From owner-svn-src-head@freebsd.org Sun Aug 5 01:28:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2C4105B2D7; Sun, 5 Aug 2018 01:28:17 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E83C171BDD; Sun, 5 Aug 2018 01:28:16 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 03D3C1CCC9; Sun, 5 Aug 2018 01:28:15 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Sat, 4 Aug 2018 18:28:13 -0700 From: Ben Widawsky To: Warner Losh Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337157 - in head: . tools/tools/git Message-ID: <20180805012813.otoixfzbq4arecyi@smtp.freebsd.org> Mail-Followup-To: Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808021828.w72IS2ts055984@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 01:28:17 -0000 On 18-08-04 19:36:11, Warner Losh wrote: > > > On Sat, Aug 4, 2018, 7:11 PM Eitan Adler wrote: > > On Sat, 4 Aug 2018 at 10:16, Warner Losh wrote: > > > > > > > > On Sat, Aug 4, 2018, 6:08 PM Eitan Adler wrote: > >> > >> On Thu, 2 Aug 2018 at 11:28, Ben Widawsky wrote: > >> > +git_checkout() > >> > +{ > >> > +       # Delete master > >> > +       ${GIT} branch -D master > >> > + > >> > +       # Make master really be trunk > >> > +       ${GIT} checkout -b master trunk > >> > >> Can't this be git branch --force master trunk ? > > > > > > No. That won't work. We do not want to change the location of master. > This will reset it to trunk, which is nearly always wrong. > > See this: > > ${GIT} branch -D master > ${GIT} checkout -b master trunk > > For clarity I'd expect something closer to: > > git branch --force master trunk > git checkout master > > The end result is the same, but IMHO this is clearer in intent. > > > Oh, that... yes, you may be right. There is another script that it would be > wrong in, but not this one... > > Warner > LGTM. Thanks. To me, --force is a little more advanced usage, but I agree this is a more direct approach. Would one of you mind updating the wiki so that the two sources match (maybe also have the wiki point to this script)? I am currently unable to register for a wiki account. I've added you both as reviewers: https://reviews.freebsd.org/D16593 From owner-svn-src-head@freebsd.org Sun Aug 5 02:02:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6760B105D144; Sun, 5 Aug 2018 02:02:51 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1AA773671; Sun, 5 Aug 2018 02:02:50 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w7522nYf094392 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Aug 2018 19:02:49 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w7522nZ8094391; Sat, 4 Aug 2018 19:02:49 -0700 (PDT) (envelope-from jmg) Date: Sat, 4 Aug 2018 19:02:49 -0700 From: John-Mark Gurney To: Kristof Provost Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336221 - head/sys/net Message-ID: <20180805020249.GL2884@funkthat.com> Mail-Followup-To: John-Mark Gurney , Kristof Provost , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807121635.w6CGZZAN046919@repo.freebsd.org> <20180803230405.GI420@FreeBSD.org> <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sat, 04 Aug 2018 19:02:49 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 02:02:51 -0000 Kristof Provost wrote this message on Sat, Aug 04, 2018 at 12:49 +0200: > On 4 Aug 2018, at 1:04, Gleb Smirnoff wrote: > > On Thu, Jul 12, 2018 at 04:35:35PM +0000, Kristof Provost wrote: > > K> Author: kp > > K> Date: Thu Jul 12 16:35:35 2018 > > K> New Revision: 336221 > > K> URL: https://svnweb.freebsd.org/changeset/base/336221 > > K> > > K> Log: > > K> pf: Increate default state table size > > K> > > K> The typical system now has a lot more memory than when pf was > > new, and is also > > K> expected to handle more connections. Increase the default size of > > the state > > K> table. > > K> Note that users can overrule this using 'set limit states' in > > pf.conf. > > K> > > K> From OpenBSD: > > K> The year is 2018. > > K> Mercury, Bowie, Cash, Motorola and DEC all left us. > > K> Just pf still has a default state table limit of 10000. > > K> Had! Now it's a tiny little bit more, 100k. > > K> lead guitar: me > > K> ok chorus: phessler theo claudio benno > > K> background school girl laughing: bob > > > > For FreeBSD it would also make sense to bump hash sizes along with > > this change. > > > Yeah, Olivier did some benchmarking work around this: > https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md > > He found a roughly 10% increase in throughput by increasing the hash > size to 256K. > I???ve been thinking about making the hash size dynamically configurable > (so we could calculate it based in the state limit, rather than expect > users to tune this manually), but that???s probably not going to get > done any time soon. Yes, this would be best... Also, tests on non-amd64 hardware would be good as well... > I???ll see about increasing the default (although perhaps not to 256K, > because if my math is right that???s cost us ~20MB of memory) soon, > because that???s mostly a quick win. I can see a default of maybe 64k (giving an average of just under 2 per bucket). IMO if you have that busy of a firewall, some tuning should be expected. Also, I don't know the hash used, but another option is to use a non-power of 2 hash... Increasing the memory required on smaller systems and not making sure it's documented how to save that memory is a bad idea... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sun Aug 5 01:43:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B06105C125 for ; Sun, 5 Aug 2018 01:43:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-21.consmr.mail.ne1.yahoo.com (sonic314-21.consmr.mail.ne1.yahoo.com [66.163.189.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFF6372A42 for ; Sun, 5 Aug 2018 01:43:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: bfNZTK0VM1lI10gvYze9ogMRLOirhlBV5MCIgU_MMRwp9zy1Cd5bXXLH9dLe1Oq sFtrp8RDruRSJvdATAg5GzVQjPSTTxUHWDXQb6cU1.qgkIhPlpDRGlqNxdYvL.n751pSgivfJ4hr Gtv3Q6Q4xcX4NJzv2Mhuyhxz73cSBjfgi7NOjO0arUIgWd5Oj_8e88fN2Gehqgviw4qJe1m5dA6c paIg6FQygqJkpDw77My377ERIBD6ZqrXo_SSKl6YDs6TvVZ0eSU9bS_pJkvkZoHt5ySXutt9lgSK rXBmSKpq2AbuIWcCG4.YnIyrYOC2WJKZzb.7ZfpiHzFLp13zqDNN8DMJQTZnpM8axdh3oUvbB9ZF 7gKN.qJVEv.ZjqJOjr5guNHACMsr4KoeTo2XHLOGZQC8qX2x_OT5Bk_oP3YVoixSTlk7pspl2lhe eYiERz9PIrePx0Zdtc46dbATOx4YxHb.y7n4o2e3jlCd8t0n6GDQy4Zo6qZNSg8SxqC43Qfiq5h. 4SnAYN0wCHUuww5ILCmJEKwhKTD.VD5RxXPuvwKPKufwUYoQugNfmqpW1sFKX.zxK0rwpxD2CuAU akdPK4XoLRSDL6TbNalxcCZEY1j27lQnzSjQUJgUCzLov6d6QkZa9nyAEVnHRXbut9CRDRP7vvvW 2973DkpJRqpohghCUXFnNYtCbrtRX9E1VVzomqWMZFxT_aStNmvmvfU9WsR_Q73FI6kkB7eHGADc 1xA2sWKaT2O5kg0mJyhjtmKmgG_ZfCUNOcTt.BNgAbiGHQVwsizqoaMCyUOYstaoC2C74F1WwkJB 5Kag4x1M7J66OtOpkYU2Pq3CSAmFMOytuclvTcZRE78uCvNh5.HXwSitqRJeEG91xdOxvOUheu6o OO6NgW0kIYwJHggXEIzQ_I7BmPKGxCj01CIiq6VBQpCEjwl.8l_mpzII23.feimBUPSP2Z.WZNMl cWau1vBW_YoEF64D89Xja_9exa7qcv1aILBSHP1_Hq8Y6XP0JRceVhzoWSatZ5WBfd.IUucjOrGY zMtNXOA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 5 Aug 2018 01:43:49 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp429.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2d7c009c47561ee545d08c6daa458d8b; Sun, 05 Aug 2018 01:43:48 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337340 - in head: [This broke all ci.freebsd.org 's FreeBSD-head-*-build 's, clang based and gcc 4.2.1 based] Message-Id: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> Date: Sat, 4 Aug 2018 18:43:46 -0700 To: brd@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 01:43:56 -0000 > Author: brd > Date: Sat Aug 4 22:41:17 2018 > New Revision: 337340 > URL:=20 > https://svnweb.freebsd.org/changeset/base/337340 >=20 >=20 > Log: > Move autofs related configs to usr.sbin/autofs/ > =20 > This is prep for pkgbase to have config files tagged as such. > =20 > Approved by: will (mentor) > Differential Revision:=09 > https://reviews.freebsd.org/D16492 . . . This broke all the ci.freebsd.org builds of freebsd-head-*-build . Using FreeBSD-head-powerpc64-build as an example: #6826 (for -r337399 ) worked but #6827 (for -r337400 ) fails with: (cd /usr/src/etc; make -DDB_FROM_SRC __MAKE_CONF=3D/dev/null = SRCCONF=3D/workspace/freebsd-ci/jobs/FreeBSD-head-powerpc64-build/src.conf= etc-examples) cd /usr/src/etc; install -N /usr/src/etc -o root -g wheel -m 444 = crontab devd.conf devfs.conf ddb.conf dhclient.conf disktab fbtab = gettytab group hosts hosts.allow hosts.equiv libalias.conf = libmap.conf login.access login.conf mac.conf motd netconfig = networks newsyslog.conf nsswitch.conf phones profile protocols = rc.bsdextended rc.firewall remote rpc services sysctl.conf = syslog.conf termcap.small etc.powerpc/ttys amd.map auto_master ftpusers = inetd.conf /usr/src/usr.bin/locate/locate/locate.rc hosts.lpd printcap = /usr/src/usr.bin/mail/misc/mail.rc ntp.conf pf.os rc.sendmail csh.cshrc = csh.login csh.logout regdomain.xml nsmb.conf opieaccess = /usr/obj/usr/src/powerpc.powerpc64/release/dist/base/usr/share/examples/et= c install: auto_master: No such file or directory *** Error code 71 Stop. make[8]: stopped in /usr/src/etc *** Error code 1 Stop. make[7]: stopped in /usr/src/share/examples *** Error code 1 Stop. make[6]: stopped in /usr/src/share/examples *** Error code 1 Stop. make[5]: stopped in /usr/src/share *** Error code 1 Stop. make[4]: stopped in /usr/src *** Error code 1 Stop. make[3]: stopped in /usr/src *** Error code 1 Stop. make[2]: stopped in /usr/src *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src/release =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sun Aug 5 02:41:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF687105F277 for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5593A74DD1 for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id w11-v6so8226501iob.2 for ; Sat, 04 Aug 2018 19:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=CA3rJaYUIAQWcyDpn7yDG5zprgSNl0tBmt1kNvB4ga0lFmScfgQWmNmdOlpoy+V4RT HDK56suwuzhyZPDDeMKGe9FYmdU1nHiPx4e0oTbL067BkFIyL1GDPXczJbSxCYMXd2wX 3Vb7AX4XFerrv7/dEx8YQb6iax+Tm7SnU3fpSBAGiEdcIFlmJBB1Ag6l82tqZcottjIn 2LEUypiXA3Co1XQbls3q8CIqRFDAZxxi1fNIYzS73jU8/BpCRGt+VLBXTotmy8Id+wsJ RKadv2sxiVAfucv8o6jOTJOK/psDFBeUrHvkY77omDU71N32p0nhMbKF1Z7kCMbPNz6k Dgsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=SZcIi9Y8Du/EIocHfK9lc4f3+EuzFoM9TXYqytigSHr7nUczUWa0pwEkeSVWt9uyn1 qufVTw+7LduZSBuD5qRiMVP41vYsLroeOzBEyYDVzUsz0KDjKKrGpzgGf5ImGp8/cv17 /qVzwH2RZBPRdyZ0opvPNCjLWXPAwzbODJZNe3PuKYvLLUi+AaYqm536eWcMAI1AYvi+ f40DVSGwj2H0m9NqA9aoXEj5JS0G18NYk17E21YRD9v9hLh3lZhcJDLUfHeq1DW/Yotx oHblKitAEzZ8/qlRNgIY1keQxMFsGMnS/puuOatO+2DEFk042LwUqvDzPnb3H2OiC4I0 RQnw== X-Gm-Message-State: AOUpUlEWp0h6miQupKczg/yfrkHmc0M4HUyNm8t2p9UoZUY8tJskDdKe 0KGbTFV7nUeSAzpxnGoavO4ZIE4FH6rKEuUcqij6qx5EIsbVOQ== X-Google-Smtp-Source: AA+uWPzmrx2NC1CMHRrWltrzZK24oCDHWgNiaVuUwza5vIQin6TzJ9p85vyK8/M8ergJ3a2p4ACpKF38RgVonwhPGtE= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr10942135ioa.168.1533436878188; Sat, 04 Aug 2018 19:41:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Sat, 4 Aug 2018 19:41:17 -0700 (PDT) X-Originating-IP: [86.153.210.77] In-Reply-To: References: <201808042208.w74M8OmD057603@repo.freebsd.org> From: Warner Losh Date: Sat, 4 Aug 2018 20:41:17 -0600 X-Google-Sender-Auth: FneHxHEE--m4n3_OlVEGuN48a9I Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 02:41:20 -0000 On Sat, Aug 4, 2018 at 5:01 PM, Warner Losh wrote: > > > On Sat, Aug 4, 2018, 11:48 PM Conrad Meyer wrote: > >> If not stale, it was inaccurate as-is. It seems to be used by a bunch >> of different clock-related drivers and routines, e.g., >> >> $ rg '(tz_minuteswest|tz_dst|utc_offset)' | wc -l >> 36 >> > > Right. Nothings sets it any more though and hasn't in 30 years. Adjkerntz > is what is used today. The other code was left for still lingering legacy > uses in the early 1990s... > Amplifying a bit, This was introduced around 4.2BSD, along with a compiled in default TIMEZONE to replace the older ftime from Version 7 which itself was an improvement on Verison 6's gtime routines (etc, there's been a lot of churn in this area unlike 'open' or 'read'). It was used by localtime() to offset the system time by this value to get local time. You could compile it into the kernel, or set it with date -t. troff also used it in one place. Otherwise, the kernel just provided an interface for userland to get this value (gettimeofday) and set it (settimeofday). This continued in 4.3BSD pretty much the same. Then in 4.4BSD David Olson's TZ stuff went in, and it became obsolete (so with FreeBSD 1.0). NetBSD has eliminated the variable, and returns 0's. This is what I'm advocating that FreeBSD do. phk introduced utc_offset() in r62962 (12 years ago) to consolidate people doing the adjkerntz stuff all over the tree. As part of this work, he moved tz_minuteswest and tz_dsttime from sys/kernel.h to sys/clock.h. This itself is an earlier cleanup which broke part tz into tz_minueswest and tz_dsttime in r110299 (15 years ago). This appears to have been inspired by getting them out from under Giant. tz itself originated with the 4.4 import at the dawn of the project. Why phk didn't just delete them at any number of these weigh points, I can only speculate. They were kinda sorta in use in FreeBSD since early days for various RTC things. TIMEZONE (from 4.x BSD days) was eliminated from config in 1995 by dg with the introduction of adjkerntz which was supposed to be controlling for this offset. This is a longer way of saying, we can kill it, along with way too much historical detail. Warner From owner-svn-src-head@freebsd.org Sun Aug 5 03:48:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE76610620AB; Sun, 5 Aug 2018 03:48:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.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 7CF3477ADB; Sun, 5 Aug 2018 03:48:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E914B21F52; Sat, 4 Aug 2018 23:48:25 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute5.internal (MEProxy); Sat, 04 Aug 2018 23:48:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=iCKfgL tGJiEwwIpPMi2CeJU6jZ48KU10VQGHMONsC5M=; b=D7yr0iLlhlzwxu5thceA4Z MlDF+wdaYxoSjTmdPSOyeQzqy8eD8haFMhkKckXhBsOznUylY3A62tcC94CKlNeQ Gy4nQ96/XGQ/F6XggwvrDAA44PxzGBRpmm2JDkVWUUvzaGZMjWtxLLQrgh/43GwK HPjF3K6GqI1Dq3Np+5VxhvJZTUaY5YRrqaDFV3OoeMRqOKmcBNu3dNYtJyEfEhjX HndXzHdxVIxFGOhLwcENVD3fpYpgY2H/1oV7qMwOb8mIQE741Kjlc0N6MM9a3H6b JoJz5SUoaMveNI3K1p4/fXE7V0plTdshUTAD2fCZ0uXnKoNSuwEEl0f5M0ZpbO7w == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 9591D940F9; Sat, 4 Aug 2018 23:48:25 -0400 (EDT) Message-Id: <1533440905.3685975.1463736920.33544EA8@webmail.messagingengine.com> From: Brad Davis To: Mark Millard , svn-src-head@freebsd.org, FreeBSD Current MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-2be8cd1b Date: Sat, 04 Aug 2018 21:48:25 -0600 In-Reply-To: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> Subject: Re: svn commit: r337340 - in head: [This broke all ci.freebsd.org 's FreeBSD-head-*-build 's, clang based and gcc 4.2.1 based] References: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 03:48:27 -0000 On Sat, Aug 4, 2018, at 7:43 PM, Mark Millard wrote: > > Author: brd > > Date: Sat Aug 4 22:41:17 2018 > > New Revision: 337340 > > URL: > > https://svnweb.freebsd.org/changeset/base/337340 > > > > > > Log: > > Move autofs related configs to usr.sbin/autofs/ > > > > This is prep for pkgbase to have config files tagged as such. > > > > Approved by: will (mentor) > > Differential Revision: > > https://reviews.freebsd.org/D16492 > . . . > > This broke all the ci.freebsd.org builds of freebsd-head-*-build . > > Using FreeBSD-head-powerpc64-build as an example: > #6826 (for -r337399 ) worked but #6827 (for -r337400 ) > fails with: > > (cd /usr/src/etc; make -DDB_FROM_SRC __MAKE_CONF=/dev/null SRCCONF=/ > workspace/freebsd-ci/jobs/FreeBSD-head-powerpc64-build/src.conf etc- > examples) > cd /usr/src/etc; install -N /usr/src/etc -o root -g wheel -m 444 > crontab devd.conf devfs.conf ddb.conf dhclient.conf disktab fbtab > gettytab group hosts hosts.allow hosts.equiv libalias.conf > libmap.conf login.access login.conf mac.conf motd netconfig > networks newsyslog.conf nsswitch.conf phones profile protocols > rc.bsdextended rc.firewall remote rpc services sysctl.conf > syslog.conf termcap.small etc.powerpc/ttys amd.map auto_master ftpusers > inetd.conf /usr/src/usr.bin/locate/locate/locate.rc hosts.lpd printcap / > usr/src/usr.bin/mail/misc/mail.rc ntp.conf pf.os rc.sendmail csh.cshrc > csh.login csh.logout regdomain.xml nsmb.conf opieaccess /usr/obj/usr/ > src/powerpc.powerpc64/release/dist/base/usr/share/examples/etc > install: auto_master: No such file or directory > *** Error code 71 > > Stop. > make[8]: stopped in /usr/src/etc > *** Error code 1 > > > > Stop. > make[7]: stopped in /usr/src/share/examples > *** Error code 1 > > Stop. > make[6]: stopped in /usr/src/share/examples > *** Error code 1 > > Stop. > make[5]: stopped in /usr/src/share > *** Error code 1 > > Stop. > make[4]: stopped in /usr/src > *** Error code 1 > > Stop. > make[3]: stopped in /usr/src > *** Error code 1 > > Stop. > make[2]: stopped in /usr/src > *** Error code 1 > > Stop. > make[1]: stopped in /usr/src > *** Error code 1 > > Stop. > make: stopped in /usr/src/release Testing the fix.. Regards, Brad Davis From owner-svn-src-head@freebsd.org Sun Aug 5 04:20:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F059A106327C; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7FA478F21; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891BF194BC; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w754Kqc3049088; Sun, 5 Aug 2018 04:20:52 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w754Kqx8049087; Sun, 5 Aug 2018 04:20:52 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808050420.w754Kqx8049087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 5 Aug 2018 04:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337342 - head/etc X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 337342 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 04:20:53 -0000 Author: brd Date: Sun Aug 5 04:20:52 2018 New Revision: 337342 URL: https://svnweb.freebsd.org/changeset/base/337342 Log: Fix build after r337340. Approved by: will (mentor) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Aug 5 04:16:00 2018 (r337341) +++ head/etc/Makefile Sun Aug 5 04:20:52 2018 (r337342) @@ -70,10 +70,6 @@ BSM_ETC_DIR= ${DESTDIR}/etc/security BIN1+= amd.map .endif -.if ${MK_AUTOFS} != "no" -BIN1+= auto_master -.endif - .if ${MK_FTP} != "no" BIN1+= ftpusers .endif From owner-svn-src-head@freebsd.org Sun Aug 5 03:07:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7387C106072A; Sun, 5 Aug 2018 03:07:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2911764E0; Sun, 5 Aug 2018 03:07:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf1-x42d.google.com with SMTP id y10-v6so5174429pfn.8; Sat, 04 Aug 2018 20:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QMYu2QjsH/Nr7T3jkdX4Iv6e/VJnz2rtT8obP21KwzE=; b=eooKi8qTccFNMX792D/YXHaKKl0h209P+J70h2PeJt9pAV4G6X30bY5S3AyyazY2mu AVL4ALMV5v2RQj/uoDdWoNzPWnU9cnTWh9G2RXd0KaLZHE9rYfGfnhPdVsp8FU/Y48HL anCjU716frCXbqqTQsqEgQhrgc4Io5q8TNVv2af7x08dk/zSp53giKCPcs6spEj5AbpC cRuwIZ1vi8/QTlr36pQwLlphMmlJQBKJ7F3k9Tpz+0RbxqvIQfJplwWfEDWUufGGIAnB xxs1iMyfqkmLmvp2/O8Gq3eL8jBSOWvZPpW7TWnIbqoUhHuZs0/7Cuqk14mje8uCcIno VK5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QMYu2QjsH/Nr7T3jkdX4Iv6e/VJnz2rtT8obP21KwzE=; b=PJdClcHOGjRPtUCeLnI33qlESP8wB9hAv0h6ZUq+LDLOlLjIo2vXF0/TBi2KwzF0uV O174iKbqsMhiAx8EKV17qgQtiq/UtLAbI9EdiWwC0QIrfer0Rq8tvfWhZokeJQ0TfGjw aFvNabxoxM9L1Rcj3lhdBlxXy0H8SOp72eR/0uGk9sWZ6T8QksdzwCvL35bAkcJOopGk FHhfEunuWjSeBW/TkSLnl9wU3W3VS4LMwZ5xGBm9Z2FNW7oo6PWxQwAMUnM646kaxDLY dKcTXwbceyXZteAFvHcAVallNtXUCdul/MCYyYsN9uSgg37H5Mw8N4iFxvbP0kHNItv+ JaLA== X-Gm-Message-State: AOUpUlEPVcFUOh63IMCjZ1p53Bfl1CLvLvatRa8FQCtuVSoKvL4pxou8 jD4rYvyT+yUQkH3VRQKJvQC5PZEW X-Google-Smtp-Source: AAOMgpfU5KghA/DI+Ih1Rem7xouOIGyIMBhSx8BjfTt6uLEZPx6QsLI+n+G7eSSSEry8YEKqkD8X+A== X-Received: by 2002:a65:6551:: with SMTP id a17-v6mr9589204pgw.132.1533438462665; Sat, 04 Aug 2018 20:07:42 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id g5-v6sm5262390pfc.77.2018.08.04.20.07.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 20:07:41 -0700 (PDT) Sender: Mark Johnston Date: Sat, 4 Aug 2018 23:07:36 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337328 - in head/sys: kern sys Message-ID: <20180805030736.GA20016@raichu> References: <201808042026.w74KQt6V006467@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808042026.w74KQt6V006467@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 03:07:44 -0000 On Sat, Aug 04, 2018 at 08:26:55PM +0000, Mark Johnston wrote: > Author: markj > Date: Sat Aug 4 20:26:54 2018 > New Revision: 337328 > URL: https://svnweb.freebsd.org/changeset/base/337328 > > Log: > Don't check rcv sockbuf limits when sending on a unix stream socket. > > sosend_generic() performs an initial comparison of the amount of data > (including control messages) to be transmitted with the send buffer > size. When transmitting on a unix socket, we then compare the amount > of data being sent with the amount of space in the receive buffer size; > if insufficient space is available, sbappendcontrol() returns an error > and the data is lost. This is easily triggered by sending control > messages together with an amount of data roughly equal to the send > buffer size, since the control message size may change in uipc_send() > as file descriptors are internalized. > > Fix the problem by removing the space check in sbappendcontrol(), > whose only consumer is the unix sockets code. The stream sockets code > uses the SB_STOP mechanism to ensure that senders will block if the > receive buffer fills up. > > PR: 181741 > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D16515 Sorry, I forgot: Tested by: jbeich, pho From owner-svn-src-head@freebsd.org Sun Aug 5 04:24:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E6C210634CE; Sun, 5 Aug 2018 04:24:06 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 E433079305; Sun, 5 Aug 2018 04:24:05 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9C15D39A; Sun, 5 Aug 2018 00:23:57 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute5.internal (MEProxy); Sun, 05 Aug 2018 00:23:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=NObFLc wr2+VxPXTEgPxVTLQ9ym1p4TKzggq0r6z8hZ0=; b=GknqKOxXCmLjszReYrXcZ2 73BhUd80+VhahGne7wY7FoKHO/WyWqmeaCUHTcx/kJZhPRn+ApCKf1feoZv9GtDn GIiLLSzqCveMwO8taf4jmZGjVzn5FbsH1pUOlT6o4YqhqDnG3wD6bmUxjCCnUSeb w/eKVvA2fkx+GE2dz9PlMQ9MEQrYRRCCYogDfDHXDcbcobu+2GHf0LuLnQ55iNPT 94EH25Gb/yx6kS/wPam/XymWm7b/psGCbygaYdAFwCHgUnbP85X30XgvE36IuNZt fwqyOpoAk27z8kTogDHbcMf+3x8GoncwuiESn3ZiQ8QO3TCRKZtM4b6Z9LQK7kNQ == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id B4738940F9; Sun, 5 Aug 2018 00:23:56 -0400 (EDT) Message-Id: <1533443036.3693802.1463750088.3A1F4538@webmail.messagingengine.com> From: Brad Davis To: Mark Millard , svn-src-head@freebsd.org, FreeBSD Current MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-2be8cd1b References: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> <1533440905.3685975.1463736920.33544EA8@webmail.messagingengine.com> Date: Sat, 04 Aug 2018 22:23:56 -0600 In-Reply-To: <1533440905.3685975.1463736920.33544EA8@webmail.messagingengine.com> Subject: Re: svn commit: r337340 - in head: [This broke all ci.freebsd.org 's FreeBSD-head-*-build 's, clang based and gcc 4.2.1 based] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 04:24:06 -0000 On Sat, Aug 4, 2018, at 9:48 PM, Brad Davis wrote: > On Sat, Aug 4, 2018, at 7:43 PM, Mark Millard wrote: > > > Author: brd > > > Date: Sat Aug 4 22:41:17 2018 > > > New Revision: 337340 > > > URL: > > > https://svnweb.freebsd.org/changeset/base/337340 > > > > > > > > > Log: > > > Move autofs related configs to usr.sbin/autofs/ > > > > > > This is prep for pkgbase to have config files tagged as such. > > > > > > Approved by: will (mentor) > > > Differential Revision: > > > https://reviews.freebsd.org/D16492 > > . . . > > > > This broke all the ci.freebsd.org builds of freebsd-head-*-build . > > > > Using FreeBSD-head-powerpc64-build as an example: > > #6826 (for -r337399 ) worked but #6827 (for -r337400 ) > > fails with: > > > > (cd /usr/src/etc; make -DDB_FROM_SRC __MAKE_CONF=/dev/null SRCCONF=/ > > workspace/freebsd-ci/jobs/FreeBSD-head-powerpc64-build/src.conf etc- > > examples) > > cd /usr/src/etc; install -N /usr/src/etc -o root -g wheel -m 444 > > crontab devd.conf devfs.conf ddb.conf dhclient.conf disktab fbtab > > gettytab group hosts hosts.allow hosts.equiv libalias.conf > > libmap.conf login.access login.conf mac.conf motd netconfig > > networks newsyslog.conf nsswitch.conf phones profile protocols > > rc.bsdextended rc.firewall remote rpc services sysctl.conf > > syslog.conf termcap.small etc.powerpc/ttys amd.map auto_master ftpusers > > inetd.conf /usr/src/usr.bin/locate/locate/locate.rc hosts.lpd printcap / > > usr/src/usr.bin/mail/misc/mail.rc ntp.conf pf.os rc.sendmail csh.cshrc > > csh.login csh.logout regdomain.xml nsmb.conf opieaccess /usr/obj/usr/ > > src/powerpc.powerpc64/release/dist/base/usr/share/examples/etc > > install: auto_master: No such file or directory > > *** Error code 71 > > > > Stop. > > make[8]: stopped in /usr/src/etc > > *** Error code 1 > > > > > > > > Stop. > > make[7]: stopped in /usr/src/share/examples > > *** Error code 1 > > > > Stop. > > make[6]: stopped in /usr/src/share/examples > > *** Error code 1 > > > > Stop. > > make[5]: stopped in /usr/src/share > > *** Error code 1 > > > > Stop. > > make[4]: stopped in /usr/src > > *** Error code 1 > > > > Stop. > > make[3]: stopped in /usr/src > > *** Error code 1 > > > > Stop. > > make[2]: stopped in /usr/src > > *** Error code 1 > > > > Stop. > > make[1]: stopped in /usr/src > > *** Error code 1 > > > > Stop. > > make: stopped in /usr/src/release > > Testing the fix.. Fix committed in r337342. Sorry for the noise. Regards, Brad Davis From owner-svn-src-head@freebsd.org Sun Aug 5 06:08:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B6DC1067C8D; Sun, 5 Aug 2018 06:08:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5E0C7D9C9; Sun, 5 Aug 2018 06:08:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6FB81A655; Sun, 5 Aug 2018 06:08:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7568NDW003563; Sun, 5 Aug 2018 06:08:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7568NtA003562; Sun, 5 Aug 2018 06:08:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050608.w7568NtA003562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337344 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337344 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 06:08:24 -0000 Author: manu Date: Sun Aug 5 06:08:23 2018 New Revision: 337344 URL: https://svnweb.freebsd.org/changeset/base/337344 Log: arm: allwinner: Remove old unused clocks Remove the old clocks for allwinner as now all the SoCs have been converted to clkng. The only old clock now is the gmac clock which still lives under the /clocks dts node. Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Aug 5 04:40:13 2018 (r337343) +++ head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:08:23 2018 (r337344) @@ -38,23 +38,7 @@ arm/allwinner/a10_hdmiaudio.c optional hdmi sound arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard -arm/allwinner/clk/aw_ahbclk.c standard -arm/allwinner/clk/aw_apbclk.c standard -arm/allwinner/clk/aw_axiclk.c standard -arm/allwinner/clk/aw_codecclk.c standard -arm/allwinner/clk/aw_cpuclk.c standard -arm/allwinner/clk/aw_cpusclk.c standard -arm/allwinner/clk/aw_debeclk.c standard -arm/allwinner/clk/aw_gate.c standard arm/allwinner/clk/aw_gmacclk.c standard -arm/allwinner/clk/aw_hdmiclk.c standard -arm/allwinner/clk/aw_lcdclk.c standard -arm/allwinner/clk/aw_modclk.c standard -arm/allwinner/clk/aw_mmcclk.c standard -arm/allwinner/clk/aw_oscclk.c standard -arm/allwinner/clk/aw_pll.c standard -arm/allwinner/clk/aw_thsclk.c standard -arm/allwinner/clk/aw_usbclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard From owner-svn-src-head@freebsd.org Sun Aug 5 06:10:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCE61067E45; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6230F7DBBD; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44B561A65A; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756AEwS003705; Sun, 5 Aug 2018 06:10:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756AEVR003704; Sun, 5 Aug 2018 06:10:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050610.w756AEVR003704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337345 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337345 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 06:10:14 -0000 Author: manu Date: Sun Aug 5 06:10:13 2018 New Revision: 337345 URL: https://svnweb.freebsd.org/changeset/base/337345 Log: arm: allwinner: Disconnect A10/A20 HDMI driver It doesn't work since 2 years when we stopped patching DTS. The DTS now have the correct bindings but they are a lot different from our hacked ones we used to have (and more representative of the reality). Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:08:23 2018 (r337344) +++ head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:10:13 2018 (r337345) @@ -32,10 +32,6 @@ arm/allwinner/aw_thermal.c standard dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev -arm/allwinner/a10_fb.c optional vt -arm/allwinner/a10_hdmi.c optional hdmi -arm/allwinner/a10_hdmiaudio.c optional hdmi sound - arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard arm/allwinner/clk/aw_gmacclk.c standard From owner-svn-src-head@freebsd.org Sun Aug 5 06:15:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C6E71068155; Sun, 5 Aug 2018 06:15:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E637E090; Sun, 5 Aug 2018 06:15:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6CA31A7FA; Sun, 5 Aug 2018 06:15:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756FZgI008811; Sun, 5 Aug 2018 06:15:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756FZcn008810; Sun, 5 Aug 2018 06:15:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050615.w756FZcn008810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337346 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 337346 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 06:15:36 -0000 Author: manu Date: Sun Aug 5 06:15:35 2018 New Revision: 337346 URL: https://svnweb.freebsd.org/changeset/base/337346 Log: extres: clkdiv: Fix div_with_table We didn't allowed a divider register value of 0 which can exists and also didn't wrote the value but the divider, which result of a wrong frequency to be selected Modified: head/sys/dev/extres/clk/clk_div.c Modified: head/sys/dev/extres/clk/clk_div.c ============================================================================== --- head/sys/dev/extres/clk/clk_div.c Sun Aug 5 06:10:13 2018 (r337345) +++ head/sys/dev/extres/clk/clk_div.c Sun Aug 5 06:15:35 2018 (r337346) @@ -97,19 +97,21 @@ clknode_div_table_get_divider(struct clknode_div_sc *s return (0); } -static uint32_t -clknode_div_table_get_value(struct clknode_div_sc *sc, uint32_t divider) +static int +clknode_div_table_get_value(struct clknode_div_sc *sc, uint32_t *divider) { struct clk_div_table *table; if (!(sc->div_flags & CLK_DIV_WITH_TABLE)) - return (divider); + return (0); for (table = sc->div_table; table->divider != 0; table++) - if (table->divider == sc->divider) - return (table->value); + if (table->divider == *divider) { + *divider = table->value; + return (0); + } - return (0); + return (ENOENT); } static int @@ -164,7 +166,7 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin { struct clknode_div_sc *sc; uint64_t divider, _fin, _fout; - uint32_t reg, i_div, f_div, hw_i_div; + uint32_t div_value, reg, i_div, f_div, hw_i_div; int rv; sc = clknode_get_softc(clk); @@ -215,9 +217,11 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin (*fout != (_fin / divider))) return (ERANGE); - divider = clknode_div_table_get_value(sc, divider); - if (divider == 0) + div_value = divider; + if (clknode_div_table_get_value(sc, &div_value) != 0) return (ERANGE); + if (div_value != divider) + i_div = div_value; DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, From owner-svn-src-head@freebsd.org Sun Aug 5 06:16:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F1A1068241; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5E27E226; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E5831A7FB; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756Gb2x008896; Sun, 5 Aug 2018 06:16:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756GbBV008895; Sun, 5 Aug 2018 06:16:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050616.w756GbBV008895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337347 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 337347 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 06:16:37 -0000 Author: manu Date: Sun Aug 5 06:16:36 2018 New Revision: 337347 URL: https://svnweb.freebsd.org/changeset/base/337347 Log: allwinner: a64: Add THS clock support The clock for the thermal sensor controller was missing when this driver was made. Modified: head/sys/arm/allwinner/clkng/ccu_a64.c Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sun Aug 5 06:15:35 2018 (r337346) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sun Aug 5 06:16:36 2018 (r337347) @@ -192,6 +192,8 @@ static struct aw_ccung_gate a64_ccu_gates[] = { CCU_GATE(CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) + CCU_GATE(CLK_THS, "ths", "thsdiv", 0x74, 31) + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) CCU_GATE(CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) CCU_GATE(CLK_USB_HSIC, "usb-hsic", "pll_hsic", 0xcc, 10) @@ -489,6 +491,22 @@ PREDIV_CLK(ahb2_clk, CLK_AHB2, /* id */ 0, 0, 2, AW_CLK_FACTOR_HAS_COND | AW_CLK_FACTOR_FIXED, /* prediv */ 0, 2, 1); /* prediv condition */ +static const char *ths_parents[] = {"osc24M"}; +static struct clk_div_table ths_div_table[] = { + { .value = 0, .divider = 1, }, + { .value = 1, .divider = 2, }, + { .value = 2, .divider = 4, }, + { .value = 3, .divider = 6, }, + { }, +}; +DIV_CLK(ths_clk, + 0, /* id */ + "thsdiv", ths_parents, /* name, parents */ + 0x74, /* offset */ + 0, 2, /* div shift, div width */ + CLK_DIV_WITH_TABLE, /* flags */ + ths_div_table); /* div table */ + static const char *mod_parents[] = {"osc24M", "pll_periph0_2x", "pll_periph1_2x"}; NM_CLK(nand_clk, CLK_NAND, "nand", mod_parents, /* id, name, parents */ @@ -725,6 +743,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_DIV, .clk.div = &axi_clk}, { .type = AW_CLK_DIV, .clk.div = &apb1_clk}, { .type = AW_CLK_DIV, .clk.div = &apb_clk}, + { .type = AW_CLK_DIV, .clk.div = &ths_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &osc12m_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph0_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph1_clk}, From owner-svn-src-head@freebsd.org Sun Aug 5 07:09:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F65106C5B3; Sun, 5 Aug 2018 07:09:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id AF03682C79; Sun, 5 Aug 2018 07:09:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 14FE0D69B89; Sun, 5 Aug 2018 17:08:58 +1000 (AEST) Date: Sun, 5 Aug 2018 17:08:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <201808042208.w74M8OmD057603@repo.freebsd.org> Message-ID: <20180805161913.C1770@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=JAFv7INFKiA87vfPrSIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 07:09:09 -0000 On Sat, 4 Aug 2018, Conrad Meyer wrote: > Log: > settimeofday(2): Remove stale note about timezone > > Contrary to the removed comment, the kernel does appear to use the timezone > argument of settimeofday. The comment dates to the BSD4.4 import; I assume it > is just stale. The kernel not only appears to use the timezone set by settimeofday(), but does use it. Applications may use it too, and adjkerntz(8) does use it. The kernel and adjkerntz also use the machdep.adjkerntz and machdep.wall_cmos_clock sysctls (these are MI but have old names for compatibility), and the final utc_offset() is: (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) adjkerntz(8) does very little when wall_cmos_clock == 0. Otherwise, it manages tz_minuteswest, but I think this is only to compensate for other applications setting it. It gets the correct offset from userland and normally just puts that in adjkerntz, leaving tz_minuteswest as 0, but if tz_minuteswest != 0 then I think it preserves this mistake but compensates for it but adjusting adjkerntz so that the final offset comes out right. The broken comment applied to both gettimeofday() and settimeofday(), and is wrongest for gettimeofday(). The kernel really does use tz_minuteswest, and gettimeofday() is the only way to determine its setting. adjkerntz makes critical use of reading it even if it doesn't change it, to compensate for the foot shooting of other applications setting it. Of course, adjkerntz can't do much if other applications set it after adjkerntz(8) runs. adjkerntz normally runs at boot time before other applications have had much chance to clobber tz_minuteswest. Then it is possible for another application to clobber it. adjkerntz might be confused when it runs about 6 months later to adjust the dst, but the time becomong wrong immediately when the other application clobbers tz_minuteswest is a larger problem. The comment was almost correct in 4.4BSD-Lite2. get/settimeofday() supported the timezone parameter, but the kernel didn't use tz_minuteswest except in the i386 inittodr() which was only called at boot time before settimeofday() can run, and in some hp code where the use seems to be read-only. > Modified: head/lib/libc/sys/gettimeofday.2 > ============================================================================== > --- head/lib/libc/sys/gettimeofday.2 Sat Aug 4 21:57:17 2018 (r337333) > +++ head/lib/libc/sys/gettimeofday.2 Sat Aug 4 22:08:24 2018 (r337334) > @@ -28,7 +28,7 @@ > .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 > .\" $FreeBSD$ > .\" > -.Dd December 27, 2015 > +.Dd August 4, 2018 > .Dt GETTIMEOFDAY 2 > .Os > .Sh NAME > @@ -44,11 +44,6 @@ > .Ft int > .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" > .Sh DESCRIPTION > -.Bf -symbolic > -Note: timezone is no longer used; this information is kept outside > -the kernel. > -.Ef > -.Pp > The system's notion of the current Greenwich time and the current time > zone is obtained with the > .Fn gettimeofday The note should have been placed after this section to more obviously cancel what this section says about time zones. This section also doesn't say anything about the wall_cmos_clock and adjkerntz sysctls or there interaction with tz_minuteswest which is what actually determines the system's notion of the current time zone. Bruce From owner-svn-src-head@freebsd.org Sun Aug 5 07:11:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A165106CC43; Sun, 5 Aug 2018 07:11:36 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 09F5583241; Sun, 5 Aug 2018 07:11:35 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w756tiEL051161 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Aug 2018 23:55:44 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w756tiUd051160; Sat, 4 Aug 2018 23:55:44 -0700 (PDT) (envelope-from sgk) Date: Sat, 4 Aug 2018 23:55:44 -0700 From: Steve Kargl To: Brad Davis Cc: Mark Millard , svn-src-head@freebsd.org, FreeBSD Current Subject: Re: svn commit: r337340 - in head: [This broke all ci.freebsd.org 's FreeBSD-head-*-build 's, clang based and gcc 4.2.1 based] Message-ID: <20180805065544.GA51139@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> <1533440905.3685975.1463736920.33544EA8@webmail.messagingengine.com> <1533443036.3693802.1463750088.3A1F4538@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533443036.3693802.1463750088.3A1F4538@webmail.messagingengine.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 07:11:36 -0000 On Sat, Aug 04, 2018 at 10:23:56PM -0600, Brad Davis wrote: > On Sat, Aug 4, 2018, at 9:48 PM, Brad Davis wrote: > > On Sat, Aug 4, 2018, at 7:43 PM, Mark Millard wrote: > > > > Author: brd > > > > Date: Sat Aug 4 22:41:17 2018 > > > > New Revision: 337340 > > > > URL: > > > > https://svnweb.freebsd.org/changeset/base/337340 > > > > > > > > > > > > Log: > > > > Move autofs related configs to usr.sbin/autofs/ > > > > > > > > This is prep for pkgbase to have config files tagged as such. > > > > > > > > Approved by: will (mentor) > > > > Differential Revision: > > > > https://reviews.freebsd.org/D16492 > > > . . . > > > > > > This broke all the ci.freebsd.org builds of freebsd-head-*-build . > > > > > > Using FreeBSD-head-powerpc64-build as an example: > > > #6826 (for -r337399 ) worked but #6827 (for -r337400 ) > > > fails with: > > > > > > (cd /usr/src/etc; make -DDB_FROM_SRC __MAKE_CONF=/dev/null SRCCONF=/ > > > workspace/freebsd-ci/jobs/FreeBSD-head-powerpc64-build/src.conf etc- > > > examples) > > > cd /usr/src/etc; install -N /usr/src/etc -o root -g wheel -m 444 > > > crontab devd.conf devfs.conf ddb.conf dhclient.conf disktab fbtab > > > gettytab group hosts hosts.allow hosts.equiv libalias.conf > > > libmap.conf login.access login.conf mac.conf motd netconfig > > > networks newsyslog.conf nsswitch.conf phones profile protocols > > > rc.bsdextended rc.firewall remote rpc services sysctl.conf > > > syslog.conf termcap.small etc.powerpc/ttys amd.map auto_master ftpusers > > > inetd.conf /usr/src/usr.bin/locate/locate/locate.rc hosts.lpd printcap / > > > usr/src/usr.bin/mail/misc/mail.rc ntp.conf pf.os rc.sendmail csh.cshrc > > > csh.login csh.logout regdomain.xml nsmb.conf opieaccess /usr/obj/usr/ > > > src/powerpc.powerpc64/release/dist/base/usr/share/examples/etc > > > install: auto_master: No such file or directory > > > *** Error code 71 > > > > > > Stop. > > > make[8]: stopped in /usr/src/etc > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > make[7]: stopped in /usr/src/share/examples > > > *** Error code 1 > > > > > > Stop. > > > make[6]: stopped in /usr/src/share/examples > > > *** Error code 1 > > > > > > Stop. > > > make[5]: stopped in /usr/src/share > > > *** Error code 1 > > > > > > Stop. > > > make[4]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[3]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[2]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[1]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make: stopped in /usr/src/release > > > > Testing the fix.. > > Fix committed in r337342. Sorry for the noise. > How was the original patch that caused the problem tested? -- Steve From owner-svn-src-head@freebsd.org Sun Aug 5 11:14:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61E9E1072DF3; Sun, 5 Aug 2018 11:14:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17ECB8BD85; Sun, 5 Aug 2018 11:14:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5EC1D837; Sun, 5 Aug 2018 11:14:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75BED00061977; Sun, 5 Aug 2018 11:14:13 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75BED7N061975; Sun, 5 Aug 2018 11:14:13 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201808051114.w75BED7N061975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 5 Aug 2018 11:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337348 - in head: share/man/man4 sys/dev/usb/input sys/modules/usb/uep X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/input sys/modules/usb/uep X-SVN-Commit-Revision: 337348 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 11:14:14 -0000 Author: wulf Date: Sun Aug 5 11:14:13 2018 New Revision: 337348 URL: https://svnweb.freebsd.org/changeset/base/337348 Log: uep(4): add evdev support To compile this driver with evdev support enabled, place following lines into the kernel configuration file: options EVDEV_SUPPORT device evdev Note: Native and evdev modes are mutually exclusive. Reviewed by: gonzo, wblock (docs) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11156 Modified: head/share/man/man4/uep.4 head/sys/dev/usb/input/uep.c head/sys/modules/usb/uep/Makefile Modified: head/share/man/man4/uep.4 ============================================================================== --- head/share/man/man4/uep.4 Sun Aug 5 06:16:36 2018 (r337347) +++ head/share/man/man4/uep.4 Sun Aug 5 11:14:13 2018 (r337348) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2010 +.Dd August 5, 2018 .Dt UEP 4 .Os .Sh NAME @@ -44,28 +44,46 @@ module at boot time, place the following line in .Bd -literal -offset indent uep_load="YES" .Ed +.Pp +To compile this driver with evdev support enabled, place the +following lines into the kernel configuration file: +.Bd -ragged -offset indent +.Cd "options EVDEV_SUPPORT" +.Cd "device evdev" +.Ed .Sh DESCRIPTION The .Nm driver provides support for the eGalax onscreen touch panels. .Pp -The driver is stub. -It just probes and attaches to USB device, creates device entry +The driver is a stub. +It just probes and attaches to USB device, creates a device entry and feeds reassembled packets from the hardware to it. +Depending on compile-time kernel options it supports either native +or evdev operation modes. .Pp -To get mouse working in -.Xr X 7 , -one needs to install +To get the mouse working in +.Xr X 7 +in native mode, install .Pa ports/x11-drivers/xf86-input-egalax . +.Pp +To get the mouse working in +.Xr X 7 +in evdev mode, install +.Pa ports/x11-drivers/xf86-input-evdev . .Sh FILES .Nm -creates a blocking pseudo\-device file, -.Pa /dev/uep0 . +creates a blocking pseudo-device file, +.Pa /dev/uep0 +in native mode or +.Pa /dev/input/eventN +in evdev mode. .Sh SEE ALSO .Xr usb 4 , .Xr loader.conf 5 , .Xr xorg.conf 5 Pq Pa ports/x11/xorg , -.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax . +.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax , +.Xr evdev 4 Pq Pa ports/x11-drivers/xf86-input-evdev . .Sh AUTHORS .An -nosplit The @@ -74,6 +92,8 @@ driver was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . .Sh BUGS .Nm -can't act like +cannot act like .Xr sysmouse 4 , -since the latter does not support absolute motion events. +as +.Xr sysmouse 4 +does not support absolute motion events. Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Sun Aug 5 06:16:36 2018 (r337347) +++ head/sys/dev/usb/input/uep.c Sun Aug 5 11:14:13 2018 (r337348) @@ -32,6 +32,8 @@ * http://www.eeti.com.tw/pdf/Software%20Programming%20Guide_v2.0.pdf */ +#include "opt_evdev.h" + #include #include #include @@ -49,9 +51,14 @@ #include #include "usbdevs.h" +#ifdef EVDEV_SUPPORT +#include +#include +#else #include #include #include +#endif #define USB_DEBUG_VAR uep_debug #include @@ -90,11 +97,15 @@ struct uep_softc { struct mtx mtx; struct usb_xfer *xfer[UEP_N_TRANSFER]; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev; +#else struct usb_fifo_sc fifo; u_int pollrate; u_int state; #define UEP_ENABLED 0x01 +#endif /* Reassembling buffer. */ u_char buf[UEP_PACKET_LEN_MAX]; @@ -107,6 +118,18 @@ static device_probe_t uep_probe; static device_attach_t uep_attach; static device_detach_t uep_detach; +#ifdef EVDEV_SUPPORT + +static evdev_open_t uep_ev_open; +static evdev_close_t uep_ev_close; + +static const struct evdev_methods uep_evdev_methods = { + .ev_open = &uep_ev_open, + .ev_close = &uep_ev_close, +}; + +#else /* !EVDEV_SUPPORT */ + static usb_fifo_cmd_t uep_start_read; static usb_fifo_cmd_t uep_stop_read; static usb_fifo_open_t uep_open; @@ -121,6 +144,7 @@ static struct usb_fifo_methods uep_fifo_methods = { .f_stop_read = &uep_stop_read, .basename[0] = "uep", }; +#endif /* !EVDEV_SUPPORT */ static int get_pkt_len(u_char *buf) @@ -154,6 +178,9 @@ static void uep_process_pkt(struct uep_softc *sc, u_char *buf) { int32_t x, y; +#ifdef EVDEV_SUPPORT + int touch; +#endif if ((buf[0] & 0xFE) != 0x80) { DPRINTF("bad input packet format 0x%.2x\n", buf[0]); @@ -186,7 +213,17 @@ uep_process_pkt(struct uep_softc *sc, u_char *buf) DPRINTFN(2, "x %u y %u\n", x, y); +#ifdef EVDEV_SUPPORT + touch = buf[0] & (1 << 0); + if (touch) { + evdev_push_abs(sc->evdev, ABS_X, x); + evdev_push_abs(sc->evdev, ABS_Y, y); + } + evdev_push_key(sc->evdev, BTN_TOUCH, touch); + evdev_sync(sc->evdev); +#else uep_put_queue(sc, buf); +#endif } static void @@ -261,12 +298,13 @@ uep_intr_callback(struct usb_xfer *xfer, usb_error_t e } case USB_ST_SETUP: tr_setup: +#ifndef EVDEV_SUPPORT /* check if we can put more data into the FIFO */ - if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) != 0) { - usbd_xfer_set_frame_len(xfer, 0, - usbd_xfer_max_len(xfer)); - usbd_transfer_submit(xfer); - } + if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) == 0) + break; +#endif + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); break; default: @@ -330,6 +368,28 @@ uep_attach(device_t dev) goto detach; } +#ifdef EVDEV_SUPPORT + sc->evdev = evdev_alloc(); + evdev_set_name(sc->evdev, device_get_desc(dev)); + evdev_set_phys(sc->evdev, device_get_nameunit(dev)); + evdev_set_id(sc->evdev, BUS_USB, uaa->info.idVendor, + uaa->info.idProduct, 0); + evdev_set_serial(sc->evdev, usb_get_serial(uaa->device)); + evdev_set_methods(sc->evdev, sc, &uep_evdev_methods); + evdev_support_prop(sc->evdev, INPUT_PROP_DIRECT); + evdev_support_event(sc->evdev, EV_SYN); + evdev_support_event(sc->evdev, EV_ABS); + evdev_support_event(sc->evdev, EV_KEY); + evdev_support_key(sc->evdev, BTN_TOUCH); + evdev_support_abs(sc->evdev, ABS_X, 0, 0, UEP_MAX_X, 0, 0, 0); + evdev_support_abs(sc->evdev, ABS_Y, 0, 0, UEP_MAX_Y, 0, 0, 0); + + error = evdev_register_mtx(sc->evdev, &sc->mtx); + if (error) { + DPRINTF("evdev_register_mtx error=%s\n", usbd_errstr(error)); + goto detach; + } +#else /* !EVDEV_SUPPORT */ error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods, &sc->fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); @@ -338,6 +398,7 @@ uep_attach(device_t dev) DPRINTF("usb_fifo_attach error=%s\n", usbd_errstr(error)); goto detach; } +#endif /* !EVDEV_SUPPORT */ sc->buf_len = 0; @@ -354,7 +415,11 @@ uep_detach(device_t dev) { struct uep_softc *sc = device_get_softc(dev); +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev); +#else usb_fifo_detach(&sc->fifo); +#endif usbd_transfer_unsetup(sc->xfer, UEP_N_TRANSFER); @@ -363,7 +428,31 @@ uep_detach(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT + static void +uep_ev_close(struct evdev_dev *evdev, void *ev_softc) +{ + struct uep_softc *sc = (struct uep_softc *)ev_softc; + + mtx_assert(&sc->mtx, MA_OWNED); + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); +} + +static int +uep_ev_open(struct evdev_dev *evdev, void *ev_softc) +{ + struct uep_softc *sc = (struct uep_softc *)ev_softc; + + mtx_assert(&sc->mtx, MA_OWNED); + usbd_transfer_start(sc->xfer[UEP_INTR_DT]); + + return (0); +} + +#else /* !EVDEV_SUPPORT */ + +static void uep_start_read(struct usb_fifo *fifo) { struct uep_softc *sc = usb_fifo_softc(fifo); @@ -424,6 +513,7 @@ uep_close(struct usb_fifo *fifo, int fflags) usb_fifo_free_buffer(fifo); } } +#endif /* !EVDEV_SUPPORT */ static devclass_t uep_devclass; @@ -442,5 +532,8 @@ static driver_t uep_driver = { DRIVER_MODULE(uep, uhub, uep_driver, uep_devclass, NULL, NULL); MODULE_DEPEND(uep, usb, 1, 1, 1); +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(uep, evdev, 1, 1, 1); +#endif MODULE_VERSION(uep, 1); USB_PNP_HOST_INFO(uep_devs); Modified: head/sys/modules/usb/uep/Makefile ============================================================================== --- head/sys/modules/usb/uep/Makefile Sun Aug 5 06:16:36 2018 (r337347) +++ head/sys/modules/usb/uep/Makefile Sun Aug 5 11:14:13 2018 (r337348) @@ -5,7 +5,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/input KMOD= uep -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ - uep.c +SRCS= opt_bus.h opt_evdev.h opt_usb.h device_if.h bus_if.h usb_if.h \ + vnode_if.h usbdevs.h uep.c .include From owner-svn-src-head@freebsd.org Sun Aug 5 11:15:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E81D41072E8D; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E0E98BF35; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4D41D84A; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75BFScG062074; Sun, 5 Aug 2018 11:15:28 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75BFSAa062073; Sun, 5 Aug 2018 11:15:28 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808051115.w75BFSAa062073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 5 Aug 2018 11:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337349 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 337349 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 11:15:29 -0000 Author: kp Date: Sun Aug 5 11:15:28 2018 New Revision: 337349 URL: https://svnweb.freebsd.org/changeset/base/337349 Log: zfsboot: Fix startup crash On a FreeNAS mini XL, with geli encrypted drives the loader crashed in geli_read(). When we iterate over the list of disks and allocate the zfsdsk structures we don’t zero out the gdev pointer. In one case that resulted in geli_read() (called on the bogus pointer) dividing by zero. Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is initialised to NULL. As a side benefit it gets rid of one #ifdef LOADER_GELI_SUPPORT. Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Aug 5 11:14:13 2018 (r337348) +++ head/stand/i386/zfsboot/zfsboot.c Sun Aug 5 11:15:28 2018 (r337349) @@ -707,10 +707,7 @@ main(void) } setheap(heap_next, heap_end); - zdsk = malloc(sizeof(struct zfsdsk)); -#ifdef LOADER_GELI_SUPPORT - zdsk->gdev = NULL; -#endif + zdsk = calloc(1, sizeof(struct zfsdsk)); zdsk->dsk.drive = *(uint8_t *)PTOV(ARGS); zdsk->dsk.type = zdsk->dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; zdsk->dsk.unit = zdsk->dsk.drive & DRV_MASK; @@ -758,7 +755,7 @@ main(void) if (!int13probe(i | DRV_HARD)) break; - zdsk = malloc(sizeof(struct zfsdsk)); + zdsk = calloc(1, sizeof(struct zfsdsk)); zdsk->dsk.drive = i | DRV_HARD; zdsk->dsk.type = zdsk->dsk.drive & TYPE_AD; zdsk->dsk.unit = i; From owner-svn-src-head@freebsd.org Sun Aug 5 11:21:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77AD1104F3C1; Sun, 5 Aug 2018 11:21:38 +0000 (UTC) (envelope-from freebsd.ed.lists@sumeritec.com) Received: from out2-4.antispamcloud.com (out2-4.antispamcloud.com [185.201.17.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013308C2C8; Sun, 5 Aug 2018 11:21:37 +0000 (UTC) (envelope-from freebsd.ed.lists@sumeritec.com) Received: from [153.92.8.106] (helo=srv31.niagahoster.com) by mx66.antispamcloud.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fmH5d-000A1r-0i; Sun, 05 Aug 2018 13:21:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sumeritec.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qLGCe9lWpUfNlZaacXvwK+BPmT7hS/A8Hvkxp3XXQhQ=; b=mzNJtefPZ0oRLKdRHfI4TlGYZ5 DAw/963Dcb1gZ2ov8Ch8shZ/pEJNRT36Jt+WbGn44GFKaZMqalkC0L6vdma+nVaNU1kan5acSFX6W krtnYeBew3YGp5Owf3Wbi2hAvwyON4fRVI2lvyAICFHtPKOLFAF3uu6X1tuUJawUPPZhnhzeqRdn4 I17wwprXw0PNVQ24FAobG6VtZzVus8RkNVK7jb/aRx9MIaYwMEgwkyPzLp+YOJDhdtYe6Fd7GZRoI a+5eJ/kVgPjlB6/KZ1R66YYPQcrdm1rOxmnWwf/h2/Nzovxej8BZIBAyM5HkP7y9ux/zZgq4E+On0 1lCRZOzA==; Received: from [114.125.101.37] (port=43703 helo=X220.sumeritec.com) by srv31.niagahoster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fmH4n-0009ta-FI; Sun, 05 Aug 2018 18:20:02 +0700 Date: Sun, 5 Aug 2018 19:19:55 +0800 From: Erich Dollansky To: Brad Davis Cc: Mark Millard , svn-src-head@freebsd.org, FreeBSD Current Subject: Re: svn commit: r337340 - in head: [This broke all ci.freebsd.org 's FreeBSD-head-*-build 's, clang based and gcc 4.2.1 based] Message-ID: <20180805191955.46d6db16.freebsd.ed.lists@sumeritec.com> In-Reply-To: <1533443036.3693802.1463750088.3A1F4538@webmail.messagingengine.com> References: <4F25D39E-88CA-420E-AE95-91A1CFFF746A@yahoo.com> <1533440905.3685975.1463736920.33544EA8@webmail.messagingengine.com> <1533443036.3693802.1463750088.3A1F4538@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-1.0 X-AuthUser: freebsd.ed.lists@sumeritec.com X-Originating-IP: 153.92.8.106 X-AntiSpamCloud-Domain: out.niagahoster.com X-AntiSpamCloud-Username: niaga Authentication-Results: antispamcloud.com; auth=pass (login) smtp.auth=niaga@out.niagahoster.com X-AntiSpamCloud-Outgoing-Class: ham X-AntiSpamCloud-Outgoing-Evidence: Combined (0.06) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5lJ//BLL5MjTvAnnmbgZKBh602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO57wQJjwUp3D71NKRnTd1MzzIxGzWn/2YAiV2nyyzfFBmfdoYyli+OTR5jAr+pjpdNqb s0Uel7l0SXX1gPoKCdWBcgPzKi1kJQuMOL/Duu8QZga396gxIYcGhwBtMkeNQUrrsUkdvVeSqv9k pCPhLZrDSxmiubF1U0WZkT01hbmk3x3XDBzmuOLeStTUqArnqlWvx4/5aan/L8AHYrKyAYNcClUc 2ezf9x33gAa3WJSJi2buHutwbyyn/XI/miKQOfO4ZPJWGqcQlqmZYLrSivNBraDkEgg+hcgXpjww IvTzM5/eIxiAxvKV2pnI83uii/gF/P40cL6DOVQpLXdIR+WE5chwy5NSxiJtgtOgA3N2hC7do/Cq BjuFWrQrLsysK22pHDwwk7Jb2vlaEyyktko/mS8xeMwQ29GzXIFExzQndCZm6kTrqH+fmxyzQoG+ NtezYqxGMqsKjARq8PBC4qg/Z3HoGVfKTN+h+/yiXEcqmdySlZou9qHIGOZDEEo7O58ZQzrOqjAE RHu4pt/Ia6wELzcGxDgkPe7eR6qspNNQErqIXcXGO2eSEQ73wW+WH/f8MkfJIjJFGJkCfEcXR+Kb jljpzcldG5bc9h0NLkX5CmpPxq5E2VdBy2iGWNQKDwEFbFmLCzFddcH94yhNq2ZbrROJppqZkLyS IzE+7ybAn81X0dmNaPuoFORFq0hnWPdjzQ6YC7Heg3Xf7O1TOd6uqwCRYte/TjpVz6McNZX7N/bn YO1EjgzzwxJl9UdVIBQoR88IeLiFYky9i5lXqx6nAPzW9Q5jSWe1G4U/pmAESf7UwiX+D6aX+xOh CKnehXTi3MRgGkVFYFPFTe6iYsHpAXnrGA4CDNa5JkRTD9kWnvpdXMQ2yA3/OGC/NFYnqXzlYOAA PLHa+qAXiAi2PdHy3deP8vNnmz84mDUvZqxnkjY4M2snSyG8qggOD3+/mIKRVsGVC0eIT0KPYErW CQNC8r9R95gC0rZhYWsQMFKR X-Report-Abuse-To: spam@quarantine1.antispamcloud.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 11:21:38 -0000 Hi, this works now but now I am back to this: Updating ./version.texi --- ./m4.info --- restore=: && backupdir=".am$$" && am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && rm -rf $backupdir && mkdir $backupdir && if (/usr/bin/makeinfo --no-split --version) >/dev/null 2>&1; then for f 2>in ./m4.info ./m4.info-[0-9] ./m4.info-[0-9][0-9] ./m4.i[0-9] ./m4.i[0-9][0-9]; 2>do if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; 2>done; else :; fi && cd "$am__cwd"; if /usr/bin/makeinfo 2>--no-split -I . -o ./m4.info ./m4.texi; then rc=0; 2>CDPATH="${ZSH_VERSION+.}:" && cd .; else rc=$?; 2>CDPATH="${ZSH_VERSION+.}:" && cd . && $restore $backupdir/* `echo 2>"././m4.info" | sed 's|[^/]*$||'`; fi; rm -rf $backupdir; exit $rc 2>Bad system call (core dumped) *** [./m4.info] Error code 140 make[4]: stopped in /usr/ports/devel/m4/work/m4-1.4.18/doc Erich On Sat, 04 Aug 2018 22:23:56 -0600 Brad Davis wrote: > On Sat, Aug 4, 2018, at 9:48 PM, Brad Davis wrote: > > On Sat, Aug 4, 2018, at 7:43 PM, Mark Millard wrote: > > > > Author: brd > > > > Date: Sat Aug 4 22:41:17 2018 > > > > New Revision: 337340 > > > > URL: > > > > https://svnweb.freebsd.org/changeset/base/337340 > > > > > > > > > > > > Log: > > > > Move autofs related configs to usr.sbin/autofs/ > > > > > > > > This is prep for pkgbase to have config files tagged as such. > > > > > > > > Approved by: will (mentor) > > > > Differential Revision: > > > > https://reviews.freebsd.org/D16492 > > > . . . > > > > > > This broke all the ci.freebsd.org builds of freebsd-head-*-build . > > > > > > Using FreeBSD-head-powerpc64-build as an example: > > > #6826 (for -r337399 ) worked but #6827 (for -r337400 ) > > > fails with: > > > > > > (cd /usr/src/etc; make -DDB_FROM_SRC __MAKE_CONF=/dev/null > > > SRCCONF=/ > > > workspace/freebsd-ci/jobs/FreeBSD-head-powerpc64-build/src.conf > > > etc- examples) cd /usr/src/etc; install -N /usr/src/etc -o root > > > -g wheel -m 444 crontab devd.conf devfs.conf ddb.conf > > > dhclient.conf disktab fbtab gettytab group hosts > > > hosts.allow hosts.equiv libalias.conf libmap.conf > > > login.access login.conf mac.conf motd netconfig networks > > > newsyslog.conf nsswitch.conf phones profile protocols > > > rc.bsdextended rc.firewall remote rpc services sysctl.conf > > > syslog.conf termcap.small etc.powerpc/ttys amd.map auto_master > > > ftpusers inetd.conf /usr/src/usr.bin/locate/locate/locate.rc > > > hosts.lpd printcap / usr/src/usr.bin/mail/misc/mail.rc ntp.conf > > > pf.os rc.sendmail csh.cshrc csh.login csh.logout regdomain.xml > > > nsmb.conf opieaccess /usr/obj/usr/ > > > src/powerpc.powerpc64/release/dist/base/usr/share/examples/etc > > > install: auto_master: No such file or directory *** Error code 71 > > > > > > Stop. > > > make[8]: stopped in /usr/src/etc > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > make[7]: stopped in /usr/src/share/examples > > > *** Error code 1 > > > > > > Stop. > > > make[6]: stopped in /usr/src/share/examples > > > *** Error code 1 > > > > > > Stop. > > > make[5]: stopped in /usr/src/share > > > *** Error code 1 > > > > > > Stop. > > > make[4]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[3]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[2]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make[1]: stopped in /usr/src > > > *** Error code 1 > > > > > > Stop. > > > make: stopped in /usr/src/release > > > > Testing the fix.. > > Fix committed in r337342. Sorry for the noise. > > > Regards, > Brad Davis > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Aug 5 13:54:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6F01053809; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311579069A; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111111F264; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75DsbRv044202; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75DsbeH044200; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808051354.w75DsbeH044200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 5 Aug 2018 13:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337350 - in head: share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: share/man/man4 sys/net X-SVN-Commit-Revision: 337350 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 13:54:38 -0000 Author: kp Date: Sun Aug 5 13:54:37 2018 New Revision: 337350 URL: https://svnweb.freebsd.org/changeset/base/337350 Log: pf: Increase default hash table size Now that we (by default) limit the number of states to 100.000 it makse sense to also adjust the default size of the hash table. Based on the benchmarking results in https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md 128K entries offers a good compromise between performance and memory use. Users may still overrule this setting with the net.pf.states_hashsize and net.pf.source_nodes_hashsize loader(8) tunables. Modified: head/share/man/man4/pf.4 head/sys/net/pfvar.h Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Sun Aug 5 11:15:28 2018 (r337349) +++ head/share/man/man4/pf.4 Sun Aug 5 13:54:37 2018 (r337350) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2013 +.Dd August 5, 2018 .Dt PF 4 .Os .Sh NAME @@ -84,11 +84,11 @@ tunables are available. .It Va net.pf.states_hashsize Size of hash tables that store states. Should be power of 2. -Default value is 32768. +Default value is 131072. .It Va net.pf.source_nodes_hashsize Size of hash table that store source nodes. Should be power of 2. -Default value is 8192. +Default value is 32768. .El .Pp Read only Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Aug 5 11:15:28 2018 (r337349) +++ head/sys/net/pfvar.h Sun Aug 5 13:54:37 2018 (r337350) @@ -1470,7 +1470,7 @@ struct pf_idhash { extern u_long pf_hashmask; extern u_long pf_srchashmask; -#define PF_HASHSIZ (32768) +#define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash); From owner-svn-src-head@freebsd.org Sun Aug 5 14:06:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8CD1053C23; Sun, 5 Aug 2018 14:06:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A22490B3B; Sun, 5 Aug 2018 14:06:34 +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)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 202DF2198C; Sun, 5 Aug 2018 14:06:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.2.164] (ptr-8rgnodu50paeznfgda2.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240b:b802:30d1:a917:bc05:823a]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 661A74154D; Sun, 5 Aug 2018 16:06:32 +0200 (CEST) From: "Kristof Provost" To: "John-Mark Gurney" Cc: "Gleb Smirnoff" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336221 - head/sys/net Date: Sun, 05 Aug 2018 16:06:30 +0200 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <20180805020249.GL2884@funkthat.com> References: <201807121635.w6CGZZAN046919@repo.freebsd.org> <20180803230405.GI420@FreeBSD.org> <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> <20180805020249.GL2884@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 14:06:34 -0000 On 5 Aug 2018, at 4:02, John-Mark Gurney wrote: > Also, I don't know the hash used, but another option is to use a > non-power of 2 hash... > I remember seeing patches someone experimented with a new hash algorithm, but I can’t seem to find it anywhere right now. I believe the patch was abandoned, perhaps because of disappointing results. > Increasing the memory required on smaller systems and not making sure > it's documented how to save that memory is a bad idea... > The relevant tuneables are documented in the pf(4) man page. Regards, Kristof From owner-svn-src-head@freebsd.org Sun Aug 5 14:22:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A001054252 for ; Sun, 5 Aug 2018 14:22:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 150F991283 for ; Sun, 5 Aug 2018 14:22:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 01b49d23-98bb-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 01b49d23-98bb-11e8-93fa-f3ebd9db2b94; Sun, 05 Aug 2018 14:22:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w75EMcJo048329; Sun, 5 Aug 2018 08:22:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533478958.9860.18.camel@freebsd.org> Subject: Re: svn commit: r337334 - head/lib/libc/sys From: Ian Lepore To: Warner Losh , "Rodney W. Grimes" Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 05 Aug 2018 08:22:38 -0600 In-Reply-To: References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 14:22:49 -0000 On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: > On Sat, Aug 4, 2018 at 4:24 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > Author: cem > > > Date: Sat Aug  4 22:08:24 2018 > > > New Revision: 337334 > > > URL: https://svnweb.freebsd.org/changeset/base/337334 > > > > > > Log: > > >   settimeofday(2): Remove stale note about timezone > > > > > >   Contrary to the removed comment, the kernel does appear to use the > > timezone > > > > > >   argument of settimeofday.  The comment dates to the BSD4.4 import; I > > assume it > > > > > >   is just stale. > > In what way is the kernel using TZ?   It shouldn't be. > > Or is it using the TZ to adjust the passed in time to UTC/GMT, > > which I would of thought is done before calling settimeofday. > > Specifically, for compatibility, we store minutes west of UTC on > settimeofday and we retrieve it for settimeofday. Otherwise it's 100% > unused by anything else at all in the system. Well, technically, we use it > for utc_offset, we don't really use that elsewhere (one can find references > in utc_offset, but usually we set this via adjkerntz, which is actively > used in the system). tz_minuteswest likely should just be removed, and the > argument to settimzeofday should just be completely ignored. > utc_offset is used by all RTC drivers, and by the convenience routines that convert times to/from FAT filesystem format (which I assume are used by FAT filesystem code, but I haven't checked that). So if the tz info passed to settimeofday() ends up in utc_offset, how can we be sure nobody is relying on that? > One could test it with date -t, nothing does that today. That should be > removed also. Likewise date -d. > > So while hyper technically, one could use this, nobody does, nor has since > between 4.3 and 4.4 when it was realized that storing the timezone in the > kernel was a really stupid idea. That's what the language used in the man > page that you removed was trying to say. > > Warner > > > > > > > > > > Modified: > > >   head/lib/libc/sys/gettimeofday.2 > > > > > > Modified: head/lib/libc/sys/gettimeofday.2 > > > ============================================================ > > ================== > > > > > > --- head/lib/libc/sys/gettimeofday.2  Sat Aug  4 21:57:17 2018 > > (r337333) > > > > > > +++ head/lib/libc/sys/gettimeofday.2  Sat Aug  4 22:08:24 2018 > > (r337334) > > > > > > @@ -28,7 +28,7 @@ > > >  .\"     @(#)gettimeofday.2   8.2 (Berkeley) 5/26/95 > > >  .\" $FreeBSD$ > > >  .\" > > > -.Dd December 27, 2015 > > > +.Dd August 4, 2018 > > >  .Dt GETTIMEOFDAY 2 > > >  .Os > > >  .Sh NAME > > > @@ -44,11 +44,6 @@ > > >  .Ft int > > >  .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" > > >  .Sh DESCRIPTION > > > -.Bf -symbolic > > > -Note: timezone is no longer used; this information is kept outside > > > -the kernel. > > > -.Ef > > > -.Pp > > >  The system's notion of the current Greenwich time and the current time > > >  zone is obtained with the > > >  .Fn gettimeofday > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > From owner-svn-src-head@freebsd.org Sun Aug 5 15:24:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E741055814 for ; Sun, 5 Aug 2018 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0C692D12 for ; Sun, 5 Aug 2018 15:24:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id d70-v6so10056150ith.1 for ; Sun, 05 Aug 2018 08:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=w1BKI0Y0TtxiNDgyKwS3GABH3mwx8MDkdcR8/sTvRAo95E1VFgQVUt+6MUY9AVmcf+ a7zuD5bAO1rQ+tP0ERRdQQn4IytMPZxlBj3mNHwB5HyDGTrT88jzDnu18DQBoSmhvu0h L0WJRM/j78XFbKasMXj7b83tBiJ26R6GclMmq4QwBznSMG9qz/JGgIBqLtYeJD1hoxVE b9eQPaymas7MMFVlC3P6kHp2KTIp2+Ipk7coh1IZ1QYtRBLrX5YT2tlcS6tNLJWaCZfh BSjZ2Prs0L51xW1ttD1M6xTn91nLNe22stpr3mAmcpNuVTdAun4NN5RDNBflLZnBNMhH XoRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=EUvMvihwAPscrej7p3TdTtdX5DU8Mm5KR+QS9cD5egJwpHpyna/0qeZQm/6W7cR+DZ YVvw2djPmxACg8nzZ9IrkNvZpjtKTEgGUuoUql6t15V7cg1O758wq36+fmrQ8pUJzYxc BrTj1hannaKSRiim2DORXm1nYUtIbkVTSxM8f/vSEhzRZtObctLWGrOwjrmco1Q8x96Z N015DMXoEKYcWHPr4kYSdtHWrrWMdpXaApw+XZMtAoyhfshPsgf//PtnabUAquHLSxtT 2D1Uqp0nBjp0JEfM9It820dDYhK+inuKCsT+5Wv2WNvwn9/T1HosYptxt9P0Bz+GzMSR D9Eg== X-Gm-Message-State: AOUpUlH9ugHEY5SQeIzZHMYyJvlnD+t70OwBw2ZcZWQXZfdxPf/W6V5x +HWt62+QNpQioAzpuESHf++zeu/MEH108TS/MNsK2A== X-Google-Smtp-Source: AAOMgpcXns3FsAB3wxipbRw4HXW2sNYHa3RVB1v9rkEG0/oce+PIOgP8DoStgLkbupDpkZtaIRJCLdH5/Nl3PVD2hpA= X-Received: by 2002:a02:3344:: with SMTP id k4-v6mr10291860jak.45.1533482676535; Sun, 05 Aug 2018 08:24:36 -0700 (PDT) MIME-Version: 1.0 References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> In-Reply-To: <1533478958.9860.18.camel@freebsd.org> From: Warner Losh Date: Sun, 5 Aug 2018 16:24:23 +0100 Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: Ian Lepore Cc: "Rodney W. Grimes" , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 15:24:38 -0000 On Sun, Aug 5, 2018, 3:22 PM Ian Lepore wrote: > On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: > > On Sat, Aug 4, 2018 at 4:24 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > Author: cem > > > > Date: Sat Aug 4 22:08:24 2018 > > > > New Revision: 337334 > > > > URL: https://svnweb.freebsd.org/changeset/base/337334 > > > > > > > > Log: > > > > settimeofday(2): Remove stale note about timezone > > > > > > > > Contrary to the removed comment, the kernel does appear to use the > > > timezone > > > > > > > > argument of settimeofday. The comment dates to the BSD4.4 import; > I > > > assume it > > > > > > > > is just stale. > > > In what way is the kernel using TZ? It shouldn't be. > > > Or is it using the TZ to adjust the passed in time to UTC/GMT, > > > which I would of thought is done before calling settimeofday. > > > > Specifically, for compatibility, we store minutes west of UTC on > > settimeofday and we retrieve it for settimeofday. Otherwise it's 100% > > unused by anything else at all in the system. Well, technically, we use > it > > for utc_offset, we don't really use that elsewhere (one can find > references > > in utc_offset, but usually we set this via adjkerntz, which is actively > > used in the system). tz_minuteswest likely should just be removed, and > the > > argument to settimzeofday should just be completely ignored. > > > > utc_offset is used by all RTC drivers, and by the convenience routines > that convert times to/from FAT filesystem format (which I assume are > used by FAT filesystem code, but I haven't checked that). So if the tz > info passed to settimeofday() ends up in utc_offset, how can we be sure > nobody is relying on that? > Nobody is setting that. No one else still preserves this info. It was obsoleted in BSD 4.4 with the introduction of the Olsen TZ code. I'd be highly surprised if some set this given we have no rc knob for it. It's completely undocumented. The only code that might use it is IBCS, but even that is doubtful... everybody has transitioned to the documented adjkerntz interface for that stuff. So while in theory someone might, I really doubt it given the history and what other systems are doing. Warner > One could test it with date -t, nothing does that today. That should be > > removed also. Likewise date -d. > > > > So while hyper technically, one could use this, nobody does, nor has > since > > between 4.3 and 4.4 when it was realized that storing the timezone in the > > kernel was a really stupid idea. That's what the language used in the man > > page that you removed was trying to say. > > > > Warner > > > > > > > > > > > > > > > Modified: > > > > head/lib/libc/sys/gettimeofday.2 > > > > > > > > Modified: head/lib/libc/sys/gettimeofday.2 > > > > ============================================================ > > > ================== > > > > > > > > --- head/lib/libc/sys/gettimeofday.2 Sat Aug 4 21:57:17 2018 > > > (r337333) > > > > > > > > +++ head/lib/libc/sys/gettimeofday.2 Sat Aug 4 22:08:24 2018 > > > (r337334) > > > > > > > > @@ -28,7 +28,7 @@ > > > > .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd December 27, 2015 > > > > +.Dd August 4, 2018 > > > > .Dt GETTIMEOFDAY 2 > > > > .Os > > > > .Sh NAME > > > > @@ -44,11 +44,6 @@ > > > > .Ft int > > > > .Fn settimeofday "const struct timeval *tp" "const struct timezone > *tzp" > > > > .Sh DESCRIPTION > > > > -.Bf -symbolic > > > > -Note: timezone is no longer used; this information is kept outside > > > > -the kernel. > > > > -.Ef > > > > -.Pp > > > > The system's notion of the current Greenwich time and the current > time > > > > zone is obtained with the > > > > .Fn gettimeofday > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > From owner-svn-src-head@freebsd.org Sun Aug 5 18:19:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8E710596CA; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9FF97CA0; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4593421C19; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75IJfmr077116; Sun, 5 Aug 2018 18:19:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75IJfwi077115; Sun, 5 Aug 2018 18:19:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051819.w75IJfwi077115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 18:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337353 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337353 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 18:19:42 -0000 Author: tsoome Date: Sun Aug 5 18:19:40 2018 New Revision: 337353 URL: https://svnweb.freebsd.org/changeset/base/337353 Log: loader: cstyle cleanup for biosdisk.c Also switch u_int to uint32_t. Also replace "write" by "dowrite". No functional changes intended. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 14:36:12 2018 (r337352) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:19:40 2018 (r337353) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); /* * BIOS disk device handling. - * + * * Ideas and algorithms from: * * - NetBSD libi386/biosdisk.c @@ -50,20 +50,20 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libi386.h" -#define BIOS_NUMDRIVES 0x475 -#define BIOSDISK_SECSIZE 512 -#define BUFSIZE (1 * BIOSDISK_SECSIZE) +#define BIOS_NUMDRIVES 0x475 +#define BIOSDISK_SECSIZE 512 +#define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ -#define WDMAJOR 0 /* major numbers for devices we frontend for */ -#define WFDMAJOR 1 -#define FDMAJOR 2 -#define DAMAJOR 4 +#define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ +#define WDMAJOR 0 /* major numbers for devices we frontend for */ +#define WFDMAJOR 1 +#define FDMAJOR 2 +#define DAMAJOR 4 #ifdef DISK_DEBUG -# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) +#define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else -# define DEBUG(fmt, args...) +#define DEBUG(fmt, args...) #endif /* @@ -164,7 +164,7 @@ bd_init(void) * Check the BIOS equipment list for number * of fixed disks. */ - if(base == 0x80 && + if (base == 0x80 && (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) break; #endif @@ -184,7 +184,7 @@ bd_init(void) } } bcache_add_dev(nbdinfo); - return(0); + return (0); } /* @@ -207,7 +207,7 @@ bd_int13probe(struct bdinfo *bd) (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ return (0); /* skip device */ - if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ + if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ ret = 0; /* set error */ /* Convert max cyl # -> # of cylinders */ @@ -318,7 +318,7 @@ bd_print(int verbose) ret = disk_print(&dev, line, verbose); disk_close(&dev); if (ret != 0) - return (ret); + return (ret); } } return (ret); @@ -410,7 +410,7 @@ bd_ioctl(struct open_file *f, u_long cmd, void *data) switch (cmd) { case DIOCGSECTORSIZE: - *(u_int *)data = BD(dev).bd_sectorsize; + *(uint32_t *)data = BD(dev).bd_sectorsize; break; case DIOCGMEDIASIZE: *(uint64_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; @@ -432,176 +432,182 @@ bd_strategy(void *devdata, int rw, daddr_t dblk, size_ bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, - size, buf, rsize)); + return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, + buf, rsize)); } static int bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { - struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks; - int blks, rc; + struct disk_devdesc *dev = (struct disk_devdesc *)devdata; + uint64_t disk_blocks; + int blks, rc; #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - char fragbuf[BIOSDISK_SECSIZE]; - size_t fragsize; + char fragbuf[BIOSDISK_SECSIZE]; + size_t fragsize; - fragsize = size % BIOSDISK_SECSIZE; + fragsize = size % BIOSDISK_SECSIZE; #else - if (size % BD(dev).bd_sectorsize) - panic("bd_strategy: %d bytes I/O not multiple of block size", size); + if (size % BD(dev).bd_sectorsize) { + panic("bd_strategy: %d bytes I/O not multiple of block size", + size); + } #endif - DEBUG("open_disk %p", dev); + DEBUG("open_disk %p", dev); - /* - * Check the value of the size argument. We do have quite small - * heap (64MB), but we do not know good upper limit, so we check against - * INT_MAX here. This will also protect us against possible overflows - * while translating block count to bytes. - */ - if (size > INT_MAX) { - DEBUG("too large read: %zu bytes", size); - return (EIO); - } + /* + * Check the value of the size argument. We do have quite small + * heap (64MB), but we do not know good upper limit, so we check against + * INT_MAX here. This will also protect us against possible overflows + * while translating block count to bytes. + */ + if (size > INT_MAX) { + DEBUG("too large read: %zu bytes", size); + return (EIO); + } - blks = size / BD(dev).bd_sectorsize; - if (dblk > dblk + blks) - return (EIO); + blks = size / BD(dev).bd_sectorsize; + if (dblk > dblk + blks) + return (EIO); - if (rsize) - *rsize = 0; + if (rsize) + *rsize = 0; - /* Get disk blocks, this value is either for whole disk or for partition */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE returns bytes. */ - disk_blocks /= BD(dev).bd_sectorsize; - } else { - /* We should not get here. Just try to survive. */ - disk_blocks = BD(dev).bd_sectors - dev->d_offset; - } + /* + * Get disk blocks, this value is either for whole disk or for + * partition. + */ + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE returns bytes. */ + disk_blocks /= BD(dev).bd_sectorsize; + } else { + /* We should not get here. Just try to survive. */ + disk_blocks = BD(dev).bd_sectors - dev->d_offset; + } - /* Validate source block address. */ - if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) - return (EIO); + /* Validate source block address. */ + if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) + return (EIO); - /* - * Truncate if we are crossing disk or partition end. - */ - if (dblk + blks >= dev->d_offset + disk_blocks) { - blks = dev->d_offset + disk_blocks - dblk; - size = blks * BD(dev).bd_sectorsize; - DEBUG("short read %d", blks); - } + /* + * Truncate if we are crossing disk or partition end. + */ + if (dblk + blks >= dev->d_offset + disk_blocks) { + blks = dev->d_offset + disk_blocks - dblk; + size = blks * BD(dev).bd_sectorsize; + DEBUG("short read %d", blks); + } - switch (rw & F_MASK) { - case F_READ: - DEBUG("read %d from %lld to %p", blks, dblk, buf); + switch (rw & F_MASK) { + case F_READ: + DEBUG("read %d from %lld to %p", blks, dblk, buf); - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { - /* Filter out floppy controller errors */ - if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x\n", blks, dblk, - buf, rc); - } - return (EIO); - } + if (blks && (rc = bd_read(dev, dblk, blks, buf))) { + /* Filter out floppy controller errors */ + if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { + printf("read %d from %lld to %p, error: 0x%x\n", + blks, dblk, buf, rc); + } + return (EIO); + } #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - DEBUG("bd_strategy: frag read %d from %d+%d to %p", - fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE)); - if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) { - DEBUG("frag read error"); - return(EIO); - } - bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize); + DEBUG("bd_strategy: frag read %d from %d+%d to %p", + fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE)); + if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) { + DEBUG("frag read error"); + return (EIO); + } + bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize); #endif - break; - case F_WRITE : - DEBUG("write %d from %lld to %p", blks, dblk, buf); + break; + case F_WRITE : + DEBUG("write %d from %lld to %p", blks, dblk, buf); - if (blks && bd_write(dev, dblk, blks, buf)) { - DEBUG("write error"); - return (EIO); - } + if (blks && bd_write(dev, dblk, blks, buf)) { + DEBUG("write error"); + return (EIO); + } #ifdef BD_SUPPORT_FRAGS - if(fragsize) { - DEBUG("Attempted to write a frag"); - return (EIO); - } + if (fragsize) { + DEBUG("Attempted to write a frag"); + return (EIO); + } #endif - break; - default: - /* DO NOTHING */ - return (EROFS); - } + break; + default: + /* DO NOTHING */ + return (EROFS); + } - if (rsize) - *rsize = size; - return (0); + if (rsize) + *rsize = size; + return (0); } static int bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int write) + int dowrite) { - static struct edd_packet packet; + static struct edd_packet packet; - packet.len = sizeof(struct edd_packet); - packet.count = blks; - packet.off = VTOPOFF(dest); - packet.seg = VTOPSEG(dest); - packet.lba = dblk; - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - if (write) + packet.len = sizeof(struct edd_packet); + packet.count = blks; + packet.off = VTOPOFF(dest); + packet.seg = VTOPSEG(dest); + packet.lba = dblk; + v86.ctl = V86_FLAGS; + v86.addr = 0x13; /* Should we Write with verify ?? 0x4302 ? */ - v86.eax = 0x4300; - else - v86.eax = 0x4200; - v86.edx = BD(dev).bd_unit; - v86.ds = VTOPSEG(&packet); - v86.esi = VTOPOFF(&packet); - v86int(); - if (V86_CY(v86.efl)) - return (v86.eax >> 8); - return (0); + if (dowrite) + v86.eax = 0x4300; + else + v86.eax = 0x4200; + v86.edx = BD(dev).bd_unit; + v86.ds = VTOPSEG(&packet); + v86.esi = VTOPOFF(&packet); + v86int(); + if (V86_CY(v86.efl)) + return (v86.eax >> 8); + return (0); } static int bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int write) + int dowrite) { - u_int x, bpc, cyl, hd, sec; + uint32_t x, bpc, cyl, hd, sec; - bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ - x = dblk; - cyl = x / bpc; /* block # / blocks per cylinder */ - x %= bpc; /* block offset into cylinder */ - hd = x / BD(dev).bd_sec; /* offset / blocks per track */ - sec = x % BD(dev).bd_sec; /* offset into track */ + bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ + x = dblk; + cyl = x / bpc; /* block # / blocks per cylinder */ + x %= bpc; /* block offset into cylinder */ + hd = x / BD(dev).bd_sec; /* offset / blocks per track */ + sec = x % BD(dev).bd_sec; /* offset into track */ - /* correct sector number for 1-based BIOS numbering */ - sec++; + /* correct sector number for 1-based BIOS numbering */ + sec++; - if (cyl > 1023) - /* CHS doesn't support cylinders > 1023. */ - return (1); + if (cyl > 1023) { + /* CHS doesn't support cylinders > 1023. */ + return (1); + } - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - if (write) - v86.eax = 0x300 | blks; - else - v86.eax = 0x200 | blks; - v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; - v86.edx = (hd << 8) | BD(dev).bd_unit; - v86.es = VTOPSEG(dest); - v86.ebx = VTOPOFF(dest); - v86int(); - if (V86_CY(v86.efl)) - return (v86.eax >> 8); - return (0); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + if (dowrite) + v86.eax = 0x300 | blks; + else + v86.eax = 0x200 | blks; + v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; + v86.edx = (hd << 8) | BD(dev).bd_unit; + v86.es = VTOPSEG(dest); + v86.ebx = VTOPOFF(dest); + v86int(); + if (V86_CY(v86.efl)) + return (v86.eax >> 8); + return (0); } static void @@ -614,111 +620,112 @@ bd_io_workaround(struct disk_devdesc *dev) static int -bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write) +bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, + int dowrite) { - u_int x, sec, result, resid, retry, maxfer; - caddr_t p, xp, bbuf; + u_int x, sec, result, resid, retry, maxfer; + caddr_t p, xp, bbuf; - /* Just in case some idiot actually tries to read/write -1 blocks... */ - if (blks < 0) - return (-1); + /* Just in case some idiot actually tries to read/write -1 blocks... */ + if (blks < 0) + return (-1); - resid = blks; - p = dest; + resid = blks; + p = dest; - /* - * Workaround for a problem with some HP ProLiant BIOS failing to work out - * the boot disk after installation. hrs and kuriyama discovered this - * problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and discovered - * that an int13h call seems to cause a buffer overrun in the bios. The - * problem is alleviated by doing an extra read before the buggy read. It - * is not immediately known whether other models are similarly affected. - */ - if (dblk >= 0x100000000) - bd_io_workaround(dev); + /* + * Workaround for a problem with some HP ProLiant BIOS failing to work + * out the boot disk after installation. hrs and kuriyama discovered + * this problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and + * discovered that an int13h call seems to cause a buffer overrun in + * the bios. The problem is alleviated by doing an extra read before + * the buggy read. It is not immediately known whether other models + * are similarly affected. + */ + if (dblk >= 0x100000000) + bd_io_workaround(dev); - /* Decide whether we have to bounce */ - if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && - (VTOP(dest) >> 16) != (VTOP(dest + - blks * BD(dev).bd_sectorsize) >> 16))) { + /* Decide whether we have to bounce */ + if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && + (VTOP(dest) >> 16) != + (VTOP(dest + blks * BD(dev).bd_sectorsize) >> 16))) { - /* - * There is a 64k physical boundary somewhere in the - * destination buffer, or the destination buffer is above - * first 1MB of physical memory so we have to arrange a - * suitable bounce buffer. Allocate a buffer twice as large - * as we need to. Use the bottom half unless there is a break - * there, in which case we use the top half. - */ - x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; - x = min(x, (unsigned)blks); - bbuf = PTOV(V86_IO_BUFFER); - maxfer = x; /* limit transfers to bounce region size */ - } else { - bbuf = NULL; - maxfer = 0; - } + /* + * There is a 64k physical boundary somewhere in the + * destination buffer, or the destination buffer is above + * first 1MB of physical memory so we have to arrange a + * suitable bounce buffer. Allocate a buffer twice as large + * as we need to. Use the bottom half unless there is a break + * there, in which case we use the top half. + */ + x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; + x = min(x, (unsigned)blks); + bbuf = PTOV(V86_IO_BUFFER); + maxfer = x; /* limit transfers to bounce region size */ + } else { + bbuf = NULL; + maxfer = 0; + } - while (resid > 0) { - /* - * Play it safe and don't cross track boundaries. - * (XXX this is probably unnecessary) - */ - sec = dblk % BD(dev).bd_sec; /* offset into track */ - x = min(BD(dev).bd_sec - sec, resid); - if (maxfer > 0) - x = min(x, maxfer); /* fit bounce buffer */ + while (resid > 0) { + /* + * Play it safe and don't cross track boundaries. + * (XXX this is probably unnecessary) + */ + sec = dblk % BD(dev).bd_sec; /* offset into track */ + x = min(BD(dev).bd_sec - sec, resid); + if (maxfer > 0) + x = min(x, maxfer); /* fit bounce buffer */ - /* where do we transfer to? */ - xp = bbuf == NULL ? p : bbuf; + /* where do we transfer to? */ + xp = bbuf == NULL ? p : bbuf; - /* - * Put your Data In, Put your Data out, - * Put your Data In, and shake it all about - */ - if (write && bbuf != NULL) - bcopy(p, bbuf, x * BD(dev).bd_sectorsize); + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + if (dowrite && bbuf != NULL) + bcopy(p, bbuf, x * BD(dev).bd_sectorsize); - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } + /* + * Loop retrying the operation a couple of times. The BIOS + * may also retry. + */ + for (retry = 0; retry < 3; retry++) { + /* if retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0; + v86.edx = BD(dev).bd_unit; + v86int(); + } - if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, write); - else - result = bd_chs_io(dev, dblk, x, xp, write); - if (result == 0) - break; - } + if (BD(dev).bd_flags & BD_MODEEDD1) + result = bd_edd_io(dev, dblk, x, xp, write); + else + result = bd_chs_io(dev, dblk, x, xp, write); + if (result == 0) + break; + } - if (write) - DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, - p, VTOP(p), dblk, result ? "failed" : "ok"); - else - DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, - dblk, p, VTOP(p), result ? "failed" : "ok"); - if (result) { - return (result); + if (dowrite) + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); + else + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); + if (result) { + return (result); + } + if (!dowrite && bbuf != NULL) + bcopy(bbuf, p, x * BD(dev).bd_sectorsize); + p += (x * BD(dev).bd_sectorsize); + dblk += x; + resid -= x; } - if (!write && bbuf != NULL) - bcopy(bbuf, p, x * BD(dev).bd_sectorsize); - p += (x * BD(dev).bd_sectorsize); - dblk += x; - resid -= x; - } -/* hexdump(dest, (blks * BD(dev).bd_sectorsize)); */ - return(0); + return (0); } static int @@ -753,15 +760,15 @@ uint32_t bd_getbigeom(int bunit) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; - v86.edx = 0x80 + bunit; - v86int(); - if (V86_CY(v86.efl)) - return 0x4f010f; - return ((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) | - (v86.edx & 0xff00) | (v86.ecx & 0x3f); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x800; + v86.edx = 0x80 + bunit; + v86int(); + if (V86_CY(v86.efl)) + return (0x4f010f); + return (((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) | + (v86.edx & 0xff00) | (v86.ecx & 0x3f)); } /* @@ -773,49 +780,49 @@ bd_getbigeom(int bunit) int bd_getdev(struct i386_devdesc *d) { - struct disk_devdesc *dev; - int biosdev; - int major; - int rootdev; - char *nip, *cp; - int i, unit; + struct disk_devdesc *dev; + int biosdev; + int major; + int rootdev; + char *nip, *cp; + int i, unit; - dev = (struct disk_devdesc *)d; - biosdev = bd_unit2bios(dev->dd.d_unit); - DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); - if (biosdev == -1) /* not a BIOS device */ - return(-1); - if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, - BD(dev).bd_sectorsize) != 0) /* oops, not a viable device */ - return (-1); - else - disk_close(dev); + dev = (struct disk_devdesc *)d; + biosdev = bd_unit2bios(dev->dd.d_unit); + DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); + if (biosdev == -1) /* not a BIOS device */ + return (-1); + if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, + BD(dev).bd_sectorsize) != 0) /* oops, not a viable device */ + return (-1); + else + disk_close(dev); - if (biosdev < 0x80) { - /* floppy (or emulated floppy) or ATAPI device */ - if (bdinfo[dev->dd.d_unit].bd_type == DT_ATAPI) { - /* is an ATAPI disk */ - major = WFDMAJOR; + if (biosdev < 0x80) { + /* floppy (or emulated floppy) or ATAPI device */ + if (bdinfo[dev->dd.d_unit].bd_type == DT_ATAPI) { + /* is an ATAPI disk */ + major = WFDMAJOR; + } else { + /* is a floppy disk */ + major = FDMAJOR; + } } else { - /* is a floppy disk */ - major = FDMAJOR; + /* assume an IDE disk */ + major = WDMAJOR; } - } else { - /* assume an IDE disk */ - major = WDMAJOR; - } - /* default root disk unit number */ - unit = biosdev & 0x7f; + /* default root disk unit number */ + unit = biosdev & 0x7f; - /* XXX a better kludge to set the root disk unit number */ - if ((nip = getenv("root_disk_unit")) != NULL) { - i = strtol(nip, &cp, 0); - /* check for parse error */ - if ((cp != nip) && (*cp == 0)) - unit = i; - } + /* XXX a better kludge to set the root disk unit number */ + if ((nip = getenv("root_disk_unit")) != NULL) { + i = strtol(nip, &cp, 0); + /* check for parse error */ + if ((cp != nip) && (*cp == 0)) + unit = i; + } - rootdev = MAKEBOOTDEV(major, dev->d_slice + 1, unit, dev->d_partition); - DEBUG("dev is 0x%x\n", rootdev); - return(rootdev); + rootdev = MAKEBOOTDEV(major, dev->d_slice + 1, unit, dev->d_partition); + DEBUG("dev is 0x%x\n", rootdev); + return (rootdev); } From owner-svn-src-head@freebsd.org Sun Aug 5 18:24:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58AE310598EC; Sun, 5 Aug 2018 18:24:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F399470088; Sun, 5 Aug 2018 18:24:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C55EA21DBD; Sun, 5 Aug 2018 18:24:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75IOZ74082352; Sun, 5 Aug 2018 18:24:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75IOZhZ082351; Sun, 5 Aug 2018 18:24:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051824.w75IOZhZ082351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 18:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337354 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337354 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 18:24:36 -0000 Author: tsoome Date: Sun Aug 5 18:24:35 2018 New Revision: 337354 URL: https://svnweb.freebsd.org/changeset/base/337354 Log: loader: 337353 did miss to rename 2 write instances 2 write instances got somehow missed. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:19:40 2018 (r337353) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:24:35 2018 (r337354) @@ -702,9 +702,9 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks } if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, write); + result = bd_edd_io(dev, dblk, x, xp, dowrite); else - result = bd_chs_io(dev, dblk, x, xp, write); + result = bd_chs_io(dev, dblk, x, xp, dowrite); if (result == 0) break; } From owner-svn-src-head@freebsd.org Sun Aug 5 19:17:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C42F105B150; Sun, 5 Aug 2018 19:17:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B967389F; Sun, 5 Aug 2018 19:17:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D51E0225E2; Sun, 5 Aug 2018 19:17:07 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75JH7ht012781; Sun, 5 Aug 2018 19:17:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75JH706012780; Sun, 5 Aug 2018 19:17:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051917.w75JH706012780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 19:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337356 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337356 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 19:17:08 -0000 Author: tsoome Date: Sun Aug 5 19:17:07 2018 New Revision: 337356 URL: https://svnweb.freebsd.org/changeset/base/337356 Log: loader: bd_open() should cleanup from disk_open() error Since bd_open() does early increment for reference counter and bcache allocation, it also should undo those in case of the error. Also remove unused variables rdev, g_err. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:27:36 2018 (r337355) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 19:17:07 2018 (r337356) @@ -337,11 +337,11 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - struct disk_devdesc *dev, rdev; + struct disk_devdesc *dev; struct disk_devdesc disk; - int err, g_err; va_list ap; uint64_t size; + int rc; va_start(ap, f); dev = va_arg(ap, struct disk_devdesc *); @@ -365,6 +365,7 @@ bd_open(struct open_file *f, ...) disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; + if (disk_open(&disk, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize) == 0) { @@ -376,10 +377,17 @@ bd_open(struct open_file *f, ...) disk_close(&disk); } - err = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, + rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize); + if (rc != 0) { + BD(dev).bd_open--; + if (BD(dev).bd_open == 0) { + bcache_free(BD(dev).bd_bcache); + BD(dev).bd_bcache = NULL; + } + } - return (err); + return (rc); } static int From owner-svn-src-head@freebsd.org Sun Aug 5 19:21:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FC40105B4D4; Sun, 5 Aug 2018 19:21:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C28AC73CB0; Sun, 5 Aug 2018 19:21:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A37072264D; Sun, 5 Aug 2018 19:21:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75JLpEN014550; Sun, 5 Aug 2018 19:21:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75JLpvQ014548; Sun, 5 Aug 2018 19:21:51 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808051921.w75JLpvQ014548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 19:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337357 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 337357 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 19:21:52 -0000 Author: rmacklem Date: Sun Aug 5 19:21:50 2018 New Revision: 337357 URL: https://svnweb.freebsd.org/changeset/base/337357 Log: Copy all bits of a file handle in case there is padding in the structure. At least on x86, fhandle_t is a packed structure, so I believe an assignment will copy all the bits. However, for some current/future architectures, there might be padding in the structure that doesn't get copied via an assignment. Since NFS assumes a file handle is an opaque blob of bits that can be compared via memcmp()/bcmp(), all the bits including any padding must be copied. This patch replaces the assignments with a call to a byte copy function. Spotted during code inspection. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Aug 5 19:17:07 2018 (r337356) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Aug 5 19:21:50 2018 (r337357) @@ -3954,7 +3954,7 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, tdsc->p = p; tdsc->pf = tpf; tdsc->createva = *vap; - tdsc->fh = fh; + NFSBCOPY(&fh, &tdsc->fh, sizeof(fh)); tdsc->va = va; tdsc->dvp = dvp[i]; tdsc->done = 0; @@ -5014,7 +5014,7 @@ nfsrv_writedsrpc(fhandle_t *fhp, off_t off, int len, s error = 0; for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->off = off; tdrpc->len = len; tdrpc->nmp = *nmpp; @@ -5200,7 +5200,7 @@ nfsrv_setattrdsrpc(fhandle_t *fhp, struct ucred *cred, for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; tdrpc->inprog = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->nmp = *nmpp; tdrpc->vp = vp; tdrpc->cred = cred; @@ -5348,7 +5348,7 @@ nfsrv_setacldsrpc(fhandle_t *fhp, struct ucred *cred, for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; tdrpc->inprog = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->nmp = *nmpp; tdrpc->vp = vp; tdrpc->cred = cred; Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 5 19:17:07 2018 (r337356) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 5 19:21:50 2018 (r337357) @@ -6907,7 +6907,7 @@ nfsrv_recalloldlayout(NFSPROC_T *p) lyp->lay_stateid.seqid = 1; clientid = lyp->lay_clientid; stateid = lyp->lay_stateid; - fh = lyp->lay_fh; + NFSBCOPY(&lyp->lay_fh, &fh, sizeof(fh)); laytype = lyp->lay_type; break; } From owner-svn-src-head@freebsd.org Sun Aug 5 20:14:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D7E105CB22; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 376A675F0F; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1880C22F82; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KE866044277; Sun, 5 Aug 2018 20:14:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KE8Pu044276; Sun, 5 Aug 2018 20:14:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052014.w75KE8Pu044276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337360 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337360 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 20:14:08 -0000 Author: rmacklem Date: Sun Aug 5 20:14:07 2018 New Revision: 337360 URL: https://svnweb.freebsd.org/changeset/base/337360 Log: Add a man page that describes the setup of a pNFS service. This is a content change. Added: head/usr.sbin/nfsd/pnfsserver.4 (contents, props changed) Added: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/nfsd/pnfsserver.4 Sun Aug 5 20:14:07 2018 (r337360) @@ -0,0 +1,405 @@ +.\" Copyright (c) 2018 Rick Macklem +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 5, 2018 +.Dt PNFSSERVER 4 +.Os +.Sh NAME +.Nm pNFSserver +.Nd NFS Version 4.1 Parallel NFS Protocol Server +.Sh DESCRIPTION +A set of FreeBSD servers may be configured to provide a +.Xr pnfs 4 +service. +One FreeBSD system needs to be configured as a MetaData Server (MDS) and +at least one additional FreeBSD system needs to be configured as one or +more Data Servers (DS)s. +.Pp +These FreeBSD systems are configured to be NFSv4.1 servers, see +.Xr nfsd 8 +and +.Xr exports 5 +if you are not familiar with configuring a NFSv4.1 server. +.Sh DS server configuration +The DS(s) need to be configured as NFSv4.1 server(s), with a top level exported +directory used for storage of data files. +This directory must be owned by +.Dq root +and would normally have a mode of +.Dq 700 . +Within this directory there needs to be additional directories named +ds0,...,dsN (where N is 19 by default) also owned by +.Dq root +with mode +.Dq 700 . +These are the directories where the data files are stored. +The following command can be run by root when in the top level exported +directory to create these subdirectories. +.Bd -literal -offset indent +jot -w ds 20 0 | xargs mkdir -m 700 +.Ed +.sp +Note that +.Dq 20 +is the default and can be set to a larger value on the MDS as shown below. +.sp +The top level exported directory used for storage of data files must be +exported to the MDS with the +.Dq maproot=root sec=sys +export options so that the MDS can create entries in these subdirectories. +It must also be exported to all pNFS aware clients, but these clients do +not require the +.Dq maproot=root +export option and this directory should be exported to them with the same +options as used by the MDS to export file system(s) to the clients. +.Pp +It is possible to have multiple DSs on the same FreeBSD system, but each +of these DSs must have a separate top level exported directory used for storage +of data files and each +of these DSs must be mountable via a separate IP address. +Alias addresses can be set on the DS server system for a network +interface via +.Xr ifconfig 8 +to create these different IP addresses. +Multiple DSs on the same server may be useful when data for different file systems +on the MDS are being stored on different file system volumes on the FreeBSD +DS system. +.Sh MDS server configuration +The MDS must be a separate FreeBSD system from the FreeBSD DS system(s) and +NFS clients. +It is configured as a NFSv4.1 server with file system(s) exported to +clients. +However, the +.Dq -p +command line argument for +.Xr nfsd +is used to indicate that it is running as the MDS for a pNFS server. +.Pp +The DS(s) must all be mounted on the MDS using the following mount options: +.Bd -literal -offset indent +nfsv4,minorversion=1,soft,retrans=2 +.Ed +.sp +so that they can be defined as DSs in the +.Dq -p +option. +Normally these mounts would be entered in the +.Xr fstab 5 +on the MDS. +For example, if there are four DSs named nfsv4-data[0-3], the +.Xr fstab 5 +lines might look like: +.Bd -literal -offset +nfsv4-data0:/ /data0 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data1:/ /data1 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data2:/ /data2 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data3:/ /data3 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +.Ed +.sp +The +.Xr nfsd 8 +command line option +.Dq -p +indicates that the NFS server is a pNFS MDS and specifies what +DSs are to be used. +.br +For the above +.Xr fstab 5 +example, the +.Xr nfsd 8 +nfs_server_flags line in your +.Xr rc.conf 5 +might look like: +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0,nfsv4-data1:/data1,nfsv4-data2:/data2,nfsv4-data3:/data3" +.Ed +.sp +This example specifies that the data files should be distributed over the +four DSs and File layouts will be issued to pNFS enabled clients. +If issuing Flexible File layouts is desired for this case, setting the sysctl +.Dq vfs.nfsd.default_flexfile +non-zero in your +.Xr sysctl.conf 5 +file will make the +.Nm +do that. +.br +Alternately, this variant of +.Dq nfs_server_flags +will specify that two way mirroring is to be done, via the +.Dq -m +command line option. +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0,nfsv4-data1:/data1,nfsv4-data2:/data2,nfsv4-data3:/data3 -m 2" +.Ed +.sp +With two way mirroring, the data file for each exported file on the MDS +will be stored on two of the DSs. +When mirroring is enabled, the server will always issue Flexible File layouts. +.Pp +It is also possible to specify which DSs are to be used to store data files for +specific exported file systems on the MDS. +For example, if the MDS has exported two file systems +.Dq /export1 +and +.Dq /export2 +to clients, the following variant of +.Dq nfs_server_flags +will specify that data files for +.Dq /export1 +will be stored on nfsv4-data0 and nfsv4-data1, whereas the data files for +.Dq /export2 +will be store on nfsv4-data2 and nfsv4-data3. +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0#/export1,nfsv4-data1:/data1#/export1,nfsv4-data2:/data2#/export2,nfsv4-data3:/data3#/export2" +.Ed +.sp +This can be used by system administrators to control where data files are +stored and might be useful for control of storage use. +For this case, it may be convenient to co-locate more than one of the DSs +on the same FreeBSD server, using separate file systems on the DS system +for storage of the respective DS's data files. +If mirroring is desired for this case, the +.Dq -m +option also needs to be specified. +There must be enough DSs assigned to each exported file system on the MDS +to support the level of mirroring. +The above example would be fine for two way mirroring, but four way mirroring +would not work, since there are only two DSs assigned to each exported file +system on the MDS. +.Pp +The number of subdirectories in each DS is defined by the +.Dq vfs.nfs.dsdirsize +sysctl on the MDS. +This value can be increased from the default of 20, but only when the +.Xr nfsd 8 +is not running and after the additional ds20,... subdirectories have been +created on all the DSs. +For a service that will store a large number of files this sysctl should be +set much larger, to avoid the number of entries in a subdirectory from +getting too large. +.Sh Client mounts +Once operational, NFSv4.1 FreeBSD client mounts done with the +.Dq pnfs +option should do I/O directly on the DSs. +The clients mounting the MDS must be running the +.Xr nfscbd +daemon for pNFS to work. +Set +.Bd -literal -offset indent +nfscbd_enable="YES" +.Ed +.sp +in the +.Xr rc.conf 5 +on these clients. +Non-pNFS aware clients or NFSv3 mounts will do all I/O RPCs on the MDS, +which acts as a proxy for the appropriate DS(s). +.Sh Backing up a pNFS service +Since the data is separated from the metadata, the simple way to back up +a pNFS service is to do so from an NFS client that has the service mounted +on it. +If you back up the MDS exported file system(s) on the MDS, you must do it +in such a way that the +.Dq system +namespace extended attributes get backed up. +.Sh Handling of failed mirrored DSs +When a mirrored DS fails, it can be disabled one of three ways: +.sp +1 - The MDS detects a problem when trying to do proxy +operations on the DS. +This can take a couple of minutes +after the DS failure or network partitioning occurs. +.sp +2 - A pNFS client can report an I/O error that occurred for a DS to the MDS in +the arguments for a LayoutReturn operation. +.sp +3 - The system administrator can perform the pnfsdskill(8) command on the MDS +to disable it. If the system administrator does a pnfsdskill(8) and it fails +with ENXIO (Device not configured) that normally means the DS was already +disabled via #1 or #2. Since doing this is harmless, once a system +administrator knows that there is a problem with a mirrored DS, doing the +command is recommended. +.sp +Once a system administrator knows that a mirrored DS has malfunctioned +or has been network partitioned, they should do the following as root/su +on the MDS: +.Bd -literal -offset indent +# pnfsdskill +# umount -N +.Ed +.sp +Note that the must be the exact mounted-on path +string used when the DS was mounted on the MDS. +.Pp +Once the mirrored DS has been disabled, the pNFS service should continue to +function, but file updates will only happen on the DS(s) +that have not been disabled. Assuming two way mirroring, that implies +the one DS of the pair stored in the +.Dq pnfsd.dsfile +extended attribute for the file on the MDS, for files stored on the disabled DS. +.Pp +The next step is to clear the IP address in the +.Dq pnfsd.dsfile +extended attribute on all files on the MDS for the failed DS. +This is done so that, when the disabled DS is repaired and brought back online, +the data files on this DS will not be used, since they may be out of date. +The command that clears the IP address is +.Xr pnfsdsfile 8 +with the +.Dq -r +option. +.Bd -literal -offset +For example: +# pnfsdsfile -r nfsv4-data3 yyy.c +yyy.c: nfsv4-data2.home.rick ds0/207508569ff983350c000000ec7c0200e4c57b2e0000000000000000 0.0.0.0 ds0/207508569ff983350c000000ec7c0200e4c57b2e0000000000000000 +.Ed +.sp +replaces nfsv4-data3 with an IPv4 address of 0.0.0.0, so that nfsv4-data3 +will not get used. +.Pp +Normally this will be called within a +.Xr find 1 +command for all regular +files in the exported directory tree and must be done on the MDS. +When used with +.Xr find 1 , +you will probably also want the +.Dq -q +option so that it won't spit out the results for every file. +If the disabled/repaired DS is nfsv4-data3, the commands done on the MDS +would be: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile -q -r nfsv4-data3 {} \; +.Ed +.sp +There is a problem with the above command if the file found by +.Xr find 1 +is renamed or unlinked before the +.Xr pnfsdsfile 8 +command is done on it. +This should normally generate an error message. +A simple unlink is harmless +but a link/unlink or rename might result in the file not having been processed +under its new name. +To check that all files have their IP addresses set to 0.0.0.0 these +commands can be used (assuming the +.Xr sh 1 +shell): +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile {} \; | sed "/nfsv4-data3/!d" +.Ed +.sp +Any line(s) printed require the +.Xr pnfsdsfile 8 +with +.Dq -r +to be done again. +Once this is done, the replaced/repaired DS can be brought back online. +It should have empty ds0,...,dsN directories under the top level exported +directory for storage of data files just like it did when first set up. +Mount it on the MDS exactly as you did before disabling it. +For the nfsv4-data3 example, the command would be: +.Bd -literal -offset +# mount -t nfs -o nfsv4,minorversion=1,soft,retrans=2 nfsv4-data3:/ /data3 +.Ed +.sp +Then restart the nfsd to re-enable the DS. +.Bd -literal -offset +# /etc/rc.d/nfsd restart +.Ed +.sp +Now, new files can be stored on nfsv4-data3, +but files with the IP address zeroed out on the MDS will not yet use the +repaired DS (nfsv4-data3). +The next step is to go through the exported file tree on the MDS and, +for each of the +files with an IPv4 address of 0.0.0.0 in its extended attribute, copy the file +data to the repaired DS and re-enable use of this mirror for it. +This command for copying the file data for one MDS file is +.Xr pnfsdscopymr 8 +and it will also normally be used in a +.Xr find 1 . +For the example case, the commands on the MDS would be: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdscopymr -r /data3 {} \; +.Ed +.sp +When this completes, the recovery should be complete or at least nearly so. +As noted above, if a link/unlink or rename occurs on a file name while the +above +.Xr find 1 +is in progress, it may not get copied. +To check for any file(s) not yet copied, the commands are: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile {} \; | sed "/0\.0\.0\.0/!d" +.Ed +.sp +If this command prints out any file name(s), these files must +have the +.Xr pnfsdscopymr 8 +command done on them to complete the recovery. +.Bd -literal -offset +# pnfsdscopymr -r /data3 +.Ed +.sp +All of these commands are designed to be +done while the pNFS service is running and can be re-run safely. +.Pp +For a more detailed discussion of the setup and management of a pNFS service +see: +.Bd -literal -offset indent +http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt +.Ed +.sp +.Sh SEE ALSO +.Xr nfsv4 4 , +.Xr pnfs 4 , +.Xr exports 5 , +.Xr fstab 5 , +.Xr rc.conf 5 , +.Xr sysctl.conf 5 , +.Xr nfscbd 8 , +.Xr nfsd 8 , +.Xr nfsuserd 8 , +.Xr pnfsdscopymr 8 , +.Xr pnfsdsfile 8 , +.Xr pnfsdskill 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 12.0 . +.Sh BUGS +Since the MDS cannot be mirrored, it is a single point of failure just +as a non +.Tn pNFS +server is. +For non-mirrored configurations, all FreeBSD systems used in the service +are single points of failure. From owner-svn-src-head@freebsd.org Sun Aug 5 20:15:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5424105CBE0; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC347607D; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4671F22F83; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KFYck044383; Sun, 5 Aug 2018 20:15:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KFYIR044382; Sun, 5 Aug 2018 20:15:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052015.w75KFYIR044382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337361 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337361 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 20:15:34 -0000 Author: rmacklem Date: Sun Aug 5 20:15:33 2018 New Revision: 337361 URL: https://svnweb.freebsd.org/changeset/base/337361 Log: Add pnfsserver.4 to the Makefile for nfsd. Modified: head/usr.sbin/nfsd/Makefile Modified: head/usr.sbin/nfsd/Makefile ============================================================================== --- head/usr.sbin/nfsd/Makefile Sun Aug 5 20:14:07 2018 (r337360) +++ head/usr.sbin/nfsd/Makefile Sun Aug 5 20:15:33 2018 (r337361) @@ -2,6 +2,6 @@ # $FreeBSD$ PROG= nfsd -MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 +MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 pnfsserver.4 .include From owner-svn-src-head@freebsd.org Sun Aug 5 20:20:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DB7105CD46; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 561B076258; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3357622FA0; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KK5eT044625; Sun, 5 Aug 2018 20:20:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KK5pJ044624; Sun, 5 Aug 2018 20:20:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052020.w75KK5pJ044624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337362 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337362 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 20:20:05 -0000 Author: rmacklem Date: Sun Aug 5 20:20:04 2018 New Revision: 337362 URL: https://svnweb.freebsd.org/changeset/base/337362 Log: Update the pnfs.4 man page to reference the pnfsserver.4 man page. This is a content change. Modified: head/usr.sbin/nfsd/pnfs.4 Modified: head/usr.sbin/nfsd/pnfs.4 ============================================================================== --- head/usr.sbin/nfsd/pnfs.4 Sun Aug 5 20:15:33 2018 (r337361) +++ head/usr.sbin/nfsd/pnfs.4 Sun Aug 5 20:20:04 2018 (r337362) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2018 +.Dd August 5, 2018 .Dt PNFS 4 .Os .Sh NAME @@ -159,13 +159,11 @@ After a disabled mirrored DS is repaired, it is possib as a mirror while the pNFS service continues to function. .Pp See -.Bd -literal -offset indent -http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt -.Ed -.sp +.Xr pnfsserver 4 for information on how to set up a FreeBSD pNFS service. .Sh SEE ALSO .Xr nfsv4 4 , +.Xr pnfsserver 4 , .Xr exports 5 , .Xr fstab 5 , .Xr rc.conf 5 , From owner-svn-src-head@freebsd.org Sun Aug 5 20:36:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B407105D3F6; Sun, 5 Aug 2018 20:36:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05F9376BE7; Sun, 5 Aug 2018 20:36:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0820232B8; Sun, 5 Aug 2018 20:36:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KamvC054484; Sun, 5 Aug 2018 20:36:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KamDs054483; Sun, 5 Aug 2018 20:36:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052036.w75KamDs054483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337363 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337363 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 20:36:49 -0000 Author: rmacklem Date: Sun Aug 5 20:36:48 2018 New Revision: 337363 URL: https://svnweb.freebsd.org/changeset/base/337363 Log: Add a reference to pnfsserver.4 to the nfsd.8 man page. This is a content change. Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sun Aug 5 20:20:04 2018 (r337362) +++ head/usr.sbin/nfsd/nfsd.8 Sun Aug 5 20:36:48 2018 (r337363) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd July 27, 2018 +.Dd August 5, 2018 .Dt NFSD 8 .Os .Sh NAME @@ -313,6 +313,7 @@ just do a .Xr nfssvc 2 , .Xr nfsv4 4 , .Xr pnfs 4 , +.Xr pnfsserver 4 , .Xr exports 5 , .Xr stablerestart 5 , .Xr gssd 8 , From owner-svn-src-head@freebsd.org Sun Aug 5 22:24:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA84106090D; Sun, 5 Aug 2018 22:24:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 622B17AEE7; Sun, 5 Aug 2018 22:24:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26C512445F; Sun, 5 Aug 2018 22:24:39 +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 w75MOdO0011123; Sun, 5 Aug 2018 22:24:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75MOcw1011122; Sun, 5 Aug 2018 22:24:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201808052224.w75MOcw1011122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 5 Aug 2018 22:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337364 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 337364 X-SVN-Commit-Repository: base 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.27 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, 05 Aug 2018 22:24:39 -0000 Author: ian Date: Sun Aug 5 22:24:38 2018 New Revision: 337364 URL: https://svnweb.freebsd.org/changeset/base/337364 Log: Document 64-bit arm in terms of arch name (aarch64) not machine (arm64). Other architectures are documented in terms of the name that is displayed by 'uname -p', aka MACHINE_ARCH and TARGET_ARCH in the build system, now aarch64 matches the rest of them. PR: 220297 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun Aug 5 20:36:48 2018 (r337363) +++ head/share/man/man7/arch.7 Sun Aug 5 22:24:38 2018 (r337364) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2018 +.Dd August 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -90,13 +90,13 @@ architectures, the final release. .Pp .Bl -column -offset indent "Sy Architecture" "Sy Initial Release" "Sy Final Release" .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release +.It aarch64 Ta 11.0 .It alpha Ta 3.2 Ta 6.4 .It amd64 Ta 5.1 .It arm Ta 6.0 .It armeb Ta 8.0 Ta 11.x .It armv6 Ta 10.0 .It armv7 Ta 12.0 -.It arm64 Ta 11.0 .It ia64 Ta 5.0 Ta 10.x .It i386 Ta 1.0 .It mips Ta 8.0 @@ -162,7 +162,7 @@ Examples are: .It Dv powerpc64 Ta Dv powerpc .It Dv mips64* Ta Dv mips* .El -.Dv arm64 +.Dv aarch64 currently does not support execution of .Dv armv6 or @@ -191,10 +191,10 @@ require only 4-byte alignment for 64-bit integers. Machine-dependent type sizes: .Bl -column -offset indent "Sy Architecture" "Sy void *" "Sy long double" "Sy time_t" .It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t +.It aarch64 Ta 8 Ta 16 Ta 8 .It amd64 Ta 8 Ta 16 Ta 8 .It arm Ta 4 Ta 8 Ta 8 .It armv6 Ta 4 Ta 8 Ta 8 -.It arm64 Ta 8 Ta 16 Ta 8 .It i386 Ta 4 Ta 12 Ta 4 .It mips Ta 4 Ta 8 Ta 8 .It mipsel Ta 4 Ta 8 Ta 8 @@ -218,11 +218,11 @@ is 8 bytes on all supported architectures except i386. .Ss Endianness and Char Signedness .Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness +.It aarch64 Ta little Ta unsigned .It amd64 Ta little Ta signed .It arm Ta little Ta unsigned .It armv6 Ta little Ta unsigned .It armv7 Ta little Ta unsigned -.It arm64 Ta little Ta unsigned .It i386 Ta little Ta signed .It mips Ta big Ta signed .It mipsel Ta little Ta signed @@ -243,11 +243,11 @@ is 8 bytes on all supported architectures except i386. .Ss Page Size .Bl -column -offset indent "Sy Architecture" "Sy Page Sizes" .It Sy Architecture Ta Sy Page Sizes +.It aarch64 Ta 4K, 2M, 1G .It amd64 Ta 4K, 2M, 1G .It arm Ta 4K .It armv6 Ta 4K, 1M .It armv7 Ta 4K, 1M -.It arm64 Ta 4K, 2M, 1G .It i386 Ta 4K, 2M (PAE), 4M .It mips Ta 4K .It mipsel Ta 4K @@ -268,11 +268,11 @@ is 8 bytes on all supported architectures except i386. .Ss Floating Point .Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double" .It Sy Architecture Ta Sy float, double Ta Sy long double +.It aarch64 Ta hard Ta soft, quad precision .It amd64 Ta hard Ta hard, 80 bit .It arm Ta soft Ta soft, double precision .It armv6 Ta hard(1) Ta hard, double precision .It armv7 Ta hard(1) Ta hard, double precision -.It arm64 Ta hard Ta soft, quad precision .It i386 Ta hard Ta hard, 80 bit .It mips Ta soft Ta identical to double .It mipsel Ta soft Ta identical to double @@ -320,11 +320,11 @@ is not used on Architecture-specific macros: .Bl -column -offset indent "Sy Architecture" "Sy Predefined macros" .It Sy Architecture Ta Sy Predefined macros +.It aarch64 Ta Dv __aarch64__ .It amd64 Ta Dv __amd64__, Dv __x86_64__ .It arm Ta Dv __arm__ .It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6 .It armv7 Ta Dv __arm__, Dv __ARM_ARCH >= 7 -.It arm64 Ta Dv __aarch64__ .It i386 Ta Dv __i386__ .It mips Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32 .It mipsel Ta Dv __mips__, Dv __mips_o32 From owner-svn-src-head@freebsd.org Sun Aug 5 22:34:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF8ED1060CAA; Sun, 5 Aug 2018 22:34:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 055037B57F; Sun, 5 Aug 2018 22:34:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 4DDFC1A2061; Mon, 6 Aug 2018 08:33:58 +1000 (AEST) Date: Mon, 6 Aug 2018 08:33:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Warner Losh , "Rodney W. Grimes" , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <1533478958.9860.18.camel@freebsd.org> Message-ID: <20180806074507.E920@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6p4G4DjUgR1eRvsjZpAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 05 Aug 2018 22:34:08 -0000 On Sun, 5 Aug 2018, Ian Lepore wrote: > On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: >>> [Context lost to corruption of spaces} >> >> Specifically, for compatibility, we store minutes west of UTC on >> settimeofday and we retrieve it for settimeofday. Otherwise it's 100% >> unused by anything else at all in the system. Well, technically, we use it >> for utc_offset, we don't really use that elsewhere (one can find references >> in utc_offset, but usually we set this via adjkerntz, which is actively >> used in the system). tz_minuteswest likely should just be removed, and the >> argument to settimzeofday should just be completely ignored. I already described how adjkerntz sets both tz_minuteswest and other more cryptic variables used in utc_offset(). > utc_offset is used by all RTC drivers, and by the convenience routines > that convert times to/from FAT filesystem format (which I assume are > used by FAT filesystem code, but I haven't checked that). So if the tz > info passed to settimeofday() ends up in utc_offset, how can we be sure > nobody is relying on that? I forgot about FAT times, and only remembered that utc_offset() was used for RTC drivers. I thought that utc_offset() is 0 unless something sets the timezone to nonzero or the RTC is on local time (wall_cmos_clock case). However, since the kernel needs the timezone for FAT times, it must be known even if the RTC is on UTC time. Now I don't see how FAT times can even work unless the wall_cmos_clock. They are just the UTC minus utc_offset(), where utc_offset() is (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) Here wall_cmos_clock is only for managing the RTC offset. It must be 0 unless the RTC is on local time. But then either FAT times or RTC times must be broken except in the Greenwich meridian. Otherwise, tz_minuteswest must be nonzero to ajust FAT times right, but this makes utc_offset() unusable for the RTC offset. The timezone and setting it using settimeofday() is the correct API for implementing all of this (it only has minutes resolution, but no more is needed). The correct offsets are then: rtc_offset() = wall_cmos_clock ? tz_minuteswest * 60 : 0; fat_offset() = tz_minuteswest * 60; where tz_minuteswest must include the dst offset so it needs a daemon like adjkerntz(8) to manage it even if wall_cmos_clock == 0. I think adjkerntz already does this management, and it works in the wall_cmos_clock != 0 case (except for missing locking of all 3 of the variables, and fundamental races updating them all and also adjusting the RTC on every dst change). FAT times work in this case. I think FAT times just don't work if wall_cmos_clock == 0. I think the extra variables are to try to manage this complexity, but the just get in the way. wall_cmos_clock is obviously needed. But the extra offset can't do anything good. It might have helped on non-preemptible UP systems where locking was not needed. It allowed adjusting the offset without going near settimeofday(). But now non- broken locking would need to use the same lock for settimeofday() and the machdep.adjkerntz sysctl. It is easier to just lock settimeofday(). >> So while hyper technically, one could use this, nobody does, nor has since >> between 4.3 and 4.4 when it was realized that storing the timezone in the >> kernel was a really stupid idea. That's what the language used in the man >> page that you removed was trying to say. adjkerntz(8) uses this. Storing the timezone in the kernel is an essential idea. Otherwise, every FAT time calculation would have to call userland to ask for the timezone. Similarly for RTC offsets, except those don't need to be calculated very often. adjkerntz(8) can be simplified by only using 1 offset, but that offset should be the timezone set by settimeofday() and not a sysctl with even more broken locking. My program for demonstrating overflow bugs and panics in RTC code uses this. It could use either the timezone or machdep.adjkerntz to set a bad offset, but the timezone is easier to use. Bad offsets can be as little as 1 second, to convert the Epoch time (time_t)0 to the invalid time (time_t)-1. The program uses a timezone of +-24 hours to clobber any more reasonable offset in machdep.adjkerntz. Bruce From owner-svn-src-head@freebsd.org Mon Aug 6 00:46:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C3D1064468; Mon, 6 Aug 2018 00:46:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA5B7FAB1; Mon, 6 Aug 2018 00:46:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E104E42B63E; Mon, 6 Aug 2018 10:46:42 +1000 (AEST) Date: Mon, 6 Aug 2018 10:46:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Ian Lepore , Warner Losh , "Rodney W. Grimes" , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <20180806074507.E920@besplex.bde.org> Message-ID: <20180806095604.J860@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> <20180806074507.E920@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=IfFsZ5XXtjUjwcPZAScA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 00:46:56 -0000 On Mon, 6 Aug 2018, Bruce Evans wrote: > ... > I forgot about FAT times, and only remembered that utc_offset() was used > for RTC drivers. I thought that utc_offset() is 0 unless something sets > the timezone to nonzero or the RTC is on local time (wall_cmos_clock case). > However, since the kernel needs the timezone for FAT times, it must be > known even if the RTC is on UTC time. Now I don't see how FAT times can > even work unless the wall_cmos_clock. They are just the UTC minus > utc_offset(), where utc_offset() is > > (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) > > Here wall_cmos_clock is only for managing the RTC offset. It must be 0 > unless the RTC is on local time. But then either FAT times or RTC times > must be broken except in the Greenwich meridian. Otherwise, tz_minuteswest > must be nonzero to ajust FAT times right, but this makes utc_offset() > unusable for the RTC offset. I verified the brokenness: - adjkerntz() normally leaves tz_minuteswest as 0. I verified that it does this when there is a nonzero dst adjustment. dst adjustments are folded into machdep.adjkerntz. - when wall_cmos_clock == 0, adjkerntz(8) does little or nothing, so all adjustments are 0, so utc_offset() is 0, so FAT times are broken except in the Greenwich meridian. The broken FAT times are not completely obvious, since getting and setting them use the same wrong offset of 0, so the times appear to be correct when displayed on FreeBSD. The are only obviously wrong when displayed on another system with non-broken FAT times, perhaps by rebooting to the other system or by moving removable media to such a system. FAT times are used by other file systems. I checked this in FreeBSD-9 so as to find axed file systems. The were used by smbfs, nwfs and msdosfs. Now they are only used by msdosfs. I never liked de-deduplicating their implementation into an over-engineered version with especially excessive handling for leap years. Leap year handling is unimportant compared with offset handling. tz_minuteswest is used by compatibility code. It cannot usefully be removed from the native version, since non-native syscalls use it and non-native applications might use it. Of course, it must have a correct value to work in compatibility. Its normal value of 0 breaks compatibility code much like the bugs in utc_offset() breaks FAT time. It is used in the following compatibility code: - amd64 linux32 linux_gettimeofday(). Like native gettimeofday(). It also reconstructs the dstflag part of the timezone struct. If linux drops this, then strict compatiility requires the support to depend on the linux version. - amd64 linux32 linux_settimeofday(). Like native settimeofday(). Has invisible reference to tz_minuteswest hidden in assignment of timezones. I only grepped for tz_minuteswest and only checked this indirect reference. - freebsd32 freebsd32_gettimeofday(). Similarly, except we control it, so can avoid needing version checks by not dropping support. - dev/tws/tws_services.h. This uses utc_offset() for FreeBSD-7 and later, and its reference to tz_minuteswest is only explicit for older versions where it open-codes utc_offset() with bug for bug compatibility except for adding style bugs. - smbfs. This uses FAT times, and in nearby code it uses tzoff for the offset and has commented-out code with an open-coded fully-buggy utc_offset(). - ibcs2 xenix_ftime(). This is similar to gettimeofday(). Bruce From owner-svn-src-head@freebsd.org Mon Aug 6 01:08:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D7E51064E27; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F19D8058F; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A71425E20; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7618hZ8092372; Mon, 6 Aug 2018 01:08:43 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7618hFx092371; Mon, 6 Aug 2018 01:08:43 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201808060108.w7618hFx092371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 6 Aug 2018 01:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337365 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 337365 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 01:08:44 -0000 Author: bwidawsk Date: Mon Aug 6 01:08:43 2018 New Revision: 337365 URL: https://svnweb.freebsd.org/changeset/base/337365 Log: git-svn-init: Clarify branch creation commands Suggested by: eadler Reviewed by: eadler Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D16593 Modified: head/tools/tools/git/git-svn-init (contents, props changed) Modified: head/tools/tools/git/git-svn-init ============================================================================== --- head/tools/tools/git/git-svn-init Sun Aug 5 22:24:38 2018 (r337364) +++ head/tools/tools/git/git-svn-init Mon Aug 6 01:08:43 2018 (r337365) @@ -119,11 +119,9 @@ git_checkout() # Arrange to have 'master' reference 'trunk' ${GIT} checkout trunk - # Delete master - ${GIT} branch -D master - - # Make master really be trunk - ${GIT} checkout -b master trunk + # Make master reference trunk + ${GIT} branch --force master trunk + ${GIT} checkout master } rebase() From owner-svn-src-head@freebsd.org Mon Aug 6 05:36:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 340CA106B762; Mon, 6 Aug 2018 05:36:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD8C888E19; Mon, 6 Aug 2018 05:36:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE391A03; Mon, 6 Aug 2018 05:36:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w765a0Tu031082; Mon, 6 Aug 2018 05:36:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w765a00s031081; Mon, 6 Aug 2018 05:36:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808060536.w765a00s031081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 05:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337372 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337372 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 05:36:01 -0000 Author: manu Date: Mon Aug 6 05:36:00 2018 New Revision: 337372 URL: https://svnweb.freebsd.org/changeset/base/337372 Log: aw_thermal: Add nvmem and H5 support Now that aw_sid expose nvmem interface, use that to read the calibration data. Add support for H5 SoC. Fix the bindings, we used to have non-upstreamed bindings. Switch to the one that have been sent upstream. They are not stable yet, so we switch from custom, wrong, bindings to correct, proposed bindings Modified: head/sys/arm/allwinner/aw_thermal.c Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:35:24 2018 (r337371) +++ head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:36:00 2018 (r337372) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #define SENSOR1_EN (1 << 1) #define SENSOR0_EN (1 << 0) #define THS_INTC 0x44 +#define THS_THERMAL_PER_SHIFT 12 #define THS_INTS 0x48 #define THS2_DATA_IRQ_STS (1 << 10) #define THS1_DATA_IRQ_STS (1 << 9) @@ -92,33 +93,49 @@ __FBSDID("$FreeBSD$"); #define THS_DATA2 0x88 #define DATA_MASK 0xfff -#define A83T_ADC_ACQUIRE_TIME 0x17 -#define A83T_FILTER 0x4 -#define A83T_INTC 0x1000 +#define A83T_CLK_RATE 24000000 +#define A83T_ADC_ACQUIRE_TIME 23 /* 24Mhz/(23 + 1) = 1us */ +#define A83T_THERMAL_PER 1 /* 4096 * (1 + 1) / 24Mhz = 341 us */ +#define A83T_FILTER 0x5 /* Filter enabled, avg of 4 */ #define A83T_TEMP_BASE 2719000 #define A83T_TEMP_MUL 1000 #define A83T_TEMP_DIV 14186 -#define A83T_CLK_RATE 24000000 -#define A64_ADC_ACQUIRE_TIME 0x190 -#define A64_FILTER 0x6 -#define A64_INTC 0x18000 +#define A64_CLK_RATE 4000000 +#define A64_ADC_ACQUIRE_TIME 400 /* 4Mhz/(400 + 1) = 100 us */ +#define A64_THERMAL_PER 24 /* 4096 * (24 + 1) / 4Mhz = 25.6 ms */ +#define A64_FILTER 0x6 /* Filter enabled, avg of 8 */ #define A64_TEMP_BASE 2170000 #define A64_TEMP_MUL 1000 #define A64_TEMP_DIV 8560 -#define A64_CLK_RATE 4000000 +#define H3_CLK_RATE 4000000 #define H3_ADC_ACQUIRE_TIME 0x3f -#define H3_FILTER 0x6 -#define H3_INTC 0x191000 +#define H3_THERMAL_PER 401 +#define H3_FILTER 0x6 /* Filter enabled, avg of 8 */ #define H3_TEMP_BASE 217 #define H3_TEMP_MUL 1000 #define H3_TEMP_DIV 8253 #define H3_TEMP_MINUS 1794000 -#define H3_CLK_RATE 4000000 #define H3_INIT_ALARM 90 /* degC */ #define H3_INIT_SHUT 105 /* degC */ +#define H5_CLK_RATE 24000000 +#define H5_ADC_ACQUIRE_TIME 479 /* 24Mhz/479 = 20us */ +#define H5_THERMAL_PER 58 /* 4096 * (58 + 1) / 24Mhz = 10ms */ +#define H5_FILTER 0x6 /* Filter enabled, avg of 8 */ +#define H5_TEMP_BASE 233832448 +#define H5_TEMP_MUL 124885 +#define H5_TEMP_DIV 20 +#define H5_TEMP_BASE_CPU 271581184 +#define H5_TEMP_MUL_CPU 152253 +#define H5_TEMP_BASE_GPU 289406976 +#define H5_TEMP_MUL_GPU 166724 +#define H5_INIT_CPU_ALARM 80 /* degC */ +#define H5_INIT_CPU_SHUT 96 /* degC */ +#define H5_INIT_GPU_ALARM 84 /* degC */ +#define H5_INIT_GPU_SHUT 100 /* degC */ + #define TEMP_C_TO_K 273 #define SENSOR_ENABLE_ALL (SENSOR0_EN|SENSOR1_EN|SENSOR2_EN) #define SHUT_INT_ALL (SHUT_INT0_STS|SHUT_INT1_STS|SHUT_INT2_STS) @@ -147,9 +164,9 @@ struct aw_thermal_config { uint32_t adc_acquire_time; int adc_cali_en; uint32_t filter; - uint32_t intc; - int (*to_temp)(uint32_t); - uint32_t (*to_reg)(int); + uint32_t thermal_per; + int (*to_temp)(uint32_t, int); + uint32_t (*to_reg)(int, int); int temp_base; int temp_mul; int temp_div; @@ -158,7 +175,7 @@ struct aw_thermal_config { }; static int -a83t_to_temp(uint32_t val) +a83t_to_temp(uint32_t val, int sensor) { return ((A83T_TEMP_BASE - (val * A83T_TEMP_MUL)) / A83T_TEMP_DIV); } @@ -183,14 +200,14 @@ static const struct aw_thermal_config a83t_config = { .adc_acquire_time = A83T_ADC_ACQUIRE_TIME, .adc_cali_en = 1, .filter = A83T_FILTER, - .intc = A83T_INTC, + .thermal_per = A83T_THERMAL_PER, .to_temp = a83t_to_temp, .calib0_mask = 0xffffffff, - .calib1_mask = 0xffffffff, + .calib1_mask = 0xffff, }; static int -a64_to_temp(uint32_t val) +a64_to_temp(uint32_t val, int sensor) { return ((A64_TEMP_BASE - (val * A64_TEMP_MUL)) / A64_TEMP_DIV); } @@ -213,19 +230,22 @@ static const struct aw_thermal_config a64_config = { }, .clk_rate = A64_CLK_RATE, .adc_acquire_time = A64_ADC_ACQUIRE_TIME, + .adc_cali_en = 1, .filter = A64_FILTER, - .intc = A64_INTC, + .thermal_per = A64_THERMAL_PER, .to_temp = a64_to_temp, + .calib0_mask = 0xffffffff, + .calib1_mask = 0xffff, }; static int -h3_to_temp(uint32_t val) +h3_to_temp(uint32_t val, int sensor) { return (H3_TEMP_BASE - ((val * H3_TEMP_MUL) / H3_TEMP_DIV)); } static uint32_t -h3_to_reg(int val) +h3_to_reg(int val, int sensor) { return ((H3_TEMP_MINUS - (val * H3_TEMP_DIV)) / H3_TEMP_MUL); } @@ -242,17 +262,93 @@ static const struct aw_thermal_config h3_config = { }, .clk_rate = H3_CLK_RATE, .adc_acquire_time = H3_ADC_ACQUIRE_TIME, + .adc_cali_en = 1, .filter = H3_FILTER, - .intc = H3_INTC, + .thermal_per = H3_THERMAL_PER, .to_temp = h3_to_temp, .to_reg = h3_to_reg, - .calib0_mask = 0xfff, + .calib0_mask = 0xffff, }; +static int +h5_to_temp(uint32_t val, int sensor) +{ + int tmp; + + /* Temp is lower than 70 degrees */ + if (val > 0x500) { + tmp = H5_TEMP_BASE - (val * H5_TEMP_MUL); + tmp >>= H5_TEMP_DIV; + return (tmp); + } + + if (sensor == 0) + tmp = H5_TEMP_BASE_CPU - (val * H5_TEMP_MUL_CPU); + else if (sensor == 1) + tmp = H5_TEMP_BASE_GPU - (val * H5_TEMP_MUL_GPU); + else { + printf("Unknown sensor %d\n", sensor); + return (val); + } + + tmp >>= H5_TEMP_DIV; + return (tmp); +} + +static uint32_t +h5_to_reg(int val, int sensor) +{ + int tmp; + + if (val < 70) { + tmp = H5_TEMP_BASE - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL; + } else { + if (sensor == 0) { + tmp = H5_TEMP_BASE_CPU - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL_CPU; + } else if (sensor == 1) { + tmp = H5_TEMP_BASE_GPU - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL_GPU; + } else { + printf("Unknown sensor %d\n", sensor); + return (val); + } + } + + return ((uint32_t)tmp); +} + +static const struct aw_thermal_config h5_config = { + .nsensors = 2, + .sensors = { + [0] = { + .name = "cpu", + .desc = "CPU temperature", + .init_alarm = H5_INIT_CPU_ALARM, + .init_shut = H5_INIT_CPU_SHUT, + }, + [1] = { + .name = "gpu", + .desc = "GPU temperature", + .init_alarm = H5_INIT_GPU_ALARM, + .init_shut = H5_INIT_GPU_SHUT, + }, + }, + .clk_rate = H5_CLK_RATE, + .adc_acquire_time = H5_ADC_ACQUIRE_TIME, + .filter = H5_FILTER, + .thermal_per = H5_THERMAL_PER, + .to_temp = h5_to_temp, + .to_reg = h5_to_reg, + .calib0_mask = 0xffffffff, +}; + static struct ofw_compat_data compat_data[] = { - { "allwinner,sun8i-a83t-ts", (uintptr_t)&a83t_config }, - { "allwinner,sun8i-h3-ts", (uintptr_t)&h3_config }, - { "allwinner,sun50i-a64-ts", (uintptr_t)&a64_config }, + { "allwinner,sun8i-a83t-ths", (uintptr_t)&a83t_config }, + { "allwinner,sun8i-h3-ths", (uintptr_t)&h3_config }, + { "allwinner,sun50i-a64-ths", (uintptr_t)&a64_config }, + { "allwinner,sun50i-h5-ths", (uintptr_t)&h5_config }, { NULL, (uintptr_t)NULL } }; @@ -269,6 +365,9 @@ struct aw_thermal_softc { int min_freq; struct cf_level levels[MAX_CF_LEVELS]; eventhandler_tag cf_pre_tag; + + clk_t clk_apb; + clk_t clk_ths; }; static struct resource_spec aw_thermal_spec[] = { @@ -288,39 +387,41 @@ aw_thermal_init(struct aw_thermal_softc *sc) int error; node = ofw_bus_get_node(sc->dev); - if (sc->conf->calib0_mask != 0 || sc->conf->calib1_mask != 0) { - error = nvmem_read_cell_by_name(node, "ths_calibration", - (void *)calib, sizeof(calib)); - /* Read calibration settings from EFUSE */ - if (error != 0) { - device_printf(sc->dev, "Cannot read THS efuse\n"); - return (error); - } + if (nvmem_get_cell_len(node, "ths-calib") > sizeof(calib)) { + device_printf(sc->dev, "ths-calib nvmem cell is too large\n"); + return (ENXIO); + } + error = nvmem_read_cell_by_name(node, "ths-calib", + (void *)&calib, nvmem_get_cell_len(node, "ths-calib")); + /* Read calibration settings from EFUSE */ + if (error != 0) { + device_printf(sc->dev, "Cannot read THS efuse\n"); + return (error); + } - device_printf(sc->dev, "calib0: %x\n", calib[0]); - device_printf(sc->dev, "calib1: %x\n", calib[1]); + calib[0] &= sc->conf->calib0_mask; + calib[1] &= sc->conf->calib1_mask; - calib[0] &= sc->conf->calib0_mask; - calib[1] &= sc->conf->calib1_mask; + /* Write calibration settings to thermal controller */ + if (calib[0] != 0) + WR4(sc, THS_CALIB0, calib[0]); + if (calib[1] != 0) + WR4(sc, THS_CALIB1, calib[1]); - /* Write calibration settings to thermal controller */ - if (calib[0] != 0) - WR4(sc, THS_CALIB0, calib[0]); - if (calib[1] != 0) - WR4(sc, THS_CALIB1, calib[1]); - } - /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ WR4(sc, THS_CTRL1, ADC_CALI_EN); WR4(sc, THS_CTRL0, sc->conf->adc_acquire_time); WR4(sc, THS_CTRL2, sc->conf->adc_acquire_time << SENSOR_ACQ1_SHIFT); + /* Set thermal period */ + WR4(sc, THS_INTC, sc->conf->thermal_per << THS_THERMAL_PER_SHIFT); + /* Enable average filter */ WR4(sc, THS_FILTER, sc->conf->filter); /* Enable interrupts */ WR4(sc, THS_INTS, RD4(sc, THS_INTS)); - WR4(sc, THS_INTC, sc->conf->intc | SHUT_INT_ALL | ALARM_INT_ALL); + WR4(sc, THS_INTC, RD4(sc, THS_INTC) | SHUT_INT_ALL | ALARM_INT_ALL); /* Enable sensors */ WR4(sc, THS_CTRL2, RD4(sc, THS_CTRL2) | SENSOR_ENABLE_ALL); @@ -335,7 +436,7 @@ aw_thermal_gettemp(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_DATA0 + (sensor * 4)); - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static int @@ -346,7 +447,7 @@ aw_thermal_getshut(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4)); val = (val >> SHUT_T_HOT_SHIFT) & SHUT_T_HOT_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static void @@ -356,7 +457,7 @@ aw_thermal_setshut(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4)); val &= ~(SHUT_T_HOT_MASK << SHUT_T_HOT_SHIFT); - val |= (sc->conf->to_reg(temp) << SHUT_T_HOT_SHIFT); + val |= (sc->conf->to_reg(temp, sensor) << SHUT_T_HOT_SHIFT); WR4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4), val); } @@ -368,7 +469,7 @@ aw_thermal_gethyst(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val = (val >> ALARM_T_HYST_SHIFT) & ALARM_T_HYST_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static int @@ -379,7 +480,7 @@ aw_thermal_getalarm(struct aw_thermal_softc *sc, int s val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val = (val >> ALARM_T_HOT_SHIFT) & ALARM_T_HOT_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static void @@ -389,7 +490,7 @@ aw_thermal_setalarm(struct aw_thermal_softc *sc, int s val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val &= ~(ALARM_T_HOT_MASK << ALARM_T_HOT_SHIFT); - val |= (sc->conf->to_reg(temp) << ALARM_T_HOT_SHIFT); + val |= (sc->conf->to_reg(temp, sensor) << ALARM_T_HOT_SHIFT); WR4(sc, THS_ALARM0_CTRL + (sensor * 4), val); } @@ -506,13 +607,12 @@ static int aw_thermal_attach(device_t dev) { struct aw_thermal_softc *sc; - clk_t clk_ahb, clk_ths; hwreset_t rst; int i, error; void *ih; sc = device_get_softc(dev); - clk_ahb = clk_ths = NULL; + sc->dev = dev; rst = NULL; ih = NULL; @@ -524,25 +624,27 @@ aw_thermal_attach(device_t dev) return (ENXIO); } - if (clk_get_by_ofw_name(dev, 0, "ahb", &clk_ahb) == 0) { - error = clk_enable(clk_ahb); + if (clk_get_by_ofw_name(dev, 0, "apb", &sc->clk_apb) == 0) { + error = clk_enable(sc->clk_apb); if (error != 0) { - device_printf(dev, "cannot enable ahb clock\n"); + device_printf(dev, "cannot enable apb clock\n"); goto fail; } } - if (clk_get_by_ofw_name(dev, 0, "ths", &clk_ths) == 0) { - error = clk_set_freq(clk_ths, sc->conf->clk_rate, 0); + + if (clk_get_by_ofw_name(dev, 0, "ths", &sc->clk_ths) == 0) { + error = clk_set_freq(sc->clk_ths, sc->conf->clk_rate, 0); if (error != 0) { device_printf(dev, "cannot set ths clock rate\n"); goto fail; } - error = clk_enable(clk_ths); + error = clk_enable(sc->clk_ths); if (error != 0) { device_printf(dev, "cannot enable ths clock\n"); goto fail; } } + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { error = hwreset_deassert(rst); if (error != 0) { @@ -581,7 +683,8 @@ aw_thermal_attach(device_t dev) if (bootverbose) for (i = 0; i < sc->conf->nsensors; i++) { device_printf(dev, - "#%d: alarm %dC hyst %dC shut %dC\n", i, + "%s: alarm %dC hyst %dC shut %dC\n", + sc->conf->sensors[i].name, aw_thermal_getalarm(sc, i), aw_thermal_gethyst(sc, i), aw_thermal_getshut(sc, i)); @@ -597,10 +700,10 @@ fail: bus_teardown_intr(dev, sc->res[1], ih); if (rst != NULL) hwreset_release(rst); - if (clk_ahb != NULL) - clk_release(clk_ahb); - if (clk_ths != NULL) - clk_release(clk_ths); + if (sc->clk_apb != NULL) + clk_release(sc->clk_apb); + if (sc->clk_ths != NULL) + clk_release(sc->clk_ths); bus_release_resources(dev, aw_thermal_spec, sc->res); return (ENXIO); From owner-svn-src-head@freebsd.org Mon Aug 6 05:35:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072FD106B5EB; Mon, 6 Aug 2018 05:35:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF65488CEF; Mon, 6 Aug 2018 05:35:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90738A02; Mon, 6 Aug 2018 05:35:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w765ZPI4031012; Mon, 6 Aug 2018 05:35:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w765ZOq7031008; Mon, 6 Aug 2018 05:35:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808060535.w765ZOq7031008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 05:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337371 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337371 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 05:35:26 -0000 Author: manu Date: Mon Aug 6 05:35:24 2018 New Revision: 337371 URL: https://svnweb.freebsd.org/changeset/base/337371 Log: aw_sid: Add nvmem interface Rework aw_sid so it can work with the nvmem interface. Each SoC expose a set of fuses (for now rootkey/boardid and, if available, the thermal calibration data). A fuse can be private or public, reading private fuse needs to be done via some registers instead of reading directly. Each fuse is exposed as a sysctl. For now leave the possibility for a driver to read any fuse without using the nvmem interface as the awg and emac driver use this to generate a mac address. Modified: head/sys/arm/allwinner/aw_sid.c head/sys/arm/allwinner/aw_sid.h head/sys/arm/allwinner/aw_thermal.c head/sys/arm/allwinner/if_awg.c head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_sid.c Mon Aug 6 05:35:24 2018 (r337371) @@ -50,7 +50,12 @@ __FBSDID("$FreeBSD$"); #include -/* efuse registers */ +#include "nvmem_if.h" + +/* + * Starting at least from sun8iw6 (A83T) EFUSE starts at 0x200 + * There is 3 registers in the low area to read/write protected EFUSE. + */ #define SID_PRCTL 0x40 #define SID_PRCTL_OFFSET_MASK 0xff #define SID_PRCTL_OFFSET(n) (((n) & SID_PRCTL_OFFSET_MASK) << 16) @@ -60,61 +65,157 @@ __FBSDID("$FreeBSD$"); #define SID_PRKEY 0x50 #define SID_RDKEY 0x60 -#define SID_SRAM 0x200 -/* Offsets into efuse space, for convenience */ -#define SID_THERMAL_CALIB0_OFF (0x34) -#define SID_THERMAL_CALIB1_OFF (0x38) -#define SID_THERMAL_CALIB0 (SID_SRAM + SID_THERMAL_CALIB0_OFF) -#define SID_THERMAL_CALIB1 (SID_SRAM + SID_THERMAL_CALIB1_OFF) +#define EFUSE_OFFSET 0x200 +#define EFUSE_NAME_SIZE 32 +#define EFUSE_DESC_SIZE 64 -#define ROOT_KEY_SIZE 4 +struct aw_sid_efuse { + char name[EFUSE_NAME_SIZE]; + char desc[EFUSE_DESC_SIZE]; + bus_size_t base; + bus_size_t offset; + uint32_t size; + enum aw_sid_fuse_id id; + bool public; +}; +static struct aw_sid_efuse a10_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .offset = 0x0, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, +}; + +static struct aw_sid_efuse a64_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 6, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + +static struct aw_sid_efuse a83t_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 8, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + +static struct aw_sid_efuse h3_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 2, + .id = AW_SID_FUSE_THSSENSOR, + .public = false, + }, +}; + +static struct aw_sid_efuse h5_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 4, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + struct aw_sid_conf { - bus_size_t efuse_size; - bus_size_t rootkey_offset; - bool has_prctl; - bool has_thermal; - bool requires_prctl_read; + struct aw_sid_efuse *efuses; + size_t nfuses; }; static const struct aw_sid_conf a10_conf = { - .efuse_size = 0x10, - .rootkey_offset = 0, + .efuses = a10_efuses, + .nfuses = nitems(a10_efuses), }; static const struct aw_sid_conf a20_conf = { - .efuse_size = 0x10, - .rootkey_offset = 0, + .efuses = a10_efuses, + .nfuses = nitems(a10_efuses), }; static const struct aw_sid_conf a64_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, + .efuses = a64_efuses, + .nfuses = nitems(a64_efuses), }; static const struct aw_sid_conf a83t_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, + .efuses = a83t_efuses, + .nfuses = nitems(a83t_efuses), }; static const struct aw_sid_conf h3_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, - .requires_prctl_read = true, + .efuses = h3_efuses, + .nfuses = nitems(h3_efuses), }; +static const struct aw_sid_conf h5_conf = { + .efuses = h5_efuses, + .nfuses = nitems(h5_efuses), +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-sid", (uintptr_t)&a10_conf}, { "allwinner,sun7i-a20-sid", (uintptr_t)&a20_conf}, { "allwinner,sun50i-a64-sid", (uintptr_t)&a64_conf}, { "allwinner,sun8i-a83t-sid", (uintptr_t)&a83t_conf}, { "allwinner,sun8i-h3-sid", (uintptr_t)&h3_conf}, + { "allwinner,sun50i-h5-sid", (uintptr_t)&h5_conf}, { NULL, 0 } }; @@ -132,47 +233,13 @@ static struct resource_spec aw_sid_spec[] = { { -1, 0 } }; -enum sid_keys { - AW_SID_ROOT_KEY, -}; - +#define RD1(sc, reg) bus_read_1((sc)->res, (reg)) #define RD4(sc, reg) bus_read_4((sc)->res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) -#define PRCTL_RD4(sc, reg, val) aw_sid_prctl_read((sc)->sid_dev, (reg), (val)) - static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS); -static int aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val); - -/* - * offset here is offset into efuse space, rather than offset into sid register - * space. This form of read is only an option for newer SoC: A83t, H3, A64 - */ static int -aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val) -{ - struct aw_sid_softc *sc; - uint32_t readval; - - sc = device_get_softc(dev); - if (!sc->sid_conf->has_prctl) - return (1); - - mtx_lock(&sc->prctl_mtx); - readval = SID_PRCTL_OFFSET(offset) | SID_PRCTL_LOCK | SID_PRCTL_READ; - WR4(sc, SID_PRCTL, readval); - /* Read bit will be cleared once read has concluded */ - while (RD4(sc, SID_PRCTL) & SID_PRCTL_READ) - continue; - readval = RD4(sc, SID_RDKEY); - mtx_unlock(&sc->prctl_mtx); - *val = readval; - - return (0); -} - -static int aw_sid_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -189,7 +256,10 @@ static int aw_sid_attach(device_t dev) { struct aw_sid_softc *sc; + phandle_t node; + int i; + node = ofw_bus_get_node(dev); sc = device_get_softc(dev); sc->sid_dev = dev; @@ -202,75 +272,124 @@ aw_sid_attach(device_t dev) sc->sid_conf = (struct aw_sid_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; aw_sid_sc = sc; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rootkey", - CTLTYPE_STRING | CTLFLAG_RD, - dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); + /* Register ourself so device can resolve who we are */ + OF_device_register_xref(OF_xref_from_node(node), dev); + for (i = 0; i < sc->sid_conf->nfuses ;i++) {\ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, sc->sid_conf->efuses[i].name, + CTLTYPE_STRING | CTLFLAG_RD, + dev, sc->sid_conf->efuses[i].id, aw_sid_sysctl, + "A", sc->sid_conf->efuses[i].desc); + } return (0); } int -aw_sid_read_tscalib(uint32_t *calib0, uint32_t *calib1) +aw_sid_get_fuse(enum aw_sid_fuse_id id, uint8_t *out, uint32_t *size) { struct aw_sid_softc *sc; + uint32_t val; + int i, j; sc = aw_sid_sc; if (sc == NULL) return (ENXIO); - if (!sc->sid_conf->has_thermal) - return (ENXIO); - if (sc->sid_conf->requires_prctl_read) { - PRCTL_RD4(sc, SID_THERMAL_CALIB0_OFF, calib0); - PRCTL_RD4(sc, SID_THERMAL_CALIB1_OFF, calib1); - } else { - *calib0 = RD4(sc, SID_THERMAL_CALIB0); - *calib1 = RD4(sc, SID_THERMAL_CALIB1); + for (i = 0; i < sc->sid_conf->nfuses; i++) + if (id == sc->sid_conf->efuses[i].id) + break; + + if (i == sc->sid_conf->nfuses) + return (ENOENT); + + if (*size != sc->sid_conf->efuses[i].size) { + *size = sc->sid_conf->efuses[i].size; + return (ENOMEM); } + if (out == NULL) + return (ENOMEM); + + if (sc->sid_conf->efuses[i].public == false) + mtx_lock(&sc->prctl_mtx); + for (j = 0; j < sc->sid_conf->efuses[i].size; j += 4) { + if (sc->sid_conf->efuses[i].public == false) { + val = SID_PRCTL_OFFSET(sc->sid_conf->efuses[i].offset + j) | + SID_PRCTL_LOCK | + SID_PRCTL_READ; + WR4(sc, SID_PRCTL, val); + /* Read bit will be cleared once read has concluded */ + while (RD4(sc, SID_PRCTL) & SID_PRCTL_READ) + continue; + val = RD4(sc, SID_RDKEY); + } else + val = RD4(sc, sc->sid_conf->efuses[i].base + + sc->sid_conf->efuses[i].offset + j); + out[j] = val & 0xFF; + if (j + 1 < *size) + out[j + 1] = (val & 0xFF00) >> 8; + if (j + 2 < *size) + out[j + 2] = (val & 0xFF0000) >> 16; + if (j + 3 < *size) + out[j + 3] = (val & 0xFF000000) >> 24; + } + if (sc->sid_conf->efuses[i].public == false) + mtx_unlock(&sc->prctl_mtx); + return (0); } -int -aw_sid_get_rootkey(u_char *out) +static int +aw_sid_read(device_t dev, uint32_t offset, uint32_t size, uint8_t *buffer) { struct aw_sid_softc *sc; + enum aw_sid_fuse_id fuse_id = 0; int i; - bus_size_t root_key_off; - u_int tmp; - sc = aw_sid_sc; - if (sc == NULL) - return (ENXIO); - root_key_off = aw_sid_sc->sid_conf->rootkey_offset; - for (i = 0; i < ROOT_KEY_SIZE ; i++) { - if (sc->sid_conf->requires_prctl_read) - PRCTL_RD4(sc, (i * 4), &tmp); - else - tmp = RD4(aw_sid_sc, root_key_off + (i * 4)); - be32enc(&out[i * 4], tmp); - } + sc = device_get_softc(dev); - return (0); + for (i = 0; i < sc->sid_conf->nfuses; i++) + if (offset == (sc->sid_conf->efuses[i].base + + sc->sid_conf->efuses[i].offset)) { + fuse_id = sc->sid_conf->efuses[i].id; + break; + } + + if (fuse_id == 0) + return (ENOENT); + + return (aw_sid_get_fuse(fuse_id, buffer, &size)); } static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS) { - enum sid_keys key = arg2; - u_char rootkey[16]; - char out[33]; + struct aw_sid_softc *sc; + device_t dev = arg1; + enum aw_sid_fuse_id fuse = arg2; + uint8_t data[32]; + char out[128]; + uint32_t size; + int ret, i; - if (key != AW_SID_ROOT_KEY) - return (ENOENT); + sc = device_get_softc(dev); - if (aw_sid_get_rootkey(rootkey) != 0) + /* Get the size of the efuse data */ + size = 0; + aw_sid_get_fuse(fuse, NULL, &size); + /* We now have the real size */ + ret = aw_sid_get_fuse(fuse, data, &size); + if (ret != 0) { + device_printf(dev, "Cannot get fuse id %d: %d\n", fuse, ret); return (ENOENT); - snprintf(out, sizeof(out), - "%16D", rootkey, ""); + } + for (i = 0; i < size; i++) + snprintf(out + (i * 2), sizeof(out) - (i * 2), + "%.2x", data[i]); + return sysctl_handle_string(oidp, out, sizeof(out), req); } @@ -279,6 +398,8 @@ static device_method_t aw_sid_methods[] = { DEVMETHOD(device_probe, aw_sid_probe), DEVMETHOD(device_attach, aw_sid_attach), + /* NVMEM interface */ + DEVMETHOD(nvmem_read, aw_sid_read), DEVMETHOD_END }; Modified: head/sys/arm/allwinner/aw_sid.h ============================================================================== --- head/sys/arm/allwinner/aw_sid.h Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_sid.h Mon Aug 6 05:35:24 2018 (r337371) @@ -29,7 +29,12 @@ #ifndef __AW_SID_H__ #define __AW_SID_H__ +enum aw_sid_fuse_id { + AW_SID_FUSE_ROOTKEY = 1, + AW_SID_FUSE_THSSENSOR, +}; + int aw_sid_read_tscalib(uint32_t *, uint32_t *); -int aw_sid_get_rootkey(u_char *out); +int aw_sid_get_fuse(enum aw_sid_fuse_id id, uint8_t *out, uint32_t *size); #endif /* !__AW_SID_H__ */ Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:35:24 2018 (r337371) @@ -50,10 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "cpufreq_if.h" +#include "nvmem_if.h" #define THS_CTRL0 0x00 #define THS_CTRL1 0x04 @@ -281,23 +283,31 @@ static struct resource_spec aw_thermal_spec[] = { static int aw_thermal_init(struct aw_thermal_softc *sc) { - uint32_t calib0, calib1; + phandle_t node; + uint32_t calib[2]; int error; + node = ofw_bus_get_node(sc->dev); if (sc->conf->calib0_mask != 0 || sc->conf->calib1_mask != 0) { - /* Read calibration settings from SRAM */ - error = aw_sid_read_tscalib(&calib0, &calib1); - if (error != 0) + error = nvmem_read_cell_by_name(node, "ths_calibration", + (void *)calib, sizeof(calib)); + /* Read calibration settings from EFUSE */ + if (error != 0) { + device_printf(sc->dev, "Cannot read THS efuse\n"); return (error); + } - calib0 &= sc->conf->calib0_mask; - calib1 &= sc->conf->calib1_mask; + device_printf(sc->dev, "calib0: %x\n", calib[0]); + device_printf(sc->dev, "calib1: %x\n", calib[1]); + calib[0] &= sc->conf->calib0_mask; + calib[1] &= sc->conf->calib1_mask; + /* Write calibration settings to thermal controller */ - if (calib0 != 0) - WR4(sc, THS_CALIB0, calib0); - if (calib1 != 0) - WR4(sc, THS_CALIB1, calib1); + if (calib[0] != 0) + WR4(sc, THS_CALIB0, calib[0]); + if (calib[1] != 0) + WR4(sc, THS_CALIB1, calib[1]); } /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/if_awg.c Mon Aug 6 05:35:24 2018 (r337371) @@ -1529,15 +1529,18 @@ awg_get_eaddr(device_t dev, uint8_t *eaddr) struct awg_softc *sc; uint32_t maclo, machi, rnd; u_char rootkey[16]; + uint32_t rootkey_size; sc = device_get_softc(dev); machi = RD4(sc, EMAC_ADDR_HIGH(0)) & 0xffff; maclo = RD4(sc, EMAC_ADDR_LOW(0)); + rootkey_size = sizeof(rootkey); if (maclo == 0xffffffff && machi == 0xffff) { /* MAC address in hardware is invalid, create one */ - if (aw_sid_get_rootkey(rootkey) == 0 && + if (aw_sid_get_fuse(AW_SID_FUSE_ROOTKEY, rootkey, + &rootkey_size) == 0 && (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | rootkey[15]) != 0) { /* MAC address is derived from the root key in SID */ Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/if_emac.c Mon Aug 6 05:35:24 2018 (r337371) @@ -170,6 +170,7 @@ emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr { uint32_t val0, val1, rnd; u_char rootkey[16]; + size_t rootkey_size; /* * Try to get MAC address from running hardware. @@ -193,7 +194,9 @@ emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr hwaddr[4] = (val0 >> 8) & 0xff; hwaddr[5] = (val0 >> 0) & 0xff; } else { - if (aw_sid_get_rootkey(rootkey) == 0) { + rootkey_size = sizeof(rootkey); + if (aw_sid_get_fuse(AW_SID_FUSE_ROOTKEY, rootkey, + &rootkey_size) == 0) { hwaddr[0] = 0x2; hwaddr[1] = rootkey[3]; hwaddr[2] = rootkey[12]; From owner-svn-src-head@freebsd.org Mon Aug 6 08:35:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A8F104F6EA; Mon, 6 Aug 2018 08:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4C88ED63; Mon, 6 Aug 2018 08:35:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCF426E7; Mon, 6 Aug 2018 08:35:16 +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 w768ZGHW023057; Mon, 6 Aug 2018 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w768ZGIH023056; Mon, 6 Aug 2018 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808060835.w768ZGIH023056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 08:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337373 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 337373 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 08:35:17 -0000 Author: hselasky Date: Mon Aug 6 08:35:16 2018 New Revision: 337373 URL: https://svnweb.freebsd.org/changeset/base/337373 Log: Define __poll_t type in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Mon Aug 6 05:36:00 2018 (r337372) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Mon Aug 6 08:35:16 2018 (r337373) @@ -59,6 +59,7 @@ typedef uint64_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; +typedef unsigned __poll_t; typedef u64 phys_addr_t; From owner-svn-src-head@freebsd.org Mon Aug 6 08:40:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64E84104F951; Mon, 6 Aug 2018 08:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17E018EFFB; Mon, 6 Aug 2018 08:40:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED04026EC; Mon, 6 Aug 2018 08:40:02 +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 w768e2vq023308; Mon, 6 Aug 2018 08:40:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w768e2gl023307; Mon, 6 Aug 2018 08:40:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808060840.w768e2gl023307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 08:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 337374 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 08:40:03 -0000 Author: hselasky Date: Mon Aug 6 08:40:02 2018 New Revision: 337374 URL: https://svnweb.freebsd.org/changeset/base/337374 Log: Implement atomic_long_cmpxchg() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 08:35:16 2018 (r337373) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 08:40:02 2018 (r337374) @@ -81,6 +81,21 @@ atomic_long_xchg(atomic_long_t *v, long val) return atomic_swap_long(&v->counter, val); } +static inline long +atomic_long_cmpxchg(atomic_long_t *v, long old, long new) +{ + long ret = old; + + for (;;) { + if (atomic_cmpset_long(&v->counter, old, new)) + break; + ret = READ_ONCE(v->counter); + if (ret != old) + break; + } + return (ret); +} + static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { From owner-svn-src-head@freebsd.org Mon Aug 6 09:22:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0C11050C0A; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 432277042C; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2586C2F3F; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w769M8PY047845; Mon, 6 Aug 2018 09:22:08 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w769M8Bv047844; Mon, 6 Aug 2018 09:22:08 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201808060922.w769M8Bv047844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 6 Aug 2018 09:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337375 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 337375 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 09:22:08 -0000 Author: rrs Date: Mon Aug 6 09:22:07 2018 New Revision: 337375 URL: https://svnweb.freebsd.org/changeset/base/337375 Log: This fixes a bug in Rack where we were not properly using the correct value for Delayed Ack. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D16579 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Aug 6 08:40:02 2018 (r337374) +++ head/sys/netinet/tcp_stacks/rack.c Mon Aug 6 09:22:07 2018 (r337375) @@ -2275,7 +2275,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc } hpts_timeout = rack_timer_start(tp, rack, cts); if (tp->t_flags & TF_DELACK) { - delayed_ack = tcp_delacktime; + delayed_ack = TICKS_2_MSEC(tcp_delacktime); rack->r_ctl.rc_hpts_flags |= PACE_TMR_DELACK; } if (delayed_ack && ((hpts_timeout == 0) || From owner-svn-src-head@freebsd.org Mon Aug 6 09:33:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50FAC10510D9; Mon, 6 Aug 2018 09:33:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2FD870AB4; Mon, 6 Aug 2018 09:33:33 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id 27-v6so8426628qkv.0; Mon, 06 Aug 2018 02:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yWdsdcZxATzt2n0aqv6kQyY01hfXHhmqOK7mmyk363A=; b=j4Q0KOM7sLep42Gc4IVCCwTPU1t9JuAySrjb1+qveGBZnHeeSZoKbbZe3/nn5/UiUF sayeZYqOlza59lrfDE11M1+vUowtdJo/Z4GRifJWwgibHg2YzKV4LWMr+LWIi7dU97z6 dsSZbPfPd0t0dnf/ifxO5XH65hgTOrjDt81i0fRREavt4VVSrrfPrzuaCmq0rqpKUsfo 6Uxw7F3YrtG9nQ2J4SuIT90d8csvX0K80MEWvebcINyalgk9Ak64NG2Hwntwxe6dbVeI SQgZRUNYYgJyQ66zcXgLO/9WNKMjMnNJjqULBlbFTeH8j0qM/4hMw0ZZHunVESmzER13 /zGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yWdsdcZxATzt2n0aqv6kQyY01hfXHhmqOK7mmyk363A=; b=t9+PUhyNuLkZx0LRs7XNLih6o64Glf7SPzVuP8TD/T5tPNQDMLc9xZY217iRIDV14c 5l90R+frhznYMLl2vIWfI5QAQSyF6Y+octIDW8F27OAKaC3DTr+fM6Mgl9W3sZ1ZT/ql h7szAsYX2/QfzIDcfN49+qVCgynmoNIR7KMH/EOxmHf3btDVP7i7zqUqRtrM7d/yZ+jm eLuG4pWRTRlULdSPEWV2BgQppg+LxC4+oFIJmldBbxNoREZ8EEiSMfghsN8Fkeq0MEvY MYOJgT4qRtbPPttTEmOuW9/AUr60ZLCm8bqbHIv7nVRnehcSACue9JsMgXjxWYLD6OoJ tKuQ== X-Gm-Message-State: AOUpUlGiKtQp6hlWv6FB+49ABZgzP8L2JRGm465Wa0PM/i+TCUUCmdfS iKHTSIS7/uaxXsZk9oW+DWUhu8NvK/pmz2V8pSmIOWs6 X-Google-Smtp-Source: AAOMgpecVHigZwB6ee+NTz12sk0IeujedE3DNvGFWgtsF/M2cBBv5nzTXjAKHXw+utqrg3YiFlgIJps3B0sNl3NLXO8= X-Received: by 2002:a37:3c84:: with SMTP id j126-v6mr12724077qka.73.1533548013472; Mon, 06 Aug 2018 02:33:33 -0700 (PDT) MIME-Version: 1.0 References: <201808060840.w768e2gl023307@repo.freebsd.org> In-Reply-To: <201808060840.w768e2gl023307@repo.freebsd.org> From: Mateusz Guzik Date: Mon, 6 Aug 2018 11:33:05 +0200 Message-ID: Subject: Re: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 09:33:34 -0000 On Mon, Aug 6, 2018 at 10:40 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Aug 6 08:40:02 2018 > New Revision: 337374 > URL: https://svnweb.freebsd.org/changeset/base/337374 > > Log: > Implement atomic_long_cmpxchg() function in the LinuxKPI. > > Submitted by: Johannes Lundberg > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/asm/atomic-long.h > > Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h > > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 > 08:35:16 2018 (r337373) > +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 > 08:40:02 2018 (r337374) > @@ -81,6 +81,21 @@ atomic_long_xchg(atomic_long_t *v, long val) > return atomic_swap_long(&v->counter, val); > } > > +static inline long > +atomic_long_cmpxchg(atomic_long_t *v, long old, long new) > +{ > + long ret = old; > + > + for (;;) { > + if (atomic_cmpset_long(&v->counter, old, new)) > + break; > + ret = READ_ONCE(v->counter); > + if (ret != old) > + break; > + } > + return (ret); > +} This code is seriously inferior to atomic_fcmpset_long, which happens to return the found value just like the linux atomic_long_cmpxchg would. The atomic_cmpset_* primitives should not be used if the target value is to be inspected. + > static inline int > atomic_long_add_unless(atomic_long_t *v, long a, long u) > { > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Aug 6 09:44:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31BEA1051A3A; Mon, 6 Aug 2018 09:44:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFC267148A; Mon, 6 Aug 2018 09:44:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 47DEB2601B1; Mon, 6 Aug 2018 11:44:53 +0200 (CEST) Subject: Re: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808060840.w768e2gl023307@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <2cbeb61b-6d24-84ed-e9d4-5d91a79cbf05@selasky.org> Date: Mon, 6 Aug 2018 11:44:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 09:44:55 -0000 On 08/06/18 11:33, Mateusz Guzik wrote: > This code is seriously inferior to atomic_fcmpset_long, which happens to > return the found value just like the linux atomic_long_cmpxchg would. > > The atomic_cmpset_* primitives should not be used if the target value is to > be inspected. Hi, The LinuxKPI has already has few places of atomic_cmpset_* currently. Can I assume that atomic_fcmpset_* is available for all platforms where atomic_cmpset_* is available? --HPS From owner-svn-src-head@freebsd.org Mon Aug 6 10:48:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2371A10530C0; Mon, 6 Aug 2018 10:48:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCF9472BD2; Mon, 6 Aug 2018 10:48:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A036409F; Mon, 6 Aug 2018 10:48:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76AmLsn093119; Mon, 6 Aug 2018 10:48:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76AmLoY093117; Mon, 6 Aug 2018 10:48:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808061048.w76AmLoY093117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 10:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337376 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 337376 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 10:48:22 -0000 Author: hselasky Date: Mon Aug 6 10:48:20 2018 New Revision: 337376 URL: https://svnweb.freebsd.org/changeset/base/337376 Log: Implement current_work() function in the LinuxKPI. Tested by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Mon Aug 6 10:48:20 2018 (r337376) @@ -60,6 +60,7 @@ #define TASK_COMM_LEN (MAXCOMLEN + 1) +struct work_struct; struct task_struct { struct thread *task_thread; struct mm_struct *mm; @@ -78,6 +79,7 @@ struct task_struct { TAILQ_ENTRY(task_struct) rcu_entry; int rcu_recurse; int bsd_interrupt_value; + struct work_struct *work; /* current work struct, if set */ }; #define current ({ \ Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Aug 6 10:48:20 2018 (r337376) @@ -209,6 +209,9 @@ do { \ #define destroy_workqueue(wq) \ linux_destroy_workqueue(wq) +#define current_work() \ + linux_current_work() + /* prototypes */ extern struct workqueue_struct *system_wq; @@ -232,5 +235,6 @@ extern bool linux_flush_work(struct work_struct *); extern bool linux_flush_delayed_work(struct delayed_work *); extern bool linux_work_pending(struct work_struct *); extern bool linux_work_busy(struct work_struct *); +extern struct work_struct *linux_current_work(void); #endif /* _LINUX_WORKQUEUE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Mon Aug 6 10:48:20 2018 (r337376) @@ -220,8 +220,9 @@ linux_work_fn(void *context, int pending) struct work_struct *work; struct workqueue_struct *wq; struct work_exec exec; + struct task_struct *task; - linux_set_current(curthread); + task = current; /* setup local variables */ work = context; @@ -240,9 +241,15 @@ linux_work_fn(void *context, int pending) case WORK_ST_CANCEL: WQ_EXEC_UNLOCK(wq); + /* set current work structure */ + task->work = work; + /* call work function */ work->func(work); + /* set current work structure */ + task->work = NULL; + WQ_EXEC_LOCK(wq); /* check if unblocked */ if (exec.target != work) { @@ -577,6 +584,12 @@ linux_init_delayed_work(struct delayed_work *dwork, wo mtx_init(&dwork->timer.mtx, spin_lock_name("lkpi-dwork"), NULL, MTX_DEF | MTX_NOWITNESS); callout_init_mtx(&dwork->timer.callout, &dwork->timer.mtx, 0); +} + +struct work_struct * +linux_current_work(void) +{ + return (current->work); } static void From owner-svn-src-head@freebsd.org Mon Aug 6 11:38:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2FC1054875; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D47874909; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03DA048DF; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76BctRD024774; Mon, 6 Aug 2018 11:38:55 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Bctal024773; Mon, 6 Aug 2018 11:38:55 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808061138.w76Bctal024773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 6 Aug 2018 11:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337377 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 337377 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 11:38:56 -0000 Author: 0mp (ports committer) Date: Mon Aug 6 11:38:55 2018 New Revision: 337377 URL: https://svnweb.freebsd.org/changeset/base/337377 Log: Fix synopsis of the -t option. While here: - Remove deprecated ".Tn" macros. - Improve formatting and fix typos in the description of the -t option. Reviewed by: bcr Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D16541 Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Mon Aug 6 10:48:20 2018 (r337376) +++ head/sbin/mount/mount.8 Mon Aug 6 11:38:55 2018 (r337377) @@ -39,14 +39,14 @@ .Op Fl adflpruvw .Op Fl F Ar fstab .Op Fl o Ar options -.Op Fl t Cm ufs | Ar external_type +.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... .Nm .Op Fl dfpruvw .Ar special | node .Nm .Op Fl dfpruvw .Op Fl o Ar options -.Op Fl t Cm ufs | Ar external_type +.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... .Ar special node .Sh DESCRIPTION The @@ -139,9 +139,7 @@ This flag is mutually exclusive with .Cm nfsv4acls flag. .It Cm async -All -.Tn I/O -to the file system should be done asynchronously. +All I/O to the file system should be done asynchronously. This is a .Em dangerous flag to set, since it does not guarantee that the file system structure @@ -345,9 +343,7 @@ See .Xr chmod 2 for more information. .It Cm sync -All -.Tn I/O -to the file system should be done synchronously. +All I/O to the file system should be done synchronously. .It Cm update The same as .Fl u ; @@ -415,7 +411,7 @@ The same as the argument to the .Fl o option. -.It Fl t Cm ufs | Ar external_type +.It Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... The argument following the .Fl t is used to indicate the file system type. @@ -429,7 +425,7 @@ to indicate that the actions should only be taken on file systems of the specified type. More than one type may be specified in a comma separated list. The list of file system types can be prefixed with -.Dq Li no +.Cm no to specify the file system types for which action should .Em not be taken. @@ -440,10 +436,7 @@ command: mount -a -t nonfs,nullfs .Ed .Pp -mounts all file systems except those of type -.Tn NFS -and -.Tn NULLFS . +mounts all file systems except those of type NFS and NULLFS. .Pp The default behavior of .Nm @@ -464,16 +457,18 @@ However, for the following file system types: .Cm smbfs , .Cm udf , and -.Cm unionfs . +.Cm unionfs .Nm will not call .Xr nmount 2 directly and will instead attempt to execute a program in -.Pa /sbin/mount_ Ns Sy XXX +.Pa /sbin/mount_ Ns Ar type where -.Sy XXX +.Ar type is replaced by the file system type name. -For example, nfs file systems are mounted by the program +For example, +.Cm nfs +file systems are mounted by the program .Pa /sbin/mount_nfs . .Pp Most file systems will be dynamically loaded by the kernel From owner-svn-src-head@freebsd.org Mon Aug 6 11:45:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD411054ACE; Mon, 6 Aug 2018 11:45:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1644074D4F; Mon, 6 Aug 2018 11:45:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB6DE4A85; Mon, 6 Aug 2018 11:45:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76BjSS7030433; Mon, 6 Aug 2018 11:45:28 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76BjSBA030432; Mon, 6 Aug 2018 11:45:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808061145.w76BjSBA030432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 6 Aug 2018 11:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337378 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 337378 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 11:45:29 -0000 Author: 0mp (ports committer) Date: Mon Aug 6 11:45:28 2018 New Revision: 337378 URL: https://svnweb.freebsd.org/changeset/base/337378 Log: Fix "mandoc -Tlint" warnings. Reviewed by: bcr Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D15580 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Mon Aug 6 11:38:55 2018 (r337377) +++ head/share/man/man8/rc.subr.8 Mon Aug 6 11:45:28 2018 (r337378) @@ -419,7 +419,7 @@ and errors about usage of services that are not enable .Xr rc.conf 5 . This prefix also sets .Va rc_quiet Ns = Ns Li YES . -.Em Please, note: +.Em Please, note\&: .Va rc_quiet is not intended to completely mask all debug and warning messages, but only certain small classes of them. @@ -506,7 +506,7 @@ This is done after invoking the commands from so that the missing modules are not loaded in vain if the preliminary commands indicate a error condition. A word in the list can have an optional -.Dq Li : Ns Ar modname +.Dq Li \&: Ns Ar modname or .Dq Li ~ Ns Ar pattern suffix. From owner-svn-src-head@freebsd.org Mon Aug 6 14:40:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F909105A8F9; Mon, 6 Aug 2018 14:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24D587A90B; Mon, 6 Aug 2018 14:40:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073D665D3; Mon, 6 Aug 2018 14:40:46 +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 w76EejKB017651; Mon, 6 Aug 2018 14:40:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Eejfq017650; Mon, 6 Aug 2018 14:40:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808061440.w76Eejfq017650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 6 Aug 2018 14:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337379 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 337379 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 14:40:46 -0000 Author: andrew Date: Mon Aug 6 14:40:45 2018 New Revision: 337379 URL: https://svnweb.freebsd.org/changeset/base/337379 Log: Default to armv5te in LINT on arm. This should fix building LINT there. Modified: head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Mon Aug 6 11:45:28 2018 (r337378) +++ head/sys/arm/conf/NOTES Mon Aug 6 14:40:45 2018 (r337379) @@ -12,6 +12,7 @@ files "../mv/orion/files.ts7800" options PHYSADDR=0x00000000 +makeoptions CONF_CFLAGS+="-march=armv5te" makeoptions LDFLAGS="-zmuldefs" makeoptions KERNPHYSADDR=0x00000000 From owner-svn-src-head@freebsd.org Mon Aug 6 15:55:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C5BD105CE0F; Mon, 6 Aug 2018 15:55:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0338A7D2B9; Mon, 6 Aug 2018 15:55:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D992772A0; Mon, 6 Aug 2018 15:55:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Ftw2J057830; Mon, 6 Aug 2018 15:55:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Ftw8G057829; Mon, 6 Aug 2018 15:55:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808061555.w76Ftw8G057829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 6 Aug 2018 15:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337381 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libpthread X-SVN-Commit-Revision: 337381 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 15:55:59 -0000 Author: br Date: Mon Aug 6 15:55:58 2018 New Revision: 337381 URL: https://svnweb.freebsd.org/changeset/base/337381 Log: Increase timeout for timedmutex_test:mutex2, timedmutex_test:mutex3 tests. Default value is 300. It takes ~310s to complete each of these tests in QEMU/RISC-V. Sponsored by: DARPA, AFRL Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Mon Aug 6 15:21:46 2018 (r337380) +++ head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Mon Aug 6 15:55:58 2018 (r337381) @@ -153,6 +153,12 @@ ATF_TC_HEAD(mutex2, tc) atf_tc_set_md_var(tc, "timeout", "40"); #endif #endif + +#ifdef __FreeBSD__ +#if defined(__riscv) + atf_tc_set_md_var(tc, "timeout", "600"); +#endif +#endif } ATF_TC_BODY(mutex2, tc) { @@ -228,6 +234,12 @@ ATF_TC_HEAD(mutex3, tc) #ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_set_md_var(tc, "timeout", "40"); +#endif +#endif + +#ifdef __FreeBSD__ +#if defined(__riscv) + atf_tc_set_md_var(tc, "timeout", "600"); #endif #endif } From owner-svn-src-head@freebsd.org Mon Aug 6 16:17:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9E0105D6CF; Mon, 6 Aug 2018 16:17:33 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 04F4F7DD50; Mon, 6 Aug 2018 16:17:32 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from dhcp-10-248-121-111.eduroam.wireless.private.cam.ac.uk (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id A16514E711; Mon, 6 Aug 2018 16:16:54 +0000 (UTC) From: Andrew Turner Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r337379 - head/sys/arm/conf Date: Mon, 6 Aug 2018 17:16:53 +0100 References: <201808061440.w76Eejfq017650@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201808061440.w76Eejfq017650@repo.freebsd.org> Message-Id: <7438753E-4833-46E4-8D5F-44FB536CE72C@freebsd.org> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 16:17:33 -0000 > On 6 Aug 2018, at 15:40, Andrew Turner wrote: > > Author: andrew > Date: Mon Aug 6 14:40:45 2018 > New Revision: 337379 > URL: https://svnweb.freebsd.org/changeset/base/337379 > > Log: > Default to armv5te in LINT on arm. This should fix building LINT there. Reported by: jhb Andrew From owner-svn-src-head@freebsd.org Mon Aug 6 16:22:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19EA105D9FC; Mon, 6 Aug 2018 16:22:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1EA07E06B; Mon, 6 Aug 2018 16:22:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79BAB7763; Mon, 6 Aug 2018 16:22:02 +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 w76GM2xi069974; Mon, 6 Aug 2018 16:22:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76GM1pY069971; Mon, 6 Aug 2018 16:22:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808061622.w76GM1pY069971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 6 Aug 2018 16:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337382 - in head: etc/mtree sbin/dhclient sbin/init/rc.d X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: etc/mtree sbin/dhclient sbin/init/rc.d X-SVN-Commit-Revision: 337382 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 16:22:03 -0000 Author: markj Date: Mon Aug 6 16:22:01 2018 New Revision: 337382 URL: https://svnweb.freebsd.org/changeset/base/337382 Log: dhclient: Don't chroot if we are in capability mode. The main dhclient process is Capsicumized but also chroots to restrict filesystem access. With r322369, pidfile(3) maintains a directory descriptor for the pidfile, which can cause the chroot to fail in certain cases. To minimize the problem, only chroot if we fail to enter capability mode, and store dhclient pidfiles in a subdirectory of /var/run, thus restricting access via pidfile(3)'s directory descriptor. PR: 223327 Reviewed by: cem, oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16584 Modified: head/etc/mtree/BSD.var.dist head/sbin/dhclient/dhclient.8 head/sbin/dhclient/dhclient.c head/sbin/init/rc.d/dhclient Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Mon Aug 6 15:55:58 2018 (r337381) +++ head/etc/mtree/BSD.var.dist Mon Aug 6 16:22:01 2018 (r337382) @@ -74,6 +74,8 @@ preserve .. run + dhclient + .. ppp gname=network mode=0770 .. wpa_supplicant Modified: head/sbin/dhclient/dhclient.8 ============================================================================== --- head/sbin/dhclient/dhclient.8 Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/dhclient/dhclient.8 Mon Aug 6 16:22:01 2018 (r337382) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2011 +.Dd August 4, 2018 .Dt DHCLIENT 8 .Os .Sh NAME @@ -87,7 +87,7 @@ for the leases file. .It Fl p Ar file Specify an alternate location for the PID file. The default is -.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . +.Pa /var/run/dhclient/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm @@ -194,3 +194,16 @@ and .Pp The current implementation was reworked by .An Henning Brauer Aq Mt henning@openbsd.org . +.Sh BUGS +The +.Nm +utility uses +.Xr capsicum 4 +to sandbox the main process. +If the requisite kernel support is not available, the main process will +attempt to run in a +.Xr chroot 2 +sandbox instead. +This will fail if the process is jailed or the +.Va kern.chroot_allow_open_directories +sysctl is set to 0. Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/dhclient/dhclient.c Mon Aug 6 16:22:01 2018 (r337382) @@ -371,6 +371,7 @@ init_casper(void) int main(int argc, char *argv[]) { + u_int capmode; int ch, fd, quiet = 0, i = 0; int pipe_fd[2]; int immediate_daemon = 0; @@ -419,7 +420,7 @@ main(int argc, char *argv[]) if (path_dhclient_pidfile == NULL) { asprintf(&path_dhclient_pidfile, - "%sdhclient.%s.pid", _PATH_VARRUN, *argv); + "%s/dhclient/dhclient.%s.pid", _PATH_VARRUN, *argv); if (path_dhclient_pidfile == NULL) error("asprintf"); } @@ -528,11 +529,6 @@ main(int argc, char *argv[]) if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS) error("can't limit route socket: %m"); - if (chroot(_PATH_VAREMPTY) == -1) - error("chroot"); - if (chdir("/") == -1) - error("chdir(\"/\")"); - if (setgroups(1, &pw->pw_gid) || setegid(pw->pw_gid) || setgid(pw->pw_gid) || seteuid(pw->pw_uid) || setuid(pw->pw_uid)) @@ -545,6 +541,19 @@ main(int argc, char *argv[]) if (caph_enter_casper() < 0) error("can't enter capability mode: %m"); + /* + * If we are not in capability mode (i.e., because Capsicum or + * libcasper is disabled), try to restrict filesystem access. This + * will fail if kern.chroot_allow_open_directories is 0 or the process + * is jailed. + */ + if (cap_getmode(&capmode) < 0 || capmode == 0) { + if (chroot(_PATH_VAREMPTY) == -1) + error("chroot"); + if (chdir("/") == -1) + error("chdir(\"/\")"); + } + if (immediate_daemon) go_daemon(); @@ -2449,13 +2458,8 @@ go_daemon(void) cap_rights_init(&rights); - if (pidfile != NULL) { + if (pidfile != NULL) pidfile_write(pidfile); - if (cap_rights_limit(pidfile_fileno(pidfile), &rights) < 0 && - errno != ENOSYS) { - error("can't limit pidfile descriptor: %m"); - } - } if (nullfd != -1) { close(nullfd); Modified: head/sbin/init/rc.d/dhclient ============================================================================== --- head/sbin/init/rc.d/dhclient Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/init/rc.d/dhclient Mon Aug 6 16:22:01 2018 (r337382) @@ -14,7 +14,7 @@ ifn="$2" name="dhclient" desc="Dynamic Host Configuration Protocol (DHCP) client" rcvar= -pidfile="/var/run/${name}.${ifn}.pid" +pidfile="/var/run/dhclient/${name}.${ifn}.pid" start_precmd="dhclient_prestart" stop_precmd="dhclient_pre_check" From owner-svn-src-head@freebsd.org Mon Aug 6 17:21:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2351F105EF9C; Mon, 6 Aug 2018 17:21:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CADEF80261; Mon, 6 Aug 2018 17:21:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF857FBA; Mon, 6 Aug 2018 17:21:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76HLKuP001425; Mon, 6 Aug 2018 17:21:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76HLK1C001395; Mon, 6 Aug 2018 17:21:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808061721.w76HLK1C001395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 17:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337383 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337383 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 17:21:21 -0000 Author: manu Date: Mon Aug 6 17:21:20 2018 New Revision: 337383 URL: https://svnweb.freebsd.org/changeset/base/337383 Log: release: arm: Copy the dtb to the fat partition When booting via EFI on arm we have no way to know the dtb file to load and we always use the one provided from the bootloader. This works in most case but : U-Boot have some really old DTB for some boards, the sync from Linux isn't done automatically for all boards Some boards (like TI BeagleBone series) use one u-boot for all the model and it doesn't embed the DTBs Some boards (like IMX6 based ones), don't embed the DTB We want u-boot to load and patch the DTB with the mac address or the display node enabled or not. Reviewed by: gjb, imp Differential Revision: https://reviews.freebsd.org/D16596 Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Aug 6 16:22:01 2018 (r337382) +++ head/release/tools/arm.subr Mon Aug 6 17:21:20 2018 (r337383) @@ -201,6 +201,8 @@ arm_install_boot() { chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET}) + chroot ${CHROOTDIR} cp -R ${UFSMOUNT}/boot/dtb ${FATMOUNT} + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} From owner-svn-src-head@freebsd.org Mon Aug 6 17:36:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6332105F714; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE2F80CF3; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78D96102BD; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Haw7t009584; Mon, 6 Aug 2018 17:36:58 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Hawt5009582; Mon, 6 Aug 2018 17:36:58 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061736.w76Hawt5009582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337384 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337384 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 17:36:59 -0000 Author: jtl Date: Mon Aug 6 17:36:57 2018 New Revision: 337384 URL: https://svnweb.freebsd.org/changeset/base/337384 Log: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Reviewed by: jhb Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp_reass.c Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Aug 6 17:21:20 2018 (r337383) +++ head/share/man/man4/tcp.4 Mon Aug 6 17:36:57 2018 (r337384) @@ -445,6 +445,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Mon Aug 6 17:21:20 2018 (r337383) +++ head/sys/netinet/tcp_reass.c Mon Aug 6 17:36:57 2018 (r337384) @@ -91,6 +91,11 @@ SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegme &tcp_reass_zone, "Global number of TCP Segments currently in Reassembly Queue"); +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -170,6 +175,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -180,7 +189,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { From owner-svn-src-head@freebsd.org Mon Aug 6 18:16:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCF41060E3E; Mon, 6 Aug 2018 18:16:00 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 C26A982C8F; Mon, 6 Aug 2018 18:15:59 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 EB3B825D3A0E; Mon, 6 Aug 2018 18:15:51 +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 0F0A1D1F947; Mon, 6 Aug 2018 18:15:51 +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 6AsbP9pLYR3s; Mon, 6 Aug 2018 18:15:49 +0000 (UTC) Received: from [192.168.124.1] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D19EDD1F917; Mon, 6 Aug 2018 18:15:48 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337384 - in head: share/man/man4 sys/netinet Date: Mon, 06 Aug 2018 18:15:48 +0000 X-Mailer: MailMate (2.0BETAr6116) Message-ID: <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> In-Reply-To: <201808061736.w76Hawt5009582@repo.freebsd.org> References: <201808061736.w76Hawt5009582@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 18:16:00 -0000 On 6 Aug 2018, at 17:36, Jonathan T. Looney wrote: > Author: jtl > Date: Mon Aug 6 17:36:57 2018 > New Revision: 337384 > URL: https://svnweb.freebsd.org/changeset/base/337384 > > Log: > Address concerns about CPU usage while doing TCP reassembly. … > > Reviewed by: jhb > Approved by: so > Security: FreeBSD-SA-18:08.tcp > Security: CVE-2018-6922 > > Modified: > head/share/man/man4/tcp.4 > head/sys/netinet/tcp_reass.c > > Modified: head/share/man/man4/tcp.4 > ============================================================================== > --- head/share/man/man4/tcp.4 Mon Aug 6 17:21:20 2018 (r337383) > +++ head/share/man/man4/tcp.4 Mon Aug 6 17:36:57 2018 (r337384) > @@ -445,6 +445,20 @@ no reseeding will occur. > Reseeding should not be necessary, and will break > .Dv TIME_WAIT > recycling for a few minutes. > +.It Va reass.cursegments Would you mind bumping .Dd as well please? Thanks, /bz From owner-svn-src-head@freebsd.org Mon Aug 6 18:42:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98B181061999; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2D783CC7; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E39F10DF2; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76IgcNq045343; Mon, 6 Aug 2018 18:42:38 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Igc7B045342; Mon, 6 Aug 2018 18:42:38 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061842.w76Igc7B045342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 18:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337390 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337390 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 18:42:38 -0000 Author: jtl Date: Mon Aug 6 18:42:37 2018 New Revision: 337390 URL: https://svnweb.freebsd.org/changeset/base/337390 Log: Bump date after r337384. Reported by: bz Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Aug 6 17:50:40 2018 (r337389) +++ head/share/man/man4/tcp.4 Mon Aug 6 18:42:37 2018 (r337390) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 9, 2018 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Mon Aug 6 18:48:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70A81061BAB; Mon, 6 Aug 2018 18:48:11 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23B8B8419F; Mon, 6 Aug 2018 18:48:11 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id f23-v6so5642454edr.11; Mon, 06 Aug 2018 11:48:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9g7gSz6iMVGEn+dNkNW9SVXETryFQ6G2gxJuN71zIQE=; b=jS40T4UZ6UOFVSJzfUVobrgLxp3JnDkG+u4skIKsUrnvh1q1Obdn+a8X42OryrCue7 tB3R8lgh2oMZsnl3aYhsVtzmzf15rurlUWBbUpsh5o+aNZsJ/y9Wl+VE0++Cs3qyNrXp 5ruoVqPionAAIWdf4D0Wxc8HoWrGpYn/5YjRq53phF4RaF5dtyQZ4HOhgO3EHrr8VSYp ztcWzbZoPbesRNdOfNbSqHjOXKOKpKHDjBpcFIot31yRTkVsv6VAaf9p9KvXDB+X8cgX M20GX9ZdSi2ti5EHpXrVhgc5h1Kw6R0ObH/yluWRXnM477AhaKgo/DlIwxPlMgX1Vhex KCIw== X-Gm-Message-State: AOUpUlEzUGex2F9ogxGTED7dq59+aMo5zsm+h/RoVvAhmti9q9J2zQuD THrAaVHKcJu+uJKS9RhC+VNjPjxOYI4= X-Google-Smtp-Source: AAOMgpczy7nAj0h9iQ7LD+Yt2T0hYAlHByZBrwNifiRaoDWoJVRPhujCcce/XjeLPDeYWgYYKSYfBg== X-Received: by 2002:a50:c201:: with SMTP id n1-v6mr19345584edf.11.1533581284548; Mon, 06 Aug 2018 11:48:04 -0700 (PDT) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com. [74.125.82.51]) by smtp.gmail.com with ESMTPSA id t44-v6sm7335903edb.79.2018.08.06.11.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 11:48:04 -0700 (PDT) Received: by mail-wm0-f51.google.com with SMTP id y9-v6so15454540wma.5; Mon, 06 Aug 2018 11:48:03 -0700 (PDT) X-Received: by 2002:a1c:1182:: with SMTP id 124-v6mr12665924wmr.75.1533581283797; Mon, 06 Aug 2018 11:48:03 -0700 (PDT) MIME-Version: 1.0 References: <201808061736.w76Hawt5009582@repo.freebsd.org> <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> In-Reply-To: <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 14:47:52 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337384 - in head: share/man/man4 sys/netinet To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 06 Aug 2018 18:48:11 -0000 On Mon, Aug 6, 2018 at 2:16 PM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > > On 6 Aug 2018, at 17:36, Jonathan T. Looney wrote: > > > Author: jtl > > Date: Mon Aug 6 17:36:57 2018 > > New Revision: 337384 > > URL: https://svnweb.freebsd.org/changeset/base/337384 > > > > Log: > > Address concerns about CPU usage while doing TCP reassembly. > =E2=80=A6 > > > > Reviewed by: jhb > > Approved by: so > > Security: FreeBSD-SA-18:08.tcp > > Security: CVE-2018-6922 > > > > Modified: > > head/share/man/man4/tcp.4 > > head/sys/netinet/tcp_reass.c > > > Would you mind bumping .Dd as well please? Done for head and the stable branches. I'll ask so@ about the releng branches. Jonathan From owner-svn-src-head@freebsd.org Mon Aug 6 19:09:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDEC7106244E; Mon, 6 Aug 2018 19:09:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733EB84ED9; Mon, 6 Aug 2018 19:09:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 500FE11188; Mon, 6 Aug 2018 19:09:56 +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 w76J9u4B055838; Mon, 6 Aug 2018 19:09:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76J9udg055837; Mon, 6 Aug 2018 19:09:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808061909.w76J9udg055837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 19:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337393 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 337393 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 19:09:56 -0000 Author: np Date: Mon Aug 6 19:09:55 2018 New Revision: 337393 URL: https://svnweb.freebsd.org/changeset/base/337393 Log: Fix typo in cxgbe/t4_tom. Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 18:47:03 2018 (r337392) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 19:09:55 2018 (r337393) @@ -198,7 +198,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par #ifdef RATELIMIT /* - * Input is Bytes/second (so_max_pacing-rate), chip counts in Kilobits/second. + * Input is Bytes/second (so_max_pacing_rate), chip counts in Kilobits/second. */ static int update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) From owner-svn-src-head@freebsd.org Mon Aug 6 19:21:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670D610628D3; Mon, 6 Aug 2018 19:21:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8D185779; Mon, 6 Aug 2018 19:21:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D4C11380; Mon, 6 Aug 2018 19:21:32 +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 w76JLWcL062851; Mon, 6 Aug 2018 19:21:32 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76JLW44062850; Mon, 6 Aug 2018 19:21:32 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808061921.w76JLW44062850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 6 Aug 2018 19:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337394 - head/release X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 337394 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 19:21:33 -0000 Author: cperciva Date: Mon Aug 6 19:21:32 2018 New Revision: 337394 URL: https://svnweb.freebsd.org/changeset/base/337394 Log: Add EC2PUBLICSNAP option to EC2 builds; this passes a (recently added) flag to bsdec2-image-upload instructing it to mark the snapshot of its root disk as public (which is independent from marking the created AMIs as public). Requested by: Amazon Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon Aug 6 19:09:55 2018 (r337393) +++ head/release/Makefile.ec2 Mon Aug 6 19:21:32 2018 (r337394) @@ -35,6 +35,9 @@ AMINAMESUFFIX!= date +-%Y-%m-%d .if defined(EC2PUBLIC) && !empty(EC2PUBLIC) PUBLISH= --public .endif +.if defined(EC2PUBLICSNAP) && !empty(EC2PUBLICSNAP) +PUBLISH= --publicsnap +.endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} @@ -79,7 +82,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @echo "--------------------------------------------------------------" @false .endif - /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov --ena \ + /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ From owner-svn-src-head@freebsd.org Mon Aug 6 21:09:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA338106641F; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDCB8BBFB; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6043A12501; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76L9DWN021625; Mon, 6 Aug 2018 21:09:13 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76L9B9h021616; Mon, 6 Aug 2018 21:09:11 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808062109.w76L9B9h021616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 6 Aug 2018 21:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337396 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 337396 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 21:09:14 -0000 Author: mckusick Date: Mon Aug 6 21:09:11 2018 New Revision: 337396 URL: https://svnweb.freebsd.org/changeset/base/337396 Log: Put in place the framework for consolodating contiguous blocks into a smaller number of larger TRIM requests. The hope had been to have the full TRIM consolodation in place for 12.0, but the algorithms are still under development and need further testing. With this framework in place it will be possible to easily add TRIM consolodation once the optimal strategy has been found. The only functional change with this patch is the elimination of TRIM requests for blocks that are freed before they have been likely to have been written. Reviewed by: kib Discussed with: Warner Losh and Chuck Silvers Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Aug 6 21:09:11 2018 (r337396) @@ -110,8 +110,6 @@ static ufs2_daddr_t static void ffs_blkfree_cg(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, struct workhead *); -static void ffs_blkfree_trim_completed(struct buf *); -static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -395,8 +393,23 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) @@ -521,7 +534,7 @@ ffs_reallocblks_ufs1(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs1_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -730,14 +743,29 @@ ffs_reallocblks_ufs1(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -771,7 +799,7 @@ ffs_reallocblks_ufs2(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs2_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -978,14 +1006,29 @@ ffs_reallocblks_ufs2(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -1823,8 +1866,7 @@ gotit: /* XXX Fixme. */ UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, - size, 0); + softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, size, 0); UFS_LOCK(ump); return (blkno); } @@ -2254,6 +2296,17 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) bdwrite(bp); } +/* + * Structures and routines associated with trim management. + */ +MALLOC_DEFINE(M_TRIM, "ufs_trim", "UFS trim structures"); + +#define TRIMLIST_HASH(ump, inum) \ + (&(ump)->um_trimhash[(inum) & (ump)->um_trimlisthashsize]) + +static void ffs_blkfree_trim_completed(struct buf *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); + struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2277,7 +2330,7 @@ ffs_blkfree_trim_task(ctx, pending) tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); atomic_add_int(&tp->ump->um_trim_inflight, -1); - free(tp, M_TEMP); + free(tp, M_TRIM); } static void @@ -2287,13 +2340,13 @@ ffs_blkfree_trim_completed(bp) struct ffs_blkfree_trim_params *tp; tp = bp->b_fsprivate1; - free(bp, M_TEMP); + free(bp, M_TRIM); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } void -ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) +ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, trimtype) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; @@ -2302,6 +2355,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de ino_t inum; enum vtype vtype; struct workhead *dephd; + int trimtype; { struct mount *mp; struct buf *bp; @@ -2319,10 +2373,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de return; } /* - * Nothing to delay if TRIM is disabled, or the operation is - * performed on the snapshot. + * Nothing to delay if TRIM is not required for this block or TRIM + * is disabled or the operation is performed on a snapshot. */ - if (((ump->um_flags) & UM_CANDELETE) == 0 || devvp->v_type == VREG) { + if (trimtype == NOTRIM || ((ump->um_flags & UM_CANDELETE) == 0) || + devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } @@ -2334,7 +2389,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de * and write some new data into it. */ atomic_add_int(&ump->um_trim_inflight, 1); - tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); tp->ump = ump; tp->devvp = devvp; tp->bno = bno; @@ -2347,7 +2402,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de } else tp->pdephd = NULL; - bp = malloc(sizeof(*bp), M_TEMP, M_WAITOK | M_ZERO); + bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); bp->b_iocmd = BIO_DELETE; bp->b_iooffset = dbtob(fsbtodb(fs, bno)); bp->b_iodone = ffs_blkfree_trim_completed; @@ -2824,7 +2879,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) long blkcnt, blksize; struct file *fp, *vfp; cap_rights_t rights; - int filetype, error; + int filetype, trimtype, error; static struct fileops *origops, bufferedops; if (req->newlen > sizeof cmd) @@ -2956,14 +3011,17 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) blkno = cmd.value; blkcnt = cmd.size; blksize = fs->fs_frag - (blkno % fs->fs_frag); + trimtype = (blksize < blkcnt) ? STARTFREE : SINGLETON; while (blkcnt > 0) { if (blksize > blkcnt) blksize = blkcnt; ffs_blkfree(ump, fs, ump->um_devvp, blkno, - blksize * fs->fs_fsize, UFS_ROOTINO, VDIR, NULL); + blksize * fs->fs_fsize, UFS_ROOTINO, + VDIR, NULL, trimtype); blkno += blksize; blkcnt -= blksize; blksize = fs->fs_frag; + trimtype = (blksize < blkcnt) ? CONTINUEFREE : ENDFREE; } break; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_balloc.c Mon Aug 6 21:09:11 2018 (r337396) @@ -553,7 +553,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON); } return (error); } @@ -1147,7 +1147,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON); } return (error); } Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_extern.h Mon Aug 6 21:09:11 2018 (r337396) @@ -63,7 +63,7 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_starto struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, - ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); + ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *, int); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -111,10 +111,27 @@ vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); void process_deferred_inactive(struct mount *mp); +/* + * Flags to ffs_vgetf + */ #define FFSV_FORCEINSMQ 0x0001 +/* + * Flags to ffs_reload + */ #define FFSR_FORCE 0x0001 #define FFSR_UNSUSPEND 0x0002 + +/* + * Trim type to ffs_blkfree - used to help with BIO_DELETE (trim) requests + */ +#define NOTRIM 1 /* never written, so don't call trim for it */ +#define SINGLETON 2 /* only block being freed, so trim it now */ +#define STARTFREE 3 /* beginning to free for this inum */ +#define CONTINUEFREE 4 /* additional block free for this inum */ +#define ENDFREE 5 /* last block to free for this inum */ + +#define MAXTRIMIO 1024 /* maximum expected outstanding trim requests */ extern struct vop_vector ffs_vnodeops1; extern struct vop_vector ffs_fifoops1; Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_inode.c Mon Aug 6 21:09:11 2018 (r337396) @@ -195,7 +195,7 @@ ffs_truncate(vp, length, flags, cred) struct ufsmount *ump; int softdeptrunc, journaltrunc; int needextclean, extblocks; - int offset, size, level, nblocks; + int trimtype, firstfree, offset, size, level, nblocks; int i, error, allerror, indiroff, waitforupdate; off_t osize; @@ -275,7 +275,7 @@ ffs_truncate(vp, length, flags, cred) continue; ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } } } @@ -523,7 +523,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_ib[level], 0); ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); blocksreleased += nblocks; } } @@ -534,6 +534,7 @@ ffs_truncate(vp, length, flags, cred) /* * All whole direct blocks or frags. */ + firstfree = 1; for (i = UFS_NDADDR - 1; i > lastblock; i--) { long bsize; @@ -542,8 +543,23 @@ ffs_truncate(vp, length, flags, cred) continue; DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); + if (firstfree) { + if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, trimtype); blocksreleased += btodb(bsize); } if (lastblock < 0) @@ -575,7 +591,8 @@ ffs_truncate(vp, length, flags, cred) */ bn += numfrags(fs, newspace); ffs_blkfree(ump, fs, ump->um_devvp, bn, - oldspace - newspace, ip->i_number, vp->v_type, NULL); + oldspace - newspace, ip->i_number, vp->v_type, + NULL, SINGLETON); blocksreleased += btodb(oldspace - newspace); } } @@ -636,7 +653,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) struct fs *fs; struct vnode *vp; caddr_t copy = NULL; - int i, nblocks, error = 0, allerror = 0; + int i, trimtype, nblocks, firstfree, error = 0, allerror = 0; ufs2_daddr_t nb, nlbn, last; ufs2_daddr_t blkcount, factor, blocksreleased = 0; ufs1_daddr_t *bap1 = NULL; @@ -719,6 +736,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) /* * Recursively free totally unused blocks. */ + firstfree = 1; for (i = NINDIR(fs) - 1, nlbn = lbn + 1 - i * factor; i > last; i--, nlbn += factor) { nb = BAP(ip, i); @@ -730,8 +748,23 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) allerror = error; blocksreleased += blkcount; } + if (firstfree) { + if (i - 1 == last || BAP(ip, i - 1) == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i - 1 == last || BAP(ip, i - 1) == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, trimtype); blocksreleased += nblocks; } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_snapshot.c Mon Aug 6 21:09:11 2018 (r337396) @@ -583,7 +583,7 @@ loop: if (len != 0 && len < fs->fs_bsize) { ffs_blkfree(ump, copy_fs, vp, DIP(xp, i_db[loc]), len, xp->i_number, - xvp->v_type, NULL); + xvp->v_type, NULL, SINGLETON); blkno = DIP(xp, i_db[loc]); DIP_SET(xp, i_db[loc], 0); } @@ -1265,7 +1265,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } return (0); } @@ -1549,7 +1549,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } return (0); } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 6 21:09:11 2018 (r337396) @@ -869,7 +869,7 @@ static void cancel_allocdirect(struct allocdirectlst * struct allocdirect *, struct freeblks *); static int check_inode_unwritten(struct inodedep *); static int free_inodedep(struct inodedep *); -static void freework_freeblock(struct freework *); +static void freework_freeblock(struct freework *, int); static void freework_enqueue(struct freework *); static int handle_workitem_freeblocks(struct freeblks *, int); static int handle_complete_freeblocks(struct freeblks *, int); @@ -884,7 +884,7 @@ static struct allocindir *newallocindir(struct inode * ufs2_daddr_t, ufs_lbn_t); static void handle_workitem_freefrag(struct freefrag *); static struct freefrag *newfreefrag(struct inode *, ufs2_daddr_t, long, - ufs_lbn_t); + ufs_lbn_t, int); static void allocdirect_merge(struct allocdirectlst *, struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, @@ -5289,7 +5289,22 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, KASSERT(MOUNTEDSOFTDEP(mp) != 0, ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); else freefrag = NULL; @@ -5566,11 +5581,12 @@ newjfreefrag(freefrag, ip, blkno, size, lbn) * Allocate a new freefrag structure. */ static struct freefrag * -newfreefrag(ip, blkno, size, lbn) +newfreefrag(ip, blkno, size, lbn, trimtype) struct inode *ip; ufs2_daddr_t blkno; long size; ufs_lbn_t lbn; + int trimtype; { struct freefrag *freefrag; struct ufsmount *ump; @@ -5591,6 +5607,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_vtype = ITOV(ip)->v_type; freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; + freefrag->ff_trimtype = trimtype; if (MOUNTEDSUJ(UFSTOVFS(ump))) { freefrag->ff_jdep = (struct worklist *) @@ -5636,7 +5653,8 @@ handle_workitem_freefrag(freefrag) } FREE_LOCK(ump); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, - freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); + freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd, + freefrag->ff_trimtype); ACQUIRE_LOCK(ump); WORKITEM_FREE(freefrag, D_FREEFRAG); FREE_LOCK(ump); @@ -5676,7 +5694,22 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, ne lbn = bp->b_lblkno; if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); else freefrag = NULL; @@ -5789,7 +5822,8 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) struct jnewblk *jnewblk; if (oldblkno) - freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn); + freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn, + SINGLETON); else freefrag = NULL; ACQUIRE_LOCK(ITOUMP(ip)); @@ -7724,8 +7758,9 @@ free_inodedep(inodedep) * in memory immediately. */ static void -freework_freeblock(freework) +freework_freeblock(freework, trimtype) struct freework *freework; + int trimtype; { struct freeblks *freeblks; struct jnewblk *jnewblk; @@ -7779,10 +7814,10 @@ freework_freeblock(freework) FREE_LOCK(ump); freeblks_free(ump, freeblks, btodb(bsize)); CTR4(KTR_SUJ, - "freework_freeblock: ino %d blkno %jd lbn %jd size %ld", + "freework_freeblock: ino %jd blkno %jd lbn %jd size %d", freeblks->fb_inum, freework->fw_blkno, freework->fw_lbn, bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, - freeblks->fb_inum, freeblks->fb_vtype, &wkhd); + freeblks->fb_inum, freeblks->fb_vtype, &wkhd, trimtype); ACQUIRE_LOCK(ump); /* * The jnewblk will be discarded and the bits in the map never @@ -7835,7 +7870,7 @@ handle_workitem_indirblk(freework) return; } if (freework->fw_off == NINDIR(fs)) { - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON); return; } freework->fw_state |= INPROGRESS; @@ -7889,16 +7924,19 @@ handle_workitem_freeblocks(freeblks, flags) struct freeblks *freeblks; int flags; { - struct freework *freework; + struct freework *freework, *prevfreework; struct newblk *newblk; struct allocindir *aip; struct ufsmount *ump; struct worklist *wk; + int trimtype; KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); ump = VFSTOUFS(freeblks->fb_list.wk_mp); ACQUIRE_LOCK(ump); + prevfreework = NULL; + trimtype = 0; while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { WORKLIST_REMOVE(wk); switch (wk->wk_type) { @@ -7932,16 +7970,26 @@ handle_workitem_freeblocks(freeblks, flags) case D_FREEWORK: freework = WK_FREEWORK(wk); - if (freework->fw_lbn <= -UFS_NDADDR) + if (freework->fw_lbn <= -UFS_NDADDR) { handle_workitem_indirblk(freework); - else - freework_freeblock(freework); + continue; + } else if (prevfreework == NULL) { + trimtype = SINGLETON; + } else if (trimtype == SINGLETON) { + freework_freeblock(prevfreework, STARTFREE); + trimtype = ENDFREE; + } else { + freework_freeblock(prevfreework, CONTINUEFREE); + } + prevfreework = freework; continue; default: panic("handle_workitem_freeblocks: Unknown type %s", TYPENAME(wk->wk_type)); } } + if (prevfreework != NULL) + freework_freeblock(prevfreework, trimtype); if (freeblks->fb_ref != 0) { freeblks->fb_state &= ~INPROGRESS; wake_worklist(&freeblks->fb_list); @@ -8080,13 +8128,8 @@ indir_trunc(freework, dbn, lbn) ufs1_daddr_t *bap1; ufs2_daddr_t nb, nnb, *bap2; ufs_lbn_t lbnadd, nlbn; - int i, nblocks, ufs1fmt; - int freedblocks; - int goingaway; - int freedeps; - int needj; - int level; - int cnt; + int nblocks, ufs1fmt, firstfree, trimtype, freedblocks; + int goingaway, freedeps, needj, level, cnt, i; freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); @@ -8180,6 +8223,7 @@ indir_trunc(freework, dbn, lbn) * arranges for the current level to be freed when subordinates * are free when journaling. */ + firstfree = 1; for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { if (i != NINDIR(fs) - 1) { if (ufs1fmt) @@ -8215,11 +8259,26 @@ indir_trunc(freework, dbn, lbn) freedeps++; } CTR3(KTR_SUJ, - "indir_trunc: ino %d blkno %jd size %ld", + "indir_trunc: ino %jd blkno %jd size %d", freeblks->fb_inum, nb, fs->fs_bsize); + if (firstfree) { + if (i == NINDIR(fs) - 1 || nnb == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i == NINDIR(fs) - 1 || nnb == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, fs->fs_bsize, freeblks->fb_inum, - freeblks->fb_vtype, &wkhd); + freeblks->fb_vtype, &wkhd, trimtype); } } if (goingaway) { @@ -8244,7 +8303,7 @@ indir_trunc(freework, dbn, lbn) if (level == 0) freeblks->fb_cgwait += freedeps; if (freework->fw_ref == 0) - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON); FREE_LOCK(ump); return; } @@ -8253,10 +8312,10 @@ indir_trunc(freework, dbn, lbn) */ dbn = dbtofsb(fs, dbn); CTR3(KTR_SUJ, - "indir_trunc 2: ino %d blkno %jd size %ld", + "indir_trunc 2: ino %jd blkno %jd size %d", freeblks->fb_inum, dbn, fs->fs_bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_inum, freeblks->fb_vtype, NULL); + freeblks->fb_inum, freeblks->fb_vtype, NULL, SINGLETON); /* Non SUJ softdep does single-threaded truncations. */ if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 6 21:09:11 2018 (r337396) @@ -978,6 +978,8 @@ ffs_mountfs(devvp, mp, td) taskqueue_thread_enqueue, &ump->um_trim_tq); taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, "%s trim", mp->mnt_stat.f_mntonname); + ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM, + &ump->um_trimlisthashsize); } } @@ -1256,6 +1258,7 @@ ffs_unmount(mp, mntflags) pause("ufsutr", hz); taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); + free (ump->um_trimhash, M_TRIM); } g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/softdep.h Mon Aug 6 21:09:11 2018 (r337396) @@ -557,6 +557,7 @@ struct freefrag { long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ enum vtype ff_vtype; /* owning inode's file type */ + int ff_trimtype; /* trim status when deleted */ }; /* Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ufs/ufsmount.h Mon Aug 6 21:09:11 2018 (r337396) @@ -47,6 +47,7 @@ struct ufs_args { #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_UFSMNT); +MALLOC_DECLARE(M_TRIM); #endif struct buf; @@ -63,6 +64,7 @@ struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); LIST_HEAD(bmsafemaphd, bmsafemap); +LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); /* * This structure describes the UFS specific mount structure data. @@ -101,6 +103,8 @@ struct ufsmount { u_int um_flags; /* (i) filesystem flags */ u_int um_trim_inflight; /* (a) outstanding trim count */ struct taskqueue *um_trim_tq; /* (c) trim request queue */ + struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */ + u_long um_trimlisthashsize; /* (i) trim hash table size-1 */ /* (c) - below function ptrs */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); From owner-svn-src-head@freebsd.org Mon Aug 6 21:54:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817C2106732A; Mon, 6 Aug 2018 21:54:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357078D76B; Mon, 6 Aug 2018 21:54:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F318112CF9; Mon, 6 Aug 2018 21:54:51 +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 w76LspU8046851; Mon, 6 Aug 2018 21:54:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76LspwN046850; Mon, 6 Aug 2018 21:54:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808062154.w76LspwN046850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 21:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337397 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337397 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 21:54:52 -0000 Author: np Date: Mon Aug 6 21:54:51 2018 New Revision: 337397 URL: https://svnweb.freebsd.org/changeset/base/337397 Log: cxgbe(4): Break up sysctl_bitfield into 8 bit and 16 bit variants. Have them display the current value of the bitfield rather than the fixed value that was provided when the sysctl node was created. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:09:11 2018 (r337396) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:54:51 2018 (r337397) @@ -547,7 +547,8 @@ static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); -static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); @@ -5454,8 +5455,8 @@ t4_sysctls(struct adapter *sc) sc->params.nports, "# of ports"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, - sysctl_bitfield, "A", "available doorbells"); + CTLTYPE_STRING | CTLFLAG_RD, doorbells, (uintptr_t)&sc->doorbells, + sysctl_bitfield_8b, "A", "available doorbells"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, sc->params.vpd.cclk, "core clock frequency (in KHz)"); @@ -5526,8 +5527,8 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ - CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text " capabilities") + CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], (uintptr_t)&sc->name, \ + sysctl_bitfield_16b, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -6215,7 +6216,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) } static int -sysctl_bitfield(SYSCTL_HANDLER_ARGS) +sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS) { int rc; struct sbuf *sb; @@ -6228,7 +6229,28 @@ sysctl_bitfield(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "%b", (int)arg2, (char *)arg1); + sbuf_printf(sb, "%b", *(uint8_t *)(uintptr_t)arg2, (char *)arg1); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + +static int +sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS) +{ + int rc; + struct sbuf *sb; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "%b", *(uint16_t *)(uintptr_t)arg2, (char *)arg1); rc = sbuf_finish(sb); sbuf_delete(sb); From owner-svn-src-head@freebsd.org Mon Aug 6 23:21:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470501069357; Mon, 6 Aug 2018 23:21:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDA70704AC; Mon, 6 Aug 2018 23:21:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEABE139EA; Mon, 6 Aug 2018 23:21:14 +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 w76NLEPF092045; Mon, 6 Aug 2018 23:21:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76NLDO6092038; Mon, 6 Aug 2018 23:21:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808062321.w76NLDO6092038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 23:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337398 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 337398 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 23:21:15 -0000 Author: np Date: Mon Aug 6 23:21:13 2018 New Revision: 337398 URL: https://svnweb.freebsd.org/changeset/base/337398 Log: cxgbe(4): Allow user-configured and driver-configured traffic classes to be used simultaneously. Move sysctl_tc and sysctl_tc_params to t4_sched.c while here. MFC after: 3 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/adapter.h Mon Aug 6 23:21:13 2018 (r337398) @@ -235,13 +235,15 @@ struct tx_ch_rl_params { }; enum { - TX_CLRL_REFRESH = (1 << 0), /* Need to update hardware state. */ - TX_CLRL_ERROR = (1 << 1), /* Error, hardware state unknown. */ + CLRL_USER = (1 << 0), /* allocated manually. */ + CLRL_SYNC = (1 << 1), /* sync hw update in progress. */ + CLRL_ASYNC = (1 << 2), /* async hw update requested. */ + CLRL_ERR = (1 << 3), /* last hw setup ended in error. */ }; struct tx_cl_rl_params { int refcount; - u_int flags; + uint8_t flags; enum fw_sched_params_rate ratemode; /* %port REL or ABS value */ enum fw_sched_params_unit rateunit; /* kbps or pps (when ABS) */ enum fw_sched_params_mode mode; /* aggr or per-flow */ @@ -1237,7 +1239,9 @@ int t4_init_tx_sched(struct adapter *); int t4_free_tx_sched(struct adapter *); void t4_update_tx_sched(struct adapter *); int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); -void t4_release_cl_rl_kbps(struct adapter *, int, int); +void t4_release_cl_rl(struct adapter *, int, int); +int sysctl_tc(SYSCTL_HANDLER_ARGS); +int sysctl_tc_params(SYSCTL_HANDLER_ARGS); #ifdef RATELIMIT void t4_init_etid_table(struct adapter *); void t4_free_etid_table(struct adapter *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 6 23:21:13 2018 (r337398) @@ -589,7 +589,6 @@ static int sysctl_tp_la(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); -static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); @@ -5963,6 +5962,7 @@ cxgbe_sysctls(struct port_info *pi) struct adapter *sc = pi->adapter; int i; char name[16]; + static char *tc_flags = {"\20\1USER\2SYNC\3ASYNC\4ERR"}; ctx = device_get_sysctl_ctx(pi->dev); @@ -6015,8 +6015,9 @@ cxgbe_sysctls(struct port_info *pi) children2 = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD, NULL, "traffic class")); - SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "flags", CTLFLAG_RD, - &tc->flags, 0, "flags"); + SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "flags", + CTLTYPE_STRING | CTLFLAG_RD, tc_flags, (uintptr_t)&tc->flags, + sysctl_bitfield_8b, "A", "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", @@ -8607,83 +8608,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) } } rc = sbuf_finish(sb); - sbuf_delete(sb); - - return (rc); -} - -static int -sysctl_tc_params(SYSCTL_HANDLER_ARGS) -{ - struct adapter *sc = arg1; - struct tx_cl_rl_params tc; - struct sbuf *sb; - int i, rc, port_id, mbps, gbps; - - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); - if (sb == NULL) - return (ENOMEM); - - port_id = arg2 >> 16; - MPASS(port_id < sc->params.nports); - MPASS(sc->port[port_id] != NULL); - i = arg2 & 0xffff; - MPASS(i < sc->chip_params->nsched_cls); - - mtx_lock(&sc->tc_lock); - tc = sc->port[port_id]->sched_params->cl_rl[i]; - mtx_unlock(&sc->tc_lock); - - switch (tc.rateunit) { - case SCHED_CLASS_RATEUNIT_BITS: - switch (tc.ratemode) { - case SCHED_CLASS_RATEMODE_REL: - /* XXX: top speed or actual link speed? */ - gbps = port_top_speed(sc->port[port_id]); - sbuf_printf(sb, "%u%% of %uGbps", tc.maxrate, gbps); - break; - case SCHED_CLASS_RATEMODE_ABS: - mbps = tc.maxrate / 1000; - gbps = tc.maxrate / 1000000; - if (tc.maxrate == gbps * 1000000) - sbuf_printf(sb, "%uGbps", gbps); - else if (tc.maxrate == mbps * 1000) - sbuf_printf(sb, "%uMbps", mbps); - else - sbuf_printf(sb, "%uKbps", tc.maxrate); - break; - default: - rc = ENXIO; - goto done; - } - break; - case SCHED_CLASS_RATEUNIT_PKTS: - sbuf_printf(sb, "%upps", tc.maxrate); - break; - default: - rc = ENXIO; - goto done; - } - - switch (tc.mode) { - case SCHED_CLASS_MODE_CLASS: - sbuf_printf(sb, " aggregate"); - break; - case SCHED_CLASS_MODE_FLOW: - sbuf_printf(sb, " per-flow"); - break; - default: - rc = ENXIO; - goto done; - } - -done: - if (rc == 0) - rc = sbuf_finish(sb); sbuf_delete(sb); return (rc); Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_sched.c Mon Aug 6 23:21:13 2018 (r337398) @@ -75,7 +75,7 @@ set_sched_class_params(struct adapter *sc, struct t4_s { int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode; struct port_info *pi; - struct tx_cl_rl_params *tc; + struct tx_cl_rl_params *tc, old; bool check_pktsize = false; if (p->level == SCHED_CLASS_LEVEL_CL_RL) @@ -179,43 +179,62 @@ set_sched_class_params(struct adapter *sc, struct t4_s return (ERANGE); } - rc = begin_synchronized_op(sc, NULL, - sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); - if (rc) - return (rc); if (p->level == SCHED_CLASS_LEVEL_CL_RL) { tc = &pi->sched_params->cl_rl[p->cl]; - if (tc->refcount > 0) { + mtx_lock(&sc->tc_lock); + if (tc->refcount > 0 || tc->flags & (CLRL_SYNC | CLRL_ASYNC)) rc = EBUSY; - goto done; - } else { + else { + tc->flags |= CLRL_SYNC | CLRL_USER; tc->ratemode = fw_ratemode; tc->rateunit = fw_rateunit; tc->mode = fw_mode; tc->maxrate = p->maxrate; tc->pktsize = p->pktsize; + rc = 0; + old= *tc; } + mtx_unlock(&sc->tc_lock); + if (rc != 0) + return (rc); } + + rc = begin_synchronized_op(sc, NULL, + sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); + if (rc != 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + *tc = old; + mtx_unlock(&sc->tc_lock); + } + return (rc); + } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, p->weight, p->pktsize, sleep_ok); - if (p->level == SCHED_CLASS_LEVEL_CL_RL && rc != 0) { - /* - * Unknown state at this point, see parameters in tc for what - * was attempted. - */ - tc->flags |= TX_CLRL_ERROR; - } -done: end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + MPASS(tc->flags & CLRL_SYNC); + MPASS(tc->flags & CLRL_USER); + MPASS(tc->refcount == 0); + + tc->flags &= ~CLRL_SYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; + mtx_unlock(&sc->tc_lock); + } + return (rc); } static void update_tx_sched(void *context, int pending) { - int i, j, mode, rateunit, ratemode, maxrate, pktsize, rc; + int i, j, rc; struct port_info *pi; struct tx_cl_rl_params *tc; struct adapter *sc = context; @@ -227,14 +246,8 @@ update_tx_sched(void *context, int pending) tc = &pi->sched_params->cl_rl[0]; for (j = 0; j < n; j++, tc++) { MPASS(mtx_owned(&sc->tc_lock)); - if ((tc->flags & TX_CLRL_REFRESH) == 0) + if ((tc->flags & CLRL_ASYNC) == 0) continue; - - mode = tc->mode; - rateunit = tc->rateunit; - ratemode = tc->ratemode; - maxrate = tc->maxrate; - pktsize = tc->pktsize; mtx_unlock(&sc->tc_lock); if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, @@ -242,21 +255,19 @@ update_tx_sched(void *context, int pending) mtx_lock(&sc->tc_lock); continue; } - rc = t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, - FW_SCHED_PARAMS_LEVEL_CL_RL, mode, rateunit, - ratemode, pi->tx_chan, j, 0, maxrate, 0, pktsize, - 1); + rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, + FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, + tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, + tc->pktsize, 1); end_synchronized_op(sc, 0); mtx_lock(&sc->tc_lock); - if (rc != 0) { - tc->flags |= TX_CLRL_ERROR; - } else if (tc->mode == mode && - tc->rateunit == rateunit && - tc->maxrate == maxrate && - tc->pktsize == tc->pktsize) { - tc->flags &= ~(TX_CLRL_REFRESH | TX_CLRL_ERROR); - } + MPASS(tc->flags & CLRL_ASYNC); + tc->flags &= ~CLRL_ASYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; } } mtx_unlock(&sc->tc_lock); @@ -278,74 +289,135 @@ t4_set_sched_class(struct adapter *sc, struct t4_sched return (EINVAL); } -int -t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +static int +bind_txq_to_traffic_class(struct adapter *sc, struct sge_txq *txq, int idx) { - struct port_info *pi = NULL; - struct vi_info *vi; - struct sge_txq *txq; - uint32_t fw_mnem, fw_queue, fw_class; - int i, rc; + struct tx_cl_rl_params *tc0, *tc; + int rc, old_idx; + uint32_t fw_mnem, fw_class; - rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsq"); - if (rc) - return (rc); + if (!(txq->eq.flags & EQ_ALLOCATED)) + return (EAGAIN); - if (p->port >= sc->params.nports) { - rc = EINVAL; + mtx_lock(&sc->tc_lock); + if (txq->tc_idx == -2) { + rc = EBUSY; /* Another bind/unbind in progress already. */ goto done; } - - /* XXX: Only supported for the main VI. */ - pi = sc->port[p->port]; - vi = &pi->vi[0]; - if (!(vi->flags & VI_INIT_DONE)) { - /* tx queues not set up yet */ - rc = EAGAIN; + if (idx == txq->tc_idx) { + rc = 0; /* No change, nothing to do. */ goto done; } - if (!in_range(p->queue, 0, vi->ntxq - 1) || - !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) { - rc = EINVAL; - goto done; + tc0 = &sc->port[txq->eq.tx_chan]->sched_params->cl_rl[0]; + if (idx != -1) { + /* + * Bind to a different class at index idx. + */ + tc = &tc0[idx]; + if (tc->flags & CLRL_ERR) { + rc = ENXIO; + goto done; + } else { + /* + * Ok to proceed. Place a reference on the new class + * while still holding on to the reference on the + * previous class, if any. + */ + tc->refcount++; + } } + /* Mark as busy before letting go of the lock. */ + old_idx = txq->tc_idx; + txq->tc_idx = -2; + mtx_unlock(&sc->tc_lock); - /* - * Create a template for the FW_PARAMS_CMD mnemonic and value (TX - * Scheduling Class in this case). - */ + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4btxq"); + if (rc != 0) + return (rc); fw_mnem = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH)); - fw_class = p->cl < 0 ? 0xffffffff : p->cl; + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | + V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); + fw_class = idx < 0 ? 0xffffffff : idx; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_mnem, &fw_class); + end_synchronized_op(sc, 0); - /* - * If op.queue is non-negative, then we're only changing the scheduling - * on a single specified TX queue. - */ - if (p->queue >= 0) { - txq = &sc->sge.txq[vi->first_txq + p->queue]; - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - goto done; + mtx_lock(&sc->tc_lock); + MPASS(txq->tc_idx == -2); + if (rc == 0) { + /* + * Unbind, bind, or bind to a different class succeeded. Remove + * the reference on the old traffic class, if any. + */ + if (old_idx != -1) { + tc = &tc0[old_idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = idx; + } else { + /* + * Unbind, bind, or bind to a different class failed. Remove + * the anticipatory reference on the new traffic class, if any. + */ + if (idx != -1) { + tc = &tc0[idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = old_idx; } +done: + MPASS(txq->tc_idx >= -1 && txq->tc_idx < sc->chip_params->nsched_cls); + mtx_unlock(&sc->tc_lock); + return (rc); +} +int +t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +{ + struct port_info *pi = NULL; + struct vi_info *vi; + struct sge_txq *txq; + int i, rc; + + if (p->port >= sc->params.nports) + return (EINVAL); + /* - * Change the scheduling on all the TX queues for the - * interface. + * XXX: cxgbetool allows the user to specify the physical port only. So + * we always operate on the main VI. */ - for_each_txq(vi, i, txq) { - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - if (rc) - goto done; + pi = sc->port[p->port]; + vi = &pi->vi[0]; + + /* Checking VI_INIT_DONE outside a synch-op is a harmless race here. */ + if (!(vi->flags & VI_INIT_DONE)) + return (EAGAIN); + + if (!in_range(p->queue, 0, vi->ntxq - 1) || + !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + if (p->queue < 0) { + /* + * Change the scheduling on all the TX queues for the + * interface. + */ + for_each_txq(vi, i, txq) { + rc = bind_txq_to_traffic_class(sc, txq, p->cl); + if (rc != 0) + break; + } + } else { + /* + * If op.queue is non-negative, then we're only changing the + * scheduling on a single specified TX queue. + */ + txq = &sc->sge.txq[vi->first_txq + p->queue]; + rc = bind_txq_to_traffic_class(sc, txq, p->cl); } - rc = 0; -done: - end_synchronized_op(sc, 0); return (rc); } @@ -372,10 +444,8 @@ t4_init_tx_sched(struct adapter *sc) tc->maxrate = 1000 * 1000; /* 1 Gbps. Arbitrary */ if (t4_sched_params_cl_rl_kbps(sc, pi->tx_chan, j, - tc->mode, tc->maxrate, tc->pktsize, 1) == 0) - tc->flags = 0; - else - tc->flags = TX_CLRL_ERROR; + tc->mode, tc->maxrate, tc->pktsize, 1) != 0) + tc->flags = CLRL_ERR; } } @@ -412,49 +482,61 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, int *tc_idx) { int rc = 0, fa = -1, i; + bool update; struct tx_cl_rl_params *tc; + struct port_info *pi; MPASS(port_id >= 0 && port_id < sc->params.nports); - tc = &sc->port[port_id]->sched_params->cl_rl[0]; + pi = sc->port[port_id]; + tc = &pi->sched_params->cl_rl[0]; + update = false; mtx_lock(&sc->tc_lock); for (i = 0; i < sc->chip_params->nsched_cls; i++, tc++) { - if (fa < 0 && tc->refcount == 0) - fa = i; + if (fa < 0 && tc->refcount == 0 && !(tc->flags & CLRL_USER)) + fa = i; /* first available */ if (tc->ratemode == FW_SCHED_PARAMS_RATE_ABS && tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE && tc->mode == FW_SCHED_PARAMS_MODE_FLOW && - tc->maxrate == maxrate) { + tc->maxrate == maxrate && + tc->pktsize == pi->vi[0].ifp->if_mtu) { tc->refcount++; *tc_idx = i; + if ((tc->flags & (CLRL_ERR | CLRL_ASYNC | CLRL_SYNC)) == + CLRL_ERR) { + update = true; + } goto done; } } /* Not found */ MPASS(i == sc->chip_params->nsched_cls); if (fa != -1) { - tc = &sc->port[port_id]->sched_params->cl_rl[fa]; - tc->flags = TX_CLRL_REFRESH; + tc = &pi->sched_params->cl_rl[fa]; tc->refcount = 1; tc->ratemode = FW_SCHED_PARAMS_RATE_ABS; tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; tc->mode = FW_SCHED_PARAMS_MODE_FLOW; tc->maxrate = maxrate; - tc->pktsize = ETHERMTU; /* XXX */ + tc->pktsize = pi->vi[0].ifp->if_mtu; *tc_idx = fa; - t4_update_tx_sched(sc); + update = true; } else { *tc_idx = -1; rc = ENOSPC; } done: mtx_unlock(&sc->tc_lock); + if (update) { + tc->flags |= CLRL_ASYNC; + t4_update_tx_sched(sc); + } return (rc); } void -t4_release_cl_rl_kbps(struct adapter *sc, int port_id, int tc_idx) +t4_release_cl_rl(struct adapter *sc, int port_id, int tc_idx) { struct tx_cl_rl_params *tc; @@ -464,13 +546,114 @@ t4_release_cl_rl_kbps(struct adapter *sc, int port_id, mtx_lock(&sc->tc_lock); tc = &sc->port[port_id]->sched_params->cl_rl[tc_idx]; MPASS(tc->refcount > 0); - MPASS(tc->ratemode == FW_SCHED_PARAMS_RATE_ABS); - MPASS(tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE); - MPASS(tc->mode == FW_SCHED_PARAMS_MODE_FLOW); tc->refcount--; mtx_unlock(&sc->tc_lock); } +int +sysctl_tc(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct port_info *pi; + struct adapter *sc; + struct sge_txq *txq; + int qidx = arg2, rc, tc_idx; + + MPASS(qidx >= 0 && qidx < vi->ntxq); + pi = vi->pi; + sc = pi->adapter; + txq = &sc->sge.txq[vi->first_txq + qidx]; + + tc_idx = txq->tc_idx; + rc = sysctl_handle_int(oidp, &tc_idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (sc->flags & IS_VF) + return (EPERM); + if (!in_range(tc_idx, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + return (bind_txq_to_traffic_class(sc, txq, tc_idx)); +} + +int +sysctl_tc_params(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct tx_cl_rl_params tc; + struct sbuf *sb; + int i, rc, port_id, mbps, gbps; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + port_id = arg2 >> 16; + MPASS(port_id < sc->params.nports); + MPASS(sc->port[port_id] != NULL); + i = arg2 & 0xffff; + MPASS(i < sc->chip_params->nsched_cls); + + mtx_lock(&sc->tc_lock); + tc = sc->port[port_id]->sched_params->cl_rl[i]; + mtx_unlock(&sc->tc_lock); + + switch (tc.rateunit) { + case SCHED_CLASS_RATEUNIT_BITS: + switch (tc.ratemode) { + case SCHED_CLASS_RATEMODE_REL: + /* XXX: top speed or actual link speed? */ + gbps = port_top_speed(sc->port[port_id]); + sbuf_printf(sb, "%u%% of %uGbps", tc.maxrate, gbps); + break; + case SCHED_CLASS_RATEMODE_ABS: + mbps = tc.maxrate / 1000; + gbps = tc.maxrate / 1000000; + if (tc.maxrate == gbps * 1000000) + sbuf_printf(sb, "%uGbps", gbps); + else if (tc.maxrate == mbps * 1000) + sbuf_printf(sb, "%uMbps", mbps); + else + sbuf_printf(sb, "%uKbps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + break; + case SCHED_CLASS_RATEUNIT_PKTS: + sbuf_printf(sb, "%upps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + + switch (tc.mode) { + case SCHED_CLASS_MODE_CLASS: + sbuf_printf(sb, " aggregate"); + break; + case SCHED_CLASS_MODE_FLOW: + sbuf_printf(sb, " per-flow"); + break; + default: + rc = ENXIO; + goto done; + } + +done: + if (rc == 0) + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + #ifdef RATELIMIT void t4_init_etid_table(struct adapter *sc) @@ -578,7 +761,7 @@ cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_ta cst = malloc(sizeof(*cst), M_CXGBE, M_ZERO | M_NOWAIT); if (cst == NULL) { failed: - t4_release_cl_rl_kbps(sc, pi->port_id, schedcl); + t4_release_cl_rl(sc, pi->port_id, schedcl); return (ENOMEM); } @@ -634,7 +817,7 @@ cxgbe_snd_tag_modify(struct m_snd_tag *mst, if (rc != 0) return (rc); MPASS(schedcl >= 0 && schedcl < sc->chip_params->nsched_cls); - t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + t4_release_cl_rl(sc, cst->port_id, cst->schedcl); cst->schedcl = schedcl; cst->max_rate = params->rate_limit.max_rate; mtx_unlock(&cst->lock); @@ -675,7 +858,7 @@ cxgbe_snd_tag_free_locked(struct cxgbe_snd_tag *cst) if (cst->etid >= 0) free_etid(sc, cst->etid); if (cst->schedcl != -1) - t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + t4_release_cl_rl(sc, cst->port_id, cst->schedcl); mtx_unlock(&cst->lock); mtx_destroy(&cst->lock); free(cst, M_CXGBE); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 6 23:21:13 2018 (r337398) @@ -296,7 +296,6 @@ static void drain_wrq_wr_list(struct adapter *, struct static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); -static int sysctl_tc(SYSCTL_HANDLER_ARGS); #ifdef RATELIMIT static inline u_int txpkt_eo_len16(u_int, u_int, u_int); static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, @@ -5365,91 +5364,6 @@ sysctl_bufsizes(SYSCTL_HANDLER_ARGS) sbuf_finish(&sb); rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); sbuf_delete(&sb); - return (rc); -} - -static int -sysctl_tc(SYSCTL_HANDLER_ARGS) -{ - struct vi_info *vi = arg1; - struct port_info *pi; - struct adapter *sc; - struct sge_txq *txq; - struct tx_cl_rl_params *tc; - int qidx = arg2, rc, tc_idx; - uint32_t fw_queue, fw_class; - - MPASS(qidx >= 0 && qidx < vi->ntxq); - pi = vi->pi; - sc = pi->adapter; - txq = &sc->sge.txq[vi->first_txq + qidx]; - - tc_idx = txq->tc_idx; - rc = sysctl_handle_int(oidp, &tc_idx, 0, req); - if (rc != 0 || req->newptr == NULL) - return (rc); - - if (sc->flags & IS_VF) - return (EPERM); - - /* Note that -1 is legitimate input (it means unbind). */ - if (tc_idx < -1 || tc_idx >= sc->chip_params->nsched_cls) - return (EINVAL); - - mtx_lock(&sc->tc_lock); - if (tc_idx == txq->tc_idx) { - rc = 0; /* No change, nothing to do. */ - goto done; - } - - fw_queue = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | - V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id); - - if (tc_idx == -1) - fw_class = 0xffffffff; /* Unbind. */ - else { - /* - * Bind to a different class. - */ - tc = &pi->sched_params->cl_rl[tc_idx]; - if (tc->flags & TX_CLRL_ERROR) { - /* Previous attempt to set the cl-rl params failed. */ - rc = EIO; - goto done; - } else { - /* - * Ok to proceed. Place a reference on the new class - * while still holding on to the reference on the - * previous class, if any. - */ - fw_class = tc_idx; - tc->refcount++; - } - } - mtx_unlock(&sc->tc_lock); - - rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4stc"); - if (rc) - return (rc); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, &fw_class); - end_synchronized_op(sc, 0); - - mtx_lock(&sc->tc_lock); - if (rc == 0) { - if (txq->tc_idx != -1) { - tc = &pi->sched_params->cl_rl[txq->tc_idx]; - MPASS(tc->refcount > 0); - tc->refcount--; - } - txq->tc_idx = tc_idx; - } else if (tc_idx != -1) { - tc = &pi->sched_params->cl_rl[tc_idx]; - MPASS(tc->refcount > 0); - tc->refcount--; - } -done: - mtx_unlock(&sc->tc_lock); return (rc); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 23:21:13 2018 (r337398) @@ -231,7 +231,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || (wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq)) == NULL) { if (tc_idx >= 0) - t4_release_cl_rl_kbps(sc, port_id, tc_idx); + t4_release_cl_rl(sc, port_id, tc_idx); return (ENOMEM); } @@ -259,7 +259,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb } if (toep->tc_idx >= 0) - t4_release_cl_rl_kbps(sc, port_id, toep->tc_idx); + t4_release_cl_rl(sc, port_id, toep->tc_idx); toep->tc_idx = tc_idx; return (0); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/tom/t4_tom.c Mon Aug 6 23:21:13 2018 (r337398) @@ -317,10 +317,9 @@ release_offload_resources(struct toepcb *toep) if (toep->ce) release_lip(td, toep->ce); -#ifdef RATELIMIT if (toep->tc_idx != -1) - t4_release_cl_rl_kbps(sc, toep->vi->pi->port_id, toep->tc_idx); -#endif + t4_release_cl_rl(sc, toep->vi->pi->port_id, toep->tc_idx); + mtx_lock(&td->toep_list_lock); TAILQ_REMOVE(&td->toep_list, toep, link); mtx_unlock(&td->toep_list_lock); From owner-svn-src-head@freebsd.org Mon Aug 6 23:51:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2ACF106A089; Mon, 6 Aug 2018 23:51:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A76971A45; Mon, 6 Aug 2018 23:51:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B9A513EBC; Mon, 6 Aug 2018 23:51:09 +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 w76Np9ru003898; Mon, 6 Aug 2018 23:51:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Np90e003896; Mon, 6 Aug 2018 23:51:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808062351.w76Np90e003896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Aug 2018 23:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337399 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 337399 X-SVN-Commit-Repository: base 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.27 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, 06 Aug 2018 23:51:10 -0000 Author: jhb Date: Mon Aug 6 23:51:08 2018 New Revision: 337399 URL: https://svnweb.freebsd.org/changeset/base/337399 Log: Make the system C11 atomics headers fully compatible with external GCC. The and headers already included support for C11 atomics via intrinsincs in modern versions of GCC, but these versions tried to "hide" atomic variables inside a wrapper structure. This wrapper is not compatible with GCC's internal header, so that if GCC's was used together with , use of C11 atomics would fail to compile. Fix this by not hiding atomic variables in a structure for modern versions of GCC. The headers already avoid using a wrapper structure on clang. Note that this wrapper was only used if C11 was not enabled (e.g. via -std=c99), so this also fixes compile failures if a modern version of GCC was used with -std=c11 but with FreeBSD's instead of GCC's and this change fixes that case as well. Reported by: Mark Millard Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D16585 Modified: head/sys/sys/cdefs.h head/sys/sys/stdatomic.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Aug 6 23:21:13 2018 (r337398) +++ head/sys/sys/cdefs.h Mon Aug 6 23:51:08 2018 (r337399) @@ -268,7 +268,7 @@ #endif #if !defined(__cplusplus) && !__has_extension(c_atomic) && \ - !__has_extension(cxx_atomic) + !__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 7) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Mon Aug 6 23:21:13 2018 (r337398) +++ head/sys/sys/stdatomic.h Mon Aug 6 23:51:08 2018 (r337399) @@ -171,12 +171,9 @@ atomic_signal_fence(memory_order __order __unused) /* Atomics in kernelspace are always lock-free. */ #define atomic_is_lock_free(obj) \ ((void)(obj), (_Bool)1) -#elif defined(__CLANG_ATOMICS) +#elif defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ __atomic_is_lock_free(sizeof(*(obj)), obj) -#elif defined(__GNUC_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) #else #define atomic_is_lock_free(obj) \ ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) @@ -260,28 +257,28 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; #elif defined(__GNUC_ATOMICS) #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ + __atomic_compare_exchange_n(object, expected, \ desired, 0, success, failure) #define atomic_compare_exchange_weak_explicit(object, expected, \ desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ + __atomic_compare_exchange_n(object, expected, \ desired, 1, success, failure) #define atomic_exchange_explicit(object, desired, order) \ - __atomic_exchange_n(&(object)->__val, desired, order) + __atomic_exchange_n(object, desired, order) #define atomic_fetch_add_explicit(object, operand, order) \ - __atomic_fetch_add(&(object)->__val, operand, order) + __atomic_fetch_add(object, operand, order) #define atomic_fetch_and_explicit(object, operand, order) \ - __atomic_fetch_and(&(object)->__val, operand, order) + __atomic_fetch_and(object, operand, order) #define atomic_fetch_or_explicit(object, operand, order) \ - __atomic_fetch_or(&(object)->__val, operand, order) + __atomic_fetch_or(object, operand, order) #define atomic_fetch_sub_explicit(object, operand, order) \ - __atomic_fetch_sub(&(object)->__val, operand, order) + __atomic_fetch_sub(object, operand, order) #define atomic_fetch_xor_explicit(object, operand, order) \ - __atomic_fetch_xor(&(object)->__val, operand, order) + __atomic_fetch_xor(object, operand, order) #define atomic_load_explicit(object, order) \ - __atomic_load_n(&(object)->__val, order) + __atomic_load_n(object, order) #define atomic_store_explicit(object, desired, order) \ - __atomic_store_n(&(object)->__val, desired, order) + __atomic_store_n(object, desired, order) #else #define __atomic_apply_stride(object, operand) \ (((__typeof__((object)->__val))0) + (operand)) From owner-svn-src-head@freebsd.org Tue Aug 7 00:10:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1FEA106AC37; Tue, 7 Aug 2018 00:10:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89A4272473; Tue, 7 Aug 2018 00:10:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ADF6142F0; Tue, 7 Aug 2018 00:10:58 +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 w770AwKA013930; Tue, 7 Aug 2018 00:10:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w770AwNA013929; Tue, 7 Aug 2018 00:10:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808070010.w770AwNA013929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Aug 2018 00:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337400 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 337400 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 00:10:59 -0000 Author: jhb Date: Tue Aug 7 00:10:58 2018 New Revision: 337400 URL: https://svnweb.freebsd.org/changeset/base/337400 Log: Remove spurious ABI tags from kdump output. The abidump routine output an ABI tag when -A was specified for records that were not displayed due to type or pid filtering. To fix, split the code to lookup the ABI from the code to display the ABI, move the code to display the ABI into dumpheader(), and move dumpheader() later in the main loop as a simplification. Previously dumpheader() was called under a condition that repeated conditions made later in the main loop. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D16608 Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Aug 6 23:51:08 2018 (r337399) +++ head/usr.bin/kdump/kdump.c Tue Aug 7 00:10:58 2018 (r337400) @@ -94,10 +94,10 @@ __FBSDID("$FreeBSD$"); #include #endif -u_int abidump(struct ktr_header *); int fetchprocinfo(struct ktr_header *, u_int *); +u_int findabi(struct ktr_header *); int fread_tail(void *, int, int); -void dumpheader(struct ktr_header *); +void dumpheader(struct ktr_header *, u_int); void ktrsyscall(struct ktr_syscall *, u_int); void ktrsysret(struct ktr_sysret *, u_int); void ktrnamei(char *, int); @@ -466,10 +466,6 @@ main(int argc, char *argv[]) drop_logged = 1; } } - if (trpoints & (1< size) { @@ -482,12 +478,13 @@ main(int argc, char *argv[]) errx(1, "data too short"); if (fetchprocinfo(&ktr_header, (u_int *)m) != 0) continue; - sv_flags = abidump(&ktr_header); if (pid && ktr_header.ktr_pid != pid && ktr_header.ktr_tid != pid) continue; if ((trpoints & (1<pid == kth->ktr_pid) { - flags = pi->sv_flags; - break; + return (pi->sv_flags); } } - - if (abiflag == 0) - return (flags); - - switch (flags & SV_ABI_MASK) { - case SV_ABI_LINUX: - abi = "L"; - break; - case SV_ABI_FREEBSD: - abi = "F"; - break; - case SV_ABI_CLOUDABI: - abi = "C"; - break; - default: - abi = "U"; - break; - } - - if (flags & SV_LP64) - arch = "64"; - else if (flags & SV_ILP32) - arch = "32"; - else - arch = "00"; - - printf("%s%s ", abi, arch); - - return (flags); + return (0); } void -dumpheader(struct ktr_header *kth) +dumpheader(struct ktr_header *kth, u_int sv_flags) { static char unknown[64]; static struct timeval prevtime, prevtime_e; struct timeval temp; + const char *abi; + const char *arch; const char *type; const char *sign; @@ -670,10 +637,6 @@ dumpheader(struct ktr_header *kth) case KTR_SYSCTL: type = "SCTL"; break; - case KTR_PROCCTOR: - /* FALLTHROUGH */ - case KTR_PROCDTOR: - return; case KTR_CAPFAIL: type = "CAP "; break; @@ -731,6 +694,31 @@ dumpheader(struct ktr_header *kth) } } printf("%s ", type); + if (abiflag != 0) { + switch (sv_flags & SV_ABI_MASK) { + case SV_ABI_LINUX: + abi = "L"; + break; + case SV_ABI_FREEBSD: + abi = "F"; + break; + case SV_ABI_CLOUDABI: + abi = "C"; + break; + default: + abi = "U"; + break; + } + + if ((sv_flags & SV_LP64) != 0) + arch = "64"; + else if ((sv_flags & SV_ILP32) != 0) + arch = "32"; + else + arch = "00"; + + printf("%s%s ", abi, arch); + } } #include From owner-svn-src-head@freebsd.org Tue Aug 7 00:51:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46ADB106BB76; Tue, 7 Aug 2018 00:51:50 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE713736A1; Tue, 7 Aug 2018 00:51:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D121E148AA; Tue, 7 Aug 2018 00:51:49 +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 w770pnTh036269; Tue, 7 Aug 2018 00:51:49 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w770pn13036259; Tue, 7 Aug 2018 00:51:49 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808070051.w770pn13036259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 7 Aug 2018 00:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337401 - head/release X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 337401 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 00:51:50 -0000 Author: cperciva Date: Tue Aug 7 00:51:49 2018 New Revision: 337401 URL: https://svnweb.freebsd.org/changeset/base/337401 Log: Fix copy-and-paste error in previous commit. Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Tue Aug 7 00:10:58 2018 (r337400) +++ head/release/Makefile.ec2 Tue Aug 7 00:51:49 2018 (r337401) @@ -36,7 +36,7 @@ AMINAMESUFFIX!= date +-%Y-%m-%d PUBLISH= --public .endif .if defined(EC2PUBLICSNAP) && !empty(EC2PUBLICSNAP) -PUBLISH= --publicsnap +PUBLICSNAP= --publicsnap .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} From owner-svn-src-head@freebsd.org Tue Aug 7 07:13:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C046104F98D; Tue, 7 Aug 2018 07:13:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C240380D56; Tue, 7 Aug 2018 07:12:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB1C1894A; Tue, 7 Aug 2018 07:12:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w777CxWN036105; Tue, 7 Aug 2018 07:12:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w777Cxb3036104; Tue, 7 Aug 2018 07:12:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808070712.w777Cxb3036104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 Aug 2018 07:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337410 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337410 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 07:13:00 -0000 Author: cy Date: Tue Aug 7 07:12:59 2018 New Revision: 337410 URL: https://svnweb.freebsd.org/changeset/base/337410 Log: Remove redundant and incorrect default definition of AF_INET6. AF_INET6 is defined in sys/socket.h where it's defined as 28. A bit of trivia: On NetBSD AF_INET6 is defined as 24. On Solaris it is defined as 26. This is probably why Darren defaulted to 26, because ipfilter was originally written for SunOS 4 and Solaris many moons ago. MFC after: 2 weeks Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 7 03:39:29 2018 (r337409) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 7 07:12:59 2018 (r337410) @@ -1463,10 +1463,6 @@ typedef struct tcpiphdr tcpiphdr_t; # define DPRINT(x) #endif -#ifndef AF_INET6 -# define AF_INET6 26 -#endif - #ifdef DTRACE_PROBE # ifdef _KERNEL # define DT(_n) DTRACE_PROBE(_n) From owner-svn-src-head@freebsd.org Tue Aug 7 08:33:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB751052530; Tue, 7 Aug 2018 08:33:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8370839D4; Tue, 7 Aug 2018 08:33:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A929A196A9; Tue, 7 Aug 2018 08:33:40 +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 w778Xepr077456; Tue, 7 Aug 2018 08:33:40 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w778Xe2o077455; Tue, 7 Aug 2018 08:33:40 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808070833.w778Xe2o077455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 7 Aug 2018 08:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337411 - head/sys/dev/vt/hw/vga X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 337411 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 08:33:41 -0000 Author: cperciva Date: Tue Aug 7 08:33:40 2018 New Revision: 337411 URL: https://svnweb.freebsd.org/changeset/base/337411 Log: Replace a pair of 8-bit writes to VGA memory with a single 16-bit write. The VGA "text mode" buffer has a pair of bytes for each character: One byte for the character symbol, and an "attribute" byte encoding the foreground and background colours. When updating the screen, we were writing these two bytes separately. On some virtualized systems, every write results in a glyph being redrawn into a (graphical) virtual screen; writing these two bytes separately results in twice as much work being done to draw characters, whereas if we perform a single 16-bit write instead, the character only needs to be redrawn once. On an EC2 c5.4xlarge instance, this change cuts 1.30s from the kernel boot, speeding it up from 8.90s to 7.60s. MFC after: 1 week Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Tue Aug 7 07:12:59 2018 (r337410) +++ head/sys/dev/vt/hw/vga/vt_vga.c Tue Aug 7 08:33:40 2018 (r337411) @@ -68,6 +68,8 @@ struct vga_softc { bus_space_read_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs) #define MEM_WRITE1(sc, ofs, val) \ bus_space_write_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val) +#define MEM_WRITE2(sc, ofs, val) \ + bus_space_write_2(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val) #define REG_READ1(sc, reg) \ bus_space_read_1(sc->vga_reg_tag, sc->vga_reg_handle, reg) #define REG_WRITE1(sc, reg, val) \ @@ -894,10 +896,8 @@ vga_bitblt_text_txtmode(struct vt_device *vd, const st cons_to_vga_colors[bg] << 4 | cons_to_vga_colors[fg]; - MEM_WRITE1(sc, (row * 80 + col) * 2 + 0, - ch); - MEM_WRITE1(sc, (row * 80 + col) * 2 + 1, - attr); + MEM_WRITE2(sc, (row * 80 + col) * 2 + 0, + ch + ((uint16_t)(attr) << 8)); } } } From owner-svn-src-head@freebsd.org Tue Aug 7 10:48:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E6051057634; Tue, 7 Aug 2018 10:48:37 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1D7889198; Tue, 7 Aug 2018 10:48:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B08481AC52; Tue, 7 Aug 2018 10:48:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Amaat044468; Tue, 7 Aug 2018 10:48:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Amajw044467; Tue, 7 Aug 2018 10:48:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808071048.w77Amajw044467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 Aug 2018 10:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337412 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337412 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 10:48:37 -0000 Author: tsoome Date: Tue Aug 7 10:48:36 2018 New Revision: 337412 URL: https://svnweb.freebsd.org/changeset/base/337412 Log: libsa: dos_checksum() should take unsigned chars Fix pointers to integers with different sign issue. Modified: head/stand/libsa/dosfs.c Modified: head/stand/libsa/dosfs.c ============================================================================== --- head/stand/libsa/dosfs.c Tue Aug 7 08:33:40 2018 (r337411) +++ head/stand/libsa/dosfs.c Tue Aug 7 10:48:36 2018 (r337412) @@ -403,7 +403,7 @@ dos_stat(struct open_file *fd, struct stat *sb) } static int -dos_checksum(char *name, char *ext) +dos_checksum(unsigned char *name, unsigned char *ext) { int x, i; char buf[11]; From owner-svn-src-head@freebsd.org Tue Aug 7 10:53:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916BF105798C; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 443B989C67; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 254EF1ADE7; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Arqqb049683; Tue, 7 Aug 2018 10:53:52 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Arqjk049682; Tue, 7 Aug 2018 10:53:52 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808071053.w77Arqjk049682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 Aug 2018 10:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337413 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337413 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 10:53:52 -0000 Author: tsoome Date: Tue Aug 7 10:53:51 2018 New Revision: 337413 URL: https://svnweb.freebsd.org/changeset/base/337413 Log: libsa: gzipfs.c converts pointers to integer types with different sign Signed versus unsigned char. Modified: head/stand/libsa/gzipfs.c Modified: head/stand/libsa/gzipfs.c ============================================================================== --- head/stand/libsa/gzipfs.c Tue Aug 7 10:48:36 2018 (r337412) +++ head/stand/libsa/gzipfs.c Tue Aug 7 10:53:51 2018 (r337413) @@ -40,7 +40,7 @@ struct z_file int zf_rawfd; off_t zf_dataoffset; z_stream zf_zstream; - char zf_buf[Z_BUFSIZE]; + unsigned char zf_buf[Z_BUFSIZE]; int zf_endseen; }; From owner-svn-src-head@freebsd.org Tue Aug 7 13:50:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0715B105F279; Tue, 7 Aug 2018 13:50:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC1D8FE14; Tue, 7 Aug 2018 13:50:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ECD31C9BC; Tue, 7 Aug 2018 13:50:21 +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 w77DoLYF037793; Tue, 7 Aug 2018 13:50:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77DoLhP037792; Tue, 7 Aug 2018 13:50:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071350.w77DoLhP037792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 13:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337415 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 337415 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 13:50:22 -0000 Author: markj Date: Tue Aug 7 13:50:21 2018 New Revision: 337415 URL: https://svnweb.freebsd.org/changeset/base/337415 Log: dhclient: Enter capability mode before dropping privileges. This is needed to be able to chroot in the fallback case where Capsicum is not available. Reported by: Daniel Braniss X-MFC with: r337382 Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Tue Aug 7 13:46:06 2018 (r337414) +++ head/sbin/dhclient/dhclient.c Tue Aug 7 13:50:21 2018 (r337415) @@ -529,23 +529,21 @@ main(int argc, char *argv[]) if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS) error("can't limit route socket: %m"); - if (setgroups(1, &pw->pw_gid) || - setegid(pw->pw_gid) || setgid(pw->pw_gid) || - seteuid(pw->pw_uid) || setuid(pw->pw_uid)) - error("can't drop privileges: %m"); - endpwent(); setproctitle("%s", ifi->name); + /* setgroups(2) is not permitted in capability mode. */ + if (setgroups(1, &pw->pw_gid) != 0) + error("can't restrict groups: %m"); + if (caph_enter_casper() < 0) error("can't enter capability mode: %m"); /* - * If we are not in capability mode (i.e., because Capsicum or - * libcasper is disabled), try to restrict filesystem access. This - * will fail if kern.chroot_allow_open_directories is 0 or the process - * is jailed. + * If we are not in capability mode (i.e., Capsicum or libcasper is + * disabled), try to restrict filesystem access. This will fail if + * kern.chroot_allow_open_directories is 0 or the process is jailed. */ if (cap_getmode(&capmode) < 0 || capmode == 0) { if (chroot(_PATH_VAREMPTY) == -1) @@ -553,6 +551,10 @@ main(int argc, char *argv[]) if (chdir("/") == -1) error("chdir(\"/\")"); } + + if (setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + error("can't drop privileges: %m"); if (immediate_daemon) go_daemon(); From owner-svn-src-head@freebsd.org Tue Aug 7 14:47:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0DB1060DD7; Tue, 7 Aug 2018 14:47:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB27772730; Tue, 7 Aug 2018 14:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7D7B1D382; Tue, 7 Aug 2018 14:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77EldsJ069907; Tue, 7 Aug 2018 14:47:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Eld3I069906; Tue, 7 Aug 2018 14:47:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808071447.w77Eld3I069906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 14:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337419 - head/usr.bin/sed X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/sed X-SVN-Commit-Revision: 337419 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 14:47:40 -0000 Author: pfg Date: Tue Aug 7 14:47:39 2018 New Revision: 337419 URL: https://svnweb.freebsd.org/changeset/base/337419 Log: sed(1): partial fix for the case of the regex delimited with '['. We don't generally support the weird case of regular expresions delimited by an opening square bracket ('[') but POSIX says that inside bracket expressions, escaping is not possible and both '[' and '\' represent themselves. PR: 230198 (exp-run) Obtained from: OpenBSD Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Tue Aug 7 14:39:00 2018 (r337418) +++ head/usr.bin/sed/compile.c Tue Aug 7 14:47:39 2018 (r337419) @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) if ((d = compile_ccl(&p, d)) == NULL) errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); continue; + } else if (*p == '\\' && p[1] == c) { + p++; } else if (*p == '\\' && p[1] == '[') { *d++ = *p++; - } else if (*p == '\\' && p[1] == c) - p++; - else if (*p == '\\' && p[1] == 'n') { + } else if (*p == '\\' && p[1] == 'n') { *d++ = '\n'; p += 2; continue; From owner-svn-src-head@freebsd.org Tue Aug 7 15:24:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8291062017; Tue, 7 Aug 2018 15:24:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0283D741CD; Tue, 7 Aug 2018 15:24:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7AFE1D9DC; Tue, 7 Aug 2018 15:24:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77FOJHM090563; Tue, 7 Aug 2018 15:24:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77FOJif090562; Tue, 7 Aug 2018 15:24:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808071524.w77FOJif090562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 15:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337422 - in head/lib/libc: gen inet X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/libc: gen inet X-SVN-Commit-Revision: 337422 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 15:24:20 -0000 Author: pfg Date: Tue Aug 7 15:24:19 2018 New Revision: 337422 URL: https://svnweb.freebsd.org/changeset/base/337422 Log: libc: fix cases of undefined behavior. These were found by the Undefined Behavious GsoC project at NetBSD: Avoid undefined behavior in ftok(3) Do not change the signedness bit with a left shift operation. Cast to unsigned integer to prevent this. ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented in type 'int' ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in type 'int' Avoid undefined behavior in an inet_addr.c Do not change the signedness bit with a left shift operation. Cast to unsigned integer to prevent this. inet_addr.c:218:20, left shift of 131 by 24 places cannot be represented in type 'int' Detected with micro-UBSan in the user mode. Obtained from: NetBSD MFC after: 2 weeks Modified: head/lib/libc/gen/ftok.c head/lib/libc/inet/inet_addr.c Modified: head/lib/libc/gen/ftok.c ============================================================================== --- head/lib/libc/gen/ftok.c Tue Aug 7 15:04:53 2018 (r337421) +++ head/lib/libc/gen/ftok.c Tue Aug 7 15:24:19 2018 (r337422) @@ -42,5 +42,6 @@ ftok(const char *path, int id) if (stat(path, &st) < 0) return (key_t)-1; - return (key_t) (id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 0xffff)); + return ((key_t)((unsigned int)id << 24 | (st.st_dev & 0xff) << 16 | + (st.st_ino & 0xffff))); } Modified: head/lib/libc/inet/inet_addr.c ============================================================================== --- head/lib/libc/inet/inet_addr.c Tue Aug 7 15:04:53 2018 (r337421) +++ head/lib/libc/inet/inet_addr.c Tue Aug 7 15:24:19 2018 (r337422) @@ -184,19 +184,20 @@ inet_aton(const char *cp, struct in_addr *addr) { case 2: /*%< a.b -- 8.24 bits */ if (val > 0xffffffU) return (0); - val |= parts[0] << 24; + val |= (uint32_t)parts[0] << 24; break; case 3: /*%< a.b.c -- 8.8.16 bits */ if (val > 0xffffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16); break; case 4: /*%< a.b.c.d -- 8.8.8.8 bits */ if (val > 0xffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16) | + (parts[2] << 8); break; } if (addr != NULL) From owner-svn-src-head@freebsd.org Tue Aug 7 16:36:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F5A10637A3; Tue, 7 Aug 2018 16:36:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94AD9767A1; Tue, 7 Aug 2018 16:36:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576751E4F3; Tue, 7 Aug 2018 16:36:50 +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 w77GaoJ8026378; Tue, 7 Aug 2018 16:36:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77GanlD026372; Tue, 7 Aug 2018 16:36:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071636.w77GanlD026372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 16:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337423 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Commit-Revision: 337423 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 16:36:51 -0000 Author: markj Date: Tue Aug 7 16:36:48 2018 New Revision: 337423 URL: https://svnweb.freebsd.org/changeset/base/337423 Log: Improve handling of control message truncation. If a recvmsg(2) or recvmmsg(2) caller doesn't provide sufficient space for all control messages, the kernel sets MSG_CTRUNC in the message flags to indicate truncation of the control messages. In the case of SCM_RIGHTS messages, however, we were failing to dispose of the rights that had already been externalized into the recipient's file descriptor table. Add a new function and mbuf type to handle this cleanup task, and use it any time we fail to copy control messages out to the recipient. To simplify cleanup, control message truncation is now only performed at control message boundaries. The change also fixes a few related bugs: - Rights could be leaked to the recipient process if an error occurred while copying out a message's contents. - We failed to set MSG_CTRUNC if the truncation occurred on a control message boundary, e.g., if the caller received two control messages and provided only the exact amount of buffer space needed for the first. PR: 131876 Reviewed by: ed (previous version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16561 Modified: head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/sys/mbuf.h Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/cloudabi/cloudabi_sock.c Tue Aug 7 16:36:48 2018 (r337423) @@ -120,24 +120,27 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd sizeof(int); if (nfds > fdslen) { /* Unable to store file descriptors. */ - nfds = fdslen; *rflags |= CLOUDABI_SOCK_RECV_FDS_TRUNCATED; + m_dispose_extcontrolm(control); + break; } error = copyout(CMSG_DATA(chdr), fds, nfds * sizeof(int)); - if (error != 0) { - m_free(control); - return (error); - } + if (error != 0) + break; fds += nfds; fdslen -= nfds; *rfdslen += nfds; } } - m_free(control); + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); + m_free(control); + } } - return (0); + return (error); } int Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 16:36:48 2018 (r337423) @@ -1064,7 +1064,7 @@ freebsd32_copyoutmsghdr(struct msghdr *msg, struct msg FREEBSD32_ALIGN(sizeof(struct cmsghdr))) static size_t -freebsd32_cmsg_convert(struct cmsghdr *cm, void *data, socklen_t datalen) +freebsd32_cmsg_convert(const struct cmsghdr *cm, void *data, socklen_t datalen) { size_t copylen; union { @@ -1122,7 +1122,7 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf { struct cmsghdr *cm; void *data; - socklen_t clen, datalen, datalen_out; + socklen_t clen, datalen, datalen_out, oldclen; int error; caddr_t ctlbuf; int len, maxlen, copylen; @@ -1133,15 +1133,11 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf maxlen = msg->msg_controllen; msg->msg_controllen = 0; - m = control; ctlbuf = msg->msg_control; - - while (m && len > 0) { + for (m = control; m != NULL && len > 0; m = m->m_next) { cm = mtod(m, struct cmsghdr *); clen = m->m_len; - while (cm != NULL) { - if (sizeof(struct cmsghdr) > clen || cm->cmsg_len > clen) { error = EINVAL; @@ -1152,34 +1148,36 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; datalen_out = freebsd32_cmsg_convert(cm, data, datalen); - /* Adjust message length */ - cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + - datalen_out; - - /* Copy cmsghdr */ + /* + * Copy out the message header. Preserve the native + * message size in case we need to inspect the message + * contents later. + */ copylen = sizeof(struct cmsghdr); if (len < copylen) { msg->msg_flags |= MSG_CTRUNC; - copylen = len; + m_dispose_extcontrolm(m); + goto exit; } - + oldclen = cm->cmsg_len; + cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + + datalen_out; error = copyout(cm, ctlbuf, copylen); - if (error) + cm->cmsg_len = oldclen; + if (error != 0) goto exit; ctlbuf += FREEBSD32_ALIGN(copylen); len -= FREEBSD32_ALIGN(copylen); - if (len <= 0) - break; - - /* Copy data */ copylen = datalen_out; if (len < copylen) { msg->msg_flags |= MSG_CTRUNC; - copylen = len; + m_dispose_extcontrolm(m); + break; } + /* Copy out the message data. */ error = copyout(data, ctlbuf, copylen); if (error) goto exit; @@ -1190,20 +1188,23 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf if (CMSG_SPACE(datalen) < clen) { clen -= CMSG_SPACE(datalen); cm = (struct cmsghdr *) - ((caddr_t)cm + CMSG_SPACE(datalen)); + ((caddr_t)cm + CMSG_SPACE(datalen)); } else { clen = 0; cm = NULL; } - } - m = m->m_next; + + msg->msg_controllen += FREEBSD32_ALIGN(sizeof(*cm)) + + datalen_out; + } } + if (len == 0 && m != NULL) { + msg->msg_flags |= MSG_CTRUNC; + m_dispose_extcontrolm(m); + } - msg->msg_controllen = (len <= 0) ? maxlen : ctlbuf - (caddr_t)msg->msg_control; - exit: return (error); - } int @@ -1240,19 +1241,22 @@ freebsd32_recvmsg(td, uap) error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, controlp); if (error == 0) { msg.msg_iov = uiov; - + if (control != NULL) error = freebsd32_copy_msg_out(&msg, control); else msg.msg_controllen = 0; - + if (error == 0) error = freebsd32_copyoutmsghdr(&msg, uap->msg); } free(iov, M_IOV); - if (control != NULL) + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); m_freem(control); + } return (error); } Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/linux/linux_socket.c Tue Aug 7 16:36:48 2018 (r337423) @@ -1263,7 +1263,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc struct cmsgcred *cmcred; struct l_cmsghdr *linux_cmsg = NULL; struct l_ucred linux_ucred; - socklen_t datalen, outlen; + socklen_t datalen, maxlen, outlen; struct l_msghdr linux_msg; struct iovec *iov, *uiov; struct mbuf *control = NULL; @@ -1322,9 +1322,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc goto bad; } - outbuf = PTRIN(linux_msg.msg_control); - outlen = 0; - + maxlen = linux_msg.msg_controllen; + linux_msg.msg_controllen = 0; if (control) { linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); @@ -1332,15 +1331,15 @@ linux_recvmsg_common(struct thread *td, l_int s, struc msg->msg_controllen = control->m_len; cm = CMSG_FIRSTHDR(msg); - + outbuf = PTRIN(linux_msg.msg_control); + outlen = 0; while (cm != NULL) { linux_cmsg->cmsg_type = bsd_to_linux_cmsg_type(cm->cmsg_type); linux_cmsg->cmsg_level = bsd_to_linux_sockopt_level(cm->cmsg_level); - if (linux_cmsg->cmsg_type == -1 - || cm->cmsg_level != SOL_SOCKET) - { + if (linux_cmsg->cmsg_type == -1 || + cm->cmsg_level != SOL_SOCKET) { error = EINVAL; goto bad; } @@ -1348,8 +1347,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; - switch (cm->cmsg_type) - { + switch (cm->cmsg_type) { case SCM_RIGHTS: if (flags & LINUX_MSG_CMSG_CLOEXEC) { fds = datalen / sizeof(int); @@ -1394,14 +1392,13 @@ linux_recvmsg_common(struct thread *td, l_int s, struc break; } - if (outlen + LINUX_CMSG_LEN(datalen) > - linux_msg.msg_controllen) { + if (outlen + LINUX_CMSG_LEN(datalen) > maxlen) { if (outlen == 0) { error = EMSGSIZE; goto bad; } else { - linux_msg.msg_flags |= - LINUX_MSG_CTRUNC; + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + m_dispose_extcontrolm(control); goto out; } } @@ -1422,15 +1419,19 @@ linux_recvmsg_common(struct thread *td, l_int s, struc cm = CMSG_NXTHDR(msg, cm); } + linux_msg.msg_controllen = outlen; } out: - linux_msg.msg_controllen = outlen; error = copyout(&linux_msg, msghdr, sizeof(linux_msg)); bad: + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); + m_freem(control); + } free(iov, M_IOV); - m_freem(control); free(linux_cmsg, M_LINUX); return (error); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/kern/uipc_syscalls.c Tue Aug 7 16:36:48 2018 (r337423) @@ -905,7 +905,7 @@ kern_recvit(struct thread *td, int s, struct msghdr *m { struct uio auio; struct iovec *iov; - struct mbuf *m, *control = NULL; + struct mbuf *control, *m; caddr_t ctlbuf; struct file *fp; struct socket *so; @@ -952,6 +952,7 @@ kern_recvit(struct thread *td, int s, struct msghdr *m if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif + control = NULL; len = auio.uio_resid; error = soreceive(so, &fromsa, &auio, NULL, (mp->msg_control || controlp) ? &control : NULL, @@ -1015,30 +1016,22 @@ kern_recvit(struct thread *td, int s, struct msghdr *m control->m_data += sizeof (struct cmsghdr); } #endif + ctlbuf = mp->msg_control; len = mp->msg_controllen; - m = control; mp->msg_controllen = 0; - ctlbuf = mp->msg_control; - - while (m && len > 0) { - unsigned int tocopy; - - if (len >= m->m_len) - tocopy = m->m_len; - else { - mp->msg_flags |= MSG_CTRUNC; - tocopy = len; - } - - if ((error = copyout(mtod(m, caddr_t), - ctlbuf, tocopy)) != 0) + for (m = control; m != NULL && len >= m->m_len; m = m->m_next) { + if ((error = copyout(mtod(m, caddr_t), ctlbuf, + m->m_len)) != 0) goto out; - ctlbuf += tocopy; - len -= tocopy; - m = m->m_next; + ctlbuf += m->m_len; + len -= m->m_len; + mp->msg_controllen += m->m_len; } - mp->msg_controllen = ctlbuf - (caddr_t)mp->msg_control; + if (m != NULL) { + mp->msg_flags |= MSG_CTRUNC; + m_dispose_extcontrolm(m); + } } out: fdrop(fp, td); @@ -1050,8 +1043,11 @@ out: if (error == 0 && controlp != NULL) *controlp = control; - else if (control) + else if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); m_freem(control); + } return (error); } @@ -1572,4 +1568,52 @@ getsockaddr(struct sockaddr **namp, caddr_t uaddr, siz *namp = sa; } return (error); +} + +/* + * Dispose of externalized rights from an SCM_RIGHTS message. This function + * should be used in error or truncation cases to avoid leaking file descriptors + * into the recipient's (the current thread's) table. + */ +void +m_dispose_extcontrolm(struct mbuf *m) +{ + struct cmsghdr *cm; + struct file *fp; + struct thread *td; + socklen_t clen, datalen; + int error, fd, *fds, nfd; + + td = curthread; + for (; m != NULL; m = m->m_next) { + if (m->m_type != MT_EXTCONTROL) + continue; + cm = mtod(m, struct cmsghdr *); + clen = m->m_len; + while (clen > 0) { + if (clen < sizeof(*cm)) + panic("%s: truncated mbuf %p", __func__, m); + datalen = CMSG_SPACE(cm->cmsg_len - CMSG_SPACE(0)); + if (clen < datalen) + panic("%s: truncated mbuf %p", __func__, m); + + if (cm->cmsg_level == SOL_SOCKET && + cm->cmsg_type == SCM_RIGHTS) { + fds = (int *)CMSG_DATA(cm); + nfd = (cm->cmsg_len - CMSG_SPACE(0)) / + sizeof(int); + + while (nfd-- > 0) { + fd = *fds++; + error = fget(td, fd, &cap_no_rights, + &fp); + if (error == 0) + fdclose(td, fp, fd); + } + } + clen -= datalen; + cm = (struct cmsghdr *)((uint8_t *)cm + datalen); + } + m_chtype(m, MT_CONTROL); + } } Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/kern/uipc_usrreq.c Tue Aug 7 16:36:48 2018 (r337423) @@ -2050,6 +2050,13 @@ unp_externalize(struct mbuf *control, struct mbuf **co &fdep[i]->fde_caps); unp_externalize_fp(fdep[i]->fde_file); } + + /* + * The new type indicates that the mbuf data refers to + * kernel resources that may need to be released before + * the mbuf is freed. + */ + m_chtype(*controlp, MT_EXTCONTROL); FILEDESC_XUNLOCK(fdesc); free(fdep[0], M_FILECAPS); } else { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/sys/mbuf.h Tue Aug 7 16:36:48 2018 (r337423) @@ -568,7 +568,8 @@ struct mbuf { #define MT_EXP4 12 /* for experimental use */ #define MT_CONTROL 14 /* extra-data protocol message */ -#define MT_OOBDATA 15 /* expedited data */ +#define MT_EXTCONTROL 15 /* control message with externalized contents */ +#define MT_OOBDATA 16 /* expedited data */ #define MT_NOINIT 255 /* Not a type but a flag to allocate a non-initialized mbuf */ @@ -633,6 +634,7 @@ void m_demote_pkthdr(struct mbuf *); void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); +void m_dispose_extcontrolm(struct mbuf *m); struct mbuf *m_dup(const struct mbuf *, int); int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, From owner-svn-src-head@freebsd.org Tue Aug 7 16:39:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85F5A106391E; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BFD376A22; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1031E523; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Gd7cJ026523; Tue, 7 Aug 2018 16:39:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Gd74N026522; Tue, 7 Aug 2018 16:39:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071639.w77Gd74N026522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 16:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337424 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 337424 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 16:39:08 -0000 Author: markj Date: Tue Aug 7 16:39:07 2018 New Revision: 337424 URL: https://svnweb.freebsd.org/changeset/base/337424 Log: Update PR 131876 regression tests after r337423. - Add some more cases to the truncation test. - Remove the "expect fail" annotations. PR: 131876 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16562 Modified: head/tests/sys/kern/unix_passfd_test.c Modified: head/tests/sys/kern/unix_passfd_test.c ============================================================================== --- head/tests/sys/kern/unix_passfd_test.c Tue Aug 7 16:36:48 2018 (r337423) +++ head/tests/sys/kern/unix_passfd_test.c Tue Aug 7 16:39:07 2018 (r337424) @@ -119,6 +119,20 @@ getnfds(void) } static void +putfds(char *buf, int fd, int nfds) +{ + struct cmsghdr *cm; + int *fdp, i; + + cm = (struct cmsghdr *)buf; + cm->cmsg_len = CMSG_LEN(nfds * sizeof(int)); + cm->cmsg_level = SOL_SOCKET; + cm->cmsg_type = SCM_RIGHTS; + for (fdp = (int *)CMSG_DATA(cm), i = 0; i < nfds; i++) + *fdp++ = fd; +} + +static void samefile(struct stat *sb1, struct stat *sb2) { @@ -131,7 +145,6 @@ sendfd_payload(int sockfd, int send_fd, void *payload, { struct iovec iovec; char message[CMSG_SPACE(sizeof(int))]; - struct cmsghdr *cmsghdr; struct msghdr msghdr; ssize_t len; @@ -147,13 +160,8 @@ sendfd_payload(int sockfd, int send_fd, void *payload, msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; - cmsghdr = (struct cmsghdr *)(void *)message; - cmsghdr->cmsg_len = CMSG_LEN(sizeof(int)); - cmsghdr->cmsg_level = SOL_SOCKET; - cmsghdr->cmsg_type = SCM_RIGHTS; - memcpy(CMSG_DATA(cmsghdr), &send_fd, sizeof(int)); - - len = sendmsg(sockfd, &msghdr, MSG_DONTWAIT); + putfds(message, send_fd, 1); + len = sendmsg(sockfd, &msghdr, 0); ATF_REQUIRE_MSG(len != -1, "sendmsg failed: %s", strerror(errno)); return ((size_t)len); } @@ -185,20 +193,22 @@ localcreds(int sockfd) } static void -recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen) +recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen, + size_t cmsgsz) { struct cmsghdr *cmsghdr; - char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(int))]; struct msghdr msghdr; struct iovec iovec; + char *message; ssize_t len; bool foundcreds; bzero(&msghdr, sizeof(msghdr)); + message = malloc(cmsgsz); + ATF_REQUIRE(message != NULL); msghdr.msg_control = message; - msghdr.msg_controllen = sizeof(message); + msghdr.msg_controllen = cmsgsz; iovec.iov_base = buf; iovec.iov_len = buflen; @@ -237,7 +247,8 @@ recvfd(int sockfd, int *recv_fd) { char ch = 0; - recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch)); + recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch), + CMSG_SPACE(sizeof(int))); } /* @@ -418,65 +429,159 @@ ATF_TC_BODY(rights_creds_payload, tc) len = sendfd_payload(fd[0], putfd, buf, sendspace); ATF_REQUIRE_MSG(len < sendspace, "sendmsg: %zu bytes sent", len); - recvfd_payload(fd[1], &getfd, buf, len); + recvfd_payload(fd[1], &getfd, buf, len, + CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(int))); close(putfd); close(getfd); closesocketpair(fd); } +static void +send_cmsg(int sockfd, void *cmsg, size_t cmsgsz) +{ + struct iovec iov; + struct msghdr msghdr; + ssize_t len; + char ch; + + ch = 0; + bzero(&msghdr, sizeof(msghdr)); + + iov.iov_base = &ch; + iov.iov_len = sizeof(ch); + msghdr.msg_control = cmsg; + msghdr.msg_controllen = cmsgsz; + msghdr.msg_iov = &iov; + msghdr.msg_iovlen = 1; + + len = sendmsg(sockfd, &msghdr, 0); + ATF_REQUIRE_MSG(len != -1, + "sendmsg failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(len == sizeof(ch), + "sendmsg: %zd bytes sent; expected %zu", len, sizeof(ch)); +} + +static void +recv_cmsg(int sockfd, char *cmsg, size_t cmsgsz, int flags) +{ + struct iovec iov; + struct msghdr msghdr; + ssize_t len; + char ch; + + ch = 0; + bzero(&msghdr, sizeof(msghdr)); + + iov.iov_base = &ch; + iov.iov_len = sizeof(ch); + msghdr.msg_control = cmsg; + msghdr.msg_controllen = cmsgsz; + msghdr.msg_iov = &iov; + msghdr.msg_iovlen = 1; + + len = recvmsg(sockfd, &msghdr, 0); + ATF_REQUIRE_MSG(len != -1, + "recvmsg failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(len == sizeof(ch), + "recvmsg: %zd bytes received; expected %zu", len, sizeof(ch)); + ATF_REQUIRE_MSG((msghdr.msg_flags & flags) == flags, + "recvmsg: got flags %#x; expected %#x", msghdr.msg_flags, flags); +} + /* - * Test for PR 131876. Receiver uses a control message buffer that is too + * Test for PR 131876. Receiver uses a control message buffer that is too * small for the incoming SCM_RIGHTS message, so the message is truncated. * The kernel must not leak the copied right into the receiver's namespace. */ ATF_TC_WITHOUT_HEAD(truncated_rights); ATF_TC_BODY(truncated_rights, tc) { - struct iovec iovec; - struct msghdr msghdr; - char buf[16], message[CMSG_SPACE(0)]; - ssize_t len; - int fd[2], nfds, putfd; + char *message; + int fd[2], nfds, putfd, rc; - atf_tc_expect_fail("PR 131876: " - "FD leak when 'control' message is truncated"); - - memset(buf, 42, sizeof(buf)); domainsocketpair(fd); devnull(&putfd); nfds = getnfds(); - len = sendfd_payload(fd[0], putfd, buf, sizeof(buf)); - ATF_REQUIRE_MSG(len == sizeof(buf), - "sendmsg: %zd bytes sent; expected %zu; %s", len, sizeof(buf), - strerror(errno)); + /* + * Case 1: Send a single descriptor and truncate the message. + */ + message = malloc(CMSG_SPACE(sizeof(int))); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + send_cmsg(fd[0], message, CMSG_LEN(sizeof(int))); + recv_cmsg(fd[1], message, CMSG_LEN(0), MSG_CTRUNC); + ATF_REQUIRE(getnfds() == nfds); + free(message); - bzero(&msghdr, sizeof(msghdr)); - bzero(message, sizeof(message)); + /* + * Case 2a: Send two descriptors in separate messages, and truncate at + * the boundary between the two messages. We should still + * receive the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC); + rc = close(*(int *)CMSG_DATA(message)); + ATF_REQUIRE_MSG(rc == 0, "close failed: %s", strerror(errno)); + ATF_REQUIRE(getnfds() == nfds); + free(message); - iovec.iov_base = buf; - iovec.iov_len = sizeof(buf); - msghdr.msg_control = message; - msghdr.msg_controllen = sizeof(message); - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; + /* + * Case 2b: Send two descriptors in separate messages, and truncate + * before the end of the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(0), MSG_CTRUNC); + ATF_REQUIRE(getnfds() == nfds); + free(message); - len = recvmsg(fd[1], &msghdr, 0); - ATF_REQUIRE_MSG(len != -1, "recvmsg failed: %s", strerror(errno)); - ATF_REQUIRE_MSG((size_t)len == sizeof(buf), - "recvmsg: %zd bytes received; expected %zd", len, sizeof(buf)); - for (size_t i = 0; i < sizeof(buf); i++) - ATF_REQUIRE_MSG(buf[i] == 42, "unexpected buffer contents"); + /* + * Case 2c: Send two descriptors in separate messages, and truncate + * after the end of the first message. We should still + * receive the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)) + CMSG_SPACE(0), + MSG_CTRUNC); + rc = close(*(int *)CMSG_DATA(message)); + ATF_REQUIRE_MSG(rc == 0, "close failed: %s", strerror(errno)); + ATF_REQUIRE(getnfds() == nfds); + free(message); - ATF_REQUIRE_MSG((msghdr.msg_flags & MSG_CTRUNC) != 0, - "MSG_CTRUNC not set after truncation"); + /* + * Case 3: Send three descriptors in the same message, and leave space + * only for the first when receiving the message. + */ + message = malloc(CMSG_SPACE(sizeof(int) * 3)); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 3); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int) * 3)); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC); ATF_REQUIRE(getnfds() == nfds); + free(message); close(putfd); closesocketpair(fd); } +/* + * Ensure that an attempt to copy a SCM_RIGHTS message to the recipient + * fails. In this case the kernel must dispose of the externalized rights + * rather than leaking them into the recipient's file descriptor table. + */ ATF_TC_WITHOUT_HEAD(copyout_rights_error); ATF_TC_BODY(copyout_rights_error, tc) { @@ -485,9 +590,6 @@ ATF_TC_BODY(copyout_rights_error, tc) char buf[16]; ssize_t len; int fd[2], error, nfds, putfd; - - atf_tc_expect_fail("PR 131876: " - "FD leak when copyout of rights returns an error"); memset(buf, 0, sizeof(buf)); domainsocketpair(fd); From owner-svn-src-head@freebsd.org Tue Aug 7 17:13:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29931064E96; Tue, 7 Aug 2018 17:13:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5831D7819B; Tue, 7 Aug 2018 17:13:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33A861EBA2; Tue, 7 Aug 2018 17:13:43 +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 w77HDhOE046662; Tue, 7 Aug 2018 17:13:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HDg82046660; Tue, 7 Aug 2018 17:13:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071713.w77HDg82046660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 17:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337425 - head/sys/dev/mii X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/mii X-SVN-Commit-Revision: 337425 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 17:13:43 -0000 Author: markj Date: Tue Aug 7 17:13:42 2018 New Revision: 337425 URL: https://svnweb.freebsd.org/changeset/base/337425 Log: Recognize ICS1893C PHYs. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/dev/mii/icsphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/icsphy.c ============================================================================== --- head/sys/dev/mii/icsphy.c Tue Aug 7 16:39:07 2018 (r337424) +++ head/sys/dev/mii/icsphy.c Tue Aug 7 17:13:42 2018 (r337425) @@ -113,6 +113,7 @@ static const struct mii_phydesc icsphys[] = { MII_PHY_DESC(ICS, 1890), MII_PHY_DESC(ICS, 1892), MII_PHY_DESC(ICS, 1893), + MII_PHY_DESC(ICS, 1893C), MII_PHY_END }; Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Tue Aug 7 16:39:07 2018 (r337424) +++ head/sys/dev/mii/miidevs Tue Aug 7 17:13:42 2018 (r337425) @@ -224,6 +224,7 @@ model ICS 1889 0x0001 ICS1889 10/100 media interface model ICS 1890 0x0002 ICS1890 10/100 media interface model ICS 1892 0x0003 ICS1892 10/100 media interface model ICS 1893 0x0004 ICS1893 10/100 media interface +model ICS 1893C 0x0005 ICS1893C 10/100 media interface /* Intel Corporation PHYs */ model xxINTEL I82553 0x0000 i82553 10/100 media interface From owner-svn-src-head@freebsd.org Tue Aug 7 17:25:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4538310653DC; Tue, 7 Aug 2018 17:25:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC7677876C; Tue, 7 Aug 2018 17:25:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C96551ED6E; Tue, 7 Aug 2018 17:25:38 +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 w77HPcMj051598; Tue, 7 Aug 2018 17:25:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HPciT051597; Tue, 7 Aug 2018 17:25:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071725.w77HPciT051597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 17:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337426 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337426 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 17:25:39 -0000 Author: markj Date: Tue Aug 7 17:25:38 2018 New Revision: 337426 URL: https://svnweb.freebsd.org/changeset/base/337426 Log: ifconfig: Fix use of _Noreturn. The _Noreturn is a function-specifier (like inline) which must preceed the declarator. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static void tunnel_status(int s); -static void usage(void) _Noreturn; +static _Noreturn void usage(void); static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); From owner-svn-src-head@freebsd.org Tue Aug 7 18:26:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2475110672B2; Tue, 7 Aug 2018 18:26:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DCC7B43C; Tue, 7 Aug 2018 18:26:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B2DF1F721; Tue, 7 Aug 2018 18:26:46 +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 w77IQkhF082478; Tue, 7 Aug 2018 18:26:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77IQktX082477; Tue, 7 Aug 2018 18:26:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071826.w77IQktX082477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 18:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337430 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337430 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 18:26:47 -0000 Author: kib Date: Tue Aug 7 18:26:46 2018 New Revision: 337430 URL: https://svnweb.freebsd.org/changeset/base/337430 Log: Add missed handling of local relocs against ifunc target in the obj modules. Reported and tested by: wulf Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Aug 7 17:45:49 2018 (r337429) +++ head/sys/kern/link_elf_obj.c Tue Aug 7 18:26:46 2018 (r337430) @@ -142,7 +142,7 @@ static int link_elf_each_function_name(linker_file_t, static int link_elf_each_function_nameval(linker_file_t, linker_function_nameval_callback_t, void *); -static int link_elf_reloc_local(linker_file_t); +static int link_elf_reloc_local(linker_file_t, bool); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); @@ -441,10 +441,9 @@ link_elf_link_preload(linker_class_t cls, const char * } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; - *result = lf; return (0); @@ -479,13 +478,18 @@ link_elf_link_preload_finish(linker_file_t lf) ef = (elf_file_t)lf; error = relocate_file(ef); if (error) - return error; + return (error); /* Notify MD code that a module is being loaded. */ error = elf_cpu_load_file(lf); if (error) return (error); + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + return (error); + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); return (0); @@ -969,7 +973,7 @@ link_elf_load_file(linker_class_t cls, const char *fil } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; @@ -990,6 +994,11 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + goto out; + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1374,7 +1383,10 @@ elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int /* Quick answer if there is a definition included. */ if (sym->st_shndx != SHN_UNDEF) { - *res = sym->st_value; + res1 = (Elf_Addr)sym->st_value; + if (ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) + res1 = ((Elf_Addr (*)(void))res1)(); + *res = res1; return (0); } @@ -1470,7 +1482,7 @@ link_elf_fix_link_set(elf_file_t ef) } static int -link_elf_reloc_local(linker_file_t lf) +link_elf_reloc_local(linker_file_t lf, bool ifuncs) { elf_file_t ef = (elf_file_t)lf; const Elf_Rel *rellim; @@ -1505,8 +1517,13 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); + else if (ifuncs) + elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); } } @@ -1531,8 +1548,13 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); + else if (ifuncs) + elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); } } return (0); From owner-svn-src-head@freebsd.org Tue Aug 7 18:29:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A024710673BE; Tue, 7 Aug 2018 18:29:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54F3E7B5DE; Tue, 7 Aug 2018 18:29:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EFD1F724; Tue, 7 Aug 2018 18:29:11 +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 w77ITBPB082614; Tue, 7 Aug 2018 18:29:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77ITAV8082610; Tue, 7 Aug 2018 18:29:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071829.w77ITAV8082610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337431 - in head/sys/amd64: linux linux32 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: linux linux32 X-SVN-Commit-Revision: 337431 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 18:29:11 -0000 Author: kib Date: Tue Aug 7 18:29:10 2018 New Revision: 337431 URL: https://svnweb.freebsd.org/changeset/base/337431 Log: Futex support functions in linux.ko and linux32.ko on amd64 should be aware of SMAP. Reported and tested by: Johannes Lundberg , wulf Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_machdep.c head/sys/amd64/linux/linux_support.s head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_support.s Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux/linux_machdep.c Tue Aug 7 18:29:10 2018 (r337431) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include @@ -88,8 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - int linux_execve(struct thread *td, struct linux_execve_args *args) { @@ -275,4 +276,49 @@ linux_set_cloned_tls(struct thread *td, void *desc) td->td_frame->tf_fs = _ufssel; return (0); +} + +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xchgl_smap : futex_xchgl_nosmap); +} + +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_addl_smap : futex_addl_nosmap); +} + +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_orl_smap : futex_orl_nosmap); +} + +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_andl_smap : futex_andl_nosmap); +} + +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xorl_smap : futex_xorl_nosmap); } Modified: head/sys/amd64/linux/linux_support.s ============================================================================== --- head/sys/amd64/linux/linux_support.s Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux/linux_support.s Tue Aug 7 18:29:10 2018 (r337431) @@ -38,7 +38,7 @@ futex_fault: movl $-EFAULT,%eax ret -ENTRY(futex_xchgl) +ENTRY(futex_xchgl_nosmap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -49,14 +49,29 @@ ENTRY(futex_xchgl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xchgl) +END(futex_xchgl_nosmap) -ENTRY(futex_addl) +ENTRY(futex_xchgl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac + xchgl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xchgl_smap) + +ENTRY(futex_addl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault #ifdef SMP lock #endif @@ -65,14 +80,32 @@ ENTRY(futex_addl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_addl) +END(futex_addl_nosmap) -ENTRY(futex_orl) +ENTRY(futex_addl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac +#ifdef SMP + lock +#endif + xaddl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_addl_smap) + +ENTRY(futex_orl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx orl %edi,%ecx @@ -85,9 +118,9 @@ ENTRY(futex_orl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_orl) +END(futex_orl_nosmap) -ENTRY(futex_andl) +ENTRY(futex_orl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -95,6 +128,28 @@ ENTRY(futex_andl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + orl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_orl_smap) + +ENTRY(futex_andl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx andl %edi,%ecx #ifdef SMP lock @@ -105,9 +160,9 @@ ENTRY(futex_andl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_andl) +END(futex_andl_nosmap) -ENTRY(futex_xorl) +ENTRY(futex_andl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -115,6 +170,28 @@ ENTRY(futex_xorl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + andl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_andl_smap) + +ENTRY(futex_xorl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx xorl %edi,%ecx #ifdef SMP lock @@ -125,4 +202,26 @@ ENTRY(futex_xorl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xorl) +END(futex_xorl_nosmap) + +ENTRY(futex_xorl_smap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx + xorl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xorl_smap) Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux32/linux32_machdep.c Tue Aug 7 18:29:10 2018 (r337431) @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include @@ -821,4 +823,49 @@ linux_set_thread_area(struct thread *td, update_gdt_gsbase(td, info.base_addr); return (0); +} + +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xchgl_smap : futex_xchgl_nosmap); +} + +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_addl_smap : futex_addl_nosmap); +} + +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_orl_smap : futex_orl_nosmap); +} + +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_andl_smap : futex_andl_nosmap); +} + +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xorl_smap : futex_xorl_nosmap); } Modified: head/sys/amd64/linux32/linux32_support.s ============================================================================== --- head/sys/amd64/linux32/linux32_support.s Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux32/linux32_support.s Tue Aug 7 18:29:10 2018 (r337431) @@ -38,7 +38,7 @@ futex_fault: movl $-EFAULT,%eax ret -ENTRY(futex_xchgl) +ENTRY(futex_xchgl_nosmap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -49,14 +49,29 @@ ENTRY(futex_xchgl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xchgl) +END(futex_xchgl_nosmap) -ENTRY(futex_addl) +ENTRY(futex_xchgl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac + xchgl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xchgl_smap) + +ENTRY(futex_addl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault #ifdef SMP lock #endif @@ -65,14 +80,32 @@ ENTRY(futex_addl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_addl) +END(futex_addl_nosmap) -ENTRY(futex_orl) +ENTRY(futex_addl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac +#ifdef SMP + lock +#endif + xaddl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_addl_smap) + +ENTRY(futex_orl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx orl %edi,%ecx @@ -85,9 +118,9 @@ ENTRY(futex_orl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_orl) +END(futex_orl_nosmap) -ENTRY(futex_andl) +ENTRY(futex_orl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -95,6 +128,28 @@ ENTRY(futex_andl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + orl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_orl_smap) + +ENTRY(futex_andl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx andl %edi,%ecx #ifdef SMP lock @@ -105,9 +160,9 @@ ENTRY(futex_andl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_andl) +END(futex_andl_nosmap) -ENTRY(futex_xorl) +ENTRY(futex_andl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -115,6 +170,28 @@ ENTRY(futex_xorl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + andl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_andl_smap) + +ENTRY(futex_xorl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx xorl %edi,%ecx #ifdef SMP lock @@ -125,4 +202,26 @@ ENTRY(futex_xorl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xorl) +END(futex_xorl_nosmap) + +ENTRY(futex_xorl_smap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx + xorl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xorl_smap) From owner-svn-src-head@freebsd.org Tue Aug 7 18:56:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 612C51067C3B; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D687C398; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3501FBE2; Tue, 7 Aug 2018 18:56:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Iu1Ba097732; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Iu1tv097731; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071856.w77Iu1tv097731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337432 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 337432 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 18:56:02 -0000 Author: marius Date: Tue Aug 7 18:56:01 2018 New Revision: 337432 URL: https://svnweb.freebsd.org/changeset/base/337432 Log: Implement atomic_swap_64(9). Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Tue Aug 7 18:29:10 2018 (r337431) +++ head/sys/arm/include/atomic-v4.h Tue Aug 7 18:56:01 2018 (r337432) @@ -249,6 +249,19 @@ atomic_subtract_64(volatile u_int64_t *p, u_int64_t va __with_interrupts_disabled(*p -= val); } +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t value; + + __with_interrupts_disabled( + { + value = *p; + *p = v; + }); + return (value); +} + #else /* !_KERNEL */ static __inline void From owner-svn-src-head@freebsd.org Tue Aug 7 18:56:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 557CC1067C91; Tue, 7 Aug 2018 18:56:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB747C500; Tue, 7 Aug 2018 18:56:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCD31FBE3; Tue, 7 Aug 2018 18:56:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77IupEt097803; Tue, 7 Aug 2018 18:56:51 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77IupF9097802; Tue, 7 Aug 2018 18:56:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071856.w77IupF9097802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337433 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 337433 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 18:56:52 -0000 Author: marius Date: Tue Aug 7 18:56:51 2018 New Revision: 337433 URL: https://svnweb.freebsd.org/changeset/base/337433 Log: Implement atomic_swap_{int,long,ptr}(9). Modified: head/sys/riscv/include/atomic.h Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Tue Aug 7 18:56:01 2018 (r337432) +++ head/sys/riscv/include/atomic.h Tue Aug 7 18:56:51 2018 (r337433) @@ -412,6 +412,8 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) return (old); } +#define atomic_swap_int atomic_swap_32 + #define atomic_add_long atomic_add_64 #define atomic_clear_long atomic_clear_64 #define atomic_cmpset_long atomic_cmpset_64 @@ -420,6 +422,7 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) #define atomic_readandclear_long atomic_readandclear_64 #define atomic_set_long atomic_set_64 #define atomic_subtract_long atomic_subtract_64 +#define atomic_swap_long atomic_swap_64 #define atomic_add_ptr atomic_add_64 #define atomic_clear_ptr atomic_clear_64 @@ -429,6 +432,7 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) #define atomic_readandclear_ptr atomic_readandclear_64 #define atomic_set_ptr atomic_set_64 #define atomic_subtract_ptr atomic_subtract_64 +#define atomic_swap_ptr atomic_swap_64 ATOMIC_ACQ_REL(set, 64) ATOMIC_ACQ_REL(clear, 64) From owner-svn-src-head@freebsd.org Tue Aug 7 18:59:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8FB1067E0B; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 536AB7C7B5; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3605C1FBE5; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Ix2NL097937; Tue, 7 Aug 2018 18:59:02 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Ix2kd097935; Tue, 7 Aug 2018 18:59:02 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071859.w77Ix2kd097935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337434 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 337434 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 18:59:03 -0000 Author: marius Date: Tue Aug 7 18:59:02 2018 New Revision: 337434 URL: https://svnweb.freebsd.org/changeset/base/337434 Log: Update the list of architectures having atomic_fcmpset_{8,16,64}(9) and atomic_swap_{64,int}(9) respectively as of r337433. Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Aug 7 18:56:51 2018 (r337433) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Aug 7 18:59:02 2018 (r337434) @@ -129,9 +129,7 @@ atomic_clear_mask(unsigned int mask, atomic_t *v) static inline int atomic_xchg(atomic_t *v, int i) { -#if defined(__i386__) || defined(__amd64__) || \ - defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) +#if !defined(__mips__) return (atomic_swap_int(&v->counter, i)); #else int ret; @@ -159,7 +157,7 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#if defined(__i386__) || defined(__amd64__) +#if defined(__amd64__) || defined(__arm64__) || defined(__i386__) #define LINUXKPI_ATOMIC_8(...) __VA_ARGS__ #define LINUXKPI_ATOMIC_16(...) __VA_ARGS__ #else @@ -167,8 +165,9 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define LINUXKPI_ATOMIC_16(...) #endif -#if defined(__amd64__) || (defined(__ARM_ARCH) && (__ARM_ARCH >= 6)) || \ - defined(__aarch64__) || defined(__powerpc64__) || defined(__riscv) +#if !(defined(i386) || (defined(__mips__) && !(defined(__mips_n32) || \ + defined(__mips_n64))) || (defined(__powerpc__) && \ + !defined(__powerpc64__))) #define LINUXKPI_ATOMIC_64(...) __VA_ARGS__ #else #define LINUXKPI_ATOMIC_64(...) Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Tue Aug 7 18:56:51 2018 (r337433) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Tue Aug 7 18:59:02 2018 (r337434) @@ -107,9 +107,8 @@ atomic64_add_unless(atomic64_t *v, int64_t a, int64_t static inline int64_t atomic64_xchg(atomic64_t *v, int64_t i) { -#if defined(__i386__) || defined(__amd64__) || \ - defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc64__) +#if !((defined(__mips__) && !(defined(__mips_n32) || defined(__mips_n64))) || \ + (defined(__powerpc__) && !defined(__powerpc64__))) return (atomic_swap_64(&v->counter, i)); #else int64_t ret; From owner-svn-src-head@freebsd.org Tue Aug 7 19:23:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1012C10689CF; Tue, 7 Aug 2018 19:23:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7B357D680; Tue, 7 Aug 2018 19:23:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9890D20094; Tue, 7 Aug 2018 19:23:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77JN46M013193; Tue, 7 Aug 2018 19:23:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77JN4Xi013191; Tue, 7 Aug 2018 19:23:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808071923.w77JN4Xi013191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 7 Aug 2018 19:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337435 - in head: sbin/init stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sbin/init stand/man X-SVN-Commit-Revision: 337435 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 19:23:05 -0000 Author: trasz Date: Tue Aug 7 19:23:03 2018 New Revision: 337435 URL: https://svnweb.freebsd.org/changeset/base/337435 Log: Move description of init_shell, init_script, and init_chroot kenv tunables from loader(8) to init(8), since it's init that actually uses them. Add .Xrs at their old place. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sbin/init/init.8 head/stand/man/loader.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Tue Aug 7 18:59:02 2018 (r337434) +++ head/sbin/init/init.8 Tue Aug 7 19:23:03 2018 (r337435) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd August 7, 2018 .Dt INIT 8 .Os .Sh NAME @@ -294,6 +294,74 @@ as follows: .Xr ttys 5 file .El +.Sh KERNEL ENVIRONMENT VARIABLES +The following +.Xr kenv 2 +variables are available as +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va init_chroot +If set to a valid directory in the root file system, it causes +.Nm +to perform a +.Xr chroot 2 +operation on that directory, making it the new root directory. +That happens before entering single-user mode or multi-user +mode (but after executing the +.Va init_script +if enabled). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +.It Va init_script +If set to a valid file name in the root file system, +instructs +.Nm +to run that script as the very first action, +before doing anything else. +Signal handling and exit code interpretation is similar to +running the +.Pa /etc/rc +script. +In particular, single-user operation is enforced +if the script terminates with a non-zero exit code, +or if a SIGTERM is delivered to the +.Nm +process (PID 1). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +.It Va init_shell +Defines the shell binary to be used for executing the various shell scripts. +The default is +.Dq Li /bin/sh . +It is used for running the +.Va init_script +if set, as well as for the +.Pa /etc/rc +and +.Pa /etc/rc.shutdown +scripts. +The value of the corresponding +.Xr kenv 2 +variable is evaluated every time +.Nm +calls a shell script, so it can be changed later on using the +.Xr kenv 1 +utility. +In particular, if a non-default shell is used for running an +.Va init_script , +it might be desirable to have that script reset the value of +.Va init_shell +back to the default, so that the +.Pa /etc/rc +script is executed with the standard shell +.Pa /bin/sh . .Sh FILES .Bl -tag -width /var/log/init.log -compact .It Pa /dev/console Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Tue Aug 7 18:59:02 2018 (r337434) +++ head/stand/man/loader.8 Tue Aug 7 19:23:03 2018 (r337435) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2018 +.Dd August 7, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -478,20 +478,8 @@ directive from has been processed, allowing kernel panics that happen during the early stages of boot to be captured. .It Va init_chroot -If set to a valid directory in the root file system, it causes -.Xr init 8 -to perform a -.Xr chroot 2 -operation on that directory, making it the new root directory. -That happens before entering single-user mode or multi-user -mode (but after executing the -.Va init_script -if enabled). -This functionality has generally been eclipsed by rerooting. See -.Xr reboot 8 -.Fl r -for details. +.Xr init 8 . .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. @@ -499,51 +487,11 @@ The first matching binary is used. The default list is .Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init . .It Va init_script -If set to a valid file name in the root file system, -instructs -.Xr init 8 -to run that script as the very first action, -before doing anything else. -Signal handling and exit code interpretation is similar to -running the -.Pa /etc/rc -script. -In particular, single-user operation is enforced -if the script terminates with a non-zero exit code, -or if a SIGTERM is delivered to the -.Xr init 8 -process (PID 1). -This functionality has generally been eclipsed by rerooting. See -.Xr reboot 8 -.Fl r -for details. +.Xr init 8 . .It Va init_shell -Defines the shell binary to be used for executing the various shell scripts. -The default is -.Dq Li /bin/sh . -It is used for running the -.Va init_script -if set, as well as for the -.Pa /etc/rc -and -.Pa /etc/rc.shutdown -scripts. -The value of the corresponding -.Xr kenv 2 -variable is evaluated every time -.Xr init 8 -calls a shell script, so it can be changed later on using the -.Xr kenv 1 -utility. -In particular, if a non-default shell is used for running an -.Va init_script , -it might be desirable to have that script reset the value of -.Va init_shell -back to the default, so that the -.Pa /etc/rc -script is executed with the standard shell -.Pa /bin/sh . +See +.Xr init 8 . .It Va interpret Has the value .Dq Li OK From owner-svn-src-head@freebsd.org Tue Aug 7 20:43:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3F7106AB96; Tue, 7 Aug 2018 20:43:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C99BE80FB3; Tue, 7 Aug 2018 20:43:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAE7420D76; Tue, 7 Aug 2018 20:43:50 +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 w77KhoYK055530; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Khook055529; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808072043.w77Khook055529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 20:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337436 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337436 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 20:43:51 -0000 Author: kib Date: Tue Aug 7 20:43:50 2018 New Revision: 337436 URL: https://svnweb.freebsd.org/changeset/base/337436 Log: Followup to r337430: only call elf_reloc_ifunc on x86. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Aug 7 19:23:03 2018 (r337435) +++ head/sys/kern/link_elf_obj.c Tue Aug 7 20:43:50 2018 (r337436) @@ -485,10 +485,12 @@ link_elf_link_preload_finish(linker_file_t lf) if (error) return (error); +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) return (error); +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -994,10 +996,12 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) goto out; +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1521,9 +1525,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#endif } } @@ -1552,9 +1558,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#endif } } return (0); From owner-svn-src-head@freebsd.org Tue Aug 7 21:17:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35987106B42B; Tue, 7 Aug 2018 21:17:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD1081D84; Tue, 7 Aug 2018 21:17:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C001D2123F; Tue, 7 Aug 2018 21:17:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77LHjwa070914; Tue, 7 Aug 2018 21:17:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77LHjoI070913; Tue, 7 Aug 2018 21:17:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808072117.w77LHjoI070913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 7 Aug 2018 21:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337437 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 337437 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 21:17:46 -0000 Author: mckusick Date: Tue Aug 7 21:17:45 2018 New Revision: 337437 URL: https://svnweb.freebsd.org/changeset/base/337437 Log: When getting mount information for all filesystems, mount uses the getfsstat(2) system call using the MNT_NOWAIT flag to indicate that it wants to use the statfs information cached in the mount structure. When the -v (verbose) flag is specified, we need to use the MNT_WAIT flag to getfsstat(2) so that kernel will call VFS_STATFS to get the current statfs statistics from each filesystem. Sponsored by: Netflix Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Tue Aug 7 20:43:50 2018 (r337436) +++ head/sbin/mount/mount.c Tue Aug 7 21:17:45 2018 (r337437) @@ -329,7 +329,8 @@ main(int argc, char *argv[]) rval = 0; switch (argc) { case 0: - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) + if ((mntsize = getmntinfo(&mntbuf, + verbose ? MNT_WAIT : MNT_NOWAIT)) == 0) err(1, "getmntinfo"); if (all) { while ((fs = getfsent()) != NULL) { From owner-svn-src-head@freebsd.org Tue Aug 7 21:29:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC19106B6CB; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30FBF8227D; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134A6213F6; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77LTEMu076160; Tue, 7 Aug 2018 21:29:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77LTEBe076159; Tue, 7 Aug 2018 21:29:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808072129.w77LTEBe076159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 7 Aug 2018 21:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337438 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 337438 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 21:29:15 -0000 Author: rmacklem Date: Tue Aug 7 21:29:14 2018 New Revision: 337438 URL: https://svnweb.freebsd.org/changeset/base/337438 Log: Allow newnfs_request() to retry all callback RPCs with an NFSERR_DELAY reply. The code in newnfs_request() retries RPCs that get a reply of NFSERR_DELAY, but exempts certain NFSv4 operations. However, for callback RPCs, there should not be any exemptions at this time. The code would have erroneously exempted the CBRECALL callback, since it has the same operation number as the CLOSE operation. This patch fixes this by checking for a callback RPC (indicated by clp != NULL) and not checking for exempt operations for callbacks. This would have only affected the NFSv4 server when delegations are enabled (they are not enabled by default) and the client replies to CBRECALL with NFSERR_DELAY. This may never actually happen. Spotted during code inspection. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Aug 7 21:17:45 2018 (r337437) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Aug 7 21:29:14 2018 (r337438) @@ -1052,10 +1052,14 @@ tryagain: NFSCL_DEBUG(1, "Got err=%d\n", reterr); } } + /* + * When clp != NULL, it is a callback and all + * callback operations can be retried for NFSERR_DELAY. + */ if (((nd->nd_repstat == NFSERR_DELAY || nd->nd_repstat == NFSERR_GRACE) && - (nd->nd_flag & ND_NFSV4) && - nd->nd_procnum != NFSPROC_DELEGRETURN && + (nd->nd_flag & ND_NFSV4) && (clp != NULL || + (nd->nd_procnum != NFSPROC_DELEGRETURN && nd->nd_procnum != NFSPROC_SETATTR && nd->nd_procnum != NFSPROC_READ && nd->nd_procnum != NFSPROC_READDS && @@ -1067,7 +1071,7 @@ tryagain: nd->nd_procnum != NFSPROC_OPENDOWNGRADE && nd->nd_procnum != NFSPROC_CLOSE && nd->nd_procnum != NFSPROC_LOCK && - nd->nd_procnum != NFSPROC_LOCKU) || + nd->nd_procnum != NFSPROC_LOCKU))) || (nd->nd_repstat == NFSERR_DELAY && (nd->nd_flag & ND_NFSV4) == 0) || nd->nd_repstat == NFSERR_RESOURCE) { From owner-svn-src-head@freebsd.org Tue Aug 7 22:00:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6B2106C4F0; Tue, 7 Aug 2018 22:00:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BCF58332A; Tue, 7 Aug 2018 22:00:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w77M0NaK087187 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Aug 2018 15:00:23 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w77M0NGr087186; Tue, 7 Aug 2018 15:00:23 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 7 Aug 2018 15:00:23 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336047 - in head/sys: amd64/include i386/include sys Message-ID: <20180807220023.GY420@FreeBSD.org> References: <201807061950.w66Joibw081390@repo.freebsd.org> <20180803222739.GH420@FreeBSD.org> <20180804074817.GH6049@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180804074817.GH6049@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 07 Aug 2018 22:00:32 -0000 On Sat, Aug 04, 2018 at 10:48:17AM +0300, Konstantin Belousov wrote: K> On Fri, Aug 03, 2018 at 03:27:39PM -0700, Gleb Smirnoff wrote: K> > Hi Konstantin, K> > K> > On Fri, Jul 06, 2018 at 07:50:44PM +0000, Konstantin Belousov wrote: K> > K> Author: kib K> > K> Date: Fri Jul 6 19:50:44 2018 K> > K> New Revision: 336047 K> > K> URL: https://svnweb.freebsd.org/changeset/base/336047 K> > K> K> > K> Log: K> > K> Expand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE. K> > K> K> > K> This restores counters(9) operation. K> > K> Revert r336024. Improve assert of pcpu size on x86. K> > K> K> > K> Reviewed by: mmacy K> > K> Sponsored by: The FreeBSD Foundation K> > K> Differential revision: https://reviews.freebsd.org/D16163 K> > K> > Since this has been broken already several times as people who edit K> > surrounding code don't understand the magic, and since now we round K> > the struct pcpu size to PAGE_SIZE anyways, what about stop carefully K> > craft the padding and just change alignment of struct pcpu to PAGE_SIZE? K> I do not see how it would avoided that breakage. Also, I like the K> explicitness in the padding, it is useful when new pcpu members are K> added. I have to do that more than once this year. I was wrong. __aligned would do proper placement of items in an array, but sizeof would return lesser value. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Aug 7 22:13:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16D27106C967; Tue, 7 Aug 2018 22:13:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB6A83A48; Tue, 7 Aug 2018 22:13:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B1A621C14; Tue, 7 Aug 2018 22:13:04 +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 w77MD4q7001293; Tue, 7 Aug 2018 22:13:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77MD3Ab001289; Tue, 7 Aug 2018 22:13:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808072213.w77MD3Ab001289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 7 Aug 2018 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337439 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 337439 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 22:13:05 -0000 Author: np Date: Tue Aug 7 22:13:03 2018 New Revision: 337439 URL: https://svnweb.freebsd.org/changeset/base/337439 Log: cxgbe(4): Allow the driver to specify a burst size when configuring a traffic class for rate limiting. Add experimental knobs that allow the user to specify a default pktsize and burstsize for traffic classes associated with a port: dev...tc.pktsize dev...tc.burstsize Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/adapter.h Tue Aug 7 22:13:03 2018 (r337439) @@ -249,6 +249,7 @@ struct tx_cl_rl_params { enum fw_sched_params_mode mode; /* aggr or per-flow */ uint32_t maxrate; uint16_t pktsize; + uint16_t burstsize; }; /* Tx scheduler parameters for a channel/port */ @@ -259,7 +260,9 @@ struct tx_sched_params { /* Class WRR */ /* XXX */ - /* Class Rate Limiter */ + /* Class Rate Limiter (including the default pktsize and burstsize). */ + int pktsize; + int burstsize; struct tx_cl_rl_params cl_rl[]; }; Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/common/common.h Tue Aug 7 22:13:03 2018 (r337439) @@ -814,7 +814,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok); + int burstsize, int sleep_ok); int t4_sched_params_ch_rl(struct adapter *adapter, int channel, int ratemode, unsigned int maxrate, int sleep_ok); int t4_sched_params_cl_wrr(struct adapter *adapter, int channel, int cl, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Aug 7 22:13:03 2018 (r337439) @@ -9803,7 +9803,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok) + int burstsize, int sleep_ok) { struct fw_sched_cmd cmd; @@ -9825,6 +9825,7 @@ int t4_sched_params(struct adapter *adapter, int type, cmd.u.params.max = cpu_to_be32(maxrate); cmd.u.params.weight = cpu_to_be16(weight); cmd.u.params.pktsize = cpu_to_be16(pktsize); + cmd.u.params.burstsize = cpu_to_be16(burstsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), NULL, sleep_ok); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/t4_main.c Tue Aug 7 22:13:03 2018 (r337439) @@ -6008,6 +6008,13 @@ cxgbe_sysctls(struct port_info *pi) */ oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", CTLFLAG_RD, NULL, "Tx scheduler traffic classes (cl_rl)"); + children2 = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "pktsize", + CTLFLAG_RW, &pi->sched_params->pktsize, 0, + "pktsize for per-flow cl-rl (0 means up to the driver )"); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "burstsize", + CTLFLAG_RW, &pi->sched_params->burstsize, 0, + "burstsize for per-flow cl-rl (0 means up to the driver)"); for (i = 0; i < sc->chip_params->nsched_cls; i++) { struct tx_cl_rl_params *tc = &pi->sched_params->cl_rl[i]; Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/t4_sched.c Tue Aug 7 22:13:03 2018 (r337439) @@ -211,7 +211,7 @@ set_sched_class_params(struct adapter *sc, struct t4_s } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, - p->weight, p->pktsize, sleep_ok); + p->weight, p->pktsize, 0, sleep_ok); end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); if (p->level == SCHED_CLASS_LEVEL_CL_RL) { @@ -258,7 +258,7 @@ update_tx_sched(void *context, int pending) rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, - tc->pktsize, 1); + tc->pktsize, tc->burstsize, 1); end_synchronized_op(sc, 0); mtx_lock(&sc->tc_lock); @@ -481,7 +481,7 @@ int t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, u_int maxrate, int *tc_idx) { - int rc = 0, fa = -1, i; + int rc = 0, fa = -1, i, pktsize, burstsize; bool update; struct tx_cl_rl_params *tc; struct port_info *pi; @@ -489,7 +489,16 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, MPASS(port_id >= 0 && port_id < sc->params.nports); pi = sc->port[port_id]; + if (pi->sched_params->pktsize > 0) + pktsize = pi->sched_params->pktsize; + else + pktsize = pi->vi[0].ifp->if_mtu; + if (pi->sched_params->burstsize > 0) + burstsize = pi->sched_params->burstsize; + else + burstsize = pktsize * 4; tc = &pi->sched_params->cl_rl[0]; + update = false; mtx_lock(&sc->tc_lock); for (i = 0; i < sc->chip_params->nsched_cls; i++, tc++) { @@ -499,8 +508,8 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, if (tc->ratemode == FW_SCHED_PARAMS_RATE_ABS && tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE && tc->mode == FW_SCHED_PARAMS_MODE_FLOW && - tc->maxrate == maxrate && - tc->pktsize == pi->vi[0].ifp->if_mtu) { + tc->maxrate == maxrate && tc->pktsize == pktsize && + tc->burstsize == burstsize) { tc->refcount++; *tc_idx = i; if ((tc->flags & (CLRL_ERR | CLRL_ASYNC | CLRL_SYNC)) == @@ -519,7 +528,8 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; tc->mode = FW_SCHED_PARAMS_MODE_FLOW; tc->maxrate = maxrate; - tc->pktsize = pi->vi[0].ifp->if_mtu; + tc->pktsize = pktsize; + tc->burstsize = burstsize; *tc_idx = fa; update = true; } else { From owner-svn-src-head@freebsd.org Tue Aug 7 23:03:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE138106D943; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 754DA85065; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 514932242D; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77N3pUP026671; Tue, 7 Aug 2018 23:03:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77N3pSt026670; Tue, 7 Aug 2018 23:03:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808072303.w77N3pSt026670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 23:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337440 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337440 X-SVN-Commit-Repository: base 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.27 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, 07 Aug 2018 23:03:52 -0000 Author: pfg Date: Tue Aug 7 23:03:50 2018 New Revision: 337440 URL: https://svnweb.freebsd.org/changeset/base/337440 Log: Fix printf(1) ignores width and precision in %b format. The precision with behavior is "unspecified" by POSIX (as of 2018), but most implementations seem to have taken it to be treated the same as for "s"; applied after the unescaping. Adopt the same treatment on our printf. PR: 229641 Submitted by: Garrett D'Amore (illumos) Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Aug 7 22:13:03 2018 (r337439) +++ head/usr.bin/printf/printf.c Tue Aug 7 23:03:50 2018 (r337440) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * + * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - p = strdup(getstr()); - if (p == NULL) { + /* Convert "b" to "s" for output. */ + start[strlen(start) - 1] = 's'; + if ((p = strdup(getstr())) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - fputs(p, stdout); + PF(start, p); + /* Restore format for next loop. */ + free(p); if (getout) - return (end_fmt); + exit(*rval); break; } case 'c': { From owner-svn-src-head@freebsd.org Wed Aug 8 01:20:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 830DD10705B0; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A988890B3; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1827A238F6; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w781K2di093694; Wed, 8 Aug 2018 01:20:02 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w781K2Xa093693; Wed, 8 Aug 2018 01:20:02 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808080120.w781K2Xa093693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 8 Aug 2018 01:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337441 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 337441 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 01:20:03 -0000 Author: kevlo Date: Wed Aug 8 01:20:02 2018 New Revision: 337441 URL: https://svnweb.freebsd.org/changeset/base/337441 Log: - Fix hash calculation by MAC address - Since rx_cmd_c is an uint16_t, use le16toh() instead of le32toh() Reviewed by: emaste Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Tue Aug 7 23:03:50 2018 (r337440) +++ head/sys/dev/usb/net/if_muge.c Wed Aug 8 01:20:02 2018 (r337441) @@ -1196,7 +1196,7 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err goto tr_setup; usbd_copy_out(pc, off, &rx_cmd_c, sizeof(rx_cmd_c)); off += (sizeof(rx_cmd_c)); - rx_cmd_c = le32toh(rx_cmd_c); + rx_cmd_c = le16toh(rx_cmd_c); if (off > actlen) goto tr_setup; @@ -1891,7 +1891,7 @@ muge_multicast_write(struct muge_softc *sc) static inline uint32_t muge_hash(uint8_t addr[ETHER_ADDR_LEN]) { - return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 26) & 0x3f; + return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 23) & 0x1ff; } /** From owner-svn-src-head@freebsd.org Wed Aug 8 01:33:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E4621070DFB; Wed, 8 Aug 2018 01:33:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B214789A96; Wed, 8 Aug 2018 01:33:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9118C23C35; Wed, 8 Aug 2018 01:33:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w781XbmW003786; Wed, 8 Aug 2018 01:33:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w781XaUM003779; Wed, 8 Aug 2018 01:33:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808080133.w781XaUM003779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 8 Aug 2018 01:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337442 - in head/contrib/file: . doc magic magic/Magdir python src tests X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/contrib/file: . doc magic magic/Magdir python src tests X-SVN-Commit-Revision: 337442 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 01:33:38 -0000 Author: eadler Date: Wed Aug 8 01:33:36 2018 New Revision: 337442 URL: https://svnweb.freebsd.org/changeset/base/337442 Log: file: update to 5.34 PR: 230141 exp-run by: antoine Added: head/contrib/file/magic/Magdir/dataone - copied unchanged from r336862, vendor/file/dist/magic/Magdir/dataone head/contrib/file/python/CHANGELOG.md - copied unchanged from r336862, vendor/file/dist/python/CHANGELOG.md head/contrib/file/python/LICENSE - copied unchanged from r336862, vendor/file/dist/python/LICENSE head/contrib/file/python/README.md - copied unchanged from r336862, vendor/file/dist/python/README.md head/contrib/file/python/tests.py - copied unchanged from r336862, vendor/file/dist/python/tests.py head/contrib/file/tests/JW07022A.mp3.result - copied unchanged from r336862, vendor/file/dist/tests/JW07022A.mp3.result head/contrib/file/tests/JW07022A.mp3.testfile - copied unchanged from r336862, vendor/file/dist/tests/JW07022A.mp3.testfile Deleted: head/contrib/file/python/README Modified: head/contrib/file/ChangeLog head/contrib/file/Makefile.in head/contrib/file/README head/contrib/file/aclocal.m4 head/contrib/file/compile head/contrib/file/config.guess head/contrib/file/config.h.in head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/depcomp head/contrib/file/doc/Makefile.in head/contrib/file/doc/file.man head/contrib/file/doc/magic.man head/contrib/file/install-sh head/contrib/file/ltmain.sh head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/audio head/contrib/file/magic/Magdir/cad head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/dbpf head/contrib/file/magic/Magdir/dump head/contrib/file/magic/Magdir/elf head/contrib/file/magic/Magdir/fsav head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/linux head/contrib/file/magic/Magdir/make head/contrib/file/magic/Magdir/measure head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/msooxml head/contrib/file/magic/Magdir/pdf head/contrib/file/magic/Magdir/sgi head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/missing head/contrib/file/python/Makefile.am head/contrib/file/python/Makefile.in head/contrib/file/python/magic.py head/contrib/file/python/setup.py head/contrib/file/src/Makefile.in head/contrib/file/src/apprentice.c head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.h head/contrib/file/src/funcs.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/readelf.h head/contrib/file/src/seccomp.c head/contrib/file/src/softmagic.c head/contrib/file/tests/Makefile.am head/contrib/file/tests/Makefile.in Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/ChangeLog Wed Aug 8 01:33:36 2018 (r337442) @@ -1,3 +1,15 @@ +2018-07-25 8:50 Christos Zoulas + + * release 5.34 + +2018-06-22 16:38 Christos Zoulas + + * Add Quad indirect offsets + +2018-05-24 14:10 Christos Zoulas + + * Enable parsing of ELF dynamic sections to handle PIE better + 2018-04-15 14:52 Christos Zoulas * release 5.33 Modified: head/contrib/file/Makefile.in ============================================================================== --- head/contrib/file/Makefile.in Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/Makefile.in Wed Aug 8 01:33:36 2018 (r337442) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -49,11 +87,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ - README TODO compile config.guess config.sub depcomp install-sh \ - missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -61,6 +94,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -124,6 +159,9 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -178,6 +216,7 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -193,6 +232,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -306,7 +346,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__c echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -327,8 +366,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -357,13 +396,12 @@ distclean-libtool: # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ @@ -538,10 +576,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -576,16 +620,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -761,6 +806,8 @@ uninstall-am: maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. Modified: head/contrib/file/README ============================================================================== --- head/contrib/file/README Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/README Wed Aug 8 01:33:36 2018 (r337442) @@ -1,10 +1,10 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.53 2018/03/11 13:06:47 glen Exp $ + @(#) $File: README,v 1.54 2018/05/30 03:06:56 christos Exp $ -Mailing List: file@mx.gw.com [currently down] -Mailing List archives: http://mx.gw.com/pipermail/file/ [currently down] -Bug tracker: http://bugs.gw.com/ [currently down] +Mailing List: file@astron.com +Mailing List archives: http://mailman.astron.com/pipermail/file/ +Bug tracker: http://bugs.astron.com/ E-mail: christos@astron.com Build Status: https://travis-ci.org/file/file Modified: head/contrib/file/aclocal.m4 ============================================================================== --- head/contrib/file/aclocal.m4 Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/aclocal.m4 Wed Aug 8 01:33:36 2018 (r337442) @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,85 @@ You have another version of autoconf. It may work, bu If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# visibility.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Tests whether the compiler supports the command-line option +dnl -fvisibility=hidden and the function and variable attributes +dnl __attribute__((__visibility__("hidden"))) and +dnl __attribute__((__visibility__("default"))). +dnl Does *not* test for __visibility__("protected") - which has tricky +dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on +dnl Mac OS X. +dnl Does *not* test for __visibility__("internal") - which has processor +dnl dependent semantics. +dnl Does *not* test for #pragma GCC visibility push(hidden) - which is +dnl "really only recommended for legacy code". +dnl Set the variable CFLAG_VISIBILITY. +dnl Defines and sets the variable HAVE_VISIBILITY. + +AC_DEFUN([gl_VISIBILITY], +[ + AC_REQUIRE([AC_PROG_CC]) + CFLAG_VISIBILITY= + HAVE_VISIBILITY=0 + if test -n "$GCC"; then + dnl First, check whether -Werror can be added to the command line, or + dnl whether it leads to an error because of some other option that the + dnl user has put into $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether the -Werror option is usable]) + AC_CACHE_VAL([gl_cv_cc_vis_werror], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_vis_werror=yes], + [gl_cv_cc_vis_werror=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_vis_werror]) + dnl Now check whether visibility declarations are supported. + AC_MSG_CHECKING([for simple visibility declarations]) + AC_CACHE_VAL([gl_cv_cc_visibility], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + dnl We use the option -Werror and a function dummyfunc, because on some + dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning + dnl "visibility attribute not supported in this configuration; ignored" + dnl at the first function definition in every compilation unit, and we + dnl don't want to use the option in this case. + if test $gl_cv_cc_vis_werror = yes; then + CFLAGS="$CFLAGS -Werror" + fi + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; + extern __attribute__((__visibility__("default"))) int exportedvar; + extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); + extern __attribute__((__visibility__("default"))) int exportedfunc (void); + void dummyfunc (void) {} + ]], + [[]])], + [gl_cv_cc_visibility=yes], + [gl_cv_cc_visibility=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_visibility]) + if test $gl_cv_cc_visibility = yes; then + CFLAG_VISIBILITY="-fvisibility=hidden" + HAVE_VISIBILITY=1 + fi + fi + AC_SUBST([CFLAG_VISIBILITY]) + AC_SUBST([HAVE_VISIBILITY]) + AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], + [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) +]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +110,10 @@ To do so, use the procedure documented by the package, # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +129,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +181,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +219,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +410,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -373,7 +450,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the @@ -409,7 +486,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -418,6 +495,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -493,8 +576,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -526,6 +609,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, se AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -534,7 +662,6 @@ dnl mangled by Autoconf and run in a shell conditional m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -556,7 +683,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -567,7 +694,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg" # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -577,7 +704,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -598,7 +725,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -646,41 +773,9 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -719,7 +814,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,9 +843,73 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -831,7 +990,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -891,7 +1050,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -919,7 +1078,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -938,7 +1097,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,76 +1116,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR Modified: head/contrib/file/compile ============================================================================== --- head/contrib/file/compile Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/compile Wed Aug 8 01:33:36 2018 (r337442) @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify Modified: head/contrib/file/config.guess ============================================================================== --- head/contrib/file/config.guess Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/config.guess Wed Aug 8 01:33:36 2018 (r337442) @@ -1,10 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -26,12 +24,12 @@ timestamp='2012-12-29' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -52,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEAS UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -151,19 +168,29 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 8 02:30:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993211072151; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2348B0EF; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3039F24539; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w782UZGm029238; Wed, 8 Aug 2018 02:30:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w782UZJP029237; Wed, 8 Aug 2018 02:30:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808080230.w782UZJP029237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 8 Aug 2018 02:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337443 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 337443 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 02:30:35 -0000 Author: alc Date: Wed Aug 8 02:30:34 2018 New Revision: 337443 URL: https://svnweb.freebsd.org/changeset/base/337443 Log: Defer and aggregate swap_pager_meta_build frees. Before swp_pager_meta_build replaces an old swapblk with an new one, it frees the old one. To allow such freeing of blocks to be aggregated, have swp_pager_meta_build return the old swap block, and make the caller responsible for freeing it. Define a pair of short static functions, swp_pager_init_freerange and swp_pager_update_freerange, to do the initialization and updating of blk addresses and counters used in aggregating blocks to be freed. Submitted by: Doug Moore Reviewed by: kib, markj (an earlier version) Tested by: pho MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13707 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Aug 8 01:33:36 2018 (r337442) +++ head/sys/vm/swap_pager.c Wed Aug 8 02:30:34 2018 (r337443) @@ -403,11 +403,32 @@ static daddr_t swp_pager_getswapspace(int npages); /* * Metadata functions */ -static void swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); +static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t); static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int); +static void +swp_pager_init_freerange(daddr_t *start, daddr_t *num) +{ + + *start = SWAPBLK_NONE; + *num = 0; +} + +static void +swp_pager_update_freerange(daddr_t *start, daddr_t *num, daddr_t addr) +{ + + if (*start + *num == addr) { + (*num)++; + } else { + swp_pager_freeswapspace(*start, *num); + *start = addr; + *num = 1; + } +} + static void * swblk_trie_alloc(struct pctrie *ptree) { @@ -861,7 +882,9 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t sta int n = 0; daddr_t blk = SWAPBLK_NONE; vm_pindex_t beg = start; /* save start index */ + daddr_t addr, n_free, s_free; + swp_pager_init_freerange(&s_free, &n_free); VM_OBJECT_WLOCK(object); while (size) { if (n == 0) { @@ -875,12 +898,15 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t sta } } } - swp_pager_meta_build(object, start, blk); + addr = swp_pager_meta_build(object, start, blk); + if (addr != SWAPBLK_NONE) + swp_pager_update_freerange(&s_free, &n_free, addr); --size; ++start; ++blk; --n; } + swp_pager_freeswapspace(s_free, n_free); swp_pager_meta_free(object, start, n); VM_OBJECT_WUNLOCK(object); return (0); @@ -910,7 +936,7 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst vm_pindex_t offset, int destroysource) { vm_pindex_t i; - daddr_t dstaddr, first_free, num_free, srcaddr; + daddr_t dstaddr, n_free, s_free, srcaddr; VM_OBJECT_ASSERT_WLOCKED(srcobject); VM_OBJECT_ASSERT_WLOCKED(dstobject); @@ -937,42 +963,38 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst /* * Transfer source to destination. */ - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); for (i = 0; i < dstobject->size; ++i) { srcaddr = swp_pager_meta_ctl(srcobject, i + offset, SWM_POP); if (srcaddr == SWAPBLK_NONE) continue; dstaddr = swp_pager_meta_ctl(dstobject, i, 0); - if (dstaddr == SWAPBLK_NONE) { + if (dstaddr != SWAPBLK_NONE) { /* - * Destination has no swapblk and is not resident, - * copy source. - * - * swp_pager_meta_build() can sleep. - */ - vm_object_pip_add(srcobject, 1); - VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); - swp_pager_meta_build(dstobject, i, srcaddr); - vm_object_pip_wakeup(dstobject); - VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); - } else { - /* * Destination has valid swapblk or it is represented - * by a resident page. We destroy the sourceblock. + * by a resident page. We destroy the source block. */ - if (first_free + num_free == srcaddr) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = srcaddr; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, srcaddr); + continue; } + + /* + * Destination has no swapblk and is not resident, + * copy source. + * + * swp_pager_meta_build() can sleep. + */ + vm_object_pip_add(srcobject, 1); + VM_OBJECT_WUNLOCK(srcobject); + vm_object_pip_add(dstobject, 1); + dstaddr = swp_pager_meta_build(dstobject, i, srcaddr); + KASSERT(dstaddr == SWAPBLK_NONE, + ("Unexpected destination swapblk")); + vm_object_pip_wakeup(dstobject); + VM_OBJECT_WLOCK(srcobject); + vm_object_pip_wakeup(srcobject); } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); /* * Free left over swap blocks in source. @@ -1307,7 +1329,9 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, { int i, n; boolean_t sync; + daddr_t addr, n_free, s_free; + swp_pager_init_freerange(&s_free, &n_free); if (count && ma[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", object, @@ -1322,8 +1346,11 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, * check for bogus sysops * force sync if not pageout process */ - if (object->type != OBJT_SWAP) - swp_pager_meta_build(object, 0, SWAPBLK_NONE); + if (object->type != OBJT_SWAP) { + addr = swp_pager_meta_build(object, 0, SWAPBLK_NONE); + KASSERT(addr == SWAPBLK_NONE, + ("unexpected object swap block")); + } VM_OBJECT_WUNLOCK(object); n = 0; @@ -1391,11 +1418,11 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, for (j = 0; j < n; ++j) { vm_page_t mreq = ma[i+j]; - swp_pager_meta_build( - mreq->object, - mreq->pindex, - blk + j - ); + addr = swp_pager_meta_build(mreq->object, mreq->pindex, + blk + j); + if (addr != SWAPBLK_NONE) + swp_pager_update_freerange(&s_free, &n_free, + addr); MPASS(mreq->dirty == VM_PAGE_BITS_ALL); mreq->oflags |= VPO_SWAPINPROG; bp->b_pages[j] = mreq; @@ -1453,6 +1480,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, swp_pager_async_iodone(bp); } VM_OBJECT_WLOCK(object); + swp_pager_freeswapspace(s_free, n_free); } /* @@ -1783,14 +1811,15 @@ swp_pager_swblk_empty(struct swblk *sb, int start, int * * The specified swapblk is added to the object's swap metadata. If * the swapblk is not valid, it is freed instead. Any previously - * assigned swapblk is freed. + * assigned swapblk is returned. */ -static void +static daddr_t swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { static volatile int swblk_zone_exhausted, swpctrie_zone_exhausted; struct swblk *sb, *sb1; vm_pindex_t modpi, rdpi; + daddr_t prev_swapblk; int error, i; VM_OBJECT_ASSERT_WLOCKED(object); @@ -1815,7 +1844,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); if (sb == NULL) { if (swapblk == SWAPBLK_NONE) - return; + return (SWAPBLK_NONE); for (;;) { sb = uma_zalloc(swblk_zone, M_NOWAIT | (curproc == pageproc ? M_USE_RESERVE : 0)); @@ -1882,9 +1911,8 @@ allocated: MPASS(sb->p == rdpi); modpi = pindex % SWAP_META_PAGES; - /* Delete prior contents of metadata. */ - if (sb->d[modpi] != SWAPBLK_NONE) - swp_pager_freeswapspace(sb->d[modpi], 1); + /* Return prior contents of metadata. */ + prev_swapblk = sb->d[modpi]; /* Enter block into metadata. */ sb->d[modpi] = swapblk; @@ -1896,6 +1924,7 @@ allocated: SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, rdpi); uma_zfree(swblk_zone, sb); } + return (prev_swapblk); } /* @@ -1912,7 +1941,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count) { struct swblk *sb; - daddr_t first_free, num_free; + daddr_t n_free, s_free; vm_pindex_t last; int i, limit, start; @@ -1920,8 +1949,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi if (object->type != OBJT_SWAP || count == 0) return; - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); last = pindex + count; for (;;) { sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, @@ -1934,13 +1962,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi for (i = start; i < limit; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; - if (first_free + num_free == sb->d[i]) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = sb->d[i]; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); sb->d[i] = SWAPBLK_NONE; } if (swp_pager_swblk_empty(sb, 0, start) && @@ -1951,7 +1973,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi } pindex = sb->p + SWAP_META_PAGES; } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); } /* @@ -1964,7 +1986,7 @@ static void swp_pager_meta_free_all(vm_object_t object) { struct swblk *sb; - daddr_t first_free, num_free; + daddr_t n_free, s_free; vm_pindex_t pindex; int i; @@ -1972,26 +1994,19 @@ swp_pager_meta_free_all(vm_object_t object) if (object->type != OBJT_SWAP) return; - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); for (pindex = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( &object->un_pager.swp.swp_blks, pindex)) != NULL;) { pindex = sb->p + SWAP_META_PAGES; for (i = 0; i < SWAP_META_PAGES; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; - if (first_free + num_free == sb->d[i]) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = sb->d[i]; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); } SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); uma_zfree(swblk_zone, sb); } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); } /* From owner-svn-src-head@freebsd.org Wed Aug 8 04:46:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CADCF10743F7; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD418E7C8; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 562FD25B54; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w784k4OY001501; Wed, 8 Aug 2018 04:46:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w784k3K3001499; Wed, 8 Aug 2018 04:46:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808080446.w784k3K3001499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 8 Aug 2018 04:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337447 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 337447 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 04:46:05 -0000 Author: cem Date: Wed Aug 8 04:46:03 2018 New Revision: 337447 URL: https://svnweb.freebsd.org/changeset/base/337447 Log: FUSE: Remove some set-but-not-used variables No functional change. Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_file.c Wed Aug 8 04:46:03 2018 (r337447) @@ -102,7 +102,6 @@ fuse_filehandle_open(struct vnode *vp, struct fuse_open_out *foo; int err = 0; - int isdir = 0; int oflags = 0; int op = FUSE_OPEN; @@ -120,7 +119,6 @@ fuse_filehandle_open(struct vnode *vp, oflags = fuse_filehandle_xlate_to_oflags(fufh_type); if (vnode_isdir(vp)) { - isdir = 1; op = FUSE_OPENDIR; if (fufh_type != FUFH_RDONLY) { printf("FUSE:non-rdonly fh requested for a directory?\n"); @@ -172,7 +170,6 @@ fuse_filehandle_close(struct vnode *vp, struct fuse_filehandle *fufh = NULL; int err = 0; - int isdir = 0; int op = FUSE_RELEASE; fuse_trace_printf("fuse_filehandle_put(vp=%p, fufh_type=%d)\n", @@ -187,10 +184,8 @@ fuse_filehandle_close(struct vnode *vp, if (fuse_isdeadfs(vp)) { goto out; } - if (vnode_isdir(vp)) { + if (vnode_isdir(vp)) op = FUSE_RELEASEDIR; - isdir = 1; - } fdisp_init(&fdi, sizeof(*fri)); fdisp_make_vp(&fdi, op, vp, td, cred); fri = fdi.indata; Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_vfsops.c Wed Aug 8 04:46:03 2018 (r337447) @@ -209,7 +209,6 @@ fuse_vfsop_mount(struct mount *mp) int err; uint64_t mntopts, __mntopts; - int max_read_set; uint32_t max_read; int daemon_timeout; int fd; @@ -224,7 +223,6 @@ fuse_vfsop_mount(struct mount *mp) struct vfsoptlist *opts; subtype = NULL; - max_read_set = 0; max_read = ~0; err = 0; mntopts = 0; @@ -277,8 +275,7 @@ fuse_vfsop_mount(struct mount *mp) FUSE_FLAGOPT(no_mmap, FSESS_NO_MMAP); FUSE_FLAGOPT(brokenio, FSESS_BROKENIO); - if (vfs_scanopt(opts, "max_read=", "%u", &max_read) == 1) - max_read_set = 1; + (void)vfs_scanopt(opts, "max_read=", "%u", &max_read); if (vfs_scanopt(opts, "timeout=", "%u", &daemon_timeout) == 1) { if (daemon_timeout < FUSE_MIN_DAEMON_TIMEOUT) daemon_timeout = FUSE_MIN_DAEMON_TIMEOUT; Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_vnops.c Wed Aug 8 04:46:03 2018 (r337447) @@ -1249,7 +1249,6 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) struct ucred *cred = ap->a_cred; struct fuse_filehandle *fufh = NULL; - struct fuse_vnode_data *fvdat; struct fuse_iov cookediov; int err = 0; @@ -1264,7 +1263,6 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) (uio_resid(uio) < sizeof(struct dirent))) { return EINVAL; } - fvdat = VTOFUD(vp); if (!fuse_filehandle_valid(vp, FUFH_RDONLY)) { FS_DEBUG("calling readdir() before open()"); From owner-svn-src-head@freebsd.org Wed Aug 8 06:31:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F5E105087A; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 300DB717CE; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 127EA26C9F; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w786Vk1l057243; Wed, 8 Aug 2018 06:31:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w786VkqZ057242; Wed, 8 Aug 2018 06:31:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808080631.w786VkqZ057242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 8 Aug 2018 06:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337448 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 337448 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 06:31:47 -0000 Author: eadler Date: Wed Aug 8 06:31:46 2018 New Revision: 337448 URL: https://svnweb.freebsd.org/changeset/base/337448 Log: top(1): hide THR column in separate-thread mode. It does not make sense to show a "thread count" column when displaying threads separately. In fact we don't, but do show the header for this column. Fix this. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Aug 8 04:46:03 2018 (r337447) +++ head/usr.bin/top/machine.c Wed Aug 8 06:31:46 2018 (r337448) @@ -388,7 +388,10 @@ format_header(const char *uname_field) sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : ""); sbuf_printf(header, " %-*.*s ", namelength, namelength, uname_field); - sbuf_cat(header, "THR PRI NICE SIZE RES "); + if (!ps.thread) { + sbuf_cat(header, "THR "); + } + sbuf_cat(header, "PRI NICE SIZE RES "); if (ps.swap) { sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP"); } From owner-svn-src-head@freebsd.org Wed Aug 8 07:58:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F2D710525CA; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F94573D21; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F73F279D2; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w787wUIB001389; Wed, 8 Aug 2018 07:58:30 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w787wUou001388; Wed, 8 Aug 2018 07:58:30 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201808080758.w787wUou001388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 8 Aug 2018 07:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337452 - head X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337452 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 07:58:30 -0000 Author: royger Date: Wed Aug 8 07:58:29 2018 New Revision: 337452 URL: https://svnweb.freebsd.org/changeset/base/337452 Log: build: skip the database check for the distributeworld target distributeworld is used to generate install media, so it makes no sense to check the host database since the install media can be generated from any box, regardless of the version of FreeBSD it's running. Sponsored by: Citrix Systems R&D Reviewed by: ian, gjb Differential revision: https://reviews.freebsd.org/D16507 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Aug 8 07:32:14 2018 (r337451) +++ head/Makefile.inc1 Wed Aug 8 07:58:29 2018 (r337452) @@ -830,6 +830,13 @@ IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} .endif + +# When generating install media, do not allow user and group information from +# the build host to affect the contents of the distribution. +.if make(distributeworld) +DB_FROM_SRC= yes +.endif + .if defined(DB_FROM_SRC) INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc From owner-svn-src-head@freebsd.org Wed Aug 8 12:07:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E7E105A565; Wed, 8 Aug 2018 12:07:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3FB57B11A; Wed, 8 Aug 2018 12:07:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 964DB225E; Wed, 8 Aug 2018 12:07:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78C7k7q031174; Wed, 8 Aug 2018 12:07:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78C7kK2031172; Wed, 8 Aug 2018 12:07:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201808081207.w78C7kK2031172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Wed, 8 Aug 2018 12:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337453 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 337453 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 12:07:47 -0000 Author: fsu Date: Wed Aug 8 12:07:45 2018 New Revision: 337453 URL: https://svnweb.freebsd.org/changeset/base/337453 Log: Fix directory blocks checksum updating logic. The checksum updating functions were not called in case of dir index inode splitting and in case of dir entry removing, when the entry was first in the block. Fix and move the dir entry adding logic when i_count == 0 to new function. MFC after: 3 months Modified: head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Wed Aug 8 07:58:29 2018 (r337452) +++ head/sys/fs/ext2fs/ext2_htree.c Wed Aug 8 12:07:45 2018 (r337453) @@ -800,7 +800,7 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ cursize = roundup(ip->i_size, blksize); dirsize = cursize + blksize; blknum = dirsize / blksize - 1; - + ext2_dx_csum_set(ip, (struct ext2fs_direct_2 *)newidxblock); error = ext2_htree_append_block(dvp, newidxblock, cnp, blksize); if (error) Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Aug 8 07:58:29 2018 (r337452) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Aug 8 12:07:45 2018 (r337453) @@ -859,6 +859,68 @@ ext2_dirbadentry(struct vnode *dp, struct ext2fs_direc } /* + * Insert an entry into the fresh directory block. + * Initialize entry tail if the metadata_csum feature is turned on. + */ +static int +ext2_add_first_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry, + struct componentname *cnp) +{ + struct inode *dp; + struct iovec aiov; + struct uio auio; + char* buf = NULL; + int dirblksize, error; + + dp = VTOI(dvp); + dirblksize = dp->i_e2fs->e2fs_bsize; + + if (dp->i_offset & (dirblksize - 1)) + panic("ext2_add_first_entry: bad directory offset"); + + if (EXT2_HAS_RO_COMPAT_FEATURE(dp->i_e2fs, + EXT2F_ROCOMPAT_METADATA_CKSUM)) { + entry->e2d_reclen = dirblksize - sizeof(struct ext2fs_direct_tail); + buf = malloc(dirblksize, M_TEMP, M_WAITOK); + if (!buf) { + error = ENOMEM; + goto out; + } + memcpy(buf, entry, EXT2_DIR_REC_LEN(entry->e2d_namlen)); + ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, dirblksize)); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf); + + auio.uio_offset = dp->i_offset; + auio.uio_resid = dirblksize; + aiov.iov_len = auio.uio_resid; + aiov.iov_base = (caddr_t)buf; + } else { + entry->e2d_reclen = dirblksize; + auio.uio_offset = dp->i_offset; + auio.uio_resid = EXT2_DIR_REC_LEN(entry->e2d_namlen); + aiov.iov_len = auio.uio_resid; + aiov.iov_base = (caddr_t)entry; + } + + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_WRITE; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = (struct thread *)0; + error = VOP_WRITE(dvp, &auio, IO_SYNC, cnp->cn_cred); + if (error) + goto out; + + dp->i_size = roundup2(dp->i_size, dirblksize); + dp->i_flag |= IN_CHANGE; + +out: + free(buf, M_TEMP); + return (error); + +} + +/* * Write a directory entry after a call to namei, using the parameters * that it left in nameidata. The argument ip is the inode which the new * directory entry will refer to. Dvp is a pointer to the directory to @@ -871,7 +933,6 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str { struct inode *dp; struct ext2fs_direct_2 newdir; - struct buf *bp; int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; int error; @@ -911,36 +972,15 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str } } - if (dp->i_count == 0) { - /* - * If dp->i_count is 0, then namei could find no - * space in the directory. Here, dp->i_offset will - * be on a directory block boundary and we will write the - * new entry into a fresh block. - */ - if (dp->i_offset & (DIRBLKSIZ - 1)) - panic("ext2_direnter: newblk"); + /* + * If dp->i_count is 0, then namei could find no + * space in the directory. Here, dp->i_offset will + * be on a directory block boundary and we will write the + * new entry into a fresh block. + */ + if (dp->i_count == 0) + return ext2_add_first_entry(dvp, &newdir, cnp); - newdir.e2d_reclen = DIRBLKSIZ; - - bp = getblk(ip->i_devvp, lblkno(dp->i_e2fs, dp->i_offset), - DIRBLKSIZ, 0, 0, 0); - if (!bp) - return (EIO); - - memcpy(bp->b_data, &newdir, sizeof(struct ext2fs_direct_2)); - - ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); - error = bwrite(bp); - if (error) - return (error); - - dp->i_size = roundup2(dp->i_size, DIRBLKSIZ); - dp->i_flag |= IN_CHANGE; - - return (0); - } - error = ext2_add_entry(dvp, &newdir); if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, @@ -1071,6 +1111,7 @@ ext2_dirremove(struct vnode *dvp, struct componentname &bp)) != 0) return (error); ep->e2d_ino = 0; + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); From owner-svn-src-head@freebsd.org Wed Aug 8 12:08:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B75105A5E9; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB307B26C; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D080225F; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78C8kQk031267; Wed, 8 Aug 2018 12:08:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78C8krZ031264; Wed, 8 Aug 2018 12:08:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201808081208.w78C8krZ031264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Wed, 8 Aug 2018 12:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337454 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 337454 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 12:08:47 -0000 Author: fsu Date: Wed Aug 8 12:08:46 2018 New Revision: 337454 URL: https://svnweb.freebsd.org/changeset/base/337454 Log: Split the dir_index and dir_nlink features. Do not allow to create more that EXT4_LINK_MAX links to directory in case if the dir_nlink is not set, like it is done in the fresh e2fsprogs updates. MFC after: 3 months Modified: head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Wed Aug 8 12:07:45 2018 (r337453) +++ head/sys/fs/ext2fs/ext2_dir.h Wed Aug 8 12:08:46 2018 (r337454) @@ -89,7 +89,6 @@ struct ext2fs_direct_tail { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 #define EXT4_LINK_MAX 65000 /* Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 8 12:07:45 2018 (r337453) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 8 12:08:46 2018 (r337454) @@ -675,19 +675,6 @@ out: return (error); } -static unsigned short -ext2_max_nlink(struct inode *ip) -{ - struct m_ext2fs *fs; - - fs = ip->i_e2fs; - - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_DIR_NLINK)) - return (EXT4_LINK_MAX); - else - return (EXT2_LINK_MAX); -} - /* * link vnode call */ @@ -705,7 +692,7 @@ ext2_link(struct vop_link_args *ap) panic("ext2_link: no name"); #endif ip = VTOI(vp); - if ((nlink_t)ip->i_nlink >= ext2_max_nlink(ip)) { + if ((nlink_t)ip->i_nlink >= EXT4_LINK_MAX) { error = EMLINK; goto out; } @@ -732,10 +719,12 @@ ext2_inc_nlink(struct inode *ip) ip->i_nlink++; - if (ext2_htree_has_idx(ip) && ip->i_nlink > 1) { - if (ip->i_nlink >= ext2_max_nlink(ip) || ip->i_nlink == 2) + if (S_ISDIR(ip->i_mode) && + EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK) && + ip->i_nlink > 1) { + if (ip->i_nlink >= EXT4_LINK_MAX || ip->i_nlink == 2) ip->i_nlink = 1; - } else if (ip->i_nlink > ext2_max_nlink(ip)) { + } else if (ip->i_nlink > EXT4_LINK_MAX) { ip->i_nlink--; return (EMLINK); } @@ -833,7 +822,8 @@ abortit: goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); - if (ip->i_nlink >= ext2_max_nlink(ip) && !ext2_htree_has_idx(ip)) { + if (ip->i_nlink >= EXT4_LINK_MAX && + !EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK)) { VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; @@ -1304,8 +1294,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) panic("ext2_mkdir: no name"); #endif dp = VTOI(dvp); - if ((nlink_t)dp->i_nlink >= ext2_max_nlink(dp) && - !ext2_htree_has_idx(dp)) { + if ((nlink_t)dp->i_nlink >= EXT4_LINK_MAX && + !EXT2_HAS_RO_COMPAT_FEATURE(dp->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK)) { error = EMLINK; goto out; } @@ -1655,10 +1645,11 @@ ext2_pathconf(struct vop_pathconf_args *ap) switch (ap->a_name) { case _PC_LINK_MAX: - if (ext2_htree_has_idx(VTOI(ap->a_vp))) + if (EXT2_HAS_RO_COMPAT_FEATURE(VTOI(ap->a_vp)->i_e2fs, + EXT2F_ROCOMPAT_DIR_NLINK)) *ap->a_retval = INT_MAX; else - *ap->a_retval = ext2_max_nlink(VTOI(ap->a_vp)); + *ap->a_retval = EXT4_LINK_MAX; break; case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; From owner-svn-src-head@freebsd.org Wed Aug 8 13:36:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FF1105C706; Wed, 8 Aug 2018 13:36:50 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFDE67E3B3; Wed, 8 Aug 2018 13:36:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C918311B; Wed, 8 Aug 2018 13:36:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Danqr078485; Wed, 8 Aug 2018 13:36:49 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Dan3f078484; Wed, 8 Aug 2018 13:36:49 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201808081336.w78Dan3f078484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 8 Aug 2018 13:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337455 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 337455 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 13:36:50 -0000 Author: rrs Date: Wed Aug 8 13:36:49 2018 New Revision: 337455 URL: https://svnweb.freebsd.org/changeset/base/337455 Log: Fix a small bug in rack where it will end up sending the FIN twice. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D16604 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Aug 8 12:08:46 2018 (r337454) +++ head/sys/netinet/tcp_stacks/rack.c Wed Aug 8 13:36:49 2018 (r337455) @@ -7603,13 +7603,10 @@ dontupdate: * If our state indicates that FIN should be sent and we have not * yet done so, then we need to send. */ - if (flags & TH_FIN) { - if ((tp->t_flags & TF_SENTFIN) || - (((tp->t_flags & TF_SENTFIN) == 0) && - (tp->snd_nxt == tp->snd_una))) { - pass = 11; - goto send; - } + if ((flags & TH_FIN) && + (tp->snd_nxt == tp->snd_una)) { + pass = 11; + goto send; } /* * No reason to send a segment, just return. From owner-svn-src-head@freebsd.org Wed Aug 8 15:08:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C231D105E9C8; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7639B815F7; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534FA4446; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78F8NS9025570; Wed, 8 Aug 2018 15:08:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78F8Nb3025569; Wed, 8 Aug 2018 15:08:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081508.w78F8Nb3025569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337456 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 337456 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 15:08:24 -0000 Author: pfg Date: Wed Aug 8 15:08:22 2018 New Revision: 337456 URL: https://svnweb.freebsd.org/changeset/base/337456 Log: msdosfs: fixes for Undefined Behavior. These were found by the Undefined Behaviour GsoC project at NetBSD: Do not change signedness bit with left shift. While there avoid signed integer overflow. Address both issues with using unsigned type. msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]' msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]' Detected with micro-UBSan in the user mode. Hinted from: NetBSD (CVS 1.33) MFC after: 2 weeks Differenctial Revision: https://reviews.freebsd.org/D16615 Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Wed Aug 8 13:36:49 2018 (r337455) +++ head/sys/fs/msdosfs/msdosfs_fat.c Wed Aug 8 15:08:22 2018 (r337456) @@ -391,7 +391,7 @@ usemap_alloc(struct msdosfsmount *pmp, u_long cn) KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) == 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; pmp->pm_flags |= MSDOSFS_FSIMOD; @@ -412,7 +412,7 @@ usemap_free(struct msdosfsmount *pmp, u_long cn) KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); - pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); + pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } int @@ -775,7 +775,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != FULL_RUN) { cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -792,7 +792,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, for (cn = 0; cn < newst;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != FULL_RUN) { cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -950,7 +950,7 @@ fillinusemap(struct msdosfsmount *pmp) for (cn = pmp->pm_maxcluster + 1; cn < (pmp->pm_maxcluster + N_INUSEBITS) / N_INUSEBITS; cn++) - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); return (0); } From owner-svn-src-head@freebsd.org Wed Aug 8 15:12:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE10105EC97; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D22E81AA6; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ECF645D3; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78FCXsO030336; Wed, 8 Aug 2018 15:12:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78FCXc2030335; Wed, 8 Aug 2018 15:12:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081512.w78FCXc2030335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337457 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337457 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 15:12:33 -0000 Author: pfg Date: Wed Aug 8 15:12:32 2018 New Revision: 337457 URL: https://svnweb.freebsd.org/changeset/base/337457 Log: Revert r337440: the log message is wrong. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Aug 8 15:08:22 2018 (r337456) +++ head/usr.bin/printf/printf.c Wed Aug 8 15:12:32 2018 (r337457) @@ -1,7 +1,6 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -376,19 +375,16 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - /* Convert "b" to "s" for output. */ - start[strlen(start) - 1] = 's'; - if ((p = strdup(getstr())) == NULL) { + p = strdup(getstr()); + if (p == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - PF(start, p); - /* Restore format for next loop. */ - + fputs(p, stdout); free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-head@freebsd.org Wed Aug 8 15:25:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5386B105F136; Wed, 8 Aug 2018 15:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 058B682110; Wed, 8 Aug 2018 15:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6FA477A; Wed, 8 Aug 2018 15:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78FP1j4035565; Wed, 8 Aug 2018 15:25:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78FP1TS035564; Wed, 8 Aug 2018 15:25:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081525.w78FP1TS035564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337458 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337458 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 15:25:02 -0000 Author: pfg Date: Wed Aug 8 15:25:01 2018 New Revision: 337458 URL: https://svnweb.freebsd.org/changeset/base/337458 Log: Fix printf(1) ignores width and precision in %b format. The precision with the conversion specifier b is specified by POSIX: see point 7 in the reference documentation. This corrects previous wrong log in r337440. Reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html PR: 229641 Reported by: Rudolf Cejka Submitted by: Garrett D'Amore (illumos) MFC after: 1 week Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Aug 8 15:12:32 2018 (r337457) +++ head/usr.bin/printf/printf.c Wed Aug 8 15:25:01 2018 (r337458) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * + * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - p = strdup(getstr()); - if (p == NULL) { + /* Convert "b" to "s" for output. */ + start[strlen(start) - 1] = 's'; + if ((p = strdup(getstr())) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - fputs(p, stdout); + PF(start, p); + /* Restore format for next loop. */ + free(p); if (getout) - return (end_fmt); + exit(*rval); break; } case 'c': { From owner-svn-src-head@freebsd.org Wed Aug 8 16:04:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 663691060544; Wed, 8 Aug 2018 16:04:28 +0000 (UTC) (envelope-from prvs=751fb83b8=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 966E683825; Wed, 8 Aug 2018 16:04:27 +0000 (UTC) (envelope-from prvs=751fb83b8=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.53,458,1531785600"; d="scan'208";a="77360106" Date: Wed, 8 Aug 2018 18:01:57 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Brooks Davis CC: Ian Lepore , , , Subject: Re: svn commit: r336526 - head Message-ID: <20180808160157.uxjcbxu57z45pap2@mac> References: <201807200044.w6K0i4QQ079894@repo.freebsd.org> <20180726135806.foqjgb555vhwhqun@mac.bytemobile.com> <1532616552.61594.23.camel@freebsd.org> <20180726145412.zp4zjznpwmhbaj65@mac.bytemobile.com> <1532617518.61594.31.camel@freebsd.org> <20180726161546.kts5tjbow7wfzhyk@mac.bytemobile.com> <20180726174146.GA63738@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180726174146.GA63738@spindle.one-eyed-alien.net> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 08 Aug 2018 16:04:28 -0000 On Thu, Jul 26, 2018 at 05:41:46PM +0000, Brooks Davis wrote: > On Thu, Jul 26, 2018 at 06:15:46PM +0200, Roger Pau Monn?? wrote: > > On Thu, Jul 26, 2018 at 09:05:18AM -0600, Ian Lepore wrote: > > > On Thu, 2018-07-26 at 16:54 +0200, Roger Pau Monn? wrote: > > > > On Thu, Jul 26, 2018 at 08:49:12AM -0600, Ian Lepore wrote: > > > > > > > > > > On Thu, 2018-07-26 at 15:58 +0200, Roger Pau Monn? wrote: > > > > > > > > > > > > On Fri, Jul 20, 2018 at 12:44:04AM +0000, Ian Lepore wrote: > > > > > > > > > > > > > > > > > > > > > Author: ian > > > > > > > Date: Fri Jul 20 00:44:04 2018 > > > > > > > New Revision: 336526 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336526 > > > > > > > > > > > > > > Log: > > > > > > > ? Add ntpd to the list of users/groups to check before > > > > > > > installing. > > > > > > The Xen CI loop is getting this when trying to create dist media > > > > > > for HEAD FreeBSD (`make -C release ftp`): > > > > > > > > > > > > + LC_ALL=C > > > > > > + export LC_ALL > > > > > > + > > > > > > PATH=/usr/lib/ccache:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbi > > > > > > n:/u > > > > > > sr/local/bin:/root/bin:/usr/lib/git-core > > > > > > + http_proxy=http://cache:3128/ > > > > > > + export http_proxy > > > > > > + https_proxy=http://cache:3128/ > > > > > > + export https_proxy > > > > > > + exec > > > > > > + cd /home/osstest/build.125515.build-amd64-freebsd > > > > > > + rm -f build-ok-stamp > > > > > > + cd freebsd > > > > > > + export 'MAKEOBJDIRPREFIX=/home/osstest/build.125515.build- > > > > > > amd64- > > > > > > freebsd/obj' > > > > > > + export 'TARGET=amd64' > > > > > > + make -C release ftp -DWITHOUT_AUTO_OBJ > > > > > > + tee ../release-ftp-log > > > > > > mkdir -p dist > > > > > > cd /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/release/.. && make TARGET_ARCH=amd64 TARGET=amd64 > > > > > > distributeworld DISTDIR=/usr/home/osstest/build.125515.build- > > > > > > amd64- > > > > > > freebsd/freebsd/release/dist > > > > > > make[2]: "/usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/obj/usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/amd64.amd64/toolchain-metadata.mk" line 1: Using > > > > > > cached toolchain metadata from build at??on Mon Jul 23 10:29:23 > > > > > > UTC > > > > > > 2018 > > > > > > ERROR: Required ntpd user is missing, see /usr/src/UPDATING. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make[2]: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make[1]: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/release > > > > > > > > > > > > The full build log can be found at: > > > > > > > > > > > > http://logs.test-lab.xenproject.org/osstest/logs/125569/build-amd > > > > > > 64-f > > > > > > reebsd/7.ts-freebsd-build.log > > > > > > > > > > > > Note that it's ~100MB. > > > > > > > > > > > > Thanks, Roger. > > > > > > > > > > > If the script is creating a new distribution image from scratch, it > > > > > should be using -DDB_FROM_SRC on all distrib* and install* make > > > > > targets, to avoid using (and verifying against) the passwd database > > > > > on > > > > > the build system. > > > > Shouldn't then that be set by default for the ftp release target? > > > > The sole purpose of that target is to create the sets that go to the > > > > servers AFAICT. > > > > > > > > Or maybe it's the distributeworld target the one missing the > > > > DB_FROM_SRC? > > > > > > > > Roger. > > > > > > > > > > I don't know anything about the release scripts or how they work. > > > > > > I started down the path of trying to make the build system > > > automatically set DB_FROM_SRC if DESTDIR is anything other than "/", > > > but I realized that's wrong too... I occasionally mount an sdcard from > > > some embedded system on my build machine and update it from a > > > crossbuild using DESTDIR=/mnt, and in a case like that, using the > > > passwd database from the system being updated is the right thing to do > > > and DB_FROM_SRC isn't right (although it would work most of the time > > > for most people). > > > > > > Right now there's no way to even properly use the passwd data from the > > > target system, and when I tried to do that, I ran into other bugs. The > > > only options now are to use the running system even when it's not > > > what's being installed (clearly wrong) or use DB_FROM_SRC to bypass the > > > checks, but also bypass using the passwd data from the target system > > > (but it works okay as long as none of the names/uids < 1024 have been > > > changed on the target system/image). > > > > But when executing something like the distributeworld target there's > > nothing to check. You cannot check against the current DB, and there's > > no destination DB since you are just generating install sets. Hence I > > think that at least for distributeworld and maybe other targets > > DB_FROM_SRC should be set by default in order to restore previous > > behavior. > > DB_FROM_SRC isn't default solely to support environments where uids/gids > don't match those in our password/group files. Unfortunately the FreeBSD > cluster has such a setup. Otherwise we'd probably have just told > people to a) don't do that and b) if you must, modify your source tree > appropriately. It's certainly the case that we should always use > DB_FROM_SRC if release builds. I think you might be right about > distributeworld, but we might need to check how that interacts with > etcupdate/mergemaster. There seems to be further fallout apart from the DB_FROM_SRC issue, I've created a PR to track this regression: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230459 Roger. From owner-svn-src-head@freebsd.org Wed Aug 8 16:08:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED93B1060678; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0587839FD; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC714DCB; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78G8dnW055918; Wed, 8 Aug 2018 16:08:39 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78G8dMp055917; Wed, 8 Aug 2018 16:08:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808081608.w78G8dMp055917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 Aug 2018 16:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337459 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 337459 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 16:08:40 -0000 Author: br Date: Wed Aug 8 16:08:38 2018 New Revision: 337459 URL: https://svnweb.freebsd.org/changeset/base/337459 Log: Implement uma_small_alloc(), uma_small_free(). Reviewed by: markj Obtained from: arm64 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16628 Modified: head/sys/riscv/include/vmparam.h head/sys/riscv/riscv/uma_machdep.c Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Wed Aug 8 15:25:01 2018 (r337458) +++ head/sys/riscv/include/vmparam.h Wed Aug 8 16:08:38 2018 (r337459) @@ -223,10 +223,7 @@ #define VM_INITIAL_PAGEIN 16 #endif -/* - * RISCVTODO - * #define UMA_MD_SMALL_ALLOC - */ +#define UMA_MD_SMALL_ALLOC #ifndef LOCORE extern vm_paddr_t dmap_phys_base; Modified: head/sys/riscv/riscv/uma_machdep.c ============================================================================== --- head/sys/riscv/riscv/uma_machdep.c Wed Aug 8 15:25:01 2018 (r337458) +++ head/sys/riscv/riscv/uma_machdep.c Wed Aug 8 16:08:38 2018 (r337459) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,13 +45,39 @@ void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, int wait) { + vm_page_t m; + vm_paddr_t pa; + void *va; - panic("uma_small_alloc"); + *flags = UMA_SLAB_PRIV; + m = vm_page_alloc_domain(NULL, 0, domain, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); + pa = m->phys_addr; +#if 0 + /* RISCVTODO: minidump */ + if ((wait & M_NODUMP) == 0) + dump_add_page(pa); +#endif + va = (void *)PHYS_TO_DMAP(pa); + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) + bzero(va, PAGE_SIZE); + return (va); } void uma_small_free(void *mem, vm_size_t size, u_int8_t flags) { + vm_page_t m; + vm_paddr_t pa; - panic("uma_small_free"); + pa = DMAP_TO_PHYS((vm_offset_t)mem); +#if 0 + /* RISCVTODO: minidump */ + dump_drop_page(pa); +#endif + m = PHYS_TO_VM_PAGE(pa); + vm_page_unwire_noq(m); + vm_page_free(m); } From owner-svn-src-head@freebsd.org Wed Aug 8 16:55:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 224251062492; Wed, 8 Aug 2018 16:55:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C493F85EF3; Wed, 8 Aug 2018 16:55:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD6955CB; Wed, 8 Aug 2018 16:55:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Gt2K5081454; Wed, 8 Aug 2018 16:55:02 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Gt2vC081451; Wed, 8 Aug 2018 16:55:02 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808081655.w78Gt2vC081451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 8 Aug 2018 16:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337463 - in head/sys: arm/arm arm/include vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: arm/arm arm/include vm X-SVN-Commit-Revision: 337463 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 16:55:03 -0000 Author: alc Date: Wed Aug 8 16:55:01 2018 New Revision: 337463 URL: https://svnweb.freebsd.org/changeset/base/337463 Log: Add support for pmap_enter(..., psind=1) to the armv6 pmap. In other words, add support for explicitly requesting that pmap_enter() create a 1 MB page mapping. (Essentially, this feature allows the machine-independent layer to create superpage mappings preemptively, and not wait for automatic promotion to occur.) Export pmap_ps_enabled() to the machine-independent layer. Add a flag to pmap_pv_insert_pte1() that specifies whether it should fail or reclaim a PV entry when one is not available. Refactor pmap_enter_pte1() into two functions, one by the same name, that is a general-purpose function for creating pte1 mappings, and another, pmap_enter_1mpage(), that is used to prefault 1 MB read- and/or execute- only mappings for execve(2), mmap(2), and shmat(2). In addition, as an optimization to pmap_enter(..., psind=0), eliminate the use of pte2_is_managed() from pmap_enter(). Unlike the x86 pmap implementations, armv6 does not have a managed bit defined within the PTE. So, pte2_is_managed() is actually a call to PHYS_TO_VM_PAGE(), which is O(n) in the number of vm_phys_segs[]. All but one call to PHYS_TO_VM_PAGE() in pmap_enter() can be avoided. Reviewed by: kib, markj, mmel Tested by: mmel MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D16555 Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h head/sys/vm/vm_fault.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/arm/arm/pmap-v6.c Wed Aug 8 16:55:01 2018 (r337463) @@ -323,9 +323,17 @@ SYSCTL_INT(_debug, OID_AUTO, PMAP1unchanged, CTLFLAG_R "Number of times pmap_pte2_quick didn't change PMAP1"); static struct mtx PMAP2mutex; +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + static __inline void pt2_wirecount_init(vm_page_t m); static boolean_t pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va); +static int pmap_enter_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, + u_int flags, vm_page_t m); void cache_icache_sync_fresh(vm_offset_t va, vm_paddr_t pa, vm_size_t size); /* @@ -1557,6 +1565,13 @@ static int sp_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0, "Are large page mappings enabled?"); +bool +pmap_ps_enabled(pmap_t pmap __unused) +{ + + return (sp_enabled != 0); +} + static SYSCTL_NODE(_vm_pmap, OID_AUTO, pte1, CTLFLAG_RD, 0, "1MB page mapping counters"); @@ -3227,21 +3242,22 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, /* * Create the pv entries for each of the pages within a section. */ -static boolean_t -pmap_pv_insert_pte1(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +static bool +pmap_pv_insert_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, u_int flags) { struct md_page *pvh; pv_entry_t pv; + bool noreclaim; rw_assert(&pvh_global_lock, RA_WLOCKED); - if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { - pv->pv_va = va; - pvh = pa_to_pvh(pa); - TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); - return (TRUE); - } else - return (FALSE); + noreclaim = (flags & PMAP_ENTER_NORECLAIM) != 0; + if ((noreclaim && pv_entry_count >= pv_entry_high_water) || + (pv = get_pv_entry(pmap, noreclaim)) == NULL) + return (false); + pv->pv_va = va; + pvh = pa_to_pvh(pte1_pa(pte1)); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + return (true); } static inline void @@ -3879,7 +3895,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if ((prot & VM_PROT_WRITE) == 0) npte2 |= PTE2_RO; KASSERT((npte2 & (PTE2_NM | PTE2_RO)) != PTE2_RO, - ("pmap_enter: flags includes VM_PROT_WRITE but prot doesn't")); + ("%s: flags includes VM_PROT_WRITE but prot doesn't", __func__)); if ((prot & VM_PROT_EXECUTE) == 0) npte2 |= PTE2_NX; if ((flags & PMAP_ENTER_WIRED) != 0) @@ -3892,6 +3908,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); sched_pin(); + if (psind == 1) { + /* Assert the required virtual and physical alignment. */ + KASSERT((va & PTE1_OFFSET) == 0, + ("%s: va unaligned", __func__)); + KASSERT(m->psind > 0, ("%s: m->psind < psind", __func__)); + rv = pmap_enter_pte1(pmap, va, PTE1_PA(pa) | ATTR_TO_L1(npte2) | + PTE1_V, flags, m); + goto out; + } /* * In the case that a page table page is not @@ -3937,7 +3962,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v */ if (mpte2) pt2_wirecount_dec(mpte2, pte1_index(va)); - if (pte2_is_managed(opte2)) + if ((m->oflags & VPO_UNMANAGED) == 0) om = m; goto validate; } @@ -3962,10 +3987,12 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if (opa) { if (pte2_is_wired(opte2)) pmap->pm_stats.wired_count--; - if (pte2_is_managed(opte2)) { - om = PHYS_TO_VM_PAGE(opa); + om = PHYS_TO_VM_PAGE(opa); + if (om != NULL && (om->oflags & VPO_UNMANAGED) != 0) + om = NULL; + if (om != NULL) pv = pmap_pvh_remove(&om->md, pmap, va); - } + /* * Remove extra pte2 reference */ @@ -3997,7 +4024,7 @@ validate: * Now validate mapping with desired protection/wiring. */ if (prot & VM_PROT_WRITE) { - if (pte2_is_managed(npte2)) + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_WRITEABLE); } @@ -4034,19 +4061,18 @@ validate: opte2 = pte2_load_clear(pte2p); pmap_tlb_flush(pmap, va); pte2_store(pte2p, npte2); - if (opte2 & PTE2_A) { - if (pte2_is_managed(opte2)) + if (om != NULL) { + KASSERT((om->oflags & VPO_UNMANAGED) == 0, + ("%s: om %p unmanaged", __func__, om)); + if ((opte2 & PTE2_A) != 0) vm_page_aflag_set(om, PGA_REFERENCED); - } - if (pte2_is_dirty(opte2)) { - if (pte2_is_managed(opte2)) + if (pte2_is_dirty(opte2)) vm_page_dirty(om); + if (TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); } - if (pte2_is_managed(opte2) && - TAILQ_EMPTY(&om->md.pv_list) && - ((om->flags & PG_FICTITIOUS) != 0 || - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) - vm_page_aflag_clear(om, PGA_WRITEABLE); } else pte2_store(pte2p, npte2); } @@ -4652,66 +4678,124 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_ } /* - * Tries to create 1MB page mapping. Returns TRUE if successful and - * FALSE otherwise. Fails if (1) a page table page cannot be allocated without - * blocking, (2) a mapping already exists at the specified virtual address, or - * (3) a pv entry cannot be allocated without reclaiming another pv entry. + * Tries to create a read- and/or execute-only 1 MB page mapping. Returns + * true if successful. Returns false if (1) a mapping already exists at the + * specified virtual address or (2) a PV entry cannot be allocated without + * reclaiming another PV entry. */ -static boolean_t -pmap_enter_pte1(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) +static bool +pmap_enter_1mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - pt1_entry_t *pte1p; + pt1_entry_t pte1; vm_paddr_t pa; - uint32_t l1prot; + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + pa = VM_PAGE_TO_PHYS(m); + pte1 = PTE1(pa, PTE1_NM | PTE1_RO, ATTR_TO_L1(vm_page_pte2_attr(m))); + if ((prot & VM_PROT_EXECUTE) == 0) + pte1 |= PTE1_NX; + if (va < VM_MAXUSER_ADDRESS) + pte1 |= PTE1_U; + if (pmap != kernel_pmap) + pte1 |= PTE1_NG; + return (pmap_enter_pte1(pmap, va, pte1, PMAP_ENTER_NOSLEEP | + PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, m) == KERN_SUCCESS); +} + +/* + * Tries to create the specified 1 MB page mapping. Returns KERN_SUCCESS if + * the mapping was created, and either KERN_FAILURE or KERN_RESOURCE_SHORTAGE + * otherwise. Returns KERN_FAILURE if PMAP_ENTER_NOREPLACE was specified and + * a mapping already exists at the specified virtual address. Returns + * KERN_RESOURCE_SHORTAGE if PMAP_ENTER_NORECLAIM was specified and PV entry + * allocation failed. + */ +static int +pmap_enter_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, u_int flags, + vm_page_t m) +{ + struct spglist free; + pt1_entry_t opte1, *pte1p; + pt2_entry_t pte2, *pte2p; + vm_offset_t cur, end; + vm_page_t mt; + rw_assert(&pvh_global_lock, RA_WLOCKED); + KASSERT((pte1 & (PTE1_NM | PTE1_RO)) == 0 || + (pte1 & (PTE1_NM | PTE1_RO)) == (PTE1_NM | PTE1_RO), + ("%s: pte1 has inconsistent NM and RO attributes", __func__)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); pte1p = pmap_pte1(pmap, va); - if (pte1_is_valid(pte1_load(pte1p))) { - CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", __func__, - va, pmap); - return (FALSE); + opte1 = pte1_load(pte1p); + if (pte1_is_valid(opte1)) { + if ((flags & PMAP_ENTER_NOREPLACE) != 0) { + CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", + __func__, va, pmap); + return (KERN_FAILURE); + } + /* Break the existing mapping(s). */ + SLIST_INIT(&free); + if (pte1_is_section(opte1)) { + /* + * If the section resulted from a promotion, then a + * reserved PT page could be freed. + */ + pmap_remove_pte1(pmap, pte1p, va, &free); + } else { + sched_pin(); + end = va + PTE1_SIZE; + for (cur = va, pte2p = pmap_pte2_quick(pmap, va); + cur != end; cur += PAGE_SIZE, pte2p++) { + pte2 = pte2_load(pte2p); + if (!pte2_is_valid(pte2)) + continue; + if (pmap_remove_pte2(pmap, pte2p, cur, &free)) + break; + } + sched_unpin(); + } + vm_page_free_pages_toq(&free, false); } if ((m->oflags & VPO_UNMANAGED) == 0) { /* * Abort this mapping if its PV entry could not be created. */ - if (!pmap_pv_insert_pte1(pmap, va, VM_PAGE_TO_PHYS(m))) { + if (!pmap_pv_insert_pte1(pmap, va, pte1, flags)) { CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", __func__, va, pmap); - return (FALSE); + return (KERN_RESOURCE_SHORTAGE); } + if ((pte1 & PTE1_RO) == 0) { + for (mt = m; mt < &m[PTE1_SIZE / PAGE_SIZE]; mt++) + vm_page_aflag_set(mt, PGA_WRITEABLE); + } } + /* * Increment counters. */ + if (pte1_is_wired(pte1)) + pmap->pm_stats.wired_count += PTE1_SIZE / PAGE_SIZE; pmap->pm_stats.resident_count += PTE1_SIZE / PAGE_SIZE; /* + * Sync icache if exec permission and attribute VM_MEMATTR_WB_WA + * is set. QQQ: For more info, see comments in pmap_enter(). + */ + if ((pte1 & PTE1_NX) == 0 && m->md.pat_mode == VM_MEMATTR_WB_WA && + pmap != kernel_pmap && (!pte1_is_section(opte1) || + pte1_pa(opte1) != VM_PAGE_TO_PHYS(m) || (opte1 & PTE2_NX) != 0)) + cache_icache_sync_fresh(va, VM_PAGE_TO_PHYS(m), PTE1_SIZE); + + /* * Map the section. - * - * QQQ: Why VM_PROT_WRITE is not evaluated and the mapping is - * made readonly? */ - pa = VM_PAGE_TO_PHYS(m); - l1prot = PTE1_RO | PTE1_NM; - if (va < VM_MAXUSER_ADDRESS) - l1prot |= PTE1_U | PTE1_NG; - if ((prot & VM_PROT_EXECUTE) == 0) - l1prot |= PTE1_NX; - else if (m->md.pat_mode == VM_MEMATTR_WB_WA && pmap != kernel_pmap) { - /* - * Sync icache if exec permission and attribute VM_MEMATTR_WB_WA - * is set. QQQ: For more info, see comments in pmap_enter(). - */ - cache_icache_sync_fresh(va, pa, PTE1_SIZE); - } - pte1_store(pte1p, PTE1(pa, l1prot, ATTR_TO_L1(vm_page_pte2_attr(m)))); + pte1_store(pte1p, pte1); pmap_pte1_mappings++; CTR3(KTR_PMAP, "%s: success for va %#lx in pmap %p", __func__, va, pmap); - return (TRUE); + return (KERN_SUCCESS); } /* @@ -4747,7 +4831,7 @@ pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_o va = start + ptoa(diff); if ((va & PTE1_OFFSET) == 0 && va + PTE1_SIZE <= end && m->psind == 1 && sp_enabled && - pmap_enter_pte1(pmap, va, m, prot)) + pmap_enter_1mpage(pmap, va, m, prot)) m = &m[PTE1_SIZE / PAGE_SIZE - 1]; else mpt2pg = pmap_enter_quick_locked(pmap, va, m, prot, @@ -6020,8 +6104,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ continue; if (dst_pmap->pm_pt1[pte1_idx] == 0 && (!pte1_is_managed(src_pte1) || - pmap_pv_insert_pte1(dst_pmap, addr, - pte1_pa(src_pte1)))) { + pmap_pv_insert_pte1(dst_pmap, addr, src_pte1, + PMAP_ENTER_NORECLAIM))) { dst_pmap->pm_pt1[pte1_idx] = src_pte1 & ~PTE1_W; dst_pmap->pm_stats.resident_count += Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/arm/include/pmap-v6.h Wed Aug 8 16:55:01 2018 (r337463) @@ -167,6 +167,7 @@ void pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kremove(vm_offset_t); boolean_t pmap_page_is_mapped(vm_page_t); +bool pmap_ps_enabled(pmap_t pmap); void pmap_tlb_flush(pmap_t, vm_offset_t); void pmap_tlb_flush_range(pmap_t, vm_offset_t, vm_size_t); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/vm/vm_fault.c Wed Aug 8 16:55:01 2018 (r337463) @@ -270,8 +270,8 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) { vm_page_t m, m_map; -#if (defined(__amd64__) || defined(__i386__) || defined(__aarch64__)) && \ - VM_NRESERVLEVEL > 0 +#if (defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__)) && VM_NRESERVLEVEL > 0 vm_page_t m_super; int flags; #endif @@ -285,8 +285,8 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t return (KERN_FAILURE); m_map = m; psind = 0; -#if (defined(__amd64__) || defined(__i386__) || defined(__aarch64__)) && \ - VM_NRESERVLEVEL > 0 +#if (defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__)) && VM_NRESERVLEVEL > 0 if ((m->flags & PG_FICTITIOUS) == 0 && (m_super = vm_reserv_to_superpage(m)) != NULL && rounddown2(vaddr, pagesizes[m_super->psind]) >= fs->entry->start && @@ -462,7 +462,8 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro pidx <= pager_last; pidx += npages, m = vm_page_next(&m[npages - 1])) { vaddr = fs->entry->start + IDX_TO_OFF(pidx) - fs->entry->offset; -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__) psind = m->psind; if (psind > 0 && ((vaddr & (pagesizes[psind] - 1)) != 0 || pidx + OFF_TO_IDX(pagesizes[psind]) - 1 > pager_last || From owner-svn-src-head@freebsd.org Wed Aug 8 17:26:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4079E1063920; Wed, 8 Aug 2018 17:26:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D5D8857B; Wed, 8 Aug 2018 17:26:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAFDA5AB8; Wed, 8 Aug 2018 17:26:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HQpO6097162; Wed, 8 Aug 2018 17:26:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HQpXp097161; Wed, 8 Aug 2018 17:26:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081726.w78HQpXp097161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337468 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 337468 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 17:26:52 -0000 Author: markj Date: Wed Aug 8 17:26:51 2018 New Revision: 337468 URL: https://svnweb.freebsd.org/changeset/base/337468 Log: Simplify compression code. - Remove the compression suffix macros and move them directly into the compress_type array. - Remove the hardcoded sizes on the suffix and compression args arrays. - Simplify the compression args arrays at the expense of a __DECONST when calling execv(). - Rewrite do_zipwork. The COMPRESS_* macros can directly index the compress_types array, so the outer loop is not needed. Convert fixed-length strings into asprintf or sbuf calls. Submitted by: Dan Nelson Reviewed by: gad MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16518 Modified: head/usr.sbin/newsyslog/Makefile head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/Makefile ============================================================================== --- head/usr.sbin/newsyslog/Makefile Wed Aug 8 17:22:41 2018 (r337467) +++ head/usr.sbin/newsyslog/Makefile Wed Aug 8 17:26:51 2018 (r337468) @@ -5,6 +5,7 @@ PROG= newsyslog MAN= newsyslog.8 newsyslog.conf.5 SRCS= newsyslog.c ptimes.c +LIBADD= sbuf HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Wed Aug 8 17:22:41 2018 (r337467) +++ head/usr.sbin/newsyslog/newsyslog.c Wed Aug 8 17:26:51 2018 (r337468) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -87,27 +88,6 @@ __FBSDID("$FreeBSD$"); #include "extern.h" /* - * Compression suffixes - */ -#ifndef COMPRESS_SUFFIX_GZ -#define COMPRESS_SUFFIX_GZ ".gz" -#endif - -#ifndef COMPRESS_SUFFIX_BZ2 -#define COMPRESS_SUFFIX_BZ2 ".bz2" -#endif - -#ifndef COMPRESS_SUFFIX_XZ -#define COMPRESS_SUFFIX_XZ ".xz" -#endif - -#ifndef COMPRESS_SUFFIX_ZST -#define COMPRESS_SUFFIX_ZST ".zst" -#endif - -#define COMPRESS_SUFFIX_MAXLEN MAX(MAX(MAX(sizeof(COMPRESS_SUFFIX_GZ),sizeof(COMPRESS_SUFFIX_BZ2)),sizeof(COMPRESS_SUFFIX_XZ)),sizeof(COMPRESS_SUFFIX_ZST)) - -/* * Compression types */ #define COMPRESS_TYPES 5 /* Number of supported compression types */ @@ -151,24 +131,21 @@ struct compress_types { const char *flag; /* Flag in configuration file */ const char *suffix; /* Compression suffix */ const char *path; /* Path to compression program */ - char **args; /* Compression program arguments */ - int nargs; /* Program argument count */ + const char **flags; /* Compression program flags */ + int nflags; /* Program flags count */ }; -static char f_arg[] = "-f"; -static char q_arg[] = "-q"; -static char rm_arg[] = "--rm"; -static char *gz_args[] = { NULL, f_arg, NULL, NULL }; -#define bz2_args gz_args -#define xz_args gz_args -static char *zstd_args[] = { NULL, q_arg, rm_arg, NULL, NULL }; +static const char *gzip_flags[] = { "-f" }; +#define bzip2_flags gzip_flags +#define xz_flags gzip_flags +static const char *zstd_flags[] = { "-q", "--rm" }; static const struct compress_types compress_type[COMPRESS_TYPES] = { - { "", "", "", NULL, 0}, - { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args, nitems(gz_args) }, - { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2, bz2_args, nitems(bz2_args) }, - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ, xz_args, nitems(xz_args) }, - { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD, zstd_args, nitems(zstd_args) } + { "", "", "", NULL, 0 }, + { "Z", ".gz", _PATH_GZIP, gzip_flags, nitems(gzip_flags) }, + { "J", ".bz2", _PATH_BZIP2, bzip2_flags, nitems(bzip2_flags) }, + { "X", ".xz", _PATH_XZ, xz_flags, nitems(xz_flags) }, + { "Y", ".zst", _PATH_ZSTD, zstd_flags, nitems(zstd_flags) } }; struct conf_entry { @@ -2020,54 +1997,19 @@ do_sigwork(struct sigwork_entry *swork) static void do_zipwork(struct zipwork_entry *zwork) { - const char *pgm_name, *pgm_path; - int errsav, fcount, zstatus; + const struct compress_types *ct; + struct sbuf *command; pid_t pidzip, wpid; - char zresult[MAXPATHLEN]; - char command[BUFSIZ]; - char **args; - int c, i, nargs; + int c, errsav, fcount, zstatus; + const char **args, *pgm_name, *pgm_path; + char *zresult; + command = NULL; assert(zwork != NULL); - pgm_path = NULL; - strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); - if (zwork->zw_conf != NULL && - zwork->zw_conf->compress > COMPRESS_NONE) - for (c = 1; c < COMPRESS_TYPES; c++) { - if (zwork->zw_conf->compress == c) { - nargs = compress_type[c].nargs; - args = calloc(nargs, sizeof(*args)); - if (args == NULL) - err(1, "calloc()"); - pgm_path = compress_type[c].path; - (void) strlcat(zresult, - compress_type[c].suffix, sizeof(zresult)); - /* the first argument is always NULL, skip it */ - for (i = 1; i < nargs; i++) { - if (compress_type[c].args[i] == NULL) - break; - args[i] = compress_type[c].args[i]; - } - break; - } - } - if (pgm_path == NULL) { - warnx("invalid entry for %s in do_zipwork", zwork->zw_fname); - return; - } - pgm_name = strrchr(pgm_path, '/'); - if (pgm_name == NULL) - pgm_name = pgm_path; - else - pgm_name++; + assert(zwork->zw_conf != NULL); + assert(zwork->zw_conf->compress > COMPRESS_NONE); + assert(zwork->zw_conf->compress < COMPRESS_TYPES); - args[0] = strdup(pgm_name); - if (args[0] == NULL) - err(1, "strdup()"); - for (c = 0; args[c] != NULL; c++) - ; - args[c] = zwork->zw_fname; - if (zwork->zw_swork != NULL && zwork->zw_swork->sw_runcmd == 0 && zwork->zw_swork->sw_pidok <= 0) { warnx( @@ -2077,20 +2019,54 @@ do_zipwork(struct zipwork_entry *zwork) return; } - strlcpy(command, pgm_path, sizeof(command)); + ct = &compress_type[zwork->zw_conf->compress]; + + /* + * execv will be called with the array [ program, flags ... , + * filename, NULL ] so allocate nflags+3 elements for the array. + */ + args = calloc(ct->nflags + 3, sizeof(*args)); + if (args == NULL) + err(1, "calloc"); + + pgm_path = ct->path; + pgm_name = strrchr(pgm_path, '/'); + if (pgm_name == NULL) + pgm_name = pgm_path; + else + pgm_name++; + + /* Build the argument array. */ + args[0] = pgm_name; + for (c = 0; c < ct->nflags; c++) + args[c + 1] = ct->flags[c]; + args[c + 1] = zwork->zw_fname; + + /* Also create a space-delimited version if we need to print it. */ + if ((command = sbuf_new_auto()) == NULL) + errx(1, "sbuf_new"); + sbuf_cpy(command, pgm_path); for (c = 1; args[c] != NULL; c++) { - strlcat(command, " ", sizeof(command)); - strlcat(command, args[c], sizeof(command)); + sbuf_putc(command, ' '); + sbuf_cat(command, args[c]); } + if (sbuf_finish(command) == -1) + err(1, "sbuf_finish"); + + /* Determine the filename of the compressed file. */ + asprintf(&zresult, "%s%s", zwork->zw_fname, ct->suffix); + if (zresult == NULL) + errx(1, "asprintf"); + + if (verbose) + printf("Executing: %s\n", sbuf_data(command)); + if (noaction) { printf("\t%s %s\n", pgm_name, zwork->zw_fname); change_attrs(zresult, zwork->zw_conf); - return; + goto out; } - if (verbose) { - printf("Executing: %s\n", command); - } fcount = 1; pidzip = fork(); while (pidzip < 0) { @@ -2108,34 +2084,34 @@ do_zipwork(struct zipwork_entry *zwork) } if (!pidzip) { /* The child process executes the compression command */ - execv(pgm_path, (char *const*) args); - err(1, "execv(`%s')", command); + execv(pgm_path, __DECONST(char *const*, args)); + err(1, "execv(`%s')", sbuf_data(command)); } wpid = waitpid(pidzip, &zstatus, 0); if (wpid == -1) { /* XXX - should this be a fatal error? */ warn("%s: waitpid(%d)", pgm_path, pidzip); - return; + goto out; } if (!WIFEXITED(zstatus)) { - warnx("`%s' did not terminate normally", command); - free(args[0]); - free(args); - return; + warnx("`%s' did not terminate normally", sbuf_data(command)); + goto out; } if (WEXITSTATUS(zstatus)) { - warnx("`%s' terminated with a non-zero status (%d)", command, - WEXITSTATUS(zstatus)); - free(args[0]); - free(args); - return; + warnx("`%s' terminated with a non-zero status (%d)", + sbuf_data(command), WEXITSTATUS(zstatus)); + goto out; } - free(args[0]); - free(args); /* Compression was successful, set file attributes on the result. */ change_attrs(zresult, zwork->zw_conf); + +out: + if (command != NULL) + sbuf_delete(command); + free(args); + free(zresult); } /* @@ -2442,8 +2418,18 @@ age_old_log(const char *file) { struct stat sb; const char *logfile_suffix; - char tmp[MAXPATHLEN + sizeof(".0") + COMPRESS_SUFFIX_MAXLEN + 1]; + static unsigned int suffix_maxlen = 0; + char *tmp; time_t mtime; + int c; + + if (suffix_maxlen == 0) { + for (c = 0; c < COMPRESS_TYPES; c++) + suffix_maxlen = MAX(suffix_maxlen, + strlen(compress_type[c].suffix)); + } + + tmp = alloca(MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1); if (archtodir) { char *p; From owner-svn-src-head@freebsd.org Wed Aug 8 17:32:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 996D91063F2D; Wed, 8 Aug 2018 17:32:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 506D488C95; Wed, 8 Aug 2018 17:32:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 322785B2C; Wed, 8 Aug 2018 17:32:03 +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 w78HW377002185; Wed, 8 Aug 2018 17:32:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HW3r7002184; Wed, 8 Aug 2018 17:32:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808081732.w78HW3r7002184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 17:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337469 - head/sys/netpfil/ipfw/pmod X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/pmod X-SVN-Commit-Revision: 337469 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 17:32:03 -0000 Author: ae Date: Wed Aug 8 17:32:02 2018 New Revision: 337469 URL: https://svnweb.freebsd.org/changeset/base/337469 Log: Use host byte order when comparing mss values. This fixes tcp-setmss action on little endian machines. PR: 225536 Submitted by: John Zielinski Modified: head/sys/netpfil/ipfw/pmod/tcpmod.c Modified: head/sys/netpfil/ipfw/pmod/tcpmod.c ============================================================================== --- head/sys/netpfil/ipfw/pmod/tcpmod.c Wed Aug 8 17:26:51 2018 (r337468) +++ head/sys/netpfil/ipfw/pmod/tcpmod.c Wed Aug 8 17:32:02 2018 (r337469) @@ -98,7 +98,7 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, in ret = 0; /* report success */ bcopy(cp + 2, &oldmss, sizeof(oldmss)); /* Do not update lower MSS value */ - if (oldmss <= mss) + if (ntohs(oldmss) <= ntohs(mss)) break; bcopy(&mss, cp + 2, sizeof(mss)); /* Update checksum if it is not delayed. */ From owner-svn-src-head@freebsd.org Wed Aug 8 17:52:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25CB71064F21; Wed, 8 Aug 2018 17:52:16 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 997D88A248; Wed, 8 Aug 2018 17:52:15 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w78HqDU3094060 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Aug 2018 10:52:13 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w78HqD6d094059; Wed, 8 Aug 2018 10:52:13 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 8 Aug 2018 10:52:13 -0700 From: Gleb Smirnoff To: Ed Maste , br@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336692 - head/sys/sys Message-ID: <20180808175213.GA420@FreeBSD.org> References: <201807250018.w6P0ILvv074365@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807250018.w6P0ILvv074365@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 08 Aug 2018 17:52:16 -0000 On Wed, Jul 25, 2018 at 12:18:21AM +0000, Ed Maste wrote: E> Author: emaste E> Date: Wed Jul 25 00:18:21 2018 E> New Revision: 336692 E> URL: https://svnweb.freebsd.org/changeset/base/336692 E> E> Log: E> sockopt.h: remove stale comment E> E> Some old compatibility bits were removed in r227503 but this comment E> was left behind. E> E> Reported by: br, via review D11962 E> Sponsored by: The FreeBSD Foundation E> E> Modified: E> head/sys/sys/sockopt.h E> E> Modified: head/sys/sys/sockopt.h E> ============================================================================== E> --- head/sys/sys/sockopt.h Wed Jul 25 00:06:18 2018 (r336691) E> +++ head/sys/sys/sockopt.h Wed Jul 25 00:18:21 2018 (r336692) E> @@ -62,7 +62,6 @@ int sosetopt(struct socket *so, struct sockopt *sopt); E> int sogetopt(struct socket *so, struct sockopt *sopt); E> int sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen); E> int sooptcopyout(struct sockopt *sopt, const void *buf, size_t len); E> -/* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */ E> int soopt_getm(struct sockopt *sopt, struct mbuf **mp); E> int soopt_mcopyin(struct sockopt *sopt, struct mbuf *m); E> int soopt_mcopyout(struct sockopt *sopt, struct mbuf *m); This comment was a good mark to note that these three functions need to go away. But IPv6 still uses them. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Aug 8 18:50:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E92C81066ECD; Wed, 8 Aug 2018 18:50:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570118D23E; Wed, 8 Aug 2018 18:50:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D476808; Wed, 8 Aug 2018 18:50:43 +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 w78IohRu040533; Wed, 8 Aug 2018 18:50:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Iohfh040532; Wed, 8 Aug 2018 18:50:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808081850.w78Iohfh040532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 8 Aug 2018 18:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337482 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 337482 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 18:50:44 -0000 Author: asomers Date: Wed Aug 8 18:50:42 2018 New Revision: 337482 URL: https://svnweb.freebsd.org/changeset/base/337482 Log: Bring VOP_LOOKUP(9) up to date * Remove the cn_hash field (removed by r51906) * Add the cn_lkflags field (added by r144285) * Remove duplicate definition of cnp. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16629 Modified: head/share/man/man9/VOP_LOOKUP.9 Modified: head/share/man/man9/VOP_LOOKUP.9 ============================================================================== --- head/share/man/man9/VOP_LOOKUP.9 Wed Aug 8 18:50:32 2018 (r337481) +++ head/share/man/man9/VOP_LOOKUP.9 Wed Aug 8 18:50:42 2018 (r337482) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2017 +.Dd August 8, 2018 .Dt VOP_LOOKUP 9 .Os .Sh NAME @@ -51,10 +51,7 @@ The locked vnode of the directory to search. The address of a variable where the resulting locked vnode should be stored. .It Fa cnp The pathname component to be searched for. -.El -.Pp -.Fa Cnp -is a pointer to a componentname structure defined as follows: +It is a pointer to a componentname structure defined as follows: .Bd -literal struct componentname { /* @@ -64,13 +61,13 @@ struct componentname { u_long cn_flags; /* flags to namei */ struct thread *cn_thread; /* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ + int cn_lkflags; /* Lock flags LK_EXCLUSIVE or LK_SHARED */ /* * Shared between lookup and commit routines. */ char *cn_pnbuf; /* pathname buffer */ char *cn_nameptr; /* pointer to looked up name */ long cn_namelen; /* length of looked up component */ - u_long cn_hash; /* hash value of looked up name */ }; .Ed .Pp From owner-svn-src-head@freebsd.org Wed Aug 8 19:15:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E6B10680CF; Wed, 8 Aug 2018 19:15:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F188D8F0C9; Wed, 8 Aug 2018 19:15:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2A976CCC; Wed, 8 Aug 2018 19:15:45 +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 w78JFjFA056130; Wed, 8 Aug 2018 19:15:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JFj6V056129; Wed, 8 Aug 2018 19:15:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081915.w78JFj6V056129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337494 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337494 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 19:15:46 -0000 Author: bdrewery Date: Wed Aug 8 19:15:45 2018 New Revision: 337494 URL: https://svnweb.freebsd.org/changeset/base/337494 Log: DIRS: Ensure existing directory still has permissions set. Modified: head/share/mk/bsd.dirs.mk Modified: head/share/mk/bsd.dirs.mk ============================================================================== --- head/share/mk/bsd.dirs.mk Wed Aug 8 19:03:06 2018 (r337493) +++ head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:45 2018 (r337494) @@ -28,9 +28,9 @@ ${dir}TAG_ARGS= -T ${${dir}TAGS:[*]:S/ /,/g} installdirs: installdirs-${dir} -installdirs-${dir}: ${DESTDIR}${${dir}} +installdirs-${dir}: installdirs-${DESTDIR}${${dir}} -${DESTDIR}${${dir}}: +installdirs-${DESTDIR}${${dir}}: @${ECHO} installing DIRS ${dir} ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \ -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}} From owner-svn-src-head@freebsd.org Wed Aug 8 19:15:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE68810680EE; Wed, 8 Aug 2018 19:15:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 660E48F0D2; Wed, 8 Aug 2018 19:15:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4877B6CCE; Wed, 8 Aug 2018 19:15:49 +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 w78JFnew056343; Wed, 8 Aug 2018 19:15:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JFnrm056342; Wed, 8 Aug 2018 19:15:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081915.w78JFnrm056342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337495 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337495 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 19:15:49 -0000 Author: bdrewery Date: Wed Aug 8 19:15:48 2018 New Revision: 337495 URL: https://svnweb.freebsd.org/changeset/base/337495 Log: DIRS: Fix duplicate target warnings. Modified: head/share/mk/bsd.dirs.mk Modified: head/share/mk/bsd.dirs.mk ============================================================================== --- head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:45 2018 (r337494) +++ head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:48 2018 (r337495) @@ -30,10 +30,12 @@ installdirs: installdirs-${dir} installdirs-${dir}: installdirs-${DESTDIR}${${dir}} +. if !target(installdirs-${DESTDIR}${${dir}}) installdirs-${DESTDIR}${${dir}}: @${ECHO} installing DIRS ${dir} ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \ -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}} +. endif . endif realinstall: installdirs-${dir} From owner-svn-src-head@freebsd.org Wed Aug 8 19:24:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 875051068605; Wed, 8 Aug 2018 19:24:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF378FA6F; Wed, 8 Aug 2018 19:24:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 062D26E75; Wed, 8 Aug 2018 19:24:25 +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 w78JOPCk061388; Wed, 8 Aug 2018 19:24:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JOKLP061364; Wed, 8 Aug 2018 19:24:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808081924.w78JOKLP061364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 8 Aug 2018 19:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin... X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin/msgs usr.sbin/freebsd-up... X-SVN-Commit-Revision: 337497 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 19:24:25 -0000 Author: asomers Date: Wed Aug 8 19:24:20 2018 New Revision: 337497 URL: https://svnweb.freebsd.org/changeset/base/337497 Log: Switch the default pager for most commands to less Finally, a pager for the nineties. MFC after: Never Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D13465 Poll: https://reviews.freebsd.org/V7 Modified: head/UPDATING head/contrib/mdocml/apropos.1 head/contrib/mdocml/main.c head/contrib/mdocml/man.1 head/contrib/mdocml/mandoc.1 head/contrib/tnftp/src/ftp_var.h head/etc/root/dot.cshrc head/etc/root/dot.profile head/share/skel/dot.cshrc head/share/skel/dot.mailrc head/share/skel/dot.profile head/tools/tools/nanobsd/pcengines/Files/root/.cshrc head/tools/tools/nanobsd/rescue/Files/root/.cshrc head/usr.bin/mail/cmd1.c head/usr.bin/mail/mail.1 head/usr.bin/mail/pathnames.h head/usr.bin/man/man.1 head/usr.bin/man/man.sh head/usr.bin/msgs/msgs.1 head/usr.bin/msgs/pathnames.h head/usr.sbin/freebsd-update/freebsd-update.sh head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mergemaster/mergemaster.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 8 19:21:08 2018 (r337496) +++ head/UPDATING Wed Aug 8 19:24:20 2018 (r337497) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180808: + The default pager for most commands has been changed to "less". To + restore the old behavior, set PAGER="more" and MANPAGER="more -s" in + your environment. + 20180731: The jedec_ts(4) driver has been removed. A superset of its functionality is available in the jedec_dimm(4) driver, and the manpage for that Modified: head/contrib/mdocml/apropos.1 ============================================================================== --- head/contrib/mdocml/apropos.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/apropos.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 4 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt APROPOS 1 .Os .Sh NAME @@ -74,7 +74,7 @@ would. If the standard output is a terminal device and .Fl c is not specified, use -.Xr more 1 +.Xr less 1 to paginate them. In .Fl a @@ -334,7 +334,7 @@ Text production: Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 ; +.Xr less 1 ; see .Xr man 1 for details. @@ -357,7 +357,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/mdocml/main.c ============================================================================== --- head/contrib/mdocml/main.c Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/main.c Wed Aug 8 19:24:20 2018 (r337497) @@ -1119,7 +1119,7 @@ spawn_pager(struct tag_files *tag_files) if (pager == NULL || *pager == '\0') pager = getenv("PAGER"); if (pager == NULL || *pager == '\0') - pager = "more -s"; + pager = "less -s"; cp = mandoc_strdup(pager); /* Modified: head/contrib/mdocml/man.1 ============================================================================== --- head/contrib/mdocml/man.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/man.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -31,7 +31,7 @@ .\" .\" @(#)man.1 8.2 (Berkeley) 1/2/94 .\" -.Dd $Mdocdate: May 17 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt MAN 1 .Os .Sh NAME @@ -75,7 +75,7 @@ See for a description of the contents of this file. .It Fl c Copy the manual page to the standard output instead of using -.Xr more 1 +.Xr less 1 to paginate it. This is done by default if the standard output is not a terminal device. .It Fl f @@ -233,7 +233,7 @@ is case insensitive. Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 . +.Xr less 1 . If .Xr less 1 is used, the interactive @@ -282,7 +282,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/mdocml/mandoc.1 ============================================================================== --- head/contrib/mdocml/mandoc.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/mandoc.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 20 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt MANDOC 1 .Os .Sh NAME @@ -54,13 +54,13 @@ The options are as follows: If the standard output is a terminal device and .Fl c is not specified, use -.Xr more 1 +.Xr less 1 to paginate the output, just like .Xr man 1 would. .It Fl c Copy the formatted manual pages to the standard output without using -.Xr more 1 +.Xr less 1 to paginate them. This is the default. It can be specified to override @@ -578,7 +578,7 @@ Meta data is not available in this case. Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 ; +.Xr less 1 ; see .Xr man 1 for details. @@ -592,7 +592,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/tnftp/src/ftp_var.h ============================================================================== --- head/contrib/tnftp/src/ftp_var.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/tnftp/src/ftp_var.h Wed Aug 8 19:24:20 2018 (r337497) @@ -189,7 +189,7 @@ enum { #define GATE_SERVER "" /* default server */ #endif -#define DEFAULTPAGER "more" /* default pager if $PAGER isn't set */ +#define DEFAULTPAGER "less" /* default pager if $PAGER isn't set */ #define DEFAULTPROMPT "ftp> " /* default prompt if `set prompt' is empty */ #define DEFAULTRPROMPT "" /* default rprompt if `set rprompt' is empty */ Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/etc/root/dot.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER more +setenv PAGER less setenv BLOCKSIZE K if ($?prompt) then Modified: head/etc/root/dot.profile ============================================================================== --- head/etc/root/dot.profile Wed Aug 8 19:21:08 2018 (r337496) +++ head/etc/root/dot.profile Wed Aug 8 19:24:20 2018 (r337497) @@ -6,7 +6,7 @@ HOME=/root export HOME TERM=${TERM:-xterm} export TERM -PAGER=more +PAGER=less export PAGER # Query terminal size; useful for serial lines. Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -20,7 +20,7 @@ alias ll ls -lAF # umask 22 setenv EDITOR vi -setenv PAGER more +setenv PAGER less if ($?prompt) then # An interactive shell -- set some stuff up Modified: head/share/skel/dot.mailrc ============================================================================== --- head/share/skel/dot.mailrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.mailrc Wed Aug 8 19:24:20 2018 (r337497) @@ -7,7 +7,7 @@ set append ask autoprint set indentprefix="> " -set PAGER=more +set PAGER=less set EDITOR=vi set VISUAL=vi set folder=Mail Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.profile Wed Aug 8 19:24:20 2018 (r337497) @@ -16,7 +16,7 @@ # TERM=xterm; export TERM EDITOR=vi; export EDITOR -PAGER=more; export PAGER +PAGER=less; export PAGER # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV Modified: head/tools/tools/nanobsd/pcengines/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -17,7 +17,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER more +setenv PAGER less setenv BLOCKSIZE K if ($?prompt) then Modified: head/tools/tools/nanobsd/rescue/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/rescue/Files/root/.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/tools/tools/nanobsd/rescue/Files/root/.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -8,13 +8,13 @@ a la ls -a a lf ls -FA a ll ls -lA - a lm 'll | more' - a m more + a lm 'll | less' + a m less set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin) setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man" -setenv PAGER more +setenv PAGER less setenv EDITOR vi setenv BLOCKSIZE K setenv FTP_PASSIVE_MODE YES Modified: head/usr.bin/mail/cmd1.c ============================================================================== --- head/usr.bin/mail/cmd1.c Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/cmd1.c Wed Aug 8 19:24:20 2018 (r337497) @@ -311,7 +311,7 @@ type1(int *msgvec, int doign, int page) if (page || nlines > (*cp ? atoi(cp) : realscreenheight)) { cp = value("PAGER"); if (cp == NULL || *cp == '\0') - cp = _PATH_MORE; + cp = _PATH_LESS; obuf = Popen(cp, "w"); if (obuf == NULL) { warnx("%s", cp); Modified: head/usr.bin/mail/mail.1 ============================================================================== --- head/usr.bin/mail/mail.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/mail.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -28,7 +28,7 @@ .\" @(#)mail.1 8.8 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd January 5, 2006 +.Dd August 8, 2018 .Dt MAIL 1 .Os .Sh NAME @@ -1188,7 +1188,7 @@ command or when .Va crt variable is set. The default paginator -.Xr more 1 +.Xr less 1 is used if this option is not defined. .It Ev REPLYTO If set, will be used to initialize the Reply-To field for outgoing Modified: head/usr.bin/mail/pathnames.h ============================================================================== --- head/usr.bin/mail/pathnames.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/pathnames.h Wed Aug 8 19:24:20 2018 (r337497) @@ -37,4 +37,4 @@ #define _PATH_HELP "/usr/share/misc/mail.help" #define _PATH_TILDE "/usr/share/misc/mail.tildehelp" #define _PATH_MASTER_RC "/usr/share/misc/mail.rc:/usr/local/etc/mail.rc:/etc/mail.rc" -#define _PATH_MORE "/usr/bin/more" +#define _PATH_LESS "/usr/bin/less" Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/man/man.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2018 +.Dd August 8, 2018 .Dt MAN 1 .Os .Sh NAME @@ -106,7 +106,7 @@ Use specified pager. Defaults to .Dq Li "less -sR" if color support is enabled, or -.Dq Li "more -s" . +.Dq Li "less -s" . Overrides the .Ev MANPAGER environment variable, which in turn overrides the @@ -345,7 +345,7 @@ If unset, and color support is disabled, then .Ev PAGER is used. If that has no value either, -.Dq Li "more -s" +.Dq Li "less -s" is used. .El .Sh FILES Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/man/man.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -901,7 +901,7 @@ setup_pager() { if [ -n "$PAGER" ]; then MANPAGER="$PAGER" else - MANPAGER="more -s" + MANPAGER="less -s" fi fi fi Modified: head/usr.bin/msgs/msgs.1 ============================================================================== --- head/usr.bin/msgs/msgs.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/msgs/msgs.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -28,7 +28,7 @@ .\" @(#)msgs.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd August 8, 2018 .Dt MSGS 1 .Os .Sh NAME @@ -196,7 +196,7 @@ messages back from the one indicated in the file, useful for reviews of recent messages. .It Fl p Pipe long messages through -.Xr more 1 . +.Xr less 1 . .El .Pp Within @@ -222,7 +222,7 @@ number of next message to be presented .El .Sh SEE ALSO .Xr mail 1 , -.Xr more 1 , +.Xr less 1 , .Xr aliases 5 , .Xr periodic 8 .Sh HISTORY Modified: head/usr.bin/msgs/pathnames.h ============================================================================== --- head/usr.bin/msgs/pathnames.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/msgs/pathnames.h Wed Aug 8 19:24:20 2018 (r337497) @@ -35,6 +35,6 @@ #define _PATH_MSGS "/var/msgs" #define _PATH_MAIL "/usr/bin/Mail -f %s" -#define _PATH_PAGER "/usr/bin/more -%d" +#define _PATH_PAGER "/usr/bin/less -%d" #undef _PATH_TMP #define _PATH_TMP "/tmp/msgXXXXXX" Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -3300,7 +3300,7 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} # Set a pager if the user doesn't if [ -z "$PAGER" ]; then - PAGER=/usr/bin/more + PAGER=/usr/bin/less fi # Set LC_ALL in order to avoid problems with character ranges like [A-Z]. Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/mergemaster/mergemaster.8 Wed Aug 8 19:24:20 2018 (r337497) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2017 +.Dd August 8, 2018 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -299,7 +299,7 @@ utility uses the .Ev PAGER environment variable if set. Otherwise it uses -.Xr more 1 . +.Xr less 1 . If .Ev PAGER specifies a program outside @@ -451,7 +451,7 @@ comparison, use: .Sh SEE ALSO .Xr diff 1 , .Xr make 1 , -.Xr more 1 , +.Xr less 1 , .Xr sdiff 1 , .Xr pwd_mkdb 8 .Pp Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -426,19 +426,19 @@ check_pager () { echo '' echo " or you may type an absolute path to PAGER for this run" echo '' - echo " Default is to use plain old 'more' " + echo " Default is to use 'less' " echo '' - echo -n "What should I do? [Use 'more'] " + echo -n "What should I do? [Use 'less'] " read FIXPAGER case "${FIXPAGER}" in [eE]) exit 0 ;; - [lL]) + [lL]|'') PAGER=less ;; - [mM]|'') + [mM]) PAGER=more ;; /*) @@ -458,11 +458,11 @@ check_pager () { esac # If user has a pager defined, or got assigned one above, use it. -# If not, use more. +# If not, use less. # -PAGER=${PAGER:-more} +PAGER=${PAGER:-less} -if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then +if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then echo " *** You have ${PAGER} defined as your pager so we will use that" echo '' sleep 3 @@ -1127,7 +1127,7 @@ for COMPFILE in `find . -type f | sort`; do else # Ok, the files are different, so show the user where they differ. # Use user's choice of diff methods; and user's pager if they have one. - # Use more if not. + # Use less if not. # Use unified diffs by default. Context diffs give me a headache. :) # # If the user chose the -F option, test for that before proceeding From owner-svn-src-head@freebsd.org Wed Aug 8 20:15:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A363E1069A24; Wed, 8 Aug 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57ACD91B42; Wed, 8 Aug 2018 20:15:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34D7F7696; Wed, 8 Aug 2018 20:15:41 +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 w78KFe4S088993; Wed, 8 Aug 2018 20:15:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KFeid088992; Wed, 8 Aug 2018 20:15:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808082015.w78KFeid088992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 20:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337500 - head/usr.sbin/route6d X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/route6d X-SVN-Commit-Revision: 337500 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 20:15:41 -0000 Author: markj Date: Wed Aug 8 20:15:40 2018 New Revision: 337500 URL: https://svnweb.freebsd.org/changeset/base/337500 Log: Use the right variable when updating interface routes. PR: 229807 Submitted by: John Hay MFC after: 2 weeks Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Wed Aug 8 19:36:28 2018 (r337499) +++ head/usr.sbin/route6d/route6d.c Wed Aug 8 20:15:40 2018 (r337500) @@ -2223,8 +2223,10 @@ ifrt(struct ifc *ifcp, int again) goto next; } - TAILQ_REMOVE(&riprt_head, rrt, rrt_next); - delroute(&rrt->rrt_info, &rrt->rrt_gw); + TAILQ_REMOVE(&riprt_head, search_rrt, rrt_next); + delroute(&search_rrt->rrt_info, + &search_rrt->rrt_gw); + free(search_rrt); } /* Attach the route to the list */ trace(1, "route: %s/%d: register route (%s)\n", From owner-svn-src-head@freebsd.org Wed Aug 8 20:21:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A8721069D75; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23E4991FA8; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0519A77E3; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78KLjEe090792; Wed, 8 Aug 2018 20:21:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KLjkJ090791; Wed, 8 Aug 2018 20:21:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808082021.w78KLjkJ090791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 8 Aug 2018 20:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337501 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 337501 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 20:21:46 -0000 Author: rmacklem Date: Wed Aug 8 20:21:45 2018 New Revision: 337501 URL: https://svnweb.freebsd.org/changeset/base/337501 Log: Assorted fixes to handling of LayoutRecall callbacks, mostly error handling. After a re-read of the appropriate section of RFC5661, I decided that a few things should be changed related to LayoutRecall callback handling. Here are the things fixed by this patch. - For two of the three cases that LayoutRecall is done, I now think setting the clora_changed argument false is correct. - All errors other than NFSERR_DELAY returned by LayoutRecall appear permanent, so don't retry for any of them. (NFSERR_DELAY is retried by newnfs_request(), so it is not affected by this patch.) - Instead of waiting "forever" (actually until the process is SIGTERM'd) for Layouts to be returned during a mirror copy, fail and return ENXIO after about 1minute. Waiting for a C made sense when pnfsdscopymr() was done by itself, but did not make sense when done via find(1). This patch only affects the pNFS server. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Aug 8 20:15:40 2018 (r337500) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Aug 8 20:21:45 2018 (r337501) @@ -220,8 +220,8 @@ static void nfsrv_freealldevids(void); static void nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, NFSPROC_T *p); static int nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *stateidp, - fhandle_t *fhp, struct nfslayout *lyp, struct nfslayouthead *lyheadp, - int laytype, NFSPROC_T *p); + fhandle_t *fhp, struct nfslayout *lyp, int changed, int laytype, + NFSPROC_T *p); static int nfsrv_findlayout(nfsquad_t *clientidp, fhandle_t *fhp, int laytype, NFSPROC_T *, struct nfslayout **lypp); static int nfsrv_fndclid(nfsquad_t *clidvec, nfsquad_t clid, int clidcnt); @@ -4234,6 +4234,8 @@ out: /* * Do a server callback. + * The "trunc" argument is slightly overloaded and refers to different + * boolean arguments for CBRECALL and CBLAYOUTRECALL. */ static int nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, @@ -4337,7 +4339,10 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, n NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(laytype); *tl++ = txdr_unsigned(NFSLAYOUTIOMODE_ANY); - *tl++ = newnfs_true; + if (trunc) + *tl++ = newnfs_true; + else + *tl++ = newnfs_false; *tl = txdr_unsigned(NFSV4LAYOUTRET_FILE); nfsm_fhtom(nd, (uint8_t *)fhp, NFSX_MYFH, 0); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_HYPER + NFSX_STATEID); @@ -6817,13 +6822,11 @@ nfsrv_flexmirrordel(char *devid, NFSPROC_T *p) /* * The layout stateid.seqid needs to be incremented * before doing a LAYOUT_RECALL callback. - * Set lay_trycnt to UINT16_MAX so it won't set up a retry. */ if (++lyp->lay_stateid.seqid == 0) lyp->lay_stateid.seqid = 1; - lyp->lay_trycnt = UINT16_MAX; nfsrv_recalllayout(lyp->lay_clientid, &lyp->lay_stateid, - &lyp->lay_fh, lyp, &loclyp, lyp->lay_type, p); + &lyp->lay_fh, lyp, 1, lyp->lay_type, p); nfsrv_freelayout(&loclyp, lyp); } } @@ -6833,8 +6836,7 @@ nfsrv_flexmirrordel(char *devid, NFSPROC_T *p) */ static int nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *stateidp, fhandle_t *fhp, - struct nfslayout *lyp, struct nfslayouthead *lyheadp, int laytype, - NFSPROC_T *p) + struct nfslayout *lyp, int changed, int laytype, NFSPROC_T *p) { struct nfsclient *clp; int error; @@ -6843,38 +6845,29 @@ nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *sta error = nfsrv_getclient(clid, 0, &clp, NULL, (nfsquad_t)((u_quad_t)0), 0, NULL, p); NFSD_DEBUG(4, "aft nfsrv_getclient=%d\n", error); - if (error != 0) + if (error != 0) { + printf("nfsrv_recalllayout: getclient err=%d\n", error); return (error); + } if ((clp->lc_flags & LCL_NFSV41) != 0) { error = nfsrv_docallback(clp, NFSV4OP_CBLAYOUTRECALL, - stateidp, 0, fhp, NULL, NULL, laytype, p); + stateidp, changed, fhp, NULL, NULL, laytype, p); /* If lyp != NULL, handle an error return here. */ if (error != 0 && lyp != NULL) { NFSDRECALLLOCK(); - if (error == NFSERR_NOMATCHLAYOUT) { - /* - * Mark it returned, since there is no layout. - */ - if ((lyp->lay_flags & NFSLAY_RECALL) != 0) { - lyp->lay_flags |= NFSLAY_RETURNED; - wakeup(lyp); - } - NFSDRECALLUNLOCK(); - } else if ((lyp->lay_flags & NFSLAY_RETURNED) == 0 && - lyp->lay_trycnt < 10) { - /* - * Clear recall, so it can be tried again - * and put it at the end of the list to - * delay the retry a little longer. - */ - lyp->lay_flags &= ~NFSLAY_RECALL; - lyp->lay_trycnt++; - TAILQ_REMOVE(lyheadp, lyp, lay_list); - TAILQ_INSERT_TAIL(lyheadp, lyp, lay_list); - NFSDRECALLUNLOCK(); - nfs_catnap(PVFS, 0, "nfsrclay"); - } else - NFSDRECALLUNLOCK(); + /* + * Mark it returned, since no layout recall + * has been done. + * All errors seem to be non-recoverable, although + * NFSERR_NOMATCHLAYOUT is a normal event. + */ + if ((lyp->lay_flags & NFSLAY_RECALL) != 0) { + lyp->lay_flags |= NFSLAY_RETURNED; + wakeup(lyp); + } + NFSDRECALLUNLOCK(); + if (error != NFSERR_NOMATCHLAYOUT) + printf("nfsrv_recalllayout: err=%d\n", error); } } else printf("nfsrv_recalllayout: clp not NFSv4.1\n"); @@ -6914,10 +6907,10 @@ nfsrv_recalloldlayout(NFSPROC_T *p) } NFSUNLOCKLAYOUT(lhyp); if (lyp != NULL) { - error = nfsrv_recalllayout(clientid, &stateid, &fh, NULL, NULL, + error = nfsrv_recalllayout(clientid, &stateid, &fh, NULL, 0, laytype, p); if (error != 0 && error != NFSERR_NOMATCHLAYOUT) - printf("recallold=%d\n", error); + NFSD_DEBUG(4, "recallold=%d\n", error); if (error != 0) { NFSLOCKLAYOUT(lhyp); /* @@ -8068,8 +8061,7 @@ tryagain: lyp->lay_stateid.seqid = 1; NFSDRECALLUNLOCK(); nfsrv_recalllayout(lyp->lay_clientid, &lyp->lay_stateid, - &lyp->lay_fh, lyp, &nfsrv_recalllisthead, - lyp->lay_type, p); + &lyp->lay_fh, lyp, 0, lyp->lay_type, p); NFSD_DEBUG(4, "nfsrv_copymr: recalled layout\n"); goto tryagain; } @@ -8086,17 +8078,33 @@ tryagain2: NFSD_DEBUG(4, "nfsrv_copymr: layout returned\n"); } else { + lyp->lay_trycnt++; ret = mtx_sleep(lyp, NFSDRECALLMUTEXPTR, PVFS | PCATCH, "nfsmrl", hz); NFSD_DEBUG(4, "nfsrv_copymr: aft sleep=%d\n", ret); if (ret == EINTR || ret == ERESTART) break; - if ((lyp->lay_flags & NFSLAY_RETURNED) == 0 && - didprintf == 0) { - printf("nfsrv_copymr: layout not " - "returned\n"); - didprintf = 1; + if ((lyp->lay_flags & NFSLAY_RETURNED) == 0) { + /* + * Give up after 60sec and return + * ENXIO, failing the copymr. + * This layout will remain on the + * recalllist. It can only be cleared + * by restarting the nfsd. + * This seems the safe way to handle + * it, since it cannot be safely copied + * with an outstanding RW layout. + */ + if (lyp->lay_trycnt >= 60) { + ret = ENXIO; + break; + } + if (didprintf == 0) { + printf("nfsrv_copymr: layout " + "not returned\n"); + didprintf = 1; + } } } goto tryagain2; From owner-svn-src-head@freebsd.org Wed Aug 8 20:30:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7EB4106A096; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F619927A0; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CA407844; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78KUDUc094660; Wed, 8 Aug 2018 20:30:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KUDS2094659; Wed, 8 Aug 2018 20:30:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808082030.w78KUDS2094659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 8 Aug 2018 20:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337502 - head/usr.sbin/pnfsdscopymr X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdscopymr X-SVN-Commit-Revision: 337502 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 20:30:13 -0000 Author: rmacklem Date: Wed Aug 8 20:30:12 2018 New Revision: 337502 URL: https://svnweb.freebsd.org/changeset/base/337502 Log: Fix the err() arguments for a nfssvc(8) failure. argv has been incremented during argument handling, so elements of the array are no longer valid. Change the err() arguments so only the first string pointer in argv is used. Found during code inspection. Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c ============================================================================== --- head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Wed Aug 8 20:21:45 2018 (r337501) +++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Wed Aug 8 20:30:12 2018 (r337502) @@ -295,7 +295,7 @@ main(int argc, char *argv[]) pnfsdarg.mdspath = *argv; ret = nfssvc(NFSSVC_PNFSDS, &pnfsdarg); if (ret < 0 && errno != EEXIST) - err(1, "Copymr failed args %s, %s", argv[1], argv[2]); + err(1, "Copymr failed for file %s", *argv); exit(0); } From owner-svn-src-head@freebsd.org Wed Aug 8 21:19:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31373106B894; Wed, 8 Aug 2018 21:19:08 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B432794A98; Wed, 8 Aug 2018 21:19:07 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9548D1006A; Wed, 8 Aug 2018 21:19:07 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LJ7Nk021007; Wed, 8 Aug 2018 21:19:07 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LJ7Zv021006; Wed, 8 Aug 2018 21:19:07 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201808082119.w78LJ7Zv021006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Wed, 8 Aug 2018 21:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337503 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 337503 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 21:19:08 -0000 Author: leitao Date: Wed Aug 8 21:19:07 2018 New Revision: 337503 URL: https://svnweb.freebsd.org/changeset/base/337503 Log: powerpc64/powernv: re-read RTC after polling If OPAL_RTC_READ is busy and does not return the information on the first run, as returning OPAL_BUSY_EVENT, the system will crash since ymd and hmsm variable will contain junk values. This is happening because we were not calling OPAL_RTC_READ again after OPAL_POLL_EVENTS' return, which would finally replace the old/junk hmsm and ymd values. The code was also mixing OPAL_RTC_READ and OPAL_POLL_EVENTS return values. This patch fix this logic and guarantee that we call OPAL_RTC_READ after OPAL_POLL_EVENTS return, and guarantee the code will only proceed if OPAL_RTC_READ returns OPAL_SUCCESS. Reviewed by: jhibbits Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D16617 Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Wed Aug 8 20:30:12 2018 (r337502) +++ head/sys/powerpc/powernv/opal_dev.c Wed Aug 8 21:19:07 2018 (r337503) @@ -218,13 +218,12 @@ opal_gettime(device_t dev, struct timespec *ts) uint32_t ymd; uint64_t hmsm; - do { + rv = opal_call(OPAL_RTC_READ, vtophys(&ymd), vtophys(&hmsm)); + while (rv == OPAL_BUSY_EVENT) { + opal_call(OPAL_POLL_EVENTS, 0); + pause("opalrtc", 1); rv = opal_call(OPAL_RTC_READ, vtophys(&ymd), vtophys(&hmsm)); - if (rv == OPAL_BUSY_EVENT) { - rv = opal_call(OPAL_POLL_EVENTS, 0); - pause("opalrtc", 1); - } - } while (rv == OPAL_BUSY_EVENT); + } if (rv != OPAL_SUCCESS) return (ENXIO); From owner-svn-src-head@freebsd.org Wed Aug 8 21:21:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCC5106BA0D; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5692694D22; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37A6A100B8; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LLTaI021887; Wed, 8 Aug 2018 21:21:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LLTwb021886; Wed, 8 Aug 2018 21:21:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082121.w78LLTwb021886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337504 - head/usr.bin/apply X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/apply X-SVN-Commit-Revision: 337504 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 21:21:30 -0000 Author: kevans Date: Wed Aug 8 21:21:28 2018 New Revision: 337504 URL: https://svnweb.freebsd.org/changeset/base/337504 Log: apply(1): Fix magic number substitution with magic character ' ' Using a space as the magic character would result in problems if the command started with a number: - For a 'valid' number n, n < size of argv, it would erroneously get replaced with that argument; e.g. `apply -a ' ' -d 1rm x => `execxrm x` - For an 'invalid' number n, n >= size of argv, it would segfault. e.g. `apply -a ' ' 2to3 test.py` would try to access argv[2] This problem occurred because apply(1) would prepend "exec " to the command string before doing the actual magic number replacements, so it would come across "exec 2to3 1" and assume that the " 2" is also a magic number to be replaced. Re-work this to instead just append "exec " to the command sbuf and workaround the ugliness. This also simplifies stuff in the process. PR: 226948 Submitted by: Tobias Stoeckmann MFC after: 1 week Modified: head/usr.bin/apply/apply.c Modified: head/usr.bin/apply/apply.c ============================================================================== --- head/usr.bin/apply/apply.c Wed Aug 8 21:19:07 2018 (r337503) +++ head/usr.bin/apply/apply.c Wed Aug 8 21:21:28 2018 (r337504) @@ -55,7 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define EXEC "exec " +#define ISMAGICNO(p) \ + (p)[0] == magic && isdigit((unsigned char)(p)[1]) && (p)[1] != '0' static int exec_shell(const char *, const char *, const char *); static void usage(void); @@ -65,8 +66,9 @@ main(int argc, char *argv[]) { struct sbuf *cmdbuf; long arg_max; - int ch, debug, i, magic, n, nargs, offset, rval; + int ch, debug, i, magic, n, nargs, rval; size_t cmdsize; + char buf[4]; char *cmd, *name, *p, *shell, *slashp, *tmpshell; debug = 0; @@ -75,7 +77,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) switch (ch) { case 'a': - if (optarg[1] != '\0') + if (optarg[0] == '\0' || optarg[1] != '\0') errx(1, "illegal magic character specification"); magic = optarg[0]; @@ -105,7 +107,7 @@ main(int argc, char *argv[]) * largest one. */ for (n = 0, p = argv[0]; *p != '\0'; ++p) - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { ++p; if (p[0] - '0' > n) n = p[0] - '0'; @@ -134,28 +136,19 @@ main(int argc, char *argv[]) * Allocate enough space to hold the maximum command. Save the * size to pass to snprintf(). */ - cmdsize = sizeof(EXEC) - 1 + strlen(argv[0]) - + 9 * (sizeof(" %1") - 1) + 1; - if ((cmd = malloc(cmdsize)) == NULL) - err(1, NULL); - if (n == 0) { + cmdsize = strlen(argv[0]) + 9 * (sizeof(" %1") - 1) + 1; + if ((cmd = malloc(cmdsize)) == NULL) + err(1, NULL); + strlcpy(cmd, argv[0], cmdsize); + /* If nargs not set, default to a single argument. */ if (nargs == -1) nargs = 1; - p = cmd; - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; for (i = 1; i <= nargs; i++) { - offset = snprintf(p, cmdsize, " %c%d", magic, i); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; + snprintf(buf, sizeof(buf), " %c%d", magic, i); + strlcat(cmd, buf, cmdsize); } /* @@ -165,9 +158,8 @@ main(int argc, char *argv[]) if (nargs == 0) nargs = 1; } else { - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); + if ((cmd = strdup(argv[0])) == NULL) + err(1, NULL); nargs = n; } @@ -184,9 +176,10 @@ main(int argc, char *argv[]) */ for (rval = 0; argc > nargs; argc -= nargs, argv += nargs) { sbuf_clear(cmdbuf); + sbuf_cat(cmdbuf, "exec "); /* Expand command argv references. */ for (p = cmd; *p != '\0'; ++p) { - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { if (sbuf_cat(cmdbuf, argv[(++p)[0] - '0']) == -1) errc(1, ENOMEM, "sbuf"); From owner-svn-src-head@freebsd.org Wed Aug 8 21:37:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59872106C444; Wed, 8 Aug 2018 21:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E351959B0; Wed, 8 Aug 2018 21:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D825810391; Wed, 8 Aug 2018 21:37:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Lb3Bb031977; Wed, 8 Aug 2018 21:37:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Lb2B5031967; Wed, 8 Aug 2018 21:37:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082137.w78Lb2B5031967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337505 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 337505 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 21:37:04 -0000 Author: kevans Date: Wed Aug 8 21:37:02 2018 New Revision: 337505 URL: https://svnweb.freebsd.org/changeset/base/337505 Log: dd: add status=progress support This reports the current status on a single line every second, mirroring similar functionality in GNU dd, and carefully interacts with SIGINFO. PR: 229615 Submitted by: Thomas Hurst (modified for style(9) nits by me) MFC after: 1 week Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/args.c Wed Aug 8 21:37:02 2018 (r337505) @@ -306,6 +306,8 @@ f_status(char *arg) ddflags |= C_NOINFO; else if (strcmp(arg, "noxfer") == 0) ddflags |= C_NOXFER; + else if (strcmp(arg, "progress") == 0) + ddflags |= C_PROGRESS; else errx(1, "unknown status %s", arg); } Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.1 Wed Aug 8 21:37:02 2018 (r337505) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd April 2, 2017 +.Dd August 8, 2018 .Dt DD 1 .Os .Sh NAME @@ -164,12 +164,14 @@ bytes per second. Where .Cm value is one of the symbols from the following list. -.Bl -tag -width "noxfer" +.Bl -tag -width "progress" .It Cm noxfer Do not print the transfer statistics as the last line of status output. .It Cm none Do not print the status output. Error messages are shown; informational messages are not. +.It Cm progress +Print basic transfer statistics once per second. .El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.c Wed Aug 8 21:37:02 2018 (r337505) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,6 +90,7 @@ const u_char *ctab; /* conversion table */ char fill_char; /* Character to fill with if defined */ size_t speed = 0; /* maximum speed, in bytes per second */ volatile sig_atomic_t need_summary; +volatile sig_atomic_t need_progress; int main(int argc __unused, char *argv[]) @@ -102,6 +104,7 @@ main(int argc __unused, char *argv[]) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); + (void)signal(SIGALRM, sigalrm_handler); (void)signal(SIGINT, terminate); atexit(summary); @@ -281,6 +284,14 @@ setup(void) ctab = casetab; } + if ((ddflags & C_PROGRESS)) { + struct itimerval timer = { + .it_interval = { .tv_sec = 1, .tv_usec = 0 }, + .it_value = { .tv_sec = 1, .tv_usec = 0 }, + }; + setitimer(ITIMER_REAL, &timer, NULL); + } + if (clock_gettime(CLOCK_MONOTONIC, &st.start)) err(1, "clock_gettime"); } @@ -460,6 +471,9 @@ dd_in(void) (*cfunc)(); if (need_summary) { summary(); + } + if (need_progress) { + progress(); } } } Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.h Wed Aug 8 21:37:02 2018 (r337505) @@ -100,5 +100,6 @@ typedef struct { #define C_STATUS 0x08000000 #define C_NOXFER 0x10000000 #define C_NOINFO 0x20000000 +#define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/extern.h Wed Aug 8 21:37:02 2018 (r337505) @@ -46,7 +46,9 @@ void pos_in(void); void pos_out(void); double secs_elapsed(void); void summary(void); +void progress(void); void siginfo_handler(int); +void sigalrm_handler(int); void terminate(int); void unblock(void); void unblock_close(void); @@ -66,3 +68,4 @@ extern const u_char a2ibm_32V[], a2ibm_POSIX[]; extern u_char casetab[]; extern char fill_char; extern volatile sig_atomic_t need_summary; +extern volatile sig_atomic_t need_progress; Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/misc.c Wed Aug 8 21:37:02 2018 (r337505) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include "dd.h" #include "extern.h" +static int need_newline; + double secs_elapsed(void) { @@ -83,6 +85,9 @@ summary(void) if (ddflags & C_NOINFO) return; + if (need_newline && !need_summary) + fprintf(stderr, "\n"); + secs = secs_elapsed(); (void)fprintf(stderr, @@ -102,12 +107,42 @@ summary(void) need_summary = 0; } +void +progress(void) +{ + double secs; + static int lastlen; + int len; + + secs = secs_elapsed(); + len = fprintf(stderr, + "\r%ju bytes transferred in %.0f secs (%.0f bytes/sec)", + st.bytes, secs, st.bytes / secs); + + if (len > 0) { + if (len < lastlen) + (void)fprintf(stderr, "%*s", len - lastlen, ""); + lastlen = len; + } + + need_newline = 1; + need_progress = 0; +} + /* ARGSUSED */ void siginfo_handler(int signo __unused) { need_summary = 1; +} + +/* ARGSUSED */ +void +sigalrm_handler(int signo __unused) +{ + + need_progress = 1; } /* ARGSUSED */ From owner-svn-src-head@freebsd.org Wed Aug 8 21:51:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA510106CAED; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70E2A964AE; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5173E1058D; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LpKA5040825; Wed, 8 Aug 2018 21:51:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LpJ63040823; Wed, 8 Aug 2018 21:51:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082151.w78LpJ63040823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337506 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 337506 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 21:51:21 -0000 Author: kevans Date: Wed Aug 8 21:51:19 2018 New Revision: 337506 URL: https://svnweb.freebsd.org/changeset/base/337506 Log: ls(1): Enable colors with COLORTERM is set in the environment COLORTERM is the de facto standard, while CLICOLOR is generally specific to FreeBSD and ls(1). PR: 230101 Submitted by: D Green (with manpage additions by myself) Reviewed by: cem ("LGTM" in PR; pre-manpage changes) MFC after: 1 week Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Aug 8 21:37:02 2018 (r337505) +++ head/bin/ls/ls.1 Wed Aug 8 21:51:19 2018 (r337506) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd January 17, 2018 +.Dd August 8, 2018 .Dt LS 1 .Os .Sh NAME @@ -132,6 +132,8 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR +or +.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -628,6 +630,10 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. +.It Ev COLORTERM +See description for +.Ev CLICOLOR +above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -652,7 +658,9 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR . +.Ev CLICOLOR +or +.Ev COLORTERM . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -759,6 +767,8 @@ option for more details. .It Ev TERM The .Ev CLICOLOR +and +.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Aug 8 21:37:02 2018 (r337505) +++ head/bin/ls/ls.c Wed Aug 8 21:51:19 2018 (r337506) @@ -368,7 +368,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if (getenv("CLICOLOR") && + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { From owner-svn-src-head@freebsd.org Wed Aug 8 22:45:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFAD106E3BA; Wed, 8 Aug 2018 22:45:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE93470564; Wed, 8 Aug 2018 22:45:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B567210EE3; Wed, 8 Aug 2018 22:45:30 +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 w78MjUe8067229; Wed, 8 Aug 2018 22:45:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78MjUlA067228; Wed, 8 Aug 2018 22:45:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808082245.w78MjUlA067228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 Aug 2018 22:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337508 - head/contrib/flex X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/flex X-SVN-Commit-Revision: 337508 X-SVN-Commit-Repository: base 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.27 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, 08 Aug 2018 22:45:31 -0000 Author: brooks Date: Wed Aug 8 22:45:30 2018 New Revision: 337508 URL: https://svnweb.freebsd.org/changeset/base/337508 Log: Terminate filter_create_ext() args with NULL, not 0. filter_create_ext() is documented to take a NULL terminated set of arguments. 0 is promoted to an int so this would fail on 64-bit systems if the value was not passed in a register. On all currently supported 64-bit architectures it is. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: head/contrib/flex/main.c Modified: head/contrib/flex/main.c ============================================================================== --- head/contrib/flex/main.c Wed Aug 8 22:42:03 2018 (r337507) +++ head/contrib/flex/main.c Wed Aug 8 22:45:30 2018 (r337508) @@ -364,7 +364,7 @@ void check_options () output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); if ( !(m4 = getenv("M4"))) m4 = M4; - filter_create_ext(output_chain, m4, "-gP", 0); + filter_create_ext(output_chain, m4, "-gP", NULL); filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ From owner-svn-src-head@freebsd.org Thu Aug 9 00:15:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D585010707AC; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC6E7414A; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 690F911DA8; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790FT0l015823; Thu, 9 Aug 2018 00:15:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790FTAW015822; Thu, 9 Aug 2018 00:15:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808090015.w790FTAW015822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 9 Aug 2018 00:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337509 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337509 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 00:15:30 -0000 Author: rmacklem Date: Thu Aug 9 00:15:28 2018 New Revision: 337509 URL: https://svnweb.freebsd.org/changeset/base/337509 Log: Fix a typo plus add a couple of sentences to pnfsserver.4. This is a content change. Modified: head/usr.sbin/nfsd/pnfsserver.4 Modified: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- head/usr.sbin/nfsd/pnfsserver.4 Wed Aug 8 22:45:30 2018 (r337508) +++ head/usr.sbin/nfsd/pnfsserver.4 Thu Aug 9 00:15:28 2018 (r337509) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd August 8, 2018 .Dt PNFSSERVER 4 .Os .Sh NAME @@ -366,8 +366,17 @@ have the .Xr pnfsdscopymr 8 command done on them to complete the recovery. .Bd -literal -offset -# pnfsdscopymr -r /data3 +# pnfsdscopymr -r /data3 .Ed +.sp +If this commmand fails with the error +.br +.Dq pnfsdscopymr: Copymr failed for file : Device not configured +.br +repeatedly, this may be caused by a Read/Write layout that has not +been returned. +The only way to get rid of such a layout is to restart the +.Xr nfsd 8 . .sp All of these commands are designed to be done while the pNFS service is running and can be re-run safely. From owner-svn-src-head@freebsd.org Thu Aug 9 00:58:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173ED1071800 for ; Thu, 9 Aug 2018 00:58:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw1-xc35.google.com (mail-yw1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94276759C4 for ; Thu, 9 Aug 2018 00:58:29 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw1-xc35.google.com with SMTP id l189-v6so3024407ywb.10 for ; Wed, 08 Aug 2018 17:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hz636VAPE0iP+D1GXx5e4Z0ZE5A5lBR92o+y9eTsg7A=; b=VpDpxNIZg6N/u9rkdLgn+Q3JM9EBvl3ln7AIesIV/z1UAIJER+eOnBC1ErEF4XxBs1 6I2iKrGm/+c84PTXtFUxNwRUE+RU7ahMfAnodrVFdj/APM1dL/VdL56hKN2g55FZCUMW /cBhykOl7i5Ev27+LRFBalDjFRDiTEaZsOrus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hz636VAPE0iP+D1GXx5e4Z0ZE5A5lBR92o+y9eTsg7A=; b=M0z5BWi2Jbyxbvb3sOjUePflJLHStHaV0DWVe7izHFpy5UrIzGBrFslGSss3IvdgUj v8LOIiqdmg7rgq2bt4ieTmZYKKwbdKlF1U1148vTIbuvu0XN7XAKPwn3EoCKrKQoz8ss Qks4coRfhIzvxrzWhBoYmnC0ddO9NYf4wfihuZKo0y/3/xu2QiVJBWA5KYlBLDR/IZK5 jWCOd+s1Ty3Cu8jdsSlZowXp76E7zPr/BYaqDX7Wmw4SpG5cqMey7913FME1VKkAjqbI Er+5V29RG615MLXa4A4V/XeoYjiaiyeOwdnCI5R8CDokCHHg17154xgo+Gb1pJysg61s XAIw== X-Gm-Message-State: AOUpUlHWZlFfkfjOYHtR0cpMCEUGyYSdJE1S1cfzu/TFO1JuD8YyVBcK agp8P4ViIfTRBoSg2OyS63xqTOW25s33V7OHAv5Ruw== X-Google-Smtp-Source: AA+uWPwNOfpF9goR+r/187Z8F+jeQ3DE01dpMik0neLHZYMsbI+aqK2eb0oxxA/Sia4Bkmd9SZcMi507coxb4SYJYSQ= X-Received: by 2002:a25:7c1:: with SMTP id 184-v6mr1702ybh.338.1533776308849; Wed, 08 Aug 2018 17:58:28 -0700 (PDT) MIME-Version: 1.0 References: <201808082137.w78Lb2B5031967@repo.freebsd.org> In-Reply-To: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Eitan Adler Date: Wed, 8 Aug 2018 17:58:02 -0700 Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Kyle Evans Cc: src-committers , 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.27 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, 09 Aug 2018 00:58:30 -0000 On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: > +/* ARGSUSED */ We've been slowly delintifying system utilities. Why do we still keep these comments? > +void > +sigalrm_handler(int signo __unused) > +{ > + > + need_progress = 1; > } -- Eitan Adler From owner-svn-src-head@freebsd.org Thu Aug 9 01:01:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD611071A34; Thu, 9 Aug 2018 01:01:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0B275DFA; Thu, 9 Aug 2018 01:01:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E441221231; Thu, 9 Aug 2018 01:01:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f175.google.com with SMTP id r13-v6so3127865ljg.10; Wed, 08 Aug 2018 18:01:36 -0700 (PDT) X-Gm-Message-State: AOUpUlEfzy4/QAZkOPl1fSyMl30eRJfHLtq5Bcy3+ycMtE25F56DEjaB ypM0KtPxlbZjJCsDn8JMdUXJJ9gfx8sJnCSGrl4= X-Google-Smtp-Source: AA+uWPyQenUrKOVVY+ufzugdiX1Iti3mWisEST/ttCbw3Q4m2oqgoP2ukTcBgGjhIvW+JmECQRXZ5qm0FWNKgzzkFsc= X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr4327ljf.27.1533776495590; Wed, 08 Aug 2018 18:01:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 18:01:14 -0700 (PDT) In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 20:01:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Eitan Adler Cc: src-committers , 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.27 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, 09 Aug 2018 01:01:37 -0000 On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: >> +/* ARGSUSED */ > > We've been slowly delintifying system utilities. Why do we still keep > these comments? > This is consistent with the style of the file, so I didn't object. I'd rather do another pass later to de-lintify the whole thing rather than nitpick at this patch for some otherwise harmless and matching comments. =) Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Aug 9 01:15:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3241072240 for ; Thu, 9 Aug 2018 01:15:35 +0000 (UTC) (envelope-from wlosh@bsdimp.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 G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E791768C4 for ; Thu, 9 Aug 2018 01:15:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id i18-v6so3417179ioj.13 for ; Wed, 08 Aug 2018 18:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4OmLy8XtdfSbqSbrCftETJqRK/iF5pk0DRFkIWknc0A=; b=O5zj3Hozp2geSzUFu/TdcMqzu7QZ1EsFPTB87mOTUTgyi6d1TR7fPLqCYXilgq/Vc3 gMI3YqedEkalmFOqxS3h5XLAQ0gbvnDMEysGvQNS55rTJMKhpjvNW0hzZxarWR+EPcy6 ffBzDHcvw60umNYPe+HTWB3FFv/ZyELx14if3fbbjfzKcatBx0WPIDTE7wK2wKXn7yTr 8JzY7DNpiCnwu2TQOCizfKfI9EQUZMwWjHtzrLCzw/F8OuKdWyRU/aFDYWK2Ym0BjPkm Eg75WMsM2MOwQ1NTaZChtjVfZuW4RkhFfHIjiVjBIKkb468ssAJ6yE+xYyonmzFe06As c0AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4OmLy8XtdfSbqSbrCftETJqRK/iF5pk0DRFkIWknc0A=; b=Iw8XqiTeDzHBhAhDR4wqIEM74YV2dTkExJNv8uU1/oLct0BuwtsOLTWtg+LBk1880/ /sgCuLiIVyL0w7YXj0UcPVj+v49Ib7YJINvX52kSPPNl3fTZLaA3RzcTHf8hS23fhybu BQ0lxRsrFF1ftg7hojbEncyS9YL7mQOSFqaAM29HZjwJQQzTo+iSDkF1hBJNvXiVS22U 7kGrbFXsZxwN4fyrrfN3ctTiF0kYsME2n+fSRaJBKOTwrn9muGG7tOW3QyvXJCDPfo3L FwsllopeEyEX4J4msTFOoszGirv8GtmoSxAzC7XVfgPZ9N1tHWEy07ruQj1BoZJhqyP3 DHVQ== X-Gm-Message-State: AOUpUlE4bIipVj52IeRhGvcJt7xJYFjFRYAlmsX/8DhuDTMky2VySxap V9ZgHTEyBrBBv28O2cDnGqRrSgdnk6ikJttt+PSE+w== X-Google-Smtp-Source: AA+uWPxYGSwVyYKlmuGSAhKWKEhBdwyn6HugtbBIWloSs9CQlW5diKZ931350n4vcRnNSLSXymPSQYDcrtL679NLqlM= X-Received: by 2002:a6b:f70f:: with SMTP id k15-v6mr37755iog.37.1533777333810; Wed, 08 Aug 2018 18:15:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 18:15:33 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Warner Losh Date: Wed, 8 Aug 2018 19:15:33 -0600 X-Google-Sender-Auth: jdGdFqdz13MkbxNAiTntpJ6kl74 Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Kyle Evans Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 01:15:35 -0000 On Wed, Aug 8, 2018 at 7:01 PM, Kyle Evans wrote: > On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: > > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: > >> +/* ARGSUSED */ > > > > We've been slowly delintifying system utilities. Why do we still keep > > these comments? > > > > This is consistent with the style of the file, so I didn't object. > I'd rather do another pass later to de-lintify the whole thing rather > than nitpick at this patch for some otherwise harmless and matching > comments. =) > It appears to be from NetBSD upstream, so removing it would be pointless churn that makes things harder to merge. Warner From owner-svn-src-head@freebsd.org Thu Aug 9 01:32:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB791073010; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 751B277663; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5752812AB5; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w791WAWt057201; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w791WAQm057199; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090132.w791WAQm057199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 01:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337518 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 337518 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 01:32:10 -0000 Author: kevans Date: Thu Aug 9 01:32:09 2018 New Revision: 337518 URL: https://svnweb.freebsd.org/changeset/base/337518 Log: kern: Add a BOOT_TAG marker at the beginning of boot dmesg From the "newly licensed to drive" PR department, add a BOOT_TAG marker (by default, --<>--, to the beginning of each boot's dmesg. This makes it easier to do textproc magic to locate the start of each boot and, of particular interest to some, the dmesg of the current boot. The PR has a dmesg(8) component as well that I've opted not to include for the moment- it was the more contentious part of this PR. bde@ also made the statement that this boot tag should be written with an ordinary printf, which I've- for the moment- declined to change about this patch to keep it more transparent to observer of the boot process. PR: 43434 Submitted by: dak (basically rewritten) MFC after: maybe never Modified: head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) cp = (char *)ptr; msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = 1; Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/sys/msgbuf.h Thu Aug 9 01:32:09 2018 (r337518) @@ -60,6 +60,9 @@ struct msgbuf { /* Subtract sequence numbers. Note that only positive values result. */ #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<>---" + #ifdef _KERNEL extern int msgbufsize; extern int msgbuftrigger; From owner-svn-src-head@freebsd.org Thu Aug 9 02:06:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14AEF107511F; Thu, 9 Aug 2018 02:06:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE4BC793D6; Thu, 9 Aug 2018 02:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EEAE13039; Thu, 9 Aug 2018 02:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7926QCV072791; Thu, 9 Aug 2018 02:06:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7926QCr072789; Thu, 9 Aug 2018 02:06:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090206.w7926QCr072789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 02:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337520 - in head/stand/i386: gptboot isoboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand/i386: gptboot isoboot X-SVN-Commit-Revision: 337520 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 02:06:27 -0000 Author: kevans Date: Thu Aug 9 02:06:25 2018 New Revision: 337520 URL: https://svnweb.freebsd.org/changeset/base/337520 Log: isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're not going to pass an additional argument to __exec. PR: 228151 Submitted by: guyyur@gmail.com MFC after: 1 week Modified: head/stand/i386/gptboot/gptboot.c head/stand/i386/isoboot/isoboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Thu Aug 9 01:39:47 2018 (r337519) +++ head/stand/i386/gptboot/gptboot.c Thu Aug 9 02:06:25 2018 (r337520) @@ -490,9 +490,10 @@ load(void) #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) #ifdef LOADER_GELI_SUPPORT - , geliargs + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs +#else + 0, 0, 0, VTOP(&bootinfo) #endif ); } Modified: head/stand/i386/isoboot/isoboot.c ============================================================================== --- head/stand/i386/isoboot/isoboot.c Thu Aug 9 01:39:47 2018 (r337519) +++ head/stand/i386/isoboot/isoboot.c Thu Aug 9 02:06:25 2018 (r337520) @@ -417,7 +417,7 @@ load(void) bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); + 0, 0, 0, VTOP(&bootinfo)); } static int From owner-svn-src-head@freebsd.org Thu Aug 9 02:07:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 287281075194; Thu, 9 Aug 2018 02:07:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCF417953D; Thu, 9 Aug 2018 02:07:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6A37921848; Thu, 9 Aug 2018 02:07:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f52.google.com with SMTP id l16-v6so2948560lfc.13; Wed, 08 Aug 2018 19:07:54 -0700 (PDT) X-Gm-Message-State: AOUpUlGdv+cI9/Y1gftRo/VeHhwZor/k0TUOTc4xcdd3yomVr3voNHoP 5THlfm0UfBEJTNLdw3m2UW5BtmkeSarxs0gKSV8= X-Google-Smtp-Source: AA+uWPwLCOi3EkGvA9geJA06RrKBX37+Wtv00mqHp6RPh+dHiIY4PJ8y1U0bXiXjOr4WPRiNT2/Wxf7kQ0dIywJ49aU= X-Received: by 2002:a19:e955:: with SMTP id g82-v6mr107921lfh.44.1533780472954; Wed, 08 Aug 2018 19:07:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 19:07:32 -0700 (PDT) In-Reply-To: <201808090206.w7926QCr072789@repo.freebsd.org> References: <201808090206.w7926QCr072789@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 21:07:32 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337520 - in head/stand/i386: gptboot isoboot To: "Rodney W. Grimes" Cc: src-committers , 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.27 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, 09 Aug 2018 02:07:55 -0000 On Wed, Aug 8, 2018 at 9:06 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Aug 9 02:06:25 2018 > New Revision: 337520 > URL: https://svnweb.freebsd.org/changeset/base/337520 > > Log: > isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general > > gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to > not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're > not going to pass an additional argument to __exec. > > PR: 228151 > Submitted by: guyyur@gmail.com > MFC after: 1 week > > Modified: > head/stand/i386/gptboot/gptboot.c > head/stand/i386/isoboot/isoboot.c > > Modified: head/stand/i386/gptboot/gptboot.c > ============================================================================== > --- head/stand/i386/gptboot/gptboot.c Thu Aug 9 01:39:47 2018 (r337519) > +++ head/stand/i386/gptboot/gptboot.c Thu Aug 9 02:06:25 2018 (r337520) > @@ -490,9 +490,10 @@ load(void) > #endif > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) > #ifdef LOADER_GELI_SUPPORT > - , geliargs > + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs > +#else > + 0, 0, 0, VTOP(&bootinfo) > #endif > ); > } > > Modified: head/stand/i386/isoboot/isoboot.c > ============================================================================== > --- head/stand/i386/isoboot/isoboot.c Thu Aug 9 01:39:47 2018 (r337519) > +++ head/stand/i386/isoboot/isoboot.c Thu Aug 9 02:06:25 2018 (r337520) > @@ -417,7 +417,7 @@ load(void) > bootinfo.bi_bios_dev = dsk.drive; > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); > + 0, 0, 0, VTOP(&bootinfo)); > } > > static int > Rod, Can you test the version of isoboot that was in stable/11 with this patch applied? It seems highly likely that this was the source of your boot issues. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Aug 9 02:47:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979C6107697F; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42B977AF4D; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21F4C136DA; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w792lNoU093602; Thu, 9 Aug 2018 02:47:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w792lMrj093601; Thu, 9 Aug 2018 02:47:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808090247.w792lMrj093601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 9 Aug 2018 02:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337522 - head/usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/tzsetup X-SVN-Commit-Revision: 337522 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 02:47:23 -0000 Author: delphij Date: Thu Aug 9 02:47:22 2018 New Revision: 337522 URL: https://svnweb.freebsd.org/changeset/base/337522 Log: In read_zones(), check if the file name actually fit in the buffer and make sure it would terminate with nul with strlcpy(). Reviewed by: imp (earlier revision) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16595 Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu Aug 9 02:27:18 2018 (r337521) +++ head/usr.sbin/tzsetup/tzsetup.c Thu Aug 9 02:47:22 2018 (r337522) @@ -481,7 +481,7 @@ read_zones(void) char contbuf[16]; FILE *fp; struct continent *cont; - size_t len; + size_t len, contlen; char *line, *tlc, *file, *descr, *p; int lineno; @@ -504,12 +504,16 @@ read_zones(void) path_zonetab, lineno, tlc); /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); + /* get continent portion from continent/country */ p = strchr(file, '/'); if (p == NULL) errx(1, "%s:%d: invalid zone name `%s'", path_zonetab, lineno, file); - contbuf[0] = '\0'; - strncat(contbuf, file, p - file); + contlen = p - file + 1; /* trailing nul */ + if (contlen > sizeof(contbuf)) + errx(1, "%s:%d: continent name in zone name `%s' too long", + path_zonetab, lineno, file); + strlcpy(contbuf, file, contlen); cont = find_continent(contbuf); if (!cont) errx(1, "%s:%d: invalid region `%s'", path_zonetab, From owner-svn-src-head@freebsd.org Thu Aug 9 02:55:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3061076E44; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99A617B5A0; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ACFB13885; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w792tmFO098817; Thu, 9 Aug 2018 02:55:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w792tm4j098816; Thu, 9 Aug 2018 02:55:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090255.w792tm4j098816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 02:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337523 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337523 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 02:55:49 -0000 Author: kevans Date: Thu Aug 9 02:55:48 2018 New Revision: 337523 URL: https://svnweb.freebsd.org/changeset/base/337523 Log: libsa: exit on EOF in ngets It was possible in some rare circumstances for ngets to behave terribly with bhyveload and some form of redirecting user input over a pipe. PR: 198706 Submitted by: Ivan Krivonos MFC after: 1 week Modified: head/stand/libsa/gets.c Modified: head/stand/libsa/gets.c ============================================================================== --- head/stand/libsa/gets.c Thu Aug 9 02:47:22 2018 (r337522) +++ head/stand/libsa/gets.c Thu Aug 9 02:55:48 2018 (r337523) @@ -44,8 +44,11 @@ ngets(char *buf, int n) int c; char *lp; - for (lp = buf;;) - switch (c = getchar() & 0177) { + for (lp = buf;;) { + c = getchar(); + if (c == -1) + break; + switch (c & 0177) { case '\n': case '\r': *lp = '\0'; @@ -79,6 +82,7 @@ ngets(char *buf, int n) putchar(c); } } + } /*NOTREACHED*/ } From owner-svn-src-head@freebsd.org Thu Aug 9 03:45:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A04910522B8; Thu, 9 Aug 2018 03:45:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C48867D55E; Thu, 9 Aug 2018 03:45:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A68D414169; Thu, 9 Aug 2018 03:45:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w793jlgh025506; Thu, 9 Aug 2018 03:45:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w793jl8x025505; Thu, 9 Aug 2018 03:45:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090345.w793jl8x025505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 03:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337524 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337524 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 03:45:48 -0000 Author: kevans Date: Thu Aug 9 03:45:47 2018 New Revision: 337524 URL: https://svnweb.freebsd.org/changeset/base/337524 Log: libi386: Fix typo in pxe.h PR: 207337 Submitted by: Tony Narlock MFC after: 1 week Modified: head/stand/i386/libi386/pxe.h Modified: head/stand/i386/libi386/pxe.h ============================================================================== --- head/stand/i386/libi386/pxe.h Thu Aug 9 02:55:48 2018 (r337523) +++ head/stand/i386/libi386/pxe.h Thu Aug 9 03:45:47 2018 (r337524) @@ -147,7 +147,7 @@ typedef struct { PXENV_STATUS_t Status; ADDR32_t ProtocolIni; /* Phys addr of a copy of the driver module */ uint8_t reserved[8]; -} PACKED t_PXENV_UNDI_INITALIZE; +} PACKED t_PXENV_UNDI_INITIALIZE; #define MAXNUM_MCADDR 8 From owner-svn-src-head@freebsd.org Thu Aug 9 04:16:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED201053738; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 829C47E690; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 217402256B; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f174.google.com with SMTP id p6-v6so3390608ljc.5; Wed, 08 Aug 2018 21:16:42 -0700 (PDT) X-Gm-Message-State: AOUpUlFHiUQEPevp8wnog/kq0w847d+Jxa6OE7hUXJZHbRFWy1Vea8As lZgcOEmismaGe1VrEyblTV3NNDS+qmAtMjSHsYo= X-Google-Smtp-Source: AA+uWPzZKDTFPwjFgkZcEa4nOzkYf3b/DlPEyVdqA0HzO2V+klmxkqaTwu5lvBMf+qWtb3lZI9VXZnU7mtnLeY9hchA= X-Received: by 2002:a2e:4055:: with SMTP id n82-v6mr231378lja.99.1533788200702; Wed, 08 Aug 2018 21:16:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 21:16:20 -0700 (PDT) In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 23:16:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Warner Losh Cc: Eitan Adler , src-committers , 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.27 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, 09 Aug 2018 04:16:43 -0000 On Wed, Aug 8, 2018 at 8:15 PM, Warner Losh wrote: > > > On Wed, Aug 8, 2018 at 7:01 PM, Kyle Evans wrote: >> >> On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: >> > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: >> >> +/* ARGSUSED */ >> > >> > We've been slowly delintifying system utilities. Why do we still keep >> > these comments? >> > >> >> This is consistent with the style of the file, so I didn't object. >> I'd rather do another pass later to de-lintify the whole thing rather >> than nitpick at this patch for some otherwise harmless and matching >> comments. =) > > > It appears to be from NetBSD upstream, so removing it would be pointless > churn that makes things harder to merge. > Poking at NetBSD now that I have time, it doesn't look like they actually have this feature. They have progress= to output a dog every n blocks, but apparently not one that actually does a single-line summary every second like this and GNU dd (with the same status=progress flag). From owner-svn-src-head@freebsd.org Thu Aug 9 05:18:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA451055339; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E06780764; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747F415017; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w795IS5l071452; Thu, 9 Aug 2018 05:18:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w795ISxD071451; Thu, 9 Aug 2018 05:18:28 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808090518.w795ISxD071451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 9 Aug 2018 05:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337525 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337525 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 05:18:29 -0000 Author: mmacy Date: Thu Aug 9 05:18:27 2018 New Revision: 337525 URL: https://svnweb.freebsd.org/changeset/base/337525 Log: epoch_block_wait: don't check TD_RUNNING struct epoch_thread is not type safe (stack allocated) and thus cannot be dereferenced from another CPU Reported by: novel@ Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu Aug 9 03:45:47 2018 (r337524) +++ head/sys/kern/subr_epoch.c Thu Aug 9 05:18:27 2018 (r337525) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); /* arbitrary --- needs benchmarking */ -#define MAX_ADAPTIVE_SPIN 1000 +#define MAX_ADAPTIVE_SPIN 100 #define MAX_EPOCHS 64 CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epoch_context)); @@ -240,24 +240,38 @@ epoch_block_handler_preempt(struct ck_epoch *global __ locksheld = td->td_locks; spincount = 0; counter_u64_add(block_count, 1); + /* + * We lost a race and there's no longer any threads + * on the CPU in an epoch section. + */ + if (TAILQ_EMPTY(&record->er_tdlist)) + return; + if (record->er_cpuid != curcpu) { /* * If the head of the list is running, we can wait for it * to remove itself from the list and thus save us the * overhead of a migration */ - if ((tdwait = TAILQ_FIRST(&record->er_tdlist)) != NULL && - TD_IS_RUNNING(tdwait->et_td)) { - gen = record->er_gen; - thread_unlock(td); - do { - cpu_spinwait(); - } while (tdwait == TAILQ_FIRST(&record->er_tdlist) && - gen == record->er_gen && TD_IS_RUNNING(tdwait->et_td) && - spincount++ < MAX_ADAPTIVE_SPIN); - thread_lock(td); + gen = record->er_gen; + thread_unlock(td); + /* + * We can't actually check if the waiting thread is running + * so we simply poll for it to exit before giving up and + * migrating. + */ + do { + cpu_spinwait(); + } while (!TAILQ_EMPTY(&record->er_tdlist) && + gen == record->er_gen && + spincount++ < MAX_ADAPTIVE_SPIN); + thread_lock(td); + /* + * If the generation has changed we can poll again + * otherwise we need to migrate. + */ + if (gen != record->er_gen) return; - } /* * Being on the same CPU as that of the record on which * we need to wait allows us access to the thread From owner-svn-src-head@freebsd.org Thu Aug 9 09:06:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36430105D792; Thu, 9 Aug 2018 09:06:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E051288B5A; Thu, 9 Aug 2018 09:06:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2DD9174F9; Thu, 9 Aug 2018 09:06:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7996Vsv098247; Thu, 9 Aug 2018 09:06:31 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7996Vxt098244; Thu, 9 Aug 2018 09:06:31 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808090906.w7996Vxt098244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 9 Aug 2018 09:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337526 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 337526 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 09:06:32 -0000 Author: kevlo Date: Thu Aug 9 09:06:30 2018 New Revision: 337526 URL: https://svnweb.freebsd.org/changeset/base/337526 Log: Follow up to r333195, add us Macbook/Macbook Pro keyboard support. Tested by: rcyu Added: head/share/vt/keymaps/us.macbook.kbd (contents, props changed) Modified: head/share/vt/keymaps/INDEX.keymaps head/share/vt/keymaps/Makefile Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Thu Aug 9 05:18:27 2018 (r337525) +++ head/share/vt/keymaps/INDEX.keymaps Thu Aug 9 09:06:30 2018 (r337526) @@ -576,6 +576,12 @@ us.unix.kbd:fr:États Unis d'Amérique unix us.unix.kbd:pt:Estados Unidos da América unix us.unix.kbd:es:Estadounidense Unix tradicional +us.macbook.kbd:en:United States of America Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:de:US-amerikanisch Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:fr:États Unis d'Amérique Macbook / Macbook Pro ISO-8859-1 +us.macbook.kbd:pt:Estados Unidos da América Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:es:Estadounidense Macbook/Macbook Pro ISO-8859-1 + ua.kbd.from-iso5:en:Ukrainian ua.kbd.from-iso5:de:Ukrainisch ua.kbd.from-iso5:fr:Ukrainien Modified: head/share/vt/keymaps/Makefile ============================================================================== --- head/share/vt/keymaps/Makefile Thu Aug 9 05:18:27 2018 (r337525) +++ head/share/vt/keymaps/Makefile Thu Aug 9 09:06:30 2018 (r337526) @@ -83,6 +83,7 @@ FILES= INDEX.keymaps \ us.dvorakx.kbd \ us.emacs.kbd \ us.kbd \ + us.macbook.kbd \ us.unix.kbd \ FILESDIR= ${SHAREDIR}/vt/keymaps Added: head/share/vt/keymaps/us.macbook.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/us.macbook.kbd Thu Aug 9 09:06:30 2018 (r337526) @@ -0,0 +1,116 @@ +# $FreeBSD$ +# by Willian Theesfeld Jr +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '`' '~' nop nop '`' '~' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + From owner-svn-src-head@freebsd.org Thu Aug 9 09:39:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32CF105E7C5; Thu, 9 Aug 2018 09:39:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8655E89F29; Thu, 9 Aug 2018 09:39:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47EEC179C8; Thu, 9 Aug 2018 09:39:33 +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 w799dXf4014143; Thu, 9 Aug 2018 09:39:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w799dWIV014139; Thu, 9 Aug 2018 09:39:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808090939.w799dWIV014139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Aug 2018 09:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337527 - in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Commit-Revision: 337527 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 09:39:34 -0000 Author: hselasky Date: Thu Aug 9 09:39:32 2018 New Revision: 337527 URL: https://svnweb.freebsd.org/changeset/base/337527 Log: Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possible in the LinuxKPI. Suggested by: mjg @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 9 09:39:32 2018 (r337527) @@ -87,9 +87,8 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n long ret = old; for (;;) { - if (atomic_cmpset_long(&v->counter, old, new)) + if (atomic_fcmpset_long(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } @@ -99,13 +98,12 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { - long c; + long c = atomic_long_read(v); for (;;) { - c = atomic_long_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_long(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) break; } return (c != u); Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 9 09:39:32 2018 (r337527) @@ -108,13 +108,12 @@ atomic_dec(atomic_t *v) static inline int atomic_add_unless(atomic_t *v, int a, int u) { - int c; + int c = atomic_read(v); for (;;) { - c = atomic_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_int(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) break; } return (c != u); @@ -132,12 +131,10 @@ atomic_xchg(atomic_t *v, int i) #if !defined(__mips__) return (atomic_swap_int(&v->counter, i)); #else - int ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_int(&v->counter, ret, i)) - break; - } + int ret = atomic_read(v); + + while (!atomic_fcmpset_int(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -148,9 +145,8 @@ atomic_cmpxchg(atomic_t *v, int old, int new) int ret = old; for (;;) { - if (atomic_cmpset_int(&v->counter, old, new)) + if (atomic_fcmpset_int(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 9 09:39:32 2018 (r337527) @@ -92,13 +92,12 @@ atomic64_dec(atomic64_t *v) static inline int64_t atomic64_add_unless(atomic64_t *v, int64_t a, int64_t u) { - int64_t c; + int64_t c = atomic64_read(v); for (;;) { - c = atomic64_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_64(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) break; } return (c != u); @@ -111,12 +110,10 @@ atomic64_xchg(atomic64_t *v, int64_t i) (defined(__powerpc__) && !defined(__powerpc64__))) return (atomic_swap_64(&v->counter, i)); #else - int64_t ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_64(&v->counter, ret, i)) - break; - } + int64_t ret = atomic64_read(v); + + while (!atomic_fcmpset_64(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -127,9 +124,8 @@ atomic64_cmpxchg(atomic64_t *v, int64_t old, int64_t n int64_t ret = old; for (;;) { - if (atomic_cmpset_64(&v->counter, old, new)) + if (atomic_fcmpset_64(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 9 09:39:32 2018 (r337527) @@ -282,10 +282,10 @@ test_and_clear_bit(long bit, volatile unsigned long *v var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val & ~bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val & ~bit)) + ; return !!(val & bit); } @@ -312,10 +312,10 @@ test_and_set_bit(long bit, volatile unsigned long *var var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val | bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val | bit)) + ; return !!(val & bit); } From owner-svn-src-head@freebsd.org Thu Aug 9 10:28:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56551060008; Thu, 9 Aug 2018 10:28:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55F728B83F; Thu, 9 Aug 2018 10:28:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id h4-v6so5890141qtj.7; Thu, 09 Aug 2018 03:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UO1wFwFqwS7JQrIPPBrpMKADpjjN0ECqRPcs7IuNu24=; b=kvSGu+T0KFlkvLrehLH3b9q7NaCN3pEh9UYsa1Os8HaYL1fA/QEOsrzObx7yPi2LsP y+3Aba2WGnHIGt6OlY2tWIblhDpo3FzV9sFre0Bpi1NvNx8kw+lF87/xxGG4iSkBzwSp VXyA9jNCsLs5JaNTWG1zwGBhokmywASkwEI7ddXRIkoA/4aHatuDx6HUB5N3dd0lmXJM ZHcs+hIpXRQW0fjY8SvAVmrlk5epoXa29XUIuIZ4Sj0PRywUHJgShTlmJiFkhd7mal0e znWUlYr9mpH6n3o4ZHOyyFSMIxUKVabZIXhwY5ofV1GhD5geY720nZ/mHaTkp7R7CXL5 K8/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UO1wFwFqwS7JQrIPPBrpMKADpjjN0ECqRPcs7IuNu24=; b=Bz12A6LfAYLyFoyQF1HL1SMlK+mEFl89lIV3WpceBurXjupqd7mpbKwworJMPANxbO 3rOogr5NSYjpHaAJGs4Sg+wbXTqiPgj7sIV4TZTzBnptblGugjJyfMoNA2DOr6022q2D RYJV8NTnpONHZ0ozuR1CtM3k8xX1U1wLqw7IRlTuzMjnWatmFKGWaHpuSLPosvHnQL2x IMGDSHhar3vU4u/tP8Vro7sMJLBT3jyyuxAmeYUF9yQhvAbNzSMbajjGvSur39Fpg+w5 HRgSNOkoQ3IEurMkwSvxtQAXRqBNOcbCGFS7+uLgKxBHsC3GkiQoFz53c4vFtBENE/XT e50A== X-Gm-Message-State: AOUpUlHs5hK6tijmC7vQ+zwRLwnMfJ/fVHHEuAREgpNS9A/p4dW569PG uYOLYZnyBcV4RXEdek4S/2+ZmR1R X-Google-Smtp-Source: AA+uWPz2jaQMgWlOPKxHKXXsH6zDS9ZEksybTDx2soDytK/YgRmXg9mPwFvbouCQ0wHbuqNw5AGUbg== X-Received: by 2002:ac8:7284:: with SMTP id v4-v6mr1356863qto.177.1533810479476; Thu, 09 Aug 2018 03:27:59 -0700 (PDT) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id s19-v6sm4438495qtj.61.2018.08.09.03.27.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 03:27:58 -0700 (PDT) Subject: Re: svn commit: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin... To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808081924.w78JOKLP061364@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga.bsd@gmail.com; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <1830754d-569d-256f-95e9-87d16664b51a@gmail.com> Date: Thu, 9 Aug 2018 07:27:54 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201808081924.w78JOKLP061364@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 10:28:01 -0000 On 08/08/18 16:24, Alan Somers wrote: > Author: asomers > Date: Wed Aug 8 19:24:20 2018 > New Revision: 337497 > URL: https://svnweb.freebsd.org/changeset/base/337497 > > Log: > Switch the default pager for most commands to less > > Finally, a pager for the nineties. > > MFC after: Never > Relnotes: Yes > Differential Revision: https://reviews.freebsd.org/D13465 > Poll: https://reviews.freebsd.org/V7 Thank you! -- Renato Botelho From owner-svn-src-head@freebsd.org Thu Aug 9 11:21:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E66E1061CFF; Thu, 9 Aug 2018 11:21:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 040B38D971; Thu, 9 Aug 2018 11:21:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA34118BE8; Thu, 9 Aug 2018 11:21:31 +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 w79BLVHJ069643; Thu, 9 Aug 2018 11:21:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BLV5r069641; Thu, 9 Aug 2018 11:21:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201808091121.w79BLV5r069641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Aug 2018 11:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337528 - in head: share/man/man4 sys/ddb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: share/man/man4 sys/ddb X-SVN-Commit-Revision: 337528 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 11:21:32 -0000 Author: avg Date: Thu Aug 9 11:21:31 2018 New Revision: 337528 URL: https://svnweb.freebsd.org/changeset/base/337528 Log: add an option for ddb ps command to print process arguments We use ps to collect the information of all processes in textdump. But it doesn't contain process arguments which however sometimes are very useful for debugging. The new 'a' modifier adds that capability. While here, remove 'm' modifier from ddb.4. It was in the manual page from its very first revision, but I could not find any evidence of the code ever supporting it. Submitted by: Terry Hu Reviewed by: kib MFC after: 1 week Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D16603 Modified: head/share/man/man4/ddb.4 head/sys/ddb/db_ps.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Aug 9 09:39:32 2018 (r337527) +++ head/share/man/man4/ddb.4 Thu Aug 9 11:21:31 2018 (r337528) @@ -537,16 +537,15 @@ If the thread is not found, search the thread stack ca cached stack address. Otherwise, prints nothing. .Pp -.It Ic show Cm all procs Ns Op Li / Ns Cm m -.It Ic ps Ns Op Li / Ns Cm m +.It Ic show Cm all procs Ns Op Li / Ns Cm a +.It Ic ps Ns Op Li / Ns Cm a Display all process information. The process information may not be shown if it is not supported in the machine, or the bottom of the stack of the target process is not in the main memory at that time. The -.Cm m -modifier will alter the display to show VM map -addresses for the process and not show other information. +.Cm a +modifier will print command line arguments for each process. .\" .Pp .It Ic show Cm all trace Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Thu Aug 9 09:39:32 2018 (r337527) +++ head/sys/ddb/db_ps.c Thu Aug 9 11:21:31 2018 (r337528) @@ -50,8 +50,13 @@ __FBSDID("$FreeBSD$"); #include +#define PRINT_NONE 0 +#define PRINT_ARGS 1 + static void dumpthread(volatile struct proc *p, volatile struct thread *td, int all); +static int ps_mode; + /* * At least one non-optional show-command must be implemented using * DB_SHOW_ALL_COMMAND() so that db_show_all_cmd_set gets created. @@ -62,6 +67,24 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) db_ps(addr, have_addr, count, modif); } +static void +dump_args(volatile struct proc *p) +{ + char *args; + int i, len; + + if (p->p_args == NULL) + return; + args = p->p_args->ar_args; + len = (int)p->p_args->ar_length; + for (i = 0; i < len; i++) { + if (args[i] == '\0') + db_printf(" "); + else + db_printf("%c", args[i]); + } +} + /* * Layout: * - column counts @@ -90,6 +113,7 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c char state[9]; int np, rflag, sflag, dflag, lflag, wflag; + ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; np = nprocs; if (!LIST_EMPTY(&allproc)) @@ -207,6 +231,10 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c db_printf("%s", p->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } FOREACH_THREAD_IN_PROC(p, td) { @@ -299,6 +327,10 @@ dumpthread(volatile struct proc *p, volatile struct th db_printf("%s", td->td_proc->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS && all == 0) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } @@ -445,12 +477,7 @@ DB_SHOW_COMMAND(proc, db_show_proc) db_printf(" ABI: %s\n", p->p_sysent->sv_name); if (p->p_args != NULL) { db_printf(" arguments: "); - for (i = 0; i < (int)p->p_args->ar_length; i++) { - if (p->p_args->ar_args[i] == '\0') - db_printf(" "); - else - db_printf("%c", p->p_args->ar_args[i]); - } + dump_args(p); db_printf("\n"); } db_printf(" repear: %p reapsubtree: %d\n", From owner-svn-src-head@freebsd.org Thu Aug 9 11:30:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 127FE10620A6; Thu, 9 Aug 2018 11:30:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD4CD8DDBD; Thu, 9 Aug 2018 11:30:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E5F218C58; Thu, 9 Aug 2018 11:30:13 +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 w79BUDrj070991; Thu, 9 Aug 2018 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BUDsW070990; Thu, 9 Aug 2018 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808091130.w79BUDsW070990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Aug 2018 11:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337529 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 337529 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 11:30:14 -0000 Author: hselasky Date: Thu Aug 9 11:30:13 2018 New Revision: 337529 URL: https://svnweb.freebsd.org/changeset/base/337529 Log: Implement missing atomic_fcmpset_XXX() support for i386. This also fixes i386 build after r337527. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Thu Aug 9 11:21:31 2018 (r337528) +++ head/sys/i386/include/atomic.h Thu Aug 9 11:30:13 2018 (r337529) @@ -130,6 +130,7 @@ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_64(volatile uint64_t *, uint64_t, uint64_t); +int atomic_fcmpset_64(volatile uint64_t *, uint64_t *, uint64_t); uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); @@ -404,6 +405,18 @@ atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if (atomic_cmpset_64_i386(dst, *expect, src)) { + return (1); + } else { + *expect = *dst; + return (0); + } +} + static __inline uint64_t atomic_load_acq_64_i386(volatile uint64_t *p) { @@ -483,6 +496,24 @@ atomic_cmpset_64_i586(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i586(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchg8b %1 ; " + " sete %0" + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+A" (*expect) /* 2 */ + : "b" ((uint32_t)src), /* 3 */ + "c" ((uint32_t)(src >> 32)) /* 4 */ + : "memory", "cc"); + return (res); +} + static __inline uint64_t atomic_load_acq_64_i586(volatile uint64_t *p) { @@ -542,6 +573,16 @@ atomic_cmpset_64(volatile uint64_t *dst, uint64_t expe return (atomic_cmpset_64_i586(dst, expect, src)); } +static __inline int +atomic_fcmpset_64(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_fcmpset_64_i386(dst, expect, src)); + else + return (atomic_fcmpset_64_i586(dst, expect, src)); +} + static __inline uint64_t atomic_load_acq_64(volatile uint64_t *p) { @@ -655,6 +696,14 @@ atomic_cmpset_long(volatile u_long *dst, u_long expect (u_int)src)); } +static __inline int +atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src) +{ + + return (atomic_fcmpset_int((volatile u_int *)dst, (u_int *)expect, + (u_int)src)); +} + static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) { @@ -834,6 +883,8 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); /* Operations on 64-bit quad words. */ #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 +#define atomic_fcmpset_acq_64 atomic_fcmpset_64 +#define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fetchadd_acq_64 atomic_fetchadd_64 #define atomic_fetchadd_rel_64 atomic_fetchadd_64 #define atomic_add_acq_64 atomic_add_64 From owner-svn-src-head@freebsd.org Thu Aug 9 11:46:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB63A1062883; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81C398E87C; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6391A18F8C; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79BkDGG080778; Thu, 9 Aug 2018 11:46:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BkDFq080777; Thu, 9 Aug 2018 11:46:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091146.w79BkDFq080777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 11:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337530 - head/sbin/ldconfig X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/ldconfig X-SVN-Commit-Revision: 337530 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 11:46:14 -0000 Author: trasz Date: Thu Aug 9 11:46:12 2018 New Revision: 337530 URL: https://svnweb.freebsd.org/changeset/base/337530 Log: Make ldconfig(8) atomic, by removing an unneccessary call to unlink(2) before rename(2). Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16641 Modified: head/sbin/ldconfig/ldconfig.c Modified: head/sbin/ldconfig/ldconfig.c ============================================================================== --- head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:30:13 2018 (r337529) +++ head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:46:12 2018 (r337530) @@ -518,13 +518,6 @@ buildhints(void) warn("%s", hints_file); return -1; } - - /* Install it */ - if (unlink(hints_file) != 0 && errno != ENOENT) { - warn("%s", hints_file); - return -1; - } - if (rename(tmpfilename, hints_file) != 0) { warn("%s", hints_file); return -1; From owner-svn-src-head@freebsd.org Thu Aug 9 12:11:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E314106393E; Thu, 9 Aug 2018 12:11:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7DEA8FBA7; Thu, 9 Aug 2018 12:11:50 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA6631941D; Thu, 9 Aug 2018 12:11:50 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CBot0096123; Thu, 9 Aug 2018 12:11:50 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CBokk096121; Thu, 9 Aug 2018 12:11:50 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201808091211.w79CBokk096121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 9 Aug 2018 12:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337533 - in head/sys/contrib/ck: include/gcc/ppc include/spinlock src X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in head/sys/contrib/ck: include/gcc/ppc include/spinlock src X-SVN-Commit-Revision: 337533 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 12:11:51 -0000 Author: cognet Date: Thu Aug 9 12:11:49 2018 New Revision: 337533 URL: https://svnweb.freebsd.org/changeset/base/337533 Log: Import CK as of commit 08813496570879fbcc2adcdd9ddc0a054361bfde, mostly to avoid using lwsync on ppc32. Modified: head/sys/contrib/ck/include/gcc/ppc/ck_pr.h head/sys/contrib/ck/include/spinlock/hclh.h head/sys/contrib/ck/src/ck_barrier_combining.c Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/include/gcc/ppc/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/ppc/ck_pr.h Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/include/gcc/ppc/ck_pr.h Thu Aug 9 12:11:49 2018 (r337533) @@ -67,21 +67,29 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "lwsync") -CK_PR_FENCE(atomic_store, "lwsync") +#ifdef CK_MD_PPC32_LWSYNC +#define CK_PR_LWSYNCOP "lwsync" +#else /* CK_MD_PPC32_LWSYNC_DISABLE */ +#define CK_PR_LWSYNCOP "sync" +#endif + +CK_PR_FENCE(atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(atomic_store, CK_PR_LWSYNCOP) CK_PR_FENCE(atomic_load, "sync") -CK_PR_FENCE(store_atomic, "lwsync") -CK_PR_FENCE(load_atomic, "lwsync") -CK_PR_FENCE(store, "lwsync") +CK_PR_FENCE(store_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(store, CK_PR_LWSYNCOP) CK_PR_FENCE(store_load, "sync") -CK_PR_FENCE(load, "lwsync") -CK_PR_FENCE(load_store, "lwsync") +CK_PR_FENCE(load, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_store, CK_PR_LWSYNCOP) CK_PR_FENCE(memory, "sync") -CK_PR_FENCE(acquire, "lwsync") -CK_PR_FENCE(release, "lwsync") -CK_PR_FENCE(acqrel, "lwsync") -CK_PR_FENCE(lock, "lwsync") -CK_PR_FENCE(unlock, "lwsync") +CK_PR_FENCE(acquire, CK_PR_LWSYNCOP) +CK_PR_FENCE(release, CK_PR_LWSYNCOP) +CK_PR_FENCE(acqrel, CK_PR_LWSYNCOP) +CK_PR_FENCE(lock, CK_PR_LWSYNCOP) +CK_PR_FENCE(unlock, CK_PR_LWSYNCOP) + +#undef CK_PR_LWSYNCOP #undef CK_PR_FENCE Modified: head/sys/contrib/ck/include/spinlock/hclh.h ============================================================================== --- head/sys/contrib/ck/include/spinlock/hclh.h Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/include/spinlock/hclh.h Thu Aug 9 12:11:49 2018 (r337533) @@ -81,6 +81,8 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q thread->wait = true; thread->splice = false; thread->cluster_id = (*local_queue)->cluster_id; + /* Make sure previous->previous doesn't appear to be NULL */ + thread->previous = *local_queue; /* Serialize with respect to update of local queue. */ ck_pr_fence_store_atomic(); @@ -91,13 +93,15 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q /* Wait until previous thread from the local queue is done with lock. */ ck_pr_fence_load(); - if (previous->previous != NULL && - previous->cluster_id == thread->cluster_id) { - while (ck_pr_load_uint(&previous->wait) == true) + if (previous->previous != NULL) { + while (ck_pr_load_uint(&previous->wait) == true && + ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) ck_pr_stall(); /* We're head of the global queue, we're done */ - if (ck_pr_load_uint(&previous->splice) == false) + if (ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) return; } Modified: head/sys/contrib/ck/src/ck_barrier_combining.c ============================================================================== --- head/sys/contrib/ck/src/ck_barrier_combining.c Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/src/ck_barrier_combining.c Thu Aug 9 12:11:49 2018 (r337533) @@ -35,7 +35,7 @@ struct ck_barrier_combining_queue { struct ck_barrier_combining_group *tail; }; -CK_CC_INLINE static struct ck_barrier_combining_group * +static struct ck_barrier_combining_group * ck_barrier_combining_queue_dequeue(struct ck_barrier_combining_queue *queue) { struct ck_barrier_combining_group *front = NULL; @@ -48,7 +48,7 @@ ck_barrier_combining_queue_dequeue(struct ck_barrier_c return front; } -CK_CC_INLINE static void +static void ck_barrier_combining_insert(struct ck_barrier_combining_group *parent, struct ck_barrier_combining_group *tnode, struct ck_barrier_combining_group **child) @@ -72,7 +72,7 @@ ck_barrier_combining_insert(struct ck_barrier_combinin * into the barrier's tree. We use a queue to implement this * traversal. */ -CK_CC_INLINE static void +static void ck_barrier_combining_queue_enqueue(struct ck_barrier_combining_queue *queue, struct ck_barrier_combining_group *node_value) { @@ -185,10 +185,10 @@ ck_barrier_combining_aux(struct ck_barrier_combining * ck_pr_fence_store(); ck_pr_store_uint(&tnode->sense, ~tnode->sense); } else { - ck_pr_fence_memory(); while (sense != ck_pr_load_uint(&tnode->sense)) ck_pr_stall(); } + ck_pr_fence_memory(); return; } From owner-svn-src-head@freebsd.org Thu Aug 9 12:13:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29FFE1063BB9; Thu, 9 Aug 2018 12:13:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D36E98FE45; Thu, 9 Aug 2018 12:13:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B60081944F; Thu, 9 Aug 2018 12:13:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CD88V096221; Thu, 9 Aug 2018 12:13:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CD8h0096220; Thu, 9 Aug 2018 12:13:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091213.w79CD8h0096220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 12:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337534 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337534 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 12:13:09 -0000 Author: trasz Date: Thu Aug 9 12:13:08 2018 New Revision: 337534 URL: https://svnweb.freebsd.org/changeset/base/337534 Log: Refactor common code into execute_script(). Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16627 Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Thu Aug 9 12:11:49 2018 (r337533) +++ head/sbin/init/init.c Thu Aug 9 12:13:08 2018 (r337534) @@ -146,6 +146,7 @@ static void transition(state_t); static state_t requested_transition; static state_t current_state = death_single; +static void execute_script(char *argv[]); static void open_console(void); static const char *get_shell(void); static void write_stderr(const char *message); @@ -1046,6 +1047,46 @@ runcom(void) return (state_func_t) read_ttys; } +static void +execute_script(char *argv[]) +{ + struct sigaction sa; + const char *shell, *script; + int error; + + bzero(&sa, sizeof(sa)); + sigemptyset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + sigaction(SIGTSTP, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); + + open_console(); + + sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); +#ifdef LOGIN_CAP + setprocresources(RESOURCE_RC); +#endif + + /* + * Try to directly execute the script first. If it + * fails, try the old method of passing the script path + * to sh(1). Don't complain if it fails because of + * the missing execute bit. + */ + script = argv[1]; + error = access(script, X_OK); + if (error == 0) { + execv(script, argv + 1); + warning("can't exec %s: %m", script); + } else if (errno != EACCES) { + warning("can't access %s: %m", script); + } + + shell = get_shell(); + execv(shell, argv); + stall("can't exec %s for %s: %m", shell, script); +} + /* * Run a shell script. * Returns 0 on success, otherwise the next transition to enter: @@ -1057,22 +1098,14 @@ static state_func_t run_script(const char *script) { pid_t pid, wpid; - int error, status; + int status; char *argv[4]; const char *shell; - struct sigaction sa; shell = get_shell(); if ((pid = fork()) == 0) { - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, (struct sigaction *)0); - sigaction(SIGHUP, &sa, (struct sigaction *)0); - open_console(); - char _sh[] = "sh"; char _autoboot[] = "autoboot"; @@ -1081,28 +1114,8 @@ run_script(const char *script) argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0; argv[3] = 0; - sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0); - -#ifdef LOGIN_CAP - setprocresources(RESOURCE_RC); -#endif - - /* - * Try to directly execute the script first. If it - * fails, try the old method of passing the script path - * to sh(1). Don't complain if it fails because of - * the missing execute bit. - */ - error = access(script, X_OK); - if (error == 0) { - execv(script, argv + 1); - warning("can't exec %s: %m", script); - } else if (errno != EACCES) { - warning("can't access %s: %m", script); - } - - execv(shell, argv); - stall("can't exec %s for %s: %m", shell, script); + execute_script(argv); + sleep(STALL_TIMEOUT); _exit(1); /* force single user mode */ } @@ -1869,12 +1882,10 @@ static int runshutdown(void) { pid_t pid, wpid; - int error, status; + int status; int shutdowntimeout; size_t len; char *argv[4]; - const char *shell; - struct sigaction sa; struct stat sb; /* @@ -1886,17 +1897,7 @@ runshutdown(void) if (stat(_PATH_RUNDOWN, &sb) == -1 && errno == ENOENT) return 0; - shell = get_shell(); - if ((pid = fork()) == 0) { - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, (struct sigaction *)0); - sigaction(SIGHUP, &sa, (struct sigaction *)0); - - open_console(); - char _sh[] = "sh"; char _reboot[] = "reboot"; char _single[] = "single"; @@ -1906,34 +1907,13 @@ runshutdown(void) argv[1] = _path_rundown; argv[2] = Reboot ? _reboot : _single; argv[3] = 0; - - sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0); - -#ifdef LOGIN_CAP - setprocresources(RESOURCE_RC); -#endif - - /* - * Try to directly execute the script first. If it - * fails, try the old method of passing the script path - * to sh(1). Don't complain if it fails because of - * the missing execute bit. - */ - error = access(_path_rundown, X_OK); - if (error == 0) { - execv(_path_rundown, argv + 1); - warning("can't exec %s: %m", _path_rundown); - } else if (errno != EACCES) { - warning("can't access %s: %m", _path_rundown); - } - - execv(shell, argv); - warning("can't exec %s for %s: %m", shell, _PATH_RUNDOWN); + + execute_script(argv); _exit(1); /* force single user mode */ } if (pid == -1) { - emergency("can't fork for %s on %s: %m", shell, _PATH_RUNDOWN); + emergency("can't fork for %s: %m", _PATH_RUNDOWN); while (waitpid(-1, (int *) 0, WNOHANG) > 0) continue; sleep(STALL_TIMEOUT); @@ -1956,20 +1936,20 @@ runshutdown(void) if (clang == 1) { /* we were waiting for the sub-shell */ kill(wpid, SIGTERM); - warning("timeout expired for %s on %s: %m; going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("timeout expired for %s: %m; going to " + "single user mode", _PATH_RUNDOWN); return -1; } if (wpid == -1) { if (errno == EINTR) continue; - warning("wait for %s on %s failed: %m; going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("wait for %s failed: %m; going to " + "single user mode", _PATH_RUNDOWN); return -1; } if (wpid == pid && WIFSTOPPED(status)) { - warning("init: %s on %s stopped, restarting\n", - shell, _PATH_RUNDOWN); + warning("init: %s stopped, restarting\n", + _PATH_RUNDOWN); kill(pid, SIGCONT); wpid = -1; } @@ -1992,8 +1972,8 @@ runshutdown(void) } if (!WIFEXITED(status)) { - warning("%s on %s terminated abnormally, going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("%s terminated abnormally, going to " + "single user mode", _PATH_RUNDOWN); return -2; } From owner-svn-src-head@freebsd.org Thu Aug 9 12:17:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 136CF1063E56; Thu, 9 Aug 2018 12:17:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDEC57011A; Thu, 9 Aug 2018 12:17:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A059519454; Thu, 9 Aug 2018 12:17:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CH3g9096412; Thu, 9 Aug 2018 12:17:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CH3gO096411; Thu, 9 Aug 2018 12:17:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091217.w79CH3gO096411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 12:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337535 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337535 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 12:17:04 -0000 Author: trasz Date: Thu Aug 9 12:17:03 2018 New Revision: 337535 URL: https://svnweb.freebsd.org/changeset/base/337535 Log: Use NULLs instead of casted zeroes, for consistency. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Thu Aug 9 12:13:08 2018 (r337534) +++ head/sbin/init/init.c Thu Aug 9 12:17:03 2018 (r337535) @@ -316,12 +316,12 @@ invalid: delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGALRM, SIGUSR1, SIGUSR2, SIGWINCH, 0); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; - sigaction(SIGTTIN, &sa, (struct sigaction *)0); - sigaction(SIGTTOU, &sa, (struct sigaction *)0); + sigaction(SIGTTIN, &sa, NULL); + sigaction(SIGTTOU, &sa, NULL); /* * Paranoia. @@ -435,7 +435,7 @@ handle(sig_t handler, ...) sa.sa_mask = mask_everything; /* XXX SA_RESTART? */ sa.sa_flags = sig == SIGCHLD ? SA_NOCLDSTOP : 0; - sigaction(sig, &sa, (struct sigaction *) 0); + sigaction(sig, &sa, NULL); } va_end(ap); } @@ -958,7 +958,7 @@ single_user(void) * and those are reset to SIG_DFL on exec. */ sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); /* * Fire off a shell. @@ -1443,7 +1443,7 @@ start_window_system(session_t *sp) _exit(0); sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); if (setsid() < 0) emergency("setsid failed (window) %m"); @@ -1510,7 +1510,7 @@ start_getty(session_t *sp) } sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); #ifdef LOGIN_CAP setprocresources(RESOURCE_GETTY); From owner-svn-src-head@freebsd.org Thu Aug 9 12:46:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1272910651BC; Thu, 9 Aug 2018 12:46:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB35371655; Thu, 9 Aug 2018 12:46:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9768D19947; Thu, 9 Aug 2018 12:46:30 +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 w79CkU7u012088; Thu, 9 Aug 2018 12:46:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CkU84012087; Thu, 9 Aug 2018 12:46:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808091246.w79CkU84012087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 12:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337536 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 337536 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 12:46:31 -0000 Author: ae Date: Thu Aug 9 12:46:30 2018 New Revision: 337536 URL: https://svnweb.freebsd.org/changeset/base/337536 Log: If -q flag is specified, do not complain when we are trying to delete nonexistent NAT instance or nonexistent rule. This allows execute batched `delete` commands and do not fail when found nonexistent rule. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Aug 9 12:17:03 2018 (r337535) +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); if (exitval) { exitval = EX_UNAVAILABLE; - warn("rule %u not available", i); + if (co.do_quiet) + continue; + warn("nat %u not available", i); } - } else if (co.do_pipe) { + } else if (co.do_pipe) { exitval = ipfw_delete_pipe(co.do_pipe, i); } else { memset(&rt, 0, sizeof(rt)); @@ -3295,10 +3297,14 @@ ipfw_delete(char *av[]) i = do_range_cmd(IP_FW_XDEL, &rt); if (i != 0) { exitval = EX_UNAVAILABLE; + if (co.do_quiet) + continue; warn("rule %u: setsockopt(IP_FW_XDEL)", rt.start_rule); } else if (rt.new_set == 0 && do_set == 0) { exitval = EX_UNAVAILABLE; + if (co.do_quiet) + continue; if (rt.start_rule != rt.end_rule) warnx("no rules rules in %u-%u range", rt.start_rule, rt.end_rule); @@ -3308,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval != EX_OK) + if (exitval != EX_OK && co.do_quiet == 0) exit(exitval); } From owner-svn-src-head@freebsd.org Thu Aug 9 12:52:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDD29106559F; Thu, 9 Aug 2018 12:52:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEE671C0F; Thu, 9 Aug 2018 12:52:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22f.google.com with SMTP id n21-v6so9604463oig.3; Thu, 09 Aug 2018 05:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NxWnRG1i2yBHYyTcVioHmlIZjeKJLVg6Gbo66oSVX18=; b=ZwpqejW9lSZZCp7HjW80QF52FIfrkl1aJUQy96+uUdEPMM6U5mghfellJaDvEg22Ec 2zYljW8pBV66arnHcuf5ikSOiCgdcFuUmljsLdg++bDe0GFqlTrPOsrzxhzXmQBhfHoh 8oXXWT5+VvFCXfynoE2OhkxT7C2mAivDO+XESxX2NxifUZLNL+cPAuxTTGiV0I107yc6 Ni5F37X0qJ44XnlMHygtKDpwXI7V2MkDPiq/nxzSgKMKJr7ZvO5hm5XCOX1JJSrV8NZY U85vla8rB7iSaE6beI61wYAtb2l4OzjC+3vAoDfRpvY2a/d5aUWkODVzPBMTCHHG9AaC mXtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NxWnRG1i2yBHYyTcVioHmlIZjeKJLVg6Gbo66oSVX18=; b=N5VKQ0F+sAvDG2A+G4KBV9jRuTKuZ5AchbZf6H/FJRrKKXk8B73tTAA8MJTVAjiiJS WGhFSwjB1ejDjsnnvmHJkIDgspT9LHvb0/6FM3JF/juuIqV/xDwWqig0iZVDlqDAMkzW KK/sKG8nKO1yLJojic4wDOn21yck209d6JLG0GA+VJgZw8ziZSRfYQrSLBRECz2PJUPW OvUN5TzZaWWYmlqsL3ng7FQkynPJp5nN2oIs6vv7t+2ky31K2OkcRqAO854RKIwmorHB i9YLzIEedBm857Rn+VRl3Y7aRfge1z7X5ykRsttzzYuLBeMXT/FxmNkqBB3Bux3/B5S3 iKTA== X-Gm-Message-State: AOUpUlEUMhty+GFL6rpNtBedRskNH/L0IAFPiUzoG6+6BSjDXg+d+SI6 eI/mpQFhL7q9y8U6ibY3jY+ECOVyZXC3axVvrZBuvgRSzUg= X-Google-Smtp-Source: AA+uWPzbM4aUbVcfqCDT1pY29MT6uYewE6nMjqRjg3oZdknxjD8jwmOW6LtSpVAlUkkBSWICGcFv/NzQRsUGGvAoQW0= X-Received: by 2002:aca:6142:: with SMTP id v63-v6mr2139975oib.137.1533819128548; Thu, 09 Aug 2018 05:52:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3bb6:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 05:52:08 -0700 (PDT) In-Reply-To: <201808091217.w79CH3gO096411@repo.freebsd.org> References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 9 Aug 2018 07:52:08 -0500 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Edward Tomasz Napierala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 12:52:10 -0000 On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Aug 9 12:17:03 2018 > New Revision: 337535 > URL: https://svnweb.freebsd.org/changeset/base/337535 > > Log: > Use NULLs instead of casted zeroes, for consistency. > It's probably helpful to note explicitly that these are not in arguments to varargs functions, in which case the explicit cast is needed in order to produce a program that will have correct behavior on all compliant compilers/systems. (We do define NULL to be a zero-with-cast, but programs should not assume that NULL will be of pointer type -- "An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant".) -Ben From owner-svn-src-head@freebsd.org Thu Aug 9 14:04:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB90F10674FA; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7164774145; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E29E1A69C; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79E4qK2052555; Thu, 9 Aug 2018 14:04:52 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79E4p5F052553; Thu, 9 Aug 2018 14:04:51 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201808091404.w79E4p5F052553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 9 Aug 2018 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337537 - in head/sys: kern netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: kern netinet netinet6 X-SVN-Commit-Revision: 337537 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 14:04:53 -0000 Author: luporl Date: Thu Aug 9 14:04:51 2018 New Revision: 337537 URL: https://svnweb.freebsd.org/changeset/base/337537 Log: [ppc] Fix kernel panic when using BOOTP_NFSROOT On PowerPC (and possibly other architectures), that doesn't use EARLY_AP_STARTUP, the config task queue may be used initialized. This was observed while trying to mount the root fs from NFS, as reported here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230168. This patch has 2 main changes: 1- Perform a basic initialization of qgroup_config, similar to what is done in taskqgroup_adjust, but simpler. This makes qgroup_config ready to be used during NFS root mount. 2- When EARLY_AP_STARTUP is not used, call inm_init() and in6m_init() right before SI_SUB_ROOT_CONF, because bootp needs to send multicast packages to request an IP. PR: Bug 230168 Reported by: sbruno Reviewed by: jhibbits, mmacy, sbruno Approved by: jhibbits Differential Revision: D16633 Modified: head/sys/kern/subr_gtaskqueue.c head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/kern/subr_gtaskqueue.c Thu Aug 9 14:04:51 2018 (r337537) @@ -857,6 +857,24 @@ taskqgroup_bind(struct taskqgroup *qgroup) } } +static void +taskqgroup_config_init(void *arg) +{ + struct taskqgroup *qgroup = qgroup_config; + LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); + + LIST_SWAP(>ask_head, &qgroup->tqg_queue[0].tgc_tasks, + grouptask, gt_list); + qgroup->tqg_queue[0].tgc_cnt = 0; + taskqgroup_cpu_create(qgroup, 0, 0); + + qgroup->tqg_cnt = 1; + qgroup->tqg_stride = 1; +} + +SYSINIT(taskqgroup_config_init, SI_SUB_TASKQ, SI_ORDER_SECOND, + taskqgroup_config_init, NULL); + static int _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) { Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/netinet/in_mcast.c Thu Aug 9 14:04:51 2018 (r337537) @@ -231,8 +231,13 @@ static void inm_init(void) taskqgroup_config_gtask_init(NULL, &free_gtask, inm_release_task, "inm release task"); } +#ifdef EARLY_AP_STARTUP SYSINIT(inm_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, inm_init, NULL); +#else +SYSINIT(inm_init, SI_SUB_ROOT_CONF - 1, SI_ORDER_FIRST, + inm_init, NULL); +#endif void Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/netinet6/in6_mcast.c Thu Aug 9 14:04:51 2018 (r337537) @@ -562,8 +562,13 @@ static void in6m_init(void) taskqgroup_config_gtask_init(NULL, &free_gtask, in6m_release_task, "in6m release task"); } +#ifdef EARLY_AP_STARTUP SYSINIT(in6m_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, in6m_init, NULL); +#else +SYSINIT(in6m_init, SI_SUB_ROOT_CONF - 1, SI_ORDER_SECOND, + in6m_init, NULL); +#endif void From owner-svn-src-head@freebsd.org Thu Aug 9 14:19:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D71B21067B94; Thu, 9 Aug 2018 14:19:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84DBB74B13; Thu, 9 Aug 2018 14:19:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 667D61A836; Thu, 9 Aug 2018 14:19:48 +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 w79EJmlq058453; Thu, 9 Aug 2018 14:19:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79EJlJi058448; Thu, 9 Aug 2018 14:19:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091419.w79EJlJi058448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337538 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 337538 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 14:19:49 -0000 Author: np Date: Thu Aug 9 14:19:47 2018 New Revision: 337538 URL: https://svnweb.freebsd.org/changeset/base/337538 Log: cxgbe(4): Add support for high priority filters on T6+. They have their own region in the TCAM starting with T6, unlike previous chips where they were in the same region as normal filters. These filters "hit" before anything else in the LE's lookup. The exact order is: a) High priority filters b) TOE's active region (TCAM and/or hash) c) Servers (TOE hw listeners) d) Normal filters MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/common/common.h Thu Aug 9 14:19:47 2018 (r337538) @@ -441,6 +441,13 @@ static inline int is_ftid(const struct adapter *sc, u_ tid <= sc->tids.ftid_end); } +static inline int is_hpftid(const struct adapter *sc, u_int tid) +{ + + return (sc->tids.nhpftids > 0 && tid >= sc->tids.hpftid_base && + tid <= sc->tids.hpftid_end); +} + static inline int is_etid(const struct adapter *sc, u_int tid) { Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/offload.h Thu Aug 9 14:19:47 2018 (r337538) @@ -133,7 +133,12 @@ struct tid_info { u_int ftid_base; u_int ftid_end; + u_int nhpftids; + u_int hpftid_base; + u_int hpftid_end; + u_int ntids; + u_int tid_base; u_int netids; u_int etid_base; @@ -150,10 +155,13 @@ struct tid_info { union aopen_entry *afree; u_int atids_in_use; + /* High priority filters and normal filters share the lock and cv. */ struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); struct cv ftid_cv; struct filter_entry *ftid_tab; + struct filter_entry *hpftid_tab; u_int ftids_in_use; + u_int hpftids_in_use; /* * hashfilter and TOE are mutually exclusive and both use ntids and Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_filter.c Thu Aug 9 14:19:47 2018 (r337538) @@ -64,12 +64,20 @@ struct filter_entry { }; static void free_filter_resources(struct filter_entry *); +static int get_tcamfilter(struct adapter *, struct t4_filter *); static int get_hashfilter(struct adapter *, struct t4_filter *); static int set_hashfilter(struct adapter *, struct t4_filter *, uint64_t, struct l2t_entry *, struct smt_entry *); static int del_hashfilter(struct adapter *, struct t4_filter *); static int configure_hashfilter_tcb(struct adapter *, struct filter_entry *); +static inline bool +separate_hpfilter_region(struct adapter *sc) +{ + + return (chip_id(sc) >= CHELSIO_T6); +} + static int alloc_hftid_tab(struct tid_info *t, int flags) { @@ -302,7 +310,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode) if (rc) return (rc); - if (sc->tids.ftids_in_use > 0) { + if (sc->tids.ftids_in_use > 0 || sc->tids.hpftids_in_use > 0) { rc = EBUSY; goto done; } @@ -343,39 +351,10 @@ get_filter_hits(struct adapter *sc, uint32_t tid) int get_filter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.nftids; - struct filter_entry *f; - if (t->fs.hash) return (get_hashfilter(sc, t)); - - if (sc->tids.ftids_in_use == 0 || sc->tids.ftid_tab == NULL || - t->idx >= nfilters) { - t->idx = 0xffffffff; - return (0); - } - - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; - for (i = t->idx; i < nfilters; i++, f++) { - if (f->valid) { - MPASS(f->tid == sc->tids.ftid_base + i); - t->idx = i; - t->l2tidx = f->l2te ? f->l2te->idx : 0; - t->smtidx = f->smt ? f->smt->idx : 0; - if (f->fs.hitcnts) - t->hits = get_filter_hits(sc, f->tid); - else - t->hits = UINT64_MAX; - t->fs = f->fs; - - goto done; - } - } - t->idx = 0xffffffff; -done: - mtx_unlock(&sc->tids.ftid_lock); - return (0); + else + return (get_tcamfilter(sc, t)); } static int @@ -387,15 +366,23 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t u_int vnic_vld, vnic_vld_mask; struct wrq_cookie cookie; int i, rc, busy, locked; + u_int tid; const int ntids = t->fs.type ? 4 : 1; MPASS(!t->fs.hash); - MPASS(t->idx < sc->tids.nftids); /* Already validated against fconf, iconf */ MPASS((t->fs.val.pfvf_vld & t->fs.val.ovlan_vld) == 0); MPASS((t->fs.mask.pfvf_vld & t->fs.mask.ovlan_vld) == 0); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + MPASS(t->idx < sc->tids.nhpftids); + f = &sc->tids.hpftid_tab[t->idx]; + tid = sc->tids.hpftid_base + t->idx; + } else { + MPASS(t->idx < sc->tids.nftids); + f = &sc->tids.ftid_tab[t->idx]; + tid = sc->tids.ftid_base + t->idx; + } rc = busy = locked = 0; mtx_lock(&sc->tids.ftid_lock); for (i = 0; i < ntids; i++) { @@ -418,7 +405,10 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t rc = ENOMEM; else { f->pending = 1; - sc->tids.ftids_in_use++; + if (separate_hpfilter_region(sc) && t->fs.prio) + sc->tids.hpftids_in_use++; + else + sc->tids.ftids_in_use++; } } mtx_unlock(&sc->tids.ftid_lock); @@ -434,7 +424,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t * Can't fail now. A set-filter WR will definitely be sent. */ - f->tid = sc->tids.ftid_base + t->idx; + f->tid = tid; f->fs = t->fs; f->l2te = l2te; f->smt = smt; @@ -649,10 +639,17 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) return (rc); } else { - if (ti->nftids == 0) - return (ENOTSUP); - if (t->idx >= ti->nftids) - return (EINVAL); + if (separate_hpfilter_region(sc) && t->fs.prio) { + if (ti->nhpftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nhpftids) + return (EINVAL); + } else { + if (ti->nftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nftids) + return (EINVAL); + } /* IPv6 filter idx must be 4 aligned */ if (t->fs.type == 1 && ((t->idx & 0x3) || t->idx + 4 >= ti->nftids)) @@ -702,17 +699,37 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) goto done; } + } else if (separate_hpfilter_region(sc) && t->fs.prio && + __predict_false(ti->hpftid_tab == NULL)) { + MPASS(ti->nhpftids != 0); + KASSERT(ti->hpftids_in_use == 0, + ("%s: no memory allocated but hpftids_in_use is %u", + __func__, ti->hpftids_in_use)); + ti->hpftid_tab = malloc(sizeof(struct filter_entry) * + ti->nhpftids, M_CXGBE, M_NOWAIT | M_ZERO); + if (ti->hpftid_tab == NULL) { + rc = ENOMEM; + goto done; + } + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } else if (__predict_false(ti->ftid_tab == NULL)) { + MPASS(ti->nftids != 0); KASSERT(ti->ftids_in_use == 0, - ("%s: no memory allocated but ftids_in_use > 0", __func__)); + ("%s: no memory allocated but ftids_in_use is %u", + __func__, ti->ftids_in_use)); ti->ftid_tab = malloc(sizeof(struct filter_entry) * ti->nftids, M_CXGBE, M_NOWAIT | M_ZERO); if (ti->ftid_tab == NULL) { rc = ENOMEM; goto done; } - mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); - cv_init(&ti->ftid_cv, "t4fcv"); + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } done: end_synchronized_op(sc, 0); @@ -768,16 +785,32 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t struct filter_entry *f; struct fw_filter_wr *fwr; struct wrq_cookie cookie; - int rc; + int rc, nfilters; +#ifdef INVARIANTS + u_int tid_base; +#endif - MPASS(sc->tids.ftid_tab != NULL); - MPASS(sc->tids.nftids > 0); - - if (t->idx >= sc->tids.nftids) - return (EINVAL); - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + MPASS(f != NULL); /* Caller checked this. */ + if (t->idx >= nfilters) { + rc = EINVAL; + goto done; + } + f += t->idx; + if (f->locked) { rc = EPERM; goto done; @@ -790,7 +823,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t rc = EINVAL; goto done; } - MPASS(f->tid == sc->tids.ftid_base + t->idx); + MPASS(f->tid == tid_base + t->idx); fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), &cookie); if (fwr == NULL) { rc = ENOMEM; @@ -833,6 +866,9 @@ del_filter(struct adapter *sc, struct t4_filter *t) if (t->fs.hash) { if (sc->tids.hftid_tab != NULL) return (del_hashfilter(sc, t)); + } else if (separate_hpfilter_region(sc) && t->fs.prio) { + if (sc->tids.hpftid_tab != NULL) + return (del_tcamfilter(sc, t)); } else { if (sc->tids.ftid_tab != NULL) return (del_tcamfilter(sc, t)); @@ -899,21 +935,28 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *rpl = (const void *)(rss + 1); u_int tid = GET_TID(rpl); - u_int rc, cleanup, idx; + u_int rc, idx; struct filter_entry *f; KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - MPASS(is_ftid(sc, tid)); - cleanup = 0; - idx = tid - sc->tids.ftid_base; - f = &sc->tids.ftid_tab[idx]; + + if (is_hpftid(sc, tid)) { + idx = tid - sc->tids.hpftid_base; + f = &sc->tids.hpftid_tab[idx]; + } else if (is_ftid(sc, tid)) { + idx = tid - sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + } else + panic("%s: FW reply for invalid TID %d.", __func__, tid); + + MPASS(f->tid == tid); rc = G_COOKIE(rpl->cookie); mtx_lock(&sc->tids.ftid_lock); KASSERT(f->pending, ("%s: reply %d for filter[%u] that isn't pending.", - __func__, rc, idx)); + __func__, rc, tid)); switch(rc) { case FW_FILTER_WR_FLT_ADDED: /* set-filter succeeded */ @@ -936,7 +979,10 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head /* set-filter failed due to lack of SMT space. */ MPASS(f->valid == 0); free_filter_resources(f); - sc->tids.ftids_in_use--; + if (separate_hpfilter_region(sc) && f->fs.prio) + sc->tids.hpftids_in_use--; + else + sc->tids.ftids_in_use--; break; case FW_FILTER_WR_SUCCESS: case FW_FILTER_WR_EINVAL: @@ -1077,10 +1123,68 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct } static int +get_tcamfilter(struct adapter *sc, struct t4_filter *t) +{ + int i, nfilters; + struct filter_entry *f; + u_int in_use; +#ifdef INVARIANTS + u_int tid_base; +#endif + + MPASS(!t->fs.hash); + + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; + in_use = sc->tids.hpftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; + in_use = sc->tids.ftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + + if (in_use == 0 || f == NULL || t->idx >= nfilters) { + t->idx = 0xffffffff; + return (0); + } + + f += t->idx; + mtx_lock(&sc->tids.ftid_lock); + for (i = t->idx; i < nfilters; i++, f++) { + if (f->valid) { + MPASS(f->tid == tid_base + i); + t->idx = i; + t->l2tidx = f->l2te ? f->l2te->idx : 0; + t->smtidx = f->smt ? f->smt->idx : 0; + if (f->fs.hitcnts) + t->hits = get_filter_hits(sc, f->tid); + else + t->hits = UINT64_MAX; + t->fs = f->fs; + + goto done; + } + } + t->idx = 0xffffffff; +done: + mtx_unlock(&sc->tids.ftid_lock); + return (0); +} + +static int get_hashfilter(struct adapter *sc, struct t4_filter *t) { int i, nfilters = sc->tids.ntids; struct filter_entry *f; + + MPASS(t->fs.hash); if (sc->tids.tids_in_use == 0 || sc->tids.hftid_tab == NULL || t->idx >= nfilters) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_main.c Thu Aug 9 14:19:47 2018 (r337538) @@ -1404,6 +1404,7 @@ t4_detach_common(device_t dev) free(sc->sge.iqmap, M_CXGBE); free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); + free(sc->tids.hpftid_tab, M_CXGBE); if (sc->tids.hftid_tab) free_hftid_tab(&sc->tids); free(sc->tids.atid_tab, M_CXGBE); @@ -3853,6 +3854,47 @@ get_params__post_init(struct adapter *sc) __func__, sc->vres.l2t.size, L2T_SIZE)); sc->params.core_vdd = val[6]; + if (chip_id(sc) >= CHELSIO_T6) { + +#ifdef INVARIANTS + if (sc->params.fw_vers >= + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + /* + * Note that the code to enable the region should run + * before t4_fw_initialize and not here. This is just a + * reminder to add said code. + */ + device_printf(sc->dev, + "hpfilter region not enabled.\n"); + } +#endif + + sc->tids.tid_base = t4_read_reg(sc, + A_LE_DB_ACTIVE_TABLE_START_INDEX); + + param[0] = FW_PARAM_PFVF(HPFILTER_START); + param[1] = FW_PARAM_PFVF(HPFILTER_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query hpfilter parameters: %d.\n", rc); + return (rc); + } + if ((int)val[1] > (int)val[0]) { + sc->tids.hpftid_base = val[0]; + sc->tids.hpftid_end = val[1]; + sc->tids.nhpftids = val[1] - val[0] + 1; + + /* + * These should go off if the layout changes and the + * driver needs to catch up. + */ + MPASS(sc->tids.hpftid_base == 0); + MPASS(sc->tids.tid_base == sc->tids.nhpftids); + } + } + /* * MPSBGMAP is queried separately because only recent firmwares support * it as a parameter and we don't want the compound query above to fail @@ -3916,6 +3958,12 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; + if (sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + MPASS(sc->tids.ntids >= sc->tids.nhpftids); + sc->tids.ntids -= sc->tids.nhpftids; + } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); sc->params.hash_filter = 1; } @@ -8127,6 +8175,11 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) t->atids_in_use); } + if (t->nhpftids) { + sbuf_printf(sb, "HPFTID range: %u-%u, in use: %u\n", + t->hpftid_base, t->hpftid_end, t->hpftids_in_use); + } + if (t->ntids) { sbuf_printf(sb, "TID range: "); if (t4_read_reg(sc, A_LE_DB_CONFIG) & F_HASHEN) { @@ -8141,10 +8194,10 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (b) - sbuf_printf(sb, "0-%u, ", b - 1); + sbuf_printf(sb, "%u-%u, ", t->tid_base, b - 1); sbuf_printf(sb, "%u-%u", hb, t->ntids - 1); } else - sbuf_printf(sb, "0-%u", t->ntids - 1); + sbuf_printf(sb, "%u-%u", t->tid_base, t->ntids - 1); sbuf_printf(sb, ", in use: %u\n", atomic_load_acq_int(&t->tids_in_use)); } @@ -8155,8 +8208,8 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (t->nftids) { - sbuf_printf(sb, "FTID range: %u-%u\n", t->ftid_base, - t->ftid_base + t->nftids - 1); + sbuf_printf(sb, "FTID range: %u-%u, in use: %u\n", t->ftid_base, + t->ftid_end, t->ftids_in_use); } if (t->netids) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 14:19:47 2018 (r337538) @@ -367,7 +367,7 @@ set_tcb_rpl_handler(struct sge_iq *iq, const struct rs MPASS(m == NULL); tid = GET_TID(cpl); - if (is_ftid(iq->adapter, tid)) { + if (is_hpftid(iq->adapter, tid) || is_ftid(iq->adapter, tid)) { /* * The return code for filter-write is put in the CPL cookie so * we have to rely on the hardware tid (is_ftid) to determine Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 9 14:19:47 2018 (r337538) @@ -510,7 +510,10 @@ insert_tid(struct adapter *sc, int tid, void *ctx, int { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + MPASS(tid >= t->tid_base); + MPASS(tid - t->tid_base < t->ntids); + + t->tid_tab[tid - t->tid_base] = ctx; atomic_add_int(&t->tids_in_use, ntids); } @@ -519,7 +522,7 @@ lookup_tid(struct adapter *sc, int tid) { struct tid_info *t = &sc->tids; - return (t->tid_tab[tid]); + return (t->tid_tab[tid - t->tid_base]); } void @@ -527,7 +530,7 @@ update_tid(struct adapter *sc, int tid, void *ctx) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + t->tid_tab[tid - t->tid_base] = ctx; } void @@ -535,7 +538,7 @@ remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = NULL; + t->tid_tab[tid - t->tid_base] = NULL; atomic_subtract_int(&t->tids_in_use, ntids); } From owner-svn-src-head@freebsd.org Thu Aug 9 14:21:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC24E1067C5B; Thu, 9 Aug 2018 14:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6026C74D3B; Thu, 9 Aug 2018 14:21:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41FAD1A97D; Thu, 9 Aug 2018 14:21:28 +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 w79ELSD6059985; Thu, 9 Aug 2018 14:21:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79ELRNW059984; Thu, 9 Aug 2018 14:21:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091421.w79ELRNW059984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337539 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 337539 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 14:21:28 -0000 Author: np Date: Thu Aug 9 14:21:27 2018 New Revision: 337539 URL: https://svnweb.freebsd.org/changeset/base/337539 Log: cxgbetool(8): Userspace part of support for high priority filters on T6+. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.8 head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.8 ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.8 Thu Aug 9 14:19:47 2018 (r337538) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Thu Aug 9 14:21:27 2018 (r337539) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2018 +.Dd Aug 8, 2018 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -60,7 +60,7 @@ .It .Nm Ar nexus Cm filter Ar idx Ar filter-specification .It -.Nm Ar nexus Cm filter Ar idx Cm delete +.Nm Ar nexus Cm filter Ar idx Cm delete Op Cm prio Bro Cm 0 | 1 Brc .It .Nm Ar nexus Cm filter list .It @@ -381,7 +381,7 @@ TCAM filters: The number of available filters is in dev...nfilters. .Ar idx must be an unused index between 0 and nfilters - 1. -IPv6 filters consume 4 consecutive entries on T4/T5 and and 2 on T6 and +IPv6 filters consume 4 consecutive entries on T4/T5 and 2 on T6 and .Ar idx must be aligned to 4 or 2 in this case. .Pp Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Thu Aug 9 14:19:47 2018 (r337538) +++ head/usr.sbin/cxgbetool/cxgbetool.c Thu Aug 9 14:21:27 2018 (r337539) @@ -94,7 +94,7 @@ usage(FILE *fp) "\tcontext show an SGE context\n" "\tdumpstate dump chip state\n" "\tfilter [ ] ... set a filter\n" - "\tfilter delete|clear delete a filter\n" + "\tfilter delete|clear [prio 1] delete a filter\n" "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\thashfilter [ ] ... set a hashfilter\n" @@ -147,7 +147,6 @@ real_doit(unsigned long cmd, void *data, const char *c rc = errno; return (rc); } - chip_id = nexus[1] - '0'; } rc = ioctl(fd, cmd, data); @@ -934,7 +933,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t printf("(hash)"); } } - if (t->fs.prio) + if (chip_id <= 5 && t->fs.prio) printf(" Prio"); if (t->fs.rpttid) printf(" RptTID"); @@ -944,7 +943,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t static int show_filters(int hash) { - uint32_t mode = 0, header = 0; + uint32_t mode = 0, header, hpfilter = 0; struct t4_filter t; int rc; @@ -953,6 +952,29 @@ show_filters(int hash) if (rc != 0) return (rc); + if (!hash && chip_id >= 6) { + header = 0; + bzero(&t, sizeof (t)); + t.idx = 0; + t.fs.hash = 0; + t.fs.prio = 1; + for (t.idx = 0; ; t.idx++) { + rc = doit(CHELSIO_T4_GET_FILTER, &t); + if (rc != 0 || t.idx == 0xffffffff) + break; + + if (!header) { + printf("High Priority TCAM Region:\n"); + do_show_info_header(mode); + header = 1; + hpfilter = 1; + } + do_show_one_filter_info(&t, mode); + } + } + + header = 0; + bzero(&t, sizeof (t)); t.idx = 0; t.fs.hash = hash; for (t.idx = 0; ; t.idx++) { @@ -961,11 +983,13 @@ show_filters(int hash) break; if (!header) { + if (hpfilter) + printf("\nNormal Priority TCAM Region:\n"); do_show_info_header(mode); header = 1; } do_show_one_filter_info(&t, mode); - }; + } return (rc); } @@ -1092,10 +1116,11 @@ set_filter_mode(int argc, const char *argv[]) } static int -del_filter(uint32_t idx, int hashfilter) +del_filter(uint32_t idx, int prio, int hashfilter) { struct t4_filter t; + t.fs.prio = prio; t.fs.hash = hashfilter; t.idx = idx; @@ -1225,6 +1250,15 @@ set_filter(uint32_t idx, int argc, const char *argv[], } else if (!parse_val("hitcnts", args, &val)) { t.fs.hitcnts = val; } else if (!parse_val("prio", args, &val)) { + if (hash) { + warnx("Hashfilters doesn't support \"prio\"\n"); + return (EINVAL); + } + if (val != 0 && val != 1) { + warnx("invalid priority \"%s\"; must be" + " \"0\" or \"1\"", argv[start_arg + 1]); + return (EINVAL); + } t.fs.prio = val; } else if (!parse_val("rpttid", args, &val)) { t.fs.rpttid = 1; @@ -1406,10 +1440,33 @@ filter_cmd(int argc, const char *argv[], int hashfilte } idx = (uint32_t) val; - /* delete|clear */ - if (argc == 2 && + /* delete|clear [prio 0|1] */ + if ((argc == 2 || argc == 4) && (strcmp(argv[1], "delete") == 0 || strcmp(argv[1], "clear") == 0)) { - return del_filter(idx, hashfilter); + int prio = 0; + + if (argc == 4) { + if (hashfilter) { + warnx("stray arguments after \"%s\".", argv[1]); + return (EINVAL); + } + + if (strcmp(argv[2], "prio") != 0) { + warnx("\"prio\" is the only valid keyword " + "after \"%s\", found \"%s\" instead.", + argv[1], argv[2]); + return (EINVAL); + } + + s = str_to_number(argv[3], NULL, &val); + if (*s || val < 0 || val > 1) { + warnx("%s \"%s\"; must be \"0\" or \"1\".", + argv[2], argv[3]); + return (EINVAL); + } + prio = (int)val; + } + return del_filter(idx, prio, hashfilter); } /* skip */ @@ -3557,6 +3614,7 @@ main(int argc, const char *argv[]) } nexus = argv[1]; + chip_id = nexus[1] - '0'; /* progname and nexus */ argc -= 2; From owner-svn-src-head@freebsd.org Thu Aug 9 14:28:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A241067F8D; Thu, 9 Aug 2018 14:28:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F3975397; Thu, 9 Aug 2018 14:28:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79ESmYv017685; Thu, 9 Aug 2018 07:28:48 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79ESmln017684; Thu, 9 Aug 2018 07:28:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <201808091246.w79CkU84012087@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 07:28:48 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 14:28:51 -0000 > Author: ae > Date: Thu Aug 9 12:46:30 2018 > New Revision: 337536 > URL: https://svnweb.freebsd.org/changeset/base/337536 > > Log: > If -q flag is specified, do not complain when we are trying to delete > nonexistent NAT instance or nonexistent rule. It would probably be better to not overload -q with what is usually a -f like functionality of a command. Sadly -f is already used in ipfw, so another option should be choosen. > This allows execute batched `delete` commands and do not fail when > found nonexistent rule. So now I can not code a quiet ipfw command that does fail when I give it a bad delete command :-(. > Obtained from: Yandex LLC > MFC after: 2 weeks > Sponsored by: Yandex LLC > > Modified: > head/sbin/ipfw/ipfw2.c > > Modified: head/sbin/ipfw/ipfw2.c > ============================================================================== > --- head/sbin/ipfw/ipfw2.c Thu Aug 9 12:17:03 2018 (r337535) > +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) > @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) > exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); > if (exitval) { > exitval = EX_UNAVAILABLE; > - warn("rule %u not available", i); > + if (co.do_quiet) > + continue; > + warn("nat %u not available", i); > } > - } else if (co.do_pipe) { > + } else if (co.do_pipe) { > exitval = ipfw_delete_pipe(co.do_pipe, i); > } else { > memset(&rt, 0, sizeof(rt)); > @@ -3295,10 +3297,14 @@ ipfw_delete(char *av[]) > i = do_range_cmd(IP_FW_XDEL, &rt); > if (i != 0) { > exitval = EX_UNAVAILABLE; > + if (co.do_quiet) > + continue; > warn("rule %u: setsockopt(IP_FW_XDEL)", > rt.start_rule); > } else if (rt.new_set == 0 && do_set == 0) { > exitval = EX_UNAVAILABLE; > + if (co.do_quiet) > + continue; > if (rt.start_rule != rt.end_rule) > warnx("no rules rules in %u-%u range", > rt.start_rule, rt.end_rule); > @@ -3308,7 +3314,7 @@ ipfw_delete(char *av[]) > } > } > } > - if (exitval != EX_OK) > + if (exitval != EX_OK && co.do_quiet == 0) > exit(exitval); > } > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 14:33:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CB4A1068245; Thu, 9 Aug 2018 14:33:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDB1F75A68; Thu, 9 Aug 2018 14:33:17 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward101o.mail.yandex.net (Yandex) with ESMTP id A6C051341FF8; Thu, 9 Aug 2018 17:33:08 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ByrnRNgkj6-X8Imsm4v; Thu, 09 Aug 2018 17:33:08 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533825188; bh=HjAuM91yURe9olicTMnvPTmmsra6Cey+mjBy7+GDId0=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=dJbScly6cslHn++60ekSS3zkHXCCbjIniX9GBjNQWyh73Aw8r3n/7OMarEEdsRGNL LMF2tGFGLrD5H5JhIVWkG1OL+O80SWu6GLCkct5Uz6c5VDC1G12IRy0QRLJm3q06Pk 5wrQPJ8cIqU7sJpFuhSimEu0clBXLZn3JzIv9x+c= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id MLrszNJksQ-X75OtgeX; Thu, 09 Aug 2018 17:33:07 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533825187; bh=HjAuM91yURe9olicTMnvPTmmsra6Cey+mjBy7+GDId0=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=WoTa2ChbZHTKaishSChlIKToeVWjXEhhkZdmn+M/VE3h4a2CFhgWuQHJqtHi60Mfd bgt+8171b4Iuioj5f1xVpyg8BAA3cpWmQzreHVII6UwOVmcHO2Cx7doxIcgt6+kYmh 63jPdr1ROpAcxQ7lv9u39rghr3miSdHMMkNlBdiE= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> Date: Thu, 9 Aug 2018 17:32:39 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 14:33:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA Content-Type: multipart/mixed; boundary="LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> --LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 17:28, Rodney W. Grimes wrote: >> Author: ae >> Date: Thu Aug 9 12:46:30 2018 >> New Revision: 337536 >> URL: https://svnweb.freebsd.org/changeset/base/337536 >> >> Log: >> If -q flag is specified, do not complain when we are trying to delet= e >> nonexistent NAT instance or nonexistent rule. >=20 > It would probably be better to not overload -q with what is > usually a -f like functionality of a command. Sadly -f is > already used in ipfw, so another option should be choosen. >=20 >> This allows execute batched `delete` commands and do not fail when >> found nonexistent rule. >=20 > So now I can not code a quiet ipfw command that does fail when > I give it a bad delete command :-(. Previously -q did not handled by delete command, so you can just use bad "ipfw delete" without -q :) --=20 WBR, Andrey V. Elsukov --LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt-- --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsUIcACgkQAcXqBBDI oXqpxgf/fzmdNCMFNEdo4azluvfn1K9ACM4uK/I1+oB65k/OB7PRAkWO+yhRsFgk WDbp0DuLDEX57jCKWihbCDLAuxyS4QmBE4lJu3eprUlBXuLfFtgYaVuPv6rky7VZ 7VlPwwpGk7A7/ThRHd9xL0FF5jhAgdAiRT19DWA3siPE0kISzV+5Gqd8OLCI4Wza tOUru7n3XkLhSuc1IH0Ce/AbtQk6Xb3bjhVzOotVc87M4SdbUOeYKHeYNwLjiFHP W9DbzllQ5qBqE42bTYbEuwUEL+sMWZse2vfr3kld5YvImVuWx1VEu4W3gUB468GL SOLFMe4m5hSdGz0ScIH0k0N5TU8ElA== =3zWV -----END PGP SIGNATURE----- --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA-- From owner-svn-src-head@freebsd.org Thu Aug 9 14:36:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 632331068315; Thu, 9 Aug 2018 14:36:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1551775C1C; Thu, 9 Aug 2018 14:36:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E58E81AB61; Thu, 9 Aug 2018 14:36:44 +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 w79EaiuC068806; Thu, 9 Aug 2018 14:36:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79Eaifp068805; Thu, 9 Aug 2018 14:36:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091436.w79Eaifp068805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337540 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337540 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 14:36:45 -0000 Author: np Date: Thu Aug 9 14:36:44 2018 New Revision: 337540 URL: https://svnweb.freebsd.org/changeset/base/337540 Log: cxgbe(4): Display pkt-size and burst-size in traffic class parameters. Modified: head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Thu Aug 9 14:21:27 2018 (r337539) +++ head/sys/dev/cxgbe/t4_sched.c Thu Aug 9 14:36:44 2018 (r337540) @@ -650,6 +650,10 @@ sysctl_tc_params(SYSCTL_HANDLER_ARGS) break; case SCHED_CLASS_MODE_FLOW: sbuf_printf(sb, " per-flow"); + if (tc.pktsize > 0) + sbuf_printf(sb, " pkt-size %u", tc.pktsize); + if (tc.burstsize > 0) + sbuf_printf(sb, " burst-size %u", tc.burstsize); break; default: rc = ENXIO; From owner-svn-src-head@freebsd.org Thu Aug 9 14:40:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B6DE10685B0; Thu, 9 Aug 2018 14:40:35 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD86D75FAE; Thu, 9 Aug 2018 14:40:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79EeWnJ017774; Thu, 9 Aug 2018 07:40:32 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79EeWYj017773; Thu, 9 Aug 2018 07:40:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 07:40:32 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 14:40:35 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 09.08.2018 17:28, Rodney W. Grimes wrote: > >> Author: ae > >> Date: Thu Aug 9 12:46:30 2018 > >> New Revision: 337536 > >> URL: https://svnweb.freebsd.org/changeset/base/337536 > >> > >> Log: > >> If -q flag is specified, do not complain when we are trying to delete > >> nonexistent NAT instance or nonexistent rule. > > > > It would probably be better to not overload -q with what is > > usually a -f like functionality of a command. Sadly -f is > > already used in ipfw, so another option should be choosen. > > > >> This allows execute batched `delete` commands and do not fail when > >> found nonexistent rule. > > > > So now I can not code a quiet ipfw command that does fail when > > I give it a bad delete command :-(. > > Previously -q did not handled by delete command, so you can just use bad > "ipfw delete" without -q :) This now means -q has 2 functions, silence most commands, and silently ignore errors on delete. That is a poor implementation of syntax and options. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 14:48:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3EE41069385; Thu, 9 Aug 2018 14:48:51 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::608]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B308786B7; Thu, 9 Aug 2018 14:48:50 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 7D50944434CC; Thu, 9 Aug 2018 17:48:40 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id j0SDnleRZ6-meIKUJYM; Thu, 09 Aug 2018 17:48:40 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533826120; bh=e3Uq49I1Zu7cfGyOfFBpl4ZgUu+8lZpzulmGXhmNEP8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=HcHXPvMh8TchBawNauoJydXF5+gKcWZ31CPJHH5lcYFtQyosfV/vEX9zVjTJERpFx Mm5RGUjrLKBCt3GUsWV1mw+tRQs81xxHn1g2eZwjV2GmHuzAVGaaIIb3sQsgsabG0W VbhWE/1EB9Txb+mN+0y+obf8rLrKUdeS4DogCPKc= Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id szA5aJ1AMD-mdOKCdpQ; Thu, 09 Aug 2018 17:48:39 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533826119; bh=e3Uq49I1Zu7cfGyOfFBpl4ZgUu+8lZpzulmGXhmNEP8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=dvehdJxQydD4At4N49uOrUBY0Vo+bh/i3fHvCSklQZvB8sGM6hgIK6ZYqlk3cSqBh Kw6e8MCwHMozmBgvGDZmA//KKff5Oi7yrvPsFVxXOIviWmgQCd+u055pwIeyWK2MRC I112zmz4fyq3P9G5uLIWEoK47oLVGPPJ3bHf0bVQ= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> Date: Thu, 9 Aug 2018 17:48:12 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 14:48:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ Content-Type: multipart/mixed; boundary="spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> --spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 17:40, Rodney W. Grimes wrote: >>> So now I can not code a quiet ipfw command that does fail when >>> I give it a bad delete command :-(. >> >> Previously -q did not handled by delete command, so you can just use b= ad >> "ipfw delete" without -q :) >=20 > This now means -q has 2 functions, silence most commands, > and silently ignore errors on delete. >=20 > That is a poor implementation of syntax and options. I think it makes "delete" command to have the same behavior as described for commands in "-q" description: -q Be quiet when executing the add, nat, zero, resetlog or flush commands; (implies -f). This is useful when updating rulesets by executing multiple ipfw commands in a script (e.g., =E2=80=98sh=C2=A0/etc/rc.firewall=E2=80=99), or by processing a fil= e with many ipfw rules across a remote login session. It also stops a table add or delete from failing if the entry already exists or is not present. table add/delete commands had the same behavior, "nat" already noted in this list. What is the usage scenario do you use, where you need to fail on bad delete? =09 --=20 WBR, Andrey V. Elsukov --spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B-- --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsVCwACgkQAcXqBBDI oXoy8Af+MOnY966xX7auk9xZQ5YMNvmBlY8H5XVJv0aAyFtcj1m6mMnJv+tQppzj kkvze4I0Gtf+dqbdCLRypeGtssQsys4PI1BiAXjiCP+89yjgtx9g02+NxCPGdNEH ftW3ki67vl/lUnHH6smaqo3QDu6G616qn7kmu/MXy85xUWT5Nx2M1v9NlL+kBK9U pKBlAkL+vTfTE/jb1dFFocIK9A9/M8Brrdp4wXzyNh12Zk62/QYWFYh/arbcsR38 kv4igQqin3URNBIRC+7f9TD1ffyxKp6eIlfhXPGyZ52zWyvOl6JBOkMsrOUZSbcc V46uudKRaOGd7XoY0XKJCPBzhiY+VA== =jyKv -----END PGP SIGNATURE----- --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ-- From owner-svn-src-head@freebsd.org Thu Aug 9 15:48:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7272A106A9C4; Thu, 9 Aug 2018 15:48:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2AE7AB38; Thu, 9 Aug 2018 15:48:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Fm8jG018169; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79Fm8Ed018168; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 08:48:08 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 15:48:12 -0000 > On 09.08.2018 17:40, Rodney W. Grimes wrote: > >>> So now I can not code a quiet ipfw command that does fail when > >>> I give it a bad delete command :-(. > >> > >> Previously -q did not handled by delete command, so you can just use bad > >> "ipfw delete" without -q :) > > > > This now means -q has 2 functions, silence most commands, > > and silently ignore errors on delete. > > > > That is a poor implementation of syntax and options. > > I think it makes "delete" command to have the same behavior as described > for commands in "-q" description: Which is yet another bug in your commit, you did not update the synopsis or the description of the -q flag to include your change. Though oddly the synopsis does show delete -q, it how ever does not show -q for any of the table commands. > > -q Be quiet when executing the add, nat, zero, resetlog or flush > commands; (implies -f). No mention of what it does on delete, does -q on delete imply -f? > This is useful when updating rulesets by > executing multiple ipfw commands in a script (e.g., > ?sh?/etc/rc.firewall?), or by processing a file with many ipfw > rules across a remote login session. It also stops a table add > or delete from failing if the entry already exists or is not > present. That suggesting that -q is good for remote login session is poor advice at best, you should redirect both standard and error output to a file, depending on -q is just a loaded gun waiting to go off. > > table add/delete commands had the same behavior, "nat" already noted in > this list. What is the usage scenario do you use, where you need to fail > on bad delete? if [ ipfw delete ${1} ]; then handle the missing rule fi But more importantly you seem to be ignoring the aspect that your overloading a "silent" option with a "ignore failure" option. That is bad design. The description of the -q flag is already 2x as long as it should be in a good design. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 16:02:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3773C106B2D4; Thu, 9 Aug 2018 16:02:11 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A573B7B513; Thu, 9 Aug 2018 16:02:10 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 9166718061B2; Thu, 9 Aug 2018 19:01:59 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VkhMn87jVX-1xIWRdlW; Thu, 09 Aug 2018 19:01:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533830519; bh=RTG9QSyaX+jlKqKYVoVsxvSi6UvtFJ3Wquv8NfpZCos=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=CtOucxA0ViYSIqQja11DgQWAwlfdUiGVwwCOCjFZtZlvmWDv8qGh3LIEWCKMfOsmB AgMPcjR1eyeeHWfjk4uYRorqfGccgvTq7nkSsnfQ1abgt5hOtpn2bMZqw7GHe9w3JO XjPeOs4OD8feLSkFgXOmNmQO58zOYvp1eIUXCl+o= Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2KJkKTHhdN-1wqqGl6I; Thu, 09 Aug 2018 19:01:59 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533830519; bh=RTG9QSyaX+jlKqKYVoVsxvSi6UvtFJ3Wquv8NfpZCos=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=CtOucxA0ViYSIqQja11DgQWAwlfdUiGVwwCOCjFZtZlvmWDv8qGh3LIEWCKMfOsmB AgMPcjR1eyeeHWfjk4uYRorqfGccgvTq7nkSsnfQ1abgt5hOtpn2bMZqw7GHe9w3JO XjPeOs4OD8feLSkFgXOmNmQO58zOYvp1eIUXCl+o= Authentication-Results: smtp4p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Thu, 9 Aug 2018 19:01:35 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 16:02:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O Content-Type: multipart/mixed; boundary="UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> --UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 18:48, Rodney W. Grimes wrote: >>> This now means -q has 2 functions, silence most commands, >>> and silently ignore errors on delete. >>> >>> That is a poor implementation of syntax and options. >> >> I think it makes "delete" command to have the same behavior as describ= ed >> for commands in "-q" description: >=20 > Which is yet another bug in your commit, you did not update the > synopsis or the description of the -q flag to include your > change. Though oddly the synopsis does show delete -q, it > how ever does not show -q for any of the table commands. >=20 >> >> -q Be quiet when executing the add, nat, zero, resetlog or flush >> commands; (implies -f). > No mention of what it does on delete, does -q on delete imply -f? >=20 >> This is useful when updating rulesets by >> executing multiple ipfw commands in a script (e.g., >> ?sh?/etc/rc.firewall?), or by processing a file with many ipfw >> rules across a remote login session. It also stops a table add >> or delete from failing if the entry already exists or is not >> present. >=20 > That suggesting that -q is good for remote login session is > poor advice at best, you should redirect both standard and > error output to a file, depending on -q is just a loaded > gun waiting to go off. >=20 >> >> table add/delete commands had the same behavior, "nat" already noted i= n >> this list. What is the usage scenario do you use, where you need to fa= il >> on bad delete? >=20 > if [ ipfw delete ${1} ]; then > handle the missing rule > fi This is mostly unneeded operation, that we wanted to avoid. I.e. to be able run in bath mode: delete ${n} add ${n} ... > But more importantly you seem to be ignoring the aspect that > your overloading a "silent" option with a "ignore failure" > option. That is bad design. The description of the -q flag > is already 2x as long as it should be in a good design. I have a feeling you are watching each my commit and comment it :) I did not designed this behavior, at work we use another tool to work with rules and tables. I'm fine with reverting this change. Do you want to restore previous behavior? AFAIR, julian@ complains that ipfw(8) has some error states that should be removed. --=20 WBR, Andrey V. Elsukov --UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b-- --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsZV8ACgkQAcXqBBDI oXrR+wf+LF3YioMLJfoFxsxnopo1/8AG5QMiKtSAHO+zj/t0Kj0gKcIrFWtYcoNL QVqjYXTqGVmipGFFqK0julCyynvlKRw2LalbkFGxxbVGF4iH7sv1dt+IDTuVABB5 nbvj0CzrV86RMz7tTOxbheLlsK85oNSU6TDngztpKnApYRRO4ROi3BqkMZDxQ0xg bquRWp/cTAu6w+t0EY0nRiK7gW6iG9HpvYnGbS7MxMcccXNDarsCLfqaPKNC0Ycq AXLZsYOAFRaBLBlTpAVcETQghwMyrWk3oPhQ8aYL3edKNxOkExzb3N/tJZBoO0t+ 1oHLLcK0IMUyagw0mTNtyShwZ5EMqA== =JjSe -----END PGP SIGNATURE----- --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O-- From owner-svn-src-head@freebsd.org Thu Aug 9 16:03:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE29B106B367; Thu, 9 Aug 2018 16:03:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7827B6C1; Thu, 9 Aug 2018 16:03:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id e14-v6so961392itf.1; Thu, 09 Aug 2018 09:03:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=hWWdtXzGX0dUWaMW8dG+2iXtboIqDLlGgPP1YE+y9aU=; b=LiVQwGhnVxyf20FiVpo/Ze3ZZqHMzkti0Lsh7HxEpL+otpfXXb20XbdIj1VTFTNke6 MocJOtsZahTHqDiNJtQTJH5VDEVoi9xIGB8GFiH9BdPimtdX70pgaIovahlBcUHOHpuz jy5BmVB4eb8tMYsl5oGfK7592BFUP5x3aPPX1dy284t4VT0y2FUYvVmbdJySyhrcN57d t1qv6tIRVKqgN51N7zXC3JHr5ZjovERB4vLJkwcxsKpF9uzV3htuQRNcRH3RAYCDP+Q8 j3F9VrvCXn5RRv/S2LY+2G2bMXH1UOTN7KCWGN1Apn/sBDxPorR9wP4GaQq40u7Tm4Ib hGdw== X-Gm-Message-State: AOUpUlHHggUcB/D+LhxxpYf+qCJilZf/E7TYuvBeki+fsuUK+JYSMyXO CF32pdgFAKTTwPo0TwNwhj+voyFM X-Google-Smtp-Source: AA+uWPwhzDTVkCvXAjxLO0peIFlntWHqBTbfmZBGGs3MoO1hlbfRdkO1lZG1J7wyth8ryApVuD7JQg== X-Received: by 2002:a02:bb04:: with SMTP id y4-v6mr2467003jan.5.1533830583395; Thu, 09 Aug 2018 09:03:03 -0700 (PDT) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id w20-v6sm2102313iob.24.2018.08.09.09.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 09:03:03 -0700 (PDT) Received: by mail-it0-f45.google.com with SMTP id s7-v6so930782itb.4; Thu, 09 Aug 2018 09:03:03 -0700 (PDT) X-Received: by 2002:a24:be8f:: with SMTP id i137-v6mr2518969itf.61.1533830582911; Thu, 09 Aug 2018 09:03:02 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:7e0a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 09:03:02 -0700 (PDT) In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Conrad Meyer Date: Thu, 9 Aug 2018 09:03:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Benjamin Kaduk Cc: src-committers , 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.27 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, 09 Aug 2018 16:03:11 -0000 On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote: > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala > wrote: >> Use NULLs instead of casted zeroes, for consistency. > > It's probably helpful to note explicitly that these are not in arguments = to > varargs functions, I don't think it's helpful. > in which case the explicit cast is needed in order to produce a program t= hat > will have > correct behavior on all compliant compilers/systems. Here "compliant" means "minimally compliant to the C standard." Use of NULL in varargs is functionally correct on all FreeBSD systems. > (We do define NULL to > be a zero-with-cast, > but programs (Ones that care about portability to weird systems.) I don't think BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a strong = candidate for portability. > should not assume that NULL will be of pointer type -- "An > integer constant > expression with the value 0, or such an expression cast to type void *, i= s > called a null pointer constant".) Right. The problem only arises when both conditions are met: 1. The system's varargs representation is smaller than the pointer representation, and 2. The runtime headers do not defined NULL as a pointer-typed value. (3. The function being invoked is actually varargs?) Neither is true on FreeBSD and v7-style init is not a useful place to call for portability. All the best, Conrad From owner-svn-src-head@freebsd.org Thu Aug 9 16:19:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA462106B8D6; Thu, 9 Aug 2018 16:19:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1477BFE8; Thu, 9 Aug 2018 16:19:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79GJ9Dk018294; Thu, 9 Aug 2018 09:19:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79GJ9lp018293; Thu, 9 Aug 2018 09:19:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 09:19:09 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 16:19:12 -0000 > On 09.08.2018 18:48, Rodney W. Grimes wrote: > >>> This now means -q has 2 functions, silence most commands, > >>> and silently ignore errors on delete. > >>> > >>> That is a poor implementation of syntax and options. > >> > >> I think it makes "delete" command to have the same behavior as described > >> for commands in "-q" description: > > > > Which is yet another bug in your commit, you did not update the > > synopsis or the description of the -q flag to include your > > change. Though oddly the synopsis does show delete -q, it > > how ever does not show -q for any of the table commands. > > > >> > >> -q Be quiet when executing the add, nat, zero, resetlog or flush > >> commands; (implies -f). > > No mention of what it does on delete, does -q on delete imply -f? > > > >> This is useful when updating rulesets by > >> executing multiple ipfw commands in a script (e.g., > >> ?sh?/etc/rc.firewall?), or by processing a file with many ipfw > >> rules across a remote login session. It also stops a table add > >> or delete from failing if the entry already exists or is not > >> present. > > > > That suggesting that -q is good for remote login session is > > poor advice at best, you should redirect both standard and > > error output to a file, depending on -q is just a loaded > > gun waiting to go off. > > > >> > >> table add/delete commands had the same behavior, "nat" already noted in > >> this list. What is the usage scenario do you use, where you need to fail > >> on bad delete? > > > > if [ ipfw delete ${1} ]; then > > handle the missing rule > > fi > > This is mostly unneeded operation, that we wanted to avoid. > I.e. to be able run in bath mode: > > delete ${n} > add ${n} ... That is one use case, but any shell script worth writting is worth writting to handle error conditions, and not being able to handle errors while being silent is a PITA. Though you didnt add to the already bad state of ipfw, this certainly did not do anything that I would consider improving that bad state. > > > But more importantly you seem to be ignoring the aspect that > > your overloading a "silent" option with a "ignore failure" > > option. That is bad design. The description of the -q flag > > is already 2x as long as it should be in a good design. > > I have a feeling you are watching each my commit and comment it :) I watch every commit by everyone, and comment when I see a reason to comment. I do not play any favors or dis favors in that respect. If you feel I am unjustly critizing you for some reason your mistaken. > I did not designed this behavior, at work we use another tool to work > with rules and tables. I'm fine with reverting this change. Do you want > to restore previous behavior? I am not asking for a revert, or at least a total revert, there is atleast a few issues here that do need some fixing. Like that fact that "ipfw delete 1" vs "ipfw -q delete 1" do the exact same thing, and per the man page (arguable interpretation) the second one should be silent: (This is an 11.1 system:) root@x230a:/etc # ipfw add 1 count ip from any to any 00001 count ip from any to any root@x230a:/etc # ipfw delete 1 root@x230a:/etc # ipfw add 1 count ip from any to any 00001 count ip from any to any root@x230a:/etc # ipfw -q delete 1 root@x230a:/etc # ipfw delete 1 ipfw: rule 1 not found root@x230a:/etc # ipfw -q delete 1 ipfw: rule 1 not found I would like to see the "do not return error" part of this change removed though. That is actually changing existing behavior. > AFAIR, julian@ complains that ipfw(8) has some error states that should > be removed. Yes, I recall that email. And yes there are probably error states that should be removed, but IMHO it is almost always a mistake to have the same option to a command do both silence and ignore error, that just leads to a lot of 1>/dev/null 2>&1 in shell scripts. Though one could also argue that there should be no silencing options to commands as all commands can be silenced by use of redirection :-) Typing ipfw -q FOO is only slightly shorter than typing ipfw FOO >&/dev/null (csh users). -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 16:35:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A949F106C057; Thu, 9 Aug 2018 16:35:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16CFF7CBC5; Thu, 9 Aug 2018 16:35:17 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 5E8014087900; Thu, 9 Aug 2018 19:35:15 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0ZaAM3n9Ng-ZFG05sdw; Thu, 09 Aug 2018 19:35:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533832515; bh=VrtmfHs6NY2E+m3NLt3ZA6v1/ZHt8fdh1UtTjpwqsvg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=adTAA3xLyk5XJSQzeboyPuwKfcFeBpKdnRIer/KFNcvDuW6xEFAMxhXQaaVi3U1mb BVg72bqUsUoRrkbKgfqVfXmxceK69wd0mnB4ZgjiGYK8szaR4XLYAjttMpwL3g1a7U c/+4jW2f/MxtYo3PxwlM/PIki4Nk3cziSoVtMwao= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XJ7HBwl7kI-ZEPiX9Ll; Thu, 09 Aug 2018 19:35:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533832514; bh=VrtmfHs6NY2E+m3NLt3ZA6v1/ZHt8fdh1UtTjpwqsvg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=JN8Yooi5qfxjPKRFl1Dg23uVIEsRZ3jCMgOiKmGZAiltBBCkSoXiatuJHl3CAeDd/ wHUKXuAsIXUdg2pruyY7d2sF53I7YDIfL7gU+gjVS8p543Nj0vjMqfNH6OjXhU8hVn jgGe0U5TMFkFDeJB5obRAErWMHDr9oAhNYEWOsUQ= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> Date: Thu, 9 Aug 2018 19:34:47 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 16:35:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc Content-Type: multipart/mixed; boundary="ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> --ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 19:19, Rodney W. Grimes wrote: >>>> table add/delete commands had the same behavior, "nat" already noted= in >>>> this list. What is the usage scenario do you use, where you need to = fail >>>> on bad delete? >>> >>> if [ ipfw delete ${1} ]; then >>> handle the missing rule >>> fi >> >> This is mostly unneeded operation, that we wanted to avoid. >> I.e. to be able run in bath mode: >> >> delete ${n} >> add ${n} ... >=20 > That is one use case, but any shell script worth writting > is worth writting to handle error conditions, and not being > able to handle errors while being silent is a PITA. Ok, I still don't understand the usefulness of knowing the error code of delete command. But, I can propose the following solution: Index: ipfw2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ipfw2.c (revision 337541) +++ ipfw2.c (working copy) @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval !=3D EX_OK && co.do_quiet =3D=3D 0) + if (exitval !=3D EX_OK && co.do_force =3D=3D 0) exit(exitval); } With this patch -q will work as "quiet", -f will work as "force". So, you can still get error code in shell script, and I can run batched commands with -q -f: # ipfw -f delete 10000-11000 ; echo $? ipfw: no rules rules in 10000-11000 range 0 # ipfw -qf delete 10000-11000 ; echo $? 0 # ipfw -q delete 10000-11000 ; echo $? 69 Are you fine with this? --=20 WBR, Andrey V. Elsukov --ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2-- --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsbScACgkQAcXqBBDI oXqBkwf+O4mBg6wo0VC19fS4aIfej3CwSJ7i82sxmb9kaf5jGTwX5qudvEwb8dz5 bHeFq4eTNw3feECgtAaPaFIi6eKZwuuK+oL0w/dvssDUIiak4RYMVG4slkI5HgiQ qTaZTD8otIJFexKW+AKd5SpB0IsGN2zAdAJXXBpVCuFlpi3Bkpu1yo3DRs5vRBGF S8gFM/rndmTQrzbPPug/MHt7QWhzTcapoxTmuCKJqjumhNqFdbYACLfyQdtNxhLG evFWC2UE7GiQbEYvXjmghJ15J9LI1ozyYDeGxQI6LG+yMgoHc6C5oZs1VK3Nk46Q mR57mCnBuX7HXWdeTpDBv/t0agOnHQ== =Ogot -----END PGP SIGNATURE----- --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc-- From owner-svn-src-head@freebsd.org Thu Aug 9 16:42:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20979106C3DE; Thu, 9 Aug 2018 16:42:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA87C7D0FB; Thu, 9 Aug 2018 16:42:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD24E1C083; Thu, 9 Aug 2018 16:42:13 +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 w79GgDkU039903; Thu, 9 Aug 2018 16:42:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79GgDCC039902; Thu, 9 Aug 2018 16:42:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808091642.w79GgDCC039902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 Aug 2018 16:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337543 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337543 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 16:42:14 -0000 Author: jhb Date: Thu Aug 9 16:42:13 2018 New Revision: 337543 URL: https://svnweb.freebsd.org/changeset/base/337543 Log: Correct default path of kernel modules. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Aug 9 15:35:48 2018 (r337542) +++ head/share/mk/bsd.own.mk Thu Aug 9 16:42:13 2018 (r337543) @@ -47,7 +47,7 @@ # # # KMODDIR Base path for loadable kernel modules -# (see kld(4)). [/boot/module] +# (see kld(4)). [/boot/modules] # # KMODOWN Kernel and KLD owner. [${BINOWN}] # From owner-svn-src-head@freebsd.org Thu Aug 9 16:49:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F16106C664; Thu, 9 Aug 2018 16:49:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A85B67D555; Thu, 9 Aug 2018 16:49:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Gni0G018409; Thu, 9 Aug 2018 09:49:44 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79GniZf018408; Thu, 9 Aug 2018 09:49:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 09:49:44 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 16:49:53 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 09.08.2018 19:19, Rodney W. Grimes wrote: > >>>> table add/delete commands had the same behavior, "nat" already noted in > >>>> this list. What is the usage scenario do you use, where you need to fail > >>>> on bad delete? > >>> > >>> if [ ipfw delete ${1} ]; then > >>> handle the missing rule > >>> fi > >> > >> This is mostly unneeded operation, that we wanted to avoid. > >> I.e. to be able run in bath mode: > >> > >> delete ${n} > >> add ${n} ... > > > > That is one use case, but any shell script worth writting > > is worth writting to handle error conditions, and not being > > able to handle errors while being silent is a PITA. > > Ok, I still don't understand the usefulness of knowing the error > code of delete command. But, I can propose the following solution: > Index: ipfw2.c > =================================================================== > --- ipfw2.c (revision 337541) > +++ ipfw2.c (working copy) > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > } > } > } > - if (exitval != EX_OK && co.do_quiet == 0) > + if (exitval != EX_OK && co.do_force == 0) > exit(exitval); > } > > > With this patch -q will work as "quiet", -f will work as "force". > So, you can still get error code in shell script, and I can run batched > commands with -q -f: > > # ipfw -f delete 10000-11000 ; echo $? > ipfw: no rules rules in 10000-11000 range > 0 > # ipfw -qf delete 10000-11000 ; echo $? > 0 > # ipfw -q delete 10000-11000 ; echo $? > 69 > > Are you fine with this? In spirit yes, in implementation No: The -f option is documented, and actually does, something different than what your change would implement. -f Do not ask for confirmation for commands that can cause problems if misused, i.e., flush. If there is no tty associated with the process, this is implied. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 16:56:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AADE3106C9F1 for ; Thu, 9 Aug 2018 16:56:17 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3377DB89 for ; Thu, 9 Aug 2018 16:56:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 20249bc6-9bf5-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 20249bc6-9bf5-11e8-93fa-f3ebd9db2b94; Thu, 09 Aug 2018 16:56:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79GuEq8059156; Thu, 9 Aug 2018 10:56:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533833774.9860.116.camel@freebsd.org> Subject: Re: svn commit: r337536 - head/sbin/ipfw From: Ian Lepore To: rgrimes@freebsd.org, "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 10:56:14 -0600 In-Reply-To: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> References: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 16:56:17 -0000 On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > -- Start of PGP signed section. > [ Charset UTF-8 unsupported, converting... ] > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > already noted in > > > > > > this list. What is the usage scenario do you use, where you > > > > > > need to fail > > > > > > on bad delete? > > > > > if [ ipfw delete ${1} ]; then > > > > > handle the missing rule > > > > > fi > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > I.e. to be able run in bath mode: > > > > > > > > delete ${n} > > > > add ${n} ... > > > That is one use case, but any shell script worth writting > > > is worth writting to handle error conditions, and not being > > > able to handle errors while being silent is a PITA. > > Ok, I still don't understand the usefulness of knowing the error > > code of delete command. But, I can propose the following solution: > > Index: ipfw2.c > > =================================================================== > > --- ipfw2.c (revision 337541) > > +++ ipfw2.c (working copy) > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > >   } > >   } > >   } > > - if (exitval != EX_OK && co.do_quiet == 0) > > + if (exitval != EX_OK && co.do_force == 0) > >   exit(exitval); > >  } > > > > > > With this patch -q will work as "quiet", -f will work as "force". > > So, you can still get error code in shell script, and I can run > > batched > > commands with -q -f: > > > > # ipfw -f delete 10000-11000 ; echo $? > > ipfw: no rules rules in 10000-11000 range > > 0 > > # ipfw -qf delete 10000-11000 ; echo $? > > 0 > > # ipfw -q delete 10000-11000 ; echo $? > > 69 > > > > Are you fine with this? > In spirit yes, in implementation No: > > The -f option is documented, and actually does, something different > than what your change would implement. > >      -f      Do not ask for confirmation for commands that can cause > problems >              if misused, i.e., flush.  If there is no tty associated > with the >              process, this is implied. > > > > What he proposes is pretty much the exact behavior of rm -f, and should be intuitively obvious to anyone familiar with common unix commands. -- Ian From owner-svn-src-head@freebsd.org Thu Aug 9 17:01:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5881C106D023; Thu, 9 Aug 2018 17:01:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7EDF7E115; Thu, 9 Aug 2018 17:01:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79H1mew018528; Thu, 9 Aug 2018 10:01:48 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79H1mgh018527; Thu, 9 Aug 2018 10:01:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <1533833774.9860.116.camel@freebsd.org> To: Ian Lepore Date: Thu, 9 Aug 2018 10:01:48 -0700 (PDT) CC: rgrimes@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 17:01:51 -0000 > On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > > -- Start of PGP signed section. > > [ Charset UTF-8 unsupported, converting... ] > > > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > > already noted in > > > > > > > this list. What is the usage scenario do you use, where you > > > > > > > need to fail > > > > > > > on bad delete? > > > > > > if [ ipfw delete ${1} ]; then > > > > > > handle the missing rule > > > > > > fi > > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > > I.e. to be able run in bath mode: > > > > > > > > > > delete ${n} > > > > > add ${n} ... > > > > That is one use case, but any shell script worth writting > > > > is worth writting to handle error conditions, and not being > > > > able to handle errors while being silent is a PITA. > > > Ok, I still don't understand the usefulness of knowing the error > > > code of delete command. But, I can propose the following solution: > > > Index: ipfw2.c > > > =================================================================== > > > --- ipfw2.c (revision 337541) > > > +++ ipfw2.c (working copy) > > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > > > ? } > > > ? } > > > ? } > > > - if (exitval != EX_OK && co.do_quiet == 0) > > > + if (exitval != EX_OK && co.do_force == 0) > > > ? exit(exitval); > > > ?} > > > > > > > > > With this patch -q will work as "quiet", -f will work as "force". > > > So, you can still get error code in shell script, and I can run > > > batched > > > commands with -q -f: > > > > > > # ipfw -f delete 10000-11000 ; echo $? > > > ipfw: no rules rules in 10000-11000 range > > > 0 > > > # ipfw -qf delete 10000-11000 ; echo $? > > > 0 > > > # ipfw -q delete 10000-11000 ; echo $? > > > 69 > > > > > > Are you fine with this? > > In spirit yes, in implementation No: > > > > The -f option is documented, and actually does, something different > > than what your change would implement. > > > > ?????-f??????Do not ask for confirmation for commands that can cause > > problems > > ?????????????if misused, i.e., flush.??If there is no tty associated > > with the > > ?????????????process, this is implied. > > > > > > > > > > What he proposes is pretty much the exact behavior of rm -f, and should > be intuitively obvious to anyone familiar with common unix commands. And saddly that someone choose to use -f differently in ipfw, just because it is intuatively obvious it is in direct conflict with both the man page and the implemented code. This would just be another overloading of an option to do 2 different things on 2 different sub commands. Are you really advocating going down that slipperly slope? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 17:15:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8245C106D556 for ; Thu, 9 Aug 2018 17:15:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0721C7EA53 for ; Thu, 9 Aug 2018 17:15:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c349fc38-9bf7-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id c349fc38-9bf7-11e8-aff6-0b9b8210da61; Thu, 09 Aug 2018 17:15:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79HF6tu059207; Thu, 9 Aug 2018 11:15:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533834906.9860.118.camel@freebsd.org> Subject: Re: svn commit: r337536 - head/sbin/ipfw From: Ian Lepore To: rgrimes@freebsd.org Cc: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 11:15:06 -0600 In-Reply-To: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> References: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 17:15:19 -0000 On Thu, 2018-08-09 at 10:01 -0700, Rodney W. Grimes wrote: > > > > On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > > > > > > -- Start of PGP signed section. > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > > > already noted in > > > > > > > > this list. What is the usage scenario do you use, where > > > > > > > > you > > > > > > > > need to fail > > > > > > > > on bad delete? > > > > > > > if [ ipfw delete ${1} ]; then > > > > > > > handle the missing rule > > > > > > > fi > > > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > > > I.e. to be able run in bath mode: > > > > > > > > > > > > delete ${n} > > > > > > add ${n} ... > > > > > That is one use case, but any shell script worth writting > > > > > is worth writting to handle error conditions, and not being > > > > > able to handle errors while being silent is a PITA. > > > > Ok, I still don't understand the usefulness of knowing the > > > > error > > > > code of delete command. But, I can propose the following > > > > solution: > > > > Index: ipfw2.c > > > > =============================================================== > > > > ==== > > > > --- ipfw2.c (revision 337541) > > > > +++ ipfw2.c (working copy) > > > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > > > > ? } > > > > ? } > > > > ? } > > > > - if (exitval != EX_OK && co.do_quiet == 0) > > > > + if (exitval != EX_OK && co.do_force == 0) > > > > ? exit(exitval); > > > > ?} > > > > > > > > > > > > With this patch -q will work as "quiet", -f will work as > > > > "force". > > > > So, you can still get error code in shell script, and I can run > > > > batched > > > > commands with -q -f: > > > > > > > > # ipfw -f delete 10000-11000 ; echo $? > > > > ipfw: no rules rules in 10000-11000 range > > > > 0 > > > > # ipfw -qf delete 10000-11000 ; echo $? > > > > 0 > > > > # ipfw -q delete 10000-11000 ; echo $? > > > > 69 > > > > > > > > Are you fine with this? > > > In spirit yes, in implementation No: > > > > > > The -f option is documented, and actually does, something > > > different > > > than what your change would implement. > > > > > > ?????-f??????Do not ask for confirmation for commands that can > > > cause > > > problems > > > ?????????????if misused, i.e., flush.??If there is no tty > > > associated > > > with the > > > ?????????????process, this is implied. > > > > > > > > > > > > > > What he proposes is pretty much the exact behavior of rm -f, and > > should > > be intuitively obvious to anyone familiar with common unix > > commands. > And saddly that someone choose to use -f differently in ipfw, just > because it is intuatively obvious it is in direct conflict with  > both the man page and the implemented code.  This would just be > another overloading of an option to do 2 different things on 2 > different sub commands.  Are you really advocating going down that > slipperly slope? > > Am I advocating for the ability to optionally silently not-fail on an attempt to delete something that doesn't exist, using the exact same syntax for that behavior as the standard rm(1) command uses? Why, yes.  Yes I am. -- Ian From owner-svn-src-head@freebsd.org Thu Aug 9 17:28:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD91106DA50; Thu, 9 Aug 2018 17:28:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5j.cmail.yandex.net (forward5j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B707F661; Thu, 9 Aug 2018 17:28:58 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id 1D0EA21881; Thu, 9 Aug 2018 20:28:48 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QPloHc9SU4-SlXeDEL2; Thu, 09 Aug 2018 20:28:47 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533835727; bh=XWFk9lLyzJ8XuWCDVJy26zUKexfcGzsbHrAFsmm8fqQ=; h=From:To:Cc:In-Reply-To:References:Subject:Date:Message-Id; b=EKaXhb2COf4WiIewEmXfngKvgorsfWWaVRB4UfmE+JN3KLCexKKX1xCRdMzCYG9jU UbVqOqQ/wKLQIkT7Jt+PZiGLadJkAqiFZN4ES9L+MYUiY3gwM/2tC2+tF5R0F85STz uUAOrtp1XUt18owc2Q/AsGgx7keQV22kXxWuB2tY= Authentication-Results: mxback1o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas1-dc4267721c1f.qloud-c.yandex.net with HTTP; Thu, 09 Aug 2018 20:28:47 +0300 From: Andrey V. Elsukov To: "rgrimes@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> References: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 09 Aug 2018 20:28:47 +0300 Message-Id: <4860211533835727@sas1-dc4267721c1f.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 17:28:59 -0000 From owner-svn-src-head@freebsd.org Thu Aug 9 17:32:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E76F106DCBB; Thu, 9 Aug 2018 17:32:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFD5C7FAD6; Thu, 9 Aug 2018 17:32:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79HWAjN018695; Thu, 9 Aug 2018 10:32:10 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79HWAU1018694; Thu, 9 Aug 2018 10:32:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <4860211533835727@sas1-dc4267721c1f.qloud-c.yandex.net> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 10:32:10 -0700 (PDT) CC: "rgrimes@freebsd.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UNKNOWN-8BIT X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 17:32:13 -0000 [ text/html is unsupported, treating like TEXT/PLAIN ] Can you resend in none html format please? >

19:50, 9 =D0=B0=D0=B2=D0=B3=D1=83=D1=81=D1=82=D0=B0 2018 =D0= =B3., "Rodney W. Grimes" <freebsd@pdx.rh.cn85.dnsmgr.net>:

-- Start of PGP signed section.
[ Charset UTF-8 unsupported,= converting... ]

=C2=A0On 09.08.2018 19:19, R= odney W. Grimes wrote:
=C2=A0>>>> table add/delete command= s had the same behavior, "nat" already noted in
=C2=A0>>>>= this list. What is the usage scenario do you use, where you need to fail=C2=A0>>>> on bad delete?=
=C2=A0>>>
=C2=A0>>> if [ ipfw delete ${1} ]; t= hen
=C2=A0>>> handle the missing rule
=C2=A0>>>= ; fi
=C2=A0>>
=C2=A0>> This is mostly unneeded operat= ion, that we wanted to avoid.
=C2=A0>> I.e. to= be able run in bath mode:
=C2=A0>>
=C2=A0>> delete $= {n}
=C2=A0>> add ${n} ...
=C2=A0>
=C2=A0> That = is one use case, but any shell script worth writting
=C2=A0> is wor= th writting to handle error conditions, and not being=
=C2=A0> able to handle errors while being silent is a PITA.
<= br />=C2=A0Ok, I still don't understand the usefulness of knowing the error=
=C2=A0code of delete command. But, I can propose the following soluti= on:
=C2=A0Index: ipfw2.c
=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0--- ipfw2.c (revision 337541)
= =C2=A0+++ ipfw2.c (working copy)
=C2=A0@@ -3314,7 +3314,7 @@ ipfw_dele= te(char *av[])
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0}
=C2=A0- if (exitval !=3D EX_OK && co.do_quiet =3D= =3D 0)
=C2=A0+ if (exitval !=3D EX_OK && co.do_force =3D=3D 0)=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0exit(exitval);
=C2=A0=C2=A0}

=C2=A0With this patch -q will work as "quiet", -f will work as "forc= e".
=C2=A0So, you can still get error code in shell script, and I can = run batched
=C2=A0commands with -q -f:

=C2=A0# ipfw -f dele= te 10000-11000 ; echo $?
=C2=A0= ipfw: no rules rules in 10000-11000 range
=C2=A00
= =C2=A0# ipfw -qf delete 10000-11000 ; echo $?
=C2=A00
=C2=A0# ipfw -q delete 10000-11000 ; echo $?
=C2=A069
=C2=A0Are you fine with this?

In spirit yes, in implementation No:

The -f option is docu= mented, and actually does, something different
than what your change w= ould implement.

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0-f Do not ask= for confirmation for commands that can cause pro= blems
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0if misused, i.e., flush. If there is no tty associated with= the
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0process, this is implied.

But this opt= ion means "force", with -f ipfw(8) will not ask any questions= and forcebly execute the command. The description in man page can be modif= ied to correctly describe the case.=C2=A0

=D0=9E=D1=82=D0=BF=D1= =80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE =D0=B8=D0=B7 =D0=BC=D0=BE=D0=B1=D0= =B8=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9 =D0=AF=D0=BD=D0=B4=D0=B5=D0=BA=D1=81.=D0= =9F=D0=BE=D1=87=D1=82=D1=8B: http://m.ya.ru/ymail --=20 Rod Grimes rgrimes@freebsd.= org From owner-svn-src-head@freebsd.org Thu Aug 9 17:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429D6106E14C; Thu, 9 Aug 2018 17:42:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB288021C; Thu, 9 Aug 2018 17:42:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D04C01CA33; Thu, 9 Aug 2018 17:42:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HgSWZ070877; Thu, 9 Aug 2018 17:42:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79HgSXq070874; Thu, 9 Aug 2018 17:42:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091742.w79HgSXq070874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337544 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 337544 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 17:42:29 -0000 Author: kevans Date: Thu Aug 9 17:42:27 2018 New Revision: 337544 URL: https://svnweb.freebsd.org/changeset/base/337544 Log: msgbuf: Light detailing (const'ify and bool'itize) Modified: head/sys/kern/subr_msgbuf.c head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_msgbuf.c ============================================================================== --- head/sys/kern/subr_msgbuf.c Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/kern/subr_msgbuf.c Thu Aug 9 17:42:27 2018 (r337544) @@ -181,7 +181,7 @@ msgbuf_addchar(struct msgbuf *mbp, int c) * carriage returns down this path. So do we still need it? */ void -msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr) +msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr) { u_int seq; size_t len, prefix_len; Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:42:27 2018 (r337544) @@ -120,7 +120,7 @@ static void putchar(int ch, void *arg); static char *ksprintn(char *nbuf, uintmax_t num, int base, int *len, int upper); static void snprintf_func(int ch, void *arg); -static int msgbufmapped; /* Set when safe to use msgbuf */ +static bool msgbufmapped; /* Set when safe to use msgbuf */ int msgbuftrigger; struct msgbuf *msgbufp; @@ -1030,7 +1030,7 @@ msgbufinit(void *ptr, int size) msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); - msgbufmapped = 1; + msgbufmapped = true; oldp = msgbufp; } Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/sys/msgbuf.h Thu Aug 9 17:42:27 2018 (r337544) @@ -71,7 +71,7 @@ extern struct mtx msgbuf_lock; void msgbufinit(void *ptr, int size); void msgbuf_addchar(struct msgbuf *mbp, int c); -void msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr); +void msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr); void msgbuf_clear(struct msgbuf *mbp); void msgbuf_copy(struct msgbuf *src, struct msgbuf *dst); int msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen); From owner-svn-src-head@freebsd.org Thu Aug 9 17:47:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F22D6106E2AE; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F5C80449; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60AE61CA3B; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HlmUd071160; Thu, 9 Aug 2018 17:47:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79Hlldv071157; Thu, 9 Aug 2018 17:47:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091747.w79Hlldv071157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337545 - in head/sys: conf kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: conf kern sys X-SVN-Commit-Revision: 337545 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 17:47:49 -0000 Author: kevans Date: Thu Aug 9 17:47:47 2018 New Revision: 337545 URL: https://svnweb.freebsd.org/changeset/base/337545 Log: BOOT_TAG: Make a config(5) option, expose as sysctl and loader tunable BOOT_TAG lived shortly in sys/msgbuf.h, but this wasn't necessarily great for changing it or removing it. Move it into subr_prf.c and add options for it to opt_printf.h. One can specify both the BOOT_TAG and BOOT_TAG_SZ (really, size of the buffer that holds the BOOT_TAG). We expose it as kern.boot_tag and also add a loader tunable by the same name that we'll fetch upon initialization of the msgbuf. This allows for flexibility and also ensures that there's a consistent way to figure out the boot tag of the running kernel, rather than relying on headers to be in-sync. Prodded super-super-lightly by: imp Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/conf/NOTES Thu Aug 9 17:47:47 2018 (r337545) @@ -145,6 +145,16 @@ options INCLUDE_CONFIG_FILE # Include this file i options BOOTVERBOSE=1 options BOOTHOWTO=RB_MULTIPLE +# +# Compile-time defaults for dmesg boot tagging +# +# Default boot tag; may use 'kern.boot_tag' loader tunable to override. The +# current boot's tag is also exposed via the 'kern.boot_tag' sysctl. +options BOOT_TAG=\"---<>---\" +# Maximum boot tag size the kernel's static buffer should accomodate. Maximum +# size for both BOOT_TAG and the assocated tunable. +options BOOT_TAG_SZ=32 + options GEOM_BDE # Disk encryption. options GEOM_BSD # BSD disklabels (obsolete, gone in 12) options GEOM_CACHE # Disk cache. Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/conf/options Thu Aug 9 17:47:47 2018 (r337545) @@ -811,6 +811,8 @@ TERMINAL_NORM_ATTR opt_teken.h # options for printf PRINTF_BUFR_SIZE opt_printf.h +BOOT_TAG opt_printf.h +BOOT_TAG_SZ opt_printf.h # kbd options KBD_DISABLE_KEYMAP_LOAD opt_kbd.h Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:47:47 2018 (r337545) @@ -124,6 +124,18 @@ static bool msgbufmapped; /* Set when safe to use msg int msgbuftrigger; struct msgbuf *msgbufp; +#ifndef BOOT_TAG_SZ +#define BOOT_TAG_SZ 32 +#endif +#ifndef BOOT_TAG +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<>---" +#endif + +static char current_boot_tag[BOOT_TAG_SZ + 1] = BOOT_TAG; +SYSCTL_STRING(_kern, OID_AUTO, boot_tag, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + current_boot_tag, 0, "Tag added to dmesg at start of boot"); + static int log_console_output = 1; SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RWTUN, &log_console_output, 0, "Duplicate console output to the syslog"); @@ -1025,9 +1037,13 @@ msgbufinit(void *ptr, int size) size -= sizeof(*msgbufp); cp = (char *)ptr; + /* Attempt to fetch kern.boot_tag tunable on first mapping */ + if (!msgbufmapped) + TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, + BOOT_TAG_SZ + 1); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); + msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/sys/msgbuf.h Thu Aug 9 17:47:47 2018 (r337545) @@ -60,9 +60,6 @@ struct msgbuf { /* Subtract sequence numbers. Note that only positive values result. */ #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) -/* Tag used to mark the start of a boot in dmesg */ -#define BOOT_TAG "---<>---" - #ifdef _KERNEL extern int msgbufsize; extern int msgbuftrigger; From owner-svn-src-head@freebsd.org Thu Aug 9 17:53:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4A1106E621; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60640809D6; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 412EB1CBCB; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HrJja076269; Thu, 9 Aug 2018 17:53:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79HrJsY076268; Thu, 9 Aug 2018 17:53:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091753.w79HrJsY076268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337546 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337546 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 17:53:19 -0000 Author: kevans Date: Thu Aug 9 17:53:18 2018 New Revision: 337546 URL: https://svnweb.freebsd.org/changeset/base/337546 Log: subr_prf: Use "sizeof current_boot_tag" instead Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 17:47:47 2018 (r337545) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:53:18 2018 (r337546) @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, - BOOT_TAG_SZ + 1); + sizeof current_boot_tag); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); From owner-svn-src-head@freebsd.org Thu Aug 9 18:09:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F0C106EB34 for ; Thu, 9 Aug 2018 18:09:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC54C8114F for ; Thu, 9 Aug 2018 18:09:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 62ed1730-9bff-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 62ed1730-9bff-11e8-93fa-f3ebd9db2b94; Thu, 09 Aug 2018 18:09:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79I9fbf059308; Thu, 9 Aug 2018 12:09:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533838181.9860.119.camel@freebsd.org> Subject: Re: svn commit: r337546 - head/sys/kern From: Ian Lepore To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 12:09:41 -0600 In-Reply-To: <201808091753.w79HrJsY076268@repo.freebsd.org> References: <201808091753.w79HrJsY076268@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 18:09:45 -0000 On Thu, 2018-08-09 at 17:53 +0000, Kyle Evans wrote: > Author: kevans > Date: Thu Aug  9 17:53:18 2018 > New Revision: 337546 > URL: https://svnweb.freebsd.org/changeset/base/337546 > > Log: >   subr_prf: Use "sizeof current_boot_tag" instead > > Modified: >   head/sys/kern/subr_prf.c > > Modified: head/sys/kern/subr_prf.c > ===================================================================== > ========= > --- head/sys/kern/subr_prf.c Thu Aug  9 17:47:47 2018 ( > r337545) > +++ head/sys/kern/subr_prf.c Thu Aug  9 17:53:18 2018 ( > r337546) > @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) >   /* Attempt to fetch kern.boot_tag tunable on first mapping > */ >   if (!msgbufmapped) >   TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, > -     BOOT_TAG_SZ + 1); > +     sizeof current_boot_tag); Style(9) mandates parens with sizeof. -- Ian >   msgbufp = (struct msgbuf *)(cp + size); >   msgbuf_reinit(msgbufp, cp, size); >   msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); > From owner-svn-src-head@freebsd.org Thu Aug 9 18:25:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D3FA106F4BC; Thu, 9 Aug 2018 18:25:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D553281D38; Thu, 9 Aug 2018 18:25:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 962F11D0AC; Thu, 9 Aug 2018 18:25:49 +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 w79IPnED091528; Thu, 9 Aug 2018 18:25:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79IPnLo091527; Thu, 9 Aug 2018 18:25:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808091825.w79IPnLo091527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Aug 2018 18:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337547 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 337547 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 18:25:50 -0000 Author: markj Date: Thu Aug 9 18:25:49 2018 New Revision: 337547 URL: https://svnweb.freebsd.org/changeset/base/337547 Log: Account for the lowmem handlers in the inactive queue scan target. Before r329882 the target would be computed after lowmem handlers run and free pages. On some systems a significant amount of page reclamation happens this way. However, with r329882 the target is computed first, which can lead to unnecessary reclamation from the page cache, and this in turn may result in excessive swapping. Instead, adjust the target after running lowmem handlers. Don't invoke the lowmem handlers before the PID controller, though, since that would hide the true rate of page allocation. Reviewed by: alc, kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16606 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Aug 9 17:53:18 2018 (r337546) +++ head/sys/vm/vm_pageout.c Thu Aug 9 18:25:49 2018 (r337547) @@ -152,7 +152,6 @@ static int vm_pageout_oom_seq = 12; static int vm_pageout_update_period; static int disable_swap_pageouts; static int lowmem_period = 10; -static time_t lowmem_uptime; static int swapdev_enabled; static int vm_panic_on_oom = 0; @@ -1856,12 +1855,17 @@ vm_pageout_oom(int shortage) } } -static void -vm_pageout_lowmem(struct vm_domain *vmd) +static bool +vm_pageout_lowmem(void) { + static int lowmem_ticks = 0; + int last; - if (vmd == VM_DOMAIN(0) && - time_uptime - lowmem_uptime >= lowmem_period) { + last = atomic_load_int(&lowmem_ticks); + while ((u_int)(ticks - last) / hz >= lowmem_period) { + if (atomic_fcmpset_int(&lowmem_ticks, &last, ticks) == 0) + continue; + /* * Decrease registered cache sizes. */ @@ -1873,14 +1877,16 @@ vm_pageout_lowmem(struct vm_domain *vmd) * drained above. */ uma_reclaim(); - lowmem_uptime = time_uptime; + return (true); } + return (false); } static void vm_pageout_worker(void *arg) { struct vm_domain *vmd; + u_int ofree; int addl_shortage, domain, shortage; bool target_met; @@ -1939,11 +1945,16 @@ vm_pageout_worker(void *arg) /* * Use the controller to calculate how many pages to free in - * this interval, and scan the inactive queue. + * this interval, and scan the inactive queue. If the lowmem + * handlers appear to have freed up some pages, subtract the + * difference from the inactive queue scan target. */ shortage = pidctrl_daemon(&vmd->vmd_pid, vmd->vmd_free_count); if (shortage > 0) { - vm_pageout_lowmem(vmd); + ofree = vmd->vmd_free_count; + if (vm_pageout_lowmem() && vmd->vmd_free_count > ofree) + shortage -= min(vmd->vmd_free_count - ofree, + (u_int)shortage); target_met = vm_pageout_scan_inactive(vmd, shortage, &addl_shortage); } else From owner-svn-src-head@freebsd.org Thu Aug 9 19:09:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 598EE10704FB; Thu, 9 Aug 2018 19:09:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4728348A; Thu, 9 Aug 2018 19:09:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E12721D759; Thu, 9 Aug 2018 19:09:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79J96al012159; Thu, 9 Aug 2018 19:09:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79J96Tt012158; Thu, 9 Aug 2018 19:09:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091909.w79J96Tt012158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 19:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337548 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337548 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 19:09:07 -0000 Author: kevans Date: Thu Aug 9 19:09:06 2018 New Revision: 337548 URL: https://svnweb.freebsd.org/changeset/base/337548 Log: subr_prf: style(9) the sizeof Reported by: jkim, ian Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 18:25:49 2018 (r337547) +++ head/sys/kern/subr_prf.c Thu Aug 9 19:09:06 2018 (r337548) @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, - sizeof current_boot_tag); + sizeof(current_boot_tag)); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); From owner-svn-src-head@freebsd.org Thu Aug 9 20:29:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255571072A26; Thu, 9 Aug 2018 20:29:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C95CF86386; Thu, 9 Aug 2018 20:29:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A45ED1E4ED; Thu, 9 Aug 2018 20:29:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79KTigP052729; Thu, 9 Aug 2018 20:29:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79KTiCZ052728; Thu, 9 Aug 2018 20:29:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808092029.w79KTiCZ052728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 20:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337549 - head/lib/libnv X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libnv X-SVN-Commit-Revision: 337549 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 20:29:45 -0000 Author: kevans Date: Thu Aug 9 20:29:44 2018 New Revision: 337549 URL: https://svnweb.freebsd.org/changeset/base/337549 Log: libnv: Remove -I${SRCTOP}/sys This should have been done as part of r336019 -- including ${SRCTOP}/sys is not a good business model for something that's build in legacy/bootstrap stages. Beyond that, libnv seems to build quite alright as legacy, part of buildworld, and standalone without. Axe it. Reported by: truckman (head building stable/11) Tested by: Shawn Webb (HardenedBSD) MFC after: 3 days Modified: head/lib/libnv/Makefile Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Thu Aug 9 19:09:06 2018 (r337548) +++ head/lib/libnv/Makefile Thu Aug 9 20:29:44 2018 (r337549) @@ -9,7 +9,7 @@ LIB= nv SHLIB_MAJOR= 0 .PATH: ${SRCTOP}/sys/contrib/libnv ${SRCTOP}/sys/sys -CFLAGS+=-I${SRCTOP}/sys -I${.CURDIR} +CFLAGS+=-I${.CURDIR} SRCS= cnvlist.c SRCS+= dnvlist.c From owner-svn-src-head@freebsd.org Thu Aug 9 20:33:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826C31072E44; Thu, 9 Aug 2018 20:33:23 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA63C868AB; Thu, 9 Aug 2018 20:33:22 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 9B30B44BBE; Thu, 9 Aug 2018 23:33:19 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vFLJP9f8ry-XJ4GOmCv; Thu, 09 Aug 2018 23:33:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533846799; bh=LVWPDXUws4o92jvEXcd8T/5eRhm5zK3iejh2PP6KaNQ=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mCivni295kB004tsnO1jYwRx6BZXtKZgVyypwqp6PVJctl9H2KPsvMErBDFEyEk1D ygw/2qfxJsUUJNQ1Bovfgz0AuvsdiEJxsHF2Ii/HUN/6z0/S3wOyabnJsQP3VF0C+l gslntF7qPxYtBWb9glUtI7ZVX17gm06wp73oZCX4= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PxIMPL14IQ-XI5mIdVC; Thu, 09 Aug 2018 23:33:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533846799; bh=LVWPDXUws4o92jvEXcd8T/5eRhm5zK3iejh2PP6KaNQ=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mCivni295kB004tsnO1jYwRx6BZXtKZgVyypwqp6PVJctl9H2KPsvMErBDFEyEk1D ygw/2qfxJsUUJNQ1Bovfgz0AuvsdiEJxsHF2Ii/HUN/6z0/S3wOyabnJsQP3VF0C+l gslntF7qPxYtBWb9glUtI7ZVX17gm06wp73oZCX4= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <09dc8efe-7e68-1da6-6709-01b2af037f1e@yandex.ru> Date: Thu, 9 Aug 2018 23:32:49 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 20:33:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ Content-Type: multipart/mixed; boundary="HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <09dc8efe-7e68-1da6-6709-01b2af037f1e@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> --HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 20:32, Rodney W. Grimes wrote: > [ text/html is unsupported, treating like TEXT/PLAIN ] > Can you resend in none html format please? Yes, sorry, I was AFK and tried to send via mobile phone.. -f options means "force", with -f ipfw(8) will not ask any questions and forcibly execute the command. The description in man page can be modified to correctly describe the case with "delete" command. --=20 WBR, Andrey V. Elsukov --HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97-- --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltspPEACgkQAcXqBBDI oXp7wAgAmrNBiEyFolTufh6Oj0Q5NQSSftzdOpqtbuiJDjrdXFPaKrkhoBKGIpNt YiTmOMc39UmBIys1eekXXJF2gVpYEBBAGJobNE0JvLABQGAQ7Kb2u6U0diurSZUN Z9sZge5cYEDp1H47f5CeuvW6tvq86p5DnqYlE8rLUGAEBTDBFst5t77Y3hqTeCjI edh84cl72MbyMaOvpuuWjE8ff/tat+GpOsSoCKzKLzh8SKgPYjlAY4DTOXIGkJ18 Nnk2Z312TJlAO71zW2WexvLSDvIo60RU31nWtafl4IawM3C4SX6WRpxNgDQbC7Aw hTsQxg+JDZmGT95lE594u/LQA1+w2A== =j90H -----END PGP SIGNATURE----- --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ-- From owner-svn-src-head@freebsd.org Thu Aug 9 20:43:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C9410732DF; Thu, 9 Aug 2018 20:43:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA5986F3F; Thu, 9 Aug 2018 20:43:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DE531289A8; Thu, 9 Aug 2018 20:43:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f176.google.com with SMTP id w16-v6so5490715ljh.12; Thu, 09 Aug 2018 13:43:26 -0700 (PDT) X-Gm-Message-State: AOUpUlEfZc9445pcTzYZU1VTYgeWGt3hsE6cWg5DIXMIZbMI2GU1+eUd rmf28AA9MAJgWc0IXLmrlZbXKTUqpdn6k2y6yJE= X-Google-Smtp-Source: AA+uWPwbT8mxZYUddJ2fLwrX5AARelQ6FNCr0suHovlXrK9clm2D92SXIrkL7ChbsMWd/X79VSo5keMr3tTOnVpuHrg= X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr2786486ljf.27.1533847405456; Thu, 09 Aug 2018 13:43:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 13:43:04 -0700 (PDT) In-Reply-To: <201808092029.w79KTiCZ052728@repo.freebsd.org> References: <201808092029.w79KTiCZ052728@repo.freebsd.org> From: Kyle Evans Date: Thu, 9 Aug 2018 15:43:04 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337549 - head/lib/libnv To: Kyle Evans Cc: src-committers , 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.27 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, 09 Aug 2018 20:43:27 -0000 On Thu, Aug 9, 2018 at 3:29 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Aug 9 20:29:44 2018 > New Revision: 337549 > URL: https://svnweb.freebsd.org/changeset/base/337549 > > Log: > libnv: Remove -I${SRCTOP}/sys > > This should have been done as part of r336019 -- including ${SRCTOP}/sys is > not a good business model for something that's build in legacy/bootstrap > stages. > > Beyond that, libnv seems to build quite alright as legacy, part of > buildworld, and standalone without. Axe it. > > Reported by: truckman (head building stable/11) > Tested by: Shawn Webb (HardenedBSD) > MFC after: 3 days > > Modified: > head/lib/libnv/Makefile > I say "3 days," but this actually fixes head building stable/11 and thus will probably get done later today or tomorrow since it's a trivial patch. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Aug 9 20:48:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F03791073526; Thu, 9 Aug 2018 20:48:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6442087207; Thu, 9 Aug 2018 20:48:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Km3DP019445; Thu, 9 Aug 2018 13:48:04 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79Km3WI019444; Thu, 9 Aug 2018 13:48:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808092048.w79Km3WI019444@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337549 - head/lib/libnv In-Reply-To: To: Kyle Evans Date: Thu, 9 Aug 2018 13:48:03 -0700 (PDT) CC: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 20:48:08 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Aug 9, 2018 at 3:29 PM, Kyle Evans wrote: > > Author: kevans > > Date: Thu Aug 9 20:29:44 2018 > > New Revision: 337549 > > URL: https://svnweb.freebsd.org/changeset/base/337549 > > > > Log: > > libnv: Remove -I${SRCTOP}/sys > > > > This should have been done as part of r336019 -- including ${SRCTOP}/sys is > > not a good business model for something that's build in legacy/bootstrap > > stages. > > > > Beyond that, libnv seems to build quite alright as legacy, part of > > buildworld, and standalone without. Axe it. > > > > Reported by: truckman (head building stable/11) > > Tested by: Shawn Webb (HardenedBSD) > > MFC after: 3 days > > > > Modified: > > head/lib/libnv/Makefile > > > > I say "3 days," but this actually fixes head building stable/11 and > thus will probably get done later today or tomorrow since it's a > trivial patch. Please send a request for immediate MFC to re@ Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Aug 9 21:07:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EE01073AF6; Thu, 9 Aug 2018 21:07:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4588855B; Thu, 9 Aug 2018 21:07:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D71A1EB53; Thu, 9 Aug 2018 21:07:33 +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 w79L7WjR072920; Thu, 9 Aug 2018 21:07:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79L7Wtq072918; Thu, 9 Aug 2018 21:07:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808092107.w79L7Wtq072918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 21:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337550 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 337550 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 21:07:33 -0000 Author: np Date: Thu Aug 9 21:07:32 2018 New Revision: 337550 URL: https://svnweb.freebsd.org/changeset/base/337550 Log: cxgbe(4): Set fl_pktshift to 0 by default. Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/t4_sge.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Thu Aug 9 20:29:44 2018 (r337549) +++ head/share/man/man4/cxgbe.4 Thu Aug 9 21:07:32 2018 (r337550) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd Aug 9, 2018 .Dt CXGBE 4 .Os .Sh NAME @@ -262,7 +262,8 @@ The default is 1. .It Va hw.cxgbe.fl_pktshift Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. -The default value of 2 ensures that the Ethernet payload (usually the IP header) +The default value is 0. +A value of of 2 would ensure that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. 0-7 are all valid values. .It Va hw.cxgbe.fl_pad Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 20:29:44 2018 (r337549) +++ head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 21:07:32 2018 (r337550) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. */ -static int fl_pktshift = 2; +static int fl_pktshift = 0; TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); /* @@ -496,8 +496,8 @@ t4_sge_modload(void) if (fl_pktshift < 0 || fl_pktshift > 7) { printf("Invalid hw.cxgbe.fl_pktshift value (%d)," - " using 2 instead.\n", fl_pktshift); - fl_pktshift = 2; + " using 0 instead.\n", fl_pktshift); + fl_pktshift = 0; } if (spg_len != 64 && spg_len != 128) { From owner-svn-src-head@freebsd.org Thu Aug 9 21:20:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B461073DAE; Thu, 9 Aug 2018 21:20:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 052DA88AD7; Thu, 9 Aug 2018 21:20:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9E841ED25; Thu, 9 Aug 2018 21:20:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LK7mC078040; Thu, 9 Aug 2018 21:20:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LK7Kj078039; Thu, 9 Aug 2018 21:20:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808092120.w79LK7Kj078039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 9 Aug 2018 21:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337551 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 337551 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 21:20:08 -0000 Author: cem Date: Thu Aug 9 21:20:07 2018 New Revision: 337551 URL: https://svnweb.freebsd.org/changeset/base/337551 Log: cam_ccb.h: Remove redundant declarations of static inline functions No functional change. They're unnecessarily confusing for tools like grep or ctags. Sponsored by: Dell EMC Isilon Modified: head/sys/cam/cam_ccb.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Aug 9 21:07:32 2018 (r337550) +++ head/sys/cam/cam_ccb.h Thu Aug 9 21:20:07 2018 (r337551) @@ -1349,48 +1349,6 @@ cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retri u_int32_t flags, u_int8_t tag_action, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int8_t cdb_len, - u_int32_t timeout); - -static __inline void -cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout); - -static __inline void -cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, u_int tag_id, - u_int init_id, u_int scsi_status, u_int8_t *data_ptr, - u_int32_t dxfer_len, u_int32_t timeout); - -static __inline void -cam_fill_ataio(struct ccb_ataio *ataio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout); - -static __inline void -cam_fill_smpio(struct ccb_smpio *smpio, uint32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, - uint8_t *smp_request, int smp_request_len, - uint8_t *smp_response, int smp_response_len, - uint32_t timeout); - -static __inline void -cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, - uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, - struct mmc_data *mmc_d, - uint32_t timeout); - -static __inline void -cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t tag_action, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int8_t sense_len, u_int8_t cdb_len, u_int32_t timeout) { csio->ccb_h.func_code = XPT_SCSI_IO; From owner-svn-src-head@freebsd.org Thu Aug 9 21:28:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B9C10740E4; Thu, 9 Aug 2018 21:28:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9DBE88FD2; Thu, 9 Aug 2018 21:28:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB0D41EECB; Thu, 9 Aug 2018 21:28:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LSXvb083085; Thu, 9 Aug 2018 21:28:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LSVPC083077; Thu, 9 Aug 2018 21:28:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808092128.w79LSVPC083077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 9 Aug 2018 21:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337552 - in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 337552 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 21:28:34 -0000 Author: dim Date: Thu Aug 9 21:28:31 2018 New Revision: 337552 URL: https://svnweb.freebsd.org/changeset/base/337552 Log: Add optional LLVM BPF target support BPF (eBPF) is an independent instruction set architecture which is introduced in Linux a few years ago. Originally, eBPF execute environment was only inside Linux kernel. However, recent years there are some user space implementation (https://github.com/iovisor/ubpf, https://doc.dpdk.org/guides/prog_guide/bpf_lib.html) and kernel space implementation for FreeBSD is going on (https://github.com/YutaroHayakawa/generic-ebpf). The BPF target support can be enabled using WITH_LLVM_TARGET_BPF, as it is not built by default. Submitted by: Yutaro Hayakawa Reviewed by: dim, bdrewery Differential Revision: https://reviews.freebsd.org/D16033 Added: head/tools/build/options/WITH_LLVM_TARGET_BPF (contents, props changed) Modified: head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/clang/libllvm/Makefile head/lib/clang/llvm.build.mk head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmParsers.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_ASM_PARSER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PARSER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_ASM_PARSER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PARSER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmPrinters.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/AsmPrinters.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_ASM_PRINTER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PRINTER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_ASM_PRINTER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PRINTER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- head/lib/clang/include/llvm/Config/Disassemblers.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/Disassemblers.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_DISASSEMBLER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_DISASSEMBLER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_DISASSEMBLER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_DISASSEMBLER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- head/lib/clang/include/llvm/Config/Targets.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/Targets.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_TARGET(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_TARGET(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_TARGET(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_TARGET(Mips) #endif Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/libllvm/Makefile Thu Aug 9 21:28:31 2018 (r337552) @@ -9,14 +9,15 @@ INTERNALLIB= CFLAGS+= -I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ - ${MK_LLVM_TARGET_MIPS} == "no" && ${MK_LLVM_TARGET_POWERPC} == "no" && \ - ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" + ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ + ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ + ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ - MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_MIPS, MK_LLVM_TARGET_POWERPC,\ - MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -905,6 +906,25 @@ SRCS_MIN+= Target/ARM/Thumb2SizeReduction.cpp SRCS_MIN+= Target/ARM/ThumbRegisterInfo.cpp SRCS_MIN+= Target/ARM/Utils/ARMBaseInfo.cpp .endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_BPF} != "no" +SRCS_MIN+= Target/BPF/AsmParser/BPFAsmParser.cpp +SRCS_MIN+= Target/BPF/BPFAsmPrinter.cpp +SRCS_MIN+= Target/BPF/BPFFrameLowering.cpp +SRCS_MIN+= Target/BPF/BPFISelDAGToDAG.cpp +SRCS_MIN+= Target/BPF/BPFISelLowering.cpp +SRCS_MIN+= Target/BPF/BPFInstrInfo.cpp +SRCS_MIN+= Target/BPF/BPFMCInstLower.cpp +SRCS_MIN+= Target/BPF/BPFRegisterInfo.cpp +SRCS_MIN+= Target/BPF/BPFSubtarget.cpp +SRCS_MIN+= Target/BPF/BPFTargetMachine.cpp +SRCS_MIN+= Target/BPF/Disassembler/BPFDisassembler.cpp +SRCS_MIN+= Target/BPF/InstPrinter/BPFInstPrinter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFAsmBackend.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp +SRCS_MIN+= Target/BPF/TargetInfo/BPFTargetInfo.cpp +.endif # MK_LLVM_TARGET_BPF .if ${MK_LLVM_TARGET_MIPS} != "no" SRCS_MIN+= Target/Mips/AsmParser/MipsAsmParser.cpp SRCS_XDW+= Target/Mips/Disassembler/MipsDisassembler.cpp @@ -1371,7 +1391,7 @@ beforebuild: # Note: some rules are superfluous, not every combination is valid. .for arch in \ - AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 + AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 . for hdr in \ AsmMatcher/-gen-asm-matcher \ AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ @@ -1431,6 +1451,17 @@ TGHDRS+= ARMGenRegisterInfo.inc TGHDRS+= ARMGenSubtargetInfo.inc TGHDRS+= ARMGenSystemRegister.inc .endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_BPF} != "no" +TGHDRS+= BPFGenAsmMatcher.inc +TGHDRS+= BPFGenAsmWriter.inc +TGHDRS+= BPFGenCallingConv.inc +TGHDRS+= BPFGenDAGISel.inc +TGHDRS+= BPFGenDisassemblerTables.inc +TGHDRS+= BPFGenInstrInfo.inc +TGHDRS+= BPFGenMCCodeEmitter.inc +TGHDRS+= BPFGenRegisterInfo.inc +TGHDRS+= BPFGenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_BPF .if ${MK_LLVM_TARGET_MIPS} != "no" TGHDRS+= MipsGenAsmMatcher.inc TGHDRS+= MipsGenAsmWriter.inc Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/llvm.build.mk Thu Aug 9 21:28:31 2018 (r337552) @@ -54,6 +54,9 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_ARM LLVM_NATIVE_ARCH= ARM . endif .endif +.if ${MK_LLVM_TARGET_BPF} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_BPF +.endif .if ${MK_LLVM_TARGET_MIPS} != "no" CFLAGS+= -DLLVM_TARGET_ENABLE_MIPS . if ${MACHINE_CPUARCH} == "mips" Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Aug 9 21:20:07 2018 (r337551) +++ head/share/man/man5/src.conf.5 Thu Aug 9 21:28:31 2018 (r337552) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 2, 2018 +.Dd August 9, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1110,6 +1110,11 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITH_LLVM_TARGET_BPF +Set to build LLVM target support for BPF. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_MIPS Set to not build LLVM target support for MIPS. The Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Aug 9 21:20:07 2018 (r337551) +++ head/share/mk/src.opts.mk Thu Aug 9 21:28:31 2018 (r337552) @@ -275,6 +275,8 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__ .endif .endfor +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF + .include # If the compiler is not C++11 capable, disable Clang and use GCC instead. # This means that architectures that have GCC 4.2 as default can not Added: head/tools/build/options/WITH_LLVM_TARGET_BPF ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_BPF Thu Aug 9 21:28:31 2018 (r337552) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build LLVM target support for BPF. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. From owner-svn-src-head@freebsd.org Thu Aug 9 21:41:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD0910744C5; Thu, 9 Aug 2018 21:41:37 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2E6896BF; Thu, 9 Aug 2018 21:41:37 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x233.google.com with SMTP id y207-v6so12367320oie.13; Thu, 09 Aug 2018 14:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i4shtrkOdcE9KwB4QryY5diQ3TQHV9xR36gFhUBkV+E=; b=iQNYn3rU3CpT+1ghDgOZHBphpUAlF7SGr4XzhXdy30RZ4iIhgLsgYujrEG75uxW84Z x7M+jc/BudHW3kzm0MtifebaSjNjQS9/exDaQkWYghLAXTv7pkXI874fP/CxITH7mBZ5 jFmZsAMmb+2HyuBYoH3alrCSBSWIfMkAkltbZsa60zti3xfxSguvZdAXnlRSLpwfBTT2 rdRU4ophmvwYpwCXpskO9VmNPt/q9Kzae03SDUuzTnj6/GLI7/PfyON47+d1VPDYnlhI 2ejMcUuI/dO3Q/kzX7CvahmUKghCN26YiM7UY/whtGnlxtAi/oER8eSLke4a5Hj67hIJ +47w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i4shtrkOdcE9KwB4QryY5diQ3TQHV9xR36gFhUBkV+E=; b=uESMXVDbtfxOcffQFBAEUGIKqv7lgj8mHOYuXxWHcLlip0DVwscVunA3AC40fkjeAW nvXV6tJ2lPBWFWmCHQ7vCcy4G7KduF7IN2KwzvNdcYtCFV3zHqD+MP2OqUvLrccmcKUF tdJ0AplBSGzkrCIkYYWBREVPshmUPZHdbcKG+vRdjxC5wJBwW3YgYB4M+EBwL/8YNu6Z tKIQa9u6P7Iufwlq4CxBKRE04gq3049c82zbV+lmU3EQcaxEq1So0enpzg6zLGiyhkXE 3HesgYXSfbz1cwco2WIvliW4Ckl3i7E49R+mQ2GXqpnEM+hIwfcXvvi+5hCm4LwSutdi g87w== X-Gm-Message-State: AOUpUlH79GWC6LdidKQP//f9/2SIwIuNb/aXRgxqE69LH9gnMa1EkPy5 Uc+0nxfHf0iWhiVmZZv38xjV5VX3xmjAqlJ+9DB5U5m1AWs= X-Google-Smtp-Source: AA+uWPwdURi5wRs+HB82yU6vupY6hbnVoWVtZRN1JD6qR24KX9sLf2a3iv718HFvfbHBqjCiZkoc480Aw2ZBpSmFxGk= X-Received: by 2002:aca:e754:: with SMTP id e81-v6mr3747251oih.203.1533850896384; Thu, 09 Aug 2018 14:41:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3bb6:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 14:41:35 -0700 (PDT) In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 9 Aug 2018 16:41:35 -0500 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: "cem@FreeBSD.org" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 21:41:37 -0000 On Thu, Aug 9, 2018 at 11:03 AM, Conrad Meyer wrote: > On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote: > > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala < > trasz@freebsd.org> > > wrote: > >> Use NULLs instead of casted zeroes, for consistency. > > > > It's probably helpful to note explicitly that these are not in argument= s > to > > varargs functions, > > I don't think it's helpful. > > > in which case the explicit cast is needed in order to produce a program > that > > will have > > correct behavior on all compliant compilers/systems. > > Here "compliant" means "minimally compliant to the C standard." Use > of NULL in varargs is functionally correct on all FreeBSD systems. > > > (We do define NULL to > > be a zero-with-cast, > > but programs > > (Ones that care about portability to weird systems.) I don't think > BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a stron= g candidate > for portability. > > > should not assume that NULL will be of pointer type -- "An > > integer constant > > expression with the value 0, or such an expression cast to type void *, > is > > called a null pointer constant".) > > Right. The problem only arises when both conditions are met: > > 1. The system's varargs representation is smaller than the pointer > representation, and > 2. The runtime headers do not defined NULL as a pointer-typed value. > (3. The function being invoked is actually varargs?) > > Neither is true on FreeBSD and v7-style init is not a useful place to > call for portability. > I don't really feel a need to continue the discussion that was already started in response to r336835 (in addition to the current thread), so I'll limit myself to asking whether we want to be writing standard C or a FreeBSD-specific dialect of C. My understanding was that we had some experience with the latter (e.g., heavy patching of the compiler) and it ended up with us in a bad place, which would tend to support writing standard C or as close to it as we can. (Yes, I know that we have non-standard printf specifiers and the like.) -Ben From owner-svn-src-head@freebsd.org Thu Aug 9 21:46:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBFDE10747BE for ; Thu, 9 Aug 2018 21:46:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4E189B36 for ; Thu, 9 Aug 2018 21:46:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id y10-v6so6019530ioa.10 for ; Thu, 09 Aug 2018 14:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OhxqssZh8iDIvyrUE7Fx7pvHFBrbafoYnSoXYPYoUEA=; b=WTLbiMqANN/9Au6OtWT1MSa6GabMer/AHQ6+RfeBfKAF4VYadqEwMhU9r0aL/wx5YA TRHy4+R7EPqt0jGNTjAVJGOCIT6waYxaDIdD7Quc02fHHHDb3ykKtHS9GLCVwr9ukHY5 kfWv9kc9sXwE4qvV3b6RT5anrkvWSv/PWt8q4CB5AR1eLajQAW9QBxKCBeRM8gOX0qrm X2ipuxVih8awfdDgosrrX4E9z8UhHm9nMnKJuTx0qihntg2ghVY+8R+VCW5sZllIAvad fA9OAVq7MJOhNtPJNvr352GLKliJ7wOTVv0ADf62FayBCQwFqStG7Bq8axDNct1eVqW4 Mwgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OhxqssZh8iDIvyrUE7Fx7pvHFBrbafoYnSoXYPYoUEA=; b=S5eKo3Kopt3jKufKeF9IscGse7xxj8oWtXX6UUjrau4IX8xGnSrRML32UzNc519XiN +Evf07DLUjvR8WsFklVvfYfvstvc6GtEldf29dLlgvG/ez0i3zAtXGR6FDMky76URJqT dakn0S2Ep+4GfqiAsp5d1iKozy3/wpFt0CQ07KJbShGnilDMfngH9wcWD1Nvb1S5X4en DuB3wuVsrgkBNKR003bL96JFSb2HqyI10jldixxgHy5BmfqsKb7DP7kluHfmKQ4bgoRO 1Low83QqlpCpjJ8dlzf6qpIOvUcdvOUnK2KusU20pEpw/zsj+3DnsDIJ14fFAPBYS0ir eE3A== X-Gm-Message-State: AOUpUlEUNpcV30vyZZzjZbkAjwBvjV4Vyq05Entb0O5Iy3ERXAD8S+Nc Bytaq5aamH130NgyipKiJipy177A37cboggfoPpMQjiIjcU= X-Google-Smtp-Source: AA+uWPzgf9TgJmkH3r3finTsczXd74gBCLMPui1DDPOXI57eoggE2W6Y6KimtodhEYYOy53Fg8182c7zhkAi0zQPTVE= X-Received: by 2002:a6b:f70f:: with SMTP id k15-v6mr3329482iog.37.1533851174688; Thu, 09 Aug 2018 14:46:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 14:46:14 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Warner Losh Date: Thu, 9 Aug 2018 15:46:14 -0600 X-Google-Sender-Auth: SPHOGHWTZSb114tZOqaFX6LVU44 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Benjamin Kaduk Cc: "cem@FreeBSD.org" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 21:46:16 -0000 On Thu, Aug 9, 2018 at 3:41 PM, Benjamin Kaduk wrote: > On Thu, Aug 9, 2018 at 11:03 AM, Conrad Meyer wrote: > >> On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote= : >> > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala < >> trasz@freebsd.org> >> > wrote: >> >> Use NULLs instead of casted zeroes, for consistency. >> > >> > It's probably helpful to note explicitly that these are not in >> arguments to >> > varargs functions, >> >> I don't think it's helpful. >> >> > in which case the explicit cast is needed in order to produce a progra= m >> that >> > will have >> > correct behavior on all compliant compilers/systems. >> >> Here "compliant" means "minimally compliant to the C standard." Use >> of NULL in varargs is functionally correct on all FreeBSD systems. >> >> > (We do define NULL to >> > be a zero-with-cast, >> > but programs >> >> (Ones that care about portability to weird systems.) I don't think >> BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a stro= ng candidate >> for portability. >> >> > should not assume that NULL will be of pointer type -- "An >> > integer constant >> > expression with the value 0, or such an expression cast to type void *= , >> is >> > called a null pointer constant".) >> >> Right. The problem only arises when both conditions are met: >> >> 1. The system's varargs representation is smaller than the pointer >> representation, and >> 2. The runtime headers do not defined NULL as a pointer-typed value. >> (3. The function being invoked is actually varargs?) >> >> Neither is true on FreeBSD and v7-style init is not a useful place to >> call for portability. >> > > I don't really feel a need to continue the discussion that was already > started in response > to r336835 (in addition to the current thread), so I'll limit myself to > asking whether we > want to be writing standard C or a FreeBSD-specific dialect of C. My > understanding was > that we had some experience with the latter (e.g., heavy patching of the > compiler) and > it ended up with us in a bad place, which would tend to support writing > standard C or > as close to it as we can. (Yes, I know that we have non-standard printf > specifiers and the like.) > The conventional wisdom is code as close to the standard(s) as we can, but not to the point of insanity. If there's a good reason to deviate, that's OK so long as it's intentional and the deviation makes sense. For example, we calloc a bunch of stuff, but that's not a strictly standards conforming way to initialize pointers to be NULL. While c->ptr =3D 0 is always standar= ds conforming, memset(&c->ptr, 0, sizeof(c->ptr)); isn't. Yet we do this everywhere because we know we'll never run on an architecture where the bitwise representation of a NULL pointer isn't all 0's. There's dozens of other similar examples. Warner From owner-svn-src-head@freebsd.org Thu Aug 9 21:52:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C9410749FD; Thu, 9 Aug 2018 21:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5725B89FEB; Thu, 9 Aug 2018 21:52:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3853E1F3BE; Thu, 9 Aug 2018 21:52:52 +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 w79LqqX3097916; Thu, 9 Aug 2018 21:52:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LqqWU097915; Thu, 9 Aug 2018 21:52:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808092152.w79LqqWU097915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 21:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337553 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337553 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 21:52:52 -0000 Author: np Date: Thu Aug 9 21:52:51 2018 New Revision: 337553 URL: https://svnweb.freebsd.org/changeset/base/337553 Log: cxgbe(4): Add a sysctl to control the tx credit reclaim mechanism for netmap tx queues. There is no change in default behavior. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Aug 9 21:28:31 2018 (r337552) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Aug 9 21:52:51 2018 (r337553) @@ -93,6 +93,14 @@ int starve_fl = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, starve_fl, CTLFLAG_RWTUN, &starve_fl, 0, "Don't ring fl db for netmap rx queues."); +/* + * Try to process tx credits in bulk. This may cause a delay in the return of + * tx credits and is suitable for bursty or non-stop tx only. + */ +int lazy_tx_credit_flush = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, lazy_tx_credit_flush, CTLFLAG_RWTUN, + &lazy_tx_credit_flush, 0, "lazy credit flush for netmap tx queues."); + static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) { @@ -571,8 +579,6 @@ ring_nm_txq_db(struct adapter *sc, struct sge_nm_txq * } nm_txq->dbidx = nm_txq->pidx; } - -int lazy_tx_credit_flush = 1; /* * Write work requests to send 'npkt' frames and ring the doorbell to send them From owner-svn-src-head@freebsd.org Thu Aug 9 21:53:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A51421074A4A; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6308A130; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3887D1F3BF; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LrXDF097989; Thu, 9 Aug 2018 21:53:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LrWEZ097986; Thu, 9 Aug 2018 21:53:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808092153.w79LrWEZ097986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 9 Aug 2018 21:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337554 - in head/sys/cam: . ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata nvme scsi X-SVN-Commit-Revision: 337554 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 21:53:34 -0000 Author: cem Date: Thu Aug 9 21:53:32 2018 New Revision: 337554 URL: https://svnweb.freebsd.org/changeset/base/337554 Log: cam(4): Add an xpt-neutral flag indicating a valid panic CCB No functional change. Note that this change is careful to set the CCB header xflags after foo_fill_bar() routines, which generally zero existing flags. An earlier version of this patch mistakenly set the flag before the fill routines. Submitted by: Scott Ferris , jhibbits@ Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor Anton Rang Sponsored by: Dell EMC Isilon Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/ata/ata_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -1081,6 +1081,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical (u_int8_t *) virtual, length, ada_default_timeout*1000); + ataio.ccb_h.xflags |= CAM_CCB_DUMP; if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { @@ -1115,6 +1116,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical NULL, 0, 5*1000); + ataio.ccb_h.xflags |= CAM_CCB_DUMP; if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); @@ -3499,6 +3501,7 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); + local_ccb.ccb_h.xflags |= CAM_CCB_DUMP; ata_28bit_cmd(&local_ccb, cmd, 0, 0, 0); error = cam_periph_runccb((union ccb *)&local_ccb, adaerror, /*cam_flags*/0, /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/cam_ccb.h Thu Aug 9 21:53:32 2018 (r337554) @@ -116,7 +116,8 @@ typedef enum { typedef enum { CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ + CAM_UNMAPPED_BUF = 0x00000008,/* use unmapped I/O */ + CAM_CCB_DUMP = 0x00000010,/* polled ccb during dump */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/nvme/nvme_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -426,6 +426,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); + nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -439,6 +440,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); + nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/scsi/scsi_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -1847,6 +1847,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); + csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -1869,6 +1870,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*lb_count*/0, SSD_FULL_SIZE, 5 * 1000); + csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) From owner-svn-src-head@freebsd.org Thu Aug 9 21:56:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCCD1074B42; Thu, 9 Aug 2018 21:56:23 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 298368A2E6; Thu, 9 Aug 2018 21:56:22 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 23E66F26; Thu, 9 Aug 2018 17:56:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 09 Aug 2018 17:56:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=WbwFGFNLlcpoVAAJqW7bqV5WfgNYg /dGt/F+YrYfTd4=; b=A9vTlZpacdnlI9G9GPHAMqXrT653VVQvKkUIpzJ8uVpVC 8stVJNapu7YHUp5QUr7TNHPbejMeZtqCY5fVOSxVv4cOmNnKB8eoRi08NiKj81Nr s5mBjq06hIKynT+uiHpQVWAqjnvEabAlNeNMI2cIpOYaYmLAXzkw/djKPQNaaxmy GlSMWg+c9XnXNW1qRGe5q7IE9W5bWdU3HWWkaDXmaFvCYHHyXgL2hDvDP+CDrB9O 94jCt5rXhmZkJYHd/JY9qnPMAykjOLgVSs+CWX9wNUELPFWEWWhjPSuuRpQWVQPg iZX2i+/I3/WXcGhLTh8w08ipcO5rLKWlqeIUKznhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=WbwFGF NLlcpoVAAJqW7bqV5WfgNYg/dGt/F+YrYfTd4=; b=CkSpjNZNiQ/f7aFYY/E9ZQ paz+H9Fit6Snbaw69dZmk1OsDXYD2wDsWpRa88JT0AbvmPzizPG4KN9TE1muwiXO Gd5w0plhogMN+Zk2golbwFtLXLEUNCIZIO0HZkwkJxYeDUYKe+PT9jqDtHZvp9cG KA9//C/5H+c4AZlR6vwREya+l0IB0nHYL+2jgPHEU6cuI7E1+9vk9Z0ln8/pk580 YlY8TuQKhbM2nL9k8PwGdB5Gav+VbKAD3QCjRUwnN6zLwk1wVZaym5jnnuZ7KQMf O0UvC+inTIw8XbPvGRqmRaHEq1YbxOGSaUlxMfA/rBdio5eocHBoDbq3LytSKUTA == X-ME-Proxy: X-ME-Sender: Received: from [192.168.0.118] (unknown [161.97.249.191]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E58C10261; Thu, 9 Aug 2018 17:56:15 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337554 - in head/sys/cam: . ata nvme scsi From: Scott Long In-Reply-To: <201808092153.w79LrWEZ097986@repo.freebsd.org> Date: Thu, 9 Aug 2018 15:56:13 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201808092153.w79LrWEZ097986@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 21:56:23 -0000 > On Aug 9, 2018, at 3:53 PM, Conrad Meyer wrote: >=20 > Author: cem > Date: Thu Aug 9 21:53:32 2018 > New Revision: 337554 > URL: https://svnweb.freebsd.org/changeset/base/337554 >=20 > Log: > cam(4): Add an xpt-neutral flag indicating a valid panic CCB >=20 > No functional change. >=20 > Note that this change is careful to set the CCB header xflags after > foo_fill_bar() routines, which generally zero existing flags. An = earlier > version of this patch mistakenly set the flag before the fill = routines. >=20 > Submitted by: Scott Ferris , jhibbits@ > Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor = Anton Rang > Sponsored by: Dell EMC Isilon What=E2=80=99s the purpose of this flag? I see it gets set in plenty of = places, but never checked. Scott From owner-svn-src-head@freebsd.org Thu Aug 9 23:22:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F10E10767AF; Thu, 9 Aug 2018 23:22:25 +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 A61F68CC0D; Thu, 9 Aug 2018 23:22:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 8C9B9104F163; Fri, 10 Aug 2018 09:22:12 +1000 (AEST) Date: Fri, 10 Aug 2018 09:22:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kyle Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: <201808090132.w791WAQm057199@repo.freebsd.org> Message-ID: <20180810081913.P1108@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=-dLe785RhlDCTkMXlmIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 23:22:25 -0000 On Thu, 9 Aug 2018, Kyle Evans wrote: > Log: > kern: Add a BOOT_TAG marker at the beginning of boot dmesg > > From the "newly licensed to drive" PR department, add a BOOT_TAG marker (by > default, --<>--, to the beginning of each boot's dmesg. This makes it > easier to do textproc magic to locate the start of each boot and, of > particular interest to some, the dmesg of the current boot. > > The PR has a dmesg(8) component as well that I've opted not to include for > the moment- it was the more contentious part of this PR. > > bde@ also made the statement that this boot tag should be written with an > ordinary printf, which I've- for the moment- declined to change about this > patch to keep it more transparent to observer of the boot process. Yes, it should be written with an ordinary printf. > Modified: head/sys/kern/subr_prf.c > ============================================================================== > --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) > +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) > @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) > cp = (char *)ptr; > msgbufp = (struct msgbuf *)(cp + size); > msgbuf_reinit(msgbufp, cp, size); > + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); > if (msgbufmapped && oldp != msgbufp) > msgbuf_copy(oldp, msgbufp); > msgbufmapped = 1; This seems to be wrong, since it writes the tag for all calls to msgbufinit(), giving multiple tags for multiple calls, but there should be only 1 per boot. msgbufinit() should be called multiple times to bootstrap it. My version does this. The only obvious bug in (a later version of) the output is a missing newline for the tag. My dmesg output on amd64: X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X KDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... In -current, all of the lines before the copyright except the tag are broken by printf() of them to an unmapped msgbuf. (The above output is without -v. Many more lines are lost with -v.) In my version, msgbufinit() is called earlier with a small message buffer to hold the early output. Output across reboots also works right except for the missing newline: X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X GDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... X Waiting (max 60 seconds) for system process `vnlru' to stop... done X Waiting (max 60 seconds) for system process `syncer' to stop... X Syncing disks, vnodes remaining... 0 0 0 done X Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-4' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-5' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-6' to stop... done X All buffers synced. X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X GDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... Bruce From owner-svn-src-head@freebsd.org Thu Aug 9 23:31:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42FF81076BA0; Thu, 9 Aug 2018 23:31:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED4D78CFEF; Thu, 9 Aug 2018 23:31:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE8B620364; Thu, 9 Aug 2018 23:31:18 +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 w79NVIhp046488; Thu, 9 Aug 2018 23:31:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79NVIBD046486; Thu, 9 Aug 2018 23:31:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808092331.w79NVIBD046486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 9 Aug 2018 23:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337555 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337555 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 23:31:19 -0000 Author: gjb Date: Thu Aug 9 23:31:18 2018 New Revision: 337555 URL: https://svnweb.freebsd.org/changeset/base/337555 Log: Update and replace old rc daemons for GCE images. PR: 229000 Submitted by: helen.koike@collabora.com MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Thu Aug 9 21:53:32 2018 (r337554) +++ head/release/tools/gce.conf Thu Aug 9 23:31:18 2018 (r337555) @@ -12,8 +12,7 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update fir export VM_RC_LIST="ntpd sshd firstboot_growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ - google_instance_setup google_ip_forwarding_daemon \ - google_network_setup" + google_instance_setup google_network_daemon" vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf From owner-svn-src-head@freebsd.org Thu Aug 9 23:40:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4271076FA9 for ; Thu, 9 Aug 2018 23:40:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB738D6F2 for ; Thu, 9 Aug 2018 23:40:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id k16-v6so6193540iom.12 for ; Thu, 09 Aug 2018 16:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OzeLmNzbnQEmcYPW2qgN4jsi4hBfUJhRO9az51lZBLc=; b=ByN1XM8DVcMh6L8ScnK3ke5l/Swa/G0NENvQvn7YsRI1maJ4XpeW/mxDzKAm9IJOMN VEMxhVzPTsb2Yff8JQY2s2rO04Ke8WX3JpoSGVmYLPta/yEkSU1AyFcu6XetpCvGQ1z8 JtaSm6+08aSeGHZ4ZhYCC+8zVUlHfC7OF0M+FZ+tykTiHItMACdoB7uiphR9HpjJbGfC 7GKt0JmO77yFB/PDlhHHGtMvi3JIitmixPcQYS+GZD+at6sgMHPwN3z/SDETcI21YJ/J 1R6Jx/xl25B12xUUIKg8//f2Vs82QMeAT4cvgRMFgzDoPr/xcCWdFeVXHTaXoStu8adW sEqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OzeLmNzbnQEmcYPW2qgN4jsi4hBfUJhRO9az51lZBLc=; b=r5IQGgelrc5gpz50GrdsJ4TTZnCK3bQ6OX5W3lNw9Afj4WVtW7qBxBMxrhlBdzq9ON BDjZL/+pOgToFcjJd38qFrvWz92WR8EYrhEApo5JjNRwyuH7dnReflwQcGBzomgG4kfG Ye4ApmNpBVvCKT0gLB7ol6JZ/J7+K+z6d22xyY1OALDSaOvXDFmrt4FaH9/EkpMSZkX7 hPfAqH7ub3tQxFeij86SeI11X/nQEE2VAtUMWjMM1mJSgjH6GlZspL8omlnwFeAhu2i5 HP3cdcakBhEoFxn7a6yt0P8vxxsugrkBBZoo0En2lK9QiZMRVcs8ffbd+exWj7rhxZP9 ccgQ== X-Gm-Message-State: AOUpUlHh4T3r5utEQggwtDHS6zRnsJ1zhKvfB6e17VkWXY5FoTfP9Rid iB9IJUQIDrIcNZKCP0iN7qxNelMxaY5ZEunLENE+/w== X-Google-Smtp-Source: AA+uWPysgW0z64rJSEUoeopjcNdsZToG1m9uOtbcZcYsc5q+vPAO364yPGv7VunTFU2M9jZbaqXnQ/ty0ytP3vYMSiY= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr3526579ioa.168.1533858055125; Thu, 09 Aug 2018 16:40:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 16:40:54 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808092153.w79LrWEZ097986@repo.freebsd.org> From: Warner Losh Date: Thu, 9 Aug 2018 17:40:54 -0600 X-Google-Sender-Auth: 3zCQiINs_CFf6Pyp-pnx-xNo8lA Message-ID: Subject: Re: svn commit: r337554 - in head/sys/cam: . ata nvme scsi To: Scott Long Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Aug 2018 23:40:56 -0000 On Thu, Aug 9, 2018 at 3:56 PM, Scott Long wrote: > > > > On Aug 9, 2018, at 3:53 PM, Conrad Meyer wrote: > > > > Author: cem > > Date: Thu Aug 9 21:53:32 2018 > > New Revision: 337554 > > URL: https://svnweb.freebsd.org/changeset/base/337554 > > > > Log: > > cam(4): Add an xpt-neutral flag indicating a valid panic CCB > > > > No functional change. > > > > Note that this change is careful to set the CCB header xflags after > > foo_fill_bar() routines, which generally zero existing flags. An > earlier > > version of this patch mistakenly set the flag before the fill routines= . > > > > Submitted by: Scott Ferris , jhibbits@ > > Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor > Anton Rang > > Sponsored by: Dell EMC Isilon > > What=E2=80=99s the purpose of this flag? I see it gets set in plenty of = places, > but never checked. > It kinda looks like something I recall removing when I did the runccb fixes so they worked when we were dumping. We used to need this, but we don't anymore. I have the same question: Why? Maybe these CAM changes should go through phabricator? Warner From owner-svn-src-head@freebsd.org Thu Aug 9 23:43:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D32107715F; Thu, 9 Aug 2018 23:43:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 170558DA97; Thu, 9 Aug 2018 23:43:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6F4D20566; Thu, 9 Aug 2018 23:43:10 +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 w79NhAdE053627; Thu, 9 Aug 2018 23:43:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79NhABG053626; Thu, 9 Aug 2018 23:43:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808092343.w79NhABG053626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 9 Aug 2018 23:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337556 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337556 X-SVN-Commit-Repository: base 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.27 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, 09 Aug 2018 23:43:11 -0000 Author: gjb Date: Thu Aug 9 23:43:10 2018 New Revision: 337556 URL: https://svnweb.freebsd.org/changeset/base/337556 Log: Invoke the growfs rc script for each boot on GCE. PR: 230275 Submitted by: gustavo.scalet@collabora.com MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Thu Aug 9 23:31:18 2018 (r337555) +++ head/release/tools/gce.conf Thu Aug 9 23:43:10 2018 (r337556) @@ -5,11 +5,10 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo firstboot-growfs \ - sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd firstboot_growfs \ +export VM_RC_LIST="ntpd sshd growfs\ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ google_instance_setup google_network_daemon" @@ -21,6 +20,10 @@ vm_extra_install_base() { } vm_extra_pre_umount() { + # Enable growfs on every boot, not only the first, as as instance's disk can + # be enlarged post-creation + sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs + cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" ifconfig_DEFAULT="SYNCDHCP mtu 1460" From owner-svn-src-head@freebsd.org Fri Aug 10 00:01:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9D8310779B6; Fri, 10 Aug 2018 00:01:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F19548E36F; Fri, 10 Aug 2018 00:01:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D40B320843; Fri, 10 Aug 2018 00:01:21 +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 w7A01L2j062451; Fri, 10 Aug 2018 00:01:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A01LKu062450; Fri, 10 Aug 2018 00:01:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808100001.w7A01LKu062450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 10 Aug 2018 00:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337557 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 337557 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 00:01:22 -0000 Author: gjb Date: Fri Aug 10 00:01:21 2018 New Revision: 337557 URL: https://svnweb.freebsd.org/changeset/base/337557 Log: Rename head from -CURRENT to -ALPHA1 as part of the 12.0-RELEASE cycle. This commit marks the start of the code slush for the 12.0 cycle. 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 Aug 9 23:43:10 2018 (r337556) +++ head/sys/conf/newvers.sh Fri Aug 10 00:01:21 2018 (r337557) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="CURRENT" +BRANCH="ALPHA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Fri Aug 10 00:02:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AEA1077BA2; Fri, 10 Aug 2018 00:02:47 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C09908E81B; Fri, 10 Aug 2018 00:02:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5F14529DE8; Fri, 10 Aug 2018 00:02:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id p10-v6so5852149ljg.2; Thu, 09 Aug 2018 17:02:46 -0700 (PDT) X-Gm-Message-State: AOUpUlEfdG+ZYFWOKB9NIzA18LZWJGmwk19Ws+mHRt/p69GbSw26L3v3 +kj5iRc1AaXBYtwANtORAWiETdtiET0Cie/2euQ= X-Google-Smtp-Source: AA+uWPwrH3M7/tnD6gsVzl43JBwUgDs5k57zk8pGqb0k8XSqfMsd1Xs17Easc/KP10w8AMf9i0mr699bVPKTvdkLAY0= X-Received: by 2002:a2e:144f:: with SMTP id 15-v6mr3177268lju.122.1533859364835; Thu, 09 Aug 2018 17:02:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 17:02:20 -0700 (PDT) In-Reply-To: <20180810081913.P1108@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> From: Kyle Evans Date: Thu, 9 Aug 2018 19:02:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337518 - in head/sys: kern sys To: Bruce Evans Cc: src-committers , 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.27 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, 10 Aug 2018 00:02:47 -0000 On Thu, Aug 9, 2018 at 6:22 PM, Bruce Evans wrote: > On Thu, 9 Aug 2018, Kyle Evans wrote: > >> Log: >> kern: Add a BOOT_TAG marker at the beginning of boot dmesg >> >> From the "newly licensed to drive" PR department, add a BOOT_TAG marker >> (by >> default, --<>--, to the beginning of each boot's dmesg. This makes >> it >> easier to do textproc magic to locate the start of each boot and, of >> particular interest to some, the dmesg of the current boot. >> >> The PR has a dmesg(8) component as well that I've opted not to include >> for >> the moment- it was the more contentious part of this PR. >> >> bde@ also made the statement that this boot tag should be written with an >> ordinary printf, which I've- for the moment- declined to change about >> this >> patch to keep it more transparent to observer of the boot process. > > > Yes, it should be written with an ordinary printf. > >> Modified: head/sys/kern/subr_prf.c >> >> ============================================================================== >> --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) >> +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) >> @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) >> cp = (char *)ptr; >> msgbufp = (struct msgbuf *)(cp + size); >> msgbuf_reinit(msgbufp, cp, size); >> + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); >> if (msgbufmapped && oldp != msgbufp) >> msgbuf_copy(oldp, msgbufp); >> msgbufmapped = 1; > > > This seems to be wrong, since it writes the tag for all calls to > msgbufinit(), giving multiple tags for multiple calls, but there should be > only 1 per boot. msgbufinit() should be called multiple times to bootstrap > it. My version does this. > > The only obvious bug in (a later version of) the output is a missing newline > for the tag. > > My dmesg output on amd64: > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X KDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > > In -current, all of the lines before the copyright except the tag are broken > by printf() of them to an unmapped msgbuf. (The above output is without -v. > Many more lines are lost with -v.) In my version, msgbufinit() is called > earlier with a small message buffer to hold the early output. I've not seen a compelling reason to switch this to printf() rather than direct addition to the msgbuf after it's initialized, but I'll humor you on this one because I don't really care either way and you've been at this a lot longer than I have. When you say you call msgbufinit() earlier-- before the static environment is even setup, or at least after that? > Output across reboots also works right except for the missing newline: > > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X GDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > X Waiting (max 60 seconds) for system process `vnlru' to stop... done > X Waiting (max 60 seconds) for system process `syncer' to stop... X Syncing > disks, vnodes remaining... 0 0 0 done > X Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-4' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-5' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-6' to stop... > done > X All buffers synced. > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X GDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > Right- I tried to maintain the form of the original patch and also overlooked this. My revised patch [1] prints the boot tag only upon first init of the message buffer, swaps it over to printf, and adds a newline to whatever's been chosen as the boot tag. Thanks, Kyle Evans [1] https://people.freebsd.org/~kevans/bde-boottag.diff From owner-svn-src-head@freebsd.org Fri Aug 10 00:04:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D732D1077D5E; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C79E8EA31; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5373C208AB; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A04XmH064245; Fri, 10 Aug 2018 00:04:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A04XuX064244; Fri, 10 Aug 2018 00:04:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808100004.w7A04XuX064244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Aug 2018 00:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337558 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337558 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 00:04:34 -0000 Author: cy Date: Fri Aug 10 00:04:32 2018 New Revision: 337558 URL: https://svnweb.freebsd.org/changeset/base/337558 Log: Identify the return value (rval) that led to the IPv4 NAT failure in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in dtrace probes. This is currently being used to diagnose NAT failures in PR/208566. It's rather handy so this commit makes it available for future diagnosis and debugging efforts. PR: 208566 MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:01:21 2018 (r337557) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:04:32 2018 (r337558) @@ -4951,7 +4951,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto outmatchfail; case 1 : default : @@ -4996,7 +4996,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (nmsk < softn->ipf_nat_map_max)) { nmsk++; @@ -5021,15 +5021,23 @@ outmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4out, fr_info_t *, fin); + DT2(frb_natv4out, fr_info_t *, fin, int, rval); NBUMPSIDED(1, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(1, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(1, ns_ignored); @@ -5437,7 +5445,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto inmatchfail; case 1 : default : @@ -5484,7 +5492,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (rmsk < softn->ipf_nat_rdr_max)) { rmsk++; @@ -5509,15 +5517,23 @@ inmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4in, fr_info_t *, fin); + DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(0, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(0, ns_ignored); From owner-svn-src-head@freebsd.org Fri Aug 10 00:10:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F5E105202B; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2208EE9D; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B50F208DD; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A0AwXi066032; Fri, 10 Aug 2018 00:10:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A0AwWj066031; Fri, 10 Aug 2018 00:10:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808100010.w7A0AwWj066031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 00:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337559 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337559 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 00:10:58 -0000 Author: kevans Date: Fri Aug 10 00:10:57 2018 New Revision: 337559 URL: https://svnweb.freebsd.org/changeset/base/337559 Log: Makefile.inc1: Add libl to -legacy as well libl is needed for config(8), which is a bootstrap-tool. It is possible to build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still need to support building from this kind of host, though. While here, group the config(8) dependencies together and add a small explanation. These can likely both be scoped more clearly, but this will need some further investigation. Reported by: rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation) MFC after: immediately Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 10 00:04:32 2018 (r337558) +++ head/Makefile.inc1 Fri Aug 10 00:10:57 2018 (r337559) @@ -1943,13 +1943,17 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# libnv and libl are both requirements for config(8), which is an unconditional +# bootstrap-tool. +_config_deps= lib/libnv usr.bin/lex/lib + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} lib/libnv +.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ From owner-svn-src-head@freebsd.org Fri Aug 10 00:26:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C6F81052718; Fri, 10 Aug 2018 00:26:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id A7FD18F56A; Fri, 10 Aug 2018 00:25:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2DD3F4348F4; Fri, 10 Aug 2018 10:25:50 +1000 (AEST) Date: Fri, 10 Aug 2018 10:25:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337426 - head/sbin/ifconfig In-Reply-To: <201808071725.w77HPciT051597@repo.freebsd.org> Message-ID: <20180810092251.K1276@besplex.bde.org> References: <201808071725.w77HPciT051597@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=5lkVNKLIfOsGeeQGpCIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 00:26:00 -0000 On Tue, 7 Aug 2018, Mark Johnston wrote: > Log: > ifconfig: Fix use of _Noreturn. > > The _Noreturn is a function-specifier (like inline) which must preceed > the declarator. > > Submitted by: Sebastian Huber > MFC after: 1 week _Noreturn is even more broken than I knew. It should never be used. Here its use is wronger than usual. > Modified: head/sbin/ifconfig/ifconfig.c > ============================================================================== > --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) > +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > struct ifaddrs *ifa); > static void tunnel_status(int s); > -static void usage(void) _Noreturn; > +static _Noreturn void usage(void); > > static struct afswtch *af_getbyname(const char *name); > static struct afswtch *af_getbyfamily(int af); FreeBSD code should use __dead2 since it is more portable (within FreeBSD) and doesn't have so mean syntactical restrictions. However, it only exists at all since it had similar syntactial restrictions when it was new (FreeBSD-1 used __dead, which must be placed like _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed there when it was new), and the macro that hides the details was renamed to inhibit misuse. Changing __dead2 to _Noreturn and moving it to satisfy the restricted syntax of the latter mainly broke support for old compilers where __dead2 cannot be placed there. However, all declarations of static usage() as non-returning are bogus, and this one is more bogus than most since another style bug is to unsort usage() to before where it is used, so even 1-pass compilers can see that it doesn't return before generating code that uses it. Unsorting of inline functions is sometimes needed so that 1-pass compilers can optimize them, but optimizing usage() is especially not needed. Bruce From owner-svn-src-head@freebsd.org Fri Aug 10 00:30:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB7B10529A0; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7341A8F849; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55C3B20BD3; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A0UGod074532; Fri, 10 Aug 2018 00:30:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A0UG4e074531; Fri, 10 Aug 2018 00:30:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808100030.w7A0UG4e074531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Aug 2018 00:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337560 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337560 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 00:30:16 -0000 Author: cy Date: Fri Aug 10 00:30:15 2018 New Revision: 337560 URL: https://svnweb.freebsd.org/changeset/base/337560 Log: Correct a comment. Should have been detected by ipf_nat_in() not ipf_nat_out(). MFC after: 1 week X-MFC-with: r337558 Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:10:57 2018 (r337559) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:30:15 2018 (r337560) @@ -5524,7 +5524,7 @@ inmatchfail: /* retry_roundrobin loop failure */ /* FALLTHROUGH */ case -1 : - /* proxy failure detected by ipf_nat_out() */ + /* proxy failure detected by ipf_nat_in() */ if (passp != NULL) { DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); From owner-svn-src-head@freebsd.org Fri Aug 10 01:49:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774B91054CCF; Fri, 10 Aug 2018 01:49:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id C4F0D71DDA; Fri, 10 Aug 2018 01:49:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A92A93CA0D1; Fri, 10 Aug 2018 11:49:04 +1000 (AEST) Date: Fri, 10 Aug 2018 11:49:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kyle Evans cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: Message-ID: <20180810105239.J1482@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=QtvNg27y_NiTNPgunEoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 01:49:15 -0000 On Thu, 9 Aug 2018, Kyle Evans wrote: > On Thu, Aug 9, 2018 at 6:22 PM, Bruce Evans wrote: >> ... >> The only obvious bug in (a later version of) the output is a missing newline >> for the tag. >> >> My dmesg output on amd64: >> X ---<>------<>---Test of early printf to msgbuf >> X GDB: debug ports: sio >> X KDB: current port: sio >> X KDB: debugger backends: ddb gdb >> X KDB: current backend: ddb >> X Copyright (c) 1992-2018 The FreeBSD Project. >> X ... >> >> In -current, all of the lines before the copyright except the tag are broken >> by printf() of them to an unmapped msgbuf. (The above output is without -v. >> Many more lines are lost with -v.) In my version, msgbufinit() is called >> earlier with a small message buffer to hold the early output. > > I've not seen a compelling reason to switch this to printf() rather > than direct addition to the msgbuf after it's initialized, but I'll > humor you on this one because I don't really care either way and > you've been at this a lot longer than I have. Thanks. > When you say you call msgbufinit() earlier-- before the static > environment is even setup, or at least after that? The above is with a simplified version that first calls msgbufinit() after the static env is set up. In other working versions, msgbufinit() is called long before the static env is set up. In a commented out version, a small MI msgbuf is statically initalized so that some msgbuf is always mapped, but msgbufmapped still starts as 0 and msgbufinit() must still be called to synchronize. Some synchronization is needed since the msgbuf uses broken mutex locking and mutexes use curthread and curthread is not initialized early. The simplified versions delay the msgbufinit() calls until mutexes are initialized enough, and this accidentally moves them after other initializations. So the tunable is unavailable in the best version :-(. The small initial msgbuf could even start with the statically initialized buffer containing the tag, and must if it is to be ready to go without a synchronization call. I haven't really noticed the need for this feature. I edit /var/log/messages a lot and need to find the start of the data for each boot, and just grep for kern.bootfile. But this depends on the message buffer being clobbered by reboot, so that syslogd always adds the kern.bootfile message before the data for the new boot. When the data spans multiple boots, the kern.bootfile message is very misplaced timestamps are wrong for the old data, and ... >> Output across reboots also works right except for the missing newline: >> >> X ---<>------<>---Test of early printf to msgbuf >> .... >> X All buffers synced. >> X ---<>------<>---Test of early printf to msgbuf ... actually, the output across reboots doesn't work write (unless you modified dmesg and syslogd to use the tag to drop duplicates). dmesg show the old boot messages by default, but syslogd shouldn't log them again by default. > Right- I tried to maintain the form of the original patch and also > overlooked this. My revised patch [1] prints the boot tag only upon > first init of the message buffer, swaps it over to printf, and adds a > newline to whatever's been chosen as the boot tag. > > [1] https://people.freebsd.org/~kevans/bde-boottag.diff I won't have much time to check it for a few weeks. Bruce From owner-svn-src-head@freebsd.org Fri Aug 10 02:12:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B350F1055583; Fri, 10 Aug 2018 02:12:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 30E06728E9; Fri, 10 Aug 2018 02:12:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B0AA8D733C6; Fri, 10 Aug 2018 12:12:43 +1000 (AEST) Date: Fri, 10 Aug 2018 12:12:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: <20180810105239.J1482@besplex.bde.org> Message-ID: <20180810115339.X1652@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> <20180810105239.J1482@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=8fF8oHDZ2iCZZMA05wEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 02:12:53 -0000 On Fri, 10 Aug 2018, Bruce Evans wrote: > On Thu, 9 Aug 2018, Kyle Evans wrote: > ... >> When you say you call msgbufinit() earlier-- before the static >> environment is even setup, or at least after that? > > The above is with a simplified version that first calls msgbufinit() > after the static env is set up. In other working versions, msgbufinit() > is called long before the static env is set up. In a commented out > version, a small MI msgbuf is statically initalized so that some msgbuf > is always mapped, but msgbufmapped still starts as 0 and msgbufinit() > must still be called to synchronize. Some synchronization is needed > since the msgbuf uses broken mutex locking and mutexes use curthread and > curthread is not initialized early. The simplified versions delay the > msgbufinit() calls until mutexes are initialized enough, and this > accidentally moves them after other initializations. > > So the tunable is unavailable in the best version :-(. The small initial > msgbuf could even start with the statically initialized buffer containing > the tag, and must if it is to be ready to go without a synchronization call. The tag can be added later fairly easily, and this order corresponds to the problem being solved (that we don't know where the data for the new boot starts iff there is old data): - start with a small statically initialized msgbuf. No need for a tag; the new data starts at the start of the buffer - write new data to this buffer - reinit is not really initialization, but supplies data from the previous boot. Construct the new buffer as the concatenation of the old data, a tag to delimit the new data, then the new data. But I think a variable tag is worse than a fixed tag. With a fixed tag, it is easy for dmesg, syslogd and users to search for the tag and replace it by a better one determined using full runtime resources. E.g., use sed on /var/log/messages to find the last instance of the tag and replace it by something depending on the current context, while a tunable tag must be set earlier and then all utilities and methods for finding and modifying must understand its variations. Bruce From owner-svn-src-head@freebsd.org Fri Aug 10 02:25:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4C33105600D; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77AC2730F9; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 142C72ABF8; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id u14-v6so5533237lfu.0; Thu, 09 Aug 2018 19:25:35 -0700 (PDT) X-Gm-Message-State: AOUpUlGW7On0+0sHVYAskVS99GUSqC5lUKhn1hVbfygEKGu1zIKX0jy6 13R/u6eZLU68YtJuTzqacWSxx2R7oU+wHfdMKGs= X-Google-Smtp-Source: AA+uWPzMprydIxEsZvtQv3l/RCInGPF6P47UNrHbFXMrpZCwsvvMEC7xgJ32dqLksIqFrjIE60XZ1ujgUd/YdE9ompc= X-Received: by 2002:a19:1586:: with SMTP id 6-v6mr2879549lfv.51.1533867933683; Thu, 09 Aug 2018 19:25:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 19:25:13 -0700 (PDT) In-Reply-To: <20180810115339.X1652@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> <20180810105239.J1482@besplex.bde.org> <20180810115339.X1652@besplex.bde.org> From: Kyle Evans Date: Thu, 9 Aug 2018 21:25:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337518 - in head/sys: kern sys To: Bruce Evans Cc: src-committers , 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.27 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, 10 Aug 2018 02:25:36 -0000 On Thu, Aug 9, 2018 at 9:12 PM, Bruce Evans wrote: > On Fri, 10 Aug 2018, Bruce Evans wrote: > >> On Thu, 9 Aug 2018, Kyle Evans wrote: >> ... >>> >>> When you say you call msgbufinit() earlier-- before the static >>> environment is even setup, or at least after that? >> >> >> The above is with a simplified version that first calls msgbufinit() >> after the static env is set up. In other working versions, msgbufinit() >> is called long before the static env is set up. In a commented out >> version, a small MI msgbuf is statically initalized so that some msgbuf >> is always mapped, but msgbufmapped still starts as 0 and msgbufinit() >> must still be called to synchronize. Some synchronization is needed >> since the msgbuf uses broken mutex locking and mutexes use curthread and >> curthread is not initialized early. The simplified versions delay the >> msgbufinit() calls until mutexes are initialized enough, and this >> accidentally moves them after other initializations. >> >> So the tunable is unavailable in the best version :-(. The small initial >> msgbuf could even start with the statically initialized buffer containing >> the tag, and must if it is to be ready to go without a synchronization >> call. > > > The tag can be added later fairly easily, and this order corresponds to > the problem being solved (that we don't know where the data for the new boot > starts iff there is old data): > > - start with a small statically initialized msgbuf. No need for a tag; the > new data starts at the start of the buffer > - write new data to this buffer > - reinit is not really initialization, but supplies data from the previous > boot. Construct the new buffer as the concatenation of the old data, a > tag to delimit the new data, then the new data. > > But I think a variable tag is worse than a fixed tag. With a fixed tag, > it is easy for dmesg, syslogd and users to search for the tag and replace > it by a better one determined using full runtime resources. E.g., use > sed on /var/log/messages to find the last instance of the tag and replace > it by something depending on the current context, while a tunable tag must > be set earlier and then all utilities and methods for finding and modifying > must understand its variations. > I honestly have very low expectations for the tunable's use, but it's a low-cost addition and I find it more useful in a less automated context. One that I've had recently would have been implemented with the following process: 1. Boot -v into installed kernel with normal tag, ---<>-- 2. Briefly review `dmesg`, notice issue with clock driver 3. Install new kernel with changes to said clock driver. Tag it ---<>--, boot -v 4. Review `dmesg` again to observe changes The non-standard tag would certainly be an anomaly, but it gives me the benefit of discerning a standard boot from this one in which I fiddled with the A20 clock driver without having to compile a non-standard boot tag into the kernel. It also gives me a clear indicator as I'm paging through output to quickly at-a-glance realize that I've reached a new (or the correct) boot. I'll likely commit the modified version soon, anyways, and we can hash out any further details after 12 branches. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Aug 10 03:28:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C1A9105794B; Fri, 10 Aug 2018 03:28:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D30A875C19; Fri, 10 Aug 2018 03:28:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B439B22961; Fri, 10 Aug 2018 03:28:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A3SecG067472; Fri, 10 Aug 2018 03:28:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A3Sebe067471; Fri, 10 Aug 2018 03:28:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808100328.w7A3Sebe067471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Aug 2018 03:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337562 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 337562 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 03:28:41 -0000 Author: jhibbits Date: Fri Aug 10 03:28:40 2018 New Revision: 337562 URL: https://svnweb.freebsd.org/changeset/base/337562 Log: powerpc: Add lwsync and ptesync 'sync' opcode variants to ddb disassembler The canonical form of sync is: sync L, E (if Category Elemental Memory Barriers implemented) The L bits (2) denote the type of sync: 0 -- hwsync 1 -- lwsync 2 -- ptesync or hwsync It's been found that most 32-bit CPUs designed prior to the introduction of lwsync will ignore the L bits. However, some cores, particularly the e500 core, will trigger an illegal instruction exception. Adding these variants will make it easier to see which sync variant is actually being used in case of a trap. Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Fri Aug 10 01:43:05 2018 (r337561) +++ head/sys/powerpc/powerpc/db_disasm.c Fri Aug 10 03:28:40 2018 (r337562) @@ -310,7 +310,9 @@ const struct opcode opcodes_1f[] = { { "lfsux", 0xfc0007fe, 0x7c00046e, Op_D | Op_A | Op_B }, { "mfsr", 0xfc0007fe, 0x7c0004a6, Op_D | Op_SR }, { "lswi", 0xfc0007fe, 0x7c0004aa, Op_D | Op_A | Op_NB }, - { "sync", 0xfc0007fe, 0x7c0004ac, 0 }, + { "sync", 0xfc6007fe, 0x7c0004ac, 0 }, + { "lwsync", 0xfc6007fe, 0x7c2004ac, 0 }, + { "ptesync", 0xfc6007fe, 0x7c4004ac, 0 }, { "lfdx", 0xfc0007fe, 0x7c0004ae, Op_D | Op_A | Op_B }, { "lfdux", 0xfc0007fe, 0x7c0004ee, Op_D | Op_A | Op_B }, { "mfsrin", 0xfc0007fe, 0x7c000526, Op_D | Op_B }, From owner-svn-src-head@freebsd.org Fri Aug 10 06:28:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86057105DDB8; Fri, 10 Aug 2018 06:28:26 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261CC7B4E5; Fri, 10 Aug 2018 06:28:26 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE64E24657; Fri, 10 Aug 2018 06:28:25 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A6SPYR059662; Fri, 10 Aug 2018 06:28:25 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A6SPvl059661; Fri, 10 Aug 2018 06:28:25 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201808100628.w7A6SPvl059661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Fri, 10 Aug 2018 06:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337566 - head/tools/tools/sysbuild X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/tools/tools/sysbuild X-SVN-Commit-Revision: 337566 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 06:28:26 -0000 Author: phk Date: Fri Aug 10 06:28:25 2018 New Revision: 337566 URL: https://svnweb.freebsd.org/changeset/base/337566 Log: Make distribution now happens from top of source tree. Silence debugging output Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Fri Aug 10 06:11:04 2018 (r337565) +++ head/tools/tools/sysbuild/sysbuild.sh Fri Aug 10 06:28:25 2018 (r337566) @@ -204,7 +204,7 @@ ports_recurse() ( echo "Missing port $d ($t) (fl $fl) (bd $bd)" 1>&2 continue fi - echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2 + # echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2 d=$bd fi d=`cd /usr/ports && cd $d && /bin/pwd` @@ -549,7 +549,7 @@ log_it Installworld > ${SBMNT}/_.iw 2>&1 log_it distribution -(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} ${SRCCONF} ) \ +(cd /usr/src && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} ${SRCCONF} ) \ > ${SBMNT}/_.dist 2>&1 log_it Installkernel From owner-svn-src-head@freebsd.org Fri Aug 10 06:42:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9CA2105EEDE; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2567BF02; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB6924989; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A6gDxl066714; Fri, 10 Aug 2018 06:42:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A6g9Mq066690; Fri, 10 Aug 2018 06:42:09 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808100642.w7A6g9Mq066690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 10 Aug 2018 06:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337567 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolari... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys s... X-SVN-Commit-Revision: 337567 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 06:42:14 -0000 Author: mmacy Date: Fri Aug 10 06:42:08 2018 New Revision: 337567 URL: https://svnweb.freebsd.org/changeset/base/337567 Log: Performance optimization of AVL tree comparator functions MFV: commit ee36c709c3d5f7040e1bd11f5c75318aa03e789f Author: Gvozden Neskovic Date: Sat Aug 27 20:12:53 2016 +0200 perf: 2.75x faster ddt_entry_compare() First 256bits of ddt_key_t is a block checksum, which are expected to be close to random data. Hence, on average, comparison only needs to look at first few bytes of the keys. To reduce number of conditional jump instructions, the result is computed as: sign(memcmp(k1, k2)). Sign of an integer 'a' can be obtained as: `(0 < a) - (a < 0)` := {-1, 0, 1} , which is computed efficiently. Synthetic performance evaluation of original and new algorithm over 1G random keys on 2.6GHz Intel(R) Xeon(R) CPU E5-2660 v3: old 6.85789 s new 2.49089 s perf: 2.8x faster vdev_queue_offset_compare() and vdev_queue_timestamp_compare() Compute the result directly instead of using conditionals perf: zfs_range_compare() Speedup between 1.1x - 2.5x, depending on compiler version and optimization level. perf: spa_error_entry_compare() `bcmp()` is not suitable for comparator use. Use `memcmp()` instead. perf: 2.8x faster metaslab_compare() and metaslab_rangesize_compare() perf: 2.8x faster zil_bp_compare() perf: 2.8x faster mze_compare() perf: faster dbuf_compare() perf: faster compares in spa_misc perf: 2.8x faster layout_hash_compare() perf: 2.8x faster space_reftree_compare() perf: libzfs: faster avl tree comparators perf: guid_compare() perf: dsl_deadlist_compare() perf: perm_set_compare() perf: 2x faster range_tree_seg_compare() perf: faster unique_compare() perf: faster vdev_cache _compare() perf: faster vdev_uberblock_compare() perf: faster fuid _compare() perf: faster zfs_znode_hold_compare() Signed-off-by: Gvozden Neskovic Signed-off-by: Richard Elling Signed-off-by: Brian Behlendorf Closes #5033 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 06:42:08 2018 (r337567) @@ -787,15 +787,13 @@ typedef struct mnttab_node { static int libzfs_mnttab_cache_compare(const void *arg1, const void *arg2) { - const mnttab_node_t *mtn1 = arg1; - const mnttab_node_t *mtn2 = arg2; + const mnttab_node_t *mtn1 = (const mnttab_node_t *)arg1; + const mnttab_node_t *mtn2 = (const mnttab_node_t *)arg2; int rv; rv = strcmp(mtn1->mtn_mt.mnt_special, mtn2->mtn_mt.mnt_special); - if (rv == 0) - return (0); - return (rv > 0 ? 1 : -1); + return (AVL_ISIGN(rv)); } void Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 06:42:08 2018 (r337567) @@ -272,12 +272,7 @@ zfs_snapshot_compare(const void *larg, const void *rar lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG); rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG); - if (lcreate < rcreate) - return (-1); - else if (lcreate > rcreate) - return (+1); - else - return (0); + return (AVL_CMP(lcreate, rcreate)); } int Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 06:42:08 2018 (r337567) @@ -489,15 +489,10 @@ typedef struct fsavl_node { static int fsavl_compare(const void *arg1, const void *arg2) { - const fsavl_node_t *fn1 = arg1; - const fsavl_node_t *fn2 = arg2; + const fsavl_node_t *fn1 = (const fsavl_node_t *)arg1; + const fsavl_node_t *fn2 = (const fsavl_node_t *)arg2; - if (fn1->fn_guid > fn2->fn_guid) - return (+1); - else if (fn1->fn_guid < fn2->fn_guid) - return (-1); - else - return (0); + return (AVL_CMP(fn1->fn_guid, fn2->fn_guid)); } /* Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 06:42:08 2018 (r337567) @@ -670,6 +670,9 @@ extern zoneid_t getzoneid(void); #define root_mount_wait() do { } while (0) #define root_mounted() (1) +#define noinline __attribute__((noinline)) +#define likely(x) __builtin_expect((x), 1) + struct file { void *dummy; }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1906,14 +1906,10 @@ typedef struct guid_map_entry { static int guid_compare(const void *arg1, const void *arg2) { - const guid_map_entry_t *gmep1 = arg1; - const guid_map_entry_t *gmep2 = arg2; + const guid_map_entry_t *gmep1 = (const guid_map_entry_t *)arg1; + const guid_map_entry_t *gmep2 = (const guid_map_entry_t *)arg2; - if (gmep1->guid < gmep2->guid) - return (-1); - else if (gmep1->guid > gmep2->guid) - return (1); - return (0); + return (AVL_CMP(gmep1->guid, gmep2->guid)); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Aug 10 06:42:08 2018 (r337567) @@ -78,19 +78,13 @@ dbuf_compare(const void *x1, const void *x2) const dmu_buf_impl_t *d1 = x1; const dmu_buf_impl_t *d2 = x2; - if (d1->db_level < d2->db_level) { - return (-1); - } - if (d1->db_level > d2->db_level) { - return (1); - } + int cmp = AVL_CMP(d1->db_level, d2->db_level); + if (likely(cmp)) + return (cmp); - if (d1->db_blkid < d2->db_blkid) { - return (-1); - } - if (d1->db_blkid > d2->db_blkid) { - return (1); - } + cmp = AVL_CMP(d1->db_blkid, d2->db_blkid); + if (likely(cmp)) + return (cmp); if (d1->db_state == DB_SEARCH) { ASSERT3S(d2->db_state, !=, DB_SEARCH); @@ -100,13 +94,7 @@ dbuf_compare(const void *x1, const void *x2) return (1); } - if ((uintptr_t)d1 < (uintptr_t)d2) { - return (-1); - } - if ((uintptr_t)d1 > (uintptr_t)d2) { - return (1); - } - return (0); + return (AVL_PCMP(d1, d2)); } /* ARGSUSED */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Fri Aug 10 06:42:08 2018 (r337567) @@ -55,15 +55,10 @@ static int dsl_deadlist_compare(const void *arg1, const void *arg2) { - const dsl_deadlist_entry_t *dle1 = arg1; - const dsl_deadlist_entry_t *dle2 = arg2; + const dsl_deadlist_entry_t *dle1 = (const dsl_deadlist_entry_t *)arg1; + const dsl_deadlist_entry_t *dle2 = (const dsl_deadlist_entry_t *)arg2; - if (dle1->dle_mintxg < dle2->dle_mintxg) - return (-1); - else if (dle1->dle_mintxg > dle2->dle_mintxg) - return (+1); - else - return (0); + return (AVL_CMP(dle1->dle_mintxg, dle2->dle_mintxg)); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c Fri Aug 10 06:42:08 2018 (r337567) @@ -384,14 +384,13 @@ typedef struct perm_set { static int perm_set_compare(const void *arg1, const void *arg2) { - const perm_set_t *node1 = arg1; - const perm_set_t *node2 = arg2; + const perm_set_t *node1 = (const perm_set_t *)arg1; + const perm_set_t *node2 = (const perm_set_t *)arg2; int val; val = strcmp(node1->p_setname, node2->p_setname); - if (val == 0) - return (0); - return (val > 0 ? 1 : -1); + + return (AVL_ISIGN(val)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 10 06:42:08 2018 (r337567) @@ -541,8 +541,8 @@ metaslab_class_expandable_space(metaslab_class_t *mc) static int metaslab_compare(const void *x1, const void *x2) { - const metaslab_t *m1 = x1; - const metaslab_t *m2 = x2; + const metaslab_t *m1 = (const metaslab_t *)x1; + const metaslab_t *m2 = (const metaslab_t *)x2; int sort1 = 0; int sort2 = 0; @@ -568,22 +568,13 @@ metaslab_compare(const void *x1, const void *x2) if (sort1 > sort2) return (1); - if (m1->ms_weight < m2->ms_weight) - return (1); - if (m1->ms_weight > m2->ms_weight) - return (-1); + int cmp = AVL_CMP(m2->ms_weight, m1->ms_weight); + if (likely(cmp)) + return (cmp); - /* - * If the weights are identical, use the offset to force uniqueness. - */ - if (m1->ms_start < m2->ms_start) - return (-1); - if (m1->ms_start > m2->ms_start) - return (1); + IMPLY(AVL_CMP(m1->ms_start, m2->ms_start) == 0, m1 == m2); - ASSERT3P(m1, ==, m2); - - return (0); + return (AVL_CMP(m1->ms_start, m2->ms_start)); } /* @@ -1195,18 +1186,14 @@ metaslab_rangesize_compare(const void *x1, const void uint64_t rs_size1 = r1->rs_end - r1->rs_start; uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (rs_size1 < rs_size2) - return (-1); - if (rs_size1 > rs_size2) - return (1); + int cmp = AVL_CMP(rs_size1, rs_size2); + if (likely(cmp)) + return (cmp); if (r1->rs_start < r2->rs_start) return (-1); - if (r1->rs_start > r2->rs_start) - return (1); - - return (0); + return (AVL_CMP(r1->rs_start, r2->rs_start)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 10 06:42:08 2018 (r337567) @@ -242,31 +242,23 @@ sa_cache_fini(void) static int layout_num_compare(const void *arg1, const void *arg2) { - const sa_lot_t *node1 = arg1; - const sa_lot_t *node2 = arg2; + const sa_lot_t *node1 = (const sa_lot_t *)arg1; + const sa_lot_t *node2 = (const sa_lot_t *)arg2; - if (node1->lot_num > node2->lot_num) - return (1); - else if (node1->lot_num < node2->lot_num) - return (-1); - return (0); + return (AVL_CMP(node1->lot_num, node2->lot_num)); } static int layout_hash_compare(const void *arg1, const void *arg2) { - const sa_lot_t *node1 = arg1; - const sa_lot_t *node2 = arg2; + const sa_lot_t *node1 = (const sa_lot_t *)arg1; + const sa_lot_t *node2 = (const sa_lot_t *)arg2; - if (node1->lot_hash > node2->lot_hash) - return (1); - if (node1->lot_hash < node2->lot_hash) - return (-1); - if (node1->lot_instance > node2->lot_instance) - return (1); - if (node1->lot_instance < node2->lot_instance) - return (-1); - return (0); + int cmp = AVL_CMP(node1->lot_hash, node2->lot_hash); + if (likely(cmp)) + return (cmp); + + return (AVL_CMP(node1->lot_instance, node2->lot_instance)); } boolean_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 06:42:08 2018 (r337567) @@ -905,19 +905,14 @@ spa_change_guid(spa_t *spa) static int spa_error_entry_compare(const void *a, const void *b) { - spa_error_entry_t *sa = (spa_error_entry_t *)a; - spa_error_entry_t *sb = (spa_error_entry_t *)b; + const spa_error_entry_t *sa = (const spa_error_entry_t *)a; + const spa_error_entry_t *sb = (const spa_error_entry_t *)b; int ret; - ret = bcmp(&sa->se_bookmark, &sb->se_bookmark, + ret = memcmp(&sa->se_bookmark, &sb->se_bookmark, sizeof (zbookmark_phys_t)); - if (ret < 0) - return (-1); - else if (ret > 0) - return (1); - else - return (0); + return (AVL_ISIGN(ret)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1016,18 +1016,13 @@ typedef struct spa_aux { int aux_count; } spa_aux_t; -static int +static inline int spa_aux_compare(const void *a, const void *b) { - const spa_aux_t *sa = a; - const spa_aux_t *sb = b; + const spa_aux_t *sa = (const spa_aux_t *)a; + const spa_aux_t *sb = (const spa_aux_t *)b; - if (sa->aux_guid < sb->aux_guid) - return (-1); - else if (sa->aux_guid > sb->aux_guid) - return (1); - else - return (0); + return (AVL_CMP(sa->aux_guid, sb->aux_guid)); } void @@ -2053,11 +2048,8 @@ spa_name_compare(const void *a1, const void *a2) int s; s = strcmp(s1->spa_name, s2->spa_name); - if (s > 0) - return (1); - if (s < 0) - return (-1); - return (0); + + return (AVL_ISIGN(s)); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Aug 10 06:42:08 2018 (r337567) @@ -54,20 +54,14 @@ static int space_reftree_compare(const void *x1, const void *x2) { - const space_ref_t *sr1 = x1; - const space_ref_t *sr2 = x2; + const space_ref_t *sr1 = (const space_ref_t *)x1; + const space_ref_t *sr2 = (const space_ref_t *)x2; - if (sr1->sr_offset < sr2->sr_offset) - return (-1); - if (sr1->sr_offset > sr2->sr_offset) - return (1); + int cmp = AVL_CMP(sr1->sr_offset, sr2->sr_offset); + if (likely(cmp)) + return (cmp); - if (sr1 < sr2) - return (-1); - if (sr1 > sr2) - return (1); - - return (0); + return (AVL_PCMP(sr1, sr2)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Fri Aug 10 06:42:08 2018 (r337567) @@ -146,4 +146,7 @@ extern struct mtx zfs_debug_mtx; #define sys_shutdown rebooting +#define noinline __attribute__((noinline)) +#define likely(x) __builtin_expect((x), 1) + #endif /* _SYS_ZFS_CONTEXT_H */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c Fri Aug 10 06:42:08 2018 (r337567) @@ -42,14 +42,10 @@ typedef struct unique { static int unique_compare(const void *a, const void *b) { - const unique_t *una = a; - const unique_t *unb = b; + const unique_t *una = (const unique_t *)a; + const unique_t *unb = (const unique_t *)b; - if (una->un_value < unb->un_value) - return (-1); - if (una->un_value > unb->un_value) - return (+1); - return (0); + return (AVL_CMP(una->un_value, unb->un_value)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1047,19 +1047,13 @@ retry: * among uberblocks with equal txg, choose the one with the latest timestamp. */ static int -vdev_uberblock_compare(uberblock_t *ub1, uberblock_t *ub2) +vdev_uberblock_compare(const uberblock_t *ub1, const uberblock_t *ub2) { - if (ub1->ub_txg < ub2->ub_txg) - return (-1); - if (ub1->ub_txg > ub2->ub_txg) - return (1); + int cmp = AVL_CMP(ub1->ub_txg, ub2->ub_txg); + if (likely(cmp)) + return (cmp); - if (ub1->ub_timestamp < ub2->ub_timestamp) - return (-1); - if (ub1->ub_timestamp > ub2->ub_timestamp) - return (1); - - return (0); + return (AVL_CMP(ub1->ub_timestamp, ub2->ub_timestamp)); } struct ubl_cbdata { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Aug 10 06:42:08 2018 (r337567) @@ -311,20 +311,15 @@ sysctl_zfs_async_write_active_max_dirty_percent(SYSCTL int vdev_queue_offset_compare(const void *x1, const void *x2) { - const zio_t *z1 = x1; - const zio_t *z2 = x2; + const zio_t *z1 = (const zio_t *)x1; + const zio_t *z2 = (const zio_t *)x2; - if (z1->io_offset < z2->io_offset) - return (-1); - if (z1->io_offset > z2->io_offset) - return (1); + int cmp = AVL_CMP(z1->io_offset, z2->io_offset); - if (z1 < z2) - return (-1); - if (z1 > z2) - return (1); + if (likely(cmp)) + return (cmp); - return (0); + return (AVL_PCMP(z1, z2)); } static inline avl_tree_t * Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Aug 10 06:42:08 2018 (r337567) @@ -281,15 +281,11 @@ mze_compare(const void *arg1, const void *arg2) const mzap_ent_t *mze1 = arg1; const mzap_ent_t *mze2 = arg2; - if (mze1->mze_hash > mze2->mze_hash) - return (+1); - if (mze1->mze_hash < mze2->mze_hash) - return (-1); - if (mze1->mze_cd > mze2->mze_cd) - return (+1); - if (mze1->mze_cd < mze2->mze_cd) - return (-1); - return (0); + int cmp = AVL_CMP(mze1->mze_hash, mze2->mze_hash); + if (likely(cmp)) + return (cmp); + + return (AVL_CMP(mze1->mze_cd, mze2->mze_cd)); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Fri Aug 10 06:42:08 2018 (r337567) @@ -71,14 +71,10 @@ static char *nulldomain = ""; static int idx_compare(const void *arg1, const void *arg2) { - const fuid_domain_t *node1 = arg1; - const fuid_domain_t *node2 = arg2; + const fuid_domain_t *node1 = (const fuid_domain_t *)arg1; + const fuid_domain_t *node2 = (const fuid_domain_t *)arg2; - if (node1->f_idx < node2->f_idx) - return (-1); - else if (node1->f_idx > node2->f_idx) - return (1); - return (0); + return (AVL_CMP(node1->f_idx, node2->f_idx)); } /* @@ -87,14 +83,13 @@ idx_compare(const void *arg1, const void *arg2) static int domain_compare(const void *arg1, const void *arg2) { - const fuid_domain_t *node1 = arg1; - const fuid_domain_t *node2 = arg2; + const fuid_domain_t *node1 = (const fuid_domain_t *)arg1; + const fuid_domain_t *node2 = (const fuid_domain_t *)arg2; int val; val = strcmp(node1->f_ksid->kd_name, node2->f_ksid->kd_name); - if (val == 0) - return (0); - return (val > 0 ? 1 : -1); + + return (AVL_ISIGN(val)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Aug 10 06:42:08 2018 (r337567) @@ -594,12 +594,8 @@ zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len) int zfs_range_compare(const void *arg1, const void *arg2) { - const rl_t *rl1 = arg1; - const rl_t *rl2 = arg2; + const rl_t *rl1 = (const rl_t *)arg1; + const rl_t *rl2 = (const rl_t *)arg2; - if (rl1->r_off > rl2->r_off) - return (1); - if (rl1->r_off < rl2->r_off) - return (-1); - return (0); + return (AVL_CMP(rl1->r_off, rl2->r_off)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Aug 10 06:42:08 2018 (r337567) @@ -131,17 +131,11 @@ zil_bp_compare(const void *x1, const void *x2) const dva_t *dva1 = &((zil_bp_node_t *)x1)->zn_dva; const dva_t *dva2 = &((zil_bp_node_t *)x2)->zn_dva; - if (DVA_GET_VDEV(dva1) < DVA_GET_VDEV(dva2)) - return (-1); - if (DVA_GET_VDEV(dva1) > DVA_GET_VDEV(dva2)) - return (1); + int cmp = AVL_CMP(DVA_GET_VDEV(dva1), DVA_GET_VDEV(dva2)); + if (likely(cmp)) + return (cmp); - if (DVA_GET_OFFSET(dva1) < DVA_GET_OFFSET(dva2)) - return (-1); - if (DVA_GET_OFFSET(dva1) > DVA_GET_OFFSET(dva2)) - return (1); - - return (0); + return (AVL_CMP(DVA_GET_OFFSET(dva1), DVA_GET_OFFSET(dva2))); } static void @@ -503,12 +497,7 @@ zil_lwb_vdev_compare(const void *x1, const void *x2) const uint64_t v1 = ((zil_vdev_node_t *)x1)->zv_vdev; const uint64_t v2 = ((zil_vdev_node_t *)x2)->zv_vdev; - if (v1 < v2) - return (-1); - if (v1 > v2) - return (1); - - return (0); + return (AVL_CMP(v1, v2)); } static lwb_t * @@ -1626,12 +1615,7 @@ zil_aitx_compare(const void *x1, const void *x2) const uint64_t o1 = ((itx_async_node_t *)x1)->ia_foid; const uint64_t o2 = ((itx_async_node_t *)x2)->ia_foid; - if (o1 < o2) - return (-1); - if (o1 > o2) - return (1); - - return (0); + return (AVL_CMP(o1, o2)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri Aug 10 06:42:08 2018 (r337567) @@ -107,6 +107,14 @@ extern "C" { /* + * AVL comparator helpers + */ +#define AVL_ISIGN(a) (((a) > 0) - ((a) < 0)) +#define AVL_CMP(a, b) (((a) > (b)) - ((a) < (b))) +#define AVL_PCMP(a, b) \ + (((uintptr_t)(a) > (uintptr_t)(b)) - ((uintptr_t)(a) < (uintptr_t)(b))) + +/* * Type used for the root of the AVL tree. */ typedef struct avl_tree avl_tree_t; From owner-svn-src-head@freebsd.org Fri Aug 10 07:24:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C54F105F9C4; Fri, 10 Aug 2018 07:24:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDF777CF61; Fri, 10 Aug 2018 07:24:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C96C825019; Fri, 10 Aug 2018 07:24:01 +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 w7A7O1rr090208; Fri, 10 Aug 2018 07:24:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A7O1aQ090207; Fri, 10 Aug 2018 07:24:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808100724.w7A7O1aQ090207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Aug 2018 07:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337568 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337568 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 07:24:02 -0000 Author: ae Date: Fri Aug 10 07:24:01 2018 New Revision: 337568 URL: https://svnweb.freebsd.org/changeset/base/337568 Log: Remove unneeded ipsec-related includes. Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D16637 Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Fri Aug 10 06:42:08 2018 (r337567) +++ head/sys/netinet/tcp_hpts.c Fri Aug 10 07:24:01 2018 (r337568) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipsec.h" #include "opt_tcpdebug.h" /** * Some notes about usage. @@ -164,10 +163,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef ipsec -#include -#include -#endif /* ipsec */ #include "opt_rss.h" MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); From owner-svn-src-head@freebsd.org Fri Aug 10 10:37:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F1310661F2; Fri, 10 Aug 2018 10:37:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECFF98470E; Fri, 10 Aug 2018 10:37:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE02526F72; Fri, 10 Aug 2018 10:37:25 +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 w7AAbPIP091446; Fri, 10 Aug 2018 10:37:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AAbPjX091445; Fri, 10 Aug 2018 10:37:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201808101037.w7AAbPjX091445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Aug 2018 10:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337569 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 337569 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 10:37:26 -0000 Author: emaste Date: Fri Aug 10 10:37:25 2018 New Revision: 337569 URL: https://svnweb.freebsd.org/changeset/base/337569 Log: readelf: display NT_GNU_PROPERTY_TYPE_0 note name NT_GNU_PROPERTY_TYPE_0 in a .note.gnu.property section "contains a program property note which describes special handling requirements for linker and run-time loader." (from the System V Application Binary Interface - Linux Extensions") Intel CET uses two processor-specific program properties in NT_GNU_PROPERTY_TYPE_0: GNU_PROPERTY_X86_FEATURE_1_IBT to indicate that all executable sections are compatible with Indirect Branch Tracking, and GNU_PROPERTY_X86_FEATURE_1_SHSTK to indicate that sections are compatible with shadow stack. A later change should add decoding of the individual properties. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 07:24:01 2018 (r337568) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 10:37:25 2018 (r337569) @@ -1189,6 +1189,7 @@ note_type_gnu(unsigned int nt) case 2: return "NT_GNU_HWCAP (Hardware capabilities)"; case 3: return "NT_GNU_BUILD_ID (Build id set by ld(1))"; case 4: return "NT_GNU_GOLD_VERSION (GNU gold version)"; + case 5: return "NT_GNU_PROPERTY_TYPE_0"; default: return (note_type_unknown(nt)); } } From owner-svn-src-head@freebsd.org Fri Aug 10 13:06:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED4F4106A78E; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95E258A0CD; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7234E836; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AD6Eof068613; Fri, 10 Aug 2018 13:06:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AD6EnG068612; Fri, 10 Aug 2018 13:06:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101306.w7AD6EnG068612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337570 - head/sys/dev/bwi X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/bwi X-SVN-Commit-Revision: 337570 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 13:06:15 -0000 Author: kevans Date: Fri Aug 10 13:06:14 2018 New Revision: 337570 URL: https://svnweb.freebsd.org/changeset/base/337570 Log: bwi(4): Set ic->ic_softc before bwi_getradiocaps to avoid bad deref Submitted by: François Revol Obtained from: Haiku (ba88131cfde64e21bedb4ebedd699cfa5e7fd314) MFC after: 1 week Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Fri Aug 10 10:37:25 2018 (r337569) +++ head/sys/dev/bwi/if_bwi.c Fri Aug 10 13:06:14 2018 (r337570) @@ -490,10 +490,12 @@ bwi_attach(struct bwi_softc *sc) BWI_SPROM_CARD_INFO_LOCALE); DPRINTF(sc, BWI_DBG_ATTACH, "locale: %d\n", sc->sc_locale); /* XXX use locale */ + + ic->ic_softc = sc; + bwi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, ic->ic_channels); - ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_SHSLOT | From owner-svn-src-head@freebsd.org Fri Aug 10 13:32:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0077C106B264; Fri, 10 Aug 2018 13:32:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB3BC8AE01; Fri, 10 Aug 2018 13:32:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D072CC9; Fri, 10 Aug 2018 13:32:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADW24k081557; Fri, 10 Aug 2018 13:32:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADW2Z6081556; Fri, 10 Aug 2018 13:32:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101332.w7ADW2Z6081556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337571 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 337571 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 13:32:03 -0000 Author: kevans Date: Fri Aug 10 13:32:02 2018 New Revision: 337571 URL: https://svnweb.freebsd.org/changeset/base/337571 Log: net80211: Drain ageq before cleaning it up. The comment above ieee80211_ageq_cleanup specifically notes that the queue is assumed to be empty, and in order to make it so, ieee80211_ageq_drain must be used. Submitted by: Augustin Cavalier Obtained from: Haiku (dffc3e235360cd7b71261239ee8507b7d62a1471) MFC after: 1 week Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Aug 10 13:06:14 2018 (r337570) +++ head/sys/net80211/ieee80211_node.c Fri Aug 10 13:32:02 2018 (r337571) @@ -137,6 +137,7 @@ ieee80211_node_detach(struct ieee80211com *ic) callout_drain(&ic->ic_inact); ieee80211_node_table_cleanup(&ic->ic_sta); + ieee80211_ageq_drain(&ic->ic_stageq); ieee80211_ageq_cleanup(&ic->ic_stageq); } From owner-svn-src-head@freebsd.org Fri Aug 10 13:34:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2AC4106B339; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 636938AFFF; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E9C1CFE; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADYO3K084144; Fri, 10 Aug 2018 13:34:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADYOBr084143; Fri, 10 Aug 2018 13:34:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101334.w7ADYOBr084143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337572 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 337572 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 13:34:24 -0000 Author: kevans Date: Fri Aug 10 13:34:23 2018 New Revision: 337572 URL: https://svnweb.freebsd.org/changeset/base/337572 Log: ieee8021_node: fix whitespace issues Submitted by: Augustin Cavalier Obtained from: Haiku (dffc3e235360cd7b71261239ee8507b7d62a1471) MFC after: 1 week Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Aug 10 13:32:02 2018 (r337571) +++ head/sys/net80211/ieee80211_node.c Fri Aug 10 13:34:23 2018 (r337572) @@ -32,13 +32,13 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" #include -#include -#include +#include +#include #include #include #include - + #include #include #include @@ -203,7 +203,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) } } -/* +/* * Port authorize/unauthorize interfaces for use by an authenticator. */ @@ -379,7 +379,7 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen); #endif } - /* + /* * Fix the channel and related attributes. */ /* clear DFS CAC state on previous channel */ @@ -571,8 +571,8 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee8 printf("%s\n", fail & 0x10 ? "!" : ""); } #endif /* IEEE80211_DEBUG */ - + int ieee80211_ibss_merge_check(struct ieee80211_node *ni) { @@ -880,7 +880,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the * mode is locked. - */ + */ ieee80211_reset_erp(ic); ieee80211_wme_initparams(vap); @@ -1678,7 +1678,7 @@ ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, /* * In adhoc demo mode there are no management * frames to use to discover neighbor capabilities, - * so blindly propagate the local configuration + * so blindly propagate the local configuration * so we can do interesting things (e.g. use * WME to disable ACK's). */ @@ -2352,7 +2352,7 @@ timeout_stations(void *arg __unused, struct ieee80211_ /* XXX before inact decrement? */ if (ni == vap->iv_bss) return; - if (ni->ni_associd != 0 || + if (ni->ni_associd != 0 || (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO)) { /* From owner-svn-src-head@freebsd.org Fri Aug 10 13:38:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6315106B3EC; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE898B1F3; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CD20D06; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADcNkJ084396; Fri, 10 Aug 2018 13:38:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADcNZr084395; Fri, 10 Aug 2018 13:38:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101338.w7ADcNZr084395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337573 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 337573 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 13:38:25 -0000 Author: kevans Date: Fri Aug 10 13:38:23 2018 New Revision: 337573 URL: https://svnweb.freebsd.org/changeset/base/337573 Log: ath: Minor style cleanups device_printf => DPRINTF and two whitespace adjustments Submitted by: Augustin Cavalier Obtained from: Haiku (4a88aa503ad4155a20931e263d24343043994ea9) MFC after: 1 week Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Fri Aug 10 13:34:23 2018 (r337572) +++ head/sys/dev/ath/if_ath_rx_edma.c Fri Aug 10 13:38:23 2018 (r337573) @@ -168,7 +168,7 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) ath_hal_setrxfilter(ah, 0); /* - * + * */ if (ath_hal_stopdmarecv(ah) == AH_TRUE) sc->sc_rx_stopped = 1; @@ -729,7 +729,7 @@ ath_edma_rxbuf_alloc(struct ath_softc *sc) bf = TAILQ_FIRST(&sc->sc_rxbuf); /* XXX shouldn't happen upon startup? */ if (bf == NULL) { - device_printf(sc->sc_dev, "%s: nothing on rxbuf?!\n", + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: nothing on rxbuf?!\n", __func__); return (NULL); } @@ -810,7 +810,7 @@ ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUE bf = ath_edma_rxbuf_alloc(sc); /* XXX should ensure the FIFO is not NULL? */ if (bf == NULL) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n", __func__, qtype, @@ -927,7 +927,7 @@ ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEU device_printf(sc->sc_dev, "%s: called; qtype=%d\n", __func__, qtype); - + free(re->m_fifo, M_ATHDEV); return (0); From owner-svn-src-head@freebsd.org Fri Aug 10 14:10:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744E1106BE1F; Fri, 10 Aug 2018 14:10:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0438C440; Fri, 10 Aug 2018 14:10: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082FB120C; Fri, 10 Aug 2018 14:10:23 +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 w7AEAMTo000391; Fri, 10 Aug 2018 14:10:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AEAMl0000389; Fri, 10 Aug 2018 14:10:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808101410.w7AEAMl0000389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Aug 2018 14:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337574 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 337574 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 14:10:23 -0000 Author: ae Date: Fri Aug 10 14:10:22 2018 New Revision: 337574 URL: https://svnweb.freebsd.org/changeset/base/337574 Log: Restore the behaviour changed in r337536, when bad `ipfw delete` command returns error. Now -q option only makes it quiet. And when -f flag is specified, the command will ignore errors and continue executing with next batched command. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Aug 10 13:38:23 2018 (r337573) +++ head/sbin/ipfw/ipfw.8 Fri Aug 10 14:10:22 2018 (r337574) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2018 +.Dd August 10, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -315,10 +315,15 @@ When listing and .Fl d is specified, also show expired dynamic rules. .It Fl f -Do not ask for confirmation for commands that can cause problems -if misused, i.e., +Run without prompting for confirmation for commands that can cause problems if misused, +i.e., .Cm flush . If there is no tty associated with the process, this is implied. +The +.Cm delete +command with this flag ignores possible errors, +i.e., nonexistent rule number. +And for batched commands execution continues with the next command. .It Fl i When listing a table (see the .Sx LOOKUP TABLES Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Aug 10 13:38:23 2018 (r337573) +++ head/sbin/ipfw/ipfw2.c Fri Aug 10 14:10:22 2018 (r337574) @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval != EX_OK && co.do_quiet == 0) + if (exitval != EX_OK && co.do_force == 0) exit(exitval); } From owner-svn-src-head@freebsd.org Fri Aug 10 15:16:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6024106DB46; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88C348F100; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EFBD1D6D; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGWOD037304; Fri, 10 Aug 2018 15:16:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGV3n037298; Fri, 10 Aug 2018 15:16:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGV3n037298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337576 - in head: include lib/libc/gen sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: include lib/libc/gen sys/sys X-SVN-Commit-Revision: 337576 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 15:16:33 -0000 Author: imp Date: Fri Aug 10 15:16:30 2018 New Revision: 337576 URL: https://svnweb.freebsd.org/changeset/base/337576 Log: Bring in timespce_get form NetBSD. Bring in the functionality for timespec_get from NetBSD. I've lightly edited the .c file to remove _DIAGASSERT because FreeBSD doesn't have that functionality and the typical #define'ing it to assert isn't right here. The man page is verbatim from NetBSD, but will be revised as part of a larger cleanup of the time man pages (they are inconsistent and vague in all the wrong places). Differential Review: https://reviews.freebsd.org/D16649 Added: head/lib/libc/gen/timespec_get.3 (contents, props changed) head/lib/libc/gen/timespec_get.c (contents, props changed) Modified: head/include/time.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/sys/sys/param.h Modified: head/include/time.h ============================================================================== --- head/include/time.h Fri Aug 10 14:47:16 2018 (r337575) +++ head/include/time.h Fri Aug 10 15:16:30 2018 (r337576) @@ -206,6 +206,11 @@ time_t posix2time(time_t t); #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include #endif + +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ +#define TIME_UTC 1 /* time elapsed since epoch */ +int timespec_get(struct timespec *ts, int base); + __END_DECLS #endif /* !_TIME_H_ */ Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Aug 10 14:47:16 2018 (r337575) +++ head/lib/libc/gen/Makefile.inc Fri Aug 10 15:16:30 2018 (r337576) @@ -135,6 +135,7 @@ SRCS+= __getosreldate.c \ termios.c \ time.c \ times.c \ + timespec_get.c \ timezone.c \ tls.c \ ttyname.c \ @@ -299,6 +300,7 @@ MAN+= alarm.3 \ tcsetsid.3 \ time.3 \ times.3 \ + timespec_get.3 \ timezone.3 \ ttyname.3 \ tzset.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Aug 10 14:47:16 2018 (r337575) +++ head/lib/libc/gen/Symbol.map Fri Aug 10 15:16:30 2018 (r337576) @@ -420,6 +420,7 @@ FBSD_1.5 { scandir_b; sem_clockwait_np; setproctitle_fast; + timespec_get; }; FBSDprivate_1.0 { Added: head/lib/libc/gen/timespec_get.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:30 2018 (r337576) @@ -0,0 +1,76 @@ +.\" $NetBSD: timespec_get.3,v 1.2 2016/10/04 10:46:40 wiz Exp $ +.\" +.\" Copyright (c) 2016 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Kamil Rytarowski. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 4, 2016 +.Dt TIMESPEC_GET 3 +.Os +.Sh NAME +.Nm timespec_get +.Nd get current calendar time +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Vt #define TIME_UTC 1 +.Ft int +.Fn timespec_get "struct timespec *ts" "int base" +.Sh DESCRIPTION +The +.Nm +function sets the interval pointed to by +.Fa ts +to hold the current calendar time based on the specified time base in +.Fa base . +.Pp +Currently the only supported valid base is +.Dv TIME_UTC . +It returns time elapsed since epoch. +.Sh RETURN VALUES +The +.Nm +function returns the passed value of +.Fa base +if successful, otherwise +.Dv 0 +on failure. +.\" .Sh ERRORS +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Nm +function conforms to +.St -isoC-2011 . +.Sh HISTORY +This interface first appeared in +.Nx 8 . +.Sh AUTHORS +.An Kamil Rytarowski Aq Mt kamil@NetBSD.org Added: head/lib/libc/gen/timespec_get.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:30 2018 (r337576) @@ -0,0 +1,57 @@ +/* $NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Kamil Rytarowski. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); +__FBSDID("$FreeBSD$"); + +#include +#include + +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ + +int +timespec_get(struct timespec *ts, int base) +{ + +/* _DIAGASSERT(ts != NULL); */ + + switch (base) { + case TIME_UTC: + if (clock_gettime(CLOCK_REALTIME, ts) == -1) + return 0; + break; + default: + return 0; + } + + return base; +} Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Aug 10 14:47:16 2018 (r337575) +++ head/sys/sys/param.h Fri Aug 10 15:16:30 2018 (r337576) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200076 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200077 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Aug 10 15:16:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63660106DB68; Fri, 10 Aug 2018 15:16:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A13A58F1AE; Fri, 10 Aug 2018 15:16:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 074BF1D6E; Fri, 10 Aug 2018 15:16:36 +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 w7AFGa2H037357; Fri, 10 Aug 2018 15:16:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGakX037356; Fri, 10 Aug 2018 15:16:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGakX037356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337577 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337577 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 15:16:39 -0000 Author: imp Date: Fri Aug 10 15:16:36 2018 New Revision: 337577 URL: https://svnweb.freebsd.org/changeset/base/337577 Log: Remove assert.h and commented out _DIAGASSERT. Remove assert.h and _DIAGASSERT to create a paper-trail of changes from NetBSD. Specifically didn't fix other style issues since I don't want this to diverge from the NetBSD original too much and that's too niggling a change to be worth future merge hassles. Differential Review: https://reviews.freebsd.org/D16649 Modified: head/lib/libc/gen/timespec_get.c Modified: head/lib/libc/gen/timespec_get.c ============================================================================== --- head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:30 2018 (r337576) +++ head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:36 2018 (r337577) @@ -33,7 +33,6 @@ __RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); __FBSDID("$FreeBSD$"); -#include #include /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ @@ -41,8 +40,6 @@ __FBSDID("$FreeBSD$"); int timespec_get(struct timespec *ts, int base) { - -/* _DIAGASSERT(ts != NULL); */ switch (base) { case TIME_UTC: From owner-svn-src-head@freebsd.org Fri Aug 10 15:16:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E0B106DB83; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C20D8F1E6; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EF191D6F; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGfOJ037411; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGfjx037410; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGfjx037410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337578 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337578 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 15:16:42 -0000 Author: imp Date: Fri Aug 10 15:16:41 2018 New Revision: 337578 URL: https://svnweb.freebsd.org/changeset/base/337578 Log: Update man page to include FreeBSD-specific details. While this implements a standards-conforming C11 function, there's implementation details the programmer needs to know. Include those here. Make changes inspired by comments on the initial review as well, though mostly this involves stealing the epoch verbage from gettimeofday(2). Add myself to authors since I've now changed a substantial amount of this man page. Modified: head/lib/libc/gen/timespec_get.3 Modified: head/lib/libc/gen/timespec_get.3 ============================================================================== --- head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:36 2018 (r337577) +++ head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:41 2018 (r337578) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 4, 2016 +.Dd August 10, 2018 .Dt TIMESPEC_GET 3 .Os .Sh NAME @@ -39,7 +39,6 @@ .Lb libc .Sh SYNOPSIS .In time.h -.Vt #define TIME_UTC 1 .Ft int .Fn timespec_get "struct timespec *ts" "int base" .Sh DESCRIPTION @@ -50,9 +49,14 @@ function sets the interval pointed to by to hold the current calendar time based on the specified time base in .Fa base . .Pp -Currently the only supported valid base is -.Dv TIME_UTC . -It returns time elapsed since epoch. +The base +.Dv TIME_UTC +returns the time since the epoch. +This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970. +In +.Fx , +this corresponds to +.Dv CLOCK_REALTIME . .Sh RETURN VALUES The .Nm @@ -61,16 +65,22 @@ function returns the passed value of if successful, otherwise .Dv 0 on failure. -.\" .Sh ERRORS .Sh SEE ALSO -.Xr clock_gettime 2 +.Xr gettimeofday 2 , +.Xr clock_gettime 2 , +.Xr time 3 .Sh STANDARDS The .Nm -function conforms to +function with a +.Fa base +of +.Dv TIME_UTC +conforms to .St -isoC-2011 . .Sh HISTORY This interface first appeared in -.Nx 8 . +.Fx 12 . .Sh AUTHORS .An Kamil Rytarowski Aq Mt kamil@NetBSD.org +.An Warner Losh Aq Mt imp@FreeBSD.org From owner-svn-src-head@freebsd.org Fri Aug 10 15:29:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCFB106E08F; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 413898FAEB; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E7141F05; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFT674042415; Fri, 10 Aug 2018 15:29:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFT69Y042414; Fri, 10 Aug 2018 15:29:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101529.w7AFT69Y042414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 15:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337579 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337579 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 15:29:07 -0000 Author: kevans Date: Fri Aug 10 15:29:06 2018 New Revision: 337579 URL: https://svnweb.freebsd.org/changeset/base/337579 Log: boot tagging: minor fixes msgbufinit may be called multiple times as we initialize the msgbuf into a progressively larger buffer. This doesn't happen as of now on head, but it may happen in the future and we generally support this. As such, only print the boot tag if we've just initialized the buffer for the first time. The boot tag also now has a newline appended to it for better visibility, and has been switched to a normal printf, by requesto f bde, after we've denoted that the msgbuf is mapped. Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 10 15:16:41 2018 (r337578) +++ head/sys/kern/subr_prf.c Fri Aug 10 15:29:06 2018 (r337579) @@ -1033,20 +1033,24 @@ void msgbufinit(void *ptr, int size) { char *cp; - static struct msgbuf *oldp = NULL; + static struct msgbuf *oldp; + bool print_boot_tag; + oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; + print_boot_tag = !msgbufmapped; /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, sizeof(current_boot_tag)); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; + if (print_boot_tag) + printf("%s\n", current_boot_tag); oldp = msgbufp; } From owner-svn-src-head@freebsd.org Fri Aug 10 15:35:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB40106E4CB; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 750DC701A4; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534F02092; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFZ34V047364; Fri, 10 Aug 2018 15:35:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFZ3gf047363; Fri, 10 Aug 2018 15:35:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101535.w7AFZ3gf047363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 15:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337580 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337580 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 15:35:03 -0000 Author: kevans Date: Fri Aug 10 15:35:02 2018 New Revision: 337580 URL: https://svnweb.freebsd.org/changeset/base/337580 Log: subr_prf: remove think-o that had returned to local patch Reported by: cognet Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 10 15:29:06 2018 (r337579) +++ head/sys/kern/subr_prf.c Fri Aug 10 15:35:02 2018 (r337580) @@ -1033,10 +1033,9 @@ void msgbufinit(void *ptr, int size) { char *cp; - static struct msgbuf *oldp; + static struct msgbuf *oldp = NULL; bool print_boot_tag; - oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; From owner-svn-src-head@freebsd.org Fri Aug 10 16:43:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36978106FF27; Fri, 10 Aug 2018 16:43:08 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9325E72783; Fri, 10 Aug 2018 16:43:07 +0000 (UTC) (envelope-from phil@juniper.net) Received: from pps.filterd (m0108162.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7AGdN76005076; Fri, 10 Aug 2018 09:43:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=message-id : from : to : cc : subject : in-reply-to : mime-version : content-type : content-id : date; s=PPS1017; bh=mIf3GIL3GGhmvDTY3g30/vVUviSKDBPbbNw6yQMi2g4=; b=qNkK6OsYb/wBuuB4rhALG2j+0kIgyCbVEZjnRfaaHaRJcHuw4uVYcaWw+kkib9TF9KdO VP4UFrKlxeKRn3dd7PD+KjLLCmMx5Wc4q7mVzzE7iIF5d2VPxLVaxPmH2M/4DtwqLgJq GGnl2QvcO/tRkJ1fhlpHCbvhun00JB0jta+SDdcrenmhG4DodT8dE/VH9QAtotgzxHkH 1O0DRKPXjBfNk/zYvgI8QmBW8VAnXS8pEmTjkTdj0vBl6zWKk37ciFcaYus9WAO8JDtD MLV0t8UU8bgkYlUEZaAfINm6x78UVmiO4Jg+LvjZSFsAsY1dhFXdkLGKuoi8igwMCyhD TQ== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp0119.outbound.protection.outlook.com [216.32.180.119]) by mx0b-00273201.pphosted.com with ESMTP id 2ksa37gemn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 10 Aug 2018 09:42:59 -0700 Received: from SN1PR05CA0005.namprd05.prod.outlook.com (2a01:111:e400:5197::15) by BY2PR05MB2312.namprd05.prod.outlook.com (2a01:111:e400:c50a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.9; Fri, 10 Aug 2018 16:42:57 +0000 Received: from CO1NAM05FT012.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by SN1PR05CA0005.outlook.office365.com (2a01:111:e400:5197::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.9 via Frontend Transport; Fri, 10 Aug 2018 16:42:57 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.239.12) by CO1NAM05FT012.mail.protection.outlook.com (10.152.96.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1059.4 via Frontend Transport; Fri, 10 Aug 2018 16:42:54 +0000 Received: from P-EXFEND-EQX-01.jnpr.net (10.104.8.54) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 10 Aug 2018 09:42:53 -0700 Received: from p-emfe01a-sac.jnpr.net (172.24.192.34) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 10 Aug 2018 09:42:53 -0700 Received: from p-mailhub01.juniper.net (10.47.226.20) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 10 Aug 2018 09:41:51 -0700 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w7AGfmvx021455; Fri, 10 Aug 2018 09:41:49 -0700 (envelope-from phil@juniper.net) Received: from idle.juniper.net (localhost [127.0.0.1]) by idle.juniper.net (8.15.2/8.15.2) with ESMTP id w7AGgZHN036891; Fri, 10 Aug 2018 12:42:35 -0400 (EDT) (envelope-from phil@juniper.net) Message-ID: <201808101642.w7AGgZHN036891@idle.juniper.net> From: Phil Shafer To: , "Rodney W. Grimes" CC: "Andrey V. Elsukov" , , , Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <36889.1533919355.1@idle.juniper.net> Date: Fri, 10 Aug 2018 12:42:35 -0400 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(39860400002)(346002)(376002)(136003)(2980300002)(199004)(189003)(11346002)(16586007)(77096007)(69596002)(486006)(186003)(126002)(316002)(6246003)(2906002)(2810700001)(97756001)(14444005)(86362001)(110136005)(54906003)(336012)(476003)(7126003)(426003)(68736007)(50466002)(46406003)(478600001)(53416004)(5660300001)(76506005)(105596002)(106466001)(8276002)(6346003)(7696005)(356003)(305945005)(23726003)(1076002)(47776003)(26005)(8676002)(4326008)(229853002)(81166006)(97736004)(8936002)(81156014)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR05MB2312; H:P-EXFEND-EQX-01.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM05FT012; 1:c2GJVexNrPgfyJWbFnZ6gN+JXg4VmrJ9r+NemvRE2ourfGsPzSrZaACSXUrWVVlgHekixPhRDRoM4itQfDotLS+SfuC9RgJpa6lXlCk6wZ5169JJjJGVJX+1IYYVW0BB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a442028e-9de2-41aa-3f4f-08d5fee05322 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BY2PR05MB2312; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 3:mmFxGSkJpaXJNyYIpX/0xWkTJO4s3iz1JRyYcRx7LN+9rQHCaXdCy21duabbGBAkAJX9xvha1Jh3zipZhr1JC3wimmRAJaxafc1RlgNbPbrcOlLanCz0c0N8I6d0/25++uTHL0k7T5Pg/4YBcbwWNSgBStHg1KWzDl/D1yIu1AWWQrj6OTMe1cw5lUjMW+xSxv7jg3bySM3/AAuYFDV6G10MBHbMHgSWebwX26gHe5r+5NFpCyKVn4lzMcVi446HLxwtZ2RTZ9YVUm1lbsO8F7Ax4am/j2huYJgx0tGGUcTD6LIZ5qa/r1p9Fma24lreYdPIQ53Swesjp4/g7EGUiKenc0thYr/MhOqtlVipEpU=; 25:9b6JHcbsDxIi/qpXKVU6psUW1DKPRc1bA4nMn+xfrxEA6MRBmo8nLQYi7aT9tPCMTzMVQYsE0PFnLZ1xpytPWDM8kEvWqCJsolWdk1EGD4bdt6UP+CPZ9r48OwPG1hKggAf5AwwvImz9EfZPrTz0CQ7bju7hj2hV9wBfD1/HrG7KiGDbd3FCesuYz/fzDUFvVMTsqhoD3vVBFkYVyZMoMrGvVDy/OQr0w/DXFiILd3KNRBfAeLfK2g0l0G0swi32YuEUzICETOrG0BAK0uGFcwjCEHVH0Kl2+erZgW+kCxFfNdkn8uhIb7WbywJMZkaBNyovuHdcNfuV1VYHcc0JQg== X-MS-TrafficTypeDiagnostic: BY2PR05MB2312: X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 31:DrZiNLBFBky3YpQKAe8y5ZyRM9r/ZoLmaY0j5XipyWaFMW4sh4vjzMzhkYGypjMvjFsagweVb50fxXxho2iZryoQOqLOoqqD9FD0s6UpjuNwvLPC7hdSniASbjyLXqNvnCJ23Y+hhjzn2xY3L0dAK7YaekA9S8iz/1rel6dLHvWa5sMpiO9IUor1WGOpRrXzzAJN1x5ciqWRALH12dD/8UC7Q/U9yA/O/pXaa+0QJzE=; 20:p4AJIU1goPDBnmSRIEqBqLrYsP07pD780/ywXx+ilT7BOEBfrEZ3sc0dBr+MBNrERL7ZDCHfUwKPE5uEa6xpjMQ7rUT6uzLtwY6hcegO9o4PH6hxO4yAEEs4QMA9OA0ju0NyAncAFv9EHP4/X0jkG5/ps4RcqBVMIzbAbOfG/kqvIe023gaO25bZcrGTFDK9jzIpm/rK62BJkps4T7E55fnOQcvgjwH6HaiJ81rkHphgXRNh8b2euCxDEkxqYhO/x7iBrcekNCEBjFxtT7z6R8NnOh+MoWIQybe4wd9q5p7WC3tu4t+Eh9qMLVW6mDMK33rSe25o7NOnhzDFH0zYpit9TlGT7EVRBNIr6dNTKejYq54uElODHSZJ48+fwmXy+J3iuTgQw7pqfY2N8mKXKZmfvQtPfpnxF7OrkQlRIQI9wq8opaoPt+1SbzzfzAk7ia3DGLah3avCkOA0DbM5xxq+wu19N2fy/2b5wfr6nCdLJkGUM2O23br3+vVZ3Hsf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93003095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BY2PR05MB2312; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB2312; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 4:6ho6kihfUEYsWcmVnjZO0R/vGhtgvgSXzvDL+Jfe6JB7hLrY9Ua3ohqVj3zEKj1NPgPfwBYfSpiZa9IKwrsT/6+G9mV7uv50GaC2TU+iIRQZ/H15tUE6/L2qOtkZhZUjktw+PfgBnEcTrxvrW2KQKhqAz8WwWX2zpz/8CoHSFCIpVK/8rszYStqq1HBecwYp5wGZIrL2ILRIt7K2sa20tj3JCAoUvZMD+pFxR6m/G1TG68IJN/aJDV1/yTYsdUAGBL6nzEYrUU7WpCJf7kmbBw== X-Forefront-PRVS: 07607ED19A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB2312; 23:ftdcuYGslYLOv1U2GTex6C/Y419Tktb6rEO/Uts07?= =?us-ascii?Q?hSf71vB/7jkXd5Ri05lXicNhKkhS2qFAE1u7z0LnZqOB6z3nkvpelItI8yn0?= =?us-ascii?Q?Qc4xB+Kp8eI1q0QPvMQV6abiQ+EBNGB0RzJyl4AXfTOHeVd/Nk03eQy/dV4h?= =?us-ascii?Q?C8BP86c9zNK1kMv8z/FgtkwMG8SU8SJsmB99DFA9Mh7O/7gQrTqsBjma1uk/?= =?us-ascii?Q?TC/8usd6EheY6cm2Jc3MyujJOP7mGcqk3xV2NGKyx3XZ3QWNoa5atAJlKxje?= =?us-ascii?Q?fpcVdGQCdllu3t7QIV6Hpk+yCZyp/6soDA3GOeXV2/4KYCE8DFqYkE/Rq5Zv?= =?us-ascii?Q?MfpQRMMuP4nfwxxUYOpHbDpu9gG3CsH6vXgumlye/hFViCOZYKEFYuTeqgQC?= =?us-ascii?Q?V3p9CdM8fI3KVR6LSYQLs70wZpPl4/kLtRDi6723hogxIVIutYswtmT3fiWP?= =?us-ascii?Q?zys7/jI/IZIXKzdSVpIYho+BLncysG+s76J2oFB3lOpZlcWW9S+uljeGCU0O?= =?us-ascii?Q?DmcVqPLTwXauu+V/gVihyVA164wtPwz6dhVjGKgEso/fcrHSB/CpxaMhTMF6?= =?us-ascii?Q?7guNkHrUOE8SFC9JoU+ZpLxAMfWttd0JigxJ0QQjixTsWLSh9TtzMfDT5y8k?= =?us-ascii?Q?W4Z4pHTl9wOJgXgCFK/ZIKUc82XcuAP7b00FEXLBp+gVcEzgAxU8OGC2Q5fb?= =?us-ascii?Q?+aDGT+pUvtydjl+3cZLsyB5omUjKpXR3k2ra1UnZSFy8122/J1GLeY4STE4u?= =?us-ascii?Q?txtzZQPm4ggcuKNajGvoj8+K2Zt22U7Sz4mNZXTrEkbJue0IcyNbvurrJirR?= =?us-ascii?Q?EWXAUmKjmYu1R/0iVBLQmay41o/OMd/5QJfKoJ+PLPf4CocU7w0US7uPwFK7?= =?us-ascii?Q?/ScwyqgwpJt1kOZTS/4KM8L6uGKlLM7toFqm764Fnn0/3FBtdYqrBU2MiQWy?= =?us-ascii?Q?NN004SPGZZCiB3TWDFW3tbSg8HCVeycKNC6LXTqKIcNuuKgxZgNXdAgZby4R?= =?us-ascii?Q?ALtKleZas63MSWaiB6ZOKPMzidw/BcsrfrUCpoNQhUUiHBrJGFhWhHiSgxi4?= =?us-ascii?Q?1AiFMzO25RjjAAegCjUpy6Ke0C7kZA1MHg0ZpnMQkQWKr8Zm7bPiklpF/Yw/?= =?us-ascii?Q?iYrNllvsHZtr0cL4OvRoDEr9TIVDxf73Wk4jRviEMqFYTUdjhEnY3z3g+NLd?= =?us-ascii?Q?amAKughVrhTUgxegmJBAQiXLJM9W0llr2nv?= X-Microsoft-Antispam-Message-Info: 65MrSuoveNAVsxqFNCw8cfYcdjGk/GsQgcboD3wsmVSTlCzA/tCsvL6h9XO9MUAPBMIiDXowbp8YdW8V5SABYMfHXIuwBX+Ubc5tLSUduym9abREFJTZNOZqk7C2ozSRhDENBUvKFCZ/qL4pu6SST928LE9JsmjgC0pqIl2WysqUYOakmiwyF1B0J2okmriRVYgQOTGA8oWvxV8flfIQHOtrbDB0iXhGq5se/gnUYOIVErzWK6LBbcWhVY/GLYAt6T9a1JIAuTChx38it2tvIOQiN+6cZo356Tbk1qIYw98orJVUg/ncndbK6gT8NVZuikWrMVqyluHs98TOOHkKsQ2SWOWxrAyjsq04VOJ2d1Q= X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 6:iRPlt7E3o04J1BPjNoF6JWucuiZA3ObQbaMtNu+6ogwWJOhe5+psq1xnD8KuAln5LgWNMeKVhAR/pmbd8sQRC5hY0lSS8i8RlL0UWE+kBB/Yr4Frl+p0U5Jh+zLkBjVHmKBp3JTCmvGIKkXrsEaMvvG+eXfHZrqlfTsQNSS9afDECri39AgIU32LUFrplPBs5NGzMN1fItEy2L0AaO0ihL3BC9qF9379H3WjPHHGE5pATn1wcU4SrjmKalIYKAfA1Ti8fPNNrXNEvayvV26b/soC2DX9Sc7R/drVUpuJZYF9owfqLOoN+o0733J4NLrqFjR6cIKeGUvsv5xvdDTsX77wYsXgW1EYuxcYp901aFM2XKU0RMhxtoXKHmbAqQhqACD+mpxBtsarsYlMSxl2d9BbzP4xA3M+nvpwVvtu65YDox2dS5eYV6JWvDeTM7CChneMEcYMo+Do8iOHoRIdmw==; 5:gnJIeYki0Ga6R6HWEekmwuyJEZkeju9ByztaKdcRFl/vbGmBgpoMg/Xuvymnd5DfKdLxn3bWVuKQX3PPtsTn2xpZf6ySoy0qrgCxYXcvxMbKDfi9LGkGvR9PwC4H0F+Z/wY/z9r/FZGUkhb4N6FGCPFesiFcGeE5ZyycCnXy+s8=; 7:aRN6USdGxb4O0xLz8cvQqLjaPVA3r/+5pRwl9vu/uZuox32QfvBKlOxAywS2qrDktAE7GxC0DLW6tlcJ7qVLP2gJ9aoXj6XnCoSb/U75wpJS+Rox6EzMJJA3QVS3OjRnNK8Z8bhVNLJ0Bd+thSrjdIsaGJUBOBXsJljLrb7pziT6zCN4VsVCPS7tAdUA71tT8GwmFVoZLRmfqo+Z+W4alex8JrF/unl37uXiSRuvB+hcC5dPH1qkAgNkFIebVB2r SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 16:42:54.1800 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a442028e-9de2-41aa-3f4f-08d5fee05322 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB2312 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-10_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=596 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808100179 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 16:43:08 -0000 >> +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) >> @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) >> exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); >> if (exitval) { >> exitval = EX_UNAVAILABLE; >> - warn("rule %u not available", i); >> + if (co.do_quiet) >> + continue; >> + warn("nat %u not available", i); Was the change in the message intentional? Thanks, Phil From owner-svn-src-head@freebsd.org Fri Aug 10 18:44:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0FF1071DA5; Fri, 10 Aug 2018 18:44:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4C7D75C73; Fri, 10 Aug 2018 18:44:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x243.google.com with SMTP id b90-v6so4402263plb.0; Fri, 10 Aug 2018 11:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=uYVPmDVDbf3wLBeKFc805tRxMHoUWmFF2z8PKLPQw2rZU1LQjZvVY+9/aarcL00qmr NfK3wiUR7dUua6PKJS2zSw+QXFHEJUTwL6gEiAXWnKAkMKEWlQipQv8GlujRvgRXpkyg ikwz/yEpVg2eEuNbssbEzqjECFqtqTTXgeUAVwVt494pXzSxYbBZNza4RhX2TaXfbkLT eFMwzxdOKMHJCNOKAlH7DZzwBkeyz2R6F8oMpIILfXIIZ4Q1UM7pwlUlVlbAhsHNzP4z 16oyZTyZdCwAlMZKXe/+S3mN+iDDzNpFnRTp9/3ybbRL49ytx2+s4tR6nQvn+y+UzlbT i8Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=CIOyu8bDLtzGPfBpzU5IsQBsMDROO4CBjgH5FgXuvIdNWYy930AS7o/C2Riiju3ykj LfulmzkcDGJXYtFxT2k1DijZR/1hed2BYsOxS2P2HsFXT6/z3IgTYXSpA+eKYk65h1up yEIQTQHTt3cGusWtE+Is9JbiNKwHRIzfmoCfSSCUwQtKUsvBuHbTmI64+J4rUtA1iO8b rR8xhaS+5JIAkyxt312v/c2gWMyUV4f6D06VU778LTtba/pelXpMpB184dZHy97dhQQ4 JHm94iKWxJw6+IjlskBTLJpsuAfM5/YG0EE7s61e58lw4NQbFOVPW4H9thaXVih3LiXZ TN1g== X-Gm-Message-State: AOUpUlED5o4NYcrrafnOu5EI6Zv+sUidAwTjgD48kX7IZ5IwhxqV2eZ5 htPuwoIZ2Q2IjHc97K6lfvpzSAft X-Google-Smtp-Source: AA+uWPzeSxV+Fc1WLvRuydmthKrvJj4uATnUrv0oYkyeEUIM2r9VAXUjbk5plXGcJ7XrrCaAIsbatg== X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr7073984plr.231.1533926669942; Fri, 10 Aug 2018 11:44:29 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id x2-v6sm19458650pfi.166.2018.08.10.11.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 11:44:28 -0700 (PDT) Sender: Mark Johnston Date: Fri, 10 Aug 2018 14:44:26 -0400 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337426 - head/sbin/ifconfig Message-ID: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180810092251.K1276@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 18:44:31 -0000 On Fri, Aug 10, 2018 at 10:25:50AM +1000, Bruce Evans wrote: > On Tue, 7 Aug 2018, Mark Johnston wrote: > > > Log: > > ifconfig: Fix use of _Noreturn. > > > > The _Noreturn is a function-specifier (like inline) which must preceed > > the declarator. > > > > Submitted by: Sebastian Huber > > MFC after: 1 week > > _Noreturn is even more broken than I knew. It should never be used. Here > its use is wronger than usual. > > > Modified: head/sbin/ifconfig/ifconfig.c > > ============================================================================== > > --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) > > +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) > > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > > struct ifaddrs *ifa); > > static void tunnel_status(int s); > > -static void usage(void) _Noreturn; > > +static _Noreturn void usage(void); > > > > static struct afswtch *af_getbyname(const char *name); > > static struct afswtch *af_getbyfamily(int af); > > FreeBSD code should use __dead2 since it is more portable (within > FreeBSD) and doesn't have so mean syntactical restrictions. However, > it only exists at all since it had similar syntactial restrictions > when it was new (FreeBSD-1 used __dead, which must be placed like > _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed > there when it was new), and the macro that hides the details was renamed > to inhibit misuse. Changing __dead2 to _Noreturn and moving it to satisfy > the restricted syntax of the latter mainly broke support for old compilers > where __dead2 cannot be placed there. __dead2 was never present. _Noreturn was added in r317755, apparently to appease Coverity. > However, all declarations of static usage() as non-returning are bogus, ... I can only agree, especially since exit() is already declared with _Noreturn in stdlib.h. I don't understand why __dead2/_Noreturn keeps getting added to various usage() declarations. From owner-svn-src-head@freebsd.org Fri Aug 10 18:48:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 915B11071E57 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1596775E19 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94; Fri, 10 Aug 2018 18:48:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7AIm9Dt061807; Fri, 10 Aug 2018 12:48:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533926889.9860.199.camel@freebsd.org> Subject: Re: svn commit: r337426 - head/sbin/ifconfig From: Ian Lepore To: Mark Johnston , Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 10 Aug 2018 12:48:09 -0600 In-Reply-To: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> <20180810184426.GB52302@raichu> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 10 Aug 2018 18:48:19 -0000 On Fri, 2018-08-10 at 14:44 -0400, Mark Johnston wrote: > On Fri, Aug 10, 2018 at 10:25:50AM +1000, Bruce Evans wrote: > > > > On Tue, 7 Aug 2018, Mark Johnston wrote: > > > > > > > > Log: > > >  ifconfig: Fix use of _Noreturn. > > > > > >  The _Noreturn is a function-specifier (like inline) which must preceed > > >  the declarator. > > > > > >  Submitted by: Sebastian Huber > > >  MFC after: 1 week > > _Noreturn is even more broken than I knew.  It should never be used.  Here > > its use is wronger than usual. > > > > > > > > Modified: head/sbin/ifconfig/ifconfig.c > > > ============================================================================== > > > --- head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:13:42 2018 (r337425) > > > +++ head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:25:38 2018 (r337426) > > > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > > > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > > > struct ifaddrs *ifa); > > > static void tunnel_status(int s); > > > -static void usage(void) _Noreturn; > > > +static _Noreturn void usage(void); > > > > > > static struct afswtch *af_getbyname(const char *name); > > > static struct afswtch *af_getbyfamily(int af); > > FreeBSD code should use __dead2 since it is more portable (within > > FreeBSD) and doesn't have so mean syntactical restrictions.  However, > > it only exists at all since it had similar syntactial restrictions > > when it was new (FreeBSD-1 used __dead, which must be placed like > > _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed > > there when it was new), and the macro that hides the details was renamed > > to inhibit misuse.  Changing __dead2 to _Noreturn and moving it to satisfy > > the restricted syntax of the latter mainly broke support for old compilers > > where __dead2 cannot be placed there. > __dead2 was never present.  _Noreturn was added in r317755, apparently > to appease Coverity. > > > > > However, all declarations of static usage() as non-returning are bogus, ... > I can only agree, especially since exit() is already declared with > _Noreturn in stdlib.h.  I don't understand why __dead2/_Noreturn keeps > getting added to various usage() declarations. > It was getting added to appease some not-very-capable static code analyzer. Not Coverity, not clang's builtin analyzer, something else someone was using, I forget the details. -- Ian From owner-svn-src-head@freebsd.org Fri Aug 10 19:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B95810727F6; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 115EB76EA2; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0D274887; Fri, 10 Aug 2018 19:19:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJJ8xt060456; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJJ87w060452; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808101919.w7AJJ87w060452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 Aug 2018 19:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337583 - in head/sys/cam: . ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata nvme scsi X-SVN-Commit-Revision: 337583 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 19:19:09 -0000 Author: cem Date: Fri Aug 10 19:19:07 2018 New Revision: 337583 URL: https://svnweb.freebsd.org/changeset/base/337583 Log: Walk back r337554 while discussion continues The idea was to get the uncontroversial mechanical change out of the way, then get the meatier functional changes reviewed subsequently. I had not realized that the immediately adjacent issue was addressed in a different direction in r334506 (see Warner's guidance in D15592). Discussion continues, trying to determine if there is a secondary issue still[1] and how best to fix it. With 12-related activities coming up, while that is ongoing, just take this back for now. [1]: Shutdown-time eventhandler events fire normally during panic's reboot path. Driver callbacks that attempt to issue and wait on interrupt- completed IO may never complete, hanging the system. This is particularly obnoxious in the shutdown/panic path, as the debugger cannot be entered anymore and the hang prevents reboot restoring availability. (There's nothing CAM-specific about this problem -- any shutdown event-triggered driver could do something like this during panic. But most NICs, etc. don't try to send spin-down commands at shutdown. ;-)) Discussed with: imp, markj Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/ata/ata_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1081,7 +1081,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical (u_int8_t *) virtual, length, ada_default_timeout*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { @@ -1116,7 +1115,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical NULL, 0, 5*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); @@ -3501,7 +3499,6 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); - local_ccb.ccb_h.xflags |= CAM_CCB_DUMP; ata_28bit_cmd(&local_ccb, cmd, 0, 0, 0); error = cam_periph_runccb((union ccb *)&local_ccb, adaerror, /*cam_flags*/0, /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/cam_ccb.h Fri Aug 10 19:19:07 2018 (r337583) @@ -116,8 +116,7 @@ typedef enum { typedef enum { CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000008,/* use unmapped I/O */ - CAM_CCB_DUMP = 0x00000010,/* polled ccb during dump */ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/nvme/nvme_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -426,7 +426,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -440,7 +439,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/scsi/scsi_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1847,7 +1847,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -1870,7 +1869,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*lb_count*/0, SSD_FULL_SIZE, 5 * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) From owner-svn-src-head@freebsd.org Fri Aug 10 19:23:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034D81072CBB; Fri, 10 Aug 2018 19:23:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA383774B3; Fri, 10 Aug 2018 19:23:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C1234A15; Fri, 10 Aug 2018 19:23:20 +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 w7AJNKSs065453; Fri, 10 Aug 2018 19:23:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJNKPj065452; Fri, 10 Aug 2018 19:23:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808101923.w7AJNKPj065452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 10 Aug 2018 19:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337584 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 337584 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 19:23:21 -0000 Author: markj Date: Fri Aug 10 19:23:20 2018 New Revision: 337584 URL: https://svnweb.freebsd.org/changeset/base/337584 Log: Disable the D subroutines msgsize() and msgdsize(). They are specific to illumos and the corresponding DIF subroutines are already disabled on FreeBSD. Reported by: gnn Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 19:19:07 2018 (r337583) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 19:23:20 2018 (r337584) @@ -343,13 +343,13 @@ static const dt_ident_t _dtrace_globals[] = { &dt_idops_func, "void(@)" }, { "mod", DT_IDENT_ACTFUNC, 0, DT_ACT_MOD, DT_ATTR_STABCMN, DT_VERS_1_2, &dt_idops_func, "_symaddr(uintptr_t)" }, +#ifdef illumos { "msgdsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGDSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, { "msgsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, -#ifdef illumos { "mutex_owned", DT_IDENT_FUNC, 0, DIF_SUBR_MUTEX_OWNED, DT_ATTR_EVOLCMN, DT_VERS_1_0, &dt_idops_func, "int(genunix`kmutex_t *)" }, From owner-svn-src-head@freebsd.org Fri Aug 10 19:57:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FCB1073680; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741B078461; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EBE54F00; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJvuEL080968; Fri, 10 Aug 2018 19:57:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJvuf4080967; Fri, 10 Aug 2018 19:57:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808101957.w7AJvuf4080967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 10 Aug 2018 19:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337585 - head/lib/libgcc_eh X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libgcc_eh X-SVN-Commit-Revision: 337585 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 19:57:56 -0000 Author: dim Date: Fri Aug 10 19:57:55 2018 New Revision: 337585 URL: https://svnweb.freebsd.org/changeset/base/337585 Log: In r308100, an explicit -fexceptions flag was added for the C sources from LLVM's libunwind, which end up in libgcc_eh.a and libgcc_s.so. This is because the unwinder needs the unwinder data for its own functions. However, for the C++ sources in libunwind, -fexceptions is already the default, and this can have the side effect of generating a reference to __gxx_personality_v0, the so-called personality function, which is normally provided by the C++ ABI library (libcxxrt or libsupc++). If the reference ends up in the eventual libgcc_s.so, linking any non-C++ programs against it will fail with "undefined reference to `__gxx_personality_v0'". Note that at high optimization levels, the reference is usually optimized away, which is why we have never noticed this problem before. With clang 7.0.0 though, higher optimization levels don't help anymore, since the addition of address-significance tables [1] in . Effectively, this always causes a reference to __gxx_personality_v0. After discussion with the upstream author of that change, it turns out that we should compile libunwind sources with the -fno-exceptions -funwind-tables flags instead. This ensures unwind tables are generated, but no references to any personality functions are emitted. [1] https://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html Reported by: jbeich PR: 230399 MFC after: 1 week Modified: head/lib/libgcc_eh/Makefile.inc Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Aug 10 19:23:20 2018 (r337584) +++ head/lib/libgcc_eh/Makefile.inc Fri Aug 10 19:57:55 2018 (r337585) @@ -20,7 +20,10 @@ SRCS_EXC+= libunwind.cpp SRCS+= ${SRCS_EXC} .for file in ${SRCS_EXC:M*.c} -CFLAGS.${file}+= -fexceptions +CFLAGS.${file}+= -fno-exceptions -funwind-tables +.endfor +.for file in ${SRCS_EXC:M*.cpp} +CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY From owner-svn-src-head@freebsd.org Fri Aug 10 20:37:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C439310749C3; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79D2A7A2B7; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 568955574; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AKbXJC001679; Fri, 10 Aug 2018 20:37:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AKbWWB001675; Fri, 10 Aug 2018 20:37:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808102037.w7AKbWWB001675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 10 Aug 2018 20:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337589 - in head/sys: dev/cx i386/include net80211 netinet X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head/sys: dev/cx i386/include net80211 netinet X-SVN-Commit-Revision: 337589 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 20:37:34 -0000 Author: dteske Date: Fri Aug 10 20:37:32 2018 New Revision: 337589 URL: https://svnweb.freebsd.org/changeset/base/337589 Log: Fix misspellings of transmitter/transmitted Reviewed by: emaste, bcr Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D16025 Modified: head/sys/dev/cx/cxddk.c head/sys/i386/include/cserial.h head/sys/net80211/ieee80211_hwmp.c head/sys/netinet/sctp_indata.c Modified: head/sys/dev/cx/cxddk.c ============================================================================== --- head/sys/dev/cx/cxddk.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/dev/cx/cxddk.c Fri Aug 10 20:37:32 2018 (r337589) @@ -215,7 +215,7 @@ void cx_enable_receive (cx_chan_t *c, int on) } /* - * Turn the transmiter on/off. + * Turn the transmitter on/off. */ void cx_enable_transmit (cx_chan_t *c, int on) { Modified: head/sys/i386/include/cserial.h ============================================================================== --- head/sys/i386/include/cserial.h Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/i386/include/cserial.h Fri Aug 10 20:37:32 2018 (r337589) @@ -89,7 +89,7 @@ struct e3_statistics { #define ER_SCC_FRAMING 7 /* subchannel framing error */ #define ER_SCC_OVERFLOW 8 /* subchannel receive buffer overflow */ #define ER_SCC_OVERRUN 9 /* subchannel receiver overrun */ -#define ER_SCC_UNDERRUN 10 /* subchannel transmiter underrun */ +#define ER_SCC_UNDERRUN 10 /* subchannel transmitter underrun */ #define ER_BUS 11 /* system bus is too busy (e.g PCI) */ /* Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/net80211/ieee80211_hwmp.c Fri Aug 10 20:37:32 2018 (r337589) @@ -920,7 +920,7 @@ hwmp_update_transmitter(struct ieee80211vap *vap, stru rttran->rt_metric > metric) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "%s path to transmiter %6D of %s, metric %d:%d", + "%s path to transmitter %6D of %s, metric %d:%d", rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? "prefer" : "update", ni->ni_macaddr, ":", hwmp_frame, rttran->rt_metric, metric); Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/netinet/sctp_indata.c Fri Aug 10 20:37:32 2018 (r337589) @@ -3078,7 +3078,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /*- - * True non-retransmited chunk + * True non-retransmitted chunk */ tp1->whoTo->net_ack2 += tp1->send_size; @@ -4056,7 +4056,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += @@ -4676,7 +4676,7 @@ hopeless_peer: if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += From owner-svn-src-head@freebsd.org Fri Aug 10 23:42:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9251F1078A9F; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488708147A; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A89A73ED; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ANgCJE099980; Fri, 10 Aug 2018 23:42:12 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ANgCPl099300; Fri, 10 Aug 2018 23:42:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808102342.w7ANgCPl099300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 10 Aug 2018 23:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337594 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 337594 X-SVN-Commit-Repository: base 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.27 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, 10 Aug 2018 23:42:13 -0000 Author: mmacy Date: Fri Aug 10 23:42:11 2018 New Revision: 337594 URL: https://svnweb.freebsd.org/changeset/base/337594 Log: ZFS/MFV: Use cached feature info in spa_add_feature_stats() commit 417104bdd3c7ce07ec58674dd078f9891c3bc780 Author: Ned Bass Date: Thu Feb 26 12:24:11 2015 -0800 Use cached feature info in spa_add_feature_stats() Avoid issuing I/O to the pool when retrieving feature flags information. Trying to read the ZAPs from disk means that zpool clear would hang if the pool is suspended and recovery would require a reboot. To keep the feature stats resident in memory, we hang a cached nvlist off of the spa. It is built up from disk the first time spa_add_feature_stats() is called, and refreshed thereafter using the cached feature reference counts. spa_add_feature_stats() gets called at pool import time so we can be sure the cached nvlist will be available if the pool is later suspended. Signed-off-by: Ned Bass Signed-off-by: Brian Behlendorf Closes #3082 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 23:42:11 2018 (r337594) @@ -4371,18 +4371,14 @@ spa_add_l2cache(spa_t *spa, nvlist_t *config) } static void -spa_add_feature_stats(spa_t *spa, nvlist_t *config) +spa_feature_stats_from_disk(spa_t *spa, nvlist_t *features) { - nvlist_t *features; zap_cursor_t zc; zap_attribute_t za; - ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); - VERIFY(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP) == 0); - /* We may be unable to read features if pool is suspended. */ if (spa_suspended(spa)) - goto out; + return; if (spa->spa_feat_for_read_obj != 0) { for (zap_cursor_init(&zc, spa->spa_meta_objset, @@ -4391,7 +4387,7 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); @@ -4404,16 +4400,62 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); } +} -out: - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - features) == 0); - nvlist_free(features); +static void +spa_feature_stats_from_cache(spa_t *spa, nvlist_t *features) +{ + int i; + + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t feature = spa_feature_table[i]; + uint64_t refcount; + + if (feature_get_refcount(spa, &feature, &refcount) != 0) + continue; + + VERIFY0(nvlist_add_uint64(features, feature.fi_guid, refcount)); + } +} + +/* + * Store a list of pool features and their reference counts in the + * config. + * + * The first time this is called on a spa, allocate a new nvlist, fetch + * the pool features and reference counts from disk, then save the list + * in the spa. In subsequent calls on the same spa use the saved nvlist + * and refresh its values from the cached reference counts. This + * ensures we don't block here on I/O on a suspended pool so 'zpool + * clear' can resume the pool. + */ +static void +spa_add_feature_stats(spa_t *spa, nvlist_t *config) +{ + nvlist_t *features; + + ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); + + mutex_enter(&spa->spa_feat_stats_lock); + features = spa->spa_feat_stats; + + if (features != NULL) { + spa_feature_stats_from_cache(spa, features); + } else { + VERIFY0(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP)); + spa->spa_feat_stats = features; + spa_feature_stats_from_disk(spa, features); + } + + VERIFY0(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + features)); + + mutex_exit(&spa->spa_feat_stats_lock); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 23:42:11 2018 (r337594) @@ -708,6 +708,7 @@ spa_add(const char *name, nvlist_t *config, const char mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_feat_stats_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL); cv_init(&spa->spa_evicting_os_cv, NULL, CV_DEFAULT, NULL); @@ -881,6 +882,7 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_label_features); nvlist_free(spa->spa_load_info); + nvlist_free(spa->spa_feat_stats); spa_config_set(spa, NULL); #ifdef illumos @@ -922,6 +924,7 @@ spa_remove(spa_t *spa) mutex_destroy(&spa->spa_scrub_lock); mutex_destroy(&spa->spa_suspend_lock); mutex_destroy(&spa->spa_vdev_top_lock); + mutex_destroy(&spa->spa_feat_stats_lock); kmem_free(spa, sizeof (spa_t)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Aug 10 23:42:11 2018 (r337594) @@ -360,6 +360,8 @@ struct spa { uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ uint64_t spa_feat_enabled_txg_obj; /* Feature enabled txg */ + kmutex_t spa_feat_stats_lock; /* protects spa_feat_stats */ + nvlist_t *spa_feat_stats; /* Cache of enabled features */ /* cache feature refcounts */ uint64_t spa_feat_refcount_cache[SPA_FEATURES]; #ifdef illumos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Aug 10 23:42:11 2018 (r337594) @@ -220,7 +220,7 @@ spa_features_check(spa_t *spa, boolean_t for_write, * * Note: well-designed features will not need to use this; they should * use spa_feature_is_enabled() and spa_feature_is_active() instead. - * However, this is non-static for zdb and zhack. + * However, this is non-static for zdb, zhack, and spa_add_feature_stats(). */ int feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) From owner-svn-src-head@freebsd.org Sat Aug 11 00:09:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2347D1079317; Sat, 11 Aug 2018 00:09:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDA9581F4F; Sat, 11 Aug 2018 00:08:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 997017728; Sat, 11 Aug 2018 00:08:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B08xJJ010300; Sat, 11 Aug 2018 00:08:59 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B08xUO010299; Sat, 11 Aug 2018 00:08:59 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808110008.w7B08xUO010299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 00:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337595 - head/contrib/pf/pflogd X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/contrib/pf/pflogd X-SVN-Commit-Revision: 337595 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 00:09:00 -0000 Author: sevan (doc committer) Date: Sat Aug 11 00:08:59 2018 New Revision: 337595 URL: https://svnweb.freebsd.org/changeset/base/337595 Log: Fix escaping, otherwise Dx gets translated as the macro for DragonFly. From 2018 Linuxhotel Hackathon & DevSummit Approved by: eadler Obtained from: OpenBSD r1.49 Differential Revision: https://reviews.freebsd.org/D16616 Modified: head/contrib/pf/pflogd/pflogd.8 Modified: head/contrib/pf/pflogd/pflogd.8 ============================================================================== --- head/contrib/pf/pflogd/pflogd.8 Fri Aug 10 23:42:11 2018 (r337594) +++ head/contrib/pf/pflogd/pflogd.8 Sat Aug 11 00:08:59 2018 (r337595) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22 2008 +.Dd August 11, 2018 .Dt PFLOGD 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pflogd .Bk -words -.Op Fl Dx +.Op Fl \&Dx .Op Fl d Ar delay .Op Fl f Ar filename .Op Fl i Ar interface From owner-svn-src-head@freebsd.org Sat Aug 11 02:56:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04BC105B3C1; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67830881A2; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 460D511359; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B2uihu096159; Sat, 11 Aug 2018 02:56:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B2uiOI096158; Sat, 11 Aug 2018 02:56:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808110256.w7B2uiOI096158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 11 Aug 2018 02:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337600 - head/usr.bin/stat X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/stat X-SVN-Commit-Revision: 337600 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 02:56:44 -0000 Author: cem Date: Sat Aug 11 02:56:43 2018 New Revision: 337600 URL: https://svnweb.freebsd.org/changeset/base/337600 Log: stat(1): cache id->name resolution When invoked on a large list of files, it is most common for a small number of uids/gids to own most of the results. Like ls(1), use pwcache(3) to avoid repeatedly looking up the same IDs. Example microbenchmark and non-scientific results: $ time (find /usr/src -type f -print0 | xargs -0 stat >/dev/null) BEFORE: 3.62s user 5.23s system 102% cpu 8.655 total 3.47s user 5.38s system 102% cpu 8.647 total AFTER: 1.23s user 1.81s system 108% cpu 2.810 total 1.43s user 1.54s system 107% cpu 2.754 total Does this microbenchmark have any real-world significance? Until a use case is demonstrated otherwise, I doubt it. Ordinarily I would be resistant to optimizing pointless microbenchmarks in base utilities (e.g., recent totally gratuitous changes to yes(1)). However, the pwcache(3) APIs actually simplify stat(1) logic ever so slightly compared to the raw APIs they wrap, so I think this is at worst harmless. PR: 230491 Reported by: Thomas Hurst Discussed with: gad@ Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sat Aug 11 01:54:45 2018 (r337599) +++ head/usr.bin/stat/stat.c Sat Aug 11 02:56:43 2018 (r337600) @@ -619,8 +619,6 @@ format1(const struct stat *st, char *stmp, lfmt[24], tmp[20]; const char *sdata; char smode[12], sid[12], path[PATH_MAX + 4]; - struct passwd *pw; - struct group *gr; const struct timespec *tsp; struct timespec ts; struct tm *tm; @@ -717,9 +715,8 @@ format1(const struct stat *st, case SHOW_st_uid: small = (sizeof(st->st_uid) == 4); data = st->st_uid; - if ((pw = getpwuid(st->st_uid)) != NULL) - sdata = pw->pw_name; - else { + sdata = user_from_uid(st->st_uid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_uid); sdata = sid; } @@ -731,9 +728,8 @@ format1(const struct stat *st, case SHOW_st_gid: small = (sizeof(st->st_gid) == 4); data = st->st_gid; - if ((gr = getgrgid(st->st_gid)) != NULL) - sdata = gr->gr_name; - else { + sdata = group_from_gid(st->st_gid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_gid); sdata = sid; } From owner-svn-src-head@freebsd.org Sat Aug 11 04:23:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21518105D51D; Sat, 11 Aug 2018 04:23:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB2148B324; Sat, 11 Aug 2018 04:23:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93318122BD; Sat, 11 Aug 2018 04:23:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B4N3b3043831; Sat, 11 Aug 2018 04:23:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4N3LR043830; Sat, 11 Aug 2018 04:23:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110423.w7B4N3LR043830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337607 - in head/sys: amd64/amd64 dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/amd64 dev/efidev X-SVN-Commit-Revision: 337607 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 04:23:04 -0000 Author: kevans Date: Sat Aug 11 04:23:03 2018 New Revision: 337607 URL: https://svnweb.freebsd.org/changeset/base/337607 Log: Destroy a couple of rogue svn:mergeinfo Modified: Directory Properties: head/sys/amd64/amd64/efirt_machdep.c (props changed) head/sys/dev/efidev/efirt.c (props changed) From owner-svn-src-head@freebsd.org Sat Aug 11 04:55:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C22105DD4F; Sat, 11 Aug 2018 04:55:49 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C176C8BF2D; Sat, 11 Aug 2018 04:55:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CE7112799; Sat, 11 Aug 2018 04:55:48 +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 w7B4tm7b058897; Sat, 11 Aug 2018 04:55:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4tloY058893; Sat, 11 Aug 2018 04:55:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808110455.w7B4tloY058893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 11 Aug 2018 04:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337609 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337609 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 04:55:49 -0000 Author: np Date: Sat Aug 11 04:55:47 2018 New Revision: 337609 URL: https://svnweb.freebsd.org/changeset/base/337609 Log: cxgbe(4): Create two variants of service_iq, one for queues with freelists and one for those without. MFH: 3 weeks 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 Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/adapter.h Sat Aug 11 04:55:47 2018 (r337609) @@ -670,6 +670,7 @@ struct sge_wrq { #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ struct vi_info *vi; struct iq_desc *iq_desc; @@ -797,7 +798,6 @@ struct adapter { struct irq { struct resource *res; int rid; - volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; @@ -1186,9 +1186,10 @@ void release_tid(struct adapter *, int, struct sge_wrq #ifdef DEV_NETMAP /* t4_netmap.c */ +struct sge_nm_rxq; void cxgbe_nm_attach(struct vi_info *); void cxgbe_nm_detach(struct vi_info *); -void t4_nm_intr(void *); +void service_nm_rxq(struct sge_nm_rxq *); #endif /* t4_sge.c */ @@ -1207,7 +1208,10 @@ 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 *); +#ifdef DEV_NETMAP +void t4_nm_intr(void *); void t4_vi_intr(void *); +#endif 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 Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_main.c Sat Aug 11 04:55:47 2018 (r337609) @@ -684,8 +684,8 @@ struct { #ifdef TCP_OFFLOAD /* - * service_iq() has an iq and needs the fl. Offset of fl from the iq should be - * exactly the same for both rxq and ofld_rxq. + * service_iq_fl() has an iq and needs the fl. Offset of fl from the iq should + * be exactly the same for both rxq and ofld_rxq. */ CTASSERT(offsetof(struct sge_ofld_rxq, iq) == offsetof(struct sge_rxq, iq)); CTASSERT(offsetof(struct sge_ofld_rxq, fl) == offsetof(struct sge_rxq, fl)); @@ -4819,9 +4819,26 @@ t4_setup_intr_handlers(struct adapter *sc) #ifdef DEV_NETMAP if (q < vi->nnmrxq) irq->nm_rxq = nm_rxq++; + + if (irq->nm_rxq != NULL && + irq->rxq == NULL) { + /* Netmap rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_nm_intr, irq->nm_rxq, s); + } + if (irq->nm_rxq != NULL && + irq->rxq != NULL) { + /* NIC and Netmap rx */ + rc = t4_alloc_irq(sc, irq, rid, + t4_vi_intr, irq, s); + } #endif - rc = t4_alloc_irq(sc, irq, rid, - t4_vi_intr, irq, s); + if (irq->rxq != NULL && + irq->nm_rxq == NULL) { + /* NIC rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_intr, irq->rxq, s); + } if (rc != 0) return (rc); #ifdef RSS Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 04:55:47 2018 (r337609) @@ -358,8 +358,6 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi nm_set_native_flags(na); for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_on(kring) || nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID) @@ -387,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON); + atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { @@ -459,14 +457,12 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v free_nm_txq_hwq(vi, nm_txq); } for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_off(kring) || nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) continue; - while (!atomic_cmpset_int(&irq->nm_state, NM_ON, NM_OFF)) + while (!atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); free_nm_rxq_hwq(vi, nm_rxq); @@ -955,9 +951,8 @@ handle_nm_sge_egr_update(struct adapter *sc, struct if } void -t4_nm_intr(void *arg) +service_nm_rxq(struct sge_nm_rxq *nm_rxq) { - struct sge_nm_rxq *nm_rxq = arg; struct vi_info *vi = nm_rxq->vi; struct adapter *sc = vi->pi->adapter; struct ifnet *ifp = vi->ifp; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 04:55:47 2018 (r337609) @@ -204,6 +204,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); +static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); @@ -1333,8 +1334,12 @@ t4_teardown_vi_queues(struct vi_info *vi) } /* - * Deals with errors and the firmware event queue. All data rx queues forward - * their interrupt to the firmware event queue. + * Interrupt handler when the driver is using only 1 interrupt. This is a very + * unusual scenario. + * + * a) Deals with errors, if any. + * b) Services firmware event queue, which is taking interrupts for all other + * queues. */ void t4_intr_all(void *arg) @@ -1342,14 +1347,16 @@ t4_intr_all(void *arg) struct adapter *sc = arg; struct sge_iq *fwq = &sc->sge.fwq; + MPASS(sc->intr_count == 1); + t4_intr_err(arg); - if (atomic_cmpset_int(&fwq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(fwq, 0); - atomic_cmpset_int(&fwq->state, IQS_BUSY, IQS_IDLE); - } + t4_intr_evt(fwq); } -/* Deals with error interrupts */ +/* + * Interrupt handler for errors (installed directly when multiple interrupts are + * being used, or called by t4_intr_all). + */ void t4_intr_err(void *arg) { @@ -1359,6 +1366,10 @@ t4_intr_err(void *arg) t4_slow_intr_handler(sc); } +/* + * Interrupt handler for iq-only queues. The firmware event queue is the only + * such queue right now. + */ void t4_intr_evt(void *arg) { @@ -1370,90 +1381,74 @@ t4_intr_evt(void *arg) } } +/* + * Interrupt handler for iq+fl queues. + */ void t4_intr(void *arg) { struct sge_iq *iq = arg; if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(iq, 0); + service_iq_fl(iq, 0); atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } +#ifdef DEV_NETMAP +/* + * Interrupt handler for netmap rx queues. + */ void -t4_vi_intr(void *arg) +t4_nm_intr(void *arg) { - struct irq *irq = arg; + struct sge_nm_rxq *nm_rxq = arg; -#ifdef DEV_NETMAP - if (atomic_cmpset_int(&irq->nm_state, NM_ON, NM_BUSY)) { - t4_nm_intr(irq->nm_rxq); - atomic_cmpset_int(&irq->nm_state, NM_BUSY, NM_ON); + if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { + service_nm_rxq(nm_rxq); + atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } -#endif - if (irq->rxq != NULL) - t4_intr(irq->rxq); } -static inline int -sort_before_lro(struct lro_ctrl *lro) +/* + * Interrupt handler for vectors shared between NIC and netmap rx queues. + */ +void +t4_vi_intr(void *arg) { + struct irq *irq = arg; - return (lro->lro_mbuf_max != 0); + MPASS(irq->nm_rxq != NULL); + t4_nm_intr(irq->nm_rxq); + + MPASS(irq->rxq != NULL); + t4_intr(irq->rxq); } +#endif /* - * Deals with anything and everything on the given ingress queue. + * Deals with interrupts on an iq-only (no freelist) queue. */ static int service_iq(struct sge_iq *iq, int budget) { struct sge_iq *q; - struct sge_rxq *rxq = iq_to_rxq(iq); /* Use iff iq is part of rxq */ - struct sge_fl *fl; /* Use iff IQ_HAS_FL */ struct adapter *sc = iq->adapter; struct iq_desc *d = &iq->desc[iq->cidx]; int ndescs = 0, limit; - int rsp_type, refill; + int rsp_type; uint32_t lq; - uint16_t fl_hw_cidx; - struct mbuf *m0; STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); -#if defined(INET) || defined(INET6) - const struct timeval lro_timeout = {0, sc->lro_timeout}; - struct lro_ctrl *lro = &rxq->lro; -#endif KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + KASSERT((iq->flags & IQ_HAS_FL) == 0, + ("%s: called for iq %p with fl (iq->flags 0x%x)", __func__, iq, + iq->flags)); + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); + MPASS((iq->flags & IQ_LRO_ENABLED) == 0); limit = budget ? budget : iq->qsize / 16; - if (iq->flags & IQ_HAS_FL) { - fl = &rxq->fl; - fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ - } else { - fl = NULL; - fl_hw_cidx = 0; /* to silence gcc warning */ - } - -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_ADJ_CREDIT) { - MPASS(sort_before_lro(lro)); - iq->flags &= ~IQ_ADJ_CREDIT; - if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { - tcp_lro_flush_all(lro); - t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | - V_INGRESSQID((u32)iq->cntxt_id) | - V_SEINTARM(iq->intr_params)); - return (0); - } - ndescs = 1; - } -#else - MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); -#endif - /* * We always come back and check the descriptor ring for new indirect * interrupts and other responses after running a single handler. @@ -1463,74 +1458,40 @@ service_iq(struct sge_iq *iq, int budget) rmb(); - refill = 0; - m0 = NULL; rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); lq = be32toh(d->rsp.pldbuflen_qid); switch (rsp_type) { case X_RSPD_TYPE_FLBUF: + panic("%s: data for an iq (%p) with no freelist", + __func__, iq); - KASSERT(iq->flags & IQ_HAS_FL, - ("%s: data for an iq (%p) with no freelist", - __func__, iq)); + /* NOTREACHED */ - m0 = get_fl_payload(sc, fl, lq); - if (__predict_false(m0 == NULL)) - goto process_iql; - refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; -#ifdef T4_PKT_TIMESTAMP - /* - * 60 bit timestamp for the payload is - * *(uint64_t *)m0->m_pktdat. Note that it is - * in the leading free-space in the mbuf. The - * kernel can clobber it during a pullup, - * m_copymdata, etc. You need to make sure that - * the mbuf reaches you unmolested if you care - * about the timestamp. - */ - *(uint64_t *)m0->m_pktdat = - be64toh(ctrl->u.last_flit) & - 0xfffffffffffffff; -#endif - - /* fall through */ - case X_RSPD_TYPE_CPL: KASSERT(d->rss.opcode < NUM_CPL_CMDS, ("%s: bad opcode %02x.", __func__, d->rss.opcode)); - t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, NULL); break; case X_RSPD_TYPE_INTR: - /* - * Interrupts should be forwarded only to queues - * that are not forwarding their interrupts. - * This means service_iq can recurse but only 1 - * level deep. - */ - KASSERT(budget == 0, - ("%s: budget %u, rsp_type %u", __func__, - budget, rsp_type)); - - /* * There are 1K interrupt-capable queues (qids 0 * through 1023). A response type indicating a * forwarded interrupt with a qid >= 1K is an * iWARP async notification. */ - if (lq >= 1024) { - t4_an_handler(iq, &d->rsp); - break; - } + if (__predict_true(lq >= 1024)) { + t4_an_handler(iq, &d->rsp); + break; + } q = sc->sge.iqmap[lq - sc->sge.iq_start - sc->sge.iq_base]; if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { - if (service_iq(q, q->qsize / 16) == 0) { + if (service_iq_fl(q, q->qsize / 16) == 0) { atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { @@ -1563,33 +1524,12 @@ service_iq(struct sge_iq *iq, int budget) V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); ndescs = 0; -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && - !sort_before_lro(lro) && - sc->lro_timeout != 0) { - tcp_lro_flush_inactive(lro, - &lro_timeout); - } -#endif - if (budget) { - if (iq->flags & IQ_HAS_FL) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - } return (EINPROGRESS); } } - if (refill) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - fl_hw_cidx = fl->hw_cidx; - } } -process_iql: if (STAILQ_EMPTY(&iql)) break; @@ -1599,13 +1539,168 @@ process_iql: */ q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); - if (service_iq(q, q->qsize / 8) == 0) + if (service_iq_fl(q, q->qsize / 8) == 0) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); } + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); + + return (0); +} + +static inline int +sort_before_lro(struct lro_ctrl *lro) +{ + + return (lro->lro_mbuf_max != 0); +} + +/* + * Deals with interrupts on an iq+fl queue. + */ +static int +service_iq_fl(struct sge_iq *iq, int budget) +{ + struct sge_rxq *rxq = iq_to_rxq(iq); + struct sge_fl *fl; + struct adapter *sc = iq->adapter; + struct iq_desc *d = &iq->desc[iq->cidx]; + int ndescs = 0, limit; + int rsp_type, refill, starved; + uint32_t lq; + uint16_t fl_hw_cidx; + struct mbuf *m0; #if defined(INET) || defined(INET6) + const struct timeval lro_timeout = {0, sc->lro_timeout}; + struct lro_ctrl *lro = &rxq->lro; +#endif + + KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + MPASS(iq->flags & IQ_HAS_FL); + + limit = budget ? budget : iq->qsize / 16; + fl = &rxq->fl; + fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_ADJ_CREDIT) { + MPASS(sort_before_lro(lro)); + iq->flags &= ~IQ_ADJ_CREDIT; + if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { + tcp_lro_flush_all(lro); + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | + V_INGRESSQID((u32)iq->cntxt_id) | + V_SEINTARM(iq->intr_params)); + return (0); + } + ndescs = 1; + } +#else + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); +#endif + + while ((d->rsp.u.type_gen & F_RSPD_GEN) == iq->gen) { + + rmb(); + + refill = 0; + m0 = NULL; + rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); + lq = be32toh(d->rsp.pldbuflen_qid); + + switch (rsp_type) { + case X_RSPD_TYPE_FLBUF: + + m0 = get_fl_payload(sc, fl, lq); + if (__predict_false(m0 == NULL)) + goto out; + refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; +#ifdef T4_PKT_TIMESTAMP + /* + * 60 bit timestamp for the payload is + * *(uint64_t *)m0->m_pktdat. Note that it is + * in the leading free-space in the mbuf. The + * kernel can clobber it during a pullup, + * m_copymdata, etc. You need to make sure that + * the mbuf reaches you unmolested if you care + * about the timestamp. + */ + *(uint64_t *)m0->m_pktdat = + be64toh(ctrl->u.last_flit) & 0xfffffffffffffff; +#endif + + /* fall through */ + + case X_RSPD_TYPE_CPL: + KASSERT(d->rss.opcode < NUM_CPL_CMDS, + ("%s: bad opcode %02x.", __func__, d->rss.opcode)); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + break; + + case X_RSPD_TYPE_INTR: + + /* + * There are 1K interrupt-capable queues (qids 0 + * through 1023). A response type indicating a + * forwarded interrupt with a qid >= 1K is an + * iWARP async notification. That is the only + * acceptable indirect interrupt on this queue. + */ + if (__predict_false(lq < 1024)) { + panic("%s: indirect interrupt on iq_fl %p " + "with qid %u", __func__, iq, lq); + } + + t4_an_handler(iq, &d->rsp); + break; + + default: + KASSERT(0, ("%s: illegal response type %d on iq %p", + __func__, rsp_type, iq)); + log(LOG_ERR, "%s: illegal response type %d on iq %p", + device_get_nameunit(sc->dev), rsp_type, iq); + break; + } + + d++; + if (__predict_false(++iq->cidx == iq->sidx)) { + iq->cidx = 0; + iq->gen ^= F_RSPD_GEN; + d = &iq->desc[0]; + } + if (__predict_false(++ndescs == limit)) { + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID(iq->cntxt_id) | + V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); + ndescs = 0; + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_LRO_ENABLED && + !sort_before_lro(lro) && + sc->lro_timeout != 0) { + tcp_lro_flush_inactive(lro, &lro_timeout); + } +#endif + if (budget) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + + return (EINPROGRESS); + } + } + if (refill) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_hw_cidx = fl->hw_cidx; + } + } +out: +#if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { if (ndescs > 0 && lro->lro_mbuf_count > 8) { MPASS(sort_before_lro(lro)); @@ -1621,15 +1716,11 @@ process_iql: t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); - if (iq->flags & IQ_HAS_FL) { - int starved; - - FL_LOCK(fl); - starved = refill_fl(sc, fl, 64); - FL_UNLOCK(fl); - if (__predict_false(starved != 0)) - add_fl_to_sfl(sc, fl); - } + FL_LOCK(fl); + starved = refill_fl(sc, fl, 64); + FL_UNLOCK(fl); + if (__predict_false(starved != 0)) + add_fl_to_sfl(sc, fl); return (0); } From owner-svn-src-head@freebsd.org Sat Aug 11 06:13:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D7D2105FAC1; Sat, 11 Aug 2018 06:13:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1700D8E094; Sat, 11 Aug 2018 06:13:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6C7D1346E; Sat, 11 Aug 2018 06:13:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B6DB6r099339; Sat, 11 Aug 2018 06:13:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B6DBgK099338; Sat, 11 Aug 2018 06:13:11 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808110613.w7B6DBgK099338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 11 Aug 2018 06:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337610 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337610 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 06:13:12 -0000 Author: dteske Date: Sat Aug 11 06:13:11 2018 New Revision: 337610 URL: https://svnweb.freebsd.org/changeset/base/337610 Log: dwatch(1): Fix syntax error in vop_readdir profile Reported by: Arne Ehrlich MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/libexec/vop_readdir Modified: head/cddl/usr.sbin/dwatch/libexec/vop_readdir ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/vop_readdir Sat Aug 11 04:55:47 2018 (r337609) +++ head/cddl/usr.sbin/dwatch/libexec/vop_readdir Sat Aug 11 06:13:11 2018 (r337610) @@ -163,6 +163,7 @@ $PROBE /this->fi_mount != 0/ /* probe ID $(( $ID + $MA this->path = strjoin(this->path, strjoin(this->name = (this->d_name != 0 ? this->d_name : ""), this->name != "" ? "/" : "")); +} EOF ACTIONS=$( cat <&9 ) ID=$(( $ID + $MAX_DEPTH + 5 )) From owner-svn-src-head@freebsd.org Sat Aug 11 06:32:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A13BB1060184; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D2F8EA33; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36D49137B8; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B6WWao009977; Sat, 11 Aug 2018 06:32:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B6WVE9009976; Sat, 11 Aug 2018 06:32:31 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808110632.w7B6WVE9009976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 11 Aug 2018 06:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337611 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 06:32:32 -0000 Author: dteske Date: Sat Aug 11 06:32:31 2018 New Revision: 337611 URL: https://svnweb.freebsd.org/changeset/base/337611 Log: dwatch(1): Add systop profile Provides a top-like view of syscall consumers. MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Added: head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 2018 (r337610) +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 2018 (r337611) @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused Added: head/cddl/usr.sbin/dwatch/libexec/systop ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dwatch/libexec/systop Sat Aug 11 06:32:31 2018 (r337611) @@ -0,0 +1,84 @@ +# -*- tab-width: 4 -*- ;; Emacs +# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM +############################################################ IDENT(1) +# +# $Title: dwatch(8) profile for top-like syscall $ +# $Copyright: 2014-2018 Devin Teske. All rights reserved. $ +# $FreeBSD$ +# +############################################################ DESCRIPTION +# +# Every 3 seconds update the screen with syscall consumers. +# +############################################################ PRAGMAS + +# Optional: You can override the default pragmas (shown below) + +DTRACE_PRAGMA=" + option quiet + option aggsortrev +" # END-QUOTE + +############################################################ PROBE + +: ${PROBE:=profile:::tick-3s} + +############################################################ ACTIONS + +exec 9< /dev/null ) +rows="${size%% *}" +cols="${size#* }" + +exec 9< Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B501062EFD; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8D871964; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EFBB14B07; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B8YPYa070989; Sat, 11 Aug 2018 08:34:25 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B8YPeY070988; Sat, 11 Aug 2018 08:34:25 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808110834.w7B8YPeY070988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 08:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337612 - head/sbin/mount_cd9660 X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/mount_cd9660 X-SVN-Commit-Revision: 337612 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 08:34:25 -0000 Author: sevan (doc committer) Date: Sat Aug 11 08:34:24 2018 New Revision: 337612 URL: https://svnweb.freebsd.org/changeset/base/337612 Log: Advise reader to also see mdconfig(8) in mount_cd9660(8). It's useful for how to mount an iso file via loopback. Reviewed by: jilles Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D16067 Modified: head/sbin/mount_cd9660/mount_cd9660.8 Modified: head/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- head/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 06:32:31 2018 (r337611) +++ head/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 08:34:24 2018 (r337612) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd August 11, 2018 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -140,6 +140,7 @@ The following command can be used to mount a Kodak Pho .Xr unmount 2 , .Xr cd9660 5 , .Xr fstab 5 , +.Xr mdconfig 8 , .Xr mount 8 .Sh HISTORY The From owner-svn-src-head@freebsd.org Sat Aug 11 10:21:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66AFB1065DA1; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3BB74F99; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFB8515C1A; Sat, 11 Aug 2018 10:21:21 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BALLAC025579; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BALL6L025578; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808111021.w7BALL6L025578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 10:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337614 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337614 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 10:21:22 -0000 Author: sevan (doc committer) Date: Sat Aug 11 10:21:21 2018 New Revision: 337614 URL: https://svnweb.freebsd.org/changeset/base/337614 Log: Drop the ternary operator for calculating ssid display length in list_scan(). Regardless if a verbose scan is required or not, we'd still want to display the full SSID name by default so use the IEE80211_NWID_LEN constant to set the value to use instead. Tested on rene@'s laptop. Reviewed by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16566 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Aug 11 09:32:20 2018 (r337613) +++ head/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:21:21 2018 (r337614) @@ -3496,7 +3496,7 @@ list_scan(int s) uint8_t buf[24*1024]; char ssid[IEEE80211_NWID_LEN+1]; const uint8_t *cp; - int len, ssidmax, idlen; + int len, idlen; if (get80211len(s, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf), &len) < 0) errx(1, "unable to get scan results"); @@ -3505,9 +3505,8 @@ list_scan(int s) getchaninfo(s); - ssidmax = verbose ? IEEE80211_NWID_LEN : 32; printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" - , ssidmax, ssidmax, "SSID/MESH ID" + , IEEE80211_NWID_LEN, IEEE80211_NWID_LEN, "SSID/MESH ID" , "BSSID" , "CHAN" , "RATE" @@ -3530,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , ssidmax - , copy_essid(ssid, ssidmax, idp, idlen) + , IEE80211_NWID_LEN + , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) From owner-svn-src-head@freebsd.org Sat Aug 11 10:42:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EB9106685F; Sat, 11 Aug 2018 10:42:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE6275CCF; Sat, 11 Aug 2018 10:42:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF9CA16029; Sat, 11 Aug 2018 10:42:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BAgCC8035451; Sat, 11 Aug 2018 10:42:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BAgC56035450; Sat, 11 Aug 2018 10:42:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111042.w7BAgC56035450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 10:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337615 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 337615 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 10:42:13 -0000 Author: dim Date: Sat Aug 11 10:42:12 2018 New Revision: 337615 URL: https://svnweb.freebsd.org/changeset/base/337615 Log: Pull in r338481 from upstream llvm trunk (by Chandler Carruth): [x86] Fix a really subtle miscompile due to a somewhat glaring bug in EFLAGS copy lowering. If you have a branch of LLVM, you may want to cherrypick this. It is extremely unlikely to hit this case empirically, but it will likely manifest as an "impossible" branch being taken somewhere, and will be ... very hard to debug. Hitting this requires complex conditions living across complex control flow combined with some interesting memory (non-stack) initialized with the results of a comparison. Also, because you have to arrange for an EFLAGS copy to be in *just* the right place, almost anything you do to the code will hide the bug. I was unable to reduce anything remotely resembling a "good" test case from the place where I hit it, and so instead I have constructed synthetic MIR testing that directly exercises the bug in question (as well as the good behavior for completeness). The issue is that we would mistakenly assume any SETcc with a valid condition and an initial operand that was a register and a virtual register at that to be a register *defining* SETcc... It isn't though.... This would in turn cause us to test some other bizarre register, typically the base pointer of some memory. Now, testing this register and using that to branch on doesn't make any sense. It even fails the machine verifier (if you are running it) due to the wrong register class. But it will make it through LLVM, assemble, and it *looks* fine... But wow do you get a very unsual and surprising branch taken in your actual code. The fix is to actually check what kind of SETcc instruction we're dealing with. Because there are a bunch of them, I just test the may-store bit in the instruction. I've also added an assert for sanity that ensure we are, in fact, *defining* the register operand. =D Noticed by: kib MFC after: 1 week Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 11 10:21:21 2018 (r337614) +++ head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 11 10:42:12 2018 (r337615) @@ -608,9 +608,12 @@ X86FlagsCopyLoweringPass::collectCondsInRegs(MachineBa for (MachineInstr &MI : llvm::reverse( llvm::make_range(MBB.instr_begin(), CopyDefI.getIterator()))) { X86::CondCode Cond = X86::getCondFromSETOpc(MI.getOpcode()); - if (Cond != X86::COND_INVALID && MI.getOperand(0).isReg() && - TRI->isVirtualRegister(MI.getOperand(0).getReg())) + if (Cond != X86::COND_INVALID && !MI.mayStore() && MI.getOperand(0).isReg() && + TRI->isVirtualRegister(MI.getOperand(0).getReg())) { + assert(MI.getOperand(0).isDef() && + "A non-storing SETcc should always define a register!"); CondRegs[Cond] = MI.getOperand(0).getReg(); + } // Stop scanning when we see the first definition of the EFLAGS as prior to // this we would potentially capture the wrong flag state. From owner-svn-src-head@freebsd.org Sat Aug 11 11:05:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D5010674AB; Sat, 11 Aug 2018 11:05:23 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBBD276B99; Sat, 11 Aug 2018 11:05:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C00F5164F7; Sat, 11 Aug 2018 11:05:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BB5MrO048443; Sat, 11 Aug 2018 11:05:22 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BB5Msw048442; Sat, 11 Aug 2018 11:05:22 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808111105.w7BB5Msw048442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 11:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337617 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337617 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 11:05:23 -0000 Author: sevan (doc committer) Date: Sat Aug 11 11:05:22 2018 New Revision: 337617 URL: https://svnweb.freebsd.org/changeset/base/337617 Log: IEEE! Pointy hat: myself Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:49:43 2018 (r337616) +++ head/sbin/ifconfig/ifieee80211.c Sat Aug 11 11:05:22 2018 (r337617) @@ -3529,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , IEE80211_NWID_LEN - , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) + , IEEE80211_NWID_LEN + , copy_essid(ssid, IEEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) From owner-svn-src-head@freebsd.org Sat Aug 11 11:13:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D70110679F6; Sat, 11 Aug 2018 11:13:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39B26771CD; Sat, 11 Aug 2018 11:13:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15881166D3; Sat, 11 Aug 2018 11:13:35 +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 w7BBDYNT053400; Sat, 11 Aug 2018 11:13:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BBDYTM053399; Sat, 11 Aug 2018 11:13:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201808111113.w7BBDYTM053399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 11 Aug 2018 11:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337618 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337618 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 11:13:35 -0000 Author: jilles Date: Sat Aug 11 11:13:34 2018 New Revision: 337618 URL: https://svnweb.freebsd.org/changeset/base/337618 Log: printf: Fix \c in %b in printf builtin exiting the shell after r337458 SVN r337458 erroneously partially reverted r265885. This is immediately visible when running the Kyua/ATF tests for usr.bin/printf, which actually test sh's printf builtin. PR: 229641 Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sat Aug 11 11:05:22 2018 (r337617) +++ head/usr.bin/printf/printf.c Sat Aug 11 11:13:34 2018 (r337618) @@ -388,7 +388,7 @@ printf_doformat(char *fmt, int *rval) free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-head@freebsd.org Sat Aug 11 13:01:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FC4106B702; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6693D7B480; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47D8C17934; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BD1lAg009900; Sat, 11 Aug 2018 13:01:47 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BD1laN009899; Sat, 11 Aug 2018 13:01:47 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111301.w7BD1laN009899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 13:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337620 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337620 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:01:47 -0000 Author: netchild Date: Sat Aug 11 13:01:46 2018 New Revision: 337620 URL: https://svnweb.freebsd.org/changeset/base/337620 Log: Add "ESI Juli@ XTe" as a supported device. Submitted by: Vladislav Movchan PR: 222025 Sponsored by: Essen Hackathon Modified: head/share/man/man4/snd_envy24ht.4 Modified: head/share/man/man4/snd_envy24ht.4 ============================================================================== --- head/share/man/man4/snd_envy24ht.4 Sat Aug 11 11:28:51 2018 (r337619) +++ head/share/man/man4/snd_envy24ht.4 Sat Aug 11 13:01:46 2018 (r337620) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2014 +.Dd August 11, 2018 .Dt SND_ENVY24HT 4 .Os .Sh NAME @@ -68,6 +68,8 @@ Audiotrak Prodigy 7.1 XT Audiotrak Prodigy HD2 .It ESI Juli@ +.It +ESI Juli@ XTe .It M-Audio Audiophile 192 .It From owner-svn-src-head@freebsd.org Sat Aug 11 13:06:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B870106BA84; Sat, 11 Aug 2018 13:06:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B7A7B89D; Sat, 11 Aug 2018 13:06:04 +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)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id DDCC9FF20; Sat, 11 Aug 2018 13:06:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.28.128.1] (p5B34BA34.dip0.t-ipconnect.de [91.52.186.52]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 368274C7AD; Sat, 11 Aug 2018 15:06:01 +0200 (CEST) From: "Kristof Provost" To: "Devin Teske" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec Date: Sat, 11 Aug 2018 15:06:00 +0200 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <201808110632.w7B6WVE9009976@repo.freebsd.org> References: <201808110632.w7B6WVE9009976@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 13:06:04 -0000 Hi Devin, On 11 Aug 2018, at 8:32, Devin Teske wrote: > Author: dteske > Date: Sat Aug 11 06:32:31 2018 > New Revision: 337611 > URL: https://svnweb.freebsd.org/changeset/base/337611 > > Log: > dwatch(1): Add systop profile > > Provides a top-like view of syscall consumers. > > MFC after: 3 days > X-MFC-to: stable/11 > Sponsored by: Smule, Inc. > > Added: > head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) > Modified: > head/cddl/usr.sbin/dwatch/libexec/Makefile > > Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile > ============================================================================== > --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 > 2018 (r337610) > +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 > 2018 (r337611) > @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv > ${LIBEXECDIR}/dw > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop This breaks install world: install: link /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop -> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: No such file or directory Regards, Kristof From owner-svn-src-head@freebsd.org Sat Aug 11 13:18:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED40C106C176; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A38C97BFB0; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8610B17B33; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDIKns016025; Sat, 11 Aug 2018 13:18:20 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDIKMZ016023; Sat, 11 Aug 2018 13:18:20 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111318.w7BDIKMZ016023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 13:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337621 - in head/share/man: man5 man7 X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: in head/share/man: man5 man7 X-SVN-Commit-Revision: 337621 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:18:21 -0000 Author: netchild Date: Sat Aug 11 13:18:19 2018 New Revision: 337621 URL: https://svnweb.freebsd.org/changeset/base/337621 Log: Add svnlite to places where svn is mentioned. The Makefile part in the PR is solved already differently, so this part is skipped form the PR The man page change change is slightly changed to adapt to the way the Makefile works and to the spirit of what is intended here. Submitted by: Juan Ramón Molina Menor PR: 194910 Sponsored by: Essen Hackathon Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sat Aug 11 13:01:46 2018 (r337620) +++ head/share/man/man5/make.conf.5 Sat Aug 11 13:18:19 2018 (r337621) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd August 11, 2018 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -234,12 +234,13 @@ Set this to not update the ports tree during .Pq Vt bool Set this to use .Xr svn 1 +or +.Xr svnlite 1 to update your .Pa src tree with .Dq Li "make update" . -Note that since a subversion client is not included in the base system, -you will need to set +Note that you can set .Va SVN to the full path of a .Xr svn 1 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sat Aug 11 13:01:46 2018 (r337620) +++ head/share/man/man7/build.7 Sat Aug 11 13:18:19 2018 (r337621) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2017 +.Dd August 11, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -42,6 +42,8 @@ and These directories may be initially empty or non-existent until updated with .Xr svn 1 or +.Xr svnlite 1 +or .Xr portsnap 8 . Directory .Pa /usr/src @@ -789,6 +791,7 @@ make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installw .Xr install 1 , .Xr make 1 , .Xr svn 1 , +.Xr svnlite 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr arch 7 , From owner-svn-src-head@freebsd.org Sat Aug 11 13:23:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7D0106C607; Sat, 11 Aug 2018 13:23:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20BD17C5D0; Sat, 11 Aug 2018 13:23:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B2417CE8; Sat, 11 Aug 2018 13:23:09 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDN9rT021372; Sat, 11 Aug 2018 13:23:09 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDN9s2021370; Sat, 11 Aug 2018 13:23:09 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111323.w7BDN9s2021370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337622 - in head: etc usr.sbin/auditd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/auditd X-SVN-Commit-Revision: 337622 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:23:10 -0000 Author: brd Date: Sat Aug 11 13:23:09 2018 New Revision: 337622 URL: https://svnweb.freebsd.org/changeset/base/337622 Log: Move OpenBSM to CONFS This helps with pkgbase as these config files will be properly tagged as config files. Approved by: allanjude (mentor), oshogbo Differential Revision: https://reviews.freebsd.org/D16679 Modified: head/etc/Makefile head/usr.sbin/auditd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:18:19 2018 (r337621) +++ head/etc/Makefile Sat Aug 11 13:23:09 2018 (r337622) @@ -56,14 +56,6 @@ BIN1+= etc.${MACHINE_CPUARCH}/ttys .error etc.MACHINE/ttys missing .endif -OPENBSMDIR= ${SRCTOP}/contrib/openbsm -BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ - ${OPENBSMDIR}/etc/audit_event -BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \ - ${OPENBSMDIR}/etc/audit_user -BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn -BSM_ETC_DIR= ${DESTDIR}/etc/security - # NB: keep these sorted by MK_* knobs .if ${MK_AMD} != "no" @@ -203,12 +195,6 @@ distribution: ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \ - ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \ - ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ - ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ Modified: head/usr.sbin/auditd/Makefile ============================================================================== --- head/usr.sbin/auditd/Makefile Sat Aug 11 13:18:19 2018 (r337621) +++ head/usr.sbin/auditd/Makefile Sat Aug 11 13:23:09 2018 (r337622) @@ -7,6 +7,18 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm CFLAGS+= -I${OPENBSMDIR} +OPENBSMETCDIR= ${OPENBSMDIR}/etc +CONFS= ${OPENBSMETCDIR}/audit_class +CONFSMODE_${OPENBSMETCDIR}/audit_class= 444 +CONFS+= ${OPENBSMETCDIR}/audit_control +CONFSMODE_${OPENBSMETCDIR}/audit_control= 600 +CONFS+= ${OPENBSMETCDIR}/audit_event +CONFSMODE_${OPENBSMETCDIR}/audit_event= 444 +CONFS+= ${OPENBSMETCDIR}/audit_user +CONFSMODE_${OPENBSMETCDIR}/audit_user= 600 +CONFS+= ${OPENBSMETCDIR}/audit_warn +CONFSMODE_${OPENBSMETCDIR}/audit_warn= 500 +CONFSDIR= /etc/security PROG= auditd SRCS= auditd.c audit_warn.c auditd_fbsd.c MAN= auditd.8 From owner-svn-src-head@freebsd.org Sat Aug 11 13:25:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE232106C761; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D497C7C4; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6715A17CF1; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDPe6G021522; Sat, 11 Aug 2018 13:25:40 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDPd92021519; Sat, 11 Aug 2018 13:25:39 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111325.w7BDPd92021519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337623 - in head: etc sbin/ddb X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/ddb X-SVN-Commit-Revision: 337623 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:25:41 -0000 Author: brd Date: Sat Aug 11 13:25:39 2018 New Revision: 337623 URL: https://svnweb.freebsd.org/changeset/base/337623 Log: Move ddb.conf to sbin/ddb/ and switch to CONFS. This helps pkgbase as this config file will now be tagged as a config file. Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D16675 Added: head/sbin/ddb/ddb.conf - copied unchanged from r337622, head/etc/ddb.conf Deleted: head/etc/ddb.conf Modified: head/etc/Makefile head/sbin/ddb/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:23:09 2018 (r337622) +++ head/etc/Makefile Sat Aug 11 13:25:39 2018 (r337623) @@ -15,7 +15,6 @@ SUBDIR+=sendmail BIN1= crontab \ devd.conf \ devfs.conf \ - ddb.conf \ dhclient.conf \ disktab \ fbtab \ Modified: head/sbin/ddb/Makefile ============================================================================== --- head/sbin/ddb/Makefile Sat Aug 11 13:23:09 2018 (r337622) +++ head/sbin/ddb/Makefile Sat Aug 11 13:25:39 2018 (r337623) @@ -1,5 +1,6 @@ # $FreeBSD$ +CONFS= ddb.conf PACKAGE=runtime PROG= ddb SRCS= ddb.c ddb_capture.c ddb_script.c Copied: head/sbin/ddb/ddb.conf (from r337622, head/etc/ddb.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ddb/ddb.conf Sat Aug 11 13:25:39 2018 (r337623, copy of r337622, head/etc/ddb.conf) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``ddb'' to define debugging scripts. +# +# see ``man 4 ddb'' and ``man 8 ddb'' for details. +# + +script lockinfo=show locks; show alllocks; show lockedvnods + +# kdb.enter.panic panic(9) was called. +script kdb.enter.panic=textdump set; capture on; run lockinfo; show pcpu; bt; ps; alltrace; capture off; call doadump; reset + +# kdb.enter.witness witness(4) detected a locking error. +script kdb.enter.witness=run lockinfo From owner-svn-src-head@freebsd.org Sat Aug 11 13:28:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF3F106C8C1; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE5B7C9BE; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DE2017CFA; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDS3c6021656; Sat, 11 Aug 2018 13:28:03 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDS3UH021653; Sat, 11 Aug 2018 13:28:03 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111328.w7BDS3UH021653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337624 - in head: etc sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/sysctl X-SVN-Commit-Revision: 337624 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:28:04 -0000 Author: brd Date: Sat Aug 11 13:28:03 2018 New Revision: 337624 URL: https://svnweb.freebsd.org/changeset/base/337624 Log: Move sysctl.conf to sbin/sysctl/ and switch to CONFS. This helps with pkgbase to tag this config file as a config file. Approved by: allanjude (mentor), will (mentor) Differential Revision: https://reviews.freebsd.org/D16559 Added: head/sbin/sysctl/sysctl.conf - copied unchanged from r337623, head/etc/sysctl.conf Deleted: head/etc/sysctl.conf Modified: head/etc/Makefile head/sbin/sysctl/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:25:39 2018 (r337623) +++ head/etc/Makefile Sat Aug 11 13:28:03 2018 (r337624) @@ -41,7 +41,6 @@ BIN1= crontab \ remote \ rpc \ services \ - sysctl.conf \ syslog.conf \ termcap.small Modified: head/sbin/sysctl/Makefile ============================================================================== --- head/sbin/sysctl/Makefile Sat Aug 11 13:25:39 2018 (r337623) +++ head/sbin/sysctl/Makefile Sat Aug 11 13:28:03 2018 (r337624) @@ -2,6 +2,7 @@ # $FreeBSD$ PACKAGE=runtime +CONFS= sysctl.conf PROG= sysctl WARNS?= 3 MAN= sysctl.8 Copied: head/sbin/sysctl/sysctl.conf (from r337623, head/etc/sysctl.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/sysctl/sysctl.conf Sat Aug 11 13:28:03 2018 (r337624, copy of r337623, head/etc/sysctl.conf) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. +# + +# Uncomment this to prevent users from seeing information about processes that +# are being run under another UID. +#security.bsd.see_other_uids=0 From owner-svn-src-head@freebsd.org Sat Aug 11 13:47:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7481D106D190; Sat, 11 Aug 2018 13:47:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 206AC7D44A; Sat, 11 Aug 2018 13:47:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F324218048; Sat, 11 Aug 2018 13:47:28 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDlSI1031328; Sat, 11 Aug 2018 13:47:28 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDlSGM031325; Sat, 11 Aug 2018 13:47:28 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111347.w7BDlSGM031325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337625 - in head: etc usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/bsnmpd/bsnmpd X-SVN-Commit-Revision: 337625 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:47:29 -0000 Author: brd Date: Sat Aug 11 13:47:28 2018 New Revision: 337625 URL: https://svnweb.freebsd.org/changeset/base/337625 Log: Move snmpd.config to usr.sbin/bsnmpd/bsnmpd/ This helps with pkgbase as this config file will now be tagged as a config file Approved by: allanjude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16674 Added: head/usr.sbin/bsnmpd/bsnmpd/snmpd.config - copied unchanged from r337624, head/etc/snmpd.config Deleted: head/etc/snmpd.config Modified: head/etc/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:28:03 2018 (r337624) +++ head/etc/Makefile Sat Aug 11 13:47:28 2018 (r337625) @@ -158,11 +158,6 @@ distribution: ${DESTDIR}/etc/services; .endif -.if ${MK_BSNMP} != "no" - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - snmpd.config ${DESTDIR}/etc; -.endif .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Aug 11 13:28:03 2018 (r337624) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Aug 11 13:47:28 2018 (r337625) @@ -7,6 +7,8 @@ CONTRIB=${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmpd +CONFS= snmpd.config +CONFSMODE= 600 PROG= bsnmpd SRCS= main.c action.c config.c export.c trap.c trans_udp.c trans_lsock.c SRCS+= oid.h tree.c tree.h Copied: head/usr.sbin/bsnmpd/bsnmpd/snmpd.config (from r337624, head/etc/snmpd.config) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/bsnmpd/snmpd.config Sat Aug 11 13:47:28 2018 (r337625, copy of r337624, head/etc/snmpd.config) @@ -0,0 +1,322 @@ +# $FreeBSD$ +# +# Example configuration file for bsnmpd(1). +# + +# +# Set some common variables +# +location := "Room 200" +contact := "sysmeister@example.com" +system := 1 # FreeBSD +traphost := localhost +trapport := 162 + +# +# Set the SNMP engine ID. +# +# The snmpEngineID object required from the SNMPv3 Framework. If not explicitly set via +# this configuration file, an ID is assigned based on the value of the +# kern.hostid variable +# engine := 0x80:0x10:0x08:0x10:0x80:0x25 +# snmpEngineID = $(engine) + +# Change this! +read := "public" +# Uncomment begemotSnmpdCommunityString.0.2 below that sets the community +# string to enable write access. +write := "geheim" +trap := "mytrap" + +# +# Declarations for SNMP-USER-BASED-SM-MIB authentication and privacy options +# + +NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1 +HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2 +HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3 +NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1 +DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2 +AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4 + +# +# Enumerations from SNMP-FRAMEWORK-MIB +# + +# Security models +securityModelAny := 0 +securityModelSNMPv1 := 1 +securityModelSNMPv2c := 2 +securityModelUSM := 3 + +# Message Processing models +MPmodelSNMPv1 := 0 +MPmodelSNMPv2c := 1 +MPmodelSNMPv3 := 3 + +# Security levels +noAuthNoPriv := 1 +authNoPriv := 2 +authPriv := 3 + + +# SNMPv3 USM User definition +# +# The localized hex password for a user may be obtained by setting SNMPUSER, SNMPPASSWD, +# SNMPAUTH and SNMPPRIV environment variables to the desired parameters and invoking +# 'bsnmpget -v 3 -D -K -o verbose' against the running bsnmpd(1). For other +# usages refer to the bsnmpget(1) manual page. The following lines define a user "bsnmp" +# with a private password "bsnmptest", localized for the above engine ID. +# +#user1 := "bsnmp" +#user1passwd := 0x22:0x98:0x1a:0x6e:0x39:0x93:0x16:0x5e:0x6a:0x21:0x1b:0xd8:0xa9:0x81:0x31:0x05:0x16:0x33:0x38:0x60 + +# +# Configuration +# +%snmpd +begemotSnmpdDebugDumpPdus = 2 +begemotSnmpdDebugSyslogPri = 7 + +# +# Set the read and write communities. +# +# The default value of the community strings is NULL (note, that this is +# different from the empty string). This disables both read and write access. +# To enable read access only the read community string must be set. Setting +# the write community string enables both read and write access with that +# string. +# +# Be sure to understand the security implications of SNMPv2 - the community +# strings are readable on the wire! +# +begemotSnmpdCommunityString.0.1 = $(read) +# begemotSnmpdCommunityString.0.2 = $(write) +begemotSnmpdCommunityDisable = 1 + +# open standard SNMP ports +begemotSnmpdPortStatus.0.0.0.0.161 = 1 + +# open a unix domain socket +begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1 +begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4 + +# send traps to the traphost +begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4 +begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2 +begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap) + +sysContact = $(contact) +sysLocation = $(location) +sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system) + +snmpEnableAuthenTraps = 2 + +# Uncomment `begemotSnmpdModulePath.".." = ".."' entries below to enable +# modules + +# +# Control configuration for the modules in the module specific sections, e.g. +# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the +# %usm specific section. You must uncomment the section specific header in +# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)` +# can only be used if %usm is uncommented. +# +# Modules are loaded in the order listed, so they must be before any +# dependent modules, e.g. "mibII" vs "bridge". +# + +# +# MIB-2 module +# +begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" + +# +# Bridge module +# This requires the mibII module. +# +#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" + +# +# Host resources module +# This requires the mibII module. +# +#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" + +# +# LM75 Sensor module +# +#begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" + +# +# Netgraph module +# +#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" + +# +# pf(4) module +# +#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" + +# +# SNMPv3 Notification Targets +# +# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" + +# +# SNMPv3 User-based security module - must be loaded for SNMPv3 USM +# +#begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" + +# +# SNMPv3 View-based Access Control module +# +#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" + +# +# Wireless module +# This requires the mibII module. +# +#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" + +# +# SNMPv3 USM User definition. +# + +#%usm + +# +# The following block creates a user with name "bsnmp" and sets privacy +# and encryption options to SHA256 message digests and AES encryption +# for this user. +# +# usmUserStatus.$(engine).$(user1) = 5 +# usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol) +# usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserPrivProtocol.$(engine).$(user1) = $(AesCfb128Protocol) +# usmUserPrivKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserStatus.$(engine).$(user1) = 1 +# + +# +# The following block creates a user with name "public" with no authentication +# or encryption options. +# +# usmUserStatus.$(engine).$(read) = 5 +# usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol) +# usmUserPrivProtocol.$(engine).$(read) = $(NoPrivProtocol) +# usmUserStatus.$(engine).$(read) = 1 +# + +# +# Definition of view-based access control entries. +# +#%vacm + +# Definition of a SNMPv1 group +# vacmSecurityToGroupStatus.$(securityModelSNMPv1).$(read) = 4 +# vacmGroupName.$(securityModelSNMPv1).$(read) = $(read) + +# Definition of SNMPv2 group +# vacmSecurityToGroupStatus.$(securityModelSNMPv2c).$(write) = 4 +# vacmGroupName.$(securityModelSNMPv2c).$(write) = $(write) + +# Definition of SNMPv3 group with users "bsnmp" and "public" +# vacmSecurityToGroupStatus.$(securityModelUSM).$(user1) = 4 +# vacmGroupName.$(securityModelUSM).$(user1) = $(write) +# vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4 +# vacmGroupName.$(securityModelUSM).$(read) = $(write) + +# +# The OID of the .iso.org.dod.internet subtree +# +# internetoid := 1.3.6.1 +# internetoidlen := 4 + +# +# Definitions of two views +# +# vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4 +# vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4 + +# +# Access control +# + +# +# Read-only access for SNMPv1 users +# +# vacmAccessStatus.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet" + +# +# Read-write access for SNMPv2 users +# +# vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" +# vacmAccessWriteViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" + +# +# Read-write-notify access for SNMPv3 USM users with noAuthNoPriv +# +# vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" + +# +#Read-write-notify access to restricted for SNMPv3 USM users with authPriv +# +# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" + +#%target +# Send notifications to target tag "test" +# tag := "test" +# snmpNotifyRowStatus.$(tag) = 4 +# snmpNotifyTag.$(tag) = $(tag) + +# tagremote := "testremote" +# snmpNotifyRowStatus.$(tagremote) = 4 +# snmpNotifyTag.$(tagremote) = $(tagremote) + +# +# Specify the target parameters for the notifications - send with the credentials +# of user "bsnmp" +# +# snmpTargetParamsRowStatus.$(tag) = 5 +# snmpTargetParamsMPModel.$(tag) = $(MPmodelSNMPv3) +# snmpTargetParamsSecurityModel.$(tag) = $(securityModelUSM) +# snmpTargetParamsSecurityName.$(tag) = $(user1) +# snmpTargetParamsSecurityLevel.$(tag) = $(authPriv) +# snmpTargetParamsRowStatus.$(tag) = 1 + +# +# Define the notifications' target address - port 162 on localhost +# +# snmpTargetAddrRowStatus.$(tag) = 5 +# snmpTargetAddrTAddress.$(tag) = 0x7f:0x0:0x0:0x1:0x0:0xa2 +# snmpTargetAddrTagList.$(tag) = "test notification" +# snmpTargetAddrParams.$(tag) = $(tag) +# snmpTargetAddrRowStatus.$(tag) = 1 + +# +# Define the notifications' target address - port 162 on 10.0.0.1 +# +# snmpTargetAddrRowStatus.$(tagremote) = 5 +# snmpTargetAddrTAddress.$(tagremote) = 0x0a:0x00:0x00:0x1:0x0:0xa2 +# snmpTargetAddrTagList.$(tagremote) = $(tagremote) +# snmpTargetAddrParams.$(tagremote) = $(tag) +# snmpTargetAddrRowStatus.$(tagremote) = 1 + +# Force a polling rate for the 64-bit interface counters in case +# the automatic computation is wrong (which may be the case if an interface +# announces the wrong bit rate via its MIB). +#%mibII +#begemotIfForcePoll = 2000 + +#%netgraph +#begemotNgControlNodeName = "snmpd" + From owner-svn-src-head@freebsd.org Sat Aug 11 13:52:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16D8106D311; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C6F7D950; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58188181D7; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDqO3O036534; Sat, 11 Aug 2018 13:52:24 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDqNPA036531; Sat, 11 Aug 2018 13:52:23 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111352.w7BDqNPA036531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337626 - in head: etc etc/cron.d usr.bin/at X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/cron.d usr.bin/at X-SVN-Commit-Revision: 337626 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:52:24 -0000 Author: brd Date: Sat Aug 11 13:52:23 2018 New Revision: 337626 URL: https://svnweb.freebsd.org/changeset/base/337626 Log: Move cron.d/at to usr.bin/at/ This helps with pkgbase as it tags this as a config file so it is handled as such Approved by: allanjude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16673 Added: head/usr.bin/at/atrun - copied unchanged from r337625, head/etc/cron.d/at Deleted: head/etc/cron.d/ Modified: head/etc/Makefile head/usr.bin/at/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:47:28 2018 (r337625) +++ head/etc/Makefile Sat Aug 11 13:52:23 2018 (r337626) @@ -174,7 +174,6 @@ distribution: .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif - ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install Modified: head/usr.bin/at/Makefile ============================================================================== --- head/usr.bin/at/Makefile Sat Aug 11 13:47:28 2018 (r337625) +++ head/usr.bin/at/Makefile Sat Aug 11 13:52:23 2018 (r337626) @@ -2,6 +2,9 @@ .include "${.CURDIR}/Makefile.inc" +CONFS= atrun +CONFSDIR= /etc/cron.d +CONFSNAME= at PROG= at SRCS= at.c panic.c parsetime.c perm.c LINKS= ${BINDIR}/at ${BINDIR}/atq \ Copied: head/usr.bin/at/atrun (from r337625, head/etc/cron.d/at) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/at/atrun Sat Aug 11 13:52:23 2018 (r337626, copy of r337625, head/etc/cron.d/at) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# +SHELL=/bin/sh +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin + +# See crontab(5) for field format. +*/5 * * * * root /usr/libexec/atrun From owner-svn-src-head@freebsd.org Sat Aug 11 13:58:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38633106D5D1; Sat, 11 Aug 2018 13:58:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D85307DB5E; Sat, 11 Aug 2018 13:58:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9ECF181EF; Sat, 11 Aug 2018 13:58:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDwQF3036833; Sat, 11 Aug 2018 13:58:26 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDwQ8R036831; Sat, 11 Aug 2018 13:58:26 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111358.w7BDwQ8R036831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337627 - in head: etc sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/pfctl X-SVN-Commit-Revision: 337627 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 13:58:27 -0000 Author: brd Date: Sat Aug 11 13:58:26 2018 New Revision: 337627 URL: https://svnweb.freebsd.org/changeset/base/337627 Log: Move pf.os to sbin/pfctl/ Approved by: will (mentor) Glanced at by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16557 Added: head/sbin/pfctl/pf.os - copied unchanged from r337626, head/etc/pf.os Deleted: head/etc/pf.os Modified: head/etc/Makefile head/sbin/pfctl/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:52:23 2018 (r337626) +++ head/etc/Makefile Sat Aug 11 13:58:26 2018 (r337627) @@ -93,10 +93,6 @@ SSH= ${SRCTOP}/crypto/openssh/ssh_config \ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf .endif -.if ${MK_PF} != "no" -BIN1+= pf.os -.endif - .if ${MK_SENDMAIL} != "no" BIN1+= rc.sendmail .endif Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Sat Aug 11 13:52:23 2018 (r337626) +++ head/sbin/pfctl/Makefile Sat Aug 11 13:58:26 2018 (r337627) @@ -6,6 +6,7 @@ .PATH: ${SRCTOP}/sys/netpfil/pf PACKAGE=pf +CONFS= pf.os PROG= pfctl MAN= pfctl.8 Copied: head/sbin/pfctl/pf.os (from r337626, head/etc/pf.os) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/pf.os Sat Aug 11 13:58:26 2018 (r337627, copy of r337626, head/etc/pf.os) @@ -0,0 +1,709 @@ +# $FreeBSD$ +# $OpenBSD: pf.os,v 1.27 2016/09/03 17:08:57 sthen Exp $ +# passive OS fingerprinting +# ------------------------- +# +# SYN signatures. Those signatures work for SYN packets only (duh!). +# +# (C) Copyright 2000-2003 by Michal Zalewski +# (C) Copyright 2003 by Mike Frantzen +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# +# This fingerprint database is adapted from Michal Zalewski's p0f passive +# operating system package. The last database sync was from a Nov 3 2003 +# p0f.fp. +# +# +# Each line in this file specifies a single fingerprint. Please read the +# information below carefully before attempting to append any signatures +# reported as UNKNOWN to this file to avoid mistakes. +# +# We use the following set metrics for fingerprinting: +# +# - Window size (WSS) - a highly OS dependent setting used for TCP/IP +# performance control (max. amount of data to be sent without ACK). +# Some systems use a fixed value for initial packets. On other +# systems, it is a multiple of MSS or MTU (MSS+40). In some rare +# cases, the value is just arbitrary. +# +# NEW SIGNATURE: if p0f reported a special value of 'Snn', the number +# appears to be a multiple of MSS (MSS*nn); a special value of 'Tnn' +# means it is a multiple of MTU ((MSS+40)*nn). Unless you notice the +# value of nn is not fixed (unlikely), just copy the Snn or Tnn token +# literally. If you know this device has a simple stack and a fixed +# MTU, you can however multiply S value by MSS, or T value by MSS+40, +# and put it instead of Snn or Tnn. +# +# If WSS otherwise looks like a fixed value (for example a multiple +# of two), or if you can confirm the value is fixed, please quote +# it literally. If there's no apparent pattern in WSS chosen, you +# should consider wildcarding this value. +# +# - Overall packet size - a function of all IP and TCP options and bugs. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Initial TTL - We check the actual TTL of a received packet. It can't +# be higher than the initial TTL, and also shouldn't be dramatically +# lower (maximum distance is defined as 40 hops). +# +# NEW SIGNATURE: *Never* copy TTL from a p0f-reported signature literally. +# You need to determine the initial TTL. The best way to do it is to +# check the documentation for a remote system, or check its settings. +# A fairly good method is to simply round the observed TTL up to +# 32, 64, 128, or 255, but it should be noted that some obscure devices +# might not use round TTLs (in particular, some shoddy appliances use +# "original" initial TTL settings). If not sure, you can see how many +# hops you're away from the remote party with traceroute or mtr. +# +# - Don't fragment flag (DF) - some modern OSes set this to implement PMTU +# discovery. Others do not bother. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Maximum segment size (MSS) - this setting is usually link-dependent. P0f +# uses it to determine link type of the remote host. +# +# NEW SIGNATURE: Always wildcard this value, except for rare cases when +# you have an appliance with a fixed value, know the system supports only +# a very limited number of network interface types, or know the system +# is using a value it pulled out of nowhere. Specific unique MSS +# can be used to tell Google crawlbots from the rest of the population. +# +# - Window scaling (WSCALE) - this feature is used to scale WSS. +# It extends the size of a TCP/IP window to 32 bits. Some modern +# systems implement this feature. +# +# NEW SIGNATURE: Observe several signatures. Initial WSCALE is often set +# to zero or other low value. There's usually no need to wildcard this +# parameter. +# +# - Timestamp - some systems that implement timestamps set them to +# zero in the initial SYN. This case is detected and handled appropriately. +# +# - Selective ACK permitted - a flag set by systems that implement +# selective ACK functionality. +# +# - The sequence of TCP all options (MSS, window scaling, selective ACK +# permitted, timestamp, NOP). Other than the options previously +# discussed, p0f also checks for timestamp option (a silly +# extension to broadcast your uptime ;-), NOP options (used for +# header padding) and sackOK option (selective ACK feature). +# +# NEW SIGNATURE: Copy the sequence literally. +# +# To wildcard any value (except for initial TTL or TCP options), replace +# it with '*'. You can also use a modulo operator to match any values +# that divide by nnn - '%nnn'. +# +# Fingerprint entry format: +# +# wwww:ttt:D:ss:OOO...:OS:Version:Subtype:Details +# +# wwww - window size (can be *, %nnn, Snn or Tnn). The special values +# "S" and "T" which are a multiple of MSS or a multiple of MTU +# respectively. +# ttt - initial TTL +# D - don't fragment bit (0 - not set, 1 - set) +# ss - overall SYN packet size +# OOO - option value and order specification (see below) +# OS - OS genre (Linux, Solaris, Windows) +# Version - OS Version (2.0.27 on x86, etc) +# Subtype - OS subtype or patchlevel (SP3, lo0) +# details - Generic OS details +# +# If OS genre starts with '*', p0f will not show distance, link type +# and timestamp data. It is useful for userland TCP/IP stacks of +# network scanners and so on, where many settings are randomized or +# bogus. +# +# If OS genre starts with @, it denotes an approximate hit for a group +# of operating systems (signature reporting still enabled in this case). +# Use this feature at the end of this file to catch cases for which +# you don't have a precise match, but can tell it's Windows or FreeBSD +# or whatnot by looking at, say, flag layout alone. +# +# Option block description is a list of comma or space separated +# options in the order they appear in the packet: +# +# N - NOP option +# Wnnn - window scaling option, value nnn (or * or %nnn) +# Mnnn - maximum segment size option, value nnn (or * or %nnn) +# S - selective ACK OK +# T - timestamp +# T0 - timestamp with a zero value +# +# To denote no TCP options, use a single '.'. +# +# Please report any additions to this file, or any inaccuracies or +# problems spotted, to the maintainers: lcamtuf@coredump.cx, +# frantzen@openbsd.org and bugs@openbsd.org with a tcpdump packet +# capture of the relevant SYN packet(s) +# +# A test and submission page is available at +# http://lcamtuf.coredump.cx/p0f-help/ +# +# +# WARNING WARNING WARNING +# ----------------------- +# +# Do not add a system X as OS Y just because NMAP says so. It is often +# the case that X is a NAT firewall. While nmap is talking to the +# device itself, p0f is fingerprinting the guy behind the firewall +# instead. +# +# When in doubt, use common sense, don't add something that looks like +# a completely different system as Linux or FreeBSD or LinkSys router. +# Check DNS name, establish a connection to the remote host and look +# at SYN+ACK - does it look similar? +# +# Some users tweak their TCP/IP settings - enable or disable RFC1323 +# functionality, enable or disable timestamps or selective ACK, +# disable PMTU discovery, change MTU and so on. Always compare a new rule +# to other fingerprints for this system, and verify the system isn't +# "customized" before adding it. It is OK to add signature variants +# caused by a commonly used software (personal firewalls, security +# packages, etc), but it makes no sense to try to add every single +# possible /proc/sys/net/ipv4 tweak on Linux or so. +# +# KEEP IN MIND: Some packet firewalls configured to normalize outgoing +# traffic (OpenBSD pf with "scrub" enabled, for example) will, well, +# normalize packets. Signatures will not correspond to the originating +# system (and probably not quite to the firewall either). +# +# NOTE: Try to keep this file in some reasonable order, from most to +# least likely systems. This will speed up operation. Also keep most +# generic and broad rules near the end. +# + +########################## +# Standard OS signatures # +########################## + +# ----------------- AIX --------------------- + +# AIX is first because its signatures are close to NetBSD, MacOS X and +# Linux 2.0, but it uses a fairly rare MSSes, at least sometimes... +# This is a shoddy hack, though. + +45046:64:0:44:M*: AIX:4.3::AIX 4.3 +16384:64:0:44:M512: AIX:4.3:2-3:AIX 4.3.2 and earlier + +16384:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +16384:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:64:M*,N,W1,N,N,T,N,N,S: AIX:5.3:ML1:AIX 5.3 ML1 + +# ----------------- Linux ------------------- + +# S1:64:0:44:M*:A: Linux:1.2::Linux 1.2.x (XXX quirks support) +512:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x +16384:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x + +# Endian snafu! Nelson says "ha-ha": +2:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac +64:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac + + +S4:64:1:60:M1360,S,T,N,W0: Linux:google::Linux (Google crawlbot) + +S2:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4 (big boy) +S3:64:1:60:M*,S,T,N,W0: Linux:2.4:.18-21:Linux 2.4.18 and newer +S4:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4/2.6 <= 2.6.7 +S4:64:1:60:M*,S,T,N,W0: Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7 + +S4:64:1:60:M*,S,T,N,W5: Linux:2.6::Linux 2.6 (newer, 1) +S4:64:1:60:M*,S,T,N,W6: Linux:2.6::Linux 2.6 (newer, 2) +S4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 3) +T4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 4) + +S10:64:1:60:M*,S,T,N,W4: Linux:3.0::Linux 3.0 + +S3:64:1:60:M*,S,T,N,W1: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W1: Linux:2.5-2.6::Linux 2.5/2.6 +S3:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) + +S20:64:1:60:M*,S,T,N,W0: Linux:2.2:20-25:Linux 2.2.20 and newer +S22:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 +S11:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 + +# Popular cluster config scripts disable timestamps and +# selective ACK: +S4:64:1:48:M1460,N,W0: Linux:2.4:cluster:Linux 2.4 in cluster + +# This needs to be investigated. On some systems, WSS +# is selected as a multiple of MTU instead of MSS. I got +# many submissions for this for many late versions of 2.4: +T4:64:1:60:M1412,S,T,N,W0: Linux:2.4::Linux 2.4 (late, uncommon) + +# This happens only over loopback, but let's make folks happy: +32767:64:1:60:M16396,S,T,N,W0: Linux:2.4:lo0:Linux 2.4 (local) +S8:64:1:60:M3884,S,T,N,W0: Linux:2.2:lo0:Linux 2.2 (local) + +# Opera visitors: +16384:64:1:60:M*,S,T,N,W0: Linux:2.2:Opera:Linux 2.2 (Opera?) +32767:64:1:60:M*,S,T,N,W0: Linux:2.4:Opera:Linux 2.4 (Opera?) + +# Some fairly common mods: +S4:64:1:52:M*,N,N,S,N,W0: Linux:2.4:ts:Linux 2.4 w/o timestamps +S22:64:1:52:M*,N,N,S,N,W0: Linux:2.2:ts:Linux 2.2 w/o timestamps + + +# ----------------- FreeBSD ----------------- + +16384:64:1:44:M*: FreeBSD:2.0-2.2::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:3.0-3.5::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:4.0-4.2::FreeBSD 2.0-4.2 +16384:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +1024:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +57344:64:1:44:M*: FreeBSD:4.6-4.8:noRFC1323:FreeBSD 4.6-4.8 (no RFC1323) +57344:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.6-4.9::FreeBSD 4.6-4.9 + +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.1 (or MacOS X) +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.1::FreeBSD 4.8-5.1 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:4.7-4.11::FreeBSD 4.7-5.2 +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.7-5.2 + +# XXX need quirks support +# 65535:64:1:60:M*,N,W0,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (1) +# 65535:64:1:60:M*,N,W1,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (2) +# 65535:64:1:60:M*,N,W2,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (3) +# 65535:64:1:44:M*:Z:FreeBSD:5.2::FreeBSD 5.2 (no RFC1323) + +# 16384:64:1:60:M*,N,N,N,N,N,N,T:FreeBSD:4.4:noTS:FreeBSD 4.4 (w/o timestamps) + +# ----------------- NetBSD ------------------ + +16384:64:0:60:M*,N,W0,N,N,T: NetBSD:1.3::NetBSD 1.3 +65535:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6:opera:NetBSD 1.6 (Opera) +16384:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6 +16384:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:df:NetBSD 1.6 (DF) +65535:64:1:60:M*,N,W1,N,N,T0: NetBSD:1.6::NetBSD 1.6W-current (DF) +65535:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6X (DF) +32768:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:randomization:NetBSD 1.6ZH-current (w/ ip_id randomization) + +# ----------------- OpenBSD ----------------- + +16384:64:0:60:M*,N,W0,N,N,T: OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6) +16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8::OpenBSD 3.0-4.8 +16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df) +57344:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0::OpenBSD 3.3-4.0 +57344:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df) + +65535:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera) + +16384:64:1:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9::OpenBSD 4.9 +16384:64:0:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df) + +16384:64:1:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1::OpenBSD 6.1 +16384:64:0:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1:no-df:OpenBSD 6.1 (scrub no-df) + +# ----------------- DragonFly BSD ----------------- + +57344:64:1:60:M*,N,W0,N,N,T: DragonFly:1.0:A:DragonFly 1.0A +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:1.2-1.12::DragonFly 1.2-1.12 +5840:64:1:60:M*,S,T,N,W4: DragonFly:2.0-2.1::DragonFly 2.0-2.1 +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:2.2-2.3::DragonFly 2.2-2.3 +57344:64:0:64:M*,N,W5,N,N,S,N,N,T: DragonFly:2.4-2.7::DragonFly 2.4-2.7 + +# ----------------- Solaris ----------------- + +S17:64:1:64:N,W3,N,N,T0,N,N,S,M*: Solaris:8:RFC1323:Solaris 8 RFC1323 +S17:64:1:48:N,N,S,M*: Solaris:8::Solaris 8 +S17:255:1:44:M*: Solaris:2.5-2.7::Solaris 2.5 to 7 + +S6:255:1:44:M*: Solaris:2.6-2.7::Solaris 2.6 to 7 +S23:255:1:44:M*: Solaris:2.5:1:Solaris 2.5.1 +S34:64:1:48:M*,N,N,S: Solaris:2.9::Solaris 9 +S44:255:1:44:M*: Solaris:2.7::Solaris 7 + +4096:64:0:44:M1460: SunOS:4.1::SunOS 4.1.x + +S34:64:1:52:M*,N,W0,N,N,S: Solaris:10:beta:Solaris 10 (beta) +32850:64:1:64:M*,N,N,T,N,W1,N,N,S: Solaris:10::Solaris 10 1203 + +# ----------------- IRIX -------------------- + +49152:64:0:44:M*: IRIX:6.4::IRIX 6.4 +61440:64:0:44:M*: IRIX:6.2-6.5::IRIX 6.2-6.5 +49152:64:0:52:M*,N,W2,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) +49152:64:0:52:M*,N,W3,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) + +61440:64:0:48:M*,N,N,S: IRIX:6.5:12-21:IRIX 6.5.12 - 6.5.21 +49152:64:0:48:M*,N,N,S: IRIX:6.5:15-21:IRIX 6.5.15 - 6.5.21 + +49152:60:0:64:M*,N,W2,N,N,T,N,N,S: IRIX:6.5:IP27:IRIX 6.5 IP27 + + +# ----------------- Tru64 ------------------- + +32768:64:1:48:M*,N,W0: Tru64:4.0::Tru64 4.0 (or OS/2 Warp 4) +32768:64:0:48:M*,N,W0: Tru64:5.0::Tru64 5.0 +8192:64:0:44:M1460: Tru64:5.1:noRFC1323:Tru64 6.1 (no RFC1323) (or QNX 6) +61440:64:0:48:M*,N,W0: Tru64:5.1a:JP4:Tru64 v5.1a JP4 (or OpenVMS 7.x on Compaq 5.x stack) + +# ----------------- OpenVMS ----------------- + +6144:64:1:60:M*,N,W0,N,N,T: OpenVMS:7.2::OpenVMS 7.2 (Multinet 4.4 stack) + +# ----------------- MacOS ------------------- + +# XXX Need EOL tcp opt support +# S2:255:1:48:M*,W0,E:.:MacOS:8.6 classic + +# XXX some of these use EOL too +16616:255:1:48:M*,W0: MacOS:7.3-7.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,W0: MacOS:8.0-8.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,N,N,N: MacOS:8.1-8.6:OTTCP:MacOS 8.1-8.6 (OTTCP) +32768:255:1:48:M*,W0,N: MacOS:9.0-9.2::MacOS 9.0-9.2 +65535:255:1:48:M*,N,N,N,N: MacOS:9.1::MacOS 9.1 (OT 2.7.4) + + +# ----------------- Windows ----------------- + +# Windows TCP/IP stack is a mess. For most recent XP, 2000 and +# even 98, the patchlevel, not the actual OS version, is more +# relevant to the signature. They share the same code, so it would +# seem. Luckily for us, almost all Windows 9x boxes have an +# awkward MSS of 536, which I use to tell one from another +# in most difficult cases. + +8192:32:1:44:M*: Windows:3.11::Windows 3.11 (Tucows) +S44:64:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95::Windows 95 +8192:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95:b:Windows 95b + +# There were so many tweaking tools and so many stack versions for +# Windows 98 it is no longer possible to tell them from each other +# without some very serious research. Until then, there's an insane +# number of signatures, for your amusement: + +S44:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +8192:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +%8192:64:1:48:M536,N,N,S: Windows:98::Windows 98 +%8192:128:1:48:M536,N,N,S: Windows:98::Windows 98 +S4:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S6:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S12:64:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:64:1:64:M1460,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +32767:64:1:48:M*,N,N,S: Windows:98::Windows 98 +37300:64:1:48:M*,N,N,S: Windows:98::Windows 98 +46080:64:1:52:M*,N,W3,N,N,S: Windows:98:RFC1323:Windows 98 (RFC1323) +65535:64:1:44:M*: Windows:98:noSack:Windows 98 (no sack) +S16:128:1:48:M*,N,N,S: Windows:98::Windows 98 +S16:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +S26:128:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:128:1:48:M*,N,N,S: Windows:98::Windows 98 +32767:128:1:52:M*,N,W0,N,N,S: Windows:98::Windows 98 +60352:128:1:48:M*,N,N,S: Windows:98::Windows 98 +60352:128:1:64:M*,N,W2,N,N,T0,N,N,S: Windows:98::Windows 98 + +# What's with 1414 on NT? +T31:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +64512:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +8192:128:1:44:M*: Windows:NT:4.0:Windows NT 4.0 (older) + +# Windows XP and 2000. Most of the signatures that were +# either dubious or non-specific (no service pack data) +# were deleted and replaced with generics at the end. + +65535:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP1 +65535:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP1 +%8192:128:1:48:M*,N,N,S: Windows:2000:SP2+:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +%8192:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +S20:128:1:48:M*,N,N,S: Windows:2000::Windows 2000/XP SP3 +S20:128:1:48:M*,N,N,S: Windows:XP:SP3:Windows 2000/XP SP3 +S45:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP 1 +S45:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP 1 +40320:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4 + +S6:128:1:48:M*,N,N,S: Windows:2000:SP2:Windows XP, 2000 SP2+ +S6:128:1:48:M*,N,N,S: Windows:XP::Windows XP, 2000 SP2+ +S12:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows XP SP1 +S44:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows Pro SP1, 2000 SP3 +S44:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows Pro SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP3 +32767:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows SP1, 2000 SP4 +32767:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP4 + +8192:128:1:52:M*,N,W2,N,N,S: Windows:Vista::Windows Vista/7 + +# Odds, ends, mods: + +S52:128:1:48:M1260,N,N,S: Windows:2000:cisco:Windows XP/2000 via Cisco +S52:128:1:48:M1260,N,N,S: Windows:XP:cisco:Windows XP/2000 via Cisco +65520:128:1:48:M*,N,N,S: Windows:XP::Windows XP bare-bone +16384:128:1:52:M536,N,W0,N,N,S: Windows:2000:ZoneAlarm:Windows 2000 w/ZoneAlarm? +2048:255:0:40:.: Windows:.NET::Windows .NET Enterprise Server + +44620:64:0:48:M*,N,N,S: Windows:ME::Windows ME no SP (?) +S6:255:1:48:M536,N,N,S: Windows:95:winsock2:Windows 95 winsock 2 +32768:32:1:52:M1460,N,W0,N,N,S: Windows:2003:AS:Windows 2003 AS + + +# No need to be more specific, it passes: +# *:128:1:48:M*,N,N,S:U:-Windows:XP/2000 while downloading (leak!) XXX quirk +# there is an equiv similar generic sig w/o the quirk + +# ----------------- HP/UX ------------------- + +32768:64:1:44:M*: HP-UX:B.10.20::HP-UX B.10.20 +32768:64:0:48:M*,W0,N: HP-UX:11.0::HP-UX 11.0 +32768:64:1:48:M*,W0,N: HP-UX:11.10::HP-UX 11.0 or 11.11 +32768:64:1:48:M*,W0,N: HP-UX:11.11::HP-UX 11.0 or 11.11 + +# Whoa. Hardcore WSS. +0:64:0:48:M*,W0,N: HP-UX:B.11.00:A:HP-UX B.11.00 A (RFC1323) + +# ----------------- RiscOS ------------------ + +# We don't yet support the ?12 TCP option +#16384:64:1:68:M1460,N,W0,N,N,T,N,N,?12: RISCOS:3.70-4.36::RISC OS 3.70-4.36 +12288:32:0:44:M536: RISC OS:3.70:4.10:RISC OS 3.70 inet 4.10 + +# XXX quirk +# 4096:64:1:56:M1460,N,N,T:T: RISC OS:3.70:freenet:RISC OS 3.70 freenet 2.00 + + + +# ----------------- BSD/OS ------------------ + +# Once again, power of two WSS is also shared by MacOS X with DF set +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:3.1::BSD/OS 3.1-4.3 (or MacOS X 10.2 w/DF) +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:4.0-4.3::BSD/OS 3.1-4.3 (or MacOS X 10.2) + + +# ---------------- NewtonOS ----------------- + +4096:64:0:44:M1420: NewtonOS:2.1::NewtonOS 2.1 + +# ---------------- NeXTSTEP ----------------- + +S4:64:0:44:M1024: NeXTSTEP:3.3::NeXTSTEP 3.3 +S8:64:0:44:M512: NeXTSTEP:3.3::NeXTSTEP 3.3 + +# ------------------ BeOS ------------------- + +1024:255:0:48:M*,N,W0: BeOS:5.0-5.1::BeOS 5.0-5.1 +12288:255:0:44:M1402: BeOS:5.0::BeOS 5.0.x + +# ------------------ OS/400 ----------------- + +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR4::OS/400 VR4/R5 +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR5::OS/400 VR4/R5 +4096:64:1:60:M1440,N,W0,N,N,T: OS/400:V4R5:CF67032:OS/400 V4R5 + CF67032 + +# XXX quirk +# 28672:64:0:44:M1460:A:OS/390:? + +# ------------------ ULTRIX ----------------- + +16384:64:0:40:.: ULTRIX:4.5::ULTRIX 4.5 + +# ------------------- QNX ------------------- + +S16:64:0:44:M512: QNX:::QNX demodisk + +# ------------------ Novell ----------------- + +16384:128:1:44:M1460: Novell:NetWare:5.0:Novel Netware 5.0 +6144:128:1:44:M1460: Novell:IntranetWare:4.11:Novell IntranetWare 4.11 +6144:128:1:44:M1368: Novell:BorderManager::Novell BorderManager ? + +6144:128:1:52:M*,W0,N,S,N,N: Novell:Netware:6:Novell Netware 6 SP3 + + +# ----------------- SCO ------------------ +S3:64:1:60:M1460,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1 +S17:64:1:60:M1380,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1.3 MP3 +S23:64:1:44:M1380: SCO:OpenServer:5.0:SCO OpenServer 5.0 + +# ------------------- DOS ------------------- + +2048:255:0:44:M536: DOS:WATTCP:1.05:DOS Arachne via WATTCP/1.05 +T2:255:0:44:M984: DOS:WATTCP:1.05Arachne:Arachne via WATTCP/1.05 (eepro) + +# ------------------ OS/2 ------------------- + +S56:64:0:44:M512: OS/2:4::OS/2 4 +28672:64:0:44:M1460: OS/2:4::OS/2 Warp 4.0 + +# ----------------- TOPS-20 ----------------- + +# Another hardcore MSS, one of the ACK leakers hunted down. +# XXX QUIRK 0:64:0:44:M1460:A:TOPS-20:version 7 +0:64:0:44:M1460: TOPS-20:7::TOPS-20 version 7 + +# ----------------- FreeMiNT ---------------- + +S44:255:0:44:M536: FreeMiNT:1:16A:FreeMiNT 1 patch 16A (Atari) + +# ------------------ AMIGA ------------------ + +# XXX TCP option 12 +# S32:64:1:56:M*,N,N,S,N,N,?12:.:AMIGA:3.9 BB2 with Miami stack + +# ------------------ Plan9 ------------------ + +65535:255:0:48:M1460,W0,N: Plan9:4::Plan9 edition 4 + +# ----------------- AMIGAOS ----------------- + +16384:64:1:48:M1560,N,N,S: AMIGAOS:3.9::AMIGAOS 3.9 BB2 MiamiDX + +########################################### +# Appliance / embedded / other signatures # +########################################### + +# ---------- Firewalls / routers ------------ + +S12:64:1:44:M1460: @Checkpoint:::Checkpoint (unknown 1) +S12:64:1:48:N,N,S,M1460: @Checkpoint:::Checkpoint (unknown 2) +4096:32:0:44:M1460: ExtremeWare:4.x::ExtremeWare 4.x + +# XXX TCP option 12 +# S32:64:0:68:M512,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO w/Checkpoint NG FP3 +# S16:64:0:68:M1024,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO 3.7 build 026 + +S4:64:1:60:W0,N,S,T,M1460: FortiNet:FortiGate:50:FortiNet FortiGate 50 + +8192:64:1:44:M1460: Eagle:::Eagle Secure Gateway + +S52:128:1:48:M1260,N,N,N,N: LinkSys:WRV54G::LinkSys WRV54G VPN router + + + +# ------- Switches and other stuff ---------- + +4128:255:0:44:M*: Cisco:::Cisco Catalyst 3500, 7500 etc +S8:255:0:44:M*: Cisco:12008::Cisco 12008 +60352:128:1:64:M1460,N,W2,N,N,T,N,N,S: Alteon:ACEswitch::Alteon ACEswitch +64512:128:1:44:M1370: Nortel:Contivity Client::Nortel Conectivity Client + + +# ---------- Caches and whatnots ------------ + +S4:64:1:52:M1460,N,N,S,N,W0: AOL:web cache::AOL web cache + +32850:64:1:64:N,W1,N,N,T,N,N,S,M*: NetApp:5.x::NetApp Data OnTap 5.x +16384:64:1:64:M1460,N,N,S,N,W0,N: NetApp:5.3:1:NetApp 5.3.1 +65535:64:0:64:M1460,N,N,S,N,W*,N,N,T: NetApp:5.3-5.5::NetApp 5.3-5.5 +65535:64:0:60:M1460,N,W0,N,N,T: NetApp:CacheFlow::NetApp CacheFlow +8192:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:5.2:1:NetApp NetCache 5.2.1 +20480:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:4.1::NetApp NetCache4.1 + +65535:64:0:60:M1460,N,W0,N,N,T: CacheFlow:4.1::CacheFlow CacheOS 4.1 +8192:64:0:60:M1380,N,N,N,N,N,N,T: CacheFlow:1.1::CacheFlow CacheOS 1.1 + +S4:64:0:48:M1460,N,N,S: Cisco:Content Engine::Cisco Content Engine + +27085:128:0:40:.: Dell:PowerApp cache::Dell PowerApp (Linux-based) + +65535:255:1:48:N,W1,M1460: Inktomi:crawler::Inktomi crawler +S1:255:1:60:M1460,S,T,N,W0: LookSmart:ZyBorg::LookSmart ZyBorg + +16384:255:0:40:.: Proxyblocker:::Proxyblocker (what's this?) + +65535:255:0:48:M*,N,N,S: Redline:::Redline T|X 2200 + +32696:128:0:40:M1460: Spirent:Avalanche::Spirent Web Avalanche HTTP benchmarking engine + +# ----------- Embedded systems -------------- + +S9:255:0:44:M536: PalmOS:Tungsten:C:PalmOS Tungsten C +S5:255:0:44:M536: PalmOS:3::PalmOS 3/4 +S5:255:0:44:M536: PalmOS:4::PalmOS 3/4 +S4:255:0:44:M536: PalmOS:3:5:PalmOS 3.5 +2948:255:0:44:M536: PalmOS:3:5:PalmOS 3.5.3 (Handera) +S29:255:0:44:M536: PalmOS:5::PalmOS 5.0 +16384:255:0:44:M1398: PalmOS:5.2:Clie:PalmOS 5.2 (Clie) +S14:255:0:44:M1350: PalmOS:5.2:Treo:PalmOS 5.2.1 (Treo) + +S23:64:1:64:N,W1,N,N,T,N,N,S,M1460: SymbianOS:7::SymbianOS 7 + +8192:255:0:44:M1460: SymbianOS:6048::Symbian OS 6048 (Nokia 7650?) +8192:255:0:44:M536: SymbianOS:9210::Symbian OS (Nokia 9210?) +S22:64:1:56:M1460,T,S: SymbianOS:P800::Symbian OS ? (SE P800?) +S36:64:1:56:M1360,T,S: SymbianOS:6600::Symbian OS 60xx (Nokia 6600?) + + +# Perhaps S4? +5840:64:1:60:M1452,S,T,N,W1: Zaurus:3.10::Zaurus 3.10 + +32768:128:1:64:M1460,N,W0,N,N,T0,N,N,S: PocketPC:2002::PocketPC 2002 + +S1:255:0:44:M346: Contiki:1.1:rc0:Contiki 1.1-rc0 + +4096:128:0:44:M1460: Sega:Dreamcast:3.0:Sega Dreamcast Dreamkey 3.0 +T5:64:0:44:M536: Sega:Dreamcast:HKT-3020:Sega Dreamcast HKT-3020 (browser disc 51027) +S22:64:1:44:M1460: Sony:PS2::Sony Playstation 2 (SOCOM?) + +S12:64:0:44:M1452: AXIS:5600:v5.64:AXIS Printer Server 5600 v5.64 + +3100:32:1:44:M1460: Windows:CE:2.0:Windows CE 2.0 + +#################### +# Fancy signatures # +#################### + +1024:64:0:40:.: *NMAP:syn scan:1:NMAP syn scan (1) +2048:64:0:40:.: *NMAP:syn scan:2:NMAP syn scan (2) +3072:64:0:40:.: *NMAP:syn scan:3:NMAP syn scan (3) +4096:64:0:40:.: *NMAP:syn scan:4:NMAP syn scan (4) + +# Requires quirks support +# 1024:64:0:40:.:A:*NMAP:TCP sweep probe (1) +# 2048:64:0:40:.:A:*NMAP:TCP sweep probe (2) +# 3072:64:0:40:.:A:*NMAP:TCP sweep probe (3) +# 4096:64:0:40:.:A:*NMAP:TCP sweep probe (4) + +1024:64:0:60:W10,N,M265,T: *NMAP:OS:1:NMAP OS detection probe (1) +2048:64:0:60:W10,N,M265,T: *NMAP:OS:2:NMAP OS detection probe (2) +3072:64:0:60:W10,N,M265,T: *NMAP:OS:3:NMAP OS detection probe (3) +4096:64:0:60:W10,N,M265,T: *NMAP:OS:4:NMAP OS detection probe (4) + +32767:64:0:40:.: *NAST:::NASTsyn scan + +# Requires quirks support +# 12345:255:0:40:.:A:-p0f:sendsyn utility + + +##################################### +# Generic signatures - just in case # +##################################### + +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:4.0-4.9::FreeBSD 4.x/5.x +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:5.0-5.1::FreeBSD 4.x/5.x + +*:128:1:52:M*,N,W0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W*,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP (RFC1323, w+) +*:128:1:48:M536,N,N,S: @Windows:98::Windows 98 +*:128:1:48:M*,N,N,S: @Windows:XP::Windows XP/2000 +*:128:1:48:M*,N,N,S: @Windows:2000::Windows XP/2000 + + From owner-svn-src-head@freebsd.org Sat Aug 11 14:45:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFF9106F471; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D38B81E5C; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05E2918A4B; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BEjXRD066888; Sat, 11 Aug 2018 14:45:33 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BEjXG9066887; Sat, 11 Aug 2018 14:45:33 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808111445.w7BEjXG9066887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 11 Aug 2018 14:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337628 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 337628 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 14:45:34 -0000 Author: kevlo Date: Sat Aug 11 14:45:33 2018 New Revision: 337628 URL: https://svnweb.freebsd.org/changeset/base/337628 Log: Remove unused MAPDESCFILE. Modified: head/usr.sbin/bsdinstall/scripts/keymap Modified: head/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- head/usr.sbin/bsdinstall/scripts/keymap Sat Aug 11 13:58:26 2018 (r337627) +++ head/usr.sbin/bsdinstall/scripts/keymap Sat Aug 11 14:45:33 2018 (r337628) @@ -43,11 +43,6 @@ f_include $BSDCFG_SHARE/sysrc.subr # : ${KEYMAPFILE:=$BSDINSTALL_TMPETC/rc.conf.keymap} -# -# Default path to keymap INDEX containing descriptions -# -: ${MAPDESCFILE:=/usr/share/syscons/keymaps/INDEX.keymaps} - ############################################################ GLOBALS # From owner-svn-src-head@freebsd.org Sat Aug 11 16:06:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16EFB1071860; Sat, 11 Aug 2018 16:06:33 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C018A84F0A; Sat, 11 Aug 2018 16:06:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A51119777; Sat, 11 Aug 2018 16:06:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BG6WQr009358; Sat, 11 Aug 2018 16:06:32 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BG6W2S009357; Sat, 11 Aug 2018 16:06:32 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111606.w7BG6W2S009357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 16:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337629 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337629 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:06:33 -0000 Author: brd Date: Sat Aug 11 16:06:32 2018 New Revision: 337629 URL: https://svnweb.freebsd.org/changeset/base/337629 Log: Fix the build by just installing systop since testing shows it works with: dwatch -X systop Reviewed by: kp Approved by: allanjude (mentor) Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 14:45:33 2018 (r337628) +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 16:06:32 2018 (r337629) @@ -12,6 +12,7 @@ FILES= chmod \ rw \ sched \ sendrecv \ + systop \ tcp \ udp \ udplite \ @@ -62,7 +63,6 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused From owner-svn-src-head@freebsd.org Sat Aug 11 16:09:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596C91071943; Sat, 11 Aug 2018 16:09:28 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.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 08D1085099; Sat, 11 Aug 2018 16:09:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AE61B21607; Sat, 11 Aug 2018 12:09:21 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute5.internal (MEProxy); Sat, 11 Aug 2018 12:09:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=jy6RSW KOdBSZVp/0vHql5KQAproK4QXA7Kt8CW266jo=; b=DQoJlRrXvaax9uybp+2XPH QNQUJZ1La0o7rm3BcS5guzCOo/Ann6EhvssLonvLVD3/ZZBuff9Ifex6q0uUDwI6 e46XqwnZNfg78tU4BSKTJa+zawTY3V3EsXfLBVCdQz+kFlOj44jPkzzWOdDzK6rr 5ty/YE64jszBP7xY5LBM5qG5d+NjSmExw7/5zlU3NaDG1OQSw1r4BSFKf3UFfKhU Y+S5EbK5s3KG3rJOwSkTfP74cdFuAL2MzAnPfTMb5you51CEC0sdKcEaknucH3Px 5vQ6y6SmOP5ToZWkSGTpS0X1AYzHFg7pinKMtMEo2ltUrudhQsJk39Bp0C7ikofg == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 3AA9194103; Sat, 11 Aug 2018 12:09:21 -0400 (EDT) Message-Id: <1534003761.1809972.1470908040.4D49BCD1@webmail.messagingengine.com> From: Brad Davis To: Kristof Provost , Devin Teske Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 In-Reply-To: References: <201808110632.w7B6WVE9009976@repo.freebsd.org> Date: Sat, 11 Aug 2018 10:09:21 -0600 Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 16:09:28 -0000 On Sat, Aug 11, 2018, at 7:06 AM, Kristof Provost wrote: > Hi Devin, > On 11 Aug 2018, at 8:32, Devin Teske wrote: >> Author: dteske >> Date: Sat Aug 11 06:32:31 2018 >> New Revision: 337611 >> URL: https://svnweb.freebsd.org/changeset/base/337611 >> >> Log: >> dwatch(1): Add systop profile >> >> Provides a top-like view of syscall consumers. >> >> MFC after: 3 days >> X-MFC-to: stable/11 >> Sponsored by: Smule, Inc. >> >> Added: >> head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) >> Modified: >> head/cddl/usr.sbin/dwatch/libexec/Makefile >> >> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile >> ============================================================================== >> --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 2018 (r337610) >> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 2018 (r337611) >> @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto >> +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > This breaks install world: > install: link /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop -> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: No such file or directory Hi Devin, I committed a fix in r337629 to just install systop, since that seems to be what you meant.. If not, please let me know and I would be happy to help correct that. Regards, Brad Davis From owner-svn-src-head@freebsd.org Sat Aug 11 16:12:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7231071B3E; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5113685469; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C2419905; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGCOQZ014495; Sat, 11 Aug 2018 16:12:24 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGCOs9014494; Sat, 11 Aug 2018 16:12:24 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111612.w7BGCOs9014494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 16:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337630 - head/sbin/restore X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/sbin/restore X-SVN-Commit-Revision: 337630 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:12:24 -0000 Author: netchild Date: Sat Aug 11 16:12:23 2018 New Revision: 337630 URL: https://svnweb.freebsd.org/changeset/base/337630 Log: Re-enable reading byte swapped NFS_MAGIC dumps. Fix bug introduced in r98542: previously to this revision the byte-swapped value was compared at this place. The current check is in a conditional section where the non-byte-swapped value was already checked to be not the value which is checked again. As byte-swapping is activated afterwards, it only makes sense if the byte-swapped value is checked. Submitted by: Keith White PR: 200059 MFC after: 1 month Sponsored by: Essen Hackathon Modified: head/sbin/restore/tape.c Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Aug 11 16:06:32 2018 (r337629) +++ head/sbin/restore/tape.c Sat Aug 11 16:12:23 2018 (r337630) @@ -1314,8 +1314,8 @@ gethead(struct s_spcl *buf) return (FAIL); } if (swabl(buf->c_magic) != FS_UFS2_MAGIC && - buf->c_magic != NFS_MAGIC) { - if (buf->c_magic == OFS_MAGIC) { + swabl(buf->c_magic) != NFS_MAGIC) { + if (swabl(buf->c_magic) == OFS_MAGIC) { fprintf(stderr, "Format of dump tape is too old. Must use\n"); fprintf(stderr, From owner-svn-src-head@freebsd.org Sat Aug 11 16:29:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6042F107274C; Sat, 11 Aug 2018 16:29:57 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9348635D; Sat, 11 Aug 2018 16:29:54 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3F0719AC4; Sat, 11 Aug 2018 16:29:54 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGTs6W020323; Sat, 11 Aug 2018 16:29:54 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGTsca020322; Sat, 11 Aug 2018 16:29:54 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111629.w7BGTsca020322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 16:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337638 - head/usr.bin/at X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/usr.bin/at X-SVN-Commit-Revision: 337638 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:29:57 -0000 Author: netchild Date: Sat Aug 11 16:29:54 2018 New Revision: 337638 URL: https://svnweb.freebsd.org/changeset/base/337638 Log: - Correct the description when jobs are executed related to load avg to match reality (slightly different to what was submitted in the PR: use english word instead of math-symbol). - Wrap the corresponding part to below 80 characters per line. Submitted by: yamagi@yamagi.org PR: 202202 Sponsored by: Essen Hackathon Modified: head/usr.bin/at/at.man Modified: head/usr.bin/at/at.man ============================================================================== --- head/usr.bin/at/at.man Sat Aug 11 16:29:51 2018 (r337637) +++ head/usr.bin/at/at.man Sat Aug 11 16:29:54 2018 (r337638) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 1, 2018 +.Dd August 11, 2018 .Dt "AT" 1 .Os .Sh NAME @@ -64,8 +64,9 @@ case, everybody's jobs are listed; .It Nm atrm deletes jobs; .It Nm batch -executes commands when system load levels permit; in other words, when the load average -drops below _LOADAVG_MX, or the value specified in the invocation of +executes commands when system load levels permit; in other words, when +the load average drops below _LOADAVG_MX times number of active CPUs, +or the value specified in the invocation of .Nm atrun . .El .Pp From owner-svn-src-head@freebsd.org Sat Aug 11 16:30:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE3D107291F; Sat, 11 Aug 2018 16:30:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.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 90BFF86C5D; Sat, 11 Aug 2018 16:30:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id oWmqfWB2Ip5A1oWmsfXtsY; Sat, 11 Aug 2018 10:30:47 -0600 X-Authority-Analysis: v=2.3 cv=JLKPTPCb c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=dapMudl6Dx4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=QAepSRUV8d__2oafRqkA:9 a=CjuIK1q_8ugA:10 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 9187826C; Sat, 11 Aug 2018 09:31:06 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w7BGUjgX095414; Sat, 11 Aug 2018 09:30:45 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w7BGUigO095292; Sat, 11 Aug 2018 09:30:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201808111630.w7BGUigO095292@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Kristof Provost" cc: "Devin Teske" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec In-Reply-To: Message from "Kristof Provost" of "Sat, 11 Aug 2018 15:06:00 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 11 Aug 2018 09:30:44 -0700 X-CMAE-Envelope: MS4wfCma1PSQ7Cqi0OxLJrlax016YsCe/P9jooZS80WMCWOCV9RP7JLu1/dT2u/M2FDBPHfPyKvpcxGF//MeutWYm4uev26tZ618GLnFAkckhaoQxDOQO1Al s6sQDsPGfyh2RNRYws/2NYjB/qhvSG2EORayvl9pBJGvAqdl4vm8DYJIZJ//B7fJl6P5cBCVm6RDzS6cuO+gcx3msG2rdm28uKEau3zG9EV6yeDtLzRBI4AB i0Zu+SyamtdunWdu+cRtPx/altxL1O6OH+H/acNkQkVhoUns2/cJcDXkgvD5NqsvRVZ/tcRiAvxOmAF+AxIGGPRQQjiY5VcNDEVRbT3bd6Y= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 16:30:55 -0000 In message , "Kristof Provost " writes: > > --=_MailMate_CF172F01-6AF0-4E9D-A175-454A09953300_= > Content-Type: text/plain; format=flowed > > Hi Devin, > > On 11 Aug 2018, at 8:32, Devin Teske wrote: > > Author: dteske > > Date: Sat Aug 11 06:32:31 2018 > > New Revision: 337611 > > URL: https://svnweb.freebsd.org/changeset/base/337611 > > > > Log: > > dwatch(1): Add systop profile > > > > Provides a top-like view of syscall consumers. > > > > MFC after: 3 days > > X-MFC-to: stable/11 > > Sponsored by: Smule, Inc. > > > > Added: > > head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) > > Modified: > > head/cddl/usr.sbin/dwatch/libexec/Makefile > > > > Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile > > =========================================================================== > === > > --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 > > 2018 (r337610) > > +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 > > 2018 (r337611) > > @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv > > ${LIBEXECDIR}/dw > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > > +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > > This breaks install world: > install: link > /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop > -> > /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: > No such file or directory > > Regards, > Kristof Hi Kristof, This should get you going. Index: /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile =================================================================== --- /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile (revision 337628) +++ /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile (working copy) @@ -12,6 +12,7 @@ rw \ sched \ sendrecv \ + systop \ tcp \ udp \ udplite \ @@ -62,7 +63,6 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-establ ished LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refuse d -- 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 Sat Aug 11 16:34:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68EB1072E39; Sat, 11 Aug 2018 16:34:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0408733D; Sat, 11 Aug 2018 16:34:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F4DE19C58; Sat, 11 Aug 2018 16:34:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGYUlI025222; Sat, 11 Aug 2018 16:34:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGYUbO025221; Sat, 11 Aug 2018 16:34:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808111634.w7BGYUbO025221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 11 Aug 2018 16:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337643 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 337643 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:34:31 -0000 Author: kp Date: Sat Aug 11 16:34:30 2018 New Revision: 337643 URL: https://svnweb.freebsd.org/changeset/base/337643 Log: pf: Fix 'set skip on' for groups The pfi_skip_if() function sometimes caused skipping of groups to work, if the members of the group used the groupname as a name prefix. This is often the case, e.g. group lo usually contains lo0, lo1, ..., but not always. Rather than relying on the name explicitly check for group memberships. Obtained from: OpenBSD (pf_if.c,v 1.62, pf_if.c,v 1.63) Sponsored by: Essen Hackathon Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Sat Aug 11 16:30:06 2018 (r337642) +++ head/sys/netpfil/pf/pf_if.c Sat Aug 11 16:34:30 2018 (r337643) @@ -735,6 +735,7 @@ pfi_get_ifaces(const char *name, struct pfi_kif *buf, static int pfi_skip_if(const char *filter, struct pfi_kif *p) { + struct ifg_list *i; int n; if (filter == NULL || !*filter) @@ -745,10 +746,19 @@ pfi_skip_if(const char *filter, struct pfi_kif *p) if (n < 1 || n >= IFNAMSIZ) return (1); /* sanity check */ if (filter[n-1] >= '0' && filter[n-1] <= '9') - return (1); /* only do exact match in that case */ - if (strncmp(p->pfik_name, filter, n)) - return (1); /* prefix doesn't match */ - return (p->pfik_name[n] < '0' || p->pfik_name[n] > '9'); + return (1); /* group names may not end in a digit */ + if (p->pfik_ifp != NULL) { + IF_ADDR_RLOCK(p->pfik_ifp); + CK_STAILQ_FOREACH(i, &p->pfik_ifp->if_groups, ifgl_next) { + if (!strncmp(i->ifgl_group->ifg_group, filter, + IFNAMSIZ)) { + IF_ADDR_RUNLOCK(p->pfik_ifp); + return (0); /* iface is in group "filter" */ + } + } + IF_ADDR_RUNLOCK(p->pfik_ifp); + } + return (1); } int From owner-svn-src-head@freebsd.org Sat Aug 11 16:35:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC741072F85; Sat, 11 Aug 2018 16:35:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8D7387566; Sat, 11 Aug 2018 16:35:52 +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)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 6ABC31143F; Sat, 11 Aug 2018 16:35:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.28.128.1] (p5B34BA34.dip0.t-ipconnect.de [91.52.186.52]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 6B6C84CC09; Sat, 11 Aug 2018 18:35:50 +0200 (CEST) From: "Kristof Provost" To: "Cy Schubert" Cc: "Devin Teske" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec Date: Sat, 11 Aug 2018 18:35:49 +0200 X-Mailer: MailMate (2.0BETAr6116) Message-ID: <2A5DDBE0-5A97-4B78-8A1E-5B1E11AE1B76@FreeBSD.org> In-Reply-To: <201808111630.w7BGUigO095292@slippy.cwsent.com> References: <201808111630.w7BGUigO095292@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 16:35:53 -0000 On 11 Aug 2018, at 18:30, Cy Schubert wrote: > In message , > "Kristof > Provost > " writes: >> >> --=_MailMate_CF172F01-6AF0-4E9D-A175-454A09953300_= >> Content-Type: text/plain; format=flowed >> >> Hi Devin, >> >> On 11 Aug 2018, at 8:32, Devin Teske wrote: >>> Author: dteske >>> Date: Sat Aug 11 06:32:31 2018 >>> New Revision: 337611 >>> URL: https://svnweb.freebsd.org/changeset/base/337611 >>> >>> Log: >>> dwatch(1): Add systop profile >>> >>> Provides a top-like view of syscall consumers. >>> >>> MFC after: 3 days >>> X-MFC-to: stable/11 >>> Sponsored by: Smule, Inc. >>> >>> Added: >>> head/cddl/usr.sbin/dwatch/libexec/systop (contents, props >>> changed) >>> Modified: >>> head/cddl/usr.sbin/dwatch/libexec/Makefile >>> >>> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile >>> =========================================================================== >> === >>> --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 >>> 2018 (r337610) >>> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 >>> 2018 (r337611) >>> @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv >>> ${LIBEXECDIR}/dw >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto >>> +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop >> >> This breaks install world: >> install: link >> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop >> -> >> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: >> No such file or directory >> >> Regards, >> Kristof > > Hi Kristof, > > This should get you going. > > Index: /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile > =================================================================== > --- /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile > (revision 337628) > +++ > /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile (working > copy) > @@ -12,6 +12,7 @@ > rw \ > sched \ > sendrecv \ > + systop \ > tcp \ > udp \ > udplite \ > @@ -62,7 +63,6 @@ > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept > LINKS+= ${LIBEXECDIR}/dwatch/tcp > ${LIBEXECDIR}/dwatch/tcp-accept-establ > ished > LINKS+= ${LIBEXECDIR}/dwatch/tcp > ${LIBEXECDIR}/dwatch/tcp-accept-refuse > d > Thanks for the pointer. Brad’s fixed it meanwhile. Regards, Kristof From owner-svn-src-head@freebsd.org Sat Aug 11 16:37:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F921073355; Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75EC58822F; Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 574B619C5D; Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGbuX7025485; Sat, 11 Aug 2018 16:37:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGbucG025484; Sat, 11 Aug 2018 16:37:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808111637.w7BGbucG025484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 11 Aug 2018 16:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337644 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 337644 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:37:57 -0000 Author: kp Date: Sat Aug 11 16:37:55 2018 New Revision: 337644 URL: https://svnweb.freebsd.org/changeset/base/337644 Log: pf: Take the IF_ADDR_RLOCK() when iterating over the group list We did do this elsewhere in pf, but the lock was missing here. Sponsored by: Essen Hackathon Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Sat Aug 11 16:34:30 2018 (r337643) +++ head/sys/netpfil/pf/pf_if.c Sat Aug 11 16:37:55 2018 (r337644) @@ -297,11 +297,16 @@ pfi_kif_match(struct pfi_kif *rule_kif, struct pfi_kif if (rule_kif == NULL || rule_kif == packet_kif) return (1); - if (rule_kif->pfik_group != NULL) - /* XXXGL: locking? */ + if (rule_kif->pfik_group != NULL) { + IF_ADDR_RLOCK(packet_kif->pfik_ifp); CK_STAILQ_FOREACH(p, &packet_kif->pfik_ifp->if_groups, ifgl_next) - if (p->ifgl_group == rule_kif->pfik_group) + if (p->ifgl_group == rule_kif->pfik_group) { + IF_ADDR_RUNLOCK(packet_kif->pfik_ifp); return (1); + } + IF_ADDR_RUNLOCK(packet_kif->pfik_ifp); + } + return (0); } From owner-svn-src-head@freebsd.org Sat Aug 11 16:41:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5036A10734E2; Sat, 11 Aug 2018 16:41:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063D38866F; Sat, 11 Aug 2018 16:41:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBFD419D9E; Sat, 11 Aug 2018 16:41:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGf7qe028871; Sat, 11 Aug 2018 16:41:07 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGf7Yb028870; Sat, 11 Aug 2018 16:41:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808111641.w7BGf7Yb028870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 11 Aug 2018 16:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337646 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 337646 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 16:41:08 -0000 Author: kp Date: Sat Aug 11 16:41:07 2018 New Revision: 337646 URL: https://svnweb.freebsd.org/changeset/base/337646 Log: pf tests: Basic test for 'set skip in $groupname' This tests for the problem reported in PR 229241, where using a group name in 'set skip on' did not work as expected. Sponsored by: Essen Hackathon Added: head/tests/sys/netpfil/pf/set_skip.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Sat Aug 11 16:40:03 2018 (r337645) +++ head/tests/sys/netpfil/pf/Makefile Sat Aug 11 16:41:07 2018 (r337646) @@ -10,7 +10,8 @@ ATF_TESTS_SH+= pass_block \ fragmentation \ set_tos \ route_to \ - synproxy + synproxy \ + set_skip ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ Added: head/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/set_skip.sh Sat Aug 11 16:41:07 2018 (r337646) @@ -0,0 +1,36 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "set_skip_group" "cleanup" +set_skip_group_head() +{ + atf_set descr 'Basic set skip test' + atf_set require.user root +} + +set_skip_group_body() +{ + # See PR 229241 + pft_init + + pft_mkjail alcatraz + jexec alcatraz ifconfig lo0 127.0.0.1/8 up + jexec alcatraz ifconfig lo0 group foo + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on foo" \ + "block in proto icmp" + + jexec alcatraz ifconfig + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 +} + +set_skip_group_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "set_skip_group" +} From owner-svn-src-head@freebsd.org Sat Aug 11 16:43:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD243107373F; Sat, 11 Aug 2018 16:43:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.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 0D20C88A39; Sat, 11 Aug 2018 16:43:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id oWywfRRIw5HxqoWyxf14r8; Sat, 11 Aug 2018 10:43:17 -0600 X-Authority-Analysis: v=2.3 cv=BMcHU2YG c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=dapMudl6Dx4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=m8gofb0dXg4uV2AHqT0A:9 a=wPNLvfGTeEIA:10 a=UJ0tAi3fqDAA:10 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 573612D7; Sat, 11 Aug 2018 09:43:36 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w7BGhF37057898; Sat, 11 Aug 2018 09:43:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w7BGhFjq057895; Sat, 11 Aug 2018 09:43:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201808111643.w7BGhFjq057895@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Kristof Provost" cc: "Cy Schubert" , "Devin Teske" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec In-Reply-To: Message from "Kristof Provost" of "Sat, 11 Aug 2018 18:35:49 +0200." <2A5DDBE0-5A97-4B78-8A1E-5B1E11AE1B76@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Sat, 11 Aug 2018 09:43:15 -0700 X-CMAE-Envelope: MS4wfD7jdT0r3AFWq5QZeapvY9c18JUxaIYvwQhDfzHUP6Wa+65i51a9k/VPeGVre8s7+nwRt/sb2pFQ7E9pW4kwmMM7lgPxh+7QqwLZ9CFZdDoIu3dZLsQS pmST/PriKu3AUX0RRarvhRXUzPuOqdAsLX9mwawgKL4ZYRbSYGEFfpkd7mfH6mRND13kesZSevxKLPjdm2vie0hSYM/6qjbUUaJxOz4E4qn/cNAkFyvXXBZP IX/suBKDt3iHMNEirPpzLNMUC6T5sZOEEQKVYeONaeFTIiPoB/jbm7n/174Ut1SXs/AF+cMEOQqEd1BR/QR1PXlcl8x8m5DC2n186++W+oQ= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 16:43:26 -0000 In message <2A5DDBE0-5A97-4B78-8A1E-5B1E11AE1B76@FreeBSD.org>, "Kristof Provost " writes: > > --=_MailMate_37784F8A-DF73-4094-A86C-D7C2EF0CB551_= > Content-Type: text/plain; charset=utf-8; format=flowed > Content-Transfer-Encoding: 8bit > > On 11 Aug 2018, at 18:30, Cy Schubert wrote: > > In message , > > "Kristof > > Provost > > " writes: > >> > >> --=_MailMate_CF172F01-6AF0-4E9D-A175-454A09953300_= > >> Content-Type: text/plain; format=flowed > >> > >> Hi Devin, > >> > >> On 11 Aug 2018, at 8:32, Devin Teske wrote: > >>> Author: dteske > >>> Date: Sat Aug 11 06:32:31 2018 > >>> New Revision: 337611 > >>> URL: https://svnweb.freebsd.org/changeset/base/337611 > >>> > >>> Log: > >>> dwatch(1): Add systop profile > >>> > >>> Provides a top-like view of syscall consumers. > >>> > >>> MFC after: 3 days > >>> X-MFC-to: stable/11 > >>> Sponsored by: Smule, Inc. > >>> > >>> Added: > >>> head/cddl/usr.sbin/dwatch/libexec/systop (contents, props > >>> changed) > >>> Modified: > >>> head/cddl/usr.sbin/dwatch/libexec/Makefile > >>> > >>> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile > >>> ========================================================================= > == > >> === > >>> --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 > >>> 2018 (r337610) > >>> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 > >>> 2018 (r337611) > >>> @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv > >>> ${LIBEXECDIR}/dw > >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > >>> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > >>> +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > >> > >> This breaks install world: > >> install: link > >> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop > >> -> > >> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: > >> No such file or directory > >> > >> Regards, > >> Kristof > > > > Hi Kristof, > > > > This should get you going. > > > > Index: /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile > > =================================================================== > > --- /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile > > (revision 337628) > > +++ > > /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile (working > > copy) > > @@ -12,6 +12,7 @@ > > rw \ > > sched \ > > sendrecv \ > > + systop \ > > tcp \ > > udp \ > > udplite \ > > @@ -62,7 +63,6 @@ > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > > -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > > LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept > > LINKS+= ${LIBEXECDIR}/dwatch/tcp > > ${LIBEXECDIR}/dwatch/tcp-accept-establ > > ished > > LINKS+= ${LIBEXECDIR}/dwatch/tcp > > ${LIBEXECDIR}/dwatch/tcp-accept-refuse > > d > > > Thanks for the pointer. > Brad’s fixed it meanwhile. I see. I'm a bit behind on my email. Thanks Brad. -- 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 Sat Aug 11 17:03:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C4511074040; Sat, 11 Aug 2018 17:03:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 327B1895A0; Sat, 11 Aug 2018 17:03:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=56019 helo=[10.0.0.112]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1foXIe-000PgX-Qe; Sat, 11 Aug 2018 17:03:36 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r337629 - head/cddl/usr.sbin/dwatch/libexec From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <201808111606.w7BG6W2S009357@repo.freebsd.org> Date: Sat, 11 Aug 2018 10:03:42 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8992CD5C-9B61-4391-93AE-89989B822C7C@freebsd.org> References: <201808111606.w7BG6W2S009357@repo.freebsd.org> To: Brad Davis Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 17:03:50 -0000 Thanks. Maybe no more commits on Friday evenings close to midnight. Sent from my iPhone > On Aug 11, 2018, at 9:06 AM, Brad Davis wrote: >=20 > Author: brd > Date: Sat Aug 11 16:06:32 2018 > New Revision: 337629 > URL: https://svnweb.freebsd.org/changeset/base/337629 >=20 > Log: > Fix the build by just installing systop since testing shows it works with= : >=20 > dwatch -X systop >=20 > Reviewed by: kp > Approved by: allanjude (mentor) >=20 > Modified: > head/cddl/usr.sbin/dwatch/libexec/Makefile >=20 > Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 14:45:33 2018= (r337628) > +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 16:06:32 2018= (r337629) > @@ -12,6 +12,7 @@ FILES=3D chmod \ > rw \ > sched \ > sendrecv \ > + systop \ > tcp \ > udp \ > udplite \ > @@ -62,7 +63,6 @@ LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}= /dw > LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > -LINKS+=3D ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > LINKS+=3D ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept > LINKS+=3D ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-esta= blished > LINKS+=3D ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refu= sed >=20 From owner-svn-src-head@freebsd.org Sat Aug 11 17:07:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD4B1074100; Sat, 11 Aug 2018 17:07:13 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18D4289711; Sat, 11 Aug 2018 17:07:13 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=56032 helo=[10.0.0.112]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1foXLy-000Pia-Ci; Sat, 11 Aug 2018 17:07:02 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <1534003761.1809972.1470908040.4D49BCD1@webmail.messagingengine.com> Date: Sat, 11 Aug 2018 10:07:09 -0700 Cc: Kristof Provost , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <898346B3-5E07-4045-BB93-B31DC85699DF@freebsd.org> References: <201808110632.w7B6WVE9009976@repo.freebsd.org> <1534003761.1809972.1470908040.4D49BCD1@webmail.messagingengine.com> To: Brad Davis Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 17:07:13 -0000 > On Aug 11, 2018, at 9:09 AM, Brad Davis wrote: >=20 >> On Sat, Aug 11, 2018, at 7:06 AM, Kristof Provost wrote: >> Hi Devin, >>> On 11 Aug 2018, at 8:32, Devin Teske wrote: >>> Author: dteske >>> Date: Sat Aug 11 06:32:31 2018 >>> New Revision: 337611 >>> URL: https://svnweb.freebsd.org/changeset/base/337611 >>>=20 >>> Log: >>> dwatch(1): Add systop profile >>>=20 >>> Provides a top-like view of syscall consumers. >>>=20 >>> MFC after: 3 days >>> X-MFC-to: stable/11 >>> Sponsored by: Smule, Inc. >>>=20 >>> Added: >>> head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) >>> Modified: >>> head/cddl/usr.sbin/dwatch/libexec/Makefile >>>=20 >>> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >>> --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 20= 18 (r337610) >>> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 20= 18 (r337611) >>> @@ -62,6 +62,7 @@ LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDI= R}/dw >>> LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send >>> LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg >>> LINKS+=3D ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto >>> +LINKS+=3D ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop >> This breaks install world: >> install: link /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/= dwatch/systop -> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/= dwatch/systop: No such file or directory >=20 > Hi Devin, >=20 > I committed a fix in r337629 to just install systop, since that seems to b= e what you meant.. If not, please let me know and I would be happy to help c= orrect that. >=20 >=20 Thanks! Silly me, the brain was not cooperating. Modified the wrong aspect of the Makefile. =E2=80=94=20 Devin From owner-svn-src-head@freebsd.org Sat Aug 11 17:11:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71FC610742B1; Sat, 11 Aug 2018 17:11:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1505789ABD; Sat, 11 Aug 2018 17:11:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E999D1A17A; Sat, 11 Aug 2018 17:11:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BHBA9Q042835; Sat, 11 Aug 2018 17:11:10 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BHB9bt042827; Sat, 11 Aug 2018 17:11:09 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111711.w7BHB9bt042827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337648 - in head: etc etc/defaults etc/periodic usr.sbin/periodic usr.sbin/periodic/etc usr.sbin/periodic/etc/daily usr.sbin/periodic/etc/monthly usr.sbin/periodic/etc/security usr.sbi... X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/defaults etc/periodic usr.sbin/periodic usr.sbin/periodic/etc usr.sbin/periodic/etc/daily usr.sbin/periodic/etc/monthly usr.sbin/periodic/etc/security usr.sbin/periodic/etc/weekly X-SVN-Commit-Revision: 337648 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 17:11:11 -0000 Author: brd Date: Sat Aug 11 17:11:08 2018 New Revision: 337648 URL: https://svnweb.freebsd.org/changeset/base/337648 Log: Move all periodic related config and scripts to usr.sbin/periodic/ This makes pkgbase easier by tagging these as CONFS so they are properly tagged as config files. Approved by: will (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16553 Added: head/usr.sbin/periodic/etc/ - copied from r337647, head/etc/periodic/ head/usr.sbin/periodic/periodic.conf - copied unchanged from r337647, head/etc/defaults/periodic.conf Deleted: head/etc/defaults/periodic.conf head/etc/periodic/ Modified: head/etc/Makefile head/etc/defaults/Makefile head/usr.sbin/periodic/Makefile head/usr.sbin/periodic/etc/Makefile.inc head/usr.sbin/periodic/etc/daily/Makefile head/usr.sbin/periodic/etc/monthly/Makefile head/usr.sbin/periodic/etc/security/Makefile head/usr.sbin/periodic/etc/weekly/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/etc/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -178,7 +178,6 @@ distribution: .if ${MK_NTP} != "no" ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install .endif - ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt Modified: head/etc/defaults/Makefile ============================================================================== --- head/etc/defaults/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/etc/defaults/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -2,7 +2,7 @@ .include -FILES= devfs.rules periodic.conf +FILES= devfs.rules FILESDIR= /etc/defaults .if ${MK_BLUETOOTH} != "no" Modified: head/usr.sbin/periodic/Makefile ============================================================================== --- head/usr.sbin/periodic/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -1,6 +1,10 @@ # $FreeBSD$ +FILES= periodic.conf +FILESDIR= /etc/defaults SCRIPTS=periodic.sh MAN= periodic.8 + +SUBDIR= etc .include Modified: head/usr.sbin/periodic/etc/Makefile.inc ============================================================================== --- head/etc/periodic/Makefile.inc Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/etc/Makefile.inc Sat Aug 11 17:11:08 2018 (r337648) @@ -1,5 +1,6 @@ # $FreeBSD$ -BINDIR= /etc/periodic/${.CURDIR:T} +CONFMODE= 755 +CONFDIR= ETC_PERIODIC_${.CURDIR:T:U} +ETC_PERIODIC_${.CURDIR:T:U}= /etc/periodic/${.CURDIR:T} NO_OBJ= -FILESMODE= 755 Modified: head/usr.sbin/periodic/etc/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/etc/daily/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -2,9 +2,9 @@ .include -FILESGROUPS=FILES +CONFGROUPS= CONFS -FILES= 100.clean-disks \ +CONFS= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 140.clean-rwho \ @@ -27,35 +27,34 @@ FILES= 100.clean-disks \ # NB: keep these sorted by MK_* knobs .if ${MK_ACCT} != "no" -FILESGROUPS+= ACCT +CONFGROUPS+= ACCT ACCT+= 310.accounting -.endif -ACCTDIR= /etc/periodic/daily ACCTMODE= ${BINMODE} ACCTPACKAGE= acct +.endif .if ${MK_CALENDAR} != "no" -FILES+= 300.calendar +CONFS+= 300.calendar .endif .if ${MK_MAIL} != "no" -FILES+= 130.clean-msgs +CONFS+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd \ +CONFS+= 480.status-ntpd \ 480.leapfile-ntpd .endif .if ${MK_SENDMAIL} != "no" -FILES+= 150.clean-hoststat \ +CONFS+= 150.clean-hoststat \ 440.status-mailq \ 460.status-mail-rejects \ 500.queuerun .endif .if ${MK_ZFS} != "no" -FILES+= 404.status-zfs \ +CONFS+= 404.status-zfs \ 800.scrub-zfs .endif Modified: head/usr.sbin/periodic/etc/monthly/Makefile ============================================================================== --- head/etc/periodic/monthly/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/etc/monthly/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -2,19 +2,19 @@ .include -FILESGROUPS=FILES +CONFGROUPS= CONFS -FILES= 450.status-security \ +CONFS= 450.status-security \ 999.local # NB: keep these sorted by MK_* knobs .if ${MK_UTMPX} != "no" -FILESGROUPS+= ACCT +CONFGROUPS+= ACCT ACCT+= 200.accounting -.endif ACCTDIR= /etc/periodic/monthly ACCTMODE= ${BINMODE} ACCTPACKAGE= acct +.endif .include Modified: head/usr.sbin/periodic/etc/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/etc/security/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -2,9 +2,9 @@ .include -FILESGROUPS= FILES DATA +CONFGROUPS= CONFS DATA -FILES= 100.chksetuid \ +CONFS= 100.chksetuid \ 110.neggrpperm \ 200.chkmounts \ 300.chkuid0 \ @@ -13,25 +13,26 @@ FILES= 100.chksetuid \ 700.kernelmsg \ 800.loginfail DATA= security.functions +DATAMODE= 444 # NB: keep these sorted by MK_* knobs .if ${MK_IPFILTER} != "no" -FILES+= 510.ipfdenied -FILES+= 610.ipf6denied +CONFS+= 510.ipfdenied +CONFS+= 610.ipf6denied .endif .if ${MK_IPFW} != "no" -FILES+= 500.ipfwdenied \ +CONFS+= 500.ipfwdenied \ 550.ipfwlimit .endif .if ${MK_PF} != "no" -FILES+= 520.pfdenied +CONFS+= 520.pfdenied .endif .if ${MK_INETD} != "no" && ${MK_TCP_WRAPPERS} != "no" -FILES+= 900.tcpwrap +CONFS+= 900.tcpwrap .endif .include Modified: head/usr.sbin/periodic/etc/weekly/Makefile ============================================================================== --- head/etc/periodic/weekly/Makefile Sat Aug 11 16:41:08 2018 (r337647) +++ head/usr.sbin/periodic/etc/weekly/Makefile Sat Aug 11 17:11:08 2018 (r337648) @@ -2,18 +2,18 @@ .include -FILES= 340.noid \ +CONFS= 340.noid \ 450.status-security \ 999.local # NB: keep these sorted by MK_* knobs .if ${MK_LOCATE} != "no" -FILES+= 310.locate +CONFS+= 310.locate .endif .if ${MK_MAN_UTILS} != "no" -FILES+= 320.whatis +CONFS+= 320.whatis .endif .include Copied: head/usr.sbin/periodic/periodic.conf (from r337647, head/etc/defaults/periodic.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/periodic/periodic.conf Sat Aug 11 17:11:08 2018 (r337648, copy of r337647, head/etc/defaults/periodic.conf) @@ -0,0 +1,407 @@ +#!/bin/sh +# +# This is defaults/periodic.conf - a file full of useful variables that +# you can set to change the default behaviour of periodic jobs on your +# system. You should not edit this file! Put any overrides into one of the +# $periodic_conf_files instead and you will be able to update these defaults +# later without spamming your local configuration information. +# +# The $periodic_conf_files files should only contain values which override +# values set in this file. This eases the upgrade path when defaults +# are changed and new features are added. +# +# For a more detailed explanation of all the periodic.conf variables, please +# refer to the periodic.conf(5) manual page. +# +# $FreeBSD$ +# + +# What files override these defaults ? +periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local" + +# periodic script dirs +local_periodic="/usr/local/etc/periodic" + +# Max time to sleep to avoid causing congestion on download servers +anticongestion_sleeptime=3600 + +# Daily options + +# These options are used by periodic(8) itself to determine what to do +# with the output of the sub-programs that are run, and where to send +# that output. $daily_output might be set to /var/log/daily.log if you +# wish to log the daily output and have the files rotated by newsyslog(8) +# +daily_output="root" # user or /file +daily_show_success="YES" # scripts returning 0 +daily_show_info="YES" # scripts returning 1 +daily_show_badconfig="NO" # scripts returning 2 + +# 100.clean-disks +daily_clean_disks_enable="NO" # Delete files daily +daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*" +daily_clean_disks_days=3 # If older than this +daily_clean_disks_verbose="YES" # Mention files deleted + +# 110.clean-tmps +daily_clean_tmps_enable="NO" # Delete stuff daily +daily_clean_tmps_dirs="/tmp" # Delete under here +daily_clean_tmps_days="3" # If not accessed for +daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix" +daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group .snap" +daily_clean_tmps_ignore="$daily_clean_tmps_ignore .sujournal" + # Don't delete these +daily_clean_tmps_verbose="YES" # Mention files deleted + +# 120.clean-preserve +daily_clean_preserve_enable="YES" # Delete files daily +daily_clean_preserve_days=7 # If not modified for +daily_clean_preserve_verbose="YES" # Mention files deleted + +# 130.clean-msgs +daily_clean_msgs_enable="YES" # Delete msgs daily +daily_clean_msgs_days= # If not modified for + +# 140.clean-rwho +daily_clean_rwho_enable="YES" # Delete rwho daily +daily_clean_rwho_days=7 # If not modified for +daily_clean_rwho_verbose="YES" # Mention files deleted + +# 150.clean-hoststat +daily_clean_hoststat_enable="YES" # Purge sendmail host + # status cache daily + +# 200.backup-passwd +daily_backup_passwd_enable="YES" # Backup passwd & group + +# 210.backup-aliases +daily_backup_aliases_enable="YES" # Backup mail aliases + +# 300.calendar +daily_calendar_enable="NO" # Run calendar -a + +# 310.accounting +daily_accounting_enable="YES" # Rotate acct files +daily_accounting_compress="NO" # Gzip rotated files +daily_accounting_flags=-q # Flags to /usr/sbin/sa +daily_accounting_save=3 # How many files to save + +# 330.news +daily_news_expire_enable="YES" # Run news.expire + +# 400.status-disks +daily_status_disks_enable="YES" # Check disk status +daily_status_disks_df_flags="-l -h" # df(1) flags for check + +# 401.status-graid +daily_status_graid_enable="NO" # Check graid(8) + +# 404.status-zfs +daily_status_zfs_enable="NO" # Check ZFS +daily_status_zfs_zpool_list_enable="YES" # List ZFS pools + +# 406.status-gmirror +daily_status_gmirror_enable="NO" # Check gmirror(8) + +# 407.status-graid3 +daily_status_graid3_enable="NO" # Check graid3(8) + +# 408.status-gstripe +daily_status_gstripe_enable="NO" # Check gstripe(8) + +# 409.status-gconcat +daily_status_gconcat_enable="NO" # Check gconcat(8) + +# 410.status-mfi +daily_status_mfi_enable="NO" # Check mfiutil(8) + +# 420.status-network +daily_status_network_enable="YES" # Check network status +daily_status_network_usedns="YES" # DNS lookups are ok +daily_status_network_netstat_flags="-d" # netstat(1) flags + +# 430.status-uptime +daily_status_uptime_enable="YES" # Check system uptime + +# 440.status-mailq +daily_status_mailq_enable="YES" # Check mail status +daily_status_mailq_shorten="NO" # Shorten output +daily_status_include_submit_mailq="YES" # Also submit queue + +# 450.status-security +daily_status_security_enable="YES" # Security check +# See also "Security options" below for more options +daily_status_security_inline="NO" # Run inline ? +daily_status_security_output="root" # user or /file + +# 460.status-mail-rejects +daily_status_mail_rejects_enable="YES" # Check mail rejects +daily_status_mail_rejects_logs=3 # How many logs to check +daily_status_mail_rejects_shorten="NO" # Shorten output + +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile + +# 480.status-ntpd +daily_status_ntpd_enable="NO" # Check NTP status + +# 500.queuerun +daily_queuerun_enable="YES" # Run mail queue +daily_submit_queuerun="YES" # Also submit queue + +# 510.status-world-kernel +daily_status_world_kernel="YES" # Check the running + # userland/kernel version + +# 800.scrub-zfs +daily_scrub_zfs_enable="NO" +daily_scrub_zfs_pools="" # empty string selects all pools +daily_scrub_zfs_default_threshold="35" # days between scrubs +#daily_scrub_zfs_${poolname}_threshold="35" # pool specific threshold + +# 999.local +daily_local="/etc/daily.local" # Local scripts + + +# Weekly options + +# These options are used by periodic(8) itself to determine what to do +# with the output of the sub-programs that are run, and where to send +# that output. $weekly_output might be set to /var/log/weekly.log if you +# wish to log the weekly output and have the files rotated by newsyslog(8) +# +weekly_output="root" # user or /file +weekly_show_success="YES" # scripts returning 0 +weekly_show_info="YES" # scripts returning 1 +weekly_show_badconfig="NO" # scripts returning 2 + +# 310.locate +weekly_locate_enable="YES" # Update locate weekly + +# 320.whatis +weekly_whatis_enable="YES" # Update whatis weekly + +# 340.noid +weekly_noid_enable="NO" # Find unowned files +weekly_noid_dirs="/" # Look here + +# 450.status-security +weekly_status_security_enable="YES" # Security check +# See also "Security options" above for more options +weekly_status_security_inline="NO" # Run inline ? +weekly_status_security_output="root" # user or /file + +# 999.local +weekly_local="/etc/weekly.local" # Local scripts + + +# Monthly options + +# These options are used by periodic(8) itself to determine what to do +# with the output of the sub-programs that are run, and where to send +# that output. $monthly_output might be set to /var/log/monthly.log if you +# wish to log the monthly output and have the files rotated by newsyslog(8) +# +monthly_output="root" # user or /file +monthly_show_success="YES" # scripts returning 0 +monthly_show_info="YES" # scripts returning 1 +monthly_show_badconfig="NO" # scripts returning 2 + +# 200.accounting +monthly_accounting_enable="YES" # Login accounting + +# 450.status-security +monthly_status_security_enable="YES" # Security check +# See also "Security options" above for more options +monthly_status_security_inline="NO" # Run inline ? +monthly_status_security_output="root" # user or /file + +# 999.local +monthly_local="/etc/monthly.local" # Local scripts + + +# Security options + +security_show_success="YES" # scripts returning 0 +security_show_info="YES" # scripts returning 1 +security_show_badconfig="NO" # scripts returning 2 + +# These options are used by the security periodic(8) scripts spawned in +# daily and weekly 450.status-security. +security_status_logdir="/var/log" # Directory for logs +security_status_diff_flags="-b -u" # flags for diff output + +# Each of the security_status_*_period options below can have one of the +# following values: +# - NO: do not run at all +# - daily: only run during the daily security status +# - weekly: only run during the weekly security status +# - monthly: only run during the monthly security status +# Note that if periodic security scripts are run from crontab(5) directly, +# they will be run unless _enable or _period is set to "NO". + +# 100.chksetuid +security_status_chksetuid_enable="YES" +security_status_chksetuid_period="daily" + +# 110.neggrpperm +security_status_neggrpperm_enable="YES" +security_status_neggrpperm_period="daily" + +# 200.chkmounts +security_status_chkmounts_enable="YES" +security_status_chkmounts_period="daily" +#security_status_chkmounts_ignore="^amd:" # Don't check matching + # FS types +security_status_noamd="NO" # Don't check amd mounts + +# 300.chkuid0 +security_status_chkuid0_enable="YES" +security_status_chkuid0_period="daily" + +# 400.passwdless +security_status_passwdless_enable="YES" +security_status_passwdless_period="daily" + +# 410.logincheck +security_status_logincheck_enable="YES" +security_status_logincheck_period="daily" + +# 500.ipfwdenied +security_status_ipfwdenied_enable="YES" +security_status_ipfwdenied_period="daily" + +# 510.ipfdenied +security_status_ipfdenied_enable="YES" +security_status_ipfdenied_period="daily" + +# 520.pfdenied +security_status_pfdenied_enable="YES" +security_status_pfdenied_period="daily" + +# 550.ipfwlimit +security_status_ipfwlimit_enable="YES" +security_status_ipfwlimit_period="daily" + +# 610.ipf6denied +security_status_ipf6denied_enable="YES" +security_status_ipf6denied_period="daily" + +# 700.kernelmsg +security_status_kernelmsg_enable="YES" +security_status_kernelmsg_period="daily" + +# 800.loginfail +security_status_loginfail_enable="YES" +security_status_loginfail_period="daily" + +# 900.tcpwrap +security_status_tcpwrap_enable="YES" +security_status_tcpwrap_period="daily" + + + +# Define source_periodic_confs, the mechanism used by /etc/periodic/*/* +# scripts to source defaults/periodic.conf overrides safely. + +if [ -z "${source_periodic_confs_defined}" ]; then + source_periodic_confs_defined=yes + + # Sleep for a random amount of time in order to mitigate the thundering + # herd problem of multiple hosts running periodic simultaneously. + # Will not sleep when used interactively. + # Will sleep at most once per invocation of periodic + anticongestion() { + [ -n "$PERIODIC_IS_INTERACTIVE" ] && return + if [ -f "$PERIODIC_ANTICONGESTION_FILE" ]; then + rm -f $PERIODIC_ANTICONGESTION_FILE + sleep `jot -r 1 0 ${anticongestion_sleeptime}` + fi + } + + # Compatibility with old daily variable names. + # They can be removed in stable/11. + security_daily_compat_var() { + local var=$1 dailyvar value + + dailyvar=daily_status_security${var#security_status} + periodvar=${var%enable}period + eval value=\"\$$dailyvar\" + [ -z "$value" ] && return + echo "Warning: Variable \$$dailyvar is deprecated," \ + "use \$$var instead." >&2 + case "$value" in + [Yy][Ee][Ss]) + eval $var=YES + eval $periodvar=daily + ;; + *) + eval $var=\"$value\" + ;; + esac + } + + check_yesno_period() { + local var="$1" periodvar value period + + eval value=\"\$$var\" + case "$value" in + [Yy][Ee][Ss]) ;; + *) return 1 ;; + esac + + periodvar=${var%enable}period + eval period=\"\$$periodvar\" + case "$PERIODIC" in + "security daily") + case "$period" in + [Dd][Aa][Ii][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security weekly") + case "$period" in + [Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security monthly") + case "$period" in + [Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + security) + # Run directly from crontab(5). + case "$period" in + [Nn][Oo]) return 1 ;; + *) return 0 ;; + esac + ;; + '') + # Script run manually. + return 0 + ;; + *) + echo "ASSERTION FAILED: Unexpected value for" \ + "\$PERIODIC: '$PERIODIC'" >&2 + exit 127 + ;; + esac + } + + source_periodic_confs() { + local i sourced_files + + for i in ${periodic_conf_files}; do + case ${sourced_files} in + *:$i:*) + ;; + *) + sourced_files="${sourced_files}:$i:" + [ -r $i ] && . $i + ;; + esac + done + } +fi From owner-svn-src-head@freebsd.org Sat Aug 11 17:42:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1791075015; Sat, 11 Aug 2018 17:42:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DADC8AC49; Sat, 11 Aug 2018 17:42:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 660FA1A80A; Sat, 11 Aug 2018 17:42:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BHghZ2061310; Sat, 11 Aug 2018 17:42:43 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BHggNw061306; Sat, 11 Aug 2018 17:42:42 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111742.w7BHggNw061306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 17:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337649 - in head: etc etc/ntp usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/ntp usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 337649 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 17:42:44 -0000 Author: brd Date: Sat Aug 11 17:42:42 2018 New Revision: 337649 URL: https://svnweb.freebsd.org/changeset/base/337649 Log: Move all NTP related files to usr.sbin/ntp/ntpd. This helps with pkgbase by using CONFS to tag these as config files. Approved by: allanjude (mentor), ian, cy Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16661 Added: head/usr.sbin/ntp/ntpd/leap-seconds - copied unchanged from r337648, head/etc/ntp/leap-seconds head/usr.sbin/ntp/ntpd/ntp.conf - copied unchanged from r337648, head/etc/ntp.conf Deleted: head/etc/ntp/ head/etc/ntp.conf Modified: head/etc/Makefile head/usr.sbin/ntp/ntpd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 17:11:08 2018 (r337648) +++ head/etc/Makefile Sat Aug 11 17:42:42 2018 (r337649) @@ -80,10 +80,6 @@ BIN1+= hosts.lpd printcap BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc .endif -.if ${MK_NTP} != "no" -BIN1+= ntp.conf -.endif - .if ${MK_OPENSSH} != "no" SSH= ${SRCTOP}/crypto/openssh/ssh_config \ ${SRCTOP}/crypto/openssh/sshd_config \ @@ -175,9 +171,6 @@ distribution: ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install -.if ${MK_NTP} != "no" - ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install -.endif ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt Modified: head/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpd/Makefile Sat Aug 11 17:11:08 2018 (r337648) +++ head/usr.sbin/ntp/ntpd/Makefile Sat Aug 11 17:42:42 2018 (r337649) @@ -7,6 +7,10 @@ MAN= .PATH: ${SRCTOP}/contrib/ntp/ntpd \ ${.OBJDIR} +CONFS= ntp.conf +FILES= leap-seconds +FILESDIR= /etc/ntp +FILESMODE= 644 PROG= ntpd SRCS= cmd_args.c ntp_config.c ntp_control.c ntp_crypto.c ntp_filegen.c \ Copied: head/usr.sbin/ntp/ntpd/leap-seconds (from r337648, head/etc/ntp/leap-seconds) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpd/leap-seconds Sat Aug 11 17:42:42 2018 (r337649, copy of r337648, head/etc/ntp/leap-seconds) @@ -0,0 +1,250 @@ +# +# In the following text, the symbol '#' introduces +# a comment, which continues from that symbol until +# the end of the line. A plain comment line has a +# whitespace character following the comment indicator. +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace +# character in column 2. +# +# A blank line should be ignored. +# +# The following table shows the corrections that must +# be applied to compute International Atomic Time (TAI) +# from the Coordinated Universal Time (UTC) values that +# are transmitted by almost all time services. +# +# The first column shows an epoch as a number of seconds +# since 1 January 1900, 00:00:00 (1900.0 is also used to +# indicate the same epoch.) Both of these time stamp formats +# ignore the complexities of the time scales that were +# used before the current definition of UTC at the start +# of 1972. (See note 3 below.) +# The second column shows the number of seconds that +# must be added to UTC to compute TAI for any timestamp +# at or after that epoch. The value on each line is +# valid from the indicated initial instant until the +# epoch given on the next one or indefinitely into the +# future if there is no next line. +# (The comment on each line shows the representation of +# the corresponding initial epoch in the usual +# day-month-year format. The epoch always begins at +# 00:00:00 UTC on the indicated day. See Note 5 below.) +# +# Important notes: +# +# 1. Coordinated Universal Time (UTC) is often referred to +# as Greenwich Mean Time (GMT). The GMT time scale is no +# longer used, and the use of GMT to designate UTC is +# discouraged. +# +# 2. The UTC time scale is realized by many national +# laboratories and timing centers. Each laboratory +# identifies its realization with its name: Thus +# UTC(NIST), UTC(USNO), etc. The differences among +# these different realizations are typically on the +# order of a few nanoseconds (i.e., 0.000 000 00x s) +# and can be ignored for many purposes. These differences +# are tabulated in Circular T, which is published monthly +# by the International Bureau of Weights and Measures +# (BIPM). See www.bipm.org for more information. +# +# 3. The current definition of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before that epoch, and it can be +# quite difficult to compute precise timestamps and time +# intervals in those "prehistoric" days. For more information, +# consult: +# +# The Explanatory Supplement to the Astronomical +# Ephemeris. +# or +# Terry Quinn, "The BIPM and the Accurate Measurement +# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, +# July, 1991. +# +# 4. The decision to insert a leap second into UTC is currently +# the responsibility of the International Earth Rotation and +# Reference Systems Service. (The name was changed from the +# International Earth Rotation Service, but the acronym IERS +# is still used.) +# +# Leap seconds are announced by the IERS in its Bulletin C. +# +# See www.iers.org for more details. +# +# Every national laboratory and timing center uses the +# data from the BIPM and the IERS to construct UTC(lab), +# their local realization of UTC. +# +# Although the definition also includes the possibility +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the +# foreseeable future. +# +# 5. If your system keeps time as the number of seconds since +# some epoch (e.g., NTP timestamps), then the algorithm for +# assigning a UTC time stamp to an event that happens during a positive +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# timestamp would be obtained by advancing to the next entry in the +# following table when the time equivalent to 23:59:59 UTC +# is used for the second time. Thus the leap second which +# occurred on 30 June 1972 at 23:59:59 UTC would have TAI +# timestamps computed as follows: +# +# ... +# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds +# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds +# ... +# +# If your system realizes the leap second by repeating 00:00:00 UTC twice +# (this is possible but not usual), then the advance to the next entry +# in the table must occur the second time that a time equivalent to +# 00:00:00 UTC is used. Thus, using the same example as above: +# +# ... +# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds +# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds +# ... +# +# in both cases the use of timestamps based on TAI produces a smooth +# time scale with no discontinuity in the time interval. However, +# although the long-term behavior of the time scale is correct in both +# methods, the second method is technically not correct because it adds +# the extra second to the wrong day. +# +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch +# during the leap second does not arise. +# +# Some systems implement leap seconds by amortizing the leap second +# over the last few minutes of the day. The frequency of the local +# clock is decreased (or increased) to realize the positive (or +# negative) leap second. This method removes the time step described +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. +# +# Questions or comments to: +# Judah Levine +# Time and Frequency Division +# NIST +# Boulder, Colorado +# Judah.Levine@nist.gov +# +# Last Update of leap second values: 8 July 2016 +# +# The following line shows this last update date in NTP timestamp +# format. This is the date on which the most recent change to +# the leap second data was added to the file. This line can +# be identified by the unique pair of characters in the first two +# columns as shown below. +# +#$ 3676924800 +# +# The NTP timestamps are in units of seconds since the NTP epoch, +# which is 1 January 1900, 00:00:00. The Modified Julian Day number +# corresponding to the NTP time stamp, X, can be computed as +# +# X/86400 + 15020 +# +# where the first term converts seconds to days and the second +# term adds the MJD corresponding to the time origin defined above. +# The integer portion of the result is the integer MJD for that +# day, and any remainder is the time of day, expressed as the +# fraction of the day since 0 hours UTC. The conversion from day +# fraction to seconds or to hours, minutes, and seconds may involve +# rounding or truncation, depending on the method used in the +# computation. +# +# The data in this file will be updated periodically as new leap +# seconds are announced. In addition to being entered on the line +# above, the update time (in NTP format) will be added to the basic +# file name leap-seconds to form the name leap-seconds.. +# In addition, the generic name leap-seconds.list will always point to +# the most recent version of the file. +# +# This update procedure will be performed only when a new leap second +# is announced. +# +# The following entry specifies the expiration date of the data +# in this file in units of seconds since the origin at the instant +# 1 January 1900, 00:00:00. This expiration date will be changed +# at least twice per year whether or not a new leap second is +# announced. These semi-annual changes will be made no later +# than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, +# respectively. (These are the customary effective dates for new +# leap seconds.) This expiration date will be identified by a +# unique pair of characters in columns 1 and 2 as shown below. +# In the unlikely event that a leap second is announced with an +# effective date other than 30 June or 31 December, then this +# file will be edited to include that leap second as soon as it is +# announced or at least one month before the effective date +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will +# be advanced to show that the information in the file is still +# current -- the update time stamp, the data and the name of the file +# will not change. +# +# Updated through IERS Bulletin C53 +# File expires on: 28 December 2017 +# +#@ 3723408000 +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 +# +# the following special comment contains the +# hash value of the data in this file computed +# use the secure hash algorithm as specified +# by FIPS 180-1. See the files in ~/pub/sha for +# the details of how this hash value is +# computed. Note that the hash computation +# ignores comments and whitespace characters +# in data lines. It includes the NTP values +# of both the last modification time and the +# expiration time of the file, but not the +# white space on those lines. +# the hash line is also ignored in the +# computation. +# +#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d Copied: head/usr.sbin/ntp/ntpd/ntp.conf (from r337648, head/etc/ntp.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpd/ntp.conf Sat Aug 11 17:42:42 2018 (r337649, copy of r337648, head/etc/ntp.conf) @@ -0,0 +1,104 @@ +# +# $FreeBSD$ +# +# Default NTP servers for the FreeBSD operating system. +# +# Don't forget to enable ntpd in /etc/rc.conf with: +# ntpd_enable="YES" +# +# The driftfile is by default /var/db/ntpd.drift, check +# /etc/defaults/rc.conf on how to change the location. +# + +# +# Set the target and limit for adding servers configured via pool statements +# or discovered dynamically via mechanisms such as broadcast and manycast. +# Ntpd automatically adds maxclock-1 servers from configured pools, and may +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistant time. +# +tos minclock 3 maxclock 6 + +# +# The following pool statement will give you a random set of NTP servers +# geographically close to you. A single pool statement adds multiple +# servers from the pool, according to the tos minclock/maxclock targets. +# See http://www.pool.ntp.org/ for details. Note, pool.ntp.org encourages +# users with a static IP and good upstream NTP servers to add a server +# to the pool. See http://www.pool.ntp.org/join.html if you are interested. +# +# The option `iburst' is used for faster initial synchronization. +# +pool 0.freebsd.pool.ntp.org iburst + +# +# If you want to pick yourself which country's public NTP server +# you want to sync against, comment out the above pool, uncomment +# the next one, and replace CC with the country's abbreviation. +# Make sure that the hostname resolves to a proper IP address! +# +# pool 0.CC.pool.ntp.org iburst + +# +# To configure a specific server, such as an organization-wide local +# server, add lines similar to the following. One or more specific +# servers can be configured in addition to, or instead of, any server +# pools specified above. When both are configured, ntpd first adds all +# the specific servers, then adds servers from the pool until the tos +# minclock/maxclock targets are met. +# +#server time.my-internal.org iburst + +# +# Security: +# +# By default, only allow time queries and block all other requests +# from unauthenticated clients. +# +# The "restrict source" line allows peers to be mobilized when added by +# ntpd from a pool, but does not enable mobilizing a new peer association +# by other dynamic means (broadcast, manycast, ntpq commands, etc). +# +# See http://support.ntp.org/bin/view/Support/AccessRestrictions +# for more information. +# +restrict default limited kod nomodify notrap noquery nopeer +restrict source limited kod nomodify notrap noquery + +# +# Alternatively, the following rules would block all unauthorized access. +# +#restrict default ignore +# +# In this case, all remote NTP time servers also need to be explicitly +# allowed or they would not be able to exchange time information with +# this server. +# +# Please note that this example doesn't work for the servers in +# the pool.ntp.org domain since they return multiple A records. +# +#restrict 0.pool.ntp.org nomodify nopeer noquery notrap +#restrict 1.pool.ntp.org nomodify nopeer noquery notrap +#restrict 2.pool.ntp.org nomodify nopeer noquery notrap +# +# The following settings allow unrestricted access from the localhost +restrict 127.0.0.1 +restrict ::1 + +# +# If a server loses sync with all upstream servers, NTP clients +# no longer follow that server. The local clock can be configured +# to provide a time source when this happens, but it should usually +# be configured on just one server on a network. For more details see +# http://support.ntp.org/bin/view/Support/UndisciplinedLocalClock +# The use of Orphan Mode may be preferable. +# +#server 127.127.1.0 +#fudge 127.127.1.0 stratum 10 + +# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. +# for documentation regarding leapfile. Updates to the file can be obtained +# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. +# Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" From owner-svn-src-head@freebsd.org Sat Aug 11 19:20:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5114B10773D2; Sat, 11 Aug 2018 19:20:07 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07B498DA37; Sat, 11 Aug 2018 19:20:07 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C420D1B6CF; Sat, 11 Aug 2018 19:20:06 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BJK6gi008637; Sat, 11 Aug 2018 19:20:06 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BJK68P008635; Sat, 11 Aug 2018 19:20:06 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201808111920.w7BJK68P008635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sat, 11 Aug 2018 19:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337651 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 337651 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 19:20:07 -0000 Author: pstef Date: Sat Aug 11 19:20:06 2018 New Revision: 337651 URL: https://svnweb.freebsd.org/changeset/base/337651 Log: indent(1): revert r334640 and r334632 While STACKSIZE macro is indeed problematic on some systems, the commits were wrong to shrink il[] and cstk[], because they need to be of the same size as p_stack[] as they're accessed with the same index ps.tos. Modified: head/usr.bin/indent/indent_globs.h head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sat Aug 11 17:52:58 2018 (r337650) +++ head/usr.bin/indent/indent_globs.h Sat Aug 11 19:20:06 2018 (r337651) @@ -234,11 +234,13 @@ int inhibit_formatting; /* true if INDENT OFF int suppress_blanklines;/* set iff following blanklines should be * suppressed */ +#define STACKSIZE 256 + struct parser_state { int last_token; - int p_stack[256]; /* this is the parsers stack */ - int il[64]; /* this stack stores indentation levels */ - float cstk[32]; /* used to store case stmt indentation levels */ + int p_stack[STACKSIZE]; /* this is the parsers stack */ + int il[STACKSIZE]; /* this stack stores indentation levels */ + float cstk[STACKSIZE];/* used to store case stmt indentation levels */ int box_com; /* set to true when we are in a "boxed" * comment. In that case, the first non-blank * char should be lined up with the / in / followed by * */ Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Sat Aug 11 17:52:58 2018 (r337650) +++ head/usr.bin/indent/parse.c Sat Aug 11 19:20:06 2018 (r337651) @@ -42,12 +42,10 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6 #endif #include -#include __FBSDID("$FreeBSD$"); #include #include - #include "indent_globs.h" #include "indent_codes.h" #include "indent.h" @@ -211,7 +209,7 @@ parse(int tk) /* tk: the code for the construct scanne } /* end of switch */ - if (ps.tos >= (int)nitems(ps.p_stack) - 1) + if (ps.tos >= STACKSIZE - 1) errx(1, "Parser stack overflow"); reduce(); /* see if any reduction can be done */ From owner-svn-src-head@freebsd.org Sat Aug 11 19:21:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE9F1077582; Sat, 11 Aug 2018 19:21:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45C198DCB3; Sat, 11 Aug 2018 19:21:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26D3F1B82D; Sat, 11 Aug 2018 19:21:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BJLstv012596; Sat, 11 Aug 2018 19:21:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BJLsjl012595; Sat, 11 Aug 2018 19:21:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808111921.w7BJLsjl012595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 11 Aug 2018 19:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337652 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337652 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 19:21:54 -0000 Author: alc Date: Sat Aug 11 19:21:53 2018 New Revision: 337652 URL: https://svnweb.freebsd.org/changeset/base/337652 Log: Eliminate a redundant assignment. MFC after: 1 week Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Sat Aug 11 19:20:06 2018 (r337651) +++ head/sys/kern/subr_vmem.c Sat Aug 11 19:21:53 2018 (r337652) @@ -989,7 +989,6 @@ vmem_clip(vmem_t *vm, bt_t *bt, vmem_addr_t start, vme bt_insbusy(vm, bt); } MPASS(bt->bt_size >= size); - bt->bt_type = BT_TYPE_BUSY; } /* ---- vmem API */ From owner-svn-src-head@freebsd.org Sat Aug 11 19:45:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CEF51077E1D; Sat, 11 Aug 2018 19:45:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D0288EBB8; Sat, 11 Aug 2018 19:45:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 121B01BB9B; Sat, 11 Aug 2018 19:45:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BJj55S023836; Sat, 11 Aug 2018 19:45:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BJj5PN023832; Sat, 11 Aug 2018 19:45:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808111945.w7BJj5PN023832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 11 Aug 2018 19:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337653 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 337653 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 19:45:06 -0000 Author: mmacy Date: Sat Aug 11 19:45:04 2018 New Revision: 337653 URL: https://svnweb.freebsd.org/changeset/base/337653 Log: Limit the amount of dnode metadata in the ARC In addition import most recent arc_prune_async implementation as dependency commit 25458cbef9e59ef9ee6a7e729ab2522ed308f88f Author: Tim Chase Date: Wed Jul 13 07:42:40 2016 -0500 Limit the amount of dnode metadata in the ARC Metadata-intensive workloads can cause the ARC to become permanently filled with dnode_t objects as they're pinned by the VFS layer. Subsequent data-intensive workloads may only benefit from about 25% of the potential ARC (arc_c_max - arc_meta_limit). In order to help track metadata usage more precisely, the other_size metadata arcstat has replaced with dbuf_size, dnode_size and bonus_size. The new zfs_arc_dnode_limit tunable, which defaults to 10% of zfs_arc_meta_limit, defines the minimum number of bytes which is desirable to be consumed by dnodes. Attempts to evict non-metadata will trigger async prune tasks if the space used by dnodes exceeds this limit. The new zfs_arc_dnode_reduce_percent tunable specifies the amount by which the excess dnode space is attempted to be pruned as a percentage of the amount by which zfs_arc_dnode_limit is being exceeded. By default, it tries to unpin 10% of the dnodes. The problem of dnode metadata pinning was observed with the following testing procedure (in this example, zfs_arc_max is set to 4GiB): - Create a large number of small files until arc_meta_used exceeds arc_meta_limit (3GiB with default tuning) and arc_prune starts increasing. - Create a 3GiB file with dd. Observe arc_mata_used. It will still be around 3GiB. - Repeatedly read the 3GiB file and observe arc_meta_limit as before. It will continue to stay around 3GiB. With this modification, space for the 3GiB file is gradually made available as subsequent demands on the ARC are made. The previous behavior can be restored by setting zfs_arc_dnode_limit to the same value as the zfs_arc_meta_limit. Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Issue #4345 Issue #4512 Issue #4773 Closes #4858 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 11 19:21:53 2018 (r337652) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 11 19:45:04 2018 (r337653) @@ -99,6 +99,14 @@ * must use: mutex_tryenter() to avoid deadlock. Also note that * the active state mutex must be held before the ghost state mutex. * + * It as also possible to register a callback which is run when the + * arc_meta_limit is reached and no buffers can be safely evicted. In + * this case the arc user should drop a reference on some arc buffers so + * they can be reclaimed and the arc_meta_limit honored. For example, + * when using the ZPL each dentry holds a references on a znode. These + * dentries must be pruned before the arc buffer holding the znode can + * be safely evicted. + * * Note that the majority of the performance stats are manipulated * with atomic operations. * @@ -367,6 +375,8 @@ uint64_t zfs_arc_max; uint64_t zfs_arc_min; uint64_t zfs_arc_meta_limit = 0; uint64_t zfs_arc_meta_min = 0; +uint64_t zfs_arc_dnode_limit = 0; +uint64_t zfs_arc_dnode_reduce_percent = 10; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_no_grow_shift = 0; @@ -624,15 +634,18 @@ typedef struct arc_stats { */ kstat_named_t arcstat_metadata_size; /* - * Number of bytes consumed by various buffers and structures - * not actually backed with ARC buffers. This includes bonus - * buffers (allocated directly via zio_buf_* functions), - * dmu_buf_impl_t structures (allocated via dmu_buf_impl_t - * cache), and dnode_t structures (allocated via dnode_t cache). - * Not updated directly; only synced in arc_kstat_update. + * Number of bytes consumed by dmu_buf_impl_t objects. */ - kstat_named_t arcstat_other_size; + kstat_named_t arcstat_dbuf_size; /* + * Number of bytes consumed by dnode_t objects. + */ + kstat_named_t arcstat_dnode_size; + /* + * Number of bytes consumed by bonus buffers. + */ + kstat_named_t arcstat_bonus_size; + /* * Total number of bytes consumed by ARC buffers residing in the * arc_anon state. This includes *all* buffers in the arc_anon * state; e.g. data, metadata, evictable, and unevictable buffers @@ -782,9 +795,19 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_write_buffer_list_iter; kstat_named_t arcstat_l2_write_buffer_list_null_iter; kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_memory_direct_count; + kstat_named_t arcstat_memory_indirect_count; + kstat_named_t arcstat_memory_all_bytes; + kstat_named_t arcstat_memory_free_bytes; + kstat_named_t arcstat_memory_available_bytes; + kstat_named_t arcstat_no_grow; + kstat_named_t arcstat_tempreserve; + kstat_named_t arcstat_loaned_bytes; + kstat_named_t arcstat_prune; /* Not updated directly; only synced in arc_kstat_update. */ kstat_named_t arcstat_meta_used; kstat_named_t arcstat_meta_limit; + kstat_named_t arcstat_dnode_limit; kstat_named_t arcstat_meta_max; kstat_named_t arcstat_meta_min; kstat_named_t arcstat_async_upgrade_sync; @@ -833,7 +856,9 @@ static arc_stats_t arc_stats = { { "hdr_size", KSTAT_DATA_UINT64 }, { "data_size", KSTAT_DATA_UINT64 }, { "metadata_size", KSTAT_DATA_UINT64 }, - { "other_size", KSTAT_DATA_UINT64 }, + { "dbuf_size", KSTAT_DATA_UINT64 }, + { "dnode_size", KSTAT_DATA_UINT64 }, + { "bonus_size", KSTAT_DATA_UINT64 }, { "anon_size", KSTAT_DATA_UINT64 }, { "anon_evictable_data", KSTAT_DATA_UINT64 }, { "anon_evictable_metadata", KSTAT_DATA_UINT64 }, @@ -882,8 +907,18 @@ static arc_stats_t arc_stats = { { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 }, { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "memory_direct_count", KSTAT_DATA_UINT64 }, + { "memory_indirect_count", KSTAT_DATA_UINT64 }, + { "memory_all_bytes", KSTAT_DATA_UINT64 }, + { "memory_free_bytes", KSTAT_DATA_UINT64 }, + { "memory_available_bytes", KSTAT_DATA_UINT64 }, + { "arc_no_grow", KSTAT_DATA_UINT64 }, + { "arc_tempreserve", KSTAT_DATA_UINT64 }, + { "arc_loaned_bytes", KSTAT_DATA_UINT64 }, + { "arc_prune", KSTAT_DATA_UINT64 }, { "arc_meta_used", KSTAT_DATA_UINT64 }, { "arc_meta_limit", KSTAT_DATA_UINT64 }, + { "arc_dnode_limit", KSTAT_DATA_UINT64 }, { "arc_meta_max", KSTAT_DATA_UINT64 }, { "arc_meta_min", KSTAT_DATA_UINT64 }, { "async_upgrade_sync", KSTAT_DATA_UINT64 }, @@ -950,8 +985,12 @@ static arc_state_t *arc_l2c_only; #define arc_c_min ARCSTAT(arcstat_c_min) /* min target cache size */ #define arc_c_max ARCSTAT(arcstat_c_max) /* max target cache size */ #define arc_meta_limit ARCSTAT(arcstat_meta_limit) /* max size for metadata */ +#define arc_dnode_limit ARCSTAT(arcstat_dnode_limit) /* max size for dnodes */ #define arc_meta_min ARCSTAT(arcstat_meta_min) /* min size for metadata */ #define arc_meta_max ARCSTAT(arcstat_meta_max) /* max size of metadata */ +#define arc_dbuf_size ARCSTAT(arcstat_dbuf_size) /* dbuf metadata */ +#define arc_dnode_size ARCSTAT(arcstat_dnode_size) /* dnode metadata */ +#define arc_bonus_size ARCSTAT(arcstat_bonus_size) /* bonus buffer metadata */ /* compressed size of entire arc */ #define arc_compressed_size ARCSTAT(arcstat_compressed_size) @@ -973,9 +1012,15 @@ aggsum_t arc_meta_used; aggsum_t astat_data_size; aggsum_t astat_metadata_size; aggsum_t astat_hdr_size; -aggsum_t astat_other_size; +aggsum_t astat_bonus_size; +aggsum_t astat_dnode_size; +aggsum_t astat_dbuf_size; aggsum_t astat_l2_hdr_size; +static list_t arc_prune_list; +static kmutex_t arc_prune_mtx; +static taskq_t *arc_prune_taskq; + static int arc_no_grow; /* Don't try to grow cache size */ static uint64_t arc_tempreserve; static uint64_t arc_loaned_bytes; @@ -1472,6 +1517,7 @@ static void arc_hdr_alloc_pabd(arc_buf_hdr_t *); static void arc_access(arc_buf_hdr_t *, kmutex_t *); static boolean_t arc_is_overflowing(); static void arc_buf_watch(arc_buf_t *); +static void arc_prune_async(int64_t); static arc_buf_contents_t arc_buf_type(arc_buf_hdr_t *); static uint32_t arc_bufc_to_flags(arc_buf_contents_t); @@ -2703,9 +2749,15 @@ arc_space_consume(uint64_t space, arc_space_type_t typ case ARC_SPACE_META: aggsum_add(&astat_metadata_size, space); break; - case ARC_SPACE_OTHER: - aggsum_add(&astat_other_size, space); + case ARC_SPACE_BONUS: + aggsum_add(&astat_bonus_size, space); break; + case ARC_SPACE_DNODE: + aggsum_add(&astat_dnode_size, space); + break; + case ARC_SPACE_DBUF: + aggsum_add(&astat_dbuf_size, space); + break; case ARC_SPACE_HDRS: aggsum_add(&astat_hdr_size, space); break; @@ -2732,9 +2784,15 @@ arc_space_return(uint64_t space, arc_space_type_t type case ARC_SPACE_META: aggsum_add(&astat_metadata_size, -space); break; - case ARC_SPACE_OTHER: - aggsum_add(&astat_other_size, -space); + case ARC_SPACE_BONUS: + aggsum_add(&astat_bonus_size, -space); break; + case ARC_SPACE_DNODE: + aggsum_add(&astat_dnode_size, -space); + break; + case ARC_SPACE_DBUF: + aggsum_add(&astat_dbuf_size, -space); + break; case ARC_SPACE_HDRS: aggsum_add(&astat_hdr_size, -space); break; @@ -3833,16 +3891,28 @@ arc_evict_state(arc_state_t *state, uint64_t spa, int6 * we're evicting all available buffers. */ while (total_evicted < bytes || bytes == ARC_EVICT_ALL) { + int sublist_idx = multilist_get_random_index(ml); + uint64_t scan_evicted = 0; + /* + * Try to reduce pinned dnodes with a floor of arc_dnode_limit. + * Request that 10% of the LRUs be scanned by the superblock + * shrinker. + */ + if (type == ARC_BUFC_DATA && aggsum_compare(&astat_dnode_size, + arc_dnode_limit) > 0) { + arc_prune_async((aggsum_upper_bound(&astat_dnode_size) - + arc_dnode_limit) / sizeof (dnode_t) / + zfs_arc_dnode_reduce_percent); + } + + /* * Start eviction using a randomly selected sublist, * this is to try and evenly balance eviction across all * sublists. Always starting at the same sublist * (e.g. index 0) would cause evictions to favor certain * sublists over others. */ - int sublist_idx = multilist_get_random_index(ml); - uint64_t scan_evicted = 0; - for (int i = 0; i < num_sublists; i++) { uint64_t bytes_remaining; uint64_t bytes_evicted; @@ -3933,6 +4003,57 @@ arc_flush_state(arc_state_t *state, uint64_t spa, arc_ } /* + * Helper function for arc_prune_async() it is responsible for safely + * handling the execution of a registered arc_prune_func_t. + */ +static void +arc_prune_task(void *ptr) +{ + arc_prune_t *ap = (arc_prune_t *)ptr; + arc_prune_func_t *func = ap->p_pfunc; + + if (func != NULL) + func(ap->p_adjust, ap->p_private); + + refcount_remove(&ap->p_refcnt, func); +} + +/* + * Notify registered consumers they must drop holds on a portion of the ARC + * buffered they reference. This provides a mechanism to ensure the ARC can + * honor the arc_meta_limit and reclaim otherwise pinned ARC buffers. This + * is analogous to dnlc_reduce_cache() but more generic. + * + * This operation is performed asynchronously so it may be safely called + * in the context of the arc_reclaim_thread(). A reference is taken here + * for each registered arc_prune_t and the arc_prune_task() is responsible + * for releasing it once the registered arc_prune_func_t has completed. + */ +static void +arc_prune_async(int64_t adjust) +{ + arc_prune_t *ap; + + mutex_enter(&arc_prune_mtx); + for (ap = list_head(&arc_prune_list); ap != NULL; + ap = list_next(&arc_prune_list, ap)) { + + if (refcount_count(&ap->p_refcnt) >= 2) + continue; + + refcount_add(&ap->p_refcnt, ap->p_pfunc); + ap->p_adjust = adjust; + if (taskq_dispatch(arc_prune_taskq, arc_prune_task, + ap, TQ_SLEEP) == TASKQID_INVALID) { + refcount_remove(&ap->p_refcnt, ap->p_pfunc); + continue; + } + ARCSTAT_BUMP(arcstat_prune); + } + mutex_exit(&arc_prune_mtx); +} + +/* * Evict the specified number of bytes from the state specified, * restricting eviction to the spa and type given. This function * prevents us from trying to evict more from a state's list than @@ -5764,6 +5885,43 @@ top: return (0); } +arc_prune_t * +arc_add_prune_callback(arc_prune_func_t *func, void *private) +{ + arc_prune_t *p; + + p = kmem_alloc(sizeof (*p), KM_SLEEP); + p->p_pfunc = func; + p->p_private = private; + list_link_init(&p->p_node); + refcount_create(&p->p_refcnt); + + mutex_enter(&arc_prune_mtx); + refcount_add(&p->p_refcnt, &arc_prune_list); + list_insert_head(&arc_prune_list, p); + mutex_exit(&arc_prune_mtx); + + return (p); +} + +void +arc_remove_prune_callback(arc_prune_t *p) +{ + boolean_t wait = B_FALSE; + mutex_enter(&arc_prune_mtx); + list_remove(&arc_prune_list, p); + if (refcount_remove(&p->p_refcnt, &arc_prune_list) > 0) + wait = B_TRUE; + mutex_exit(&arc_prune_mtx); + + /* wait for arc_prune_task to finish */ + if (wait) + taskq_wait(arc_prune_taskq); + ASSERT0(refcount_count(&p->p_refcnt)); + refcount_destroy(&p->p_refcnt); + kmem_free(p, sizeof (*p)); +} + /* * Notify the arc that a block was freed, and thus will never be used again. */ @@ -6476,7 +6634,9 @@ arc_kstat_update(kstat_t *ksp, int rw) ARCSTAT(arcstat_metadata_size) = aggsum_value(&astat_metadata_size); ARCSTAT(arcstat_hdr_size) = aggsum_value(&astat_hdr_size); - ARCSTAT(arcstat_other_size) = aggsum_value(&astat_other_size); + ARCSTAT(arcstat_bonus_size) = aggsum_value(&astat_bonus_size); + ARCSTAT(arcstat_dnode_size) = aggsum_value(&astat_dnode_size); + ARCSTAT(arcstat_dbuf_size) = aggsum_value(&astat_dbuf_size); ARCSTAT(arcstat_l2_hdr_size) = aggsum_value(&astat_l2_hdr_size); } @@ -6616,7 +6776,9 @@ arc_state_init(void) aggsum_init(&astat_data_size, 0); aggsum_init(&astat_metadata_size, 0); aggsum_init(&astat_hdr_size, 0); - aggsum_init(&astat_other_size, 0); + aggsum_init(&astat_bonus_size, 0); + aggsum_init(&astat_dnode_size, 0); + aggsum_init(&astat_dbuf_size, 0); aggsum_init(&astat_l2_hdr_size, 0); } @@ -6730,6 +6892,7 @@ arc_init(void) */ #ifdef __FreeBSD__ arc_meta_limit = MIN(arc_meta_limit, uma_limit() / 2); + arc_dnode_limit = arc_meta_limit / 10; #else arc_meta_limit = MIN(arc_meta_limit, vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 2); @@ -6749,6 +6912,12 @@ arc_init(void) arc_meta_min = arc_c_min / 2; } + /* Valid range: - */ + if ((zfs_arc_dnode_limit) && (zfs_arc_dnode_limit != arc_dnode_limit) && + (zfs_arc_dnode_limit >= zfs_arc_meta_min) && + (zfs_arc_dnode_limit <= arc_c_max)) + arc_dnode_limit = zfs_arc_dnode_limit; + if (zfs_arc_grow_retry > 0) arc_grow_retry = zfs_arc_grow_retry; @@ -6778,6 +6947,13 @@ arc_init(void) arc_state_init(); buf_init(); + list_create(&arc_prune_list, sizeof (arc_prune_t), + offsetof(arc_prune_t, p_node)); + mutex_init(&arc_prune_mtx, NULL, MUTEX_DEFAULT, NULL); + + arc_prune_taskq = taskq_create("arc_prune", max_ncpus, minclsyspri, + max_ncpus, INT_MAX, TASKQ_PREPOPULATE | TASKQ_DYNAMIC); + arc_reclaim_thread_exit = B_FALSE; arc_dnlc_evicts_thread_exit = FALSE; @@ -6859,6 +7035,8 @@ arc_init(void) void arc_fini(void) { + arc_prune_t *p; + #ifdef _KERNEL if (arc_event_lowmem != NULL) EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem); @@ -6898,6 +7076,20 @@ arc_fini(void) arc_ksp = NULL; } + taskq_wait(arc_prune_taskq); + taskq_destroy(arc_prune_taskq); + + mutex_enter(&arc_prune_mtx); + while ((p = list_head(&arc_prune_list)) != NULL) { + list_remove(&arc_prune_list, p); + refcount_remove(&p->p_refcnt, &arc_prune_list); + refcount_destroy(&p->p_refcnt); + kmem_free(p, sizeof (*p)); + } + mutex_exit(&arc_prune_mtx); + + list_destroy(&arc_prune_list); + mutex_destroy(&arc_prune_mtx); mutex_destroy(&arc_reclaim_lock); cv_destroy(&arc_reclaim_thread_cv); cv_destroy(&arc_reclaim_waiters_cv); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Aug 11 19:21:53 2018 (r337652) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Aug 11 19:45:04 2018 (r337653) @@ -1014,7 +1014,7 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_ ASSERT3U(bonuslen, <=, db->db.db_size); db->db.db_data = zio_buf_alloc(DN_MAX_BONUSLEN); - arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_OTHER); + arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); if (bonuslen < DN_MAX_BONUSLEN) bzero(db->db.db_data, DN_MAX_BONUSLEN); if (bonuslen) @@ -1124,7 +1124,7 @@ dbuf_fix_old_data(dmu_buf_impl_t *db, uint64_t txg) if (db->db_blkid == DMU_BONUS_BLKID) { /* Note that the data bufs here are zio_bufs */ dr->dt.dl.dr_data = zio_buf_alloc(DN_MAX_BONUSLEN); - arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_OTHER); + arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); bcopy(db->db.db_data, dr->dt.dl.dr_data, DN_MAX_BONUSLEN); } else if (refcount_count(&db->db_holds) > db->db_dirtycnt) { int size = arc_buf_size(db->db_buf); @@ -2098,7 +2098,7 @@ dbuf_destroy(dmu_buf_impl_t *db) if (db->db_blkid == DMU_BONUS_BLKID) { ASSERT(db->db.db_data != NULL); zio_buf_free(db->db.db_data, DN_MAX_BONUSLEN); - arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_OTHER); + arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); db->db_state = DB_UNCACHED; } @@ -2172,7 +2172,7 @@ dbuf_destroy(dmu_buf_impl_t *db) ASSERT(!multilist_link_active(&db->db_cache_link)); kmem_cache_free(dbuf_kmem_cache, db); - arc_space_return(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); + arc_space_return(sizeof (dmu_buf_impl_t), ARC_SPACE_DBUF); /* * If this dbuf is referenced from an indirect dbuf, @@ -2311,7 +2311,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid db->db_state = DB_UNCACHED; db->db_caching_status = DB_NO_CACHE; /* the bonus dbuf is not placed in the hash table */ - arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); + arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_DBUF); return (db); } else if (blkid == DMU_SPILL_BLKID) { db->db.db_size = (blkptr != NULL) ? @@ -2344,7 +2344,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid db->db_state = DB_UNCACHED; db->db_caching_status = DB_NO_CACHE; mutex_exit(&dn->dn_dbufs_mtx); - arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); + arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_DBUF); if (parent && parent != dn->dn_dbuf) dbuf_add_ref(parent, db); @@ -3191,7 +3191,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) if (*datap != db->db.db_data) { zio_buf_free(*datap, DN_MAX_BONUSLEN); - arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_OTHER); + arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); } db->db_data_pending = NULL; drp = &db->db_last_dirty; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Aug 11 19:21:53 2018 (r337652) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Aug 11 19:45:04 2018 (r337653) @@ -472,7 +472,7 @@ dnode_create(objset_t *os, dnode_phys_t *dnp, dmu_buf_ dnh->dnh_dnode = dn; mutex_exit(&os->os_lock); - arc_space_consume(sizeof (dnode_t), ARC_SPACE_OTHER); + arc_space_consume(sizeof (dnode_t), ARC_SPACE_DNODE); return (dn); } @@ -527,7 +527,7 @@ dnode_destroy(dnode_t *dn) dmu_zfetch_fini(&dn->dn_zfetch); kmem_cache_free(dnode_cache, dn); - arc_space_return(sizeof (dnode_t), ARC_SPACE_OTHER); + arc_space_return(sizeof (dnode_t), ARC_SPACE_DNODE); if (complete_os_eviction) dmu_objset_evict_done(os); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 11 19:21:53 2018 (r337652) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 11 19:45:04 2018 (r337653) @@ -58,14 +58,42 @@ _NOTE(CONSTCOND) } while (0) typedef struct arc_buf_hdr arc_buf_hdr_t; typedef struct arc_buf arc_buf_t; +typedef struct arc_prune arc_prune_t; + +/* + * Because the ARC can store encrypted data, errors (not due to bugs) may arise + * while transforming data into its desired format - specifically, when + * decrypting, the key may not be present, or the HMAC may not be correct + * which signifies deliberate tampering with the on-disk state + * (assuming that the checksum was correct). If any error occurs, the "buf" + * parameter will be NULL. + */ typedef void arc_read_done_func_t(zio_t *zio, const zbookmark_phys_t *zb, - const blkptr_t *bp, arc_buf_t *buf, void *priv); -typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv); + const blkptr_t *bp, arc_buf_t *buf, void *private); +typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void *private); +typedef void arc_prune_func_t(int64_t bytes, void *private); +/* Shared module parameters */ +extern uint64_t zfs_arc_average_blocksize; + /* generic arc_done_func_t's which you can use */ arc_read_done_func_t arc_bcopy_func; arc_read_done_func_t arc_getbuf_func; +/* generic arc_prune_func_t wrapper for callbacks */ +struct arc_prune { + arc_prune_func_t *p_pfunc; + void *p_private; + uint64_t p_adjust; + list_node_t p_node; + refcount_t p_refcnt; +}; + +typedef enum arc_strategy { + ARC_STRATEGY_META_ONLY = 0, /* Evict only meta data buffers */ + ARC_STRATEGY_META_BALANCED = 1, /* Evict data buffers if needed */ +} arc_strategy_t; + typedef enum arc_flags { /* @@ -151,7 +179,9 @@ typedef enum arc_space_type { ARC_SPACE_META, ARC_SPACE_HDRS, ARC_SPACE_L2HDRS, - ARC_SPACE_OTHER, + ARC_SPACE_DBUF, + ARC_SPACE_DNODE, + ARC_SPACE_BONUS, ARC_SPACE_NUMTYPES } arc_space_type_t; @@ -190,6 +220,9 @@ zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, arc_write_done_func_t *physdone, arc_write_done_func_t *done, void *priv, zio_priority_t priority, int zio_flags, const zbookmark_phys_t *zb); + +arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void *private); +void arc_remove_prune_callback(arc_prune_t *p); void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_flush(spa_t *spa, boolean_t retry); From owner-svn-src-head@freebsd.org Sat Aug 11 20:41:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D6510790E8; Sat, 11 Aug 2018 20:41:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D980908E4; Sat, 11 Aug 2018 20:41:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F8F31C505; Sat, 11 Aug 2018 20:41:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BKfhb1054824; Sat, 11 Aug 2018 20:41:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BKfhWl054823; Sat, 11 Aug 2018 20:41:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808112041.w7BKfhWl054823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 11 Aug 2018 20:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337656 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 337656 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 20:41:44 -0000 Author: mmacy Date: Sat Aug 11 20:41:42 2018 New Revision: 337656 URL: https://svnweb.freebsd.org/changeset/base/337656 Log: buildworld fix: private appears to have special meaning on FreeBSD - revert to priv Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 11 20:32:50 2018 (r337655) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 11 20:41:42 2018 (r337656) @@ -69,9 +69,9 @@ typedef struct arc_prune arc_prune_t; * parameter will be NULL. */ typedef void arc_read_done_func_t(zio_t *zio, const zbookmark_phys_t *zb, - const blkptr_t *bp, arc_buf_t *buf, void *private); -typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void *private); -typedef void arc_prune_func_t(int64_t bytes, void *private); + const blkptr_t *bp, arc_buf_t *buf, void *priv); +typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv); +typedef void arc_prune_func_t(int64_t bytes, void *priv); /* Shared module parameters */ extern uint64_t zfs_arc_average_blocksize; @@ -221,7 +221,7 @@ zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, void *priv, zio_priority_t priority, int zio_flags, const zbookmark_phys_t *zb); -arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void *private); +arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void *priv); void arc_remove_prune_callback(arc_prune_t *p); void arc_freed(spa_t *spa, const blkptr_t *bp); From owner-svn-src-head@freebsd.org Sat Aug 11 20:49:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7526C1079428; Sat, 11 Aug 2018 20:49:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21B1690DAB; Sat, 11 Aug 2018 20:49:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02D6D1C55A; Sat, 11 Aug 2018 20:49:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BKnJBk055262; Sat, 11 Aug 2018 20:49:19 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BKnJCO055260; Sat, 11 Aug 2018 20:49:19 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808112049.w7BKnJCO055260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 20:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337658 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 337658 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 20:49:20 -0000 Author: netchild Date: Sat Aug 11 20:49:19 2018 New Revision: 337658 URL: https://svnweb.freebsd.org/changeset/base/337658 Log: Extend the info about the limitations of datasets in jails. Reviewed by: allanjude Sponsored by: Essen Hackathon Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Aug 11 20:47:35 2018 (r337657) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Aug 11 20:49:19 2018 (r337658) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2017 +.Dd August 11, 2018 .Dt ZFS 8 .Os .Sh NAME @@ -462,8 +462,11 @@ responsible for mounting and unmounting the file syste dataset can be attached to a jail by using the .Qq Nm Cm jail subcommand. You cannot attach a dataset to one jail and the children of the -same dataset to another jails. To allow management of the dataset from within -a jail, the +same dataset to another jail. You can also not attach the root file system +of the jail or any dataset which needs to be mounted before the zfs rc script +is run inside the jail, as it would be attached unmounted until it is +mounted from the rc script inside the jail. To allow management of the +dataset from within a jail, the .Sy jailed property has to be set and the jail needs access to the .Pa /dev/zfs From owner-svn-src-head@freebsd.org Sat Aug 11 20:56:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047BB1079A25 for ; Sat, 11 Aug 2018 20:56:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-22.consmr.mail.ne1.yahoo.com (sonic310-22.consmr.mail.ne1.yahoo.com [66.163.186.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8036C913AD for ; Sat, 11 Aug 2018 20:56:09 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: Nv1pRCwVM1l8jd3AWEoZWmiwWEsQos3xQ6Fr1ii5kAACvF1qa1jRufuT5kFhVum BqGrFwoJOCD9RoHNnQIURs1FqQuQhKz0FxOQgJcYlgCnd.bRt5E9C9uuvuxHq5mTxWdbrb6kRZPS hyLCYJMEfGq_kzQrK453WVNjxmkUfKXS__AEaCrC0Z5PHT9uodz95e2rxg4z8fiA4a61pixI0siQ hTQ.teWPR0xiH6CrksjtmRdX5dvWvbR3SakA6c4Rt3iQdvW.am2x64lRdmUXxNASeKdmcsV5neoz aJLXP.JnahCXuu_0ALWhmMLTOhKxxW11yMwc1FNogdO1WEZwp3eTb3KtqMh58HEkPC1cKWUvRjAF T_8QTUa1bGl.5tNuI0dRoq3XWgp2EpGC_mRKoY1lL_M3lW_74s.vA1pRw7v3yRrRcP42EFdqIq2s nsOfZhZY6KMMUYWo1V6JGu_y81kf2ZHbdANL4RkLYe1lndRZCRLUfH7oRtqjmZEUJnT5zs1FEKAu r0MfPxuh0QPODd9aPdMvFrEPcNWkhjTxu0yTI_g1V1FVIgdFLyTGvgXEZCNwiysBpjp3yPJRjWKB m2yMRypHgELqDouKlOAOFPvDFv60drqe5VqabdoKSI2fzuLivkORmzW6utwivmoL0bxrXATkP6Rv uFdOb2IAj5wxbRs.rkDpIyaeDvYNt3N.rnkGDv9aD19_5Qo3.ZFffKdxq.Gwjl.l6iHyN51233Kc A_jYRmat6Bn3qV0Z3AT5Vt7paonHNaBeT264r9s5Qi_SOG5eOZjDk.aUj66yIQ8_8KQbiXjFpBHm nwBcPSnGM6DVUgUt1qv3oIvxASbWbrvng.Q5EeGt_uP8hy2AEVknvi2a0VL7eLK75IR2Aqwyt5gp r5.bqdFkJJ4y592N5riaZhSUYkmVep5D0SAfEsbuAHlOobV4tqYsNlhh8voH9MiK0nXDo5HcxOA2 spxgR.OdGC6nmG2hfvEPWXXWdc3YGXAf8x0GHTKHoo1MV1sovdfl3LdckrdW5NTOs..Jvz2koeA8 coGU06gZOvjNz Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 11 Aug 2018 20:56:08 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp427.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e3afbb1980f90573158fe6def44da9e6; Sat, 11 Aug 2018 20:45:59 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337653 -[this broke the ci.freebsd.org 's FreeBSD-head-*-builds, both clang-based and gcc-4.2.1-based that have attempted to build so far] Message-Id: <56642530-DB9B-4017-A23D-178FBBD8FB5D@yahoo.com> Date: Sat, 11 Aug 2018 13:45:57 -0700 To: mmacy@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 20:56:10 -0000 For example: https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/6945/consoleText = shows: (gcc 4.2.1, -r337652 for 6944 built) --- all_subdir_cddl/usr.sbin --- In file included from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h:37,= from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h:30= , from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h:35= , from = /usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:45, from /usr/src/cddl/usr.sbin/zfsd/case_file.cc:54: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:72: = error: expected ',' or '...' before 'private' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:73: = error: expected ',' or '...' before 'private' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:74: = error: expected ',' or '...' before 'private' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:224: = error: expected ',' or '...' before 'private' https://ci.freebsd.org/job/FreeBSD-head-armv6-build/1090/consoleText = shows: (clang) --- all_subdir_cddl/usr.sbin --- In file included from /usr/src/cddl/usr.sbin/zfsd/case_file.cc:54: In file included from = /usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:45: In file included from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h:35= : In file included from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h:30= : In file included from = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h:37:= /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:72:47: = error: expected ')' const blkptr_t *bp, arc_buf_t *buf, void *private); ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:71:34: = note: to match this '(' typedef void arc_read_done_func_t(zio_t *zio, const zbookmark_phys_t = *zb, ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:73:70: = error: expected ')' typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void = *private); ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:73:35: = note: to match this '(' typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void = *private); ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:74:52: = error: expected ')' . . . typedef void arc_prune_func_t(int64_t bytes, void *private); ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:74:30: = note: to match this '(' typedef void arc_prune_func_t(int64_t bytes, void *private); ^ . . . = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:224:67: = error: expected ')' arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void = *private); ^ = /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:224:36: = note: to match this '(' arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void = *private); (Some builds are still in process.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Aug 11 21:10:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075491079F88; Sat, 11 Aug 2018 21:10:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A732191A59; Sat, 11 Aug 2018 21:10:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83B191C8E1; Sat, 11 Aug 2018 21:10:10 +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 w7BLAAwg065544; Sat, 11 Aug 2018 21:10:10 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BLA8qA065531; Sat, 11 Aug 2018 21:10:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808112110.w7BLA8qA065531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 11 Aug 2018 21:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337659 - in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Commit-Revision: 337659 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 21:10:11 -0000 Author: np Date: Sat Aug 11 21:10:08 2018 New Revision: 337659 URL: https://svnweb.freebsd.org/changeset/base/337659 Log: cxgbe(4): Move all control queues to the adapter. There used to be one control queue per adapter (the mgmtq) that was initialized during adapter init and one per port that was initialized later during port init. This change moves all the control queues (one per port/channel) to the adapter so that they are initialized during adapter init and are available before any port is up. This allows the driver to issue ctrlq work requests over any channel without having to bring up any port. MFH: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/t4_smt.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/adapter.h Sat Aug 11 21:10:08 2018 (r337659) @@ -100,7 +100,7 @@ enum { EQ_ESIZE = 64, /* Default queue sizes for all kinds of egress queues */ - CTRL_EQ_QSIZE = 128, + CTRL_EQ_QSIZE = 1024, TX_EQ_QSIZE = 1024, #if MJUMPAGESIZE != MCLBYTES @@ -738,7 +738,6 @@ struct sge { int neq; /* total # of egress queues */ struct sge_iq fwq; /* Firmware event queue */ - struct sge_wrq mgmtq; /* Management queue (control queue) */ struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ Modified: head/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cq.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/iw_cxgbe/cq.c Sat Aug 11 21:10:08 2018 (r337659) @@ -63,7 +63,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t struct wrqe *wr; wr_len = sizeof *res_wr + sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); res_wr = wrtod(wr); @@ -133,7 +133,7 @@ create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, /* build fw_ri_res_wr */ wr_len = sizeof *res_wr + sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); res_wr = wrtod(wr); Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Sat Aug 11 21:10:08 2018 (r337659) @@ -82,7 +82,7 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 wr_len = roundup(sizeof *ulpmc + sizeof *ulpsc + roundup(copy_len, T4_ULPTX_MIN_IO), 16); - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); ulpmc = wrtod(wr); Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Aug 11 21:10:08 2018 (r337659) @@ -236,7 +236,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4 /* build fw_ri_res_wr */ wr_len = sizeof *res_wr + 2 * sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) { ret = -ENOMEM; goto free_rq_dma; Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_filter.c Sat Aug 11 21:10:08 2018 (r337659) @@ -400,7 +400,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t len16 = howmany(sizeof(struct fw_filter2_wr), 16); else len16 = howmany(sizeof(struct fw_filter_wr), 16); - fwr = start_wrq_wr(&sc->sge.mgmtq, len16, &cookie); + fwr = start_wrq_wr(&sc->sge.ctrlq[0], len16, &cookie); if (__predict_false(fwr == NULL)) rc = ENOMEM; else { @@ -519,7 +519,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t fwr->newfport = htobe16(f->fs.nat_sport); fwr->natseqcheck = htobe32(f->fs.nat_seq_chk); } - commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], fwr, &cookie); /* Wait for response. */ mtx_lock(&sc->tids.ftid_lock); @@ -824,7 +824,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t goto done; } MPASS(f->tid == tid_base + t->idx); - fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), &cookie); + fwr = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*fwr), 16), &cookie); if (fwr == NULL) { rc = ENOMEM; goto done; @@ -833,7 +833,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t bzero(fwr, sizeof (*fwr)); t4_mk_filtdelwr(f->tid, fwr, sc->sge.fwq.abs_id); f->pending = 1; - commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], fwr, &cookie); t->fs = f->fs; /* extra info for the caller */ for (;;) { @@ -901,7 +901,7 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t struct wrq_cookie cookie; struct cpl_set_tcb_field *req; - req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), 16), &cookie); + req = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*req), 16), &cookie); if (req == NULL) return (ENOMEM); bzero(req, sizeof(*req)); @@ -914,7 +914,7 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(CPL_COOKIE_HASHFILTER)); req->mask = htobe64(mask); req->val = htobe64(val); - commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], req, &cookie); return (0); } @@ -1044,7 +1044,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r f->tid = act_open_rpl_status_to_errno(status); f->valid = 0; if (act_open_has_tid(status)) - release_tid(sc, GET_TID(cpl), &sc->sge.mgmtq); + release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); if (f->locked == 0) free(f, M_CXGBE); @@ -1081,7 +1081,7 @@ t4_hashfilter_tcb_rpl(struct sge_iq *iq, const struct f->valid = 0; free_filter_resources(f); remove_hftid(sc, tid, f->fs.type ? 2 : 1); - release_tid(sc, tid, &sc->sge.mgmtq); + release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); } @@ -1112,7 +1112,7 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct f->valid = 0; free_filter_resources(f); remove_hftid(sc, tid, f->fs.type ? 2 : 1); - release_tid(sc, tid, &sc->sge.mgmtq); + release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); } @@ -1374,7 +1374,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t } MPASS(atid >= 0); - wr = start_wrq_wr(&sc->sge.mgmtq, act_open_cpl_len16(sc, f->fs.type), + wr = start_wrq_wr(&sc->sge.ctrlq[0], act_open_cpl_len16(sc, f->fs.type), &cookie); if (wr == NULL) { free_atid(sc, atid); @@ -1394,7 +1394,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 1; /* ithread mustn't free f if ioctl is still around. */ f->pending = 1; f->tid = -1; - commit_wrq_wr(&sc->sge.mgmtq, wr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); for (;;) { MPASS(f->locked); @@ -1571,7 +1571,7 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t rc = EBUSY; goto done; } - wr = start_wrq_wr(&sc->sge.mgmtq, howmany(wrlen, 16), &cookie); + wr = start_wrq_wr(&sc->sge.ctrlq[0], howmany(wrlen, 16), &cookie); if (wr == NULL) { rc = ENOMEM; goto done; @@ -1580,7 +1580,7 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t mk_del_hashfilter_wr(t->idx, wr, wrlen, sc->sge.fwq.abs_id); f->locked = 1; f->pending = 1; - commit_wrq_wr(&sc->sge.mgmtq, wr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); t->fs = f->fs; /* extra info for the caller */ for (;;) { Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_l2t.c Sat Aug 11 21:10:08 2018 (r337659) @@ -182,7 +182,7 @@ t4_l2t_set_switching(struct adapter *sc, struct l2t_en e->vlan = vlan; e->lport = port; - e->wrq = &sc->sge.mgmtq; + e->wrq = &sc->sge.ctrlq[0]; e->iqid = sc->sge.fwq.abs_id; memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); mtx_lock(&e->lock); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_main.c Sat Aug 11 21:10:08 2018 (r337659) @@ -1052,7 +1052,7 @@ t4_attach(device_t dev) s->ntxq += nports * (num_vis - 1) * iaq.ntxq_vi; } s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ - s->neq += nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ + s->neq += nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ #if defined(TCP_OFFLOAD) || defined(RATELIMIT) if (is_offload(sc) || is_ethoffload(sc)) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 21:10:08 2018 (r337659) @@ -224,8 +224,8 @@ static void add_fl_sysctls(struct adapter *, struct sy struct sysctl_oid *, struct sge_fl *); static int alloc_fwq(struct adapter *); static int free_fwq(struct adapter *); -static int alloc_mgmtq(struct adapter *); -static int free_mgmtq(struct adapter *); +static int alloc_ctrlq(struct adapter *, struct sge_wrq *, int, + struct sysctl_oid *); static int alloc_rxq(struct vi_info *, struct sge_rxq *, int, int, struct sysctl_oid *); static int free_rxq(struct vi_info *, struct sge_rxq *); @@ -1009,7 +1009,8 @@ t4_destroy_dma_tag(struct adapter *sc) } /* - * Allocate and initialize the firmware event queue and the management queue. + * Allocate and initialize the firmware event queue, control queues, and special + * purpose rx queues owned by the adapter. * * Returns errno on failure. Resources allocated up to that point may still be * allocated. Caller is responsible for cleanup in case this function fails. @@ -1017,7 +1018,9 @@ t4_destroy_dma_tag(struct adapter *sc) int t4_setup_adapter_queues(struct adapter *sc) { - int rc; + struct sysctl_oid *oid; + struct sysctl_oid_list *children; + int rc, i; ADAPTER_LOCK_ASSERT_NOTOWNED(sc); @@ -1032,12 +1035,31 @@ t4_setup_adapter_queues(struct adapter *sc) return (rc); /* - * Management queue. This is just a control queue that uses the fwq as - * its associated iq. + * That's all for the VF driver. */ - if (!(sc->flags & IS_VF)) - rc = alloc_mgmtq(sc); + if (sc->flags & IS_VF) + return (rc); + oid = device_get_sysctl_tree(sc->dev); + children = SYSCTL_CHILDREN(oid); + + /* + * XXX: General purpose rx queues, one per port. + */ + + /* + * Control queues, one per port. + */ + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "ctrlq", + CTLFLAG_RD, NULL, "control queues"); + for_each_port(sc, i) { + struct sge_wrq *ctrlq = &sc->sge.ctrlq[i]; + + rc = alloc_ctrlq(sc, ctrlq, i, oid); + if (rc != 0) + return (rc); + } + return (rc); } @@ -1047,6 +1069,7 @@ t4_setup_adapter_queues(struct adapter *sc) int t4_teardown_adapter_queues(struct adapter *sc) { + int i; ADAPTER_LOCK_ASSERT_NOTOWNED(sc); @@ -1056,7 +1079,8 @@ t4_teardown_adapter_queues(struct adapter *sc) sc->flags &= ~ADAP_SYSCTL_CTX; } - free_mgmtq(sc); + for_each_port(sc, i) + free_wrq(sc, &sc->sge.ctrlq[i]); free_fwq(sc); return (0); @@ -1092,7 +1116,6 @@ t4_setup_vi_queues(struct vi_info *vi) int rc = 0, i, intr_idx, iqidx; struct sge_rxq *rxq; struct sge_txq *txq; - struct sge_wrq *ctrlq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; #endif @@ -1239,20 +1262,6 @@ t4_setup_vi_queues(struct vi_info *vi) goto done; } #endif - - /* - * Finally, the control queue. - */ - if (!IS_MAIN_VI(vi) || sc->flags & IS_VF) - goto done; - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD, - NULL, "ctrl queue"); - ctrlq = &sc->sge.ctrlq[pi->port_id]; - snprintf(name, sizeof(name), "%s ctrlq", device_get_nameunit(vi->dev)); - init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, pi->tx_chan, - sc->sge.rxq[vi->first_rxq].iq.cntxt_id, name); - rc = alloc_wrq(sc, vi, ctrlq, oid); - done: if (rc) t4_teardown_vi_queues(vi); @@ -1267,16 +1276,16 @@ int t4_teardown_vi_queues(struct vi_info *vi) { int i; - struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; struct sge_rxq *rxq; struct sge_txq *txq; -#ifdef TCP_OFFLOAD - struct sge_ofld_rxq *ofld_rxq; -#endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct port_info *pi = vi->pi; + struct adapter *sc = pi->adapter; struct sge_wrq *ofld_txq; #endif +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif #ifdef DEV_NETMAP struct sge_nm_rxq *nm_rxq; struct sge_nm_txq *nm_txq; @@ -1305,9 +1314,6 @@ t4_teardown_vi_queues(struct vi_info *vi) * (for egress updates, etc.). */ - if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF)) - free_wrq(sc, &sc->sge.ctrlq[pi->port_id]); - for_each_txq(vi, i, txq) { free_txq(vi, txq); } @@ -3257,35 +3263,25 @@ free_fwq(struct adapter *sc) } static int -alloc_mgmtq(struct adapter *sc) +alloc_ctrlq(struct adapter *sc, struct sge_wrq *ctrlq, int idx, + struct sysctl_oid *oid) { int rc; - struct sge_wrq *mgmtq = &sc->sge.mgmtq; char name[16]; - struct sysctl_oid *oid = device_get_sysctl_tree(sc->dev); - struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); + struct sysctl_oid_list *children; - oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "mgmtq", CTLFLAG_RD, - NULL, "management queue"); - - snprintf(name, sizeof(name), "%s mgmtq", device_get_nameunit(sc->dev)); - init_eq(sc, &mgmtq->eq, EQ_CTRL, CTRL_EQ_QSIZE, sc->port[0]->tx_chan, + snprintf(name, sizeof(name), "%s ctrlq%d", device_get_nameunit(sc->dev), + idx); + init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, sc->port[idx]->tx_chan, sc->sge.fwq.cntxt_id, name); - rc = alloc_wrq(sc, NULL, mgmtq, oid); - if (rc != 0) { - device_printf(sc->dev, - "failed to create management queue: %d\n", rc); - return (rc); - } - return (0); -} + children = SYSCTL_CHILDREN(oid); + snprintf(name, sizeof(name), "%d", idx); + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, name, CTLFLAG_RD, + NULL, "ctrl queue"); + rc = alloc_wrq(sc, NULL, ctrlq, oid); -static int -free_mgmtq(struct adapter *sc) -{ - - return free_wrq(sc, &sc->sge.mgmtq); + return (rc); } int Modified: head/sys/dev/cxgbe/t4_smt.c ============================================================================== --- head/sys/dev/cxgbe/t4_smt.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_smt.c Sat Aug 11 21:10:08 2018 (r337659) @@ -210,7 +210,7 @@ t4_smt_set_switching(struct adapter *sc, struct smt_en if (atomic_load_acq_int(&e->refcnt) == 1) { /* Setup the entry for the first time */ mtx_lock(&e->lock); - e->wrq = &sc->sge.mgmtq; + e->wrq = &sc->sge.ctrlq[0]; e->iqid = sc->sge.fwq.abs_id; e->pfvf = pfvf; e->state = SMT_STATE_SWITCHING; Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Sat Aug 11 20:49:19 2018 (r337658) +++ head/sys/dev/cxgbe/t4_vf.c Sat Aug 11 21:10:08 2018 (r337659) @@ -662,7 +662,7 @@ t4vf_attach(device_t dev) s->nrxq = sc->params.nports * iaq.nrxq; s->ntxq = sc->params.nports * iaq.ntxq; 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 */ + s->neq += sc->params.nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, From owner-svn-src-head@freebsd.org Sat Aug 11 22:01:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10CC3107B228; Sat, 11 Aug 2018 22:01:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA9E59319D; Sat, 11 Aug 2018 22:01:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C4D01D17D; Sat, 11 Aug 2018 22:01:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BM1qSv092728; Sat, 11 Aug 2018 22:01:52 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BM1qqA092727; Sat, 11 Aug 2018 22:01:52 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808112201.w7BM1qqA092727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 11 Aug 2018 22:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337660 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337660 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 22:01:53 -0000 Author: mmacy Date: Sat Aug 11 22:01:52 2018 New Revision: 337660 URL: https://svnweb.freebsd.org/changeset/base/337660 Log: Enable balanced arc pruning Taken from: ommit f6046738365571bd647f804958dfdff8a32fbde4 Author: Brian Behlendorf Date: Sat May 30 09:57:53 2015 -0500 Make arc_prune() asynchronous As described in the comment above arc_adapt_thread() it is critical that the arc_adapt_thread() function never sleep while holding a hash lock. This behavior was possible in the Linux implementation because the arc_prune() logic was implemented to be synchronous. Under illumos the analogous dnlc_reduce_cache() function is asynchronous. To address this the arc_do_user_prune() function is has been reworked in to two new functions as follows: * arc_prune_async() is an asynchronous implementation which dispatches the prune callback to be run by the system taskq. This makes it suitable to use in the context of the arc_adapt_thread(). * arc_prune() is a synchronous implementation which depends on the arc_prune_async() implementation but blocks until the outstanding callbacks complete. This is used in arc_kmem_reap_now() where it is safe, and expected, that memory will be freed. This patch additionally adds the zfs_arc_meta_strategy module option while allows the meta reclaim strategy to be configured. It defaults to a balanced strategy which has been proved to work well under Linux but the illumos meta-only strategy can be enabled. Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 11 21:10:08 2018 (r337659) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 11 22:01:52 2018 (r337660) @@ -525,6 +525,14 @@ typedef struct arc_state { refcount_t arcs_size; } arc_state_t; +/* + * Percentage that can be consumed by dnodes of ARC meta buffers. + */ +int zfs_arc_meta_prune = 10000; +unsigned long zfs_arc_dnode_limit_percent = 10; +int zfs_arc_meta_strategy = ARC_STRATEGY_META_BALANCED; +int zfs_arc_meta_adjust_restarts = 4096; + /* The 6 states: */ static arc_state_t ARC_anon; static arc_state_t ARC_mru; @@ -4076,11 +4084,114 @@ arc_adjust_impl(arc_state_t *state, uint64_t spa, int6 } /* + * The goal of this function is to evict enough meta data buffers from the + * ARC in order to enforce the arc_meta_limit. Achieving this is slightly + * more complicated than it appears because it is common for data buffers + * to have holds on meta data buffers. In addition, dnode meta data buffers + * will be held by the dnodes in the block preventing them from being freed. + * This means we can't simply traverse the ARC and expect to always find + * enough unheld meta data buffer to release. + * + * Therefore, this function has been updated to make alternating passes + * over the ARC releasing data buffers and then newly unheld meta data + * buffers. This ensures forward progress is maintained and meta_used + * will decrease. Normally this is sufficient, but if required the ARC + * will call the registered prune callbacks causing dentry and inodes to + * be dropped from the VFS cache. This will make dnode meta data buffers + * available for reclaim. + */ +static uint64_t +arc_adjust_meta_balanced(uint64_t meta_used) +{ + int64_t delta, prune = 0, adjustmnt; + uint64_t total_evicted = 0; + arc_buf_contents_t type = ARC_BUFC_DATA; + int restarts = MAX(zfs_arc_meta_adjust_restarts, 0); + +restart: + /* + * This slightly differs than the way we evict from the mru in + * arc_adjust because we don't have a "target" value (i.e. no + * "meta" arc_p). As a result, I think we can completely + * cannibalize the metadata in the MRU before we evict the + * metadata from the MFU. I think we probably need to implement a + * "metadata arc_p" value to do this properly. + */ + adjustmnt = meta_used - arc_meta_limit; + + if (adjustmnt > 0 && refcount_count(&arc_mru->arcs_esize[type]) > 0) { + delta = MIN(refcount_count(&arc_mru->arcs_esize[type]), + adjustmnt); + total_evicted += arc_adjust_impl(arc_mru, 0, delta, type); + adjustmnt -= delta; + } + + /* + * We can't afford to recalculate adjustmnt here. If we do, + * new metadata buffers can sneak into the MRU or ANON lists, + * thus penalize the MFU metadata. Although the fudge factor is + * small, it has been empirically shown to be significant for + * certain workloads (e.g. creating many empty directories). As + * such, we use the original calculation for adjustmnt, and + * simply decrement the amount of data evicted from the MRU. + */ + + if (adjustmnt > 0 && refcount_count(&arc_mfu->arcs_esize[type]) > 0) { + delta = MIN(refcount_count(&arc_mfu->arcs_esize[type]), + adjustmnt); + total_evicted += arc_adjust_impl(arc_mfu, 0, delta, type); + } + + adjustmnt = meta_used - arc_meta_limit; + + if (adjustmnt > 0 && + refcount_count(&arc_mru_ghost->arcs_esize[type]) > 0) { + delta = MIN(adjustmnt, + refcount_count(&arc_mru_ghost->arcs_esize[type])); + total_evicted += arc_adjust_impl(arc_mru_ghost, 0, delta, type); + adjustmnt -= delta; + } + + if (adjustmnt > 0 && + refcount_count(&arc_mfu_ghost->arcs_esize[type]) > 0) { + delta = MIN(adjustmnt, + refcount_count(&arc_mfu_ghost->arcs_esize[type])); + total_evicted += arc_adjust_impl(arc_mfu_ghost, 0, delta, type); + } + + /* + * If after attempting to make the requested adjustment to the ARC + * the meta limit is still being exceeded then request that the + * higher layers drop some cached objects which have holds on ARC + * meta buffers. Requests to the upper layers will be made with + * increasingly large scan sizes until the ARC is below the limit. + */ + if (meta_used > arc_meta_limit) { + if (type == ARC_BUFC_DATA) { + type = ARC_BUFC_METADATA; + } else { + type = ARC_BUFC_DATA; + + if (zfs_arc_meta_prune) { + prune += zfs_arc_meta_prune; + arc_prune_async(prune); + } + } + + if (restarts > 0) { + restarts--; + goto restart; + } + } + return (total_evicted); +} + +/* * Evict metadata buffers from the cache, such that arc_meta_used is * capped by the arc_meta_limit tunable. */ static uint64_t -arc_adjust_meta(uint64_t meta_used) +arc_adjust_meta_only(uint64_t meta_used) { uint64_t total_evicted = 0; int64_t target; @@ -4110,6 +4221,15 @@ arc_adjust_meta(uint64_t meta_used) total_evicted += arc_adjust_impl(arc_mfu, 0, target, ARC_BUFC_METADATA); return (total_evicted); +} + +static uint64_t +arc_adjust_meta(uint64_t meta_used) +{ + if (zfs_arc_meta_strategy == ARC_STRATEGY_META_ONLY) + return (arc_adjust_meta_only(meta_used)); + else + return (arc_adjust_meta_balanced(meta_used)); } /* From owner-svn-src-head@freebsd.org Sat Aug 11 22:11:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A19107B35B; Sat, 11 Aug 2018 22:11:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 567DC9343B; Sat, 11 Aug 2018 22:11:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38A8F1D2EE; Sat, 11 Aug 2018 22:11:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BMBDpN098293; Sat, 11 Aug 2018 22:11:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BMBDjT098292; Sat, 11 Aug 2018 22:11:13 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808112211.w7BMBDjT098292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 11 Aug 2018 22:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337661 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 337661 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 22:11:13 -0000 Author: mmacy Date: Sat Aug 11 22:11:12 2018 New Revision: 337661 URL: https://svnweb.freebsd.org/changeset/base/337661 Log: fix top after arc accounting change Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Aug 11 22:01:52 2018 (r337660) +++ head/usr.bin/top/machine.c Sat Aug 11 22:11:12 2018 (r337661) @@ -522,8 +522,12 @@ get_system_info(struct system_info *si) GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc_stat2); arc_stats[4] = (arc_stat + arc_stat2) >> 10; - GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); + GETSYSCTL("kstat.zfs.misc.arcstats.bonus_size", arc_stat); arc_stats[5] = arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.dnode_size", arc_stat); + arc_stats[5] += arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); + arc_stats[5] += arc_stat >> 10; si->arc = arc_stats; } if (carc_enabled) { From owner-svn-src-head@freebsd.org Sat Aug 11 22:25:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6CB4107B814 for ; Sat, 11 Aug 2018 22:25:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic316-14.consmr.mail.bf2.yahoo.com (sonic316-14.consmr.mail.bf2.yahoo.com [74.6.130.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43C5593B77 for ; Sat, 11 Aug 2018 22:25:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1534026297; bh=Q5P4YW6L0Y4P0GLcto4+N0Ow/QCgnHlMHxEuEyePzoQ=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=PyPNFNUCRIJ0u2kVJn244SD0RUoJ/47ATg+N+9dNaa8LoEbx7totsbiEvOe5ozjyleSWXECfQo9kvX+gfScD/0iO4CFXaJ/fZeXMvEC2bMEB/960EEbP0lgmctPbb4GUIFOUg2fNSGS/PFKjSjjWB/nl7Fj+QZcAOde6zXt0umSbhXjHbNKsuyOv5wDcNzkAIoLOV1G0EPfzqPgHNkNpxXtYaTIgrAeEV0Jdaum869uo/XdbLSteVmMPVwc4DRnfkmX3ee+x7//+knphddr5hBeKrOiz3Gv7gQsmBDj3ed3U703doA6Cxdj3oq85fnXs6DWhJ8wJQNNIW4VgyHZn4A== X-YMail-OSG: .Aewo0IVM1lB4flzbuStYJXkEyOLn2KNf5flleksN9Vx_USOSPZC7ujyn7uhAaB GlBEPiRqoRU0obOkXPT2lgwukfdBh0cBUJpYQiHlnHOxUkzB.hLdyh7lLyuGy9h3AnzHcuJglx3P ypiCO8LkRn.XnUr7l5xyi4sLCcpPlbqCgoiyecPX3oFp4HXMCfd9VMR9D81TaYF.dzke46eQvT1d QQg7jleAE_1LQuOwZdKTDZ8ek1g7a.eBmjj6TTNo7KkgD1LBFgwYyDonEwR5REjgAX8wWX.gATbG droZ3rL2xHjPKos1AswTAE8VJpprD3D9bxQmU1RdP42FqgoBeJy6o46WE5qr6yJdAS932xHwlAFU kHELL_ZCgCsJACTyQgDIpienur3YckUwrFz6leDnrsBUW_Cc1Li0dC8tNF9rWOF8rnGsJrawo95q dD_iyxPPunOUOKNhIBOWQhQWWn0LH1d7ZSTXzXxG6MGxdnRSBlomrwdkzDTo6vGCo31e1I_eIkY1 YvW0L2GdUesnMw2xtFVVcU3eBzQBOjBBDReWbu2Y.65Ww_q.ZV319_VR0khaOPuPzzhpnzCAB3wH FIASqjeeKHnGmjN.9wp9H_0.E6lbo9PEaxJNrIQO5Vv1VyIFoj3fzq6X4vXtoGGxhMWFdL6ZReME gDCSHpCJMKMjIcox0vVNbwi48QJH82Auf8rC7Q3emvWqozR01HhxUT30wNw1o6oZd00I5KyTGgYp 6CjNIHoRdFKdHtCsAyGbgbmrXIxjEK9GPWyxhSyXomfwIVhjnWdqyGTPHe_i7DVmWOdyuFmZY1Y3 aBJWvhPeFa9xbOY9MULY9EJBYoP.ponv5WCbQ5ENuGAKlbhjz7hzZBrVcz6a8Zj5NPeEym0mL24i Ryj7FGJzUCNCpX_q50y1GyNWj8EyplifRyoy4TbdacmFrRZ6XfGkakxxea.vYoEG_AMjkMktfeQ2 TaQBSuBOABGnplqQzUOmUpAsXcpg8opHI0ir5WBy44uTtM.DTleUW8.L6 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Sat, 11 Aug 2018 22:24:57 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.2]) ([181.52.72.201]) by smtp408.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID b33bb553079d60f29c2954792639d9a5; Sat, 11 Aug 2018 22:24:56 +0000 (UTC) Subject: Re: svn commit: r337618 - head/usr.bin/printf To: Jilles Tjoelker , svn-src-head@freebsd.org References: <201808111113.w7BBDYTM053399@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sat, 11 Aug 2018 17:24:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808111113.w7BBDYTM053399@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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, 11 Aug 2018 22:25:03 -0000 Duh! On 08/11/18 06:13, Jilles Tjoelker wrote: > Author: jilles > Date: Sat Aug 11 11:13:34 2018 > New Revision: 337618 > URL: https://svnweb.freebsd.org/changeset/base/337618 > > Log: > printf: Fix \c in %b in printf builtin exiting the shell after r337458 > > SVN r337458 erroneously partially reverted r265885. > > This is immediately visible when running the Kyua/ATF tests for > usr.bin/printf, which actually test sh's printf builtin. > > PR: 229641 > > Modified: > head/usr.bin/printf/printf.c > > Modified: head/usr.bin/printf/printf.c > ============================================================================== > --- head/usr.bin/printf/printf.c Sat Aug 11 11:05:22 2018 (r337617) > +++ head/usr.bin/printf/printf.c Sat Aug 11 11:13:34 2018 (r337618) > @@ -388,7 +388,7 @@ printf_doformat(char *fmt, int *rval) > > free(p); > if (getout) > - exit(*rval); > + return (end_fmt); > break; > } > case 'c': { > Thanks for fixing this! I recall it's the second time I (inadvertently) commit this bug. So great to have a corresponding test! Pedro. From owner-svn-src-head@freebsd.org Sat Aug 11 23:50:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 806AB10563E6; Sat, 11 Aug 2018 23:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E13495ACC; Sat, 11 Aug 2018 23:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A5A1E2B5; Sat, 11 Aug 2018 23:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BNoA1f047132; Sat, 11 Aug 2018 23:50:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BNo9t8047126; Sat, 11 Aug 2018 23:50:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808112350.w7BNo9t8047126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 23:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk X-SVN-Commit-Revision: 337663 X-SVN-Commit-Repository: base 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.27 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, 11 Aug 2018 23:50:11 -0000 Author: kevans Date: Sat Aug 11 23:50:09 2018 New Revision: 337663 URL: https://svnweb.freebsd.org/changeset/base/337663 Log: Merge libbe(3)/bectl(8) from projects/bectl into head bectl(8) is an administrative interface for working with ZFS boot environments, intended to provide a superset of the functionality provided by sysutils/beadm. libbe(3) is the back-end library that the required functionality has been pulled out into for later reuse. These were originally written for GSoC 2017 under the mentorship of allanjude@. bectl(8) has proven pretty stable in my testing, with the known bug documented in the man page. Relnotes: yes Added: head/cddl/lib/libbe/ - copied from r337662, projects/bectl/cddl/lib/libbe/ head/lib/libbe/ - copied from r337662, projects/bectl/lib/libbe/ head/sbin/bectl/ - copied from r337662, projects/bectl/sbin/bectl/ Modified: head/Makefile.inc1 head/cddl/lib/Makefile head/contrib/mdocml/lib.in head/sbin/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Directory Properties: head/ (props changed) head/cddl/ (props changed) head/contrib/mdocml/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Aug 11 22:45:39 2018 (r337662) +++ head/Makefile.inc1 Sat Aug 11 23:50:09 2018 (r337663) @@ -2524,7 +2524,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ ${_cddl_lib_libuutil} \ ${_cddl_lib_libavl} \ - ${_cddl_lib_libzfs_core} \ + ${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \ ${_cddl_lib_libctf} \ lib/libufs \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ @@ -2597,7 +2597,15 @@ _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil .if ${MK_ZFS} != "no" _cddl_lib_libzfs_core= cddl/lib/libzfs_core +_cddl_lib_libzfs= cddl/lib/libzfs + cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L + +cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__L lib/libutil__L +cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L +cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L + +cddl/lib/libbe__L: cddl/lib/libzfs__L .endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Sat Aug 11 22:45:39 2018 (r337662) +++ head/cddl/lib/Makefile Sat Aug 11 23:50:09 2018 (r337663) @@ -4,6 +4,7 @@ SUBDIR= ${_drti} \ libavl \ + ${_libbe} \ libctf \ ${_libdtrace} \ libnvpair \ @@ -16,6 +17,7 @@ SUBDIR= ${_drti} \ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" +_libbe= libbe _libzfs_core= libzfs_core _libzfs= libzfs .if ${MK_LIBTHR} != "no" @@ -28,6 +30,7 @@ _drti= drti _libdtrace= libdtrace .endif +SUBDIR_DEPEND_libbe= libnvpair libzfs SUBDIR_DEPEND_libdtrace= libctf SUBDIR_DEPEND_libzfs_core= libnvpair SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Sat Aug 11 22:45:39 2018 (r337662) +++ head/contrib/mdocml/lib.in Sat Aug 11 23:50:09 2018 (r337663) @@ -28,6 +28,7 @@ LINE("lib80211", "802.11 Wireless Network Management L LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +LINE("libbe", "Boot Environment Library (libbe, \\-lbe)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") LINE("libc", "Standard C\\~Library (libc, \\-lc)") Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Sat Aug 11 22:45:39 2018 (r337662) +++ head/sbin/Makefile Sat Aug 11 23:50:09 2018 (r337663) @@ -86,6 +86,7 @@ SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd SUBDIR.${MK_QUOTAS}+= quotacheck SUBDIR.${MK_ROUTED}+= routed +SUBDIR.${MK_ZFS}+= bectl SUBDIR.${MK_ZFS}+= zfsbootcfg SUBDIR.${MK_TESTS}+= tests Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Aug 11 22:45:39 2018 (r337662) +++ head/share/mk/bsd.libnames.mk Sat Aug 11 23:50:09 2018 (r337663) @@ -23,6 +23,7 @@ LIBASN1?= ${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a LIBATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libatm.a LIBAUDITD?= ${LIBDESTDIR}${LIBDIR_BASE}/libauditd.a LIBAVL?= ${LIBDESTDIR}${LIBDIR_BASE}/libavl.a +LIBBE?= ${LIBDESTDIR}${LIBDIR_BASE}/libbe.a LIBBEGEMOT?= ${LIBDESTDIR}${LIBDIR_BASE}/libbegemot.a LIBBLACKLIST?= ${LIBDESTDIR}${LIBDIR_BASE}/libblacklist.a LIBBLUETOOTH?= ${LIBDESTDIR}${LIBDIR_BASE}/libbluetooth.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Aug 11 22:45:39 2018 (r337662) +++ head/share/mk/src.libnames.mk Sat Aug 11 23:50:09 2018 (r337663) @@ -62,6 +62,7 @@ _LIBRARIES= \ asn1 \ auditd \ avl \ + be \ begemot \ bluetooth \ bsdxml \ @@ -335,6 +336,7 @@ _DP_zfs= md pthread umem util uutil m nvpair avl bsdxm zfs_core _DP_zfs_core= nvpair _DP_zpool= md pthread z nvpair avl umem +_DP_be= zfs nvpair # OFED support .if ${MK_OFED} != "no" @@ -472,6 +474,8 @@ LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu.a +LIBBE?= ${LIBBEDIR}/libbe.a + LIBPMCSTATDIR= ${OBJTOP}/lib/libpmcstat LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat.a @@ -482,6 +486,7 @@ LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. LIBAVLDIR= ${OBJTOP}/cddl/lib/libavl +LIBBEDIR= ${OBJTOP}/cddl/lib/libbe LIBCTFDIR= ${OBJTOP}/cddl/lib/libctf LIBDTRACEDIR= ${OBJTOP}/cddl/lib/libdtrace LIBNVPAIRDIR= ${OBJTOP}/cddl/lib/libnvpair