From owner-svn-src-head@freebsd.org Sun Dec 16 00:54: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 3F27913347AA; Sun, 16 Dec 2018 00:54:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 560538E871; Sun, 16 Dec 2018 00:54:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YKgsg3g2e8uQmYKgugdLyc; Sat, 15 Dec 2018 17:53:58 -0700 X-Authority-Analysis: v=2.3 cv=XKpOtjpE c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=2ur7OfE09M0A:10 a=H0GPC0OhAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=macyKqCroWbngV_CoWYA:9 a=CjuIK1q_8ugA:10 a=KczGKrPSgCPlefTG41c3:22 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 399F6145; Sat, 15 Dec 2018 16:53:54 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wBG0rrEF073305; Sat, 15 Dec 2018 16:53:53 -0800 (PST) (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 wBG0rqRB073302; Sat, 15 Dec 2018 16:53:53 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201812160053.wBG0rqRB073302@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: Eugene Grosbein cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342139 - in head: . bin/date libexec/rc/rc.d share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/timed In-Reply-To: Message from Eugene Grosbein of "Sun, 16 Dec 2018 06:28:39 +0700." <7a528b98-f554-4d34-a5cb-aa5496a89f3e@grosbein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 15 Dec 2018 16:53:52 -0800 X-CMAE-Envelope: MS4wfDOQDJ2OiB/yqE+2yfzLXvErtTKSRybWXuYyVtBZu/q8I2K0T/YFgOzB80l7qvJQ3/mwTnLVxdSx44IcQm+5GY+tvhGdVyJjrRerBLMGTEQUKTiBmvkp HclvTXmG2guY5hjtFFI/eLbUCGRk4AHEHHpYORDevpm6MFIaZPO6uOd9ubud1DRl+N+Z9odL9LdAQWuDNMvyzgH0blm7pqGcJ2mFtpiv/nYpRqR+aVhpNnAH QOzfHY60lhwXtApxNmu/Mq/uSsi7kARP5LGmTXlkPpM1ae/jbq2t5lhNcw0uwCSTHIwHAP0s3JQjAIk/P6Oq4g== X-Rspamd-Queue-Id: 560538E871 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.69)[-0.690,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.31)[ip: (-6.31), ipnet: 64.59.128.0/20(-2.85), asn: 6327(-2.28), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 00:54:08 -0000 In message <7a528b98-f554-4d34-a5cb-aa5496a89f3e@grosbein.net>, Eugene Grosbein writes: > 16.12.2018 4:34, George V. Neville-Neil wrote: > > > Author: gnn > > Date: Sat Dec 15 21:34:40 2018 > > New Revision: 342139 > > URL: https://svnweb.freebsd.org/changeset/base/342139 > > > > Log: > > Remove, the now very outdated, timed. > > > +20181211: > > + Remove the timed and netdate programs from the base tree. Setting > > + the time with these deamons has been obsolete for over a decade. > > + > > Is there any replacement software arounnd for timed protocol? > > I still run some telco hardware that uses my FreeBSD/timed as time source > because it cannot use any other protocol, not NTP nor SNTP. > > Maybe someone could add it to ports. Ideally maintaining upstream on github. My initial thought was we could port the NetBSD version but theirs is arguably just as ancient as ours. On a juxtaposed topic, how would one export an eclectic set of directories from svn to git? My last experience doing that was painful because there was more than one subdirectory involved and most of the doc out there talks about only one. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Dec 16 01:36: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 0BF451337148 for ; Sun, 16 Dec 2018 01:36:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 3B84A6A3E6 for ; Sun, 16 Dec 2018 01:36:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72f.google.com with SMTP id g125so5280863qke.4 for ; Sat, 15 Dec 2018 17:36:21 -0800 (PST) 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=b6w6ozvrtdkt2Yyjtrqp+MvDiRoXgQBXxKiRvwuwBrU=; b=ub/NxqEI8RqogMyEof2OHWWPSQHFwj0Ogax4TrZoIa6chlAD8EAJkOkWop1uTuHUzh RrLxjh/fNwSLaNiWZrLm1fim147o/g85Lcpd1R3IfsmJEbSmENJhKILqrF7D11FP2XbD 4k2qr5EJIOES4D4CXAgT8V6ATZ2TiWtTu9JjLNk9i0NxpevtmPliXkQVaCZt2p+qaUhP 5I5KYF4KFthncjbBFRUHC6Hb3lTnIQ0vFIsafL/wTloBrfkd0R61zwpZ8vqFVezJTz3x h+pthANo3Pvn0SNMX1OHBjMqtBtLqBei2azD0Gf90LW/pCvLTPJsgzxRg75DwnZVHa3w mJ6Q== 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=b6w6ozvrtdkt2Yyjtrqp+MvDiRoXgQBXxKiRvwuwBrU=; b=KLlXAJqfwilAOh6D4uTzPWkUTSn8k41Oqp6xLvW5QZ+Hayt9A3hkuwWPLA0CjSIUb1 tRNJ3nl6CL2XxK3kU+Qu3u1h1p4H9MdKn3QFTIWa5Ed2QVgyq5aJfmUx5yqQ6I83aec+ SJ5vk3KPIfqW32D69MKuOQYbozASpJryQduDZ0nyi0Tlpo41PR4FppNGIOCUsiFH6Cg4 aUJQG7UGW58ZUxjFAkI1lIkfAX6ivT/kan8R41p+YhHVXuIorxqW+/rBQIfOEvORnJbe xOF1w5rbh/JiYUygV1oFvRH0BevItzFDWHjRhGw9NgXSsjxZQ6o4r6CrjvOA8yJtLkaA bSmw== X-Gm-Message-State: AA+aEWYCizcJF0Jfc9Govmp5iCeUxtLVM2OcNJ3qHUO9nDASzvtDOEJr O5mB3h9XMvURb85NLN2sl8QCmfEPirusW/8PGCfsYUAb X-Google-Smtp-Source: AFSGD/WP+RRx2aNIGdZh8jA4kxGk85PUq/wROIMGfCEH1O9OStr8uixNBb1Kxgbv42tTCjojW7RxjDhaosoQpeDAo1g= X-Received: by 2002:a37:6e86:: with SMTP id j128mr8158343qkc.46.1544924180549; Sat, 15 Dec 2018 17:36:20 -0800 (PST) MIME-Version: 1.0 References: <7a528b98-f554-4d34-a5cb-aa5496a89f3e@grosbein.net> <201812160053.wBG0rqRB073302@slippy.cwsent.com> In-Reply-To: <201812160053.wBG0rqRB073302@slippy.cwsent.com> From: Warner Losh Date: Sat, 15 Dec 2018 18:36:08 -0700 Message-ID: Subject: Re: svn commit: r342139 - in head: . bin/date libexec/rc/rc.d share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/timed To: Cy Schubert Cc: Eugene Grosbein , George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 3B84A6A3E6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 01:36:22 -0000 On Sat, Dec 15, 2018, 5:54 PM Cy Schubert In message <7a528b98-f554-4d34-a5cb-aa5496a89f3e@grosbein.net>, Eugene > Grosbein > writes: > > 16.12.2018 4:34, George V. Neville-Neil wrote: > > > > > Author: gnn > > > Date: Sat Dec 15 21:34:40 2018 > > > New Revision: 342139 > > > URL: https://svnweb.freebsd.org/changeset/base/342139 > > > > > > Log: > > > Remove, the now very outdated, timed. > > > > > +20181211: > > > + Remove the timed and netdate programs from the base tree. Setting > > > + the time with these deamons has been obsolete for over a decade. > > > + > > > > Is there any replacement software arounnd for timed protocol? > > > > I still run some telco hardware that uses my FreeBSD/timed as time source > > because it cannot use any other protocol, not NTP nor SNTP. > > > > > > Maybe someone could add it to ports. Ideally maintaining upstream on > github. > > My initial thought was we could port the NetBSD version but theirs is > arguably just as ancient as ours. > > On a juxtaposed topic, how would one export an eclectic set of > directories from svn to git? My last experience doing that was painful > because there was more than one subdirectory involved and most of the > doc out there talks about only one. > I did it for CTM. If people want, I can do it for this too... But CTM was only one dir... Warner > From owner-svn-src-head@freebsd.org Sun Dec 16 02:11: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 0E069133854B; Sun, 16 Dec 2018 02:11:44 +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 05BAA6B5E4; Sun, 16 Dec 2018 02:11:42 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YLtzg1qKu82YcYLu0gQn47; Sat, 15 Dec 2018 19:11:35 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=2ur7OfE09M0A:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=H0GPC0OhAAAA:8 a=6I5d2MoRAAAA:8 a=mo54iWl955AUacO25OsA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=KczGKrPSgCPlefTG41c3:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5262F5D3; Sat, 15 Dec 2018 18:11:30 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wBG2BTXa070043; Sat, 15 Dec 2018 18:11:29 -0800 (PST) (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 wBG2BRwN070040; Sat, 15 Dec 2018 18:11:27 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201812160211.wBG2BRwN070040@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: Warner Losh cc: Cy Schubert , Eugene Grosbein , George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342139 - in head: . bin/date libexec/rc/rc.d share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/timed In-Reply-To: Message from Warner Losh of "Sat, 15 Dec 2018 18:36:08 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 15 Dec 2018 18:11:27 -0800 X-CMAE-Envelope: MS4wfO8fTK4f3iDlwYvVjuAUVBzwYdE07bB08C3/VRGtwZo03yx+qp37e3nyOJpQAg4ZM5krug+dteGZZMQCHsnBMU7VT1fzLrvWqZoOTIz11LRcZHdSLIQW QTmyh8UzpK//C/59KXtq11vLlItYJe86xyFmiuIQt9JcQWZVuiuxc76fMGvVoThzi28zCdEkYPrNijOnLTIbd0R9OoTPPvxQb0PVN2lkmkwCpemzKB14oO2W r8xfBYaw1QgfKTkIf4HCTM81WjMh72GVDBS2ZkjintZfSyTZe4DXdsZ/LRFx6cwDfHc2qPA97MhhrxKuNOG7u72kTuN98UTr8tLREyeB2UA= X-Rspamd-Queue-Id: 05BAA6B5E4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.27 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-1.99)[ip: (-4.75), ipnet: 64.59.128.0/20(-2.83), asn: 6327(-2.26), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.58)[-0.575,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 02:11:44 -0000 In message , Warner Losh writes: > --000000000000fca822057d19b03f > Content-Type: text/plain; charset="UTF-8" > > On Sat, Dec 15, 2018, 5:54 PM Cy Schubert > > In message <7a528b98-f554-4d34-a5cb-aa5496a89f3e@grosbein.net>, Eugene > > Grosbein > > writes: > > > 16.12.2018 4:34, George V. Neville-Neil wrote: > > > > > > > Author: gnn > > > > Date: Sat Dec 15 21:34:40 2018 > > > > New Revision: 342139 > > > > URL: https://svnweb.freebsd.org/changeset/base/342139 > > > > > > > > Log: > > > > Remove, the now very outdated, timed. > > > > > > > +20181211: > > > > + Remove the timed and netdate programs from the base tree. Setting > > > > + the time with these deamons has been obsolete for over a decade. > > > > + > > > > > > Is there any replacement software arounnd for timed protocol? > > > > > > I still run some telco hardware that uses my FreeBSD/timed as time source > > > because it cannot use any other protocol, not NTP nor SNTP. > > > > > > > > > > Maybe someone could add it to ports. Ideally maintaining upstream on > > github. > > > > My initial thought was we could port the NetBSD version but theirs is > > arguably just as ancient as ours. > > > > On a juxtaposed topic, how would one export an eclectic set of > > directories from svn to git? My last experience doing that was painful > > because there was more than one subdirectory involved and most of the > > doc out there talks about only one. > > > > I did it for CTM. If people want, I can do it for this too... But CTM was > only one dir... > > Warner Personally, I'm less interested in timed and more interested in how to. Last time I tried it the first directory was easy. Adding the second subtree was the hard part. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Dec 16 01:51: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 71DD51337D7C; Sun, 16 Dec 2018 01:51:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD09E6ACCB; Sun, 16 Dec 2018 01:51:38 +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 AFE512074E; Sun, 16 Dec 2018 01:51:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBG1pcLH006615; Sun, 16 Dec 2018 01:51:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG1pcOV006614; Sun, 16 Dec 2018 01:51:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160151.wBG1pcOV006614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 01:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342144 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 342144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD09E6ACCB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.88)[-0.883,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 01:51:39 -0000 Author: kib Date: Sun Dec 16 01:51:38 2018 New Revision: 342144 URL: https://svnweb.freebsd.org/changeset/base/342144 Log: Document new required MI behaviour of pmap_enter(9) for CoW. Reviewed by: markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18568 Modified: head/share/man/man9/pmap_enter.9 Modified: head/share/man/man9/pmap_enter.9 ============================================================================== --- head/share/man/man9/pmap_enter.9 Sun Dec 16 01:19:10 2018 (r342143) +++ head/share/man/man9/pmap_enter.9 Sun Dec 16 01:51:38 2018 (r342144) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2018 +.Dd December 16, 2018 .Dt PMAP_ENTER 9 .Os .Sh NAME @@ -119,6 +119,14 @@ It is advised to clear for destroyed mappings if the implementation can ensure that no other writeable managed mappings for the previously mapped pages exist. +.Pp +If the request modifies an existing mapping to use a different physical +page, an implementation of +.Nm +must invalidate the previous mapping before installing the new one. +This ensures that all threads sharing the pmap keep a consistent +view of the mapping, which is necessary for the correct handling +of CoW (copy on write) faults. .Pp If the page .Fa m From owner-svn-src-head@freebsd.org Sun Dec 16 04:06: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 BB034133B8F0; Sun, 16 Dec 2018 04:06:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14E846F3AA; Sun, 16 Dec 2018 04:06:54 +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 ECFDB21F4A; Sun, 16 Dec 2018 04:06:53 +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 wBG46rnn080054; Sun, 16 Dec 2018 04:06:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG46rqj080053; Sun, 16 Dec 2018 04:06:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812160406.wBG46rqj080053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 16 Dec 2018 04:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342150 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14E846F3AA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-0.88)[-0.883,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 04:06:55 -0000 Author: cy Date: Sun Dec 16 04:06:53 2018 New Revision: 342150 URL: https://svnweb.freebsd.org/changeset/base/342150 Log: Add a missing leading / in a filename. MFC after: 3 days Modified: head/share/man/man4/ses.4 Modified: head/share/man/man4/ses.4 ============================================================================== --- head/share/man/man4/ses.4 Sun Dec 16 02:46:51 2018 (r342149) +++ head/share/man/man4/ses.4 Sun Dec 16 04:06:53 2018 (r342150) @@ -107,7 +107,7 @@ Initialize the enclosure. .El .Sh EXAMPLE USAGE The files contained in -.In usr/share/examples/ses +.In /usr/share/examples/ses show simple mechanisms for how to use these interfaces, as well as a very stupid simple monitoring daemon. .Sh FILES From owner-svn-src-head@freebsd.org Sun Dec 16 08:58: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 BCA5B1342107; Sun, 16 Dec 2018 08:58:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECD776B30; Sun, 16 Dec 2018 08:58:15 +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 4EAB62504A; Sun, 16 Dec 2018 08:58:15 +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 wBG8wFA8032965; Sun, 16 Dec 2018 08:58:15 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG8wFSd032964; Sun, 16 Dec 2018 08:58:15 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812160858.wBG8wFSd032964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 16 Dec 2018 08:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342151 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 342151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5ECD776B30 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-0.88)[-0.883,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 08:58:16 -0000 Author: tsoome Date: Sun Dec 16 08:58:14 2018 New Revision: 342151 URL: https://svnweb.freebsd.org/changeset/base/342151 Log: loader: zfs reader should not probe partitionless disks First of all, normal setups can not boot such pools as the tools do not support installing boot programs. Secondly, for proper pool configuration detection, we need to checks all four label copies on disk, 2 from front and 2 from the end of the disk, but zfs label does not contain the size of the disk - so we depend on firmware to report the correct disk size or use information from the partition table. Without partition table, we only can rely on firmware to report and support disk IO properly. There is a specific case: 8TB disks are reported by BIOS to have 4294967295 sectors (0x00000000ffffffff), the sectors reported by OS is 15628053168 (0x00000003a3812ab0), so the reported size is less than actual but is hitting 32-bit max. Unfortuantely the real limit must be even lower because probing this disk in this system will wnd up with hung system. UEFI boot of this system seems not to be affected. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18558 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Dec 16 04:06:53 2018 (r342150) +++ head/stand/libsa/zfs/zfs.c Sun Dec 16 08:58:14 2018 (r342151) @@ -527,10 +527,11 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) return (ENXIO); - /* Probe the whole disk */ - ret = zfs_probe(pa.fd, pool_guid); - if (ret == 0) - return (0); + /* + * We will not probe the whole disk, we can not boot from such + * disks and some systems will misreport the disk sizes and will + * hang while accessing the disk. + */ /* Probe each partition */ ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); From owner-svn-src-head@freebsd.org Sun Dec 16 08:05: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 DE8301340A22; Sun, 16 Dec 2018 08:05:43 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19AD1752D2; Sun, 16 Dec 2018 08:05:42 +0000 (UTC) (envelope-from gnn@neville-neil.com) X-Originating-IP: 118.169.45.207 Received: from [10.0.1.2] (118-169-45-207.dynamic-ip.hinet.net [118.169.45.207]) (Authenticated sender: gnn@neville-neil.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 81369E0008; Sun, 16 Dec 2018 08:05:33 +0000 (UTC) From: "George Neville-Neil" To: "Cy Schubert" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342140 - head/tools/build/mk Date: Sun, 16 Dec 2018 16:05:28 +0800 X-Mailer: MailMate (1.12.3r5579) Message-ID: <836287CE-C668-49E1-8AB3-3BEEC18A28E4@neville-neil.com> In-Reply-To: <201812152202.wBFM23K0089706@repo.freebsd.org> References: <201812152202.wBFM23K0089706@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Rspamd-Queue-Id: 19AD1752D2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.975,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 08:05:44 -0000 Thanks. Best, George On 16 Dec 2018, at 6:02, Cy Schubert wrote: > Author: cy > Date: Sat Dec 15 22:02:02 2018 > New Revision: 342140 > URL: https://svnweb.freebsd.org/changeset/base/342140 > > Log: > Repair build post-r342139 > > Modified: > head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 15 21:34:40 > 2018 (r342139) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 15 22:02:02 > 2018 (r342140) > @@ -8513,6 +8513,7 @@ OLD_FILES+=usr/share/man/man1/tftp.1.gz > OLD_FILES+=usr/share/man/man8/tftpd.8.gz > .endif > > +.if ${MK_TOOLCHAIN} == no > OLD_FILES+=usr/bin/addr2line > OLD_FILES+=usr/bin/as > OLD_FILES+=usr/bin/byacc From owner-svn-src-head@freebsd.org Sun Dec 16 18:10: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 2D5DB1335AA4; Sun, 16 Dec 2018 18:10:56 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3CA490A59; Sun, 16 Dec 2018 18:10:55 +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 981722F4D; Sun, 16 Dec 2018 18:10:55 +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 wBGIAtlf034169; Sun, 16 Dec 2018 18:10:55 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBGIAtU6034168; Sun, 16 Dec 2018 18:10:55 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201812161810.wBGIAtU6034168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 16 Dec 2018 18:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342152 - head/sbin/mdconfig X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sbin/mdconfig X-SVN-Commit-Revision: 342152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3CA490A59 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.88)[-0.883,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 18:10:56 -0000 Author: phk Date: Sun Dec 16 18:10:55 2018 New Revision: 342152 URL: https://svnweb.freebsd.org/changeset/base/342152 Log: Make (no)ro an alias for (no)readonly Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Sun Dec 16 08:58:14 2018 (r342151) +++ head/sbin/mdconfig/mdconfig.c Sun Dec 16 18:10:55 2018 (r342152) @@ -193,6 +193,10 @@ main(int argc, char **argv) mdio.md_options |= MD_READONLY; else if (!strcmp(optarg, "noreadonly")) mdio.md_options &= ~MD_READONLY; + else if (!strcmp(optarg, "ro")) + mdio.md_options |= MD_READONLY; + else if (!strcmp(optarg, "noro")) + mdio.md_options &= ~MD_READONLY; else if (!strcmp(optarg, "reserve")) mdio.md_options |= MD_RESERVE; else if (!strcmp(optarg, "noreserve")) From owner-svn-src-head@freebsd.org Sun Dec 16 23:38: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 60FFA1341510; Sun, 16 Dec 2018 23:38:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0443A6E423; Sun, 16 Dec 2018 23:38:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB7116A27; Sun, 16 Dec 2018 23:38:46 +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 wBGNckxZ005896; Sun, 16 Dec 2018 23:38:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBGNckpN005894; Sun, 16 Dec 2018 23:38:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201812162338.wBGNckpN005894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 16 Dec 2018 23:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342153 - in head: libexec/rc/rc.d tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: libexec/rc/rc.d tools/build/mk X-SVN-Commit-Revision: 342153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0443A6E423 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.88)[-0.883,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 23:38:47 -0000 Author: asomers Date: Sun Dec 16 23:38:46 2018 New Revision: 342153 URL: https://svnweb.freebsd.org/changeset/base/342153 Log: Conditionally install /etc/rc.d/audit* based on ${MK_AUDIT} /usr/sbin/audit(dist)?d are only installed if ${MK_AUDIT} == yes. Their supporting scripts should only be installed in those instances as well. Submitted by: ngie Reviewed by: emaste MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd/pull/242 Modified: head/libexec/rc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Sun Dec 16 18:10:55 2018 (r342152) +++ head/libexec/rc/rc.d/Makefile Sun Dec 16 23:38:46 2018 (r342153) @@ -15,8 +15,6 @@ CONFS= DAEMON \ addswap \ adjkerntz \ archdep \ - auditd \ - auditdistd \ bgfsck \ ${_blacklistd} \ ${_bluetooth} \ @@ -162,6 +160,12 @@ APM+= apm APM+= apmd .endif APMPACKAGE= apm +.endif + +.if ${MK_AUDIT} != "no" +CONFGROUPS+= AUDIT +AUDIT+= auditd +AUDIT+= auditdistd .endif .if ${MK_AUTOFS} != "no" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Dec 16 18:10:55 2018 (r342152) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Dec 16 23:38:46 2018 (r342153) @@ -147,6 +147,8 @@ OLD_FILES+=usr/share/man/man3/unistruct.3.gz .endif .if ${MK_AUDIT} == no +OLD_FILES+=etc/rc.d/auditd +OLD_FILES+=etc/rc.d/auditdistd OLD_FILES+=usr/sbin/audit OLD_FILES+=usr/sbin/auditd OLD_FILES+=usr/sbin/auditdistd From owner-svn-src-head@freebsd.org Sun Dec 16 23:45: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 B695413418BB; Sun, 16 Dec 2018 23:45:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59FE96E9AF; Sun, 16 Dec 2018 23:45:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435BA6BEE; Sun, 16 Dec 2018 23:45:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBGNjlrs010994; Sun, 16 Dec 2018 23:45:47 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBGNjleN010993; Sun, 16 Dec 2018 23:45:47 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201812162345.wBGNjleN010993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 16 Dec 2018 23:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342154 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 342154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59FE96E9AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-0.88)[-0.883,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 16 Dec 2018 23:45:47 -0000 Author: asomers Date: Sun Dec 16 23:45:46 2018 New Revision: 342154 URL: https://svnweb.freebsd.org/changeset/base/342154 Log: OptionalObsoleteFiles: Fix deleting usr/tests/usr.sbin/sa It's a directory, not a file. Reported by: ngie MFC after: 2 weeks X-MFC-With: 300938 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Dec 16 23:38:46 2018 (r342153) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Dec 16 23:45:46 2018 (r342154) @@ -38,7 +38,7 @@ OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-usr.in OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-sav.in OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-u.out OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-usr.in -OLD_FILES+=usr/tests/usr.sbin/sa +OLD_DIRS+=usr/tests/usr.sbin/sa .endif .if ${MK_ACPI} == no From owner-svn-src-head@freebsd.org Mon Dec 17 05:07: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 686B91329280; Mon, 17 Dec 2018 05:07:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D62982CFB; Mon, 17 Dec 2018 05:07:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 010FDA279; Mon, 17 Dec 2018 05:07:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH57vbE078461; Mon, 17 Dec 2018 05:07:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH57v3W078459; Mon, 17 Dec 2018 05:07:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812170507.wBH57v3W078459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 17 Dec 2018 05:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342156 - in head/sys/dev: rtwn/usb usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 342156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D62982CFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-0.88)[-0.883,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 05:07:58 -0000 Author: avos Date: Mon Dec 17 05:07:57 2018 New Revision: 342156 URL: https://svnweb.freebsd.org/changeset/base/342156 Log: Add revision number for TP-Link TL-WN722N to prevent ambiguity between different chipsets. MFC after: 3 days X-MFC with: 341786 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Dec 17 00:32:50 2018 (r342155) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Dec 17 05:07:57 2018 (r342156) @@ -118,7 +118,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(DLINK, DWA123D1), RTWN_RTL8188EU_DEV(DLINK, DWA125D1), RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M), - RTWN_RTL8188EU_DEV(TPLINK, WN722N), + RTWN_RTL8188EU_DEV(TPLINK, WN722NV2), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), #undef RTWN_RTL8188EU_DEV Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Dec 17 00:32:50 2018 (r342155) +++ head/sys/dev/usb/usbdevs Mon Dec 17 05:07:57 2018 (r342156) @@ -4612,7 +4612,7 @@ product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive product TPLINK T4U 0x0101 Archer T4U product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 -product TPLINK WN722N 0x010c TL-WN722N +product TPLINK WN722NV2 0x010c TL-WN722N v2 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 From owner-svn-src-head@freebsd.org Mon Dec 17 07:09: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 436D21331761; Mon, 17 Dec 2018 07:09:47 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7BCF86904; Mon, 17 Dec 2018 07:09:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C989CB6DE; Mon, 17 Dec 2018 07:09:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH79krM043197; Mon, 17 Dec 2018 07:09:46 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH79kkG043196; Mon, 17 Dec 2018 07:09:46 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201812170709.wBH79kkG043196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Mon, 17 Dec 2018 07:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342160 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 342160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7BCF86904 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 07:09:47 -0000 Author: grog Date: Mon Dec 17 07:09:46 2018 New Revision: 342160 URL: https://svnweb.freebsd.org/changeset/base/342160 Log: Work around BIOS quirks on HPE Proliant MicroServer Gen10 PR: 221350 Submitted by: Bob Bishop Reported by: Rafal Lukawiecki Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Dec 17 07:03:36 2018 (r342159) +++ head/sys/dev/pci/pci.c Mon Dec 17 07:09:46 2018 (r342160) @@ -230,6 +230,7 @@ struct pci_quirk { #define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ #define PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */ #define PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */ +#define PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */ int arg1; int arg2; }; @@ -311,6 +312,12 @@ static const struct pci_quirk pci_quirks[] = { { 0x167814e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715 */ { 0x167914e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715S */ + /* + * HPE Gen 10 VGA has a memory range that can't be allocated in the + * expected place. + */ + { 0x98741002, PCI_QUIRK_REALLOC_BAR, 0, 0 }, + { 0 } }; @@ -3283,7 +3290,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struc */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, flags); - if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) { + if ((pci_do_realloc_bars + || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR)) + && res == NULL && (start != 0 || end != ~0)) { /* * If the allocation fails, try to allocate a resource for * this BAR using any available range. The firmware felt From owner-svn-src-head@freebsd.org Mon Dec 17 07:43: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 1D52C1332B8E; Mon, 17 Dec 2018 07:43:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5AB387FB2; Mon, 17 Dec 2018 07:43:29 +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 A3973BF36; Mon, 17 Dec 2018 07:43:29 +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 wBH7hTUs063795; Mon, 17 Dec 2018 07:43:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH7hTX9063794; Mon, 17 Dec 2018 07:43:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812170743.wBH7hTX9063794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 17 Dec 2018 07:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342161 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 342161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5AB387FB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 07:43:30 -0000 Author: tsoome Date: Mon Dec 17 07:43:29 2018 New Revision: 342161 URL: https://svnweb.freebsd.org/changeset/base/342161 Log: loader: zfs reader should not probe partitionless disks (UEFI case) With r342151 I did fix the BIOS version of zfs_probe_dev() from accessing the whole disk, but the fix was not complete - we actually did not check if the device name was really for whole disk. Since UEFI version is only calling the zfs_probe_dev() with partitions and not with whole disk, the UEFI loader was not able to find the zfs pools. This update does correct the issue by calling archsw.arch_getdev() to translate the device name back to dev_desc, and we have whole disk when both partition and slice values are -1. Reported by: alvisen_gmail.com Differential Revision: https://reviews.freebsd.org/D18558 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Mon Dec 17 07:09:46 2018 (r342160) +++ head/stand/libsa/zfs/zfs.c Mon Dec 17 07:43:29 2018 (r342161) @@ -33,15 +33,16 @@ __FBSDID("$FreeBSD$"); * Stand-alone file reading package. */ +#include #include #include #include #include +#include #include #include #include #include -#include #include #include "libzfs.h" @@ -517,6 +518,7 @@ zfs_probe_partition(void *arg, const char *partname, int zfs_probe_dev(const char *devname, uint64_t *pool_guid) { + struct disk_devdesc *dev; struct ptable *table; struct zfs_probe_args pa; uint64_t mediasz; @@ -532,6 +534,17 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid * disks and some systems will misreport the disk sizes and will * hang while accessing the disk. */ + if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { + int partition = dev->d_partition; + int slice = dev->d_slice; + + free(dev); + if (partition != -1 && slice != -1) { + ret = zfs_probe(pa.fd, pool_guid); + if (ret == 0) + return (0); + } + } /* Probe each partition */ ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); From owner-svn-src-head@freebsd.org Mon Dec 17 10:17: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 BFB401338982; Mon, 17 Dec 2018 10:17:57 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F8598D5BB; Mon, 17 Dec 2018 10:17:57 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4F06CD88E; Mon, 17 Dec 2018 10:17:57 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHAHvxr053011; Mon, 17 Dec 2018 10:17:57 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHAHv7J053010; Mon, 17 Dec 2018 10:17:57 GMT (envelope-from se@FreeBSD.org) Message-Id: <201812171017.wBHAHv7J053010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 17 Dec 2018 10:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342162 - head X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F8598D5BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 10:17:57 -0000 Author: se Date: Mon Dec 17 10:17:56 2018 New Revision: 342162 URL: https://svnweb.freebsd.org/changeset/base/342162 Log: Add removed CTM files to ObsoleteFiles.inc as a follow-up to r342126. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Dec 17 07:43:29 2018 (r342161) +++ head/ObsoleteFiles.inc Mon Dec 17 10:17:56 2018 (r342162) @@ -38,6 +38,16 @@ # xargs -n1 | sort | uniq -d; # done +# 20181215: Migration of CTM to ports +OLD_FILES+=usr/sbin/ctm +OLD_FILES+=usr/sbin/ctm_dequeue +OLD_FILES+=usr/sbin/ctm_rmail +OLD_FILES+=usr/sbin/ctm_smail +OLD_FILES+=usr/share/man/man1/ctm.1.gz +OLD_FILES+=usr/share/man/man1/ctm_dequeue.1.gz +OLD_FILES+=usr/share/man/man1/ctm_rmail.1.gz +OLD_FILES+=usr/share/man/man1/ctm_smail.1.gz +OLD_FILES+=usr/share/man/man5/ctm.5.gz # 20181214: Remove timed files OLD_FILES+=etc/rc.d/timed OLD_FILES+=usr/sbin/timed From owner-svn-src-head@freebsd.org Mon Dec 17 14:25: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 9277D134155D; Mon, 17 Dec 2018 14:25:56 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1BCE6FF4F; Mon, 17 Dec 2018 14:25:55 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 2FA6727002EB; Mon, 17 Dec 2018 09:25:48 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 2FA6727002EB DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1545056748; bh=R4VQuk+BCU7VuQFj76xOoaj9TIpWQ2atUDeslu6APo0=; h=Subject:To:From:Date:From; b=tU4Hz9lyW4Ue+zZ6lcuPCj8wVt8rAX/K4oVocb+z9ae0PKEg8fgJ0hQeBm/MU+mQS 5VZjID1KEOnRNhVgOvTZ6JXHC1apIYftPIn7waRjyyjdoSFrnDZkJUDkzM2ohFe1m/ 1tvQJscbsJyMqYxw8p2DYZBiPJodKQtjHLzebUxBITf+eeAkgughnlT7q+1azEB9ry BvmOLtEUTUjP73mDybeeybC9ORsU1B7mpGM0xDmRgYlcai7wIEdy9D6OiXFv827RTT MxM0aQNYpQyEUX23mVPCIzF9HCIFufF/AXu8Jr0nJ3mWUwBjhaHiV3VMOTiWeE4mdu IZdhIFoWSQhlA== Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> From: Andrew Gallatin Message-ID: <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> Date: Mon, 17 Dec 2018 09:25:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812051420.wB5EKwxr099242@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D1BCE6FF4F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.duke.edu header.s=mail0816 header.b=tU4Hz9ly; dmarc=pass (policy=none) header.from=cs.duke.edu; spf=pass (mx1.freebsd.org: domain of gallatin@cs.duke.edu designates 152.3.140.1 as permitted sender) smtp.mailfrom=gallatin@cs.duke.edu X-Spamd-Result: default: False [-4.45 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[cs.duke.edu:s=mail0816]; NEURAL_HAM_MEDIUM(-0.95)[-0.954,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:152.3.140.0/23]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.83)[-0.827,0]; DKIM_TRACE(0.00)[cs.duke.edu:+]; RCVD_IN_DNSWL_MED(-0.20)[1.140.3.152.list.dnswl.org : 127.0.11.2]; DMARC_POLICY_ALLOW(-0.50)[cs.duke.edu,none]; MX_GOOD(-0.01)[mx.oit.duke.edu]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.02)[country: US(-0.08)]; ASN(0.00)[asn:13371, ipnet:152.3.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 14:25:56 -0000 On 12/5/18 9:20 AM, Slava Shwartsman wrote: > Author: slavash > Date: Wed Dec 5 14:20:57 2018 > New Revision: 341578 > URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_341578&d=DwIDaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=BFp2c_-S0jnzRZJF2APwvTwmnmVFcyjcnBvHRZ3Locc&s=b7fvhOzf_b5bMVGquu4SaBhMNql5N8dVPAvpfKtz53Q&e= > > Log: > mlx5en: Remove the DRBR and associated logic in the transmit path. > > The hardware queues are deep enough currently and using the DRBR and associated > callbacks only leads to more task switching in the TX path. The is also a race > setting the queue_state which can lead to hung TX rings. > The point of DRBR in the tx path is not simply to provide a software ring for queuing excess packets. Rather it provides a mechanism to avoid lock contention by shoving a packet into the software ring, where it will later be found & processed, rather than blocking the caller on a mtx lock. I'm concerned you may have introduced a performance regression for use cases where you have N:1 or N:M lock contention where many threads on different cores are contending for the same tx queue. The state of the art for this is no longer DRBR, but mp_ring, as used by both cxgbe and iflib. For well behaved workloads (like Netflix's), I don't anticipate this being a performance issue. However, I worry that this will impact other workloads and that you should consider running some testing of N:1 contention. Eg, 128 netperfs running in parallel with only a few nic tx rings. Sorry for the late reply.. I'm behind on my -committers email. If you have not already MFC'ed this, you may want to reconsider. Drew From owner-svn-src-head@freebsd.org Mon Dec 17 16:00: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 C82061344406; Mon, 17 Dec 2018 16:00:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66BC174966; Mon, 17 Dec 2018 16:00:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4CA0B19263; Mon, 17 Dec 2018 16:00:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHG0ab2046396; Mon, 17 Dec 2018 16:00:36 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHG0Zet046365; Mon, 17 Dec 2018 16:00:35 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201812171600.wBHG0Zet046365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 17 Dec 2018 16:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342168 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 342168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66BC174966 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 16:00:37 -0000 Author: sobomax Date: Mon Dec 17 16:00:35 2018 New Revision: 342168 URL: https://svnweb.freebsd.org/changeset/base/342168 Log: Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4) or the likes. Add new control message types: setdlt and getdlt to switch from default DLT_RAW (no encapsulation) to DLT_EN10MB (ethernet). Approved by: glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18535 Modified: head/share/man/man4/ng_nat.4 head/sys/netgraph/ng_nat.c head/sys/netgraph/ng_nat.h Modified: head/share/man/man4/ng_nat.4 ============================================================================== --- head/share/man/man4/ng_nat.4 Mon Dec 17 15:19:48 2018 (r342167) +++ head/share/man/man4/ng_nat.4 Mon Dec 17 16:00:35 2018 (r342168) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd December 12, 2018 .Dt NG_NAT 4 .Os .Sh NAME @@ -264,6 +264,38 @@ from its .Xr libalias instance, the corresponding field is returned as .Va UINT32_MAX . +.It Dv NGM_NAT_SET_DLT Pq Ic setdlt +Sets the data link type on the +.Va in +and +.Va out +hooks. +Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams , no offset applied, the default) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h . +If you want to work on the +.Xr ipfw 8 +level you must use no additional offset by specifying +.Cm DLT_RAW . +If, however, you attach +.Nm +to a network interface directly and +.Cm EN10MB +is specified, then the extra offset will be applied to take into account +link-level header. +In this mode the +.Nm +would also inspect appropriate type field in the Ethernet header and +pass-through any datagrams that are not IP packets. +.It Dv NGM_NAT_GET_DLT Pq Ic getdlt +This control message returns the current data link type of the +.Va in +and +.Va out +hooks. .El .Pp In all redirection messages @@ -336,11 +368,31 @@ serial line with HDLC encapsulation. SEQ ifconfig ng0 x.y.8.35 x.y.8.1 .Ed +.Pp +The +.Nm +node can also be attached directly to the physical interface +via +.Xr ng_ether 4 +node in the graph. +In the following example, we perform masquerading on a +Ethernet interface connected to a public network. +.Bd -literal -offset indent +ifconfig igb0 inet x.y.8.35 netmask 0xfffff000 +route add default x.y.0.1 +/usr/sbin/ngctl -f- <<-SEQ + mkpeer igb0: nat lower in + name igb0:lower igb0_NAT + connect igb0: igb0_NAT: upper out + msg igb0_NAT: setdlt 1 + msg igb0_NAT: setaliasaddr x.y.8.35 +SEQ .Sh SEE ALSO .Xr libalias 3 , .Xr ng_ipfw 4 , .Xr natd 8 , -.Xr ngctl 8 +.Xr ngctl 8 , +.Xr ng_ether 8 .Sh HISTORY The .Nm Modified: head/sys/netgraph/ng_nat.c ============================================================================== --- head/sys/netgraph/ng_nat.c Mon Dec 17 15:19:48 2018 (r342167) +++ head/sys/netgraph/ng_nat.c Mon Dec 17 16:00:35 2018 (r342168) @@ -44,6 +44,9 @@ #include #include +#include +#include + #include #include @@ -241,6 +244,20 @@ static const struct ng_cmdlist ng_nat_cmdlist[] = { NULL, &ng_nat_libalias_info_type }, + { + NGM_NAT_COOKIE, + NGM_NAT_SET_DLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_NAT_COOKIE, + NGM_NAT_GET_DLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, { 0 } }; @@ -277,6 +294,7 @@ struct ng_nat_priv { uint32_t rdrcount; /* number or redirects in list */ uint32_t nextid; /* for next in turn in list */ struct rdrhead redirhead; /* redirect list header */ + uint8_t dlt; /* DLT_XXX from bpf.h */ }; typedef struct ng_nat_priv *priv_p; @@ -302,6 +320,7 @@ ng_nat_constructor(node_p node) /* Init redirects housekeeping. */ priv->rdrcount = 0; priv->nextid = 1; + priv->dlt = DLT_RAW; STAILQ_INIT(&priv->redirhead); /* Link structs together. */ @@ -694,11 +713,34 @@ ng_nat_rcvmsg(node_p node, item_p item, hook_p lasthoo #undef COPY } break; + case NGM_NAT_SET_DLT: + if (msg->header.arglen != sizeof(uint8_t)) { + error = EINVAL; + break; + } + switch (*(uint8_t *) msg->data) { + case DLT_EN10MB: + case DLT_RAW: + priv->dlt = *(uint8_t *) msg->data; + break; + default: + error = EINVAL; + break; + } + break; default: error = EINVAL; /* unknown command */ break; } break; + case NGM_NAT_GET_DLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + if (resp == NULL) { + error = ENOMEM; + break; + } + *((uint8_t *) resp->data) = priv->dlt; + break; default: error = EINVAL; /* unknown cookie type */ break; @@ -715,7 +757,7 @@ ng_nat_rcvdata(hook_p hook, item_p item ) const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct mbuf *m; struct ip *ip; - int rval, error = 0; + int rval, ipofs, error = 0; char *c; /* We have no required hooks. */ @@ -738,10 +780,37 @@ ng_nat_rcvdata(hook_p hook, item_p item ) NGI_M(item) = m; - c = mtod(m, char *); - ip = mtod(m, struct ip *); + switch (priv->dlt) { + case DLT_RAW: + ipofs = 0; + break; + case DLT_EN10MB: + { + struct ether_header *eh; - KASSERT(m->m_pkthdr.len == ntohs(ip->ip_len), + if (m->m_pkthdr.len < sizeof(struct ether_header)) { + NG_FREE_ITEM(item); + return (ENXIO); + } + eh = mtod(m, struct ether_header *); + switch (ntohs(eh->ether_type)) { + case ETHERTYPE_IP: + case ETHERTYPE_IPV6: + ipofs = sizeof(struct ether_header); + break; + default: + goto send; + } + break; + } + default: + panic("Corrupted priv->dlt: %u", priv->dlt); + } + + c = (char *)mtodo(m, ipofs); + ip = (struct ip *)mtodo(m, ipofs); + + KASSERT(m->m_pkthdr.len == ipofs + ntohs(ip->ip_len), ("ng_nat: ip_len != m_pkthdr.len")); /* @@ -753,7 +822,8 @@ ng_nat_rcvdata(hook_p hook, item_p item ) * PKT_ALIAS_DENY_INCOMING flag is set. */ if (hook == priv->in) { - rval = LibAliasIn(priv->lib, c, m->m_len + M_TRAILINGSPACE(m)); + rval = LibAliasIn(priv->lib, c, m->m_len - ipofs + + M_TRAILINGSPACE(m)); if (rval == PKT_ALIAS_ERROR || rval == PKT_ALIAS_UNRESOLVED_FRAGMENT || (rval == PKT_ALIAS_IGNORED && @@ -763,7 +833,8 @@ ng_nat_rcvdata(hook_p hook, item_p item ) return (EINVAL); } } else if (hook == priv->out) { - rval = LibAliasOut(priv->lib, c, m->m_len + M_TRAILINGSPACE(m)); + rval = LibAliasOut(priv->lib, c, m->m_len - ipofs + + M_TRAILINGSPACE(m)); if (rval == PKT_ALIAS_ERROR) { NG_FREE_ITEM(item); return (EINVAL); @@ -773,7 +844,7 @@ ng_nat_rcvdata(hook_p hook, item_p item ) if (rval == PKT_ALIAS_RESPOND) m->m_flags |= M_SKIP_FIREWALL; - m->m_pkthdr.len = m->m_len = ntohs(ip->ip_len); + m->m_pkthdr.len = m->m_len = ntohs(ip->ip_len) + ipofs; if ((ip->ip_off & htons(IP_OFFMASK)) == 0 && ip->ip_p == IPPROTO_TCP) { Modified: head/sys/netgraph/ng_nat.h ============================================================================== --- head/sys/netgraph/ng_nat.h Mon Dec 17 15:19:48 2018 (r342167) +++ head/sys/netgraph/ng_nat.h Mon Dec 17 16:00:35 2018 (r342168) @@ -205,6 +205,8 @@ enum { NGM_NAT_SET_IPADDR = 1, NGM_NAT_SET_MODE, NGM_NAT_SET_TARGET, + NGM_NAT_SET_DLT, + NGM_NAT_GET_DLT, NGM_NAT_REDIRECT_PORT, NGM_NAT_REDIRECT_ADDR, NGM_NAT_REDIRECT_PROTO, From owner-svn-src-head@freebsd.org Mon Dec 17 16:01: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 9C94013444B6; Mon, 17 Dec 2018 16:01:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44AE974D82; Mon, 17 Dec 2018 16:01:38 +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 3834C193EC; Mon, 17 Dec 2018 16:01:38 +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 wBHG1cbJ048026; Mon, 17 Dec 2018 16:01:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHG1cUO048025; Mon, 17 Dec 2018 16:01:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812171601.wBHG1cUO048025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Dec 2018 16:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342169 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 342169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44AE974D82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 16:01:38 -0000 Author: avg Date: Mon Dec 17 16:01:37 2018 New Revision: 342169 URL: https://svnweb.freebsd.org/changeset/base/342169 Log: add a knob that disables detection of write protected disks It has been reported that on some systems (with real hardware passed through to a virtual machine) the WP detection causes USB disk probing failures. While here, also fix the selection of the next state in the case of malloc failure in DA_STATE_PROBE_WP. It was DA_STATE_PROBE_RC unconditionally even when it should have been DA_STATE_PROBE_RC16. PR: 225794 Reported by: David Boyd MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D18496 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 17 16:00:35 2018 (r342168) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 17 16:01:37 2018 (r342169) @@ -1469,6 +1469,7 @@ static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static sbintime_t da_default_softtimeout = DA_DEFAULT_SOFTTIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; +static int da_disable_wp_detection = 0; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -1480,6 +1481,9 @@ SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CT &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RWTUN, &da_send_ordered, 0, "Send Ordered Tags"); +SYSCTL_INT(_kern_cam_da, OID_AUTO, disable_wp_detection, CTLFLAG_RWTUN, + &da_disable_wp_detection, 0, + "Disable detection of write-protected disks"); SYSCTL_PROC(_kern_cam_da, OID_AUTO, default_softtimeout, CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, dasysctlsofttimeout, "I", @@ -3336,12 +3340,22 @@ out: void *mode_buf; int mode_buf_len; + if (da_disable_wp_detection) { + if ((softc->flags & DA_FLAG_CAN_RC16) != 0) + softc->state = DA_STATE_PROBE_RC16; + else + softc->state = DA_STATE_PROBE_RC; + goto skipstate; + } mode_buf_len = 192; mode_buf = malloc(mode_buf_len, M_SCSIDA, M_NOWAIT); if (mode_buf == NULL) { xpt_print(periph->path, "Unable to send mode sense - " "malloc failure\n"); - softc->state = DA_STATE_PROBE_RC; + if ((softc->flags & DA_FLAG_CAN_RC16) != 0) + softc->state = DA_STATE_PROBE_RC16; + else + softc->state = DA_STATE_PROBE_RC; goto skipstate; } scsi_mode_sense_len(&start_ccb->csio, From owner-svn-src-head@freebsd.org Mon Dec 17 16:01: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 E69561344503 for ; Mon, 17 Dec 2018 16:01:56 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 841E374EB8 for ; Mon, 17 Dec 2018 16:01:55 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f195.google.com with SMTP id n18-v6so11438730lji.7 for ; Mon, 17 Dec 2018 08:01:55 -0800 (PST) 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:cc:content-transfer-encoding; bh=ft9QIizwhaHTH76rfHMzEMYXBU64Xu5+N7TDF/IN9Rc=; b=qEe4PPnZEA1J494POQmMlgqVUmvl4WrCbGKab7/BwKGLbaMtqErRVH72tReujYusky OM/DzV5eAjmwBZNT7CR0nFiXrFfBbgm455WpVzYJNBnxtt6y/P7/HMBk/naN2VqlPnRr CCDdYUSsQ1xZ66IOhsBI+RisghAMc0ynXEWaRrwsJYx/6awUVmY3mGxSQ1S2oxlGV8hk ORYYYimwNRCL7a3LcRBfhN/fLtfCQWFl90llDZ3xHs5DR4Co6RWI+Dh1OwxGTihuOQdK rGeSKZ7TN1hWroWUzew6M5kEYw//WjHIviJPLmJuCcyXPQ/VdI/ad3DvJR5wfNA/+j3w sjXw== X-Gm-Message-State: AA+aEWbhJ5pPMjzk77/X8EfC5d5uLOmTm1tLUUC+3fVPk+LN0GSi53Vp 66eAPO8lvD58lK3iJcjFbOa+C3hTVdrGjNOs3yk= X-Received: by 2002:a2e:9e95:: with SMTP id f21-v6mt8865585ljk.128.1545062506787; Mon, 17 Dec 2018 08:01:46 -0800 (PST) MIME-Version: 1.0 References: <201805042054.w44KsRtc038808@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Mon, 17 Dec 2018 09:01:34 -0700 Message-ID: Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... Cc: jamie@freebsd.org, src-committers , svn-src-all , svn-src-head , Ross Williams Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 841E374EB8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.195 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.90)[-0.897,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.90)[-0.895,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.89)[-0.889,0]; RCVD_IN_DNSWL_NONE(0.00)[195.208.85.209.list.dnswl.org : 127.0.5.0]; MISSING_TO(2.00)[]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; IP_SCORE(-1.01)[ipnet: 209.85.128.0/17(-3.60), asn: 15169(-1.36), country: US(-0.08)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 16:01:57 -0000 On Mon, Nov 19, 2018 at 10:26 AM Alan Somers wrote: > > On Fri, Nov 16, 2018 at 7:16 PM James Gritton wrote: >> >> On 2018-11-16 16:30, Alan Somers wrote: >> >> On Fri, Nov 16, 2018 at 2:28 PM James Gritton wrote: >>> >>> On 2018-11-16 10:34, Alan Somers wrote: >>> >>> On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: >>>> >>>> Author: jamie >>>> Date: Fri May 4 20:54:27 2018 >>>> New Revision: 333263 >>>> URL: https://svnweb.freebsd.org/changeset/base/333263 >>>> >>>> Log: >>>> Make it easier for filesystems to count themselves as jail-enabled, >>>> by doing most of the work in a new function prison_add_vfs in kern_j= ail.c >>>> Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, = and >>>> the rest is taken care of. This includes adding a jail parameter li= ke >>>> allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allow= ed. >>>> Both of these used to be a static list of known filesystems, with >>>> predefined permission bits. >>>> >>>> Reviewed by: kib >>>> Differential Revision: D14681 >>>> >>>> Modified: >>>> head/lib/libjail/jail.c >>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >>>> head/sys/compat/linprocfs/linprocfs.c >>>> head/sys/compat/linsysfs/linsysfs.c >>>> head/sys/fs/devfs/devfs_vfsops.c >>>> head/sys/fs/fdescfs/fdesc_vfsops.c >>>> head/sys/fs/nullfs/null_vfsops.c >>>> head/sys/fs/procfs/procfs.c >>>> head/sys/fs/pseudofs/pseudofs.h >>>> head/sys/fs/tmpfs/tmpfs_vfsops.c >>>> head/sys/kern/kern_jail.c >>>> head/sys/kern/vfs_init.c >>>> head/sys/kern/vfs_mount.c >>>> head/sys/kern/vfs_subr.c >>>> head/sys/sys/jail.h >>>> head/sys/sys/mount.h >>>> head/usr.sbin/jail/jail.8 >>>> >>>> Modified: head/lib/libjail/jail.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r3332= 62) >>>> +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r3332= 63) >>>> @@ -1048,7 +1048,13 @@ kldload_param(const char *name) >>>> else if (strcmp(name, "sysvmsg") =3D=3D 0 || strcmp(name, "sys= vsem") =3D=3D 0 || >>>> strcmp(name, "sysvshm") =3D=3D 0) >>>> kl =3D kldload(name); >>>> - else { >>>> + else if (strncmp(name, "allow.mount.", 12) =3D=3D 0) { >>>> + /* Load the matching filesystem */ >>>> + kl =3D kldload(name + 12); >>>> + if (kl < 0 && errno =3D=3D ENOENT && >>>> + strncmp(name + 12, "no", 2) =3D=3D 0) >>>> + kl =3D kldload(name + 14); >>>> + } else { >>>> errno =3D ENOENT; >>>> return (-1); >>>> } >>> >>> I'm curious about this part of the change. Why is it necessary to load= the module in the "allow.mount.noXXXfs" case, when the jail is forbidden t= o mount the filesystem? It seems like that would just load modules that are= n't going to be used. >>> Additional discussion at https://github.com/iocage/iocage/issues/689 . >>> -Alan >>> >>> Presumably such a parameter would be included in some jails in conjunct= ion with the positive being included in others (perhaps as a default). The= truth is I never really considered whether the "no" option would be used, = I just always treat these option as pairs. >>> It may be reasonable (at least in the allow.mount.* case) to silently d= isregard a "no" option that doesn't exist, but I don't know how many places= would need to be modified for that to go smoothly. Though I don't expect = that there would be too many people who bother to include a jail parameter = about a filesystem which they're not planning to use. >>> - Jamie >> >> >> Well, many people use the "no" option because one of the most popular ja= il managers, iocage, uses it under the hood. But since "no" is the default= , its presence on the command line is a noop. Are there any situations in = which the "no" option has an effect? The only two possibilities I could th= ink of were: >> >> 1) Somebody puts both the positive and negative options on the same comm= and line. From experiment, it seems like the last option takes effect. In= this case, the presence of the positive option would cause the kld to be l= oaded, regardless of the presence of the negative option. >> 2) When using hierarchical jails, it might make sense to use the positiv= e option for the outer jail and the negative option for the inner jail. Bu= t this would only be important if the inner jail inherited the outer jail's= parameters, which doesn't seem to be the case. >> >> So I can't think of any reason to continue to mount the kld for "no" opt= ions. Can you? >> >> >> 3) There's allow.mount.foofs as a global parameter, with some jails over= riding that with a jail-specific allow.mount.nofoofs. In that case, KLD lo= ading shouldn't be a problem as global parameters typically come first. >> >> It makes sense not to load a KLD for a "no" option, as long as that opti= on is then silently ignored. I wouldn't want it to error out with "unknown= parameter". > > > See also https://github.com/iocage/iocage/issues/689 This issue should be fixed, for iocage at least, by https://github.com/iocage/iocage/commit/3c38801335ed7c67505f0000b70c4b3febc= ddbc1 . -Alan From owner-svn-src-head@freebsd.org Mon Dec 17 17:11: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 953EE1346692; Mon, 17 Dec 2018 17:11:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 457268070F; Mon, 17 Dec 2018 17:11:02 +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 362DC19F18; Mon, 17 Dec 2018 17:11:02 +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 wBHHB2Mo084426; Mon, 17 Dec 2018 17:11:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHHB0OO084416; Mon, 17 Dec 2018 17:11:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812171711.wBHHB0OO084416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Dec 2018 17:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342170 - in head/sys: dev/pci kern sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: dev/pci kern sys x86/x86 X-SVN-Commit-Revision: 342170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 457268070F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 17:11:02 -0000 Author: avg Date: Mon Dec 17 17:11:00 2018 New Revision: 342170 URL: https://svnweb.freebsd.org/changeset/base/342170 Log: add support for marking interrupt handlers as suspended The goal of this change is to fix a problem with PCI shared interrupts during suspend and resume. I have observed a couple of variations of the following scenario. Devices A and B are on the same PCI bus and share the same interrupt. Device A's driver is suspended first and the device is powered down. Device B generates an interrupt. Interrupt handlers of both drivers are called. Device A's interrupt handler accesses registers of the powered down device and gets back bogus values (I assume all 0xff). That data is interpreted as interrupt status bits, etc. So, the interrupt handler gets confused and may produce some noise or enter an infinite loop, etc. This change affects only PCI devices. The pci(4) bus driver marks a child's interrupt handler as suspended after the child's suspend method is called and before the device is powered down. This is done only for traditional PCI interrupts, because only they can be shared. At the moment the change is only for x86. Notable changes in core subsystems / interfaces: - BUS_SUSPEND_INTR and BUS_RESUME_INTR methods are added to bus interface along with convenience functions bus_suspend_intr and bus_resume_intr; - rman_set_irq_cookie and rman_get_irq_cookie functions are added to provide a way to associate an interrupt resource with an interrupt cookie; - intr_event_suspend_handler and intr_event_resume_handler functions are added to the MI interrupt handler interface. I added two new interrupt handler flags, IH_SUSP and IH_CHANGED, to implement the new intr_event functions. IH_SUSP marks a suspended interrupt handler. IH_CHANGED is used to implement a barrier that ensures that a change to the interrupt handler's state is visible to future interrupts. While there, I fixed some whitespace issues in comments and changed a couple of logically boolean variables to be bool. MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15755 Modified: head/sys/dev/pci/pci.c head/sys/kern/bus_if.m head/sys/kern/kern_intr.c head/sys/kern/subr_bus.c head/sys/kern/subr_rman.c head/sys/sys/bus.h head/sys/sys/interrupt.h head/sys/sys/rman.h head/sys/x86/x86/nexus.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/dev/pci/pci.c Mon Dec 17 17:11:00 2018 (r342170) @@ -4467,6 +4467,7 @@ int pci_suspend_child(device_t dev, device_t child) { struct pci_devinfo *dinfo; + struct resource_list_entry *rle; int error; dinfo = device_get_ivars(child); @@ -4483,8 +4484,20 @@ pci_suspend_child(device_t dev, device_t child) if (error) return (error); - if (pci_do_power_suspend) + if (pci_do_power_suspend) { + /* + * Make sure this device's interrupt handler is not invoked + * in the case the device uses a shared interrupt that can + * be raised by some other device. + * This is applicable only to regular (legacy) PCI interrupts + * as MSI/MSI-X interrupts are never shared. + */ + rle = resource_list_find(&dinfo->resources, + SYS_RES_IRQ, 0); + if (rle != NULL && rle->res != NULL) + (void)bus_suspend_intr(child, rle->res); pci_set_power_child(dev, child, PCI_POWERSTATE_D3); + } return (0); } @@ -4493,6 +4506,7 @@ int pci_resume_child(device_t dev, device_t child) { struct pci_devinfo *dinfo; + struct resource_list_entry *rle; if (pci_do_power_resume) pci_set_power_child(dev, child, PCI_POWERSTATE_D0); @@ -4503,6 +4517,16 @@ pci_resume_child(device_t dev, device_t child) pci_cfg_save(child, dinfo, 1); bus_generic_resume_child(dev, child); + + /* + * Allow interrupts only after fully resuming the driver and hardware. + */ + if (pci_do_power_suspend) { + /* See pci_suspend_child for details. */ + rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, 0); + if (rle != NULL && rle->res != NULL) + (void)bus_resume_intr(child, rle->res); + } return (0); } Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/kern/bus_if.m Mon Dec 17 17:11:00 2018 (r342170) @@ -472,6 +472,44 @@ METHOD int teardown_intr { }; /** + * @brief Suspend an interrupt handler + * + * This method is used to mark a handler as suspended in the case + * that the associated device is powered down and cannot be a source + * for the, typically shared, interrupt. + * The value of @p _irq must be the interrupt resource passed + * to a previous call to BUS_SETUP_INTR(). + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + */ +METHOD int suspend_intr { + device_t _dev; + device_t _child; + struct resource *_irq; +} DEFAULT bus_generic_suspend_intr; + +/** + * @brief Resume an interrupt handler + * + * This method is used to clear suspended state of a handler when + * the associated device is powered up and can be an interrupt source + * again. + * The value of @p _irq must be the interrupt resource passed + * to a previous call to BUS_SETUP_INTR(). + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + */ +METHOD int resume_intr { + device_t _dev; + device_t _child; + struct resource *_irq; +} DEFAULT bus_generic_resume_intr; + +/** * @brief Define a resource which can be allocated with * BUS_ALLOC_RESOURCE(). * Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/kern/kern_intr.c Mon Dec 17 17:11:00 2018 (r342170) @@ -721,6 +721,28 @@ intr_event_barrier(struct intr_event *ie) atomic_thread_fence_acq(); } +static void +intr_handler_barrier(struct intr_handler *handler) +{ + struct intr_event *ie; + + ie = handler->ih_event; + mtx_assert(&ie->ie_lock, MA_OWNED); + KASSERT((handler->ih_flags & IH_DEAD) == 0, + ("update for a removed handler")); + + if (ie->ie_thread == NULL) { + intr_event_barrier(ie); + return; + } + if ((handler->ih_flags & IH_CHANGED) == 0) { + handler->ih_flags |= IH_CHANGED; + intr_event_schedule_thread(ie); + } + while ((handler->ih_flags & IH_CHANGED) != 0) + msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); +} + /* * Sleep until an ithread finishes executing an interrupt handler. * @@ -842,6 +864,49 @@ intr_event_remove_handler(void *cookie) return (0); } +int +intr_event_suspend_handler(void *cookie) +{ + struct intr_handler *handler = (struct intr_handler *)cookie; + struct intr_event *ie; + + if (handler == NULL) + return (EINVAL); + ie = handler->ih_event; + KASSERT(ie != NULL, + ("interrupt handler \"%s\" has a NULL interrupt event", + handler->ih_name)); + mtx_lock(&ie->ie_lock); + handler->ih_flags |= IH_SUSP; + intr_handler_barrier(handler); + mtx_unlock(&ie->ie_lock); + return (0); +} + +int +intr_event_resume_handler(void *cookie) +{ + struct intr_handler *handler = (struct intr_handler *)cookie; + struct intr_event *ie; + + if (handler == NULL) + return (EINVAL); + ie = handler->ih_event; + KASSERT(ie != NULL, + ("interrupt handler \"%s\" has a NULL interrupt event", + handler->ih_name)); + + /* + * intr_handler_barrier() acts not only as a barrier, + * it also allows to check for any pending interrupts. + */ + mtx_lock(&ie->ie_lock); + handler->ih_flags &= ~IH_SUSP; + intr_handler_barrier(handler); + mtx_unlock(&ie->ie_lock); + return (0); +} + static int intr_event_schedule_thread(struct intr_event *ie) { @@ -1016,10 +1081,21 @@ intr_event_execute_handlers(struct proc *p, struct int */ ihp = ih; + if ((ih->ih_flags & IH_CHANGED) != 0) { + mtx_lock(&ie->ie_lock); + ih->ih_flags &= ~IH_CHANGED; + wakeup(ih); + mtx_unlock(&ie->ie_lock); + } + /* Skip filter only handlers */ if (ih->ih_handler == NULL) continue; + /* Skip suspended handlers */ + if ((ih->ih_flags & IH_SUSP) != 0) + continue; + /* * For software interrupt threads, we only execute * handlers that have their need flag set. Hardware @@ -1178,8 +1254,9 @@ intr_event_handle(struct intr_event *ie, struct trapfr struct intr_handler *ih; struct trapframe *oldframe; struct thread *td; - int ret, thread; int phase; + int ret; + bool filter, thread; td = curthread; @@ -1198,7 +1275,8 @@ intr_event_handle(struct intr_event *ie, struct trapfr * a trapframe as its argument. */ td->td_intr_nesting_level++; - thread = 0; + filter = false; + thread = false; ret = 0; critical_enter(); oldframe = td->td_intr_frame; @@ -1214,8 +1292,10 @@ intr_event_handle(struct intr_event *ie, struct trapfr atomic_thread_fence_seq_cst(); CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) { + if ((ih->ih_flags & IH_SUSP) != 0) + continue; if (ih->ih_filter == NULL) { - thread = 1; + thread = true; continue; } CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, @@ -1230,24 +1310,25 @@ intr_event_handle(struct intr_event *ie, struct trapfr (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), ("%s: incorrect return value %#x from %s", __func__, ret, ih->ih_name)); + filter = filter || ret == FILTER_HANDLED; - /* + /* * Wrapper handler special handling: * - * in some particular cases (like pccard and pccbb), + * in some particular cases (like pccard and pccbb), * the _real_ device handler is wrapped in a couple of * functions - a filter wrapper and an ithread wrapper. - * In this case (and just in this case), the filter wrapper + * In this case (and just in this case), the filter wrapper * could ask the system to schedule the ithread and mask * the interrupt source if the wrapped handler is composed * of just an ithread handler. * - * TODO: write a generic wrapper to avoid people rolling - * their own + * TODO: write a generic wrapper to avoid people rolling + * their own. */ if (!thread) { if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; + thread = true; } } atomic_add_rel_int(&ie->ie_active[phase], -1); @@ -1271,6 +1352,11 @@ intr_event_handle(struct intr_event *ie, struct trapfr } critical_exit(); td->td_intr_nesting_level--; +#ifdef notyet + /* The interrupt is not aknowledged by any filter and has no ithread. */ + if (!thread && !filter) + return (EINVAL); +#endif return (0); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/kern/subr_bus.c Mon Dec 17 17:11:00 2018 (r342170) @@ -4057,6 +4057,36 @@ bus_generic_teardown_intr(device_t dev, device_t child } /** + * @brief Helper function for implementing BUS_SUSPEND_INTR(). + * + * This simple implementation of BUS_SUSPEND_INTR() simply calls the + * BUS_SUSPEND_INTR() method of the parent of @p dev. + */ +int +bus_generic_suspend_intr(device_t dev, device_t child, struct resource *irq) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_SUSPEND_INTR(dev->parent, child, irq)); + return (EINVAL); +} + +/** + * @brief Helper function for implementing BUS_RESUME_INTR(). + * + * This simple implementation of BUS_RESUME_INTR() simply calls the + * BUS_RESUME_INTR() method of the parent of @p dev. + */ +int +bus_generic_resume_intr(device_t dev, device_t child, struct resource *irq) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_RESUME_INTR(dev->parent, child, irq)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_ADJUST_RESOURCE(). * * This simple implementation of BUS_ADJUST_RESOURCE() simply calls the @@ -4621,6 +4651,34 @@ bus_teardown_intr(device_t dev, struct resource *r, vo if (dev->parent == NULL) return (EINVAL); return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie)); +} + +/** + * @brief Wrapper function for BUS_SUSPEND_INTR(). + * + * This function simply calls the BUS_SUSPEND_INTR() method of the + * parent of @p dev. + */ +int +bus_suspend_intr(device_t dev, struct resource *r) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_SUSPEND_INTR(dev->parent, dev, r)); +} + +/** + * @brief Wrapper function for BUS_RESUME_INTR(). + * + * This function simply calls the BUS_RESUME_INTR() method of the + * parent of @p dev. + */ +int +bus_resume_intr(device_t dev, struct resource *r) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_RESUME_INTR(dev->parent, dev, r)); } /** Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/kern/subr_rman.c Mon Dec 17 17:11:00 2018 (r342170) @@ -94,6 +94,7 @@ struct resource_i { rman_res_t r_end; /* index of the last entry (inclusive) */ u_int r_flags; void *r_virtual; /* virtual address of this resource */ + void *r_irq_cookie; /* interrupt cookie for this (interrupt) resource */ device_t r_dev; /* device which has allocated this resource */ struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ @@ -866,6 +867,20 @@ rman_get_virtual(struct resource *r) { return (r->__r_i->r_virtual); +} + +void +rman_set_irq_cookie(struct resource *r, void *c) +{ + + r->__r_i->r_irq_cookie = c; +} + +void * +rman_get_irq_cookie(struct resource *r) +{ + + return (r->__r_i->r_irq_cookie); } void Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/sys/bus.h Mon Dec 17 17:11:00 2018 (r342170) @@ -485,6 +485,10 @@ int bus_generic_suspend(device_t dev); int bus_generic_suspend_child(device_t dev, device_t child); int bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); +int bus_generic_suspend_intr(device_t dev, device_t child, + struct resource *irq); +int bus_generic_resume_intr(device_t dev, device_t child, + struct resource *irq); int bus_generic_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map); @@ -535,6 +539,8 @@ int bus_setup_intr(device_t dev, struct resource *r, i driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep); int bus_teardown_intr(device_t dev, struct resource *r, void *cookie); +int bus_suspend_intr(device_t dev, struct resource *r); +int bus_resume_intr(device_t dev, struct resource *r); int bus_bind_intr(device_t dev, struct resource *r, int cpu); int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, const char *fmt, ...) __printflike(4, 5); Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/sys/interrupt.h Mon Dec 17 17:11:00 2018 (r342170) @@ -62,6 +62,8 @@ struct intr_handler { #define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ #define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ #define IH_DEAD 0x00000008 /* Handler should be removed. */ +#define IH_SUSP 0x00000010 /* Device is powered down. */ +#define IH_CHANGED 0x40000000 /* Handler state is changed. */ #define IH_MPSAFE 0x80000000 /* Handler does not need Giant. */ /* @@ -184,6 +186,8 @@ int intr_event_describe_handler(struct intr_event *ie, int intr_event_destroy(struct intr_event *ie); int intr_event_handle(struct intr_event *ie, struct trapframe *frame); int intr_event_remove_handler(void *cookie); +int intr_event_suspend_handler(void *cookie); +int intr_event_resume_handler(void *cookie); int intr_getaffinity(int irq, int mode, void *mask); void *intr_handler_source(void *cookie); int intr_setaffinity(int irq, int mode, void *mask); Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/sys/rman.h Mon Dec 17 17:11:00 2018 (r342170) @@ -131,6 +131,7 @@ bus_space_tag_t rman_get_bustag(struct resource *); rman_res_t rman_get_end(struct resource *); device_t rman_get_device(struct resource *); u_int rman_get_flags(struct resource *); +void *rman_get_irq_cookie(struct resource *); void rman_get_mapping(struct resource *, struct resource_map *); int rman_get_rid(struct resource *); rman_res_t rman_get_size(struct resource *); @@ -155,6 +156,7 @@ void rman_set_bushandle(struct resource *_r, bus_space void rman_set_bustag(struct resource *_r, bus_space_tag_t _t); void rman_set_device(struct resource *_r, device_t _dev); void rman_set_end(struct resource *_r, rman_res_t _end); +void rman_set_irq_cookie(struct resource *_r, void *_c); void rman_set_mapping(struct resource *, struct resource_map *); void rman_set_rid(struct resource *_r, int _rid); void rman_set_start(struct resource *_r, rman_res_t _start); Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Mon Dec 17 16:01:37 2018 (r342169) +++ head/sys/x86/x86/nexus.c Mon Dec 17 17:11:00 2018 (r342170) @@ -124,6 +124,8 @@ static int nexus_setup_intr(device_t, device_t, struct void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +static int nexus_suspend_intr(device_t, device_t, struct resource *); +static int nexus_resume_intr(device_t, device_t, struct resource *); static struct resource_list *nexus_get_reslist(device_t dev, device_t child); static int nexus_set_resource(device_t, device_t, int, int, rman_res_t, rman_res_t); @@ -161,6 +163,8 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_suspend_intr, nexus_suspend_intr), + DEVMETHOD(bus_resume_intr, nexus_resume_intr), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -595,6 +599,8 @@ nexus_setup_intr(device_t bus, device_t child, struct error = intr_add_handler(device_get_nameunit(child), rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain); + if (error == 0) + rman_set_irq_cookie(irq, *cookiep); return (error); } @@ -602,7 +608,24 @@ nexus_setup_intr(device_t bus, device_t child, struct static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { - return (intr_remove_handler(ih)); + int error; + + error = intr_remove_handler(ih); + if (error == 0) + rman_set_irq_cookie(r, NULL); + return (error); +} + +static int +nexus_suspend_intr(device_t dev, device_t child, struct resource *irq) +{ + return (intr_event_suspend_handler(rman_get_irq_cookie(irq))); +} + +static int +nexus_resume_intr(device_t dev, device_t child, struct resource *irq) +{ + return (intr_event_resume_handler(rman_get_irq_cookie(irq))); } #ifdef SMP From owner-svn-src-head@freebsd.org Mon Dec 17 17:21: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 F404C1346ACB; Mon, 17 Dec 2018 17:21:46 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 832D280FB0; Mon, 17 Dec 2018 17:21:46 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 674881A107; Mon, 17 Dec 2018 17:21:46 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHHLkH4087503; Mon, 17 Dec 2018 17:21:46 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHHLkF1087502; Mon, 17 Dec 2018 17:21:46 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812171721.wBHHLkF1087502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 17 Dec 2018 17:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342171 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 342171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 832D280FB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 17:21:47 -0000 Author: dab Date: Mon Dec 17 17:21:45 2018 New Revision: 342171 URL: https://svnweb.freebsd.org/changeset/base/342171 Log: asmc: Add support for mid-2011 Macmini 5,2 PR: 225911 Submitted by: trev Reported by: trev MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Dec 17 17:11:00 2018 (r342170) +++ head/sys/dev/asmc/asmc.c Mon Dec 17 17:21:45 2018 (r342171) @@ -260,6 +260,15 @@ struct asmc_model asmc_models[] = { ASMC_MM31_TEMPS, ASMC_MM31_TEMPNAMES, ASMC_MM31_TEMPDESCS }, + /* The Mac Mini 5,2 has no SMS */ + { + "Macmini5,2", "Apple SMC Mac Mini 5,2", + NULL, NULL, NULL, + ASMC_FAN_FUNCS2, + NULL, NULL, NULL, + ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS + }, + /* Idem for the MacPro */ { "MacPro2", "Apple SMC Mac Pro (8-core)", Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Mon Dec 17 17:11:00 2018 (r342170) +++ head/sys/dev/asmc/asmcvar.h Mon Dec 17 17:21:45 2018 (r342171) @@ -339,6 +339,41 @@ struct asmc_softc { "Northbridge Proximity Temperature", \ "Wireless Module Proximity Temperature", } +#define ASMC_MM52_TEMPS { "TA0P", "TA1P", \ + "TC0D", "TC0P", \ + "TG0D", "TG1D", \ + "TG0P", "TG0M", \ + "TI0P", \ + "TM0S", "TMBS", \ + "TM0P", "TP0P", \ + "TPCD", "Tp0C", \ + "TW0P", NULL } + +#define ASMC_MM52_TEMPNAMES { "ambient_air_proximity", "ambient_cpu_pch_wireless_dimm", \ + "cpu_die", "cpu_proximity", \ + "gpu_diode1", "gpu_diode2", \ + "gpu_proximity", "gpu_integrated_switcher", \ + "thunderbolt_proximity", \ + "memory_slot1", "memory_slot2", \ + "memory_proximity", "pch_controller_proximity", \ + "pch_controller_die", "pwr_supply", \ + "wireless_proximity", } + +#define ASMC_MM52_TEMPDESCS { "Ambient Air Proximity Temperature", \ + "Combo Ambient CPU PCH Wireless DIMM Temperature", \ + "CPU Die Temperature", "CPU Proximity Temperature", \ + "GPU Diode 1 Temperature" , "GPU Diode 2 Temperature", \ + "GPU Proximity Temperature", \ + "Integrated Graphics/GPU Switcher Temperature", \ + "Thunderbolt Proximity Temperature", \ + "Memory Slot 1 Temperature", \ + "Memory Slot 2 Temperature", \ + "Memory Slots Proximity Temperature", \ + "Platform Controller Hub Proximity Temperature", \ + "Platform Controller Hub Die Temperature", \ + "Power Supply Temperature", \ + "Wireless Module Proximity Temperature", } + #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ From owner-svn-src-head@freebsd.org Mon Dec 17 18:11: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 2D4DD1347EB8; Mon, 17 Dec 2018 18:11:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBE1182F47; Mon, 17 Dec 2018 18:11:06 +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 D18131AA86; Mon, 17 Dec 2018 18:11:06 +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 wBHIB6xN013372; Mon, 17 Dec 2018 18:11:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHIB6Hg013371; Mon, 17 Dec 2018 18:11:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201812171811.wBHIB6Hg013371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 17 Dec 2018 18:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342172 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 342172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBE1182F47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 18:11:07 -0000 Author: asomers Date: Mon Dec 17 18:11:06 2018 New Revision: 342172 URL: https://svnweb.freebsd.org/changeset/base/342172 Log: audit(4) tests: require /etc/rc.d/auditd These tests should be skipped if /etc/rc.d/auditd is missing, which could be the case if world was built with WITHOUT_AUDIT set. Also, one test case requires /etc/rc.d/accounting. Submitted by: ngie MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd/pull/240 Modified: head/tests/sys/audit/Makefile head/tests/sys/audit/administrative.c Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Mon Dec 17 17:21:45 2018 (r342171) +++ head/tests/sys/audit/Makefile Mon Dec 17 18:11:06 2018 (r342172) @@ -49,6 +49,7 @@ SRCS.miscellaneous+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive="true" +TEST_METADATA+= required_files="/etc/rc.d/auditd" WARNS?= 6 Modified: head/tests/sys/audit/administrative.c ============================================================================== --- head/tests/sys/audit/administrative.c Mon Dec 17 17:21:45 2018 (r342171) +++ head/tests/sys/audit/administrative.c Mon Dec 17 18:11:06 2018 (r342172) @@ -377,6 +377,8 @@ ATF_TC_HEAD(acct_success, tc) { atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " "acct(2) call"); + atf_tc_set_md_var(tc, "require.files", + "/etc/rc.d/accounting /etc/rc.d/auditd"); } ATF_TC_BODY(acct_success, tc) From owner-svn-src-head@freebsd.org Mon Dec 17 18:35: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 4D1E71348985; Mon, 17 Dec 2018 18:35:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A447D83FC0; Mon, 17 Dec 2018 18:35:35 +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 09DF21AEBF; Mon, 17 Dec 2018 18:35:33 +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 wBHIZWpX027525; Mon, 17 Dec 2018 18:35:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHIZWQE027523; Mon, 17 Dec 2018 18:35:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201812171835.wBHIZWQE027523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 17 Dec 2018 18:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342173 - in head: tests/sys tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: tests/sys tools/build/mk X-SVN-Commit-Revision: 342173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A447D83FC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 18:35:36 -0000 Author: asomers Date: Mon Dec 17 18:35:32 2018 New Revision: 342173 URL: https://svnweb.freebsd.org/changeset/base/342173 Log: Conditionalize installtion audit(4) tests on MK_AUDIT MK_AUDIT already controls auditd(8), praudit(1), etc. It should also control the audit test suite. Submitted by: ngie MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd/pull/240 Modified: head/tests/sys/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Dec 17 18:11:06 2018 (r342172) +++ head/tests/sys/Makefile Mon Dec 17 18:35:32 2018 (r342173) @@ -6,7 +6,7 @@ TESTSDIR= ${TESTSBASE}/sys TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio -TESTS_SUBDIRS+= audit +TESTS_SUBDIRS+= ${_audit} TESTS_SUBDIRS+= auditpipe TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} @@ -26,6 +26,10 @@ TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm + +.if ${MK_AUDIT} != "no" +_audit= audit +.endif .if ${MK_CDDL} != "no" _cddl= cddl Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 17 18:11:06 2018 (r342172) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 17 18:35:32 2018 (r342173) @@ -160,6 +160,22 @@ OLD_FILES+=usr/share/man/man5/auditdistd.conf.5.gz OLD_FILES+=usr/share/man/man8/audit.8.gz OLD_FILES+=usr/share/man/man8/auditd.8.gz OLD_FILES+=usr/share/man/man8/auditdistd.8.gz +OLD_FILES+=usr/tests/sys/audit/process-control +OLD_FILES+=usr/tests/sys/audit/open +OLD_FILES+=usr/tests/sys/audit/network +OLD_FILES+=usr/tests/sys/audit/miscellaneous +OLD_FILES+=usr/tests/sys/audit/Kyuafile +OLD_FILES+=usr/tests/sys/audit/ioctl +OLD_FILES+=usr/tests/sys/audit/inter-process +OLD_FILES+=usr/tests/sys/audit/file-write +OLD_FILES+=usr/tests/sys/audit/file-read +OLD_FILES+=usr/tests/sys/audit/file-delete +OLD_FILES+=usr/tests/sys/audit/file-create +OLD_FILES+=usr/tests/sys/audit/file-close +OLD_FILES+=usr/tests/sys/audit/file-attribute-modify +OLD_FILES+=usr/tests/sys/audit/file-attribute-access +OLD_FILES+=usr/tests/sys/audit/administrative +OLD_DIRS+=usr/tests/sys/audit .endif .if ${MK_AUTHPF} == no From owner-svn-src-head@freebsd.org Mon Dec 17 19:08: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 C16F513499A6; Mon, 17 Dec 2018 19:08:49 +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 133438556F; Mon, 17 Dec 2018 19:08:48 +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 962113D0133; Tue, 18 Dec 2018 06:08:37 +1100 (AEDT) Date: Tue, 18 Dec 2018 06:08:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrew Gallatin cc: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en In-Reply-To: <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> Message-ID: <20181218033137.Q2217@besplex.bde.org> References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> 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=DZtnkrlW c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=RpNjiQI2AAAA:8 a=lFH_ZaLGt7j6_0O9Q3YA:9 a=jpIH26JlB8aEU1M81S3jpgcb7nU=:19 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 133438556F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 19:08:50 -0000 On Mon, 17 Dec 2018, Andrew Gallatin wrote: > On 12/5/18 9:20 AM, Slava Shwartsman wrote: >> Author: slavash >> Date: Wed Dec 5 14:20:57 2018 >> New Revision: 341578 >> URL: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_341578&d=DwIDaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=BFp2c_-S0jnzRZJF2APwvTwmnmVFcyjcnBvHRZ3Locc&s=b7fvhOzf_b5bMVGquu4SaBhMNql5N8dVPAvpfKtz53Q&e= >> >> Log: >> mlx5en: Remove the DRBR and associated logic in the transmit path. >> The hardware queues are deep enough currently and using the DRBR and >> associated >> callbacks only leads to more task switching in the TX path. The is also >> a race >> setting the queue_state which can lead to hung TX rings. > > The point of DRBR in the tx path is not simply to provide a software ring for > queuing excess packets. Rather it provides a mechanism to > avoid lock contention by shoving a packet into the software ring, where > it will later be found & processed, rather than blocking the caller on > a mtx lock. I'm concerned you may have introduced a performance > regression for use cases where you have N:1 or N:M lock contention where > many threads on different cores are contending for the same tx queue. The > state of the art for this is no longer DRBR, but mp_ring, > as used by both cxgbe and iflib. iflib uses queuing techniques to significantly pessimize em NICs with 1 hardware queue. On fast machines, it attempts to do 1 context switch per (small) tx packet and can't keep up. On slow machines it has a chance of handling multiple packets per context switch, but since the machine is too slow it can't keep up and saturates at a slightly different point. Results for netblast $lanhost 5001 5 10 (5-byte payload for 10 seconds) on an I218V on Haswell 4 cores x 2 threads @4.08GHz running i386: Old results with no iflib and no EM_MULTIQUEUE except as indicated: FBSD-10 UP 1377+0 FBSD-11 UP 1326+0 FBSD-11 SMP-1 1484+0 FBSD-11 SMP-8 1395+0 FBSD-12mod SMP-1 1386+0 FBSD-12mod SMP-8 1422+0 FBSD-12mod SMP-1 1270+0 # use iflib (lose 8% performance) FBSD-12mod SMP-8 1279+0 # use iflib (lose 10% performance using more CPU) 1377+0 means 1377 kpps sent and 0 kpps errors, etc. SMP-8 means use all 8 CPUs. SMP-1 means restrict netblast to 1 CPU different from the taskqueue CPUs using cpuset. New results: FBSD-11 SMP-8 1440+0 # no iflib, no EM_MULTIQUEUE FBSD-11 SMP-8 1486+241 # no iflib, use EM_MULTIQUEUE (now saturate 1Gbps) FBSD-cur SMP-8 533+0 # use iflib, use i386 with 4G KVA iflib only decimates performance relative to the FreeBSD-11 version with no EM_MULTIQUEUE, but EM_MULTIQUEUE gives better queueing using more CPUs. This gives the extra 10-20% of performance needed to saturate the NIC and 1Gbps ethernet. The FreeBSD-current version is not directly comparable since using 4G KVA on i386 reduces performance by about a factor of 2.5 for all loads with mostly small i/o's (for 128K disk i/o's the reduction is only 10-20%). i386 ran at about the same speed as amd64 when it had 1GB KVA, but I don't have any savd results for amd64 to compare with precisely). This is all with security-related things like ibrs unavailable or turned off. All versions use normal Intel interrupt moderation which gives an interrupt rate of 8k/sec. Old versions of em use a "fast" interrupt handler and a slow switch to a taskqueue. This gives a contex switch rate of about 16k/ sec. In the SMP case, netblast normally runs on another CPU and I think it fills h/w tx queue(s) synchronously, and the taskqueue only does minor cleanups. Old em also has a ping latency of about 10% smaller than with iflib (73 usec instead of 80 usec after setting em.x.itr to 0 and other tuning to kill interrupt moderation, and similar for a bge NIC on the other end). The synchronous queue filling probably improves latency, but it is hard to see how it makes a difference of more than 1 usec. 73 is already too high. An old PRO1000 Intel NIC has a latency of only 50 usec on the same network. The switch costs about 20 usec of this. iflib uses taskqueue more. netblast normally runs on another CPU and I think it only fills s/w tx queue(s) synchronously, and wakes up the taskqueues for every packet. The CPUs are almost fast enough to keep up, and the system does about 1M context switches for this (in versions other than i386 with 4G KVA). That is slightly more than 2 packets per switch to get the speed of 1279 kpps. netblast uses 100% of 1 CPU but the taskqueues don't saturate their CPUs although they should so as to do even more context switches. They still use a lot of CPU (about 50% of 1 CPU more than in old em). These context switches lose by doing the opposite of interrupt moderation. I can "fix" the extra context switches and restore some of the lost performance and most of the lost CPU by running netblast on the same CPU as the main taskqueue (and using my normal configuration of no PREEMPTION and no IPI_PREEMPTION) or by breaking the scheduler to never preempt to a higher priority thread. Non-broken schedulers preempt idle threads to run higher priority threads even without PREEMPTION. PREEMPTION gives this preemption for non-idle threads too. So my "fix" stops the taskqueue being preempted to on every packet. netblast gets preempted eventually and waits for the taskqueue, but it still manages to send more packets using less CPU. My "fix" doesn't quite give UP behaviour. PREEMPTION is necessary with UP, and the "fix" depends on not having it. I haven't tested this. Scheduling makes little difference for old em since the taskqueue only runs for tx interrupts and then does very little. tx interrupts are very unimportant for this benchmark on old em and bge. My bge tuning delays them for up to 1 second if possible when tuning for throughput over latency. The relative effect of this "fix" is shown for the PRO1000 NIC by: FBSD-cur SMP-1 293+773 # iflib, i386 with 4G KVA, cpuset to taskq CPU FBSD-cur SMP-1 like SMP-8 # iflib, i386 with 4G KVA, cpuset to non-taskq CPU FBSD-cur SMP-8 279+525 # iflib, i386 with 4G KVA This NIC seemed to saturate and 280 kpps on all systems, but the "fix" lets it reach 293 kpps and leaves enough CPU to spare to generate and drop 248 kpps. The dropped packet count is a good test of the comination of CPU to spare and efficiency of dropping packets. Old versions of FreeBSD and em have much more CPU to spare and drop packets more efficiently by peeking at the ifq high in the network stack. They can generate and drop about 2000 kpps on this NIC, but the best iflib version can only do this for about 1000 kpps. The Haswell CPU has 4 cores x 2 threads, and sharing CPUs is about 67% slower for each CPU of an HTT pair. The main taskq is on CPU6 and the other taskq is on CPU7. Running netblast on CPU6 gives the speedup. Running netbast on CP7 gives HTT contention, but this makes little difference. On the PRO1000 where the NIC saturates first so that the taskq's don't run so often, there CPU uses are about 35% for CPU6 and 1% for CPU7 when netblast is run on CPU0. So there is only about 35% HTT and netblast contention when netblast is run on CPU7. > For well behaved workloads (like Netflix's), I don't anticipate > this being a performance issue. However, I worry that this will impact > other workloads and that you should consider running some testing of > N:1 contention. Eg, 128 netperfs running in parallel with only > a few nic tx rings. For the I218V, before iflib 2 netblasts got closer to saturating the NIC but 8 netblasts were slower than 1. Checking this now with the PRO1000, the total kpps counts (all with about 280 kpps actually sent) are: 1 netblast: 537 2 netblasts: 949 (high variance from now on, just a higher sample) 3 netblasts: 1123 4 netblasts: 1206 5 netblasts: 1129 6 netblasts: 1094 7 netblasts: 1080 8 netblasts: 1016 So the contention is much the same as before for the dropping-packets part after the NIC saturates. Maybe it is all in the network stack. There is a lot of slowness there too, so a 4GHz CPU is needed to almost keep up with the network for small packets sent by any 1Gbps NIC. Multi-queue NICs obviously need something like taskqueues to avoid contention with multiple senders, but to be fast the taskqueues you have to have enough CPUs to dedicate 1 CPU per queue and don't wast time and latency context- switching this CPU to the idle thread. According to lmbench, the context switch latency on the test system is between 1.1 and 1.8 usec for all cases between 2proc/0K and 16proc/64K. Context switches to and from the idle thread are much faster, and they need to be to reach 1M/sec. Watching context switches more carefully using top -m io shows that for 1 netblast to the PRO1000 they are: 259k/sec for if_io_tqg_6 (names are too verbose and are truncated by top) 259k/sec for idle: cpu on same CPU as above 7.9k/sec for if_io_tqg_7 7.9k/sec for idle: cpu on same CPU as above These are much less than 1M/sec because i386 with 4G KVA is several times slower than i386 with 1G KVA. I mostly use the PRO1000 because its ping latency with best configuration is 50 usec instead of 80 usec and only the latency matters for nfs use. Bruce From owner-svn-src-head@freebsd.org Mon Dec 17 19:50: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 A003B134AA5B; Mon, 17 Dec 2018 19:50:06 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 441D4871DF; Mon, 17 Dec 2018 19:50:06 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id A7FBB27002EB; Mon, 17 Dec 2018 14:50:04 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu A7FBB27002EB DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1545076204; bh=i+m0zteltLs/YesmOOTxa/ZJqLlueyEod3q3m8kBaZY=; h=Subject:To:From:Date:From; b=dZuM6N26fjCl6LrHZMGRATi7/r3CIkGECZG65NtpqYVG/S79TSIpA8EeOPS+fl14O 8qKJNDiLJPGJ2x718CnMT2kyWCxSHCMO84aZaQo3xDvVYryl66/P87GyZ2HofJqIbA PlCDhCNE9oaGiIWDb7Sv9gCkcAPTfDAleHwIEOoDZEsxjCyYXwHzGhSWRICkFUrsO7 P79Xe2QamNh1uYz5dPRodSnjNrOfPNnEQB4HNWrieIyWS5TQj7ymoXRCdEBIljCN7e RvtGbSsbMTN4LPkbPFHmQaJVjMcu2/weeJ/aXlwuFJtiu2VYntm5YKPeZl6N4Xpo6f KwdLHWCjq1ujQ== Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: Bruce Evans Cc: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> <20181218033137.Q2217@besplex.bde.org> From: Andrew Gallatin Message-ID: Date: Mon, 17 Dec 2018 14:50:04 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20181218033137.Q2217@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 441D4871DF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 19:50:06 -0000 On 12/17/18 2:08 PM, Bruce Evans wrote: > On Mon, 17 Dec 2018, Andrew Gallatin wrote: > >> On 12/5/18 9:20 AM, Slava Shwartsman wrote: >>> Author: slavash >>> Date: Wed Dec  5 14:20:57 2018 >>> New Revision: 341578 >>> URL: >>> https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_341578&d=DwIDaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=BFp2c_-S0jnzRZJF2APwvTwmnmVFcyjcnBvHRZ3Locc&s=b7fvhOzf_b5bMVGquu4SaBhMNql5N8dVPAvpfKtz53Q&e= >>> >>> >>> Log: >>>    mlx5en: Remove the DRBR and associated logic in the transmit path. >>>       The hardware queues are deep enough currently and using the >>> DRBR and associated >>>    callbacks only leads to more task switching in the TX path. The is >>> also a race >>>    setting the queue_state which can lead to hung TX rings. >> >> The point of DRBR in the tx path is not simply to provide a software >> ring for queuing excess packets.  Rather it provides a mechanism to >> avoid lock contention by shoving a packet into the software ring, where >> it will later be found & processed, rather than blocking the caller on >> a mtx lock.   I'm concerned you may have introduced a performance >> regression for use cases where you have N:1  or N:M lock contention >> where many threads on different cores are contending for the same tx >> queue.  The state of the art for this is no longer DRBR, but mp_ring, >> as used by both cxgbe and iflib. > > iflib uses queuing techniques to significantly pessimize em NICs with 1 > hardware queue.  On fast machines, it attempts to do 1 context switch per This can happen even w/o contention when "abdicate" is enabled in mp ring. I complained about this as well, and the default was changed in mp ring to not always "abdicate" (eg, switch to the tq to handle the packet). Abdication substantially pessimizes Netflix style web uncontended workloads, but it generally helps small packet forwarding. It is interesting that you see the opposite. I should try benchmarking with just a single ring. > (small) tx packet and can't keep up.  On slow machines it has a chance of > handling multiple packets per context switch, but since the machine is too > slow it can't keep up and saturates at a slightly different point.  Results > for netblast $lanhost 5001 5 10 (5-byte payload for 10 seconds) on an I218V > on Haswell 4 cores x 2 threads @4.08GHz running i386: > > Old results with no iflib and no EM_MULTIQUEUE except as indicated: > > FBSD-10     UP    1377+0 > FBSD-11     UP    1326+0 > FBSD-11     SMP-1 1484+0 > FBSD-11     SMP-8 1395+0 > FBSD-12mod  SMP-1 1386+0 > FBSD-12mod  SMP-8 1422+0 > FBSD-12mod  SMP-1 1270+0   # use iflib (lose 8% performance) > FBSD-12mod  SMP-8 1279+0   # use iflib (lose 10% performance using more > CPU) > > 1377+0 means 1377 kpps sent and 0 kpps errors, etc.  SMP-8 means use all 8 > CPUs.  SMP-1 means restrict netblast to 1 CPU different from the taskqueue > CPUs using cpuset. > > New results: > > FBSD-11     SMP-8 1440+0   # no iflib, no EM_MULTIQUEUE > FBSD-11     SMP-8 1486+241 # no iflib, use EM_MULTIQUEUE (now saturate > 1Gbps) > FBSD-cur    SMP-8  533+0   # use iflib, use i386 with 4G KVA > > iflib only decimates performance relative to the FreeBSD-11 version > with no EM_MULTIQUEUE, but EM_MULTIQUEUE gives better queueing using > more CPUs.  This gives the extra 10-20% of performance needed to > saturate the NIC and 1Gbps ethernet.  The FreeBSD-current version is > not directly comparable since using 4G KVA on i386 reduces performance > by about a factor of 2.5 for all loads with mostly small i/o's (for > 128K disk i/o's the reduction is only 10-20%).  i386 ran at about the > same speed as amd64 when it had 1GB KVA, but I don't have any savd > results for amd64 to compare with precisely).  This is all with > security-related things like ibrs unavailable or turned off. > > All versions use normal Intel interrupt moderation which gives an interrupt > rate of 8k/sec. > > Old versions of em use a "fast" interrupt handler and a slow switch > to a taskqueue.  This gives a contex switch rate of about 16k/ sec. > In the SMP case, netblast normally runs on another CPU and I think it > fills h/w tx queue(s) synchronously, and the taskqueue only does minor > cleanups.  Old em also has a ping latency of about 10% smaller than > with iflib (73 usec instead of 80 usec after setting em.x.itr to 0 and > other tuning to kill interrupt moderation, and similar for a bge NIC > on the other end).  The synchronous queue filling probably improves > latency, but it is hard to see how it makes a difference of more than > 1 usec.  73 is already too high.  An old PRO1000 Intel NIC has a latency > of only 50 usec on the same network.  The switch costs about 20 usec > of this. > > iflib uses taskqueue more.  netblast normally runs on another CPU and > I think it only fills s/w tx queue(s) synchronously, and wakes up the > taskqueues for every packet.  The CPUs are almost fast enough to keep > up, and the system does about 1M context switches for this (in versions > other than i386 with 4G KVA).  That is slightly more than 2 packets per > switch to get the speed of 1279 kpps.  netblast uses 100% of 1 CPU but > the taskqueues don't saturate their CPUs although they should so as to > do even more context switches.  They still use a lot of CPU (about 50% > of 1 CPU more than in old em).  These context switches lose by doing > the opposite of interrupt moderation. > > I can "fix" the extra context switches and restore some of the lost > performance and most of the lost CPU by running netblast on the same > CPU as the main taskqueue (and using my normal configuration of no > PREEMPTION and no IPI_PREEMPTION) or by breaking the scheduler to never > preempt to a higher priority thread.  Non-broken schedulers preempt > idle threads to run higher priority threads even without PREEMPTION. > PREEMPTION gives this preemption for non-idle threads too.  So my > "fix" stops the taskqueue being preempted to on every packet. > netblast gets preempted eventually and waits for the taskqueue, but > it still manages to send more packets using less CPU. > > My "fix" doesn't quite give UP behaviour.  PREEMPTION is necessary with > UP, and the "fix" depends on not having it.  I haven't tested this. > Scheduling makes little difference for old em since the taskqueue only > runs for tx interrupts and then does very little.  tx interrupts are > very unimportant for this benchmark on old em and bge.  My bge tuning > delays them for up to 1 second if possible when tuning for throughput > over latency. > > The relative effect of this "fix" is shown for the PRO1000 NIC by: > > FBSD-cur  SMP-1 293+773    # iflib, i386 with 4G KVA, cpuset to taskq CPU > FBSD-cur  SMP-1 like SMP-8 # iflib, i386 with 4G KVA, cpuset to > non-taskq CPU > FBSD-cur  SMP-8 279+525    # iflib, i386 with 4G KVA > > This NIC seemed to saturate and 280 kpps on all systems, but the "fix" > lets it reach 293 kpps and leaves enough CPU to spare to generate and > drop 248 kpps.  The dropped packet count is a good test of the comination > of CPU to spare and efficiency of dropping packets.  Old versions of > FreeBSD and em have much more CPU to spare and drop packets more > efficiently > by peeking at the ifq high in the network stack.  They can generate and > drop about 2000 kpps on this NIC, but the best iflib version can only > do this for about 1000 kpps. > > The Haswell CPU has 4 cores x 2 threads, and sharing CPUs is about 67% > slower for each CPU of an HTT pair.  The main taskq is on CPU6 and the > other taskq is on CPU7.  Running netblast on CPU6 gives the speedup. > Running netbast on CP7 gives HTT contention, but this makes little > difference.  On the PRO1000 where the NIC saturates first so that the > taskq's don't run so often, there CPU uses are about 35% for CPU6 and > 1% for CPU7 when netblast is run on CPU0.  So there is only about 35% > HTT and netblast contention when netblast is run on CPU7. > >> For well behaved workloads (like Netflix's), I don't anticipate >> this being a performance issue.  However, I worry that this will impact >> other workloads and that you should consider running some testing of >> N:1 contention.   Eg, 128 netperfs running in parallel with only >> a few nic tx rings. > > For the I218V, before iflib 2 netblasts got closer to saturating the NIC > but 8 netblasts were slower than 1.  Checking this now with the PRO1000, > the total kpps counts (all with about 280 kpps actually sent) are: > > 1 netblast:   537 > 2 netblasts:  949 (high variance from now on, just a higher sample) > 3 netblasts: 1123 > 4 netblasts: 1206 > 5 netblasts: 1129 > 6 netblasts: 1094 > 7 netblasts: 1080 > 8 netblasts: 1016 > > So the contention is much the same as before for the dropping-packets part > after the NIC saturates.  Maybe it is all in the network stack.  There is > a lot of slowness there too, so a 4GHz CPU is needed to almost keep up with > the network for small packets sent by any 1Gbps NIC. > > Multi-queue NICs obviously need something like taskqueues to avoid > contention > with multiple senders, but to be fast the taskqueues you have to have > enough > CPUs to dedicate 1 CPU per queue and don't wast time and latency context- > switching this CPU to the idle thread.  According to lmbench, the context > switch latency on the test system is between 1.1 and 1.8 usec for all cases > between 2proc/0K and 16proc/64K.  Context switches to and from the idle > thread are much faster, and they need to be to reach 1M/sec.  Watching > context switches more carefully using top -m io shows that for 1 netblast > to the PRO1000 they are: > > 259k/sec for if_io_tqg_6 (names are too verbose and are truncated by top) > 259k/sec for idle: cpu on same CPU as above > 7.9k/sec for if_io_tqg_7 > 7.9k/sec for idle: cpu on same CPU as above > > These are much less than 1M/sec because i386 with 4G KVA is several times > slower than i386 with 1G KVA. > > I mostly use the PRO1000 because its ping latency with best configuration > is 50 usec instead of 80 usec and only the latency matters for nfs use. > > Bruce I think part of the problem with iflib is just its sheer size, but some of that is hard to avoid due to it being an intermediate shim layer & having to translate packets. One thing I think could help is to do the conversion from mbufs to iflib's packet info data structure at entry into iflib, and not at xmit time. This the stuff that parses the mbufs, does the virt to phys, and basically will take cache misses if it runs on a different CPU, but seems less likely to take cache misses if run just after ether_output() (which has likely already taken misses). I've been trying to find the time to make this change for a while. It would be interesting to see if it helps your workload too. Drew From owner-svn-src-head@freebsd.org Mon Dec 17 21:13: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 7AD32134C8CF; Mon, 17 Dec 2018 21:13:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F420A8AE2D; Mon, 17 Dec 2018 21:13:09 +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 F2BC81CA62; Mon, 17 Dec 2018 21:13:05 +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 wBHLD5RO011890; Mon, 17 Dec 2018 21:13:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHLD5DU011889; Mon, 17 Dec 2018 21:13:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812172113.wBHLD5DU011889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 17 Dec 2018 21:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342178 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 342178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F420A8AE2D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 21:13:10 -0000 Author: markj Date: Mon Dec 17 21:13:05 2018 New Revision: 342178 URL: https://svnweb.freebsd.org/changeset/base/342178 Log: Revert r336326. In testing on a Dell Latitude 7480, having ig4.ko loaded during a suspend caused the system to hang. It turns out that ig4iic_intr() was being called after the device entered D3, and entered an infinite loop because a read of the I2C status register returned all ones, causing us to attempt to read a byte from the data buffer until one of the status bits clears. This occured because ig4iic_pci0 shares an interrupt with the VGA device on this laptop, so ig4iic_intr() gets called even when there is no work to do. This is exactly the problem fixed by r342170, which resolves the hang for me and allows suspend/resume to work with ig4.ko loaded. So, re-enable autoloading of ig4.ko in the hope that r342170 resolves the problem universally. Reviewed by: gonzo MFC after: 1 month (pending an MFC of r342170) Differential Revision: https://reviews.freebsd.org/D18587 Modified: head/sys/dev/ichiic/ig4_pci.c Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Mon Dec 17 20:23:27 2018 (r342177) +++ head/sys/dev/ichiic/ig4_pci.c Mon Dec 17 21:13:05 2018 (r342178) @@ -232,7 +232,5 @@ DRIVER_MODULE_ORDERED(ig4iic_pci, pci, ig4iic_pci_driv MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1); MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(ig4iic_pci, 1); -/* - * Loading this module breaks suspend/resume on laptops - * Do not add MODULE_PNP_INFO until it's impleneted - */ +MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic_pci, ig4iic_pci_devices, + sizeof(ig4iic_pci_devices[0]), nitems(ig4iic_pci_devices)); From owner-svn-src-head@freebsd.org Mon Dec 17 21:33: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 A2720134CEC5; Mon, 17 Dec 2018 21:33:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 444CB8BA12; Mon, 17 Dec 2018 21:33:26 +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 38F051CDDF; Mon, 17 Dec 2018 21:33:26 +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 wBHLXQuP022300; Mon, 17 Dec 2018 21:33:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHLXQWf022299; Mon, 17 Dec 2018 21:33:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812172133.wBHLXQWf022299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Dec 2018 21:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342179 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 342179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 444CB8BA12 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 21:33:26 -0000 Author: avg Date: Mon Dec 17 21:33:25 2018 New Revision: 342179 URL: https://svnweb.freebsd.org/changeset/base/342179 Log: fix formatting and style in ig4iic_acpi_probe afetr r339754 This includes removing stray whitespace, adding a line after the variable declaration block and removing a redundant check. MFC after: 1 week X-MFC with: r339754 Modified: head/sys/dev/ichiic/ig4_acpi.c Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Mon Dec 17 21:13:05 2018 (r342178) +++ head/sys/dev/ichiic/ig4_acpi.c Mon Dec 17 21:33:25 2018 (r342179) @@ -71,21 +71,17 @@ ig4iic_acpi_probe(device_t dev) ig4iic_softc_t *sc; char *hid; int rv; - sc = device_get_softc(dev); + sc = device_get_softc(dev); if (acpi_disabled("ig4iic")) return (ENXIO); rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, &hid); - if (rv > 0){ + if (rv > 0) return (rv); - } if (strcmp("AMDI0010", hid) == 0) sc->access_intr_mask = 1; - - - if (rv <= 0) - device_set_desc(dev, "Designware I2C Controller"); + device_set_desc(dev, "Designware I2C Controller"); return (rv); } From owner-svn-src-head@freebsd.org Mon Dec 17 21:34: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 B2B24134CF1E; Mon, 17 Dec 2018 21:34:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 599778BB42; Mon, 17 Dec 2018 21:34:10 +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 4E8A51CDE1; Mon, 17 Dec 2018 21:34:10 +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 wBHLYAc5022372; Mon, 17 Dec 2018 21:34:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHLYAfT022371; Mon, 17 Dec 2018 21:34:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812172134.wBHLYAfT022371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 17 Dec 2018 21:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342180 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 342180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 599778BB42 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 21:34:10 -0000 Author: markj Date: Mon Dec 17 21:34:09 2018 New Revision: 342180 URL: https://svnweb.freebsd.org/changeset/base/342180 Log: Catch up with r338948. MFC with: r342178 Modified: head/sys/dev/ichiic/ig4_pci.c Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Mon Dec 17 21:33:25 2018 (r342179) +++ head/sys/dev/ichiic/ig4_pci.c Mon Dec 17 21:34:09 2018 (r342180) @@ -233,4 +233,4 @@ MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1); MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(ig4iic_pci, 1); MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic_pci, ig4iic_pci_devices, - sizeof(ig4iic_pci_devices[0]), nitems(ig4iic_pci_devices)); + nitems(ig4iic_pci_devices)); From owner-svn-src-head@freebsd.org Mon Dec 17 21:48: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 C96A0134D642; Mon, 17 Dec 2018 21:48: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7598C487; Mon, 17 Dec 2018 21:48: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 62B801CFAC; Mon, 17 Dec 2018 21:48: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 wBHLmLFW027871; Mon, 17 Dec 2018 21:48:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHLmKIp027867; Mon, 17 Dec 2018 21:48:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812172148.wBHLmKIp027867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 17 Dec 2018 21:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342182 - in head/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Commit-Revision: 342182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F7598C487 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 Dec 2018 21:48:22 -0000 Author: markj Date: Mon Dec 17 21:48:20 2018 New Revision: 342182 URL: https://svnweb.freebsd.org/changeset/base/342182 Log: Remove UMS support code from radeonkms. The code is unreachable since the entries of radeon_ioctls[] are not associated with any device: we provide only the KMS entry points. Moreover, r600_cp_dispatch_texture() contains an integer overflow bug that can be triggered from userspace.[1] Reported by: Anonymous of the Shellphish Grill Team[1] Reviewed by: dumbbell MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18516 Deleted: head/sys/dev/drm2/radeon/r300_cmdbuf.c head/sys/dev/drm2/radeon/r600_blit.c head/sys/dev/drm2/radeon/r600_cp.c head/sys/dev/drm2/radeon/radeon_cp.c head/sys/dev/drm2/radeon/radeon_ioc32.c head/sys/dev/drm2/radeon/radeon_state.c Modified: head/sys/dev/drm2/radeon/r600_blit_kms.c head/sys/dev/drm2/radeon/r600_cs.c head/sys/dev/drm2/radeon/radeon_irq.c head/sys/modules/drm2/radeonkms/Makefile Modified: head/sys/dev/drm2/radeon/r600_blit_kms.c ============================================================================== --- head/sys/dev/drm2/radeon/r600_blit_kms.c Mon Dec 17 21:46:42 2018 (r342181) +++ head/sys/dev/drm2/radeon/r600_blit_kms.c Mon Dec 17 21:48:20 2018 (r342182) @@ -35,6 +35,39 @@ __FBSDID("$FreeBSD$"); #include "r600_blit_shaders.h" #include "radeon_blit_common.h" +/* 23 bits of float fractional data */ +#define I2F_FRAC_BITS 23 +#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) + +/* + * Converts unsigned integer into 32-bit IEEE floating point representation. + * Will be exact from 0 to 2^24. Above that, we round towards zero + * as the fractional bits will not fit in a float. (It would be better to + * round towards even as the fpu does, but that is slower.) + * + * Moved from r600_blit.c after that file was removed. + */ +__pure uint32_t int2float(uint32_t x) +{ + uint32_t msb, exponent, fraction; + + /* Zero is special */ + if (!x) return 0; + + /* Get location of the most significant bit */ + msb = fls(x); + + /* + * Use a rotate instead of a shift because that works both leftwards + * and rightwards due to the mod(32) behaviour. This means we don't + * need to check to see if we are above 2^24 or not. + */ + fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; + exponent = (127 + msb) << I2F_FRAC_BITS; + + return fraction + exponent; +} + /* emits 21 on rv770+, 23 on r600 */ static void set_render_target(struct radeon_device *rdev, int format, Modified: head/sys/dev/drm2/radeon/r600_cs.c ============================================================================== --- head/sys/dev/drm2/radeon/r600_cs.c Mon Dec 17 21:46:42 2018 (r342181) +++ head/sys/dev/drm2/radeon/r600_cs.c Mon Dec 17 21:48:20 2018 (r342182) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); static int r600_cs_packet_next_reloc_mm(struct radeon_cs_parser *p, struct radeon_cs_reloc **cs_reloc); -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc); typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**); static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm; #ifdef FREEBSD_WIP /* FreeBSD: to please GCC 4.2. */ @@ -885,53 +883,6 @@ static int r600_cs_packet_next_reloc_mm(struct radeon_ } /** - * r600_cs_packet_next_reloc_nomm() - parse next packet which should be reloc packet3 - * @parser: parser structure holding parsing context. - * @data: pointer to relocation data - * @offset_start: starting offset - * @offset_mask: offset mask (to align start offset on) - * @reloc: reloc informations - * - * Check next packet is relocation packet3, do bo validation and compute - * GPU offset using the provided start. - **/ -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc) -{ - struct radeon_cs_chunk *relocs_chunk; - struct radeon_cs_packet p3reloc; - unsigned idx; - int r; - - if (p->chunk_relocs_idx == -1) { - DRM_ERROR("No relocation chunk !\n"); - return -EINVAL; - } - *cs_reloc = NULL; - relocs_chunk = &p->chunks[p->chunk_relocs_idx]; - r = r600_cs_packet_parse(p, &p3reloc, p->idx); - if (r) { - return r; - } - p->idx += p3reloc.count + 2; - if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) { - DRM_ERROR("No packet3 for relocation for packet at %d.\n", - p3reloc.idx); - return -EINVAL; - } - idx = radeon_get_ib_value(p, p3reloc.idx + 1); - if (idx >= relocs_chunk->length_dw) { - DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", - idx, relocs_chunk->length_dw); - return -EINVAL; - } - *cs_reloc = p->relocs; - (*cs_reloc)->lobj.gpu_offset = (u64)relocs_chunk->kdata[idx + 3] << 32; - (*cs_reloc)->lobj.gpu_offset |= relocs_chunk->kdata[idx + 0]; - return 0; -} - -/** * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc * @parser: parser structure holding parsing context. * @@ -2456,105 +2407,6 @@ int r600_cs_parse(struct radeon_cs_parser *p) free(p->track, DRM_MEM_DRIVER); p->track = NULL; return 0; -} - -static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) -{ - if (p->chunk_relocs_idx == -1) { - return 0; - } - p->relocs = malloc(sizeof(struct radeon_cs_reloc), - DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (p->relocs == NULL) { - return -ENOMEM; - } - return 0; -} - -/** - * cs_parser_fini() - clean parser states - * @parser: parser structure holding parsing context. - * @error: error number - * - * If error is set than unvalidate buffer, otherwise just free memory - * used by parsing context. - **/ -static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) -{ - unsigned i; - - free(parser->relocs, DRM_MEM_DRIVER); - for (i = 0; i < parser->nchunks; i++) { - free(parser->chunks[i].kdata, DRM_MEM_DRIVER); - if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { - free(parser->chunks[i].kpage[0], DRM_MEM_DRIVER); - free(parser->chunks[i].kpage[1], DRM_MEM_DRIVER); - } - } - free(parser->chunks, DRM_MEM_DRIVER); - free(parser->chunks_array, DRM_MEM_DRIVER); - free(parser->track, DRM_MEM_DRIVER); -} - -int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, - unsigned family, u32 *ib, int *l) -{ - struct radeon_cs_parser parser; - struct radeon_cs_chunk *ib_chunk; - struct r600_cs_track *track; - int r; - - /* initialize tracker */ - track = malloc(sizeof(*track), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (track == NULL) - return -ENOMEM; - r600_cs_track_init(track); - r600_cs_legacy_get_tiling_conf(dev, &track->npipes, &track->nbanks, &track->group_size); - /* initialize parser */ - memset(&parser, 0, sizeof(struct radeon_cs_parser)); - parser.filp = filp; - parser.dev = dev->dev; - parser.rdev = NULL; - parser.family = family; - parser.track = track; - parser.ib.ptr = ib; - r = radeon_cs_parser_init(&parser, data); - if (r) { - DRM_ERROR("Failed to initialize parser !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = r600_cs_parser_relocs_legacy(&parser); - if (r) { - DRM_ERROR("Failed to parse relocation !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - /* Copy the packet into the IB, the parser will read from the - * input memory (cached) and write to the IB (which can be - * uncached). */ - ib_chunk = &parser.chunks[parser.chunk_ib_idx]; - parser.ib.length_dw = ib_chunk->length_dw; - *l = parser.ib.length_dw; - r = r600_cs_parse(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = radeon_cs_finish_pages(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r600_cs_parser_fini(&parser, r); - return r; -} - -void r600_cs_legacy_init(void) -{ - r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_nomm; } /* Modified: head/sys/dev/drm2/radeon/radeon_irq.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_irq.c Mon Dec 17 21:46:42 2018 (r342181) +++ head/sys/dev/drm2/radeon/radeon_irq.c Mon Dec 17 21:48:20 2018 (r342182) @@ -221,41 +221,6 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) return IRQ_HANDLED; } -static int radeon_emit_irq(struct drm_device * dev) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - unsigned int ret; - RING_LOCALS; - - atomic_inc(&dev_priv->swi_emitted); - ret = atomic_read(&dev_priv->swi_emitted); - - BEGIN_RING(4); - OUT_RING_REG(RADEON_LAST_SWI_REG, ret); - OUT_RING_REG(RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE); - ADVANCE_RING(); - COMMIT_RING(); - - return ret; -} - -static int radeon_wait_irq(struct drm_device * dev, int swi_nr) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *) dev->dev_private; - int ret = 0; - - if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr) - return 0; - - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; - - DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, - RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); - - return ret; -} - u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc) { drm_radeon_private_t *dev_priv = dev->dev_private; @@ -281,52 +246,6 @@ u32 radeon_get_vblank_counter(struct drm_device *dev, else return RADEON_READ(RADEON_CRTC2_CRNT_FRAME); } -} - -/* Needs the lock as it touches the ring. - */ -int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_emit_t *emit = data; - int result; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - LOCK_TEST_WITH_RETURN(dev, file_priv); - - result = radeon_emit_irq(dev); - - if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { - DRM_ERROR("copy_to_user\n"); - return -EFAULT; - } - - return 0; -} - -/* Doesn't need the hardware lock. - */ -int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_wait_t *irqwait = data; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - return radeon_wait_irq(dev, irqwait->irq_seq); } /* drm_dma.h hooks Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Mon Dec 17 21:46:42 2018 (r342181) +++ head/sys/modules/drm2/radeonkms/Makefile Mon Dec 17 21:48:20 2018 (r342182) @@ -25,7 +25,6 @@ SRCS += \ radeon_clocks.c \ radeon_combios.c \ radeon_connectors.c \ - radeon_cp.c \ radeon_cs.c \ radeon_cursor.c \ radeon_device.c \ @@ -50,7 +49,6 @@ SRCS += \ radeon_ring.c \ radeon_sa.c \ radeon_semaphore.c \ - radeon_state.c \ radeon_test.c \ radeon_ttm.c \ atom.c \ @@ -61,7 +59,6 @@ SRCS += \ r100.c \ r200.c \ r300.c \ - r300_cmdbuf.c \ r420.c \ rs400.c \ rs600.c \ @@ -70,10 +67,8 @@ SRCS += \ r520.c \ r600.c \ r600_audio.c \ - r600_blit.c \ r600_blit_kms.c \ r600_blit_shaders.c \ - r600_cp.c \ r600_cs.c \ r600_hdmi.c \ rv770.c \ @@ -92,10 +87,6 @@ radeon_acpi= radeon_acpi.c #radeon_atpx_handler= radeon_atpx_handler.c .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -radeon_ioc32= radeon_ioc32.c -.endif - #radeon_prime.c #--radeon_trace_points.c @@ -115,7 +106,5 @@ SRCS += \ CFLAGS+= -I${SRCTOP}/sys/dev/drm2/radeon -CWARNFLAGS.radeon_cp.c= -Wno-unused-value -CWARNFLAGS.r600_cp.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} From owner-svn-src-head@freebsd.org Tue Dec 18 01: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 6C5F61351433; Tue, 18 Dec 2018 01:12: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DBA46B964; Tue, 18 Dec 2018 01:12: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 11F641F417; Tue, 18 Dec 2018 01:12: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 wBI1CWSq037216; Tue, 18 Dec 2018 01:12:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI1CVbL037206; Tue, 18 Dec 2018 01:12:31 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812180112.wBI1CVbL037206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 18 Dec 2018 01:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342183 - in head/contrib/sqlite3: . tea X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea X-SVN-Commit-Revision: 342183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DBA46B964 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 01:12:33 -0000 Author: cy Date: Tue Dec 18 01:12:30 2018 New Revision: 342183 URL: https://svnweb.freebsd.org/changeset/base/342183 Log: MFV r342175: Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000) MFC after: 3 days Security: https://blade.tencent.com/magellan/index_en.html No known CVE was apparently registered. Added: head/contrib/sqlite3/Makefile.fallback - copied unchanged from r342177, vendor/sqlite3/dist/Makefile.fallback head/contrib/sqlite3/tea/ - copied from r342177, vendor/sqlite3/dist/tea/ Modified: head/contrib/sqlite3/Makefile.am head/contrib/sqlite3/Makefile.in head/contrib/sqlite3/Makefile.msc head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.am ============================================================================== --- head/contrib/sqlite3/Makefile.am Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/Makefile.am Tue Dec 18 01:12:30 2018 (r342183) @@ -1,6 +1,5 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @ZLIB_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE - +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -14,7 +13,7 @@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_ include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Copied: head/contrib/sqlite3/Makefile.fallback (from r342177, vendor/sqlite3/dist/Makefile.fallback) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/sqlite3/Makefile.fallback Tue Dec 18 01:12:30 2018 (r342183, copy of r342177, vendor/sqlite3/dist/Makefile.fallback) @@ -0,0 +1,19 @@ +#!/usr/bin/make +# +# If the configure script does not work, then this Makefile is available +# as a backup. Manually configure the variables below. +# +# Note: This makefile works out-of-the-box on MacOS 10.2 (Jaguar) +# +CC = gcc +CFLAGS = -O0 -I. +LIBS = -lz +COPTS += -D_BSD_SOURCE +COPTS += -DSQLITE_ENABLE_LOCKING_STYLE=0 +COPTS += -DSQLITE_THREADSAFE=0 +COPTS += -DSQLITE_OMIT_LOAD_EXTENSION +COPTS += -DSQLITE_WITHOUT_ZONEMALLOC +COPTS += -DSQLITE_ENABLE_RTREE + +sqlite3: shell.c sqlite3.c + $(CC) $(CFLAGS) $(COPTS) -o sqlite3 shell.c sqlite3.c $(LIBS) Modified: head/contrib/sqlite3/Makefile.in ============================================================================== --- head/contrib/sqlite3/Makefile.in Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/Makefile.in Tue Dec 18 01:12:30 2018 (r342183) @@ -260,7 +260,6 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ -DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -268,14 +267,12 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ FGREP = @FGREP@ -FTS5_FLAGS = @FTS5_FLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON1_FLAGS = @JSON1_FLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -305,14 +302,11 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ -SESSION_FLAGS = @SESSION_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELL_CFLAGS = @SHELL_CFLAGS@ STRIP = @STRIP@ -THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ -ZLIB_FLAGS = @ZLIB_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -365,7 +359,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @ZLIB_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -375,7 +369,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 Modified: head/contrib/sqlite3/Makefile.msc ============================================================================== --- head/contrib/sqlite3/Makefile.msc Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/Makefile.msc Tue Dec 18 01:12:30 2018 (r342183) @@ -277,6 +277,12 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb !IF $(MINIMAL_AMALGAMATION)==0 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 !ENDIF @@ -928,10 +934,9 @@ LIBRESOBJS = # when the shell is not being dynamically linked. # !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_INTROSPECTION_PRAGMAS -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_RTREE +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 !ENDIF @@ -966,7 +971,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/configure Tue Dec 18 01:12:30 2018 (r342183) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.23.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.26.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.23.1' -PACKAGE_STRING='sqlite 3.23.1' +PACKAGE_VERSION='3.26.0' +PACKAGE_STRING='sqlite 3.26.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -637,13 +637,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SHELL_CFLAGS -ZLIB_FLAGS EXTRA_SHELL_OBJ -SESSION_FLAGS -JSON1_FLAGS -FTS5_FLAGS -DYNAMIC_EXTENSION_FLAGS -THREADSAFE_FLAGS READLINE_LIBS BUILD_CFLAGS CPP @@ -777,9 +771,13 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_fts4 +enable_fts3 enable_fts5 enable_json1 +enable_rtree enable_session +enable_debug enable_static_shell ' ac_precious_vars='build_alias @@ -1332,7 +1330,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.23.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.26.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1402,7 +1400,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.23.1:";; + short | recursive ) echo "Configuration of sqlite 3.26.0:";; esac cat <<\_ACEOF @@ -1427,9 +1425,13 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] - --enable-fts5 include fts5 support [default=no] - --enable-json1 include json1 support [default=no] + --enable-fts4 include fts4 support [default=yes] + --enable-fts3 include fts3 support [default=no] + --enable-fts5 include fts5 support [default=yes] + --enable-json1 include json1 support [default=yes] + --enable-rtree include rtree support [default=yes] --enable-session enable the session extension [default=no] + --enable-debug build with debugging features enabled [default=no] --enable-static-shell statically link libsqlite3 into shell tool [default=yes] @@ -1523,7 +1525,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.23.1 +sqlite configure 3.26.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1938,7 +1940,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.23.1, which was +It was created by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2804,7 +2806,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.23.1' + VERSION='3.26.0' cat >>confdefs.h <<_ACEOF @@ -13040,6 +13042,7 @@ fi ac_config_files="$ac_config_files Makefile sqlite3.pc" +BUILD_CFLAGS= #------------------------------------------------------------------------- @@ -13304,9 +13307,8 @@ else enable_threadsafe=yes fi -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : @@ -13420,7 +13422,6 @@ if test "$ac_res" != no; then : fi fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13491,23 +13492,50 @@ if test "$ac_res" != no; then : fi else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to support dynamic extensions" >&5 $as_echo_n "checking for whether to support dynamic extensions... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dynamic_extensions" >&5 $as_echo "$enable_dynamic_extensions" >&6; } +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +# Check whether --enable-fts4 was given. +if test "${enable_fts4+set}" = set; then : + enableval=$enable_fts4; +else + enable_fts4=yes +fi +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +# Check whether --enable-fts3 was given. +if test "${enable_fts3+set}" = set; then : + enableval=$enable_fts3; +fi + +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # # Check whether --enable-fts5 was given. if test "${enable_fts5+set}" = set; then : enableval=$enable_fts5; else - enable_fts5=no + enable_fts5=yes fi if test x"$enable_fts5" = "xyes"; then @@ -13567,9 +13595,8 @@ if test "$ac_res" != no; then : fi - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13579,32 +13606,57 @@ fi if test "${enable_json1+set}" = set; then : enableval=$enable_json1; else - enable_json1=no + enable_json1=yes fi if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +# Check whether --enable-rtree was given. +if test "${enable_rtree+set}" = set; then : + enableval=$enable_rtree; +else + enable_rtree=yes +fi +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # # Check whether --enable-session was given. if test "${enable_session+set}" = set; then : enableval=$enable_session; -else - enable_session=no fi if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +fi +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # # Check whether --enable-static-shell was given. @@ -13694,7 +13746,7 @@ $as_echo "$ac_cv_search_deflate" >&6; } ac_res=$ac_cv_search_deflate if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ZLIB_FLAGS="-DSQLITE_HAVE_ZLIB" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB" fi @@ -13703,7 +13755,6 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing system" >&5 $as_echo_n "checking for library containing system... " >&6; } if ${ac_cv_search_system+:} false; then : @@ -14359,7 +14410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.23.1, which was +This file was extended by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14416,7 +14467,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.23.1 +sqlite config.status 3.26.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/configure.ac Tue Dec 18 01:12:30 2018 (r342183) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.23.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.26.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -29,6 +29,7 @@ AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r AC_FUNC_STRERROR_R AC_CONFIG_FILES([Makefile sqlite3.pc]) +BUILD_CFLAGS= AC_SUBST(BUILD_CFLAGS) #------------------------------------------------------------------------- @@ -86,13 +87,11 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) fi -AC_SUBST(THREADSAFE_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -104,51 +103,92 @@ AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( if test x"$enable_dynamic_extensions" != "xno"; then AC_SEARCH_LIBS(dlopen, dl) else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) -AC_SUBST(DYNAMIC_EXTENSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +AC_ARG_ENABLE(fts4, [AS_HELP_STRING( + [--enable-fts4], [include fts4 support [default=yes]])], + [], [enable_fts4=yes]) +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +AC_ARG_ENABLE(fts3, [AS_HELP_STRING( + [--enable-fts3], [include fts3 support [default=no]])], + [], []) +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # AC_ARG_ENABLE(fts5, [AS_HELP_STRING( - [--enable-fts5], [include fts5 support [default=no]])], - [], [enable_fts5=no]) + [--enable-fts5], [include fts5 support [default=yes]])], + [], [enable_fts5=yes]) if test x"$enable_fts5" = "xyes"; then AC_SEARCH_LIBS(log, m) - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi -AC_SUBST(FTS5_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- # --enable-json1 # AC_ARG_ENABLE(json1, [AS_HELP_STRING( - [--enable-json1], [include json1 support [default=no]])], - [], [enable_json1=no]) + [--enable-json1], [include json1 support [default=yes]])], + [],[enable_json1=yes]) if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi -AC_SUBST(JSON1_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +AC_ARG_ENABLE(rtree, [AS_HELP_STRING( + [--enable-rtree], [include rtree support [default=yes]])], + [], [enable_rtree=yes]) +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], - [], [enable_session=no]) + [], []) if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi -AC_SUBST(SESSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +AC_ARG_ENABLE(debug, [AS_HELP_STRING( + [--enable-debug], [build with debugging features enabled [default=no]])], + [], []) +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( @@ -165,9 +205,8 @@ AC_SUBST(EXTRA_SHELL_OBJ) AC_CHECK_FUNCS(posix_fallocate) AC_CHECK_HEADERS(zlib.h,[ - AC_SEARCH_LIBS(deflate,z,[ZLIB_FLAGS="-DSQLITE_HAVE_ZLIB"]) + AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"]) ]) -AC_SUBST(ZLIB_FLAGS) AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"]) AC_SUBST(SHELL_CFLAGS) Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Mon Dec 17 21:48:20 2018 (r342182) +++ head/contrib/sqlite3/shell.c Tue Dec 18 01:12:30 2018 (r342183) @@ -97,12 +97,15 @@ typedef unsigned char u8; #if (!defined(_WIN32) && !defined(WIN32)) || defined(__MINGW32__) # include # include +# define GETPID getpid # if defined(__MINGW32__) # define DIRENT dirent # ifndef S_ISLNK # define S_ISLNK(mode) (0) # endif # endif +#else +# define GETPID (int)GetCurrentProcessId #endif #include #include @@ -454,6 +457,12 @@ void utf8_printf(FILE *out, const char *zFormat, ...){ # define raw_printf fprintf #endif +/* Indicate out-of-memory and exit. */ +static void shell_out_of_memory(void){ + raw_printf(stderr,"Error: out of memory\n"); + exit(1); +} + /* ** Write I/O traces to the following stream. */ @@ -577,7 +586,7 @@ static char *local_getline(char *zLine, FILE *in){ if( n+100>nLine ){ nLine = nLine*2 + 100; zLine = realloc(zLine, nLine); - if( zLine==0 ) return 0; + if( zLine==0 ) shell_out_of_memory(); } if( fgets(&zLine[n], nLine - n, in)==0 ){ if( n==0 ){ @@ -604,10 +613,7 @@ static char *local_getline(char *zLine, FILE *in){ int nTrans = strlen30(zTrans)+1; if( nTrans>nLine ){ zLine = realloc(zLine, nTrans); - if( zLine==0 ){ - sqlite3_free(zTrans); - return 0; - } + if( zLine==0 ) shell_out_of_memory(); } memcpy(zLine, zTrans, nTrans); sqlite3_free(zTrans); @@ -754,10 +760,7 @@ static void appendText(ShellText *p, char const *zAppe if( p->n+len>=p->nAlloc ){ p->nAlloc = p->nAlloc*2 + len + 20; p->z = realloc(p->z, p->nAlloc); - if( p->z==0 ){ - memset(p, 0, sizeof(*p)); - return; - } + if( p->z==0 ) shell_out_of_memory(); } if( quote ){ @@ -786,45 +789,12 @@ static void appendText(ShellText *p, char const *zAppe ** Return '"' if quoting is required. Return 0 if no quoting is required. */ static char quoteChar(const char *zName){ - /* All SQLite keywords, in alphabetical order */ - static const char *azKeywords[] = { - "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS", - "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", - "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT", - "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE", - "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH", - "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN", - "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF", - "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER", - "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", - "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL", - "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA", - "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", - "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT", - "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP", - "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE", - "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE", - "WITH", "WITHOUT", - }; - int i, lwr, upr, mid, c; + int i; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; } - lwr = 0; - upr = sizeof(azKeywords)/sizeof(azKeywords[0]) - 1; - while( lwr<=upr ){ - mid = (lwr+upr)/2; - c = sqlite3_stricmp(azKeywords[mid], zName); - if( c==0 ) return '"'; - if( c<0 ){ - lwr = mid+1; - }else{ - upr = mid-1; - } - } - return 0; + return sqlite3_keyword_check(zName, i) ? '"' : 0; } /* @@ -1347,7 +1317,7 @@ INT closedir( ** ****************************************************************************** ** -** This SQLite extension implements a functions that compute SHA1 hashes. +** This SQLite extension implements functions that compute SHA3 hashes. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -2158,8 +2128,19 @@ SQLITE_EXTENSION_INIT1 #include +/* +** Structure of the fsdir() table-valued function +*/ + /* 0 1 2 3 4 5 */ #define FSDIR_SCHEMA "(name,mode,mtime,data,path HIDDEN,dir HIDDEN)" +#define FSDIR_COLUMN_NAME 0 /* Name of the file */ +#define FSDIR_COLUMN_MODE 1 /* Access mode */ +#define FSDIR_COLUMN_MTIME 2 /* Last modification time */ +#define FSDIR_COLUMN_DATA 3 /* File content */ +#define FSDIR_COLUMN_PATH 4 /* Path to top of search */ +#define FSDIR_COLUMN_DIR 5 /* Path is relative to this directory */ + /* ** Set the result stored by context ctx to a blob containing the ** contents of file zName. @@ -2256,7 +2237,7 @@ static void statTimesToUtc( extern LPWSTR sqlite3_win32_utf8_to_unicode(const char*); zUnicodeName = sqlite3_win32_utf8_to_unicode(zPath); if( zUnicodeName ){ - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); + memset(&fd, 0, sizeof(WIN32_FIND_DATAW)); hFindFile = FindFirstFileW(zUnicodeName, &fd); if( hFindFile!=NULL ){ pStatBuf->st_ctime = (time_t)fileTimeToUnixTime(&fd.ftCreationTime); @@ -2747,20 +2728,20 @@ static int fsdirColumn( ){ fsdir_cursor *pCur = (fsdir_cursor*)cur; switch( i ){ - case 0: { /* name */ + case FSDIR_COLUMN_NAME: { sqlite3_result_text(ctx, &pCur->zPath[pCur->nBase], -1, SQLITE_TRANSIENT); break; } - case 1: /* mode */ + case FSDIR_COLUMN_MODE: sqlite3_result_int64(ctx, pCur->sStat.st_mode); break; - case 2: /* mtime */ + case FSDIR_COLUMN_MTIME: sqlite3_result_int64(ctx, pCur->sStat.st_mtime); break; - case 3: { /* data */ + case FSDIR_COLUMN_DATA: { mode_t m = pCur->sStat.st_mode; if( S_ISDIR(m) ){ sqlite3_result_null(ctx); @@ -2790,6 +2771,12 @@ static int fsdirColumn( readFileContents(ctx, pCur->zPath); } } + case FSDIR_COLUMN_PATH: + default: { + /* The FSDIR_COLUMN_PATH and FSDIR_COLUMN_DIR are input parameters. + ** always return their values as NULL */ + break; + } } return SQLITE_OK; } @@ -2816,6 +2803,9 @@ static int fsdirEof(sqlite3_vtab_cursor *cur){ /* ** xFilter callback. +** +** idxNum==1 PATH parameter only +** idxNum==2 Both PATH and DIR supplied */ static int fsdirFilter( sqlite3_vtab_cursor *cur, @@ -2868,40 +2858,63 @@ static int fsdirFilter( ** In this implementation idxNum is used to represent the ** query plan. idxStr is unused. ** -** The query plan is represented by bits in idxNum: +** The query plan is represented by values of idxNum: ** -** (1) start = $value -- constraint exists -** (2) stop = $value -- constraint exists -** (4) step = $value -- constraint exists -** (8) output in descending order +** (1) The path value is supplied by argv[0] +** (2) Path is in argv[0] and dir is in argv[1] */ static int fsdirBestIndex( sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo ){ int i; /* Loop over constraints */ - int idx4 = -1; - int idx5 = -1; + int idxPath = -1; /* Index in pIdxInfo->aConstraint of PATH= */ + int idxDir = -1; /* Index in pIdxInfo->aConstraint of DIR= */ + int seenPath = 0; /* True if an unusable PATH= constraint is seen */ + int seenDir = 0; /* True if an unusable DIR= constraint is seen */ const struct sqlite3_index_constraint *pConstraint; (void)tab; pConstraint = pIdxInfo->aConstraint; for(i=0; inConstraint; i++, pConstraint++){ - if( pConstraint->usable==0 ) continue; if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; - if( pConstraint->iColumn==4 ) idx4 = i; - if( pConstraint->iColumn==5 ) idx5 = i; + switch( pConstraint->iColumn ){ + case FSDIR_COLUMN_PATH: { + if( pConstraint->usable ){ + idxPath = i; + seenPath = 0; + }else if( idxPath<0 ){ + seenPath = 1; + } + break; + } + case FSDIR_COLUMN_DIR: { + if( pConstraint->usable ){ + idxDir = i; + seenDir = 0; + }else if( idxDir<0 ){ + seenDir = 1; + } + break; + } + } } + if( seenPath || seenDir ){ + /* If input parameters are unusable, disallow this plan */ + return SQLITE_CONSTRAINT; + } - if( idx4<0 ){ + if( idxPath<0 ){ pIdxInfo->idxNum = 0; - pIdxInfo->estimatedCost = (double)(((sqlite3_int64)1) << 50); + /* The pIdxInfo->estimatedCost should have been initialized to a huge + ** number. Leave it unchanged. */ + pIdxInfo->estimatedRows = 0x7fffffff; }else{ - pIdxInfo->aConstraintUsage[idx4].omit = 1; - pIdxInfo->aConstraintUsage[idx4].argvIndex = 1; - if( idx5>=0 ){ - pIdxInfo->aConstraintUsage[idx5].omit = 1; - pIdxInfo->aConstraintUsage[idx5].argvIndex = 2; + pIdxInfo->aConstraintUsage[idxPath].omit = 1; + pIdxInfo->aConstraintUsage[idxPath].argvIndex = 1; + if( idxDir>=0 ){ + pIdxInfo->aConstraintUsage[idxDir].omit = 1; + pIdxInfo->aConstraintUsage[idxDir].argvIndex = 2; pIdxInfo->idxNum = 2; pIdxInfo->estimatedCost = 10.0; }else{ @@ -2940,7 +2953,8 @@ static int fsdirRegister(sqlite3 *db){ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ - 0 /* xRollbackTo */ + 0, /* xRollbackTo */ + 0, /* xShadowName */ }; int rc = sqlite3_create_module(db, "fsdir", &fsdirModule, 0); @@ -3042,6 +3056,7 @@ struct completion_cursor { char *zPrefix; /* The prefix for the word we want to complete */ char *zLine; /* The whole that we want to complete */ const char *zCurrentRow; /* Current output row */ + int szRow; /* Length of the zCurrentRow string */ sqlite3_stmt *pStmt; /* Current statement */ sqlite3_int64 iRowid; /* The rowid */ int ePhase; /* Current phase */ @@ -3155,32 +3170,6 @@ static int completionClose(sqlite3_vtab_cursor *cur){ } /* -** All SQL keywords understood by SQLite -*/ -static const char *completionKwrds[] = { - "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS", - "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", - "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT", - "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE", - "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH", - "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN", - "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF", - "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER", - "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", - "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL", - "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA", - "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", - "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT", - "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP", - "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE", - "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE", - "WITH", "WITHOUT", -}; -#define completionKwCount \ - (int)(sizeof(completionKwrds)/sizeof(completionKwrds[0])) - -/* ** Advance a completion_cursor to its next row of output. ** ** The ->ePhase, ->j, and ->pStmt fields of the completion_cursor object @@ -3202,11 +3191,11 @@ static int completionNext(sqlite3_vtab_cursor *cur){ while( pCur->ePhase!=COMPLETION_EOF ){ switch( pCur->ePhase ){ case COMPLETION_KEYWORDS: { - if( pCur->j >= completionKwCount ){ + if( pCur->j >= sqlite3_keyword_count() ){ pCur->zCurrentRow = 0; pCur->ePhase = COMPLETION_DATABASES; }else{ - pCur->zCurrentRow = completionKwrds[pCur->j++]; + sqlite3_keyword_name(pCur->j++, &pCur->zCurrentRow, &pCur->szRow); } iCol = -1; break; @@ -3278,6 +3267,7 @@ static int completionNext(sqlite3_vtab_cursor *cur){ if( sqlite3_step(pCur->pStmt)==SQLITE_ROW ){ /* Extract the next row of content */ pCur->zCurrentRow = (const char*)sqlite3_column_text(pCur->pStmt, iCol); + pCur->szRow = sqlite3_column_bytes(pCur->pStmt, iCol); }else{ /* When all rows are finished, advance to the next phase */ sqlite3_finalize(pCur->pStmt); @@ -3287,7 +3277,9 @@ static int completionNext(sqlite3_vtab_cursor *cur){ } } if( pCur->nPrefix==0 ) break; - if( sqlite3_strnicmp(pCur->zPrefix, pCur->zCurrentRow, pCur->nPrefix)==0 ){ + if( pCur->nPrefix<=pCur->szRow + && sqlite3_strnicmp(pCur->zPrefix, pCur->zCurrentRow, pCur->nPrefix)==0 + ){ break; } } @@ -3307,7 +3299,7 @@ static int completionColumn( completion_cursor *pCur = (completion_cursor*)cur; switch( i ){ case COMPLETION_COLUMN_CANDIDATE: { - sqlite3_result_text(ctx, pCur->zCurrentRow, -1, SQLITE_TRANSIENT); + sqlite3_result_text(ctx, pCur->zCurrentRow, pCur->szRow,SQLITE_TRANSIENT); break; } case COMPLETION_COLUMN_PREFIX: { @@ -3367,7 +3359,7 @@ static int completionFilter( pCur->zPrefix = sqlite3_mprintf("%s", sqlite3_value_text(argv[iArg])); if( pCur->zPrefix==0 ) return SQLITE_NOMEM; } - iArg++; + iArg = 1; } if( idxNum & 2 ){ pCur->nLine = sqlite3_value_bytes(argv[iArg]); @@ -3375,7 +3367,6 @@ static int completionFilter( pCur->zLine = sqlite3_mprintf("%s", sqlite3_value_text(argv[iArg])); if( pCur->zLine==0 ) return SQLITE_NOMEM; } - iArg++; } if( pCur->zLine!=0 && pCur->zPrefix==0 ){ int i = pCur->nLine; @@ -3471,7 +3462,8 @@ static sqlite3_module completionModule = { 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ - 0 /* xRollbackTo */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ }; #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -5368,25 +5360,26 @@ static int zipfileBestIndex( sqlite3_index_info *pIdxInfo ){ int i; + int idx = -1; + int unusable = 0; for(i=0; inConstraint; i++){ const struct sqlite3_index_constraint *pCons = &pIdxInfo->aConstraint[i]; - if( pCons->usable==0 ) continue; - if( pCons->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; if( pCons->iColumn!=ZIPFILE_F_COLUMN_IDX ) continue; - break; + if( pCons->usable==0 ){ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Dec 18 05:08: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 AD4D913404AD; Tue, 18 Dec 2018 05:08:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5212577D7A; Tue, 18 Dec 2018 05:08:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4062522095; Tue, 18 Dec 2018 05:08:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBI58vqT057219; Tue, 18 Dec 2018 05:08:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI58vLp057218; Tue, 18 Dec 2018 05:08:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812180508.wBI58vLp057218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 18 Dec 2018 05:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342185 - head/sys/dev/iwi X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwi X-SVN-Commit-Revision: 342185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5212577D7A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 05:08:57 -0000 Author: avos Date: Tue Dec 18 05:08:56 2018 New Revision: 342185 URL: https://svnweb.freebsd.org/changeset/base/342185 Log: iwi(4): do not leak node reference when IWI_FLAG_ASSOCIATED flag is set. MFC after: 6 days Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Tue Dec 18 03:00:12 2018 (r342184) +++ head/sys/dev/iwi/if_iwi.c Tue Dec 18 05:08:56 2018 (r342185) @@ -2833,12 +2833,12 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80 IWI_LOCK_ASSERT(sc); - ni = ieee80211_ref_node(vap->iv_bss); - if (sc->flags & IWI_FLAG_ASSOCIATED) { DPRINTF(("Already associated\n")); return (-1); } + + ni = ieee80211_ref_node(vap->iv_bss); IWI_STATE_BEGIN(sc, IWI_FW_ASSOCIATING); error = 0; From owner-svn-src-head@freebsd.org Tue Dec 18 08:40: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 578A4134662D; Tue, 18 Dec 2018 08:40:26 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 BC92786C27; Tue, 18 Dec 2018 08:40:25 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id z5so14941286wrt.11; Tue, 18 Dec 2018 00:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=FQLdXy2J3+g2KGxNdljEdCLcHv8PjLzrfmEwNqsNlXg=; b=OFD8eq/YNziRQrbxwqOhURBi4bkOvbsbyyJWxsldJ5RC97wd0Di64oE4uXjVn9j41+ RCQPbodr0vm50qZ3rRTiVA0KbjRUNwPf6HXVDpwc9OW9MGprrOrF26qrZzu+1Al3td2K 5jxVTbk2SGuAsO0dMpPhSOIwL9Khvn5eYi7l5XcoxLypzVV0cWAKuOScPx0mz/Y8hnX3 3ePo9WC35J2bi3Lsv3Ar0VX6MCgk+ElVfc6FldksfghAQOaNbBvaUR+q0LTpXjcU8u5/ 5LFltgT6xz+VU/1nXwvUtw1nIPTElmqox63J6rJ6fLJun4Y2Rz51seUhm+MibwR5SoqS CSiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=FQLdXy2J3+g2KGxNdljEdCLcHv8PjLzrfmEwNqsNlXg=; b=GWBapXTzOLvLSDq0QZDFScVvc93bz+gJ3k4/Kw2IF8qQG+mCD6oAVw4GSX5pCy8t9G jFR2NtFpM9wxDd0m40lZ9AIvxvRl7g1SBgvRCBtQL0nsxtoOpOkttGjzt0mDn3nDQ/S+ ll/gkV2+XEbtWty0uucut2fk/VHkXA+TZQmNLDfM8VH99DxPGp7clc1tjzRlY85rMp89 MQu8PTKchp64FSHbJaYdA9BOdaLm55lHI+7MGf48FLKTp1h2lUhUAwXeM9nGaUrmVkZG kXhaLFnOrEsMYnK9frTxHyBQOotpOg0XjOpzH2N/sbp5oo76v3VncZJnDWx+i7rPFc9w 4KFg== X-Gm-Message-State: AA+aEWYAkYJA5fkz5PdLRAEeEFH+myOjmRKDmM5S1c9N1cV9y2FqAUgw v6c1IEg/SIeKgqW5xIzocapea55c X-Google-Smtp-Source: AFSGD/WgCvVqwwjZNewC5L4qZz5Of8XlRiX74iFP+GAjepCNies2G0k1YLd35JiMPIA19d9U3nvPiQ== X-Received: by 2002:adf:b608:: with SMTP id f8mr13083159wre.120.1545122424625; Tue, 18 Dec 2018 00:40:24 -0800 (PST) Received: from ernst.home (p5B02380D.dip0.t-ipconnect.de. [91.2.56.13]) by smtp.gmail.com with ESMTPSA id n82sm1222285wma.42.2018.12.18.00.40.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Dec 2018 00:40:23 -0800 (PST) Date: Tue, 18 Dec 2018 09:40:22 +0100 From: Gary Jennejohn To: Andrew Gallatin Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Slava Shwartsman Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en Message-ID: <20181218094022.0deab2fa@ernst.home> In-Reply-To: References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> <20181218033137.Q2217@besplex.bde.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BC92786C27 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 08:40:26 -0000 On Mon, 17 Dec 2018 14:50:04 -0500 Andrew Gallatin wrote: > On 12/17/18 2:08 PM, Bruce Evans wrote: [snip] > > iflib uses queuing techniques to significantly pessimize em NICs with 1 > > hardware queue. On fast machines, it attempts to do 1 context switch per > > This can happen even w/o contention when "abdicate" is enabled in mp > ring. I complained about this as well, and the default was changed in > mp ring to not always "abdicate" (eg, switch to the tq to handle the > packet). Abdication substantially pessimizes Netflix style web > uncontended workloads, but it generally helps small packet forwarding. > > It is interesting that you see the opposite. I should try benchmarking > with just a single ring. > Why are iflib and ifdi compiled into EVERY kernel with device ether and/or device pci when only a few NICs actually use iflib? This is really unnecessary bloat in an already bloated kernel. I use if_re which does not use iflib. I removed iflib and ifdi from /sys/conf/files and my network still works just fine. It seems to me like these iflib entries need finer-grained options, e.g. one of the NICs which use iflib is enabled, before pulling them into the kernel build. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Tue Dec 18 11:46: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 856B5134E089; Tue, 18 Dec 2018 11:46:04 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 206718F620; Tue, 18 Dec 2018 11:46:04 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0EE3E1D07F; Tue, 18 Dec 2018 11:46:04 +0000 (UTC) Date: Tue, 18 Dec 2018 11:46:04 +0000 From: Alexey Dokuchaev To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342151 - head/stand/libsa/zfs Message-ID: <20181218114603.GA65077@FreeBSD.org> References: <201812160858.wBG8wFSd032964@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201812160858.wBG8wFSd032964@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 206718F620 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.986,0]; NEURAL_HAM_LONG(-0.98)[-0.984,0]; NEURAL_HAM_SHORT(-0.85)[-0.848,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 11:46:04 -0000 On Sun, Dec 16, 2018 at 08:58:15AM +0000, Toomas Soome wrote: > New Revision: 342151 > URL: https://svnweb.freebsd.org/changeset/base/342151 > > Log: > loader: zfs reader should not probe partitionless disks > > @@ -527,10 +527,11 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid > pa.fd = open(devname, O_RDONLY); > if (pa.fd == -1) > return (ENXIO); > - /* Probe the whole disk */ > - ret = zfs_probe(pa.fd, pool_guid); > - if (ret == 0) > - return (0); > + /* > + * We will not probe the whole disk, we can not boot from such I think you mean "cannot" here. > + * disks and some systems will misreport the disk sizes and will > + * hang while accessing the disk. > + */ ./danfe From owner-svn-src-head@freebsd.org Tue Dec 18 12:44: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 0C36D1350A0B; Tue, 18 Dec 2018 12:44:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5D656B663; Tue, 18 Dec 2018 12:44:39 +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 992D326FB6; Tue, 18 Dec 2018 12:44:39 +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 wBICidEk099773; Tue, 18 Dec 2018 12:44:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBICicbo099769; Tue, 18 Dec 2018 12:44:38 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201812181244.wBICicbo099769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 18 Dec 2018 12:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342190 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 342190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5D656B663 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 12:44:40 -0000 Author: brooks Date: Tue Dec 18 12:44:38 2018 New Revision: 342190 URL: https://svnweb.freebsd.org/changeset/base/342190 Log: const poison the `new` pointer of __sysctl. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18444 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_sysctl.c head/sys/kern/syscalls.master head/sys/sys/sysctl.h Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Dec 18 09:16:04 2018 (r342189) +++ head/sys/compat/freebsd32/syscalls.master Tue Dec 18 12:44:38 2018 (r342190) @@ -388,7 +388,7 @@ uint32_t length1, uint32_t length2); } 202 AUE_SYSCTL STD { int freebsd32___sysctl(int *name, \ u_int namelen, void *old, \ - uint32_t *oldlenp, void *new, \ + uint32_t *oldlenp, const void *new, \ uint32_t newlen); } 203 AUE_MLOCK NOPROTO { int mlock(const void *addr, \ size_t len); } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Dec 18 09:16:04 2018 (r342189) +++ head/sys/kern/kern_sysctl.c Tue Dec 18 12:44:38 2018 (r342190) @@ -1772,7 +1772,7 @@ sysctl_new_kernel(struct sysctl_req *req, void *p, siz return (0); if (req->newlen - req->newidx < l) return (EINVAL); - bcopy((char *)req->newptr + req->newidx, p, l); + bcopy((const char *)req->newptr + req->newidx, p, l); req->newidx += l; return (0); } @@ -1898,7 +1898,7 @@ sysctl_new_user(struct sysctl_req *req, void *p, size_ return (EINVAL); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "sysctl_new_user()"); - error = copyin((char *)req->newptr + req->newidx, p, l); + error = copyin((const char *)req->newptr + req->newidx, p, l); req->newidx += l; return (error); } @@ -2126,8 +2126,8 @@ sys___sysctl(struct thread *td, struct sysctl_args *ua */ int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, - size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval, - int flags) + size_t *oldlenp, int inkernel, const void *new, size_t newlen, + size_t *retval, int flags) { int error = 0, memlocked; struct sysctl_req req; Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Dec 18 09:16:04 2018 (r342189) +++ head/sys/kern/syscalls.master Tue Dec 18 12:44:38 2018 (r342190) @@ -1209,7 +1209,7 @@ u_int namelen, _Out_writes_bytes_opt_(*oldlenp) void *old, _Inout_opt_ size_t *oldlenp, - _In_reads_bytes_opt_(newlen) void *new, + _In_reads_bytes_opt_(newlen) const void *new, size_t newlen ); } __sysctl sysctl_args int Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Dec 18 09:16:04 2018 (r342189) +++ head/sys/sys/sysctl.h Tue Dec 18 12:44:38 2018 (r342190) @@ -165,7 +165,7 @@ struct sysctl_req { size_t oldlen; size_t oldidx; int (*oldfunc)(struct sysctl_req *, const void *, size_t); - void *newptr; + const void *newptr; size_t newlen; size_t newidx; int (*newfunc)(struct sysctl_req *, void *, size_t); @@ -1083,7 +1083,7 @@ int kernel_sysctlbyname(struct thread *td, char *name, size_t *oldlenp, void *new, size_t newlen, size_t *retval, int flags); int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, - size_t *oldlenp, int inkernel, void *new, size_t newlen, + size_t *oldlenp, int inkernel, const void *new, size_t newlen, size_t *retval, int flags); int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req); From owner-svn-src-head@freebsd.org Tue Dec 18 13:41: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 4436513520A9; Tue, 18 Dec 2018 13:41:33 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C734E6D6D7; Tue, 18 Dec 2018 13:41:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id B627F1EE31; Tue, 18 Dec 2018 13:41:32 +0000 (UTC) Date: Tue, 18 Dec 2018 13:41:32 +0000 From: Alexey Dokuchaev To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys Message-ID: <20181218134132.GA63563@FreeBSD.org> References: <201304042319.r34NJqIP040377@svn.freebsd.org> <20181127134514.GA1580@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127134514.GA1580@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: C734E6D6D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.985,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-0.98)[-0.984,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 13:41:33 -0000 On Tue, Nov 27, 2018 at 01:45:14PM +0000, Alexey Dokuchaev wrote: > On Thu, Apr 04, 2013 at 11:19:52PM +0000, Steven Hartland wrote: > > New Revision: 249115 > > URL: http://svnweb.freebsd.org/changeset/base/249115 > > > > Log: > > Adds security options to camcontrol this includes the ability to secure > > erase disks such as SSD's > > > > Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) > > com[m]and > > > > Modified: head/sbin/camcontrol/camcontrol.c > > > > [...] > > +static int > > +ata_do_identify(struct cam_device *device, int retry_count, int timeout, > > + union ccb *ccb, struct ata_params** ident_bufp) > > +{ > > [...] > > + > > + error = ata_do_28bit_cmd(device, > > + ccb, > > + /*retries*/retry_count, > > + /*flags*/CAM_DIR_IN, > > + /*protocol*/AP_PROTO_PIO_IN, > > + /*tag_action*/MSG_SIMPLE_Q_TAG, > > + /*command*/command, > > + /*features*/0, > > + /*lba*/0, > > + /*sector_count*/(u_int8_t)sizeof(struct ata_params), > > This looks strange: sizeof(struct ata_params) is 512, but it is too wide > for u_int8_t, so it would be truncated to zero. Should it be 1 (one) here > instead for ATA_ATA_IDENTIFY command, since it normally returns some data > which typically fits one sector (>=512 bytes)? Ping. ./danfe > > + /*data_ptr*/(u_int8_t *)ptr, > > + /*dxfer_len*/sizeof(struct ata_params), > > + /*timeout*/timeout ? timeout : 30 * 1000, > > + /*quiet*/1); > > > > [...] > > + error = ata_do_28bit_cmd(device, > > + ccb, > > + /*retries*/retry_count, > > + /*flags*/CAM_DIR_IN, > > + /*protocol*/AP_PROTO_PIO_IN, > > + /*tag_action*/MSG_SIMPLE_Q_TAG, > > + /*command*/retry_command, > > + /*features*/0, > > + /*lba*/0, > > + /*sector_count*/(u_int8_t) > > + sizeof(struct ata_params), > > Same here. > > > + /*data_ptr*/(u_int8_t *)ptr, > > + /*dxfer_len*/sizeof(struct ata_params), > > + /*timeout*/timeout ? timeout : 30 * 1000, > > + /*quiet*/0); From owner-svn-src-head@freebsd.org Tue Dec 18 14:40: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 9685313533D3; Tue, 18 Dec 2018 14:40:54 +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 DFD766FA8A; Tue, 18 Dec 2018 14:40:53 +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 EE39A42E3E0; Wed, 19 Dec 2018 01:40:44 +1100 (AEDT) Date: Wed, 19 Dec 2018 01:40:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrew Gallatin cc: Bruce Evans , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en In-Reply-To: Message-ID: <20181219001335.A1412@besplex.bde.org> References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> <20181218033137.Q2217@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DZtnkrlW c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=RpNjiQI2AAAA:8 a=J7JHSmw4B8a3WLR4-DMA:9 a=jpIH26JlB8aEU1M81S3jpgcb7nU=:19 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: DFD766FA8A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 14:40:54 -0000 On Mon, 17 Dec 2018, Andrew Gallatin wrote: > On 12/17/18 2:08 PM, Bruce Evans wrote: >> On Mon, 17 Dec 2018, Andrew Gallatin wrote: >>=20 >>> On 12/5/18 9:20 AM, Slava Shwartsman wrote: >>>> Author: slavash >>>> Date: Wed Dec=C2=A0 5 14:20:57 2018 >>>> New Revision: 341578 >>>> URL:=20 >>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__svnweb.freebsd.= org_changeset_base_341578&d=3DDwIDaQ&c=3DimBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0= Sj_gZ4adc&r=3DEd-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=3DBFp2c_-S0jnzR= ZJF2APwvTwmnmVFcyjcnBvHRZ3Locc&s=3Db7fvhOzf_b5bMVGquu4SaBhMNql5N8dVPAvpfKtz= 53Q&e=3D=20 >>>>=20 >>>> Log: >>>> =C2=A0=C2=A0 mlx5en: Remove the DRBR and associated logic in the trans= mit path. >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The hardware queues are deep enough cur= rently and using the=20 >>>> DRBR and associated >>>> =C2=A0=C2=A0 callbacks only leads to more task switching in the TX pat= h. The is=20 >>>> also a race >>>> =C2=A0=C2=A0 setting the queue_state which can lead to hung TX rings. >>>=20 >>> The point of DRBR in the tx path is not simply to provide a software ri= ng=20 >>> for queuing excess packets.=C2=A0 Rather it provides a mechanism to >>> avoid lock contention by shoving a packet into the software ring, where >>> it will later be found & processed, rather than blocking the caller on >>> a mtx lock.=C2=A0=C2=A0 I'm concerned you may have introduced a perform= ance >>> regression for use cases where you have N:1=C2=A0 or N:M lock contentio= n where=20 >>> many threads on different cores are contending for the same tx queue.= =C2=A0=20 >>> The state of the art for this is no longer DRBR, but mp_ring, >>> as used by both cxgbe and iflib. >>=20 >> iflib uses queuing techniques to significantly pessimize em NICs with 1 >> hardware queue.=C2=A0 On fast machines, it attempts to do 1 context swit= ch per Bruce Evans didn't write that. Some mail program converted 2-space sentenc= e breaks to \xc2\xa0. > This can happen even w/o contention when "abdicate" is enabled in mp > ring. I complained about this as well, and the default was changed in > mp ring to not always "abdicate" (eg, switch to the tq to handle the > packet). Abdication substantially pessimizes Netflix style web uncontende= d=20 > workloads, but it generally helps small packet forwarding. > > It is interesting that you see the opposite. I should try benchmarking > with just a single ring. Hmm, I didn't remember "abdicated" and never knew about the sysctl for it (the sysctl is newer), but I notices the slowdown from near the first commit for it (r323954) and already used the folowing workaround for it: XX Index: iflib.c XX =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D XX --- iflib.c=09(revision 332488) XX +++ iflib.c=09(working copy) XX @@ -1,3 +1,5 @@ XX +int bde_oldnet =3D 1; XX + XX /*- XX * Copyright (c) 2014-2018, Matthew Macy XX * All rights reserved. XX @@ -3650,9 +3652,17 @@ XX =09=09IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); XX =09=09return; XX =09} XX +if (bde_oldnet) { XX =09if (txq->ift_db_pending) XX =09=09ifmp_ring_enqueue(txq->ift_br, (void **)&txq, 1, TX_BATCH_SIZE); XX +=09else XX +=09=09ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); XX +} else { XX +=09if (txq->ift_db_pending) XX +=09=09ifmp_ring_enqueue(txq->ift_br, (void **)&txq, 1, TX_BATCH_SIZE); XX =09ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); XX +} XX +=09ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); XX =09if (ctx->ifc_flags & IFC_LEGACY) XX =09=09IFDI_INTR_ENABLE(ctx); XX =09else { XX @@ -3862,8 +3872,11 @@ XX =09DBG_COUNTER_INC(tx_seen); XX =09err =3D ifmp_ring_enqueue(txq->ift_br, (void **)&m, 1, TX_BATCH_SIZE= ); XX=20 XX +if (!bde_oldnet) XX =09GROUPTASK_ENQUEUE(&txq->ift_task); XX =09if (err) { XX +if (bde_oldnet) XX +=09=09GROUPTASK_ENQUEUE(&txq->ift_task); XX =09=09/* support forthcoming later */ XX #ifdef DRIVER_BACKPRESSURE XX =09=09txq->ift_closed =3D TRUE; XX @@ -3870,6 +3883,9 @@ XX #endif XX =09=09ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); XX =09=09m_freem(m); XX +=09} else if (TXQ_AVAIL(txq) < (txq->ift_size >> 1)) { XX +if (bde_oldnet) XX +=09=09GROUPTASK_ENQUEUE(&txq->ift_task); XX =09} XX=20 XX =09return (err); XX Index: mp_ring.c XX =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D XX --- mp_ring.c=09(revision 332488) XX +++ mp_ring.c=09(working copy) XX @@ -1,3 +1,11 @@ XX +#include "opt_pci.h" XX + XX +#ifdef DEV_PCI XX +extern int bde_oldnet; XX +#else XX +#define=09bde_oldnet=090 XX +#endif XX + XX /*- XX * Copyright (c) 2014 Chelsio Communications, Inc. XX * All rights reserved. XX @@ -454,12 +462,25 @@ XX =09do { XX =09=09os.state =3D ns.state =3D r->state; XX =09=09ns.pidx_tail =3D pidx_stop; XX +if (bde_oldnet) XX +=09=09ns.flags =3D BUSY; XX +else { XX =09=09if (os.flags =3D=3D IDLE) XX =09=09=09ns.flags =3D ABDICATED; XX +} XX =09} while (atomic_cmpset_rel_64(&r->state, os.state, ns.state) =3D=3D = 0); XX =09critical_exit(); XX =09counter_u64_add(r->enqueues, n); XX=20 XX +if (bde_oldnet) { XX +=09/* XX +=09 * Turn into a consumer if some other thread isn't active as a consu= mer XX +=09 * already. XX +=09 */ XX +=09if (os.flags !=3D BUSY) XX +=09=09drain_ring_lockless(r, ns, os.flags, budget); XX +} XX + XX =09return (0); XX } XX #endif XX @@ -470,10 +491,15 @@ XX =09union ring_state os, ns; XX=20 XX =09os.state =3D r->state; XX +if (bde_oldnet) { XX +=09if (os.flags !=3D STALLED || os.pidx_head !=3D os.pidx_tail || r->ca= n_drain(r) =3D=3D 0) XX +=09=09return; XX +} else { XX =09if ((os.flags !=3D STALLED && os.flags !=3D ABDICATED) ||=09// Only = continue in STALLED and ABDICATED XX =09 os.pidx_head !=3D os.pidx_tail ||=09=09=09// Require work to be = available XX =09 (os.flags !=3D ABDICATED && r->can_drain(r) =3D=3D 0))=09// Can = either drain, or everyone left XX =09=09return; XX +} XX=20 XX =09MPASS(os.cidx !=3D os.pidx_tail);=09/* implied by STALLED */ XX =09ns.state =3D os.state; This essentialy just adds back the previous code with a flag to check both versions. Hopefully the sysctl can do the same thing. The log message for r323954 claims an improvement of 30% for forwarding small packets, but I saw only lots more context switches, and more CPU use to do these, but only a small unimprovement for send(2)ing packets. My hack reduces the context switches but doesn't change the rate much. I don't understand forwarding but think it is usually entirely in the kernel and doesn't do as much blasting as netblast (just bursts of received packets with rate and burst size limiting by interrupt moderation, and with no syscall slowness between the packets?). This is a very different load. Ping (-fq) latency increased a while ago, but I forget when, and my hack doesn't affect it much. The increase was much larger for an I218V than for= a PRO1000(fairly low end). This might be due to timing problems increased by non-synchronous transmitting. > ... > I think part of the problem with iflib is just its sheer size, but > some of that is hard to avoid due to it being an intermediate shim > layer & having to translate packets. Hmm, the only thing I like about it is that it seems to be less sheer than a vendor driver :-) (1.5MB for e1000 and only 175K for iflib.c). > One thing I think could help is to do the conversion from mbufs > to iflib's packet info data structure at entry into iflib, and not > at xmit time. This the stuff that parses > the mbufs, does the virt to phys, and basically will take cache > misses if it runs on a different CPU, but seems less likely to > take cache misses if run just after ether_output() (which has > likely already taken misses). I've been trying to find the > time to make this change for a while. It would be interesting > to see if it helps your workload too. I forgot about cache misses. Separate threads must make them worse, especially for user threads and with spectres breaking caching. I think L2+ caches are shared across CPUs for x86, but some spectre cases flush the TLB which is not quite as bad as flushing caches. In my old work on bge, -current (6-8 at the time) seemed to be slower than my version in ~5.2 with more than half of the difference due to 1 or 2 more cache misses in the send[to]() path. I never located these exactly, and got nowhere with prefetch instructions on old Athlons. send() takes about 1600 nsec on an original Athlon64 ~2GHz, and though the main memory latency was much lower than now (42.7 nsec according to lmbench), adding a couple of cache misses to 1600 nsec means that the CPU saturates before the NIC+PCI33. CPU affinity doesn't have much affect on the results of my benchmarks. I think threads should never be bound to CPUs like iflib does, unless the CPUs can be dedicated to a single thread. Schedulers usually do a good job of picking the best CPU to run on (I fixed my version of 4BSD to do this slightly better than ULE for HTT pairs). Binding is home made scheduling which cannot adapt to changing loads, and it prevents the scheduler from picking the best CPU in some cases. One case is if previous activity resulted in all CPUs being non-idle. Then if CPU0 and CPU1 but no others become idle, threads on the others shouldn't switched to CPU0 or CPU1 even when these are a HTT pair so switching the threads now on CPU[2-3] would run faster by migrating one of them to CPU0 -- it just takes too long to migrate. Then if a bound thread needs to run on CPU6, it either has to wait or the thread on CPU6 must be migrated to CPU0 or CPU1. The thread should be unbound so that it can run immediately on any available CPU (CPU0 or CPU1 here). Bruce From owner-svn-src-head@freebsd.org Tue Dec 18 16:47: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 C8F161336C61; Tue, 18 Dec 2018 16:47:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6030675509; Tue, 18 Dec 2018 16:47:04 +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 5105F192D; Tue, 18 Dec 2018 16:47:04 +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 wBIGl4uS024757; Tue, 18 Dec 2018 16:47:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIGl4jm024756; Tue, 18 Dec 2018 16:47:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812181647.wBIGl4jm024756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 16:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342192 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 342192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6030675509 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 16:47:05 -0000 Author: markj Date: Tue Dec 18 16:47:03 2018 New Revision: 342192 URL: https://svnweb.freebsd.org/changeset/base/342192 Log: Use caph_enter_casper() in ping(8). Reported by: oshogbo MFC with: r341837 Sponsored by: The FreeBSD Foundation Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Tue Dec 18 14:39:29 2018 (r342191) +++ head/sbin/ping/ping.c Tue Dec 18 16:47:03 2018 (r342192) @@ -708,7 +708,7 @@ main(int argc, char *const *argv) * We must connect(2) our socket before this point. */ caph_cache_catpages(); - if (caph_enter() < 0) + if (caph_enter_casper() < 0) err(1, "cap_enter"); cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); From owner-svn-src-head@freebsd.org Tue Dec 18 17:17: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 5EB9A1337E00; Tue, 18 Dec 2018 17:17:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0151576727; Tue, 18 Dec 2018 17:17:54 +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 E6E011E49; Tue, 18 Dec 2018 17:17:53 +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 wBIHHrak040160; Tue, 18 Dec 2018 17:17:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIHHr8D040159; Tue, 18 Dec 2018 17:17:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812181717.wBIHHr8D040159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 18 Dec 2018 17:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342193 - head/sys/dev/ichwd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ichwd X-SVN-Commit-Revision: 342193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0151576727 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 17:17:54 -0000 Author: avg Date: Tue Dec 18 17:17:53 2018 New Revision: 342193 URL: https://svnweb.freebsd.org/changeset/base/342193 Log: ichwd: add a few assertions about tco_version Those should ensure correctness of ichwd_find_ich_lpc_bridge() and ichwd_find_ich_lpc_bridge() as well as make it easier for both humans and static analyzers to see the relation between tco_version and ich and smb variables in ichwd_identify(). Reported by: Coverity CID: 1396314, 1396317 MFC after: 10 days Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Tue Dec 18 16:47:03 2018 (r342192) +++ head/sys/dev/ichwd/ichwd.c Tue Dec 18 17:17:53 2018 (r342193) @@ -635,6 +635,13 @@ ichwd_identify(driver_t *driver, device_t parent) return; } + KASSERT(id_p->tco_version >= 1, + ("unexpected TCO version %d", id_p->tco_version)); + KASSERT(id_p->tco_version != 4 || smb != NULL, + ("could not find PCI SMBus device for TCOv4")); + KASSERT(id_p->tco_version >= 4 || ich != NULL, + ("could not find PCI LPC bridge device for TCOv1-3")); + /* good, add child to bus */ if ((dev = device_find_child(parent, driver->name, 0)) == NULL) dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); From owner-svn-src-head@freebsd.org Tue Dec 18 18:42: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 5012D133A989; Tue, 18 Dec 2018 18:42:05 +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 95E3281BC2; Tue, 18 Dec 2018 18:42:04 +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 EC9673D05E3; Wed, 19 Dec 2018 05:42:01 +1100 (AEDT) Date: Wed, 19 Dec 2018 05:42:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Andrew Gallatin , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en In-Reply-To: <20181219001335.A1412@besplex.bde.org> Message-ID: <20181219023918.E1895@besplex.bde.org> References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> <20181218033137.Q2217@besplex.bde.org> <20181219001335.A1412@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=zaJ64CYOsYNRDh1VX9IA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: 95E3281BC2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 18:42:05 -0000 On Wed, 19 Dec 2018, Bruce Evans wrote: > On Mon, 17 Dec 2018, Andrew Gallatin wrote: > >> On 12/17/18 2:08 PM, Bruce Evans wrote: >* ... >>> iflib uses queuing techniques to significantly pessimize em NICs with 1 >>> hardware queue.=C2=A0 On fast machines, it attempts to do 1 context swi= tch per > ... >> This can happen even w/o contention when "abdicate" is enabled in mp >> ring. I complained about this as well, and the default was changed in >> mp ring to not always "abdicate" (eg, switch to the tq to handle the >> packet). Abdication substantially pessimizes Netflix style web uncontend= ed=20 >> workloads, but it generally helps small packet forwarding. >>=20 >> It is interesting that you see the opposite. I should try benchmarking >> with just a single ring. > > Hmm, I didn't remember "abdicated" and never knew about the sysctl for it > (the sysctl is newer), but I notices the slowdown from near the first > commit for it (r323954) and already used the folowing workaround for it: > ... > This essentialy just adds back the previous code with a flag to check > both versions. Hopefully the sysctl can do the same thing. It doesn't. Setting tx_abdicate to 1 gives even more context switches (alm= ost twice as many, 800k/sec instead of 400k/sec, on i386 pessimized by INVARIANTS, WITNESS, !WITNESS_SKIPSPIN, 4G KVA and more. Without pessimizations it does 1M/sec instea of 400k/sec). The behaviour is easy to understand by watchomg top -SH -m io with netblast bound to the same CPU as the main tgq. Then netblast does involuntary context switches at the same rate that the tgq does voluntary context switches, and tx_abdicate= =3D1 doubles this rare. netblast only switches at the quantum rate (11 per seco= nd) when not bound (I think it does null switches and it is a bug to count thes= e as switches, but even null switches do too much). This is also without my usual default of !PREEMPTION && !IPI_PREEMPTION. Binding the netblast to the same CPU as the tgq only stops the excessive context switches wihen !PREEMPTION. My hack might depend on this too. Unfortunately, the hack is not in the same kernels as the sysctl, and I already have too many combinations to test. Another test with only 4G KVA (no INVARIANTS, etc., no PREEMPTION): tx_abdicate=3D0: tgq switch rate 997-1017k/sec (16k/sec if netblast bound) tx_abdicate=3D1: tgq switch rate 1300-1350k/sec (16k/sec if netblast bound) Another test on amd64 to escape i386 4G KVA pessimizations: tx_abdicate=3D0: tgq switch rate 1110-1220k/sec (16k/sec if netblast bound) tx_abdicate=3D1: tgq switch rate 1360-1430k/sec (16k/sec if netblast bound) When netblast is bound to the tgq's CPU, the tgq actually runs on another CPU. Apparently, the binding is weak ot this is a bugfeature in my schedul= er. When tx_abdicate=3D1, the switch rate is close to the packet rate. Since t= he NIC can't keep up, most packets are dropped. On amd64 with tx_abdicate=3D1= , the packet rates are: netblast bound: 313kpps sent, 1604kpps dropped netblast unbound: 253kpps sent, 1153kpps dropped 253kpps sent is bad. This indicates large latencies (not due to !PREEMPTIO= N or secheduler bugs AFAIK). Most tests with netblast unbound seemed to satu= rate the NIC at 280kpps (but the tests with netblast bound shows that the NIC ca= n go a little faster). Even an old 2GHz CPU can reach 280kpps. This shows another problem with taskqueues. It takes context switches just to decide to drop packets. Previous versions of iflib were much slower at dropping packets. Some had rates closer to the low send rate than the 1604= kpps achieved above. FreeBSD-5 running on a single 3 times slower CPU can drop packets at 2124kpps, mainly by dropping them in ip_output() after peeking a= t the software ifqs to see that there is no space. IFF_MONITOR gives better tests of the syscall overhead. Another test with amd64 and I218V instead of PRO1000: netblast bound, !abdicate: 1243kpps sent, 0kpps dropped (16k/sec csw) netblast unbound, !abdicate: 1236kpps sent, 0kpps dropped (16k/sec csw) netblast bound, abdicate: 1485kpps sent, 243kpps dropped (16k/sec csw) netblast unbound, abdicate: 1407kpps sent, 1.7kpps dropped (850k/sec csw) There is an i386 dependency after all! !abdicate works on amd64 but not on i386 to prevent the excessive context switches. Unfortunately, it also reduces kpps by almost 20% and leaves no spare CPU for dropping packets. The best case of netblast bound, abdicate is competitive with FreeBSD-11 on i386 with EM_MULTIQUEUE: above result repeated: netblast bound, abdicate: 1485kpps sent, 243kpps dropped (16k/sec csw) previous best result: FBSD-11 SMP-8 1486+241 # no iflib, use EM_MULTIQUEUE (now saturate 1Gbp= s) (this is without PREEMPTION* and without binding netblast). The above for -current also has the lowest possible CPU use (100% of 1 CPU for all threads, while netblast unbound takes 100% of 1 CPU for netblast an= d 60% of another CPU for tgq), and I think the FBSD=3D11 case takes 100% of 1 CPU for netblast unbound and a tiny% of another CPU for the taskqueue and a tiny unaccounted % of various CPUs for the fast interrupt handler. The fast interrupt handler is not accounted for in all cases. Since interrupt moderation gives a rate of 8 kHz, the interrupt handler doesn't take very long, but if it does a single PCI read then that might take 1 usec so 8 kHz costs 1% for that alone. Why would tx_abdicate=3D0 give extra context switches for i386 but not for amd64? More interestingly, what does it do wrong to lose 20% in kpps sent and more in kpps dropped? Another test with PREEMPTION*: netblast bound, !abdicate: same as above netblast unbound, !abdicate: same as above netblast bound, abdicate: 578kpps sent, 0kpps dropped (1160k/sec csw) netblast unbound, abdicate: 1106kpps sent, 0kpps dropped (850k/sec csw) That is, abdicate with PREEMPTION to make it work as fully intended destroys performance for the netblast bound case where it fixes most peformance problems without PREEMPTION; for the network unbound case it only reduces performance by 30%. It uses the same amount of CPU as !PREEMPTION. Another test with PREEMPTION* and SCHED_ULE instead of SCHED_4BSD (PREEMPTION* works a little differently in different schedulers. IIRC, IPI_PREEMPTION is useless and is mostly ignored in 4BSD and entirely ignored in ULE, and PREEMPTION loses a little more preemption in ULE than in 4BSD): netblast bound, !abdicate: same as above netblast unbound, !abdicate: same as above netblast bound, abdicate: same as above (very bad) netblast unbound, abdicate: 1485kpps sent, 0kpps dropped (850k/sec csw) In the 2 !abdicate cases, the CPU uses is below 1% for tgq. The very bad case is independent of the scheduler. This is probably inherent (some sort of contention on the common bound CPU when preemption is done technically correctly). I expected this case was much slower before I tried it). But ULE doesn't have the 30% loss for PREEMPTION && netblast unbound && abdicate. The case where ULE is better has large latency for 4BSD. It can be mostly fixed by binding netblast to any set of CPUs not containing the one of tgq or the one in the same HTT pair as that. The speed is then only 85kpps slower than with ULE. Otherwise, even my version of 4BSD sees no reason not to run netblast on the one of the CPUs on the same core as the tgq. (My 4BSD changes affinity more often since in other benchmarks it is bad to wait until the preferred is available; binding of taskqueues and ithread= s too often steals preferred CPUs and causes this migration.) When netblast decides to run on the same CPU as tgq, it contends with the tgq. When it decides to run on the HTT pair, both CPUs run 33% slower. Anyway, I don't want the ~1M/sec context switches given by abdicate. Context switching is especially bad for 4BSD. It still uses sched_lock for everything (it appears to use thread_lock(), but this just uses sched_lock for 4BSD). The slowness from this is remarkably small in most cases. Bruce From owner-svn-src-head@freebsd.org Tue Dec 18 18:52: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 3AE8B133ADDB; Tue, 18 Dec 2018 18:52:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D763882455; Tue, 18 Dec 2018 18:52:12 +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 CA5E02F67; Tue, 18 Dec 2018 18:52:12 +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 wBIIqCKG090178; Tue, 18 Dec 2018 18:52:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIIqCI4090177; Tue, 18 Dec 2018 18:52:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812181852.wBIIqCI4090177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Dec 2018 18:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342195 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D763882455 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 18:52:13 -0000 Author: imp Date: Tue Dec 18 18:52:12 2018 New Revision: 342195 URL: https://svnweb.freebsd.org/changeset/base/342195 Log: add pre-commit review request for drm*. Move dev/usb/wlan to sys/dev/usb/wlan as it was the odd-man-out. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Dec 18 17:31:31 2018 (r342194) +++ head/MAINTAINERS Tue Dec 18 18:52:12 2018 (r342195) @@ -44,7 +44,6 @@ contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb emaste Pre-commit review preferred. contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. contrib/pjdfstest freebsd-testing,asomers,ngie,pjd Pre-commit review requested. -dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. @@ -110,5 +109,8 @@ autofs(5) trasz Pre-commit review recommended. iscsi(4) trasz Pre-commit review recommended. rctl(8) trasz Pre-commit review recommended. sys/dev/ofw nwhitehorn Pre-commit review recommended. +sys/dev/drm* imp Pre-commit review requested in phabricator. Changes need to + be mirrored in gitub repo. +sys/dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org sys/arm/allwinner manu Pre-commit review requested sys/arm64/rockchip manu Pre-commit review requested From owner-svn-src-head@freebsd.org Tue Dec 18 19:05: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 05A2D133B367; Tue, 18 Dec 2018 19:05:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8E682AF0; Tue, 18 Dec 2018 19:05:57 +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 8345C314A; Tue, 18 Dec 2018 19:05:57 +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 wBIJ5vku098010; Tue, 18 Dec 2018 19:05:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIJ5vGR098009; Tue, 18 Dec 2018 19:05:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812181905.wBIJ5vGR098009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Dec 2018 19:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342196 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A8E682AF0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 19:05:58 -0000 Author: imp Date: Tue Dec 18 19:05:57 2018 New Revision: 342196 URL: https://svnweb.freebsd.org/changeset/base/342196 Log: Fix typo and formatting... Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Dec 18 18:52:12 2018 (r342195) +++ head/MAINTAINERS Tue Dec 18 19:05:57 2018 (r342196) @@ -110,7 +110,7 @@ iscsi(4) trasz Pre-commit review recommended. rctl(8) trasz Pre-commit review recommended. sys/dev/ofw nwhitehorn Pre-commit review recommended. sys/dev/drm* imp Pre-commit review requested in phabricator. Changes need to - be mirrored in gitub repo. + be mirrored in github repo. sys/dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org sys/arm/allwinner manu Pre-commit review requested sys/arm64/rockchip manu Pre-commit review requested From owner-svn-src-head@freebsd.org Tue Dec 18 19:38: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 6A627133C9C6; Tue, 18 Dec 2018 19:38:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3BB843F0; Tue, 18 Dec 2018 19:38:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 02C3B3815; Tue, 18 Dec 2018 19:38:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBIJcDOs014211; Tue, 18 Dec 2018 19:38:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIJcDEw014210; Tue, 18 Dec 2018 19:38:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201812181938.wBIJcDEw014210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 18 Dec 2018 19:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342197 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 342197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F3BB843F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 19:38:14 -0000 Author: glebius Date: Tue Dec 18 19:38:13 2018 New Revision: 342197 URL: https://svnweb.freebsd.org/changeset/base/342197 Log: Use mbufq instead of ifqueue to queue mbufs. Modified: head/sys/dev/usb/net/uhso.c Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Tue Dec 18 19:05:57 2018 (r342196) +++ head/sys/dev/usb/net/uhso.c Tue Dec 18 19:38:13 2018 (r342197) @@ -98,7 +98,7 @@ struct uhso_softc { struct ifnet *sc_ifp; struct mbuf *sc_mwait; /* Partial packet */ size_t sc_waitlen; /* No. of outstanding bytes */ - struct ifqueue sc_rxq; + struct mbufq sc_rxq; struct callout sc_c; /* TTY related structures */ @@ -560,6 +560,7 @@ uhso_attach(device_t self) sc->sc_dev = self; sc->sc_udev = uaa->device; mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF); + mbufq_init(&sc->sc_rxq, INT_MAX); /* XXXGL: sane maximum */ ucom_ref(&sc->sc_super_ucom); sc->sc_radio = 1; @@ -1626,11 +1627,13 @@ uhso_ifnet_read_callback(struct usb_xfer *xfer, usb_er case USB_ST_TRANSFERRED: if (actlen > 0 && (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)) { pc = usbd_xfer_get_frame(xfer, 0); + if (mbufq_full(&sc->sc_rxq)) + break; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); usbd_copy_out(pc, 0, mtod(m, uint8_t *), actlen); m->m_pkthdr.len = m->m_len = actlen; /* Enqueue frame for further processing */ - _IF_ENQUEUE(&sc->sc_rxq, m); + mbufq_enqueue(&sc->sc_rxq, m); if (!callout_pending(&sc->sc_c) || !callout_active(&sc->sc_c)) { callout_schedule(&sc->sc_c, 1); @@ -1676,8 +1679,7 @@ uhso_if_rxflush(void *arg) mwait = sc->sc_mwait; for (;;) { if (m == NULL) { - _IF_DEQUEUE(&sc->sc_rxq, m); - if (m == NULL) + if ((m = mbufq_dequeue(&sc->sc_rxq)) == NULL) break; UHSO_DPRINTF(3, "dequeue m=%p, len=%d\n", m, m->m_len); } From owner-svn-src-head@freebsd.org Tue Dec 18 21:43: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 9B58313402D1; Tue, 18 Dec 2018 21:43:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40570893B6; Tue, 18 Dec 2018 21:43:34 +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 31E234F3E; Tue, 18 Dec 2018 21:43:34 +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 wBILhYpc082161; Tue, 18 Dec 2018 21:43:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBILhXNW082160; Tue, 18 Dec 2018 21:43:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812182143.wBILhXNW082160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 18 Dec 2018 21:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342204 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40570893B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Dec 2018 21:43:34 -0000 Author: avg Date: Tue Dec 18 21:43:33 2018 New Revision: 342204 URL: https://svnweb.freebsd.org/changeset/base/342204 Log: cyapa.4, isl.4: cross-reference and document use of chromebook_platform(4) PR: 218632 Reported by: Denis Kozadaev MFC after: 1 week Modified: head/share/man/man4/cyapa.4 head/share/man/man4/isl.4 Modified: head/share/man/man4/cyapa.4 ============================================================================== --- head/share/man/man4/cyapa.4 Tue Dec 18 21:01:48 2018 (r342203) +++ head/share/man/man4/cyapa.4 Tue Dec 18 21:43:33 2018 (r342204) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 03, 2016 +.Dd December 18, 2018 .Dt CYAPA 4 .Os .Sh NAME @@ -46,7 +46,13 @@ cyapa_load="YES" ig4_load="YES" .Ed .Pp -In +On many Chromebook models this driver can be automatically configured with the +help of the +.Xr chromebook_platform 4 +driver. +Alternatively, the +.Nm +driver can be manually configured in .Pa /boot/device.hints : .Cd hint.cyapa.0.at="iicbus0" .Cd hint.cyapa.0.addr="0xCE" @@ -195,6 +201,7 @@ file: .Dl debug.cyapa_thumbarea_percent=0 .Dl debug.cyapa_enable_tapclick=2 .Sh SEE ALSO +.Xr chromebook_platform 4 , .Xr ig4 4 , .Xr iicbus 4 , .Xr sysmouse 4 , Modified: head/share/man/man4/isl.4 ============================================================================== --- head/share/man/man4/isl.4 Tue Dec 18 21:01:48 2018 (r342203) +++ head/share/man/man4/isl.4 Tue Dec 18 21:43:33 2018 (r342204) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 03, 2016 +.Dd December 18, 2018 .Dt ISL 4 .Os .Sh NAME @@ -46,7 +46,13 @@ isl_load="YES" ig4_load="YES" .Ed .Pp -In +On many Chromebook models this driver can be automatically configured with the +help of the +.Xr chromebook_platform 4 +driver. +Alternatively, the +.Nm +driver can be manually configured in .Pa /boot/device.hints : .Cd hint.isl.0.at="iicbus0" .Cd hint.isl.0.addr="0x88" @@ -106,6 +112,7 @@ $ pkg install intel-backlight $ sh /usr/local/share/examples/intel-backlight/isl_backlight.sh .Ed .Sh SEE ALSO +.Xr chromebook_platform 4 , .Xr ig4 4 , .Xr iicbus 4 .Sh AUTHORS From owner-svn-src-head@freebsd.org Wed Dec 19 00:17: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 DD8CF1343C0C; Wed, 19 Dec 2018 00:17: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 816228E293; Wed, 19 Dec 2018 00:17:22 +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 737D867CB; Wed, 19 Dec 2018 00:17:22 +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 wBJ0HM1B059317; Wed, 19 Dec 2018 00:17:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ0HMfV059316; Wed, 19 Dec 2018 00:17:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812190017.wBJ0HMfV059316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 00:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342207 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 816228E293 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 00:17:23 -0000 Author: markj Date: Wed Dec 19 00:17:22 2018 New Revision: 342207 URL: https://svnweb.freebsd.org/changeset/base/342207 Log: Fix DDB's "show malloc" after r338899. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Dec 18 23:22:37 2018 (r342206) +++ head/sys/kern/kern_malloc.c Wed Dec 19 00:17:22 2018 (r342207) @@ -1205,7 +1205,7 @@ restart: DB_SHOW_COMMAND(malloc, db_show_malloc) { struct malloc_type_internal *mtip; - struct malloc_type_internal *mtsp; + struct malloc_type_stats *mtsp; struct malloc_type *mtp; uint64_t allocs, frees; uint64_t alloced, freed; @@ -1221,10 +1221,10 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) freed = 0; for (i = 0; i <= mp_maxid; i++) { mtsp = zpcpu_get_cpu(mtip->mti_stats, i); - allocs += mtip->mti_stats[i].mts_numallocs; - frees += mtip->mti_stats[i].mts_numfrees; - alloced += mtip->mti_stats[i].mts_memalloced; - freed += mtip->mti_stats[i].mts_memfreed; + allocs += mtsp->mts_numallocs; + frees += mtsp->mts_numfrees; + alloced += mtsp->mts_memalloced; + freed += mtsp->mts_memfreed; } db_printf("%18s %12ju %12juK %12ju\n", mtp->ks_shortdesc, allocs - frees, From owner-svn-src-head@freebsd.org Wed Dec 19 01:37: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 0F075134653C; Wed, 19 Dec 2018 01:37:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1FDA91A45; Wed, 19 Dec 2018 01:37:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FD487533; Wed, 19 Dec 2018 01:37:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJ1b1He000826; Wed, 19 Dec 2018 01:37:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ1b0u3000821; Wed, 19 Dec 2018 01:37:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812190137.wBJ1b0u3000821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Dec 2018 01:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342208 - 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: 342208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1FDA91A45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 01:37:02 -0000 Author: np Date: Wed Dec 19 01:37:00 2018 New Revision: 342208 URL: https://svnweb.freebsd.org/changeset/base/342208 Log: cxgbe/t4_tom: fixes for issues on the passive open side. - Fix PR 227760 by getting the TOE to respond to the SYN after the call to toe_syncache_add, not during it. The kernel syncache code calls syncache_respond just before syncache_insert. If the ACK to the syncache_respond is processed in another thread it may run before the syncache_insert and won't find the entry. Note that this affects only t4_tom because it's the only driver trying to insert and expand syncache entries from different threads. - Do not leak resources if an embryonic connection terminates at SYN_RCVD because of L2 lookup failures. - Retire lctx->synq and associated code because there is never a need to walk the list of embryonic connections associated with a listener. The per-tid state is still called a synq entry in the driver even though the synq itself is now gone. PR: 227760 MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Dec 19 00:17:22 2018 (r342207) +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Dec 19 01:37:00 2018 (r342208) @@ -99,7 +99,8 @@ do_act_establish(struct sge_iq *iq, const struct rss_h goto done; } - make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); + make_established(toep, be32toh(cpl->snd_isn) - 1, + be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt); if (toep->ulp_mode == ULP_MODE_TLS) tls_establish(toep); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Dec 19 00:17:22 2018 (r342207) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Dec 19 01:37:00 2018 (r342208) @@ -373,18 +373,15 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt) * Completes some final bits of initialization for just established connections * and changes their state to TCPS_ESTABLISHED. * - * The ISNs are from after the exchange of SYNs. i.e., the true ISN + 1. + * The ISNs are from the exchange of SYNs. */ void -make_established(struct toepcb *toep, uint32_t snd_isn, uint32_t rcv_isn, - uint16_t opt) +make_established(struct toepcb *toep, uint32_t iss, uint32_t irs, uint16_t opt) { struct inpcb *inp = toep->inp; struct socket *so = inp->inp_socket; struct tcpcb *tp = intotcpcb(inp); long bufsize; - uint32_t iss = be32toh(snd_isn) - 1; /* true ISS */ - uint32_t irs = be32toh(rcv_isn) - 1; /* true IRS */ uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; @@ -1245,22 +1242,12 @@ do_peer_close(struct sge_iq *iq, const struct rss_head KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); if (__predict_false(toep->flags & TPF_SYNQE)) { -#ifdef INVARIANTS - struct synq_entry *synqe = (void *)toep; - - INP_WLOCK(synqe->lctx->inp); - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } else { - /* - * do_pass_accept_req is still running and will - * eventually take care of this tid. - */ - } - INP_WUNLOCK(synqe->lctx->inp); -#endif + /* + * do_pass_establish must have run before do_peer_close and if + * this is still a synqe instead of a toepcb then the connection + * must be getting aborted. + */ + MPASS(toep->flags & TPF_ABORT_SHUTDOWN); CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, toep, toep->flags); return (0); @@ -1568,22 +1555,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { -#ifdef INVARIANTS - struct synq_entry *synqe = (void *)toep; - - INP_WLOCK(synqe->lctx->inp); - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } else { - /* - * do_pass_accept_req is still running and will - * eventually take care of this tid. - */ - } - INP_WUNLOCK(synqe->lctx->inp); -#endif + /* + * do_pass_establish must have run before do_rx_data and if this + * is still a synqe instead of a toepcb then the connection must + * be getting aborted. + */ + MPASS(toep->flags & TPF_ABORT_SHUTDOWN); CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, toep, toep->flags); m_freem(m); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Dec 19 00:17:22 2018 (r342207) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Dec 19 01:37:00 2018 (r342208) @@ -87,9 +87,6 @@ static struct listen_ctx *listen_hash_find(struct adap static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *); static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); -static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *, - struct offload_settings *); -static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *); static void send_reset_synqe(struct toedev *, struct synq_entry *); static int @@ -223,7 +220,6 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, stru lctx->ctrlq = &sc->sge.ctrlq[vi->pi->port_id]; lctx->ofld_rxq = &sc->sge.ofld_rxq[vi->first_ofld_rxq]; refcount_init(&lctx->refcount, 1); - TAILQ_INIT(&lctx->synq); lctx->inp = inp; lctx->vnet = inp->inp_socket->so_vnet; @@ -241,8 +237,6 @@ free_lctx(struct adapter *sc, struct listen_ctx *lctx) INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, ("%s: refcount %d", __func__, lctx->refcount)); - KASSERT(TAILQ_EMPTY(&lctx->synq), - ("%s: synq not empty.", __func__)); KASSERT(lctx->stid >= 0, ("%s: bad stid %d.", __func__, lctx->stid)); CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p", @@ -358,7 +352,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry struct wrqe *wr; struct fw_flowc_wr *flowc; struct cpl_abort_req *req; - int txqid, rxqid, flowclen; + int flowclen; struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; @@ -374,9 +368,8 @@ send_reset_synqe(struct toedev *tod, struct synq_entry return; /* abort already in progress */ synqe->flags |= TPF_ABORT_SHUTDOWN; - get_qids_from_mbuf(m, &txqid, &rxqid); - ofld_txq = &sc->sge.ofld_txq[txqid]; - ofld_rxq = &sc->sge.ofld_rxq[rxqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; + ofld_rxq = &sc->sge.ofld_rxq[synqe->rxqid]; /* The wrqe will have two WRs - a flowc followed by an abort_req */ flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -606,7 +599,6 @@ t4_listen_stop(struct toedev *tod, struct tcpcb *tp) struct listen_ctx *lctx; struct adapter *sc = tod->tod_softc; struct inpcb *inp = tp->t_inpcb; - struct synq_entry *synqe; INP_WLOCK_ASSERT(inp); @@ -622,25 +614,33 @@ t4_listen_stop(struct toedev *tod, struct tcpcb *tp) * arrive and clean up when it does. */ if (lctx->flags & LCTX_RPL_PENDING) { - KASSERT(TAILQ_EMPTY(&lctx->synq), - ("%s: synq not empty.", __func__)); return (EINPROGRESS); } - /* - * The host stack will abort all the connections on the listening - * socket's so_comp. It doesn't know about the connections on the synq - * so we need to take care of those. - */ - TAILQ_FOREACH(synqe, &lctx->synq, link) { - if (synqe->flags & TPF_SYNQE_HAS_L2TE) - send_reset_synqe(tod, synqe); - } - destroy_server(sc, lctx); return (0); } +static inline struct synq_entry * +alloc_synqe(struct adapter *sc __unused, struct listen_ctx *lctx, int flags) +{ + struct synq_entry *synqe; + + INP_WLOCK_ASSERT(lctx->inp); + MPASS(flags == M_WAITOK || flags == M_NOWAIT); + + synqe = malloc(sizeof(*synqe), M_CXGBE, flags); + if (__predict_true(synqe != NULL)) { + synqe->flags = TPF_SYNQE; + refcount_init(&synqe->refcnt, 1); + synqe->lctx = lctx; + hold_lctx(lctx); /* Every synqe has a ref on its lctx. */ + synqe->syn = NULL; + } + + return (synqe); +} + static inline void hold_synqe(struct synq_entry *synqe) { @@ -648,17 +648,25 @@ hold_synqe(struct synq_entry *synqe) refcount_acquire(&synqe->refcnt); } -static inline void -release_synqe(struct synq_entry *synqe) +static inline struct inpcb * +release_synqe(struct adapter *sc, struct synq_entry *synqe) { + struct inpcb *inp; - if (refcount_release(&synqe->refcnt)) { - int needfree = synqe->flags & TPF_SYNQE_NEEDFREE; + MPASS(synqe->flags & TPF_SYNQE); + MPASS(synqe->lctx != NULL); + inp = synqe->lctx->inp; + MPASS(inp != NULL); + INP_WLOCK_ASSERT(inp); + + if (refcount_release(&synqe->refcnt)) { + inp = release_lctx(sc, synqe->lctx); m_freem(synqe->syn); - if (needfree) - free(synqe, M_CXGBE); + free(synqe, M_CXGBE); } + + return (inp); } void @@ -670,51 +678,45 @@ t4_syncache_added(struct toedev *tod __unused, void *a } void -t4_syncache_removed(struct toedev *tod __unused, void *arg) +t4_syncache_removed(struct toedev *tod, void *arg) { + struct adapter *sc = tod->tod_softc; struct synq_entry *synqe = arg; + struct inpcb *inp = synqe->lctx->inp; - release_synqe(synqe); + /* + * XXX: this is a LOR but harmless when running from the softclock. + */ + INP_WLOCK(inp); + inp = release_synqe(sc, synqe); + if (inp != NULL) + INP_WUNLOCK(inp); } int t4_syncache_respond(struct toedev *tod, void *arg, struct mbuf *m) { - struct adapter *sc = tod->tod_softc; struct synq_entry *synqe = arg; - struct wrqe *wr; - struct l2t_entry *e; - struct tcpopt to; - struct ip *ip = mtod(m, struct ip *); - struct tcphdr *th; - wr = (struct wrqe *)atomic_readandclear_ptr(&synqe->wr); - if (wr == NULL) { - m_freem(m); - return (EALREADY); - } + if (atomic_fetchadd_int(&synqe->ok_to_respond, 1) == 0) { + struct tcpopt to; + struct ip *ip = mtod(m, struct ip *); + struct tcphdr *th; - if (ip->ip_v == IPVERSION) - th = (void *)(ip + 1); - else - th = (void *)((struct ip6_hdr *)ip + 1); - bzero(&to, sizeof(to)); - tcp_dooptions(&to, (void *)(th + 1), (th->th_off << 2) - sizeof(*th), - TO_SYN); + if (ip->ip_v == IPVERSION) + th = (void *)(ip + 1); + else + th = (void *)((struct ip6_hdr *)ip + 1); + bzero(&to, sizeof(to)); + tcp_dooptions(&to, (void *)(th + 1), + (th->th_off << 2) - sizeof(*th), TO_SYN); - /* save these for later */ - synqe->iss = be32toh(th->th_seq); - synqe->ts = to.to_tsval; - - if (chip_id(sc) >= CHELSIO_T5) { - struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); - - rpl5->iss = th->th_seq; + /* save these for later */ + synqe->iss = be32toh(th->th_seq); + synqe->irs = be32toh(th->th_ack) - 1; + synqe->ts = to.to_tsval; } - e = &sc->l2t->l2tab[synqe->l2e_idx]; - t4_l2t_send(sc, wr, e); - m_freem(m); /* don't need this any more */ return (0); } @@ -834,23 +836,29 @@ done_with_synqe(struct adapter *sc, struct synq_entry { struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; int ntids; INP_WLOCK_ASSERT(inp); ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; - TAILQ_REMOVE(&lctx->synq, synqe, link); - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); remove_tid(sc, synqe->tid, ntids); - release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]); + release_tid(sc, synqe->tid, lctx->ctrlq); t4_l2t_release(e); - release_synqe(synqe); /* removed from synq list */ + inp = release_synqe(sc, synqe); + if (inp) + INP_WUNLOCK(inp); } +void +synack_failure_cleanup(struct adapter *sc, int tid) +{ + struct synq_entry *synqe = lookup_tid(sc, tid); + + INP_WLOCK(synqe->lctx->inp); + done_with_synqe(sc, synqe); +} + int do_abort_req_synqe(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -861,7 +869,6 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss struct synq_entry *synqe = lookup_tid(sc, tid); struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - int txqid; struct sge_wrq *ofld_txq; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -880,8 +887,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss INP_WLOCK(inp); - get_qids_from_mbuf(synqe->syn, &txqid, NULL); - ofld_txq = &sc->sge.ofld_txq[txqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; /* * If we'd initiated an abort earlier the reply to it is responsible for @@ -941,23 +947,23 @@ t4_offload_socket(struct toedev *tod, void *arg, struc #ifdef INVARIANTS struct inpcb *inp = sotoinpcb(so); #endif - struct cpl_pass_establish *cpl = mtod(synqe->syn, void *); - struct toepcb *toep = *(struct toepcb **)(cpl + 1); + struct toepcb *toep = synqe->toep; INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); + MPASS(toep->tid == synqe->tid); offload_socket(so, toep); - make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); + make_established(toep, synqe->iss, synqe->irs, synqe->tcp_opt); toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); synqe->flags |= TPF_SYNQE_EXPANDED; } static inline void -save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, +save_qids_in_synqe(struct synq_entry *synqe, struct vi_info *vi, struct offload_settings *s) { uint32_t txqid, rxqid; @@ -974,43 +980,10 @@ save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, rxqid = arc4random() % vi->nofldrxq; rxqid += vi->first_ofld_rxq; - m->m_pkthdr.flowid = (txqid << 16) | (rxqid & 0xffff); + synqe->txqid = txqid; + synqe->rxqid = rxqid; } -static inline void -get_qids_from_mbuf(struct mbuf *m, int *txqid, int *rxqid) -{ - - if (txqid) - *txqid = m->m_pkthdr.flowid >> 16; - if (rxqid) - *rxqid = m->m_pkthdr.flowid & 0xffff; -} - -/* - * Use the trailing space in the mbuf in which the PASS_ACCEPT_REQ arrived to - * store some state temporarily. - */ -static struct synq_entry * -mbuf_to_synqe(struct mbuf *m) -{ - int len = roundup2(sizeof (struct synq_entry), 8); - int tspace = M_TRAILINGSPACE(m); - struct synq_entry *synqe = NULL; - - if (tspace < len) { - synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT); - if (synqe == NULL) - return (NULL); - synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE; - } else { - synqe = (void *)(m->m_data + m->m_len + tspace - len); - synqe->flags = TPF_SYNQE; - } - - return (synqe); -} - static void t4opt_to_tcpopt(const struct tcp_options *t4opt, struct tcpopt *to) { @@ -1210,7 +1183,39 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifne return (e); } -#define REJECT_PASS_ACCEPT() do { \ +static int +send_synack(struct adapter *sc, struct synq_entry *synqe, uint64_t opt0, + uint32_t opt2, int tid) +{ + struct wrqe *wr; + struct cpl_pass_accept_rpl *rpl; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + + wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : + sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[0]); + if (wr == NULL) + return (ENOMEM); + rpl = wrtod(wr); + + if (is_t4(sc)) + INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + else { + struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; + + INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + rpl5->iss = htobe32(synqe->iss); + } + rpl->opt0 = opt0; + rpl->opt2 = opt2; + + return (t4_l2t_send(sc, wr, e)); +} + +#define REJECT_PASS_ACCEPT_REQ(tunnel) do { \ + if (!tunnel) { \ + m_freem(m); \ + m = NULL; \ + } \ reject_reason = __LINE__; \ goto reject; \ } while (0) @@ -1234,8 +1239,6 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss struct adapter *sc = iq->adapter; struct toedev *tod; const struct cpl_pass_accept_req *cpl = mtod(m, const void *); - struct cpl_pass_accept_rpl *rpl; - struct wrqe *wr; unsigned int stid = G_PASS_OPEN_TID(be32toh(cpl->tos_stid)); unsigned int tid = GET_TID(cpl); struct listen_ctx *lctx = lookup_stid(sc, stid); @@ -1248,11 +1251,9 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss struct vi_info *vi; struct ifnet *hw_ifp, *ifp; struct l2t_entry *e = NULL; - int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; int reject_reason, v, ntids; - uint16_t vid; - u_int wnd; + uint16_t vid, l2info; struct epoch_tracker et; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -1266,36 +1267,35 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss CTR4(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p", __func__, stid, tid, lctx); - pass_accept_req_to_protohdrs(sc, m, &inc, &th); - t4opt_to_tcpopt(&cpl->tcpopt, &to); + CURVNET_SET(lctx->vnet); /* before any potential REJECT */ - pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; - - CURVNET_SET(lctx->vnet); - /* - * Use the MAC index to lookup the associated VI. If this SYN - * didn't match a perfect MAC filter, punt. + * Use the MAC index to lookup the associated VI. If this SYN didn't + * match a perfect MAC filter, punt. */ - if (!(be16toh(cpl->l2info) & F_SYN_XACT_MATCH)) { - m_freem(m); - m = NULL; - REJECT_PASS_ACCEPT(); + l2info = be16toh(cpl->l2info); + pi = sc->port[G_SYN_INTF(l2info)]; + if (!(l2info & F_SYN_XACT_MATCH)) { + REJECT_PASS_ACCEPT_REQ(false); } for_each_vi(pi, v, vi) { - if (vi->xact_addr_filt == G_SYN_MAC_IDX(be16toh(cpl->l2info))) + if (vi->xact_addr_filt == G_SYN_MAC_IDX(l2info)) goto found; } - m_freem(m); - m = NULL; - REJECT_PASS_ACCEPT(); - + REJECT_PASS_ACCEPT_REQ(false); found: - hw_ifp = vi->ifp; /* the (v)cxgbeX ifnet */ + hw_ifp = vi->ifp; /* the cxgbe ifnet */ m->m_pkthdr.rcvif = hw_ifp; tod = TOEDEV(hw_ifp); /* + * Don't offload if the peer requested a TCP option that's not known to + * the silicon. Send the SYN to the kernel instead. + */ + if (__predict_false(cpl->tcpopt.unknown)) + REJECT_PASS_ACCEPT_REQ(true); + + /* * Figure out if there is a pseudo interface (vlan, lagg, etc.) * involved. Don't offload if the SYN had a VLAN tag and the vid * doesn't match anything on this interface. @@ -1306,75 +1306,57 @@ found: if (vid != 0xfff && vid != 0) { ifp = VLAN_DEVAT(hw_ifp, vid); if (ifp == NULL) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); } else ifp = hw_ifp; /* - * Don't offload if the peer requested a TCP option that's not known to - * the silicon. + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. */ - if (cpl->tcpopt.unknown) - REJECT_PASS_ACCEPT(); + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT_REQ(true); + pass_accept_req_to_protohdrs(sc, m, &inc, &th); if (inc.inc_flags & INC_ISIPV6) { /* Don't offload if the ifcap isn't enabled */ if ((ifp->if_capenable & IFCAP_TOE6) == 0) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* * SYN must be directed to an IP6 address on this ifnet. This * is more restrictive than in6_localip. */ if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); ntids = 2; } else { /* Don't offload if the ifcap isn't enabled */ if ((ifp->if_capenable & IFCAP_TOE4) == 0) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* * SYN must be directed to an IP address on this ifnet. This * is more restrictive than in_localip. */ if (!in_ifhasaddr(ifp, inc.inc_laddr)) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); ntids = 1; } - /* - * Don't offload if the ifnet that the SYN came in on is not in the same - * vnet as the listening socket. - */ - if (lctx->vnet != ifp->if_vnet) - REJECT_PASS_ACCEPT(); - e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); - synqe = mbuf_to_synqe(m); - if (synqe == NULL) - REJECT_PASS_ACCEPT(); - - wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : - sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[pi->port_id]); - if (wr == NULL) - REJECT_PASS_ACCEPT(); - rpl = wrtod(wr); - - INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for 4-tuple check */ - /* Don't offload if the 4-tuple is already in use */ + INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for 4-tuple check */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(false); } INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); @@ -1383,14 +1365,8 @@ found: /* Don't offload if the listening socket has closed */ if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * The listening socket has closed. The reply from the TOE to - * our CPL_CLOSE_LISTSRV_REQ will ultimately release all - * resources tied to this listen context. - */ INP_WUNLOCK(inp); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(false); } so = inp->inp_socket; rw_rlock(&sc->policy_lock); @@ -1399,119 +1375,65 @@ found: rw_runlock(&sc->policy_lock); if (!settings.offload) { INP_WUNLOCK(inp); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* Rejected by COP. */ } - mtu_idx = find_best_mtu_idx(sc, &inc, &settings); - rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); - wnd = min(wnd, MAX_RCV_WND); - rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); - - save_qids_in_mbuf(m, vi, &settings); - get_qids_from_mbuf(m, NULL, &rxqid); - - if (is_t4(sc)) - INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); - else { - struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; - - INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + synqe = alloc_synqe(sc, lctx, M_NOWAIT); + if (synqe == NULL) { + INP_WUNLOCK(inp); + REJECT_PASS_ACCEPT_REQ(true); } - ulp_mode = select_ulp_mode(so, sc, &settings); - switch (ulp_mode) { - case ULP_MODE_TCPDDP: - synqe->flags |= TPF_SYNQE_TCPDDP; - break; - case ULP_MODE_TLS: - synqe->flags |= TPF_SYNQE_TLS; - break; - } - rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode, - &settings); - rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode, - CC_ALGO(intotcpcb(inp)), &settings); + atomic_store_int(&synqe->ok_to_respond, 0); - synqe->tid = tid; - synqe->lctx = lctx; - synqe->syn = m; - m = NULL; - refcount_init(&synqe->refcnt, 1); /* 1 means extra hold */ - synqe->l2e_idx = e->idx; - synqe->rcv_bufsize = rx_credits; - atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); - - insert_tid(sc, tid, synqe, ntids); - TAILQ_INSERT_TAIL(&lctx->synq, synqe, link); - hold_synqe(synqe); /* hold for the duration it's in the synq */ - hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */ - /* * If all goes well t4_syncache_respond will get called during * syncache_add. Note that syncache_add releases the pcb lock. */ + t4opt_to_tcpopt(&cpl->tcpopt, &to); toe_syncache_add(&inc, &to, &th, inp, tod, synqe); - INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - /* - * If we replied during syncache_add (synqe->wr has been consumed), - * good. Otherwise, set it to 0 so that further syncache_respond - * attempts by the kernel will be ignored. - */ - if (atomic_cmpset_ptr(&synqe->wr, (uintptr_t)wr, 0)) { + if (atomic_load_int(&synqe->ok_to_respond) > 0) { + uint64_t opt0; + uint32_t opt2; + u_int wnd; + int rscale, mtu_idx, rx_credits; - /* - * syncache may or may not have a hold on the synqe, which may - * or may not be stashed in the original SYN mbuf passed to us. - * Just copy it over instead of dealing with all possibilities. - */ - m = m_dup(synqe->syn, M_NOWAIT); - if (m) - m->m_pkthdr.rcvif = hw_ifp; + mtu_idx = find_best_mtu_idx(sc, &inc, &settings); + rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; + /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ + wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); + wnd = min(wnd, MAX_RCV_WND); + rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); - remove_tid(sc, synqe->tid, ntids); - free(wr, M_CXGBE); + save_qids_in_synqe(synqe, vi, &settings); + synqe->ulp_mode = select_ulp_mode(so, sc, &settings); - /* Yank the synqe out of the lctx synq. */ - INP_WLOCK(inp); - TAILQ_REMOVE(&lctx->synq, synqe, link); - release_synqe(synqe); /* removed from synq list */ - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); + opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, + synqe->ulp_mode, &settings); + opt2 = calc_opt2p(sc, pi, synqe->rxqid, &cpl->tcpopt, &th, + synqe->ulp_mode, CC_ALGO(intotcpcb(inp)), &settings); - release_synqe(synqe); /* extra hold */ - REJECT_PASS_ACCEPT(); - } + insert_tid(sc, tid, synqe, ntids); + synqe->tid = tid; + synqe->l2e_idx = e->idx; + synqe->rcv_bufsize = rx_credits; + synqe->syn = m; + m = NULL; - CTR6(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK mode %d", - __func__, stid, tid, lctx, synqe, ulp_mode); + if (send_synack(sc, synqe, opt0, opt2, tid) != 0) { + remove_tid(sc, tid, ntids); + m = synqe->syn; + synqe->syn = NULL; + REJECT_PASS_ACCEPT_REQ(true); + } - INP_WLOCK(inp); - synqe->flags |= TPF_SYNQE_HAS_L2TE; - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * Listening socket closed but tod_listen_stop did not abort - * this tid because there was no L2T entry for the tid at that - * time. Abort it now. The reply to the abort will clean up. - */ CTR6(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p (0x%x), ABORT", - __func__, stid, tid, lctx, synqe, synqe->flags); - if (!(synqe->flags & TPF_SYNQE_EXPANDED)) - send_reset_synqe(tod, synqe); - INP_WUNLOCK(inp); - CURVNET_RESTORE(); + "%s: stid %u, tid %u, lctx %p, synqe %p, mode %d, SYNACK", + __func__, stid, tid, lctx, synqe, synqe->ulp_mode); + } else + REJECT_PASS_ACCEPT_REQ(false); - release_synqe(synqe); /* extra hold */ - return (__LINE__); - } - INP_WUNLOCK(inp); CURVNET_RESTORE(); - - release_synqe(synqe); /* extra hold */ return (0); reject: CURVNET_RESTORE(); @@ -1521,8 +1443,19 @@ reject: if (e) t4_l2t_release(e); release_tid(sc, tid, lctx->ctrlq); + if (synqe) { + inp = synqe->lctx->inp; + INP_WLOCK(inp); + inp = release_synqe(sc, synqe); + if (inp) + INP_WUNLOCK(inp); + } - if (__predict_true(m != NULL)) { + if (m) { + /* + * The connection request hit a TOE listener but is being passed + * on to the kernel sw stack instead of getting offloaded. + */ m_adj(m, sizeof(*cpl)); m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); @@ -1575,7 +1508,6 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ struct in_conninfo inc; struct toepcb *toep; struct epoch_tracker et; - u_int txqid, rxqid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1595,73 +1527,46 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ "%s: stid %u, tid %u, synqe %p (0x%x), inp_flags 0x%x", __func__, stid, tid, synqe, synqe->flags, inp->inp_flags); - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } - - INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - CURVNET_RESTORE(); - return (0); - } - ifp = synqe->syn->m_pkthdr.rcvif; vi = ifp->if_softc; KASSERT(vi->pi->adapter == sc, ("%s: vi %p, sc %p mismatch", __func__, vi, sc)); - get_qids_from_mbuf(synqe->syn, &txqid, &rxqid); - KASSERT(rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], - ("%s: CPL arrived on unexpected rxq. %d %d", __func__, rxqid, - (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); - - toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT); - if (toep == NULL) { + if (__predict_false(inp->inp_flags & INP_DROPPED)) { reset: - /* - * The reply to this abort will perform final cleanup. There is - * no need to check for HAS_L2TE here. We can be here only if - * we responded to the PASS_ACCEPT_REQ, and our response had the - * L2T idx. - */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); } + + KASSERT(synqe->rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], + ("%s: CPL arrived on unexpected rxq. %d %d", __func__, + synqe->rxqid, (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); + + toep = alloc_toepcb(vi, synqe->txqid, synqe->rxqid, M_NOWAIT); + if (toep == NULL) + goto reset; toep->tid = tid; toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; - if (synqe->flags & TPF_SYNQE_TCPDDP) - set_ulp_mode(toep, ULP_MODE_TCPDDP); - else if (synqe->flags & TPF_SYNQE_TLS) - set_ulp_mode(toep, ULP_MODE_TLS); - else - set_ulp_mode(toep, ULP_MODE_NONE); + toep->vnet = lctx->vnet; + set_ulp_mode(toep, synqe->ulp_mode); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = synqe->rcv_bufsize; - so = inp->inp_socket; - KASSERT(so != NULL, ("%s: socket is NULL", __func__)); + MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); + MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); + synqe->tcp_opt = cpl->tcp_opt; + synqe->toep = toep; /* Come up with something that syncache_expand should be ok with. */ synqe_to_protohdrs(sc, synqe, cpl, &inc, &th, &to); + if (inc.inc_flags & INC_ISIPV6) + toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); + so = inp->inp_socket; + KASSERT(so != NULL, ("%s: socket is NULL", __func__)); - /* - * No more need for anything in the mbuf that carried the - * CPL_PASS_ACCEPT_REQ. Drop the CPL_PASS_ESTABLISH and toep pointer - * there. XXX: bad form but I don't want to increase the size of synqe. - */ - m = synqe->syn; - KASSERT(sizeof(*cpl) + sizeof(toep) <= m->m_len, - ("%s: no room in mbuf %p (m_len %d)", __func__, m, m->m_len)); - bcopy(cpl, mtod(m, void *), sizeof(*cpl)); - *(struct toepcb **)(mtod(m, struct cpl_pass_establish *) + 1) = toep; - if (!toe_syncache_expand(&inc, &to, &th, &so) || so == NULL) { free_toepcb(toep); goto reset; @@ -1671,14 +1576,9 @@ reset: new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); MPASS(so->so_vnet == lctx->vnet); - toep->vnet = lctx->vnet; - if (inc.inc_flags & INC_ISIPV6) - toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); /* - * This is for the unlikely case where the syncache entry that we added - * has been evicted from the syncache, but the syncache_expand above - * works because of syncookies. + * This is for expansion from syncookies. * * XXX: we've held the tcbinfo lock throughout so there's no risk of * anyone accept'ing a connection before we've installed our hooks, but @@ -1692,13 +1592,11 @@ reset: INP_WUNLOCK(new_inp); /* Done with the synqe */ - TAILQ_REMOVE(&lctx->synq, synqe, link); - inp = release_lctx(sc, lctx); + inp = release_synqe(sc, synqe); if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); - release_synqe(synqe); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Dec 19 00:17:22 2018 (r342207) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Dec 19 01:37:00 2018 (r342208) @@ -1020,9 +1020,9 @@ reclaim_wr_resources(void *arg, int count) struct tom_data *td = arg; STAILQ_HEAD(, wrqe) twr_list = STAILQ_HEAD_INITIALIZER(twr_list); struct cpl_act_open_req *cpl; - u_int opcode, atid; + u_int opcode, atid, tid; struct wrqe *wr; - struct adapter *sc; + struct adapter *sc = td_adapter(td); mtx_lock(&td->unsent_wr_lock); STAILQ_SWAP(&td->unsent_wr_list, &twr_list, wrqe); @@ -1038,10 +1038,14 @@ reclaim_wr_resources(void *arg, int count) case CPL_ACT_OPEN_REQ: case CPL_ACT_OPEN_REQ6: atid = G_TID_TID(be32toh(OPCODE_TID(cpl))); - sc = td_adapter(td); - CTR2(KTR_CXGBE, "%s: atid %u ", __func__, atid); act_open_failure_cleanup(sc, atid, EHOSTUNREACH); + free(wr, M_CXGBE); + break; + case CPL_PASS_ACCEPT_RPL: + tid = GET_TID(cpl); + CTR2(KTR_CXGBE, "%s: tid %u ", __func__, tid); + synack_failure_cleanup(sc, tid); free(wr, M_CXGBE); break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Dec 19 03:08: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 D28CD13493F9; Wed, 19 Dec 2018 03:08:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76E1D95388; Wed, 19 Dec 2018 03:08:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D1484DD; Wed, 19 Dec 2018 03:08:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJ38AiF048385; Wed, 19 Dec 2018 03:08:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ38AIl048384; Wed, 19 Dec 2018 03:08:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812190308.wBJ38AIl048384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 19 Dec 2018 03:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342211 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 342211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76E1D95388 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 03:08:11 -0000 Author: avos Date: Wed Dec 19 03:08:10 2018 New Revision: 342211 URL: https://svnweb.freebsd.org/changeset/base/342211 Log: net80211: fix out-of-bounds read in ieee80211_amrr(9). ieee80211_alloc_node() does not initialize rateset tables; that's not expected by rate control modules and will result in array access at index -1 - where ni_essid[] array is located (zeroed at allocation, so there are no user-visible consequences). Just delay rate control initialization to the moment, when rateset tables are initiaziled; nothing will use rates here anyway. MFC after: 4 days Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Wed Dec 19 02:34:31 2018 (r342210) +++ head/sys/net80211/ieee80211_node.c Wed Dec 19 03:08:10 2018 (r342211) @@ -1417,8 +1417,6 @@ ieee80211_alloc_node(struct ieee80211_node_table *nt, IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, "%s: inact_reload %u", __func__, ni->ni_inact_reload); - ieee80211_ratectl_node_init(ni); - return ni; } From owner-svn-src-head@freebsd.org Wed Dec 19 04:54: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 6F5B4134B231; Wed, 19 Dec 2018 04:54:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB2897FBC; Wed, 19 Dec 2018 04:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E951197A4; Wed, 19 Dec 2018 04:54:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJ4sXRK005078; Wed, 19 Dec 2018 04:54:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ4sWJ2005072; Wed, 19 Dec 2018 04:54:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812190454.wBJ4sWJ2005072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 04:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342214 - in head/sys: conf dev/fxp modules/fxp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: conf dev/fxp modules/fxp X-SVN-Commit-Revision: 342214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DB2897FBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 04:54:34 -0000 Author: markj Date: Wed Dec 19 04:54:32 2018 New Revision: 342214 URL: https://svnweb.freebsd.org/changeset/base/342214 Log: Remove a use of a negative array index from fxp(4). This fixes a warning seen when compiling amd64 GENERIC with clang 7. Also remove the workaround added in r337324. clang 7 and gcc 4.2 generate the same code with or without the code change. Reviewed by: imp (previous version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18603 Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/if_fxpreg.h head/sys/modules/fxp/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/conf/files Wed Dec 19 04:54:32 2018 (r342214) @@ -1782,8 +1782,7 @@ dev/flash/cqspi.c optional cqspi fdt xdma dev/flash/mx25l.c optional mx25l dev/flash/n25q.c optional n25q fdt dev/flash/qspi_if.m optional cqspi fdt | n25q fdt -dev/fxp/if_fxp.c optional fxp \ - compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}" +dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/conf/kern.mk Wed Dec 19 04:54:32 2018 (r342214) @@ -25,7 +25,6 @@ NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-intern NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized NO_WCAST_QUAL= -Wno-error-cast-qual NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare -NO_WARRAY_BOUNDS= -Wno-error-array-bounds # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/dev/fxp/if_fxp.c Wed Dec 19 04:54:32 2018 (r342214) @@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) cbp->tbd_number = nseg; /* Configure TSO. */ if (m->m_pkthdr.csum_flags & CSUM_TSO) { - cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16); + cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16); cbp->tbd[1].tb_size |= htole32(tcp_payload << 16); cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE | FXP_IPCB_IP_CHECKSUM_ENABLE | Modified: head/sys/dev/fxp/if_fxpreg.h ============================================================================== --- head/sys/dev/fxp/if_fxpreg.h Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/dev/fxp/if_fxpreg.h Wed Dec 19 04:54:32 2018 (r342214) @@ -281,10 +281,15 @@ struct fxp_cb_tx { uint16_t cb_status; uint16_t cb_command; uint32_t link_addr; - uint32_t tbd_array_addr; - uint16_t byte_count; - uint8_t tx_threshold; - uint8_t tbd_number; + union { + struct { + uint32_t tbd_array_addr; + uint16_t byte_count; + uint8_t tx_threshold; + uint8_t tbd_number; + }; + struct fxp_tbd tbdtso; + }; /* * The following structure isn't actually part of the TxCB, Modified: head/sys/modules/fxp/Makefile ============================================================================== --- head/sys/modules/fxp/Makefile Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/modules/fxp/Makefile Wed Dec 19 04:54:32 2018 (r342214) @@ -6,5 +6,3 @@ KMOD= if_fxp SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h .include - -CWARNFLAGS+= ${NO_WARRAY_BOUNDS} From owner-svn-src-head@freebsd.org Wed Dec 19 07:38: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 2E5BD134E958; Wed, 19 Dec 2018 07:38:49 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C99CC6DD55; Wed, 19 Dec 2018 07:38:48 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id B97CEE5C7; Wed, 19 Dec 2018 07:38:48 +0000 (UTC) Date: Wed, 19 Dec 2018 07:38:48 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342197 - head/sys/dev/usb/net Message-ID: <20181219073848.GC93143@FreeBSD.org> References: <201812181938.wBIJcDEw014210@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201812181938.wBIJcDEw014210@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: C99CC6DD55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 07:38:49 -0000 On Tue, Dec 18, 2018 at 07:38:13PM +0000, Gleb Smirnoff wrote: > New Revision: 342197 > URL: https://svnweb.freebsd.org/changeset/base/342197 > > Log: > Use mbufq instead of ifqueue to queue mbufs. > > Modified: > head/sys/dev/usb/net/uhso.c For the less aware folks reading through the code changes, it would be nice if you'd explained the reason for this change, rather than simply translated the diff in English. ./danfe From owner-svn-src-head@freebsd.org Wed Dec 19 16:45: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 D313B133C553; Wed, 19 Dec 2018 16:45:38 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76A0C891C1; Wed, 19 Dec 2018 16:45:38 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 66211189DB; Wed, 19 Dec 2018 16:45:38 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJGjcUk057163; Wed, 19 Dec 2018 16:45:38 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJGjbmb057161; Wed, 19 Dec 2018 16:45:37 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812191645.wBJGjbmb057161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 19 Dec 2018 16:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342218 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 342218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76A0C891C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 16:45:39 -0000 Author: dab Date: Wed Dec 19 16:45:37 2018 New Revision: 342218 URL: https://svnweb.freebsd.org/changeset/base/342218 Log: asmc: Add support for MacPro1,1 PR: 203431 Submitted by: jjr@alisa.org & holindho@saunalahti.fi Reported by: jjr@alisa.org MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Wed Dec 19 16:06:08 2018 (r342217) +++ head/sys/dev/asmc/asmc.c Wed Dec 19 16:45:37 2018 (r342218) @@ -269,13 +269,22 @@ struct asmc_model asmc_models[] = { ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS }, - /* Idem for the MacPro */ + /* Idem for the Mac Pro "Quad Core" (original) */ { + "MacPro1,1", "Apple SMC Mac Pro (Quad Core)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP1_TEMPS, ASMC_MP1_TEMPNAMES, ASMC_MP1_TEMPDESCS + }, + + /* Idem for the Mac Pro (8-core) */ + { "MacPro2", "Apple SMC Mac Pro (8-core)", NULL, NULL, NULL, ASMC_FAN_FUNCS, NULL, NULL, NULL, - ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS + ASMC_MP2_TEMPS, ASMC_MP2_TEMPNAMES, ASMC_MP2_TEMPDESCS }, /* Idem for the MacPro 2010*/ Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Wed Dec 19 16:06:08 2018 (r342217) +++ head/sys/dev/asmc/asmcvar.h Wed Dec 19 16:45:37 2018 (r342218) @@ -374,7 +374,70 @@ struct asmc_softc { "Power Supply Temperature", \ "Wireless Module Proximity Temperature", } -#define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP1_TEMPS { "TA0P", \ + "TCAH", "TCBH", \ + "TC0P", "TC0C", "TC1C", \ + "TC2C", "TC3C", "THTG", \ + "TH0P", "TH1P", \ + "TH2P", "TH3P", \ + "TM0P", "TM1P", "TM2P", \ + "TM8P", "TM9P", "TMAP", \ + "TM0S", "TM1S", "TM2P", "TM3S", \ + "TM8S", "TM9S", "TMAS", "TMBS", \ + "TN0H", "TS0C", \ + "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL } + +#define ASMC_MP1_TEMPNAMES { "ambient", \ + "cpu_a_heatsink", "cpu_b_heatsink", \ + "cpu_a_proximity", "cpu_core0", "cpu_core1", \ + "cpu_core2", "cpu_core3", "THTG", \ + "hdd_bay0", "hdd_bay1", \ + "hdd_bay2", "hdd_bay3", \ + "memory_card_a_proximity0", \ + "memory_card_a_proximity1", \ + "memory_card_a_proximity2", \ + "memory_card_b_proximity0", \ + "memory_card_b_proximity1", \ + "memory_card_b_proximity2", \ + "memory_card_a_slot0", \ + "memory_card_a_slot1", \ + "memory_card_a_slot2", \ + "memory_card_a_slot3", \ + "memory_card_b_slot0", \ + "memory_card_b_slot1", \ + "memory_card_b_slot2", \ + "memory_card_b_slot3", \ + "mch_heatsink", "expansion_slots", \ + "power_supply_loc0", "power_supply_loc1", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP1_TEMPDESCS { "Ambient Air", \ + "CPU A Heatsink", "CPU B Heatsink", \ + "CPU A Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "CPU Core 3", "CPU Core 4", "THTG", \ + "Hard Drive Bay 1", "Hard Drive Bay 2", \ + "Hard Drive Bay 3", "Hard Drive Bay 4", \ + "Memory Riser A, Proximity 1", \ + "Memory Riser A, Proximity 2", \ + "Memory Riser A, Proximity 3", \ + "Memory Riser B, Proximity 1", \ + "Memory Riser B, Proximity 2", \ + "Memory Riser B, Proximity 3", \ + "Memory Riser A, Slot 1", \ + "Memory Riser A, Slot 2", \ + "Memory Riser A, Slot 3", \ + "Memory Riser A, Slot 4", \ + "Memory Riser B, Slot 1", \ + "Memory Riser B, Slot 2", \ + "Memory Riser B, Slot 3", \ + "Memory Riser B, Slot 4", \ + "MCH Heatsink", "Expansion Slots", \ + "Power Supply, Location 1", \ + "Power Supply, Location 2", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP2_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -383,7 +446,7 @@ struct asmc_softc { "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ NULL } -#define ASMC_MP_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -391,7 +454,7 @@ struct asmc_softc { "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } -#define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ From owner-svn-src-head@freebsd.org Wed Dec 19 17:45: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 DB5B7133DFC3; Wed, 19 Dec 2018 17:45:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E28C8B776; Wed, 19 Dec 2018 17:45:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E7531944D; Wed, 19 Dec 2018 17:45:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJHjGnO088985; Wed, 19 Dec 2018 17:45:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHjGXa088984; Wed, 19 Dec 2018 17:45:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191745.wBJHjGXa088984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342221 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E28C8B776 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 17:45:17 -0000 Author: markj Date: Wed Dec 19 17:45:16 2018 New Revision: 342221 URL: https://svnweb.freebsd.org/changeset/base/342221 Log: Implement cpu_halt() for RISC-V. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18595 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Wed Dec 19 17:42:39 2018 (r342220) +++ head/sys/riscv/riscv/machdep.c Wed Dec 19 17:45:16 2018 (r342221) @@ -426,7 +426,9 @@ void cpu_halt(void) { - panic("cpu_halt"); + intr_disable(); + for (;;) + __asm __volatile("wfi"); } /* From owner-svn-src-head@freebsd.org Wed Dec 19 17:52: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 EC645133E360; Wed, 19 Dec 2018 17:52:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1CB8BD56; Wed, 19 Dec 2018 17:52:10 +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 820D7195E2; Wed, 19 Dec 2018 17:52:10 +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 wBJHqAKa091611; Wed, 19 Dec 2018 17:52:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHq9nv091607; Wed, 19 Dec 2018 17:52:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191752.wBJHq9nv091607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342223 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 342223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F1CB8BD56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 17:52:11 -0000 Author: markj Date: Wed Dec 19 17:52:09 2018 New Revision: 342223 URL: https://svnweb.freebsd.org/changeset/base/342223 Log: Replace uses of sbadaddr with stval. The sbadaddr register was renamed in version 1.10 of the privileged architecture specification. No functional change intended. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18594 Modified: head/sys/riscv/include/frame.h head/sys/riscv/riscv/db_interface.c head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/frame.h ============================================================================== --- head/sys/riscv/include/frame.h Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/include/frame.h Wed Dec 19 17:52:09 2018 (r342223) @@ -55,7 +55,7 @@ struct trapframe { uint64_t tf_a[8]; uint64_t tf_sepc; uint64_t tf_sstatus; - uint64_t tf_sbadaddr; + uint64_t tf_stval; uint64_t tf_scause; }; Modified: head/sys/riscv/riscv/db_interface.c ============================================================================== --- head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:52:09 2018 (r342223) @@ -98,7 +98,7 @@ struct db_variable db_regs[] = { { "a7", DB_OFFSET(tf_a[7]), db_frame }, { "sepc", DB_OFFSET(tf_sepc), db_frame }, { "sstatus", DB_OFFSET(tf_sstatus), db_frame }, - { "sbadaddr", DB_OFFSET(tf_sbadaddr), db_frame }, + { "stval", DB_OFFSET(tf_stval), db_frame }, { "scause", DB_OFFSET(tf_scause), db_frame }, }; Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/exception.S Wed Dec 19 17:52:09 2018 (r342223) @@ -107,8 +107,8 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) - csrr t0, sbadaddr - sd t0, (TF_SBADADDR)(sp) + csrr t0, stval + sd t0, (TF_STVAL)(sp) csrr t0, scause sd t0, (TF_SCAUSE)(sp) .endm Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/genassym.c Wed Dec 19 17:52:09 2018 (r342223) @@ -96,6 +96,6 @@ ASSYM(TF_T, offsetof(struct trapframe, tf_t)); ASSYM(TF_S, offsetof(struct trapframe, tf_s)); ASSYM(TF_A, offsetof(struct trapframe, tf_a)); ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc)); -ASSYM(TF_SBADADDR, offsetof(struct trapframe, tf_sbadaddr)); +ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/trap.c Wed Dec 19 17:52:09 2018 (r342223) @@ -170,7 +170,7 @@ static void data_abort(struct trapframe *frame, int usermode) { struct vm_map *map; - uint64_t sbadaddr; + uint64_t stval; struct thread *td; struct pcb *pcb; vm_prot_t ftype; @@ -188,7 +188,7 @@ data_abort(struct trapframe *frame, int usermode) td = curthread; p = td->td_proc; pcb = td->td_pcb; - sbadaddr = frame->tf_sbadaddr; + stval = frame->tf_stval; if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, @@ -197,7 +197,7 @@ data_abort(struct trapframe *frame, int usermode) if (usermode) map = &td->td_proc->p_vmspace->vm_map; - else if (sbadaddr >= VM_MAX_USER_ADDRESS) + else if (stval >= VM_MAX_USER_ADDRESS) map = kernel_map; else { if (pcb->pcb_onfault == 0) @@ -205,7 +205,7 @@ data_abort(struct trapframe *frame, int usermode) map = &td->td_proc->p_vmspace->vm_map; } - va = trunc_page(sbadaddr); + va = trunc_page(stval); if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { @@ -249,7 +249,7 @@ data_abort(struct trapframe *frame, int usermode) ucode = SEGV_ACCERR; else ucode = SEGV_MAPERR; - call_trapsignal(td, sig, ucode, (void *)sbadaddr); + call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -267,7 +267,7 @@ done: fatal: dump_regs(frame); - panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, sbadaddr); + panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval); } void @@ -324,8 +324,8 @@ do_trap_supervisor(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown kernel exception %x badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown kernel exception %x trap value %lx\n", + exception, frame->tf_stval); } } @@ -392,7 +392,7 @@ do_trap_user(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown userland exception %x, badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown userland exception %x, trap value %lx\n", + exception, frame->tf_stval); } } From owner-svn-src-head@freebsd.org Wed Dec 19 18:16: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 D70D0133F366; Wed, 19 Dec 2018 18:16:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77CF68D1B4; Wed, 19 Dec 2018 18:16:30 +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 63D2C19987; Wed, 19 Dec 2018 18:16:30 +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 wBJIGUtH005156; Wed, 19 Dec 2018 18:16:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJIGUU0005155; Wed, 19 Dec 2018 18:16:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812191816.wBJIGUU0005155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Dec 2018 18:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342227 - head/libexec/bootpd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/libexec/bootpd X-SVN-Commit-Revision: 342227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77CF68D1B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 18:16:31 -0000 Author: emaste Date: Wed Dec 19 18:16:29 2018 New Revision: 342227 URL: https://svnweb.freebsd.org/changeset/base/342227 Log: bootpd: validate hardware type Due to insufficient validation of network-provided data it may have been possible for a malicious actor to craft a bootp packet which could cause a stack buffer overflow. admbugs: 850 Reported by: Reno Robert Reviewed by: markj Approved by: so Security: FreeBSD-SA-18:15.bootpd Sponsored by: The FreeBSD Foundation Modified: head/libexec/bootpd/bootpd.c Modified: head/libexec/bootpd/bootpd.c ============================================================================== --- head/libexec/bootpd/bootpd.c Wed Dec 19 18:05:50 2018 (r342226) +++ head/libexec/bootpd/bootpd.c Wed Dec 19 18:16:29 2018 (r342227) @@ -636,6 +636,10 @@ handle_request() char *homedir, *bootfile; int n; + if (bp->bp_htype >= hwinfocnt) { + report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype); + return; + } bp->bp_file[sizeof(bp->bp_file)-1] = '\0'; /* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */ From owner-svn-src-head@freebsd.org Wed Dec 19 19:21: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 87CA913415C5; Wed, 19 Dec 2018 19:21:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8DB682A4; Wed, 19 Dec 2018 19:21:31 +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 4CB9B1A401; Wed, 19 Dec 2018 19:21:30 +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 wBJJLU5N039001; Wed, 19 Dec 2018 19:21:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJJLUZO039000; Wed, 19 Dec 2018 19:21:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812191921.wBJJLUZO039000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Dec 2018 19:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342234 - 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: 342234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B8DB682A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 19:21:31 -0000 Author: np Date: Wed Dec 19 19:21:29 2018 New Revision: 342234 URL: https://svnweb.freebsd.org/changeset/base/342234 Log: cxgbe(4): Do not issue mbox commands after t4_fw_bye. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_clip.c Modified: head/sys/dev/cxgbe/t4_clip.c ============================================================================== --- head/sys/dev/cxgbe/t4_clip.c Wed Dec 19 18:32:32 2018 (r342233) +++ head/sys/dev/cxgbe/t4_clip.c Wed Dec 19 19:21:29 2018 (r342234) @@ -325,7 +325,9 @@ t4_destroy_clip_table(struct adapter *sc) ("%s: CLIP entry %p still in use (%d)", __func__, ce, ce->refcount)); TAILQ_REMOVE(&sc->clip_table, ce, link); +#if 0 delete_lip(sc, &ce->lip); +#endif free(ce, M_CXGBE); } mtx_unlock(&sc->clip_table_lock); From owner-svn-src-head@freebsd.org Wed Dec 19 20:25: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 7C1F513430C9; Wed, 19 Dec 2018 20:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 170396BDB7; Wed, 19 Dec 2018 20:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0621C1AF94; Wed, 19 Dec 2018 20:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJKPwSB074279; Wed, 19 Dec 2018 20:25:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJKPwut074278; Wed, 19 Dec 2018 20:25:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192025.wBJKPwut074278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 20:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342235 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 342235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 170396BDB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 20:25:59 -0000 Author: mjg Date: Wed Dec 19 20:25:58 2018 New Revision: 342235 URL: https://svnweb.freebsd.org/changeset/base/342235 Log: Update priv(9) after r341827 Reported by: trasz Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/priv.9 Modified: head/share/man/man9/priv.9 ============================================================================== --- head/share/man/man9/priv.9 Wed Dec 19 19:21:29 2018 (r342234) +++ head/share/man/man9/priv.9 Wed Dec 19 20:25:58 2018 (r342235) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2006 +.Dd December 19, 2018 .Dt PRIV 9 .Os .Sh NAME @@ -39,7 +39,7 @@ .Ft int .Fn priv_check "struct thread *td" "int priv" .Ft int -.Fn priv_check_cred "struct ucred *cred" "int priv" "int flags" +.Fn priv_check_cred "struct ucred *cred" "int priv" .Sh DESCRIPTION The .Nm @@ -57,9 +57,6 @@ policy or access control list. The caller identifies the desired privilege via the .Fa priv argument. -The optional flags argument, -.Fa flags , -is currently unused. .Ss Privilege Policies Privileges are typically granted based on one of two base system policies: the superuser policy, which grants privilege based on the effective (or From owner-svn-src-head@freebsd.org Wed Dec 19 20:27: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 14E2A1343161; Wed, 19 Dec 2018 20:27:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A29DA6BF2C; Wed, 19 Dec 2018 20:27:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7BC881AF95; Wed, 19 Dec 2018 20:27:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJKRRpr074404; Wed, 19 Dec 2018 20:27:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJKRQZY074401; Wed, 19 Dec 2018 20:27:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192027.wBJKRQZY074401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 20:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342236 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 342236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A29DA6BF2C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 20:27:28 -0000 Author: mjg Date: Wed Dec 19 20:27:26 2018 New Revision: 342236 URL: https://svnweb.freebsd.org/changeset/base/342236 Log: Deinline vfork handling out of the syscall return path. vfork is rarely called (comparatively to other syscalls) and it avoidably pollutes the fast path. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 19 20:25:58 2018 (r342235) +++ head/sys/kern/kern_fork.c Wed Dec 19 20:27:26 2018 (r342236) @@ -757,6 +757,51 @@ do_fork(struct thread *td, struct fork_req *fr, struct } } +void +fork_rfppwait(struct thread *td) +{ + struct proc *p, *p2; + + MPASS(td->td_pflags & TDP_RFPPWAIT); + + p = td->td_proc; + /* + * Preserve synchronization semantics of vfork. If + * waiting for child to exec or exit, fork set + * P_PPWAIT on child, and there we sleep on our proc + * (in case of exit). + * + * Do it after the ptracestop() above is finished, to + * not block our debugger until child execs or exits + * to finish vfork wait. + */ + td->td_pflags &= ~TDP_RFPPWAIT; + p2 = td->td_rfppwait_p; +again: + PROC_LOCK(p2); + while (p2->p_flag & P_PPWAIT) { + PROC_LOCK(p); + if (thread_suspend_check_needed()) { + PROC_UNLOCK(p2); + thread_suspend_check(0); + PROC_UNLOCK(p); + goto again; + } else { + PROC_UNLOCK(p); + } + cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); + } + PROC_UNLOCK(p2); + + if (td->td_dbgflags & TDB_VFORK) { + PROC_LOCK(p); + if (p->p_ptevents & PTRACE_VFORK) + ptracestop(td, SIGTRAP, NULL); + td->td_dbgflags &= ~TDB_VFORK; + PROC_UNLOCK(p); + } +} + int fork1(struct thread *td, struct fork_req *fr) { Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Wed Dec 19 20:25:58 2018 (r342235) +++ head/sys/kern/subr_syscall.c Wed Dec 19 20:27:26 2018 (r342236) @@ -165,7 +165,7 @@ syscallenter(struct thread *td) static inline void syscallret(struct thread *td, int error) { - struct proc *p, *p2; + struct proc *p; struct syscall_args *sa; ksiginfo_t ksi; int traced, error1; @@ -230,41 +230,6 @@ syscallret(struct thread *td, int error) PROC_UNLOCK(p); } - if (__predict_false(td->td_pflags & TDP_RFPPWAIT)) { - /* - * Preserve synchronization semantics of vfork. If - * waiting for child to exec or exit, fork set - * P_PPWAIT on child, and there we sleep on our proc - * (in case of exit). - * - * Do it after the ptracestop() above is finished, to - * not block our debugger until child execs or exits - * to finish vfork wait. - */ - td->td_pflags &= ~TDP_RFPPWAIT; - p2 = td->td_rfppwait_p; -again: - PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) { - PROC_LOCK(p); - if (thread_suspend_check_needed()) { - PROC_UNLOCK(p2); - thread_suspend_check(0); - PROC_UNLOCK(p); - goto again; - } else { - PROC_UNLOCK(p); - } - cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); - } - PROC_UNLOCK(p2); - - if (td->td_dbgflags & TDB_VFORK) { - PROC_LOCK(p); - if (p->p_ptevents & PTRACE_VFORK) - ptracestop(td, SIGTRAP, NULL); - td->td_dbgflags &= ~TDB_VFORK; - PROC_UNLOCK(p); - } - } + if (__predict_false(td->td_pflags & TDP_RFPPWAIT)) + fork_rfppwait(td); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Dec 19 20:25:58 2018 (r342235) +++ head/sys/sys/proc.h Wed Dec 19 20:27:26 2018 (r342236) @@ -1026,6 +1026,7 @@ int enterthispgrp(struct proc *p, struct pgrp *pgrp); void faultin(struct proc *p); void fixjobc(struct proc *p, struct pgrp *pgrp, int entering); int fork1(struct thread *, struct fork_req *); +void fork_rfppwait(struct thread *); void fork_exit(void (*)(void *, struct trapframe *), void *, struct trapframe *); void fork_return(struct thread *, struct trapframe *); From owner-svn-src-head@freebsd.org Wed Dec 19 20:29: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 6917B1343285; Wed, 19 Dec 2018 20:29:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA76D6C119; Wed, 19 Dec 2018 20:29:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DAFB31AF97; Wed, 19 Dec 2018 20:29:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJKTqah074564; Wed, 19 Dec 2018 20:29:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJKTqNE074563; Wed, 19 Dec 2018 20:29:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192029.wBJKTqNE074563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 20:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342237 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA76D6C119 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 20:29:53 -0000 Author: mjg Date: Wed Dec 19 20:29:52 2018 New Revision: 342237 URL: https://svnweb.freebsd.org/changeset/base/342237 Log: Microoptimize corner case of ID bitmap handling. Prior to the change we would avoidably test more possibly used IDs. While here update the comment: there is no pidchecked variable anymore. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 19 20:27:26 2018 (r342236) +++ head/sys/kern/kern_fork.c Wed Dec 19 20:29:52 2018 (r342237) @@ -238,19 +238,18 @@ extern bitstr_t proc_id_grpidmap; extern bitstr_t proc_id_sessidmap; extern bitstr_t proc_id_reapmap; +/* + * Find an unused process ID + * + * If RFHIGHPID is set (used during system boot), do not allocate + * low-numbered pids. + */ static int fork_findpid(int flags) { pid_t result; int trypid; - /* - * Find an unused process ID. We remember a range of unused IDs - * ready to use (from lastpid+1 through pidchecked-1). - * - * If RFHIGHPID is set (used during system boot), do not allocate - * low-numbered pids. - */ trypid = lastpid + 1; if (flags & RFHIGHPID) { if (trypid < 10) @@ -280,7 +279,7 @@ retry: if (bit_test(&proc_id_grpidmap, result) || bit_test(&proc_id_sessidmap, result) || bit_test(&proc_id_reapmap, result)) { - trypid++; + trypid = result + 1; goto retry; } From owner-svn-src-head@freebsd.org Wed Dec 19 21:56: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 A9DD6134A498; Wed, 19 Dec 2018 21:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E9847187C; Wed, 19 Dec 2018 21:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0E6C91BED4; Wed, 19 Dec 2018 21:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJLuuL8022893; Wed, 19 Dec 2018 21:56:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJLutvg022884; Wed, 19 Dec 2018 21:56:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192156.wBJLutvg022884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 21:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342242 - in head: . etc/mtree libexec/rc libexec/rc/rc.d share/examples share/examples/ibcs2 share/man/man4 share/man/man5 usr.sbin/bsdconfig/startup usr.sbin/bsdconfig/startup/include X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: . etc/mtree libexec/rc libexec/rc/rc.d share/examples share/examples/ibcs2 share/man/man4 share/man/man5 usr.sbin/bsdconfig/startup usr.sbin/bsdconfig/startup/include X-SVN-Commit-Revision: 342242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E9847187C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 21:56:57 -0000 Author: mjg Date: Wed Dec 19 21:56:54 2018 New Revision: 342242 URL: https://svnweb.freebsd.org/changeset/base/342242 Log: Remove iBCS2, part1: userspace iBCS2 was disconnected from the build in 2015 (see r291419) bsdconfig parts submitted by dteske. Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Deleted: head/share/examples/ibcs2/ Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/libexec/rc/rc.conf head/libexec/rc/rc.d/archdep head/share/examples/Makefile head/share/man/man4/kld.4 head/share/man/man5/rc.conf.5 head/usr.sbin/bsdconfig/startup/include/messages.subr head/usr.sbin/bsdconfig/startup/misc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Dec 19 21:28:11 2018 (r342241) +++ head/ObsoleteFiles.inc Wed Dec 19 21:56:54 2018 (r342242) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20181219: ibcs removal +OLD_FILES+=usr/share/examples/ibcs2/hello.uu +OLD_FILES+=usr/share/examples/ibcs2/README +OLD_DIRS+=usr/share/examples/ibcs2 # 20181215: Migration of CTM to ports OLD_FILES+=usr/sbin/ctm OLD_FILES+=usr/sbin/ctm_dequeue Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Dec 19 21:28:11 2018 (r342241) +++ head/etc/mtree/BSD.usr.dist Wed Dec 19 21:56:54 2018 (r342242) @@ -251,8 +251,6 @@ .. hostapd .. - ibcs2 - .. indent .. ipfilter Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Wed Dec 19 21:28:11 2018 (r342241) +++ head/libexec/rc/rc.conf Wed Dec 19 21:56:54 2018 (r342242) @@ -626,8 +626,6 @@ quotaon_flags="-a" # Turn quotas on for all file syste quotaoff_flags="-a" # Turn quotas off for all file systems at shutdown quotacheck_flags="-a" # Check all file system quotas (if enabled) accounting_enable="NO" # Turn on process accounting (or NO). -ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO). -ibcs2_loaders="coff" # List of additional Ibcs2 loaders (or NO). firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if # this file exists. Should be on a R/W filesystem so # the file can be deleted after the boot completes. Modified: head/libexec/rc/rc.d/archdep ============================================================================== --- head/libexec/rc/rc.d/archdep Wed Dec 19 21:28:11 2018 (r342241) +++ head/libexec/rc/rc.d/archdep Wed Dec 19 21:56:54 2018 (r342242) @@ -19,25 +19,6 @@ archdep_start() _arch=`${SYSCTL_N} hw.machine_arch` case $_arch in - i386) - # SCO binary emulation - # - if checkyesno ibcs2_enable; then - echo -n 'Initial i386 initialization:' - echo -n ' ibcs2' - load_kld ibcs2 - case ${ibcs2_loaders} in - [Nn][Oo]) - ;; - *) - for i in ${ibcs2_loaders}; do - load_kld ibcs2_$i - done - ;; - esac - echo '.' - fi - ;; esac } Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Wed Dec 19 21:28:11 2018 (r342241) +++ head/share/examples/Makefile Wed Dec 19 21:56:54 2018 (r342242) @@ -16,7 +16,6 @@ LDIRS= BSD_daemon \ drivers \ etc \ find_interface \ - ibcs2 \ indent \ ipfw \ jails \ @@ -98,11 +97,6 @@ SE_FIND_INTERFACE= \ Makefile \ README \ find_interface.c - -SE_DIRS+= ibcs2 -SE_IBCS2= \ - README \ - hello.uu SE_DIRS+= indent SE_INDENT= indent.pro Modified: head/share/man/man4/kld.4 ============================================================================== --- head/share/man/man4/kld.4 Wed Dec 19 21:28:11 2018 (r342241) +++ head/share/man/man4/kld.4 Wed Dec 19 21:56:54 2018 (r342242) @@ -57,10 +57,8 @@ system makes extensive use of loadable kernel modules, versions of most file systems, the .Tn NFS client and server, all the screen-savers, and the -.Tn iBCS2 -and .Tn Linux -emulators. +emulator. .Nm modules are placed by default in the .Pa /boot/kernel Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Dec 19 21:28:11 2018 (r342241) +++ head/share/man/man5/rc.conf.5 Wed Dec 19 21:56:54 2018 (r342242) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2018 +.Dd December 19, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -3540,21 +3540,6 @@ Set to to enable system accounting through the .Xr accton 8 facility. -.It Va ibcs2_enable -.Pq Vt bool -Set to -.Dq Li YES -to enable iBCS2 (SCO) binary emulation at system initial boot -time. -.It Va ibcs2_loaders -.Pq Vt str -If not set to -.Dq Li NO -and if -.Va ibcs2_enable -is set to -.Dq Li YES , -this specifies a list of additional iBCS2 loaders to enable. .It Va firstboot_sentinel .Pq Vt str This variable specifies the full path to a Modified: head/usr.sbin/bsdconfig/startup/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/include/messages.subr Wed Dec 19 21:28:11 2018 (r342241) +++ head/usr.sbin/bsdconfig/startup/include/messages.subr Wed Dec 19 21:56:54 2018 (r342242) @@ -90,8 +90,6 @@ msg_rcvar_contains_invalid_chars="ERROR! rc.conf(5) va msg_rcvar_must_start_with="ERROR! rc.conf(5) variable name must start with\n a letter [a-zA-Z] or underscore [_]." msg_reset="Reset" msg_reset_desc="Reset to default view settings" -msg_sco="SCO" -msg_sco_desc="This host wants to be able to run IBCS2 binaries." msg_show_configured="Show Configured" msg_show_configured_desc="Calculate rc.conf(5) locations (slowest)" msg_show_default_value="Show Default/Value" Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Wed Dec 19 21:28:11 2018 (r342241) +++ head/usr.sbin/bsdconfig/startup/misc Wed Dec 19 21:56:54 2018 (r342242) @@ -73,7 +73,6 @@ dialog_menu_main() if [ "$UNAME_P" = "i386" ]; then var_list="$var_list apm_enable - ibcs2_enable " # END-QUOTE fi @@ -94,7 +93,6 @@ dialog_menu_main() export msg_nis_server msg_nis_server_desc export msg_accounting msg_accounting_desc export msg_lpd msg_lpd_desc - export msg_sco msg_sco_desc :| awk \ -v uname_p="$UNAME_P" \ -v menu_tags="$DIALOG_MENU_TAGS" \ @@ -223,21 +221,6 @@ dialog_menu_main() mprint(tag, ENVIRON["msg_lpd_desc"]) if (ditem == char) defaultitem = tag - if ( uname_p == "i386" ) - { - # - # SCO: This host wants to be able to run IBCS2 - # binaries. - # - char = substr(menu_tags, i++, 1) - mark = ( ENVIRON["ibcs2_enable"] ~ \ - /^[Yy][Ee][Ss]$/ ? "X" : " " ) - subtag = ENVIRON["msg_sco"] - tag = sprintf(mtag_fmt, char, mark, subtag) - mprint(tag, ENVIRON["msg_sco_desc"]) - if (ditem == char) defaultitem = tag - } - printf "\"\n" if ( defaultitem ) @@ -343,9 +326,6 @@ while :; do ?" ["?"] $msg_lpd") f_eval_catch -dk err "$0" f_sysrc_set \ 'f_sysrc_set lpd_enable "%s"' "$reverse" ;; - ?" ["?"] $msg_sco") - f_eval_catch -dk err "$0" f_sysrc_set \ - 'f_sysrc_set ibcs2_enable "%s"' "$reverse" ;; # Multi-variable On/Off toggle bits ?" ["?"] $msg_nis_client") if f_eval_catch -dk err "$0" f_sysrc_set \ From owner-svn-src-head@freebsd.org Wed Dec 19 21:58: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 8CC1F134A52F; Wed, 19 Dec 2018 21:58:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C73971A06; Wed, 19 Dec 2018 21:58:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0C7D91BED7; Wed, 19 Dec 2018 21:58:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJLw6Lc023030; Wed, 19 Dec 2018 21:58:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJLvw9Y022990; Wed, 19 Dec 2018 21:57:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192157.wBJLvw9Y022990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 21:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342243 - in head/sys: amd64/amd64 amd64/conf amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 conf i386 i386/conf i386/i386 i386/linux kern mips/mips po... X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/conf amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 conf i386 i386/conf i386/i386 i386/linux kern mips/mips powerpc/powerpc riscv/riscv... X-SVN-Commit-Revision: 342243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C73971A06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 21:58:06 -0000 Author: mjg Date: Wed Dec 19 21:57:58 2018 New Revision: 342243 URL: https://svnweb.freebsd.org/changeset/base/342243 Log: Remove iBCS2, part2: general kernel Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/conf/NOTES head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/syscall.c head/sys/arm/arm/vm_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/arm64/trap.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/ia32/ia32_sysvec.c head/sys/conf/files.i386 head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/i386/Makefile head/sys/i386/conf/NOTES head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/trap.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_aout.c head/sys/kern/init_main.c head/sys/kern/makesyscalls.sh head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/trap.c head/sys/riscv/riscv/elf_machdep.c head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sparc64/sparc64/trap.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/amd64/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/amd64/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -991,8 +991,6 @@ cpu_fetch_syscall_args_fallback(struct thread *td, str reg++; regcnt--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; @@ -1039,9 +1037,6 @@ cpu_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; KASSERT(sa->narg <= nitems(sa->args), ("Too many syscall arguments!")); - - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (__predict_false(sa->narg > NARGREGS)) return (cpu_fetch_syscall_args_fallback(td, sa)); Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/conf/NOTES Wed Dec 19 21:57:58 2018 (r342243) @@ -612,9 +612,6 @@ options EFIRT # Enable 32-bit runtime support for FreeBSD/i386 binaries. options COMPAT_FREEBSD32 -# Enable iBCS2 runtime support for SCO and ISC binaries -#XXX#options IBCS2 - # Emulate spx device for client side of SVR3 local X interface #XXX#options SPX_HACK Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/ia32/ia32_syscall.c Wed Dec 19 21:57:58 2018 (r342243) @@ -177,8 +177,6 @@ ia32_fetch_syscall_args(struct thread *td) sa->code = tmp; params += sizeof(quad_t); } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/linux/linux_sysvec.c Wed Dec 19 21:57:58 2018 (r342243) @@ -711,7 +711,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/amd64/linux32/linux32_sysvec.c Wed Dec 19 21:57:58 2018 (r342243) @@ -909,7 +909,6 @@ linux32_fixlimit(struct rlimit *rl, int which) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX32_SYS_MAXSYSCALL, .sv_table = linux32_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm/arm/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -59,7 +59,6 @@ u_long elf_hwcap2; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/arm/arm/syscall.c ============================================================================== --- head/sys/arm/arm/syscall.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm/arm/syscall.c Wed Dec 19 21:57:58 2018 (r342243) @@ -118,8 +118,6 @@ cpu_fetch_syscall_args(struct thread *td) ap += 2; } p = td->td_proc; - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm/arm/vm_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -190,8 +190,6 @@ cpu_set_syscall_retval(struct thread *td, int error) if (call == SYS___syscall) { register_t *ap = &frame->tf_r0; register_t code = ap[_QUAD_LOWWORD]; - if (td->td_proc->p_sysent->sv_mask) - code &= td->td_proc->p_sysent->sv_mask; fixup = (code != SYS_lseek); } #endif Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm64/arm64/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm64/arm64/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -115,8 +115,6 @@ cpu_fetch_syscall_args(struct thread *td) nap--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/arm64/linux/linux_sysvec.c Wed Dec 19 21:57:58 2018 (r342243) @@ -124,8 +124,6 @@ linux_fetch_syscall_args(struct thread *td) sa->code = td->td_frame->tf_x[8]; /* LINUXTODO: generic syscall? */ - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else @@ -364,7 +362,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/compat/ia32/ia32_sysvec.c Wed Dec 19 21:57:58 2018 (r342243) @@ -98,7 +98,6 @@ SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_ struct sysentvec ia32_freebsd_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/conf/files.i386 Wed Dec 19 21:57:58 2018 (r342243) @@ -508,25 +508,6 @@ i386/i386/trap.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard -i386/ibcs2/ibcs2_errno.c optional ibcs2 -i386/ibcs2/ibcs2_fcntl.c optional ibcs2 -i386/ibcs2/ibcs2_ioctl.c optional ibcs2 -i386/ibcs2/ibcs2_ipc.c optional ibcs2 -i386/ibcs2/ibcs2_isc.c optional ibcs2 -i386/ibcs2/ibcs2_isc_sysent.c optional ibcs2 -i386/ibcs2/ibcs2_misc.c optional ibcs2 -i386/ibcs2/ibcs2_msg.c optional ibcs2 -i386/ibcs2/ibcs2_other.c optional ibcs2 -i386/ibcs2/ibcs2_signal.c optional ibcs2 -i386/ibcs2/ibcs2_socksys.c optional ibcs2 -i386/ibcs2/ibcs2_stat.c optional ibcs2 -i386/ibcs2/ibcs2_sysent.c optional ibcs2 -i386/ibcs2/ibcs2_sysi86.c optional ibcs2 -i386/ibcs2/ibcs2_sysvec.c optional ibcs2 -i386/ibcs2/ibcs2_util.c optional ibcs2 -i386/ibcs2/ibcs2_xenix.c optional ibcs2 -i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 -i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_copyout.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/conf/options.amd64 Wed Dec 19 21:57:58 2018 (r342243) @@ -16,7 +16,6 @@ PV_STATS opt_pmap.h # (see src/sys/conf/options), except for broken debugging options. COMPAT_AOUT opt_dontuse.h COMPAT_FREEBSD32 opt_global.h -#IBCS2 opt_dontuse.h #COMPAT_LINUX opt_dontuse.h COMPAT_LINUX32 opt_compat.h LINPROCFS opt_dontuse.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/conf/options.i386 Wed Dec 19 21:57:58 2018 (r342243) @@ -22,7 +22,6 @@ PV_STATS opt_pmap.h # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. COMPAT_AOUT opt_dontuse.h -IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h Modified: head/sys/i386/Makefile ============================================================================== --- head/sys/i386/Makefile Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/i386/Makefile Wed Dec 19 21:57:58 2018 (r342243) @@ -14,7 +14,7 @@ all: @echo "make links or tags only" # Directories in which to place i386 tags links -DI386= apm i386 ibcs2 include isa linux +DI386= apm i386 include isa linux links:: -for i in ${COMMDIR1}; do \ @@ -25,9 +25,9 @@ links:: (cd $$i && { rm -f tags; ln -s ../tags tags; }) done SI386= ${SYS}/i386/acpica/*.[ch] ${SYS}/i386/bios/*.[ch] \ - ${SYS}/i386/i386/*.[ch] ${SYS}/i386/ibcs2/*.[ch] \ - ${SYS}/i386/include/*.[ch] ${SYS}/i386/isa/*.[ch] \ - ${SYS}/i386/linux/*.[ch] ${SYS}/i386/pci/*.[ch] + ${SYS}/i386/i386/*.[ch] ${SYS}/i386/include/*.[ch] \ + ${SYS}/i386/isa/*.[ch] ${SYS}/i386/linux/*.[ch] \ + ${SYS}/i386/pci/*.[ch] AI386= ${SYS}/i386/i386/*.s tags:: Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/i386/conf/NOTES Wed Dec 19 21:57:58 2018 (r342243) @@ -885,9 +885,6 @@ options NKPT=31 ##################################################################### # ABI Emulation -# Enable iBCS2 runtime support for SCO and ISC binaries -#options IBCS2 - # Emulate spx device for client side of SVR3 local X interface options SPX_HACK Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/i386/i386/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/i386/i386/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -1095,8 +1095,6 @@ cpu_fetch_syscall_args(struct thread *td) params += sizeof(quad_t); } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/i386/linux/linux_sysvec.c Wed Dec 19 21:57:58 2018 (r342243) @@ -850,7 +850,6 @@ linux_get_machine(const char **dst) struct sysentvec linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, @@ -887,7 +886,6 @@ INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/kern/imgact_aout.c Wed Dec 19 21:57:58 2018 (r342243) @@ -76,7 +76,6 @@ static int aout_fixup(register_t **stack_base, struct struct sysentvec aout_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -119,7 +118,6 @@ extern u_long ia32_maxssiz; struct sysentvec aout_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/kern/init_main.c Wed Dec 19 21:57:58 2018 (r342243) @@ -401,7 +401,6 @@ null_set_syscall_retval(struct thread *td __unused, in struct sysentvec null_sysvec = { .sv_size = 0, .sv_table = NULL, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/kern/makesyscalls.sh Wed Dec 19 21:57:58 2018 (r342243) @@ -526,8 +526,8 @@ sed -e ' if (!flag("NOPROTO") && !flag("NODEF")) { if (funcname == "nosys" || funcname == "lkmnosys" || funcname == "sysarch" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^ibcs2/ || - funcname ~ /^xenix/ || funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^xenix/ || + funcname ~ /^cloudabi/) { printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl } else { @@ -546,8 +546,8 @@ sed -e ' } else { if (funcname == "nosys" || funcname == "sysarch" || funcname == "lkmnosys" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^ibcs2/ || - funcname ~ /^xenix/ || funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^xenix/ || + funcname ~ /^cloudabi/) { printf("%s, %s, NULL, 0, 0, %s, %s },", funcname, auditev, flags, thr_flag) > sysent column = column + length(funcname) + length(auditev) + length(flags) + 3 } else { Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/mips/mips/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -111,7 +110,6 @@ elf64_dump_thread(struct thread *td __unused, void *ds struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/mips/mips/freebsd32_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -77,7 +77,6 @@ extern const char *freebsd32_syscallnames[]; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/mips/mips/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -442,8 +442,6 @@ cpu_fetch_syscall_args(struct thread *td) * XXX * Shouldn't this go before switching on the code? */ - if (se->sv_mask) - sa->code &= se->sv_mask; if (sa->code >= se->sv_size) sa->callp = &se->sv_table[0]; Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/powerpc/powerpc/elf32_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -83,7 +83,6 @@ struct sysentvec elf32_freebsd_sysvec = { #else .sv_table = sysent, #endif - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/powerpc/powerpc/elf64_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -58,7 +58,6 @@ static void exec_setregs_funcdesc(struct thread *td, s struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -97,7 +96,6 @@ INIT_SYSENTVEC(elf64_sysvec_v1, &elf64_freebsd_sysvec_ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -867,8 +867,6 @@ cpu_set_syscall_retval(struct thread *td, int error) if (tf->fixreg[0] == SYS___syscall && (SV_PROC_FLAG(p, SV_ILP32))) { int code = tf->fixreg[FIRSTARG + 1]; - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; fixup = ( #if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) code != SYS_freebsd6_lseek && Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/powerpc/powerpc/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -622,8 +622,6 @@ cpu_fetch_syscall_args(struct thread *td) } } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/riscv/riscv/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/riscv/riscv/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -111,8 +111,6 @@ cpu_fetch_syscall_args(struct thread *td) nap--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/sparc64/sparc64/elf_machdep.c Wed Dec 19 21:57:58 2018 (r342243) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/sparc64/sparc64/trap.c Wed Dec 19 21:57:58 2018 (r342243) @@ -558,8 +558,6 @@ cpu_fetch_syscall_args(struct thread *td) regcnt--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Wed Dec 19 21:56:54 2018 (r342242) +++ head/sys/sys/sysent.h Wed Dec 19 21:57:58 2018 (r342243) @@ -95,7 +95,6 @@ struct vnode; struct sysentvec { int sv_size; /* number of entries */ struct sysent *sv_table; /* pointer to sysent */ - u_int sv_mask; /* optional mask to index */ int sv_errsize; /* size of errno translation table */ const int *sv_errtbl; /* errno translation table */ int (*sv_transtrap)(int, int); From owner-svn-src-head@freebsd.org Wed Dec 19 22:02: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 13F53134A7DA; Wed, 19 Dec 2018 22:02:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A90C271E45; Wed, 19 Dec 2018 22:02:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 943531C079; Wed, 19 Dec 2018 22:02:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJM2n4O027841; Wed, 19 Dec 2018 22:02:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJM2nkx027840; Wed, 19 Dec 2018 22:02:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192202.wBJM2nkx027840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342244 - in head/sys: i386/ibcs2 modules modules/coff modules/ibcs2 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: i386/ibcs2 modules modules/coff modules/ibcs2 X-SVN-Commit-Revision: 342244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A90C271E45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:02:50 -0000 Author: mjg Date: Wed Dec 19 22:02:49 2018 New Revision: 342244 URL: https://svnweb.freebsd.org/changeset/base/342244 Log: Remove iBCS2, part3: the implementation Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Deleted: head/sys/i386/ibcs2/ head/sys/modules/coff/ head/sys/modules/ibcs2/ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Dec 19 21:57:58 2018 (r342243) +++ head/sys/modules/Makefile Wed Dec 19 22:02:49 2018 (r342244) @@ -92,7 +92,6 @@ SUBDIR= \ ${_cloudabi32} \ ${_cloudabi64} \ ${_cmx} \ - ${_coff} \ ${_coretemp} \ ${_cp} \ ${_cpsw} \ @@ -153,7 +152,6 @@ SUBDIR= \ i2c \ ${_iavf} \ ${_ibcore} \ - ${_ibcs2} \ ${_ichwd} \ ${_ida} \ if_bridge \ @@ -750,13 +748,11 @@ _apm= apm .if ${MK_SOURCELESS_UCODE} != "no" _ce= ce .endif -_coff= coff .if ${MK_SOURCELESS_UCODE} != "no" _cp= cp .endif _glxiic= glxiic _glxsb= glxsb -#_ibcs2= ibcs2 _pcfclock= pcfclock _pst= pst _sbni= sbni From owner-svn-src-head@freebsd.org Wed Dec 19 22:08: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 6173E134A961; Wed, 19 Dec 2018 22:08:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 048F97203C; Wed, 19 Dec 2018 22:08:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EA3261C082; Wed, 19 Dec 2018 22:08:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJM8pIS028191; Wed, 19 Dec 2018 22:08:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJM8pHg028190; Wed, 19 Dec 2018 22:08:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192208.wBJM8pHg028190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342245 - head X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 048F97203C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:08:52 -0000 Author: mjg Date: Wed Dec 19 22:08:51 2018 New Revision: 342245 URL: https://svnweb.freebsd.org/changeset/base/342245 Log: Remove iBCS2: plug a wart missed in r342242 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 19 22:02:49 2018 (r342244) +++ head/Makefile.inc1 Wed Dec 19 22:08:51 2018 (r342245) @@ -1451,7 +1451,6 @@ packageworld: .PHONY _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 -_sysent_dirs+= sys/i386/ibcs2 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ sys/arm64/linux \ From owner-svn-src-head@freebsd.org Wed Dec 19 22:17: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 B7785134ACFF; Wed, 19 Dec 2018 22:17: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 C55FC72627; Wed, 19 Dec 2018 22:17: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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 8907B105526E; Thu, 20 Dec 2018 09:17:03 +1100 (AEDT) Date: Thu, 20 Dec 2018 09:17:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Andrew Gallatin , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en In-Reply-To: <20181219023918.E1895@besplex.bde.org> Message-ID: <20181220075104.H1360@besplex.bde.org> References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <9e09a2f8-d9fd-7fde-8e5a-b7c566cdb6a9@cs.duke.edu> <20181218033137.Q2217@besplex.bde.org> <20181219001335.A1412@besplex.bde.org> <20181219023918.E1895@besplex.bde.org> MIME-Version: 1.0 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=nlC_4_pT8q9DhB4Ho9EA:9 a=HnwGlJzEaBgL8TtGiP0A:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: C55FC72627 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-4.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_COUNT_TWO(0.00)[2]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; MIME_TRACE(0.00)[0:+,1:+]; DMARC_NA(0.00)[optusnet.com.au]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; CTYPE_MIXED_BOGUS(1.00)[]; IP_SCORE(-3.22)[ip: (-8.47), ipnet: 211.28.0.0/14(-4.21), asn: 4804(-3.37), country: AU(-0.03)]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RWL_MAILSPIKE_POSSIBLE(0.00)[249.132.29.211.rep.mailspike.net : 127.0.0.17] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:17:26 -0000 On Wed, 19 Dec 2018, Bruce Evans wrote: > On Wed, 19 Dec 2018, Bruce Evans wrote: > >> On Mon, 17 Dec 2018, Andrew Gallatin wrote: >>=20 >>> On 12/17/18 2:08 PM, Bruce Evans wrote: >> * ... >>>> iflib uses queuing techniques to significantly pessimize em NICs with = 1 >>>> hardware queue.=C2=A0 On fast machines, it attempts to do 1 context sw= itch=20 >>>> per >> ... >>> This can happen even w/o contention when "abdicate" is enabled in mp >>> ring. I complained about this as well, and the default was changed in >>> mp ring to not always "abdicate" (eg, switch to the tq to handle the >>> packet). Abdication substantially pessimizes Netflix style web unconten= ded=20 >>> workloads, but it generally helps small packet forwarding. >>>=20 >>> It is interesting that you see the opposite. I should try benchmarking >>> with just a single ring. >>=20 >> Hmm, I didn't remember "abdicated" and never knew about the sysctl for i= t >> (the sysctl is newer), but I notices the slowdown from near the first >> commit for it (r323954) and already used the folowing workaround for it: >> ... >> This essentialy just adds back the previous code with a flag to check >> both versions. Hopefully the sysctl can do the same thing. > > It doesn't. Setting tx_abdicate to 1 gives even more context switches=20 > (almost > twice as many, 800k/sec instead of 400k/sec, on i386 pessimized by > INVARIANTS, WITNESS, !WITNESS_SKIPSPIN, 4G KVA and more. Without > ... I now understand most of the slownesses and variations in benchmarks. Short summary: After arcane tuning including a sysctl only available in my version of SCHED_4BSD, on amd64 iflib in -current runs as fast as old old em with EM_MULTIQUEUE and no other tuning in FreeBSD-11; i386 also needs a CPU almost 3 times faster to compensate for the overhead of having 4G KVA (bit no other security pessimizations in either). Long summary: iflib with tx_abdicate=3D0 runs a bit like old em without EM_MULTIQUEUE, provided the NIC is I218V and not PRO1000 and/or the CPU is too slow to saturate the NIC and/or the network. iflib is just 10% slower. Neither does excessive context switches to tgq with I218V (context switches seem to be limited to not much more than 2 per h/w interrupt, and h/w interrupts are normally moderated to 8kHz). However, iflib does excessive context switches for PRO1000. I don't know if this is for hardware reasons or just for dropping packets. iflib with tx_abdicate=3D1 runs a bit like old em with EM_MULTIQUEUE. Due to general slowness, even a 4GHz i7 has difficulty saturating 1Gbps etherne= t with small packets. tx_abdicate=3D1 allows it to saturate by using tgq mor= e. This causes lots of context switches and otherwise uses lots of CPU (60% of a 4GHz i7 for iflib). Old em with EM_MULTIQUEUE gives identical kpps and saturation and dropped packets for spare cycles on the CPU producing the packets, but I think it does less context switches and uses less CPU for tgq. This is mostly for the I218V. I got apparently-qualitativly-different results on i386 because I mostly tested i386 with the PRO1000 where there are excessive context switches on both amd64 and i386 with tx_abdicate=3D0. tx_abdicate=3D1 gives even mo= re excessive context switches (about twice as many) for the PRO1000. I got apparently-qualitativly-different results for some old benchmarks because I used an old version of FreeBSD (r332488) for many of them, and also had version problems within this version. iflib in this version forces tx_abdicate=3D1. I noticed the extra context switches from this long ago, and had an option which defaulted to using older iflib code which seemed to work better. But I misedited the non-default case of this and had the double drainage check bug that was added in -current in r366560 and fixed in -current in r341824. This gave excessive extra context switches, so the commit that added abdication (r323954) seemed to be even slower than it was. The fastest case by a significant amount (saturation on I218V using 1.6 times less CPU) is with netblast bound to the same CPU as tgq, PREEMPTION* not configured, and my scheduler modification that reduces preemption even further, and this modification selected using a sysctl), and tx_abdicate=3D1. Then the scheduler modification delays most switches to tgq, and tx_abdicate=3D1 apparently allows such context switches when they are useful (I think netblast fills a queue and then tx_abdiscate=3D1 gives a context switch immediately, but tx_abdicate=3D0 doesn't give a context switch soon enough). But without the scheduler modification, this is the slowest case (tx_abdicate=3D1 forces context switches to tgq after every packet, and since netblast is bound to the same CPU, it can't run. In both cases, only 1 CPU is used, but the context switches reduce throughput by about a factor of 2. It is less clear why througput counting dropped packets is lower for netblast not bound and tx_abdicate=3D0. Then tgq apparently doesn't run promptly enough to saturate the net, but netblast has its own CPU so it doesn't stop when tgq runs so it should be able to produce even more packets (many more dropped ones) than in the fastest case. This might be caused by lock contention. > When netblast is bound to the tgq's CPU, the tgq actually runs on another > CPU. Apparently, the binding is weak ot this is a bugfeature in my=20 > scheduler. It is a feature that I have forgotten about. It was originally a bug, but I happened to noticed that it reduced the context switches for iflib long ago, so made it a feature. I didn't noticed then that it also improved throughput signficantly. I made it the default for !PREEMPTION only, then forgot that it was stronger than !PREEMPTION. The feature is to not reschedule on all CPUs when a thread becomes runnable= =2E Only reschedule on the current CPU. Also, run an idle CPU if there is one. This is not suitable for general use since it results in low priority threa= ds staying running until the end of their quantum or voluntary context switch instead of running a higher priority thread. Plain !PREEMPTION does much the same thing for threads at a user priority, but preempts from user priority to kernel priority. > ... > Another test with amd64 and I218V instead of PRO1000: > > netblast bound, !abdicate: 1243kpps sent, 0kpps dropped (16k/sec csw= ) > netblast unbound, !abdicate: 1236kpps sent, 0kpps dropped (16k/sec csw= ) > netblast bound, abdicate: 1485kpps sent, 243kpps dropped (16k/sec csw= ) > netblast unbound, abdicate: 1407kpps sent, 1.7kpps dropped (850k/sec csw= ) All working correctly, except the throughput is a bit low with !abdicate and abdicate takes too much CPU. This must be with my anti-preemption for the low csw in the 3rd case. > There is an i386 dependency after all! !abdicate works on amd64 but not > on i386 to prevent the excessive context switches. Unfortunately, it als= o > reduces kpps by almost 20% and leaves no spare CPU for dropping packets. The deependency was actually on the NIC. > Why would tx_abdicate=3D0 give extra context switches for i386 but not > for amd64? More interestingly, what does it do wrong to lose 20% in > kpps sent and more in kpps dropped? Apparently, some dependency on the NIC. kpps is lost because less CPU is used and 1 4GHz CPU can't keep up. (I use CC and CFLAGS optimized for debugging. This costs about 10% in sys time.) > Another test with PREEMPTION*: > > netblast bound, !abdicate: same as above > netblast unbound, !abdicate: same as above > netblast bound, abdicate: 578kpps sent, 0kpps dropped (1160k/sec csw) > netblast unbound, abdicate: 1106kpps sent, 0kpps dropped (850k/sec csw) > > That is, abdicate with PREEMPTION to make it work as fully intended > destroys performance for the netblast bound case where it fixes most > peformance problems without PREEMPTION; for the network unbound case it > only reduces performance by 30%. It uses the same amount of CPU as > !PREEMPTION. This is because PREEMPTION makes the netblast unbound case run into tgq always. Unquoted benchmarks show that the netblast unbound case is slower than usual because mis-scheduling makes netblast run into tgq sometimes. The regression in average ping latency is actually from 73 usec to 84 usec. Anti-preemption might give latencies of 100 msec, but actually makes no difference for ping latency However, I now rememeber that the maximum ping latency is often 2 msec. That is too high. This is with itr=3D0, which is the main part of turning off interrupt moderation. Even the default itr of 125 usec only increases worst-case latencies by 125 usec. Bruce From owner-svn-src-head@freebsd.org Wed Dec 19 22:30: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 9EA51134B254; Wed, 19 Dec 2018 22:30:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36C1672EDE; Wed, 19 Dec 2018 22:30:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 262A81C3D7; Wed, 19 Dec 2018 22:30:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMUQCW039051; Wed, 19 Dec 2018 22:30:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMUQI7039050; Wed, 19 Dec 2018 22:30:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192230.wBJMUQI7039050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342247 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 342247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36C1672EDE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:30:27 -0000 Author: mjg Date: Wed Dec 19 22:30:26 2018 New Revision: 342247 URL: https://svnweb.freebsd.org/changeset/base/342247 Log: mac: reduce pessimization of sdt probe handling Prior to the change the code would branch on return value and then check if probes are enabled. Since vast majority of the time they are not, this is clearly wasteful. Check probes first. Sponsored by: The FreeBSD Foundation Modified: head/sys/security/mac/mac_internal.h Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Wed Dec 19 22:17:24 2018 (r342246) +++ head/sys/security/mac/mac_internal.h Wed Dec 19 22:30:26 2018 (r342247) @@ -98,12 +98,14 @@ SDT_PROVIDER_DECLARE(mac_framework); /* Entry points t "int", arg0); #define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \ - if (error) { \ - SDT_PROBE5(mac_framework, , name, mac__check__err, \ - error, arg0, arg1, arg2, arg3); \ - } else { \ - SDT_PROBE5(mac_framework, , name, mac__check__ok, \ - 0, arg0, arg1, arg2, arg3); \ + if (SDT_PROBES_ENABLED()) { \ + if (error) { \ + SDT_PROBE5(mac_framework, , name, mac__check__err,\ + error, arg0, arg1, arg2, arg3); \ + } else { \ + SDT_PROBE5(mac_framework, , name, mac__check__ok,\ + 0, arg0, arg1, arg2, arg3); \ + } \ } \ } while (0) @@ -122,12 +124,14 @@ SDT_PROVIDER_DECLARE(mac_framework); /* Entry points t "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ - if (error) { \ - SDT_PROBE3(mac_framework, , name, mac__grant__err, \ - error, arg0, arg1); \ - } else { \ - SDT_PROBE3(mac_framework, , name, mac__grant__ok, \ - error, arg0, arg1); \ + if (SDT_PROBES_ENABLED()) { \ + if (error) { \ + SDT_PROBE3(mac_framework, , name, mac__grant__err,\ + error, arg0, arg1); \ + } else { \ + SDT_PROBE3(mac_framework, , name, mac__grant__ok,\ + error, arg0, arg1); \ + } \ } \ } while (0) From owner-svn-src-head@freebsd.org Wed Dec 19 22:43: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 E47F5134B829; Wed, 19 Dec 2018 22:43:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8905473AD1; Wed, 19 Dec 2018 22:43:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 797DB1C738; Wed, 19 Dec 2018 22:43:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMhBiN049314; Wed, 19 Dec 2018 22:43:11 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMhB9C049313; Wed, 19 Dec 2018 22:43:11 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201812192243.wBJMhB9C049313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 19 Dec 2018 22:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342251 - head/sys/modules/tpm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/modules/tpm X-SVN-Commit-Revision: 342251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8905473AD1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:43:12 -0000 Author: mw Date: Wed Dec 19 22:43:10 2018 New Revision: 342251 URL: https://svnweb.freebsd.org/changeset/base/342251 Log: Include the new TPM 2.0 driver in the TPM module. Update the appropriate Makefile to build the new driver together with the old one. Submitted by: Kornel Duleba Reported by: kib Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/modules/tpm/Makefile Modified: head/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Wed Dec 19 22:42:06 2018 (r342250) +++ head/sys/modules/tpm/Makefile Wed Dec 19 22:43:10 2018 (r342251) @@ -7,5 +7,7 @@ KMOD= tpm SRCS= tpm.c bus_if.h device_if.h #Bus specific stuff. SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h +#TPM 2.0 +SRCS+= tpm20.c tpm_crb.c tpm_tis.c .include From owner-svn-src-head@freebsd.org Wed Dec 19 22:47: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 D6964134BA67; Wed, 19 Dec 2018 22:47:38 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5949F74389; Wed, 19 Dec 2018 22:47:38 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2F9FB1C73E; Wed, 19 Dec 2018 22:47:38 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMlcnV049730; Wed, 19 Dec 2018 22:47:38 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMlcWt049729; Wed, 19 Dec 2018 22:47:38 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201812192247.wBJMlcWt049729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 19 Dec 2018 22:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342253 - head/usr.sbin/uefisign X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/usr.sbin/uefisign X-SVN-Commit-Revision: 342253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5949F74389 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:47:39 -0000 Author: mw Date: Wed Dec 19 22:47:37 2018 New Revision: 342253 URL: https://svnweb.freebsd.org/changeset/base/342253 Log: Fix alignment issue in uefisign The pe_certificate structure has to be aligned to 8 bytes. [1] Since this is now checked in edk2, any binaries signed with older version of this tool will fail verification. References: [1] https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#the-attribute-certificate-table-image-only Submitted by: Kornel Duleba Reviewed by: trasz Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D18554 Modified: head/usr.sbin/uefisign/pe.c Modified: head/usr.sbin/uefisign/pe.c ============================================================================== --- head/usr.sbin/uefisign/pe.c Wed Dec 19 22:46:03 2018 (r342252) +++ head/usr.sbin/uefisign/pe.c Wed Dec 19 22:47:37 2018 (r342253) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] #endif +#define PE_ALIGMENT_SIZE 8 + struct mz_header { uint8_t mz_signature[2]; uint8_t mz_dont_care[58]; @@ -498,19 +500,17 @@ parse(struct executable *x) } static off_t -append(struct executable *x, void *ptr, size_t len) +append(struct executable *x, void *ptr, size_t len, size_t aligment) { off_t off; - /* - * XXX: Alignment. - */ off = x->x_len; - x->x_buf = realloc(x->x_buf, x->x_len + len); + x->x_buf = realloc(x->x_buf, x->x_len + len + aligment); if (x->x_buf == NULL) err(1, "realloc"); memcpy(x->x_buf + x->x_len, ptr, len); - x->x_len += len; + memset(x->x_buf + x->x_len + len, 0, aligment); + x->x_len += len + aligment; return (off); } @@ -522,6 +522,7 @@ update(struct executable *x) struct pe_certificate *pc; struct pe_directory_entry pde; size_t pc_len; + size_t pc_aligment; off_t pc_off; pc_len = sizeof(*pc) + x->x_signature_len; @@ -529,6 +530,11 @@ update(struct executable *x) if (pc == NULL) err(1, "calloc"); + if (pc_len % PE_ALIGMENT_SIZE > 0) + pc_aligment = PE_ALIGMENT_SIZE - (pc_len % PE_ALIGMENT_SIZE); + else + pc_aligment = 0; + #if 0 /* * Note that pc_len is the length of pc_certificate, @@ -545,7 +551,7 @@ update(struct executable *x) pc->pc_type = PE_CERTIFICATE_TYPE; memcpy(&pc->pc_signature, x->x_signature, x->x_signature_len); - pc_off = append(x, pc, pc_len); + pc_off = append(x, pc, pc_len, pc_aligment); #if 0 printf("added signature chunk at offset %zd, len %zd\n", pc_off, pc_len); @@ -554,7 +560,7 @@ update(struct executable *x) free(pc); pde.pde_rva = pc_off; - pde.pde_size = pc_len; + pde.pde_size = pc_len + pc_aligment; memcpy(x->x_buf + x->x_certificate_entry_off, &pde, sizeof(pde)); checksum = compute_checksum(x); From owner-svn-src-head@freebsd.org Wed Dec 19 22:54: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 31997134C20B; Wed, 19 Dec 2018 22:54:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C86C74DCD; Wed, 19 Dec 2018 22:54:04 +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 4EDCD1C8F0; Wed, 19 Dec 2018 22:54:04 +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 wBJMs4m8054868; Wed, 19 Dec 2018 22:54:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMs3vc054866; Wed, 19 Dec 2018 22:54:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192254.wBJMs3vc054866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 22:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342255 - in head: . sys/mips/conf sys/mips/mips sys/mips/sibyte X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/mips/conf sys/mips/mips sys/mips/sibyte X-SVN-Commit-Revision: 342255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C86C74DCD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:54:05 -0000 Author: imp Date: Wed Dec 19 22:54:03 2018 New Revision: 342255 URL: https://svnweb.freebsd.org/changeset/base/342255 Log: Remove support for the now very old SiByte MIPS platform. It's not relevant and is unused. It's also getting in the way of progress in some admittedly minor ways. Better to retire it to reduce the burden on the project. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Deleted: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM.hints head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP head/sys/mips/conf/std.SWARM head/sys/mips/sibyte/ata_zbbus.c head/sys/mips/sibyte/files.sibyte head/sys/mips/sibyte/sb_asm.S head/sys/mips/sibyte/sb_bus_space.h head/sys/mips/sibyte/sb_machdep.c head/sys/mips/sibyte/sb_scd.c head/sys/mips/sibyte/sb_scd.h head/sys/mips/sibyte/sb_zbbus.c head/sys/mips/sibyte/sb_zbpci.c head/sys/mips/sibyte/std.sibyte Modified: head/UPDATING head/sys/mips/mips/bus_space_generic.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Dec 19 22:48:27 2018 (r342254) +++ head/UPDATING Wed Dec 19 22:54:03 2018 (r342255) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181215: + The old sibyte / swarm / Broadcom BCM1250 support has been + removed from the mips port. + 20181211: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 7.0.1. Please see the 20141231 entry below for information about Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Wed Dec 19 22:48:27 2018 (r342254) +++ head/sys/mips/mips/bus_space_generic.c Wed Dec 19 22:54:03 2018 (r342255) @@ -202,14 +202,6 @@ static struct bus_space generic_space = { #define wr16(a, v) cvmx_write64_uint16(a, v) #define wr32(a, v) cvmx_write64_uint32(a, v) #define wr64(a, v) cvmx_write64_uint64(a, v) -#elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN -#include -#define rd8(a) sb_big_endian_read8(a) -#define rd16(a) sb_big_endian_read16(a) -#define rd32(a) sb_big_endian_read32(a) -#define wr8(a, v) sb_big_endian_write8(a, v) -#define wr16(a, v) sb_big_endian_write16(a, v) -#define wr32(a, v) sb_big_endian_write32(a, v) #else #define rd8(a) readb(a) #define rd16(a) readw(a) From owner-svn-src-head@freebsd.org Wed Dec 19 22:54: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 006CD134C269; Wed, 19 Dec 2018 22:54:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80ADC74EFD; Wed, 19 Dec 2018 22:54:24 +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 52D221C8F2; Wed, 19 Dec 2018 22:54:24 +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 wBJMsOLX054933; Wed, 19 Dec 2018 22:54:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMsOGZ054932; Wed, 19 Dec 2018 22:54:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192254.wBJMsOGZ054932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 22:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342256 - in head/sys/mips: conf gxemul X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/mips: conf gxemul X-SVN-Commit-Revision: 342256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80ADC74EFD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:54:25 -0000 Author: imp Date: Wed Dec 19 22:54:23 2018 New Revision: 342256 URL: https://svnweb.freebsd.org/changeset/base/342256 Log: Remove the GXEMUL support. gxemul was a nice stop-gap while qemu support for mips was firmed up. Now MALTA* + qemu is the platform of choice retire gxemul support. It's unknown when this was last confirmed working. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Deleted: head/sys/mips/conf/GXEMUL head/sys/mips/conf/GXEMUL.hints head/sys/mips/conf/GXEMUL32 head/sys/mips/gxemul/files.gxemul head/sys/mips/gxemul/gxemul_machdep.c head/sys/mips/gxemul/mpreg.h head/sys/mips/gxemul/std.gxemul From owner-svn-src-head@freebsd.org Wed Dec 19 22:54: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 35224134C292; Wed, 19 Dec 2018 22:54: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6417974F72; Wed, 19 Dec 2018 22:54:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAF131C8F3; Wed, 19 Dec 2018 22:54:29 +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 wBJMsT2o054987; Wed, 19 Dec 2018 22:54:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMsT0e054986; Wed, 19 Dec 2018 22:54:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192254.wBJMsT0e054986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342257 - in head: . sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/mips/conf X-SVN-Commit-Revision: 342257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6417974F72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:54:32 -0000 Author: imp Date: Wed Dec 19 22:54:29 2018 New Revision: 342257 URL: https://svnweb.freebsd.org/changeset/base/342257 Log: Remove support for running 32-bit kernels on 64-bit hardware. This was useful in bring up. However, it causes more issues than the support is worth (64-bit atomics being chief among them). Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Deleted: head/sys/mips/conf/XLP Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Dec 19 22:54:23 2018 (r342256) +++ head/UPDATING Wed Dec 19 22:54:29 2018 (r342257) @@ -32,6 +32,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20181215: + The XLP config has been removed. We can't support 64-bit atomics in this + kernel because it is running in 32-bit mode. XLP users must transition + to running a 64-bit kernel (XLP64 or XLPN32). + +20181215: + The mips GXEMUL support has been removed from FreeBSD. MALTA* + qemu is + the preferred emulator today and we don't need two different ones. + +20181215: The old sibyte / swarm / Broadcom BCM1250 support has been removed from the mips port. From owner-svn-src-head@freebsd.org Wed Dec 19 22: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 7FCD3134C2B6; Wed, 19 Dec 2018 22:54:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 268A574FF4; Wed, 19 Dec 2018 22:54:36 +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 2956C1C8FB; Wed, 19 Dec 2018 22:54:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMsZwV055042; Wed, 19 Dec 2018 22:54:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMsZ6d055041; Wed, 19 Dec 2018 22:54:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192254.wBJMsZ6d055041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 22:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342258 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 342258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 268A574FF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:54:38 -0000 Author: imp Date: Wed Dec 19 22:54:34 2018 New Revision: 342258 URL: https://svnweb.freebsd.org/changeset/base/342258 Log: Remove old config file for SENTRY5 This is an older broadcom part that implements the mips32 ISA. 32-bit FreeBSD/mips now requires mips32r2, so retire this config. Most of the broadcom port is shared with newer ports, so what little code may be unique to this part has not been GC'd at this time. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Deleted: head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SENTRY5.hints From owner-svn-src-head@freebsd.org Wed Dec 19 22:56: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 E029C134C477; Wed, 19 Dec 2018 22:56: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7896D753D0; Wed, 19 Dec 2018 22:56: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 67B131C8FC; Wed, 19 Dec 2018 22:56: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 wBJMuWl8055214; Wed, 19 Dec 2018 22:56:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMuWAF055213; Wed, 19 Dec 2018 22:56:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192256.wBJMuWAF055213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 22:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342259 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7896D753D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:56:33 -0000 Author: imp Date: Wed Dec 19 22:56:31 2018 New Revision: 342259 URL: https://svnweb.freebsd.org/changeset/base/342259 Log: Fix the date The first part of the mips pruning has been commited. This part is uncontested. Fix the date in the UPDATING file to reflect when I made the commit. The contested parts will be committed (or not) once those discussions complete. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Dec 19 22:54:34 2018 (r342258) +++ head/UPDATING Wed Dec 19 22:56:31 2018 (r342259) @@ -31,16 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20181215: +20181219: The XLP config has been removed. We can't support 64-bit atomics in this kernel because it is running in 32-bit mode. XLP users must transition to running a 64-bit kernel (XLP64 or XLPN32). -20181215: The mips GXEMUL support has been removed from FreeBSD. MALTA* + qemu is the preferred emulator today and we don't need two different ones. -20181215: The old sibyte / swarm / Broadcom BCM1250 support has been removed from the mips port. From owner-svn-src-head@freebsd.org Wed Dec 19 22:57: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 C9429134C581; Wed, 19 Dec 2018 22:57:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5792975603; Wed, 19 Dec 2018 22:57:48 +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 4CB501C8FD; Wed, 19 Dec 2018 22:57:48 +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 wBJMvmrK055325; Wed, 19 Dec 2018 22:57:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMvlct055323; Wed, 19 Dec 2018 22:57:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812192257.wBJMvlct055323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 19 Dec 2018 22:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342260 - in head/lib/libc: stdlib tests/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/lib/libc: stdlib tests/stdlib X-SVN-Commit-Revision: 342260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5792975603 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 22:57:49 -0000 Author: cem Date: Wed Dec 19 22:57:47 2018 New Revision: 342260 URL: https://svnweb.freebsd.org/changeset/base/342260 Log: Allow multi-byte thousands separators in strfmon(3) PR: 234010 Reported by: Jon Tejnung Reviewed by: yuripv Differential Revision: https://reviews.freebsd.org/D18605 Added: head/lib/libc/tests/stdlib/strfmon_test.c (contents, props changed) Modified: head/lib/libc/stdlib/strfmon.c head/lib/libc/tests/stdlib/Makefile Modified: head/lib/libc/stdlib/strfmon.c ============================================================================== --- head/lib/libc/stdlib/strfmon.c Wed Dec 19 22:56:31 2018 (r342259) +++ head/lib/libc/stdlib/strfmon.c Wed Dec 19 22:57:47 2018 (r342260) @@ -92,7 +92,8 @@ __FBSDID("$FreeBSD$"); } while (0) #define GRPSEP do { \ - *--bufend = thousands_sep; \ + bufend -= thousands_sep_size; \ + memcpy(bufend, thousands_sep, thousands_sep_size); \ groups++; \ } while (0) @@ -520,7 +521,7 @@ get_groups(int size, char *grouping) { return (chars); } -/* convert double to ASCII */ +/* convert double to locale-encoded string */ static char * __format_grouped_double(double value, int *flags, int left_prec, int right_prec, int pad_char) { @@ -536,19 +537,24 @@ __format_grouped_double(double value, int *flags, struct lconv *lc = localeconv(); char *grouping; - char decimal_point; - char thousands_sep; + const char *decimal_point; + const char *thousands_sep; + size_t decimal_point_size; + size_t thousands_sep_size; int groups = 0; grouping = lc->mon_grouping; - decimal_point = *lc->mon_decimal_point; - if (decimal_point == '\0') - decimal_point = *lc->decimal_point; - thousands_sep = *lc->mon_thousands_sep; - if (thousands_sep == '\0') - thousands_sep = *lc->thousands_sep; + decimal_point = lc->mon_decimal_point; + if (*decimal_point == '\0') + decimal_point = lc->decimal_point; + thousands_sep = lc->mon_thousands_sep; + if (*thousands_sep == '\0') + thousands_sep = lc->thousands_sep; + decimal_point_size = strlen(decimal_point); + thousands_sep_size = strlen(thousands_sep); + /* fill left_prec with default value */ if (left_prec == -1) left_prec = 0; @@ -574,7 +580,8 @@ __format_grouped_double(double value, int *flags, return (NULL); /* make sure that we've enough space for result string */ - bufsize = avalue_size * 2 + 1; + bufsize = avalue_size * (1 + thousands_sep_size) + decimal_point_size + + 1; rslt = calloc(1, bufsize); if (rslt == NULL) { free(avalue); @@ -593,12 +600,13 @@ __format_grouped_double(double value, int *flags, bufend -= right_prec; memcpy(bufend, avalue + avalue_size+padded-right_prec, right_prec); - *--bufend = decimal_point; + bufend -= decimal_point_size; + memcpy(bufend, decimal_point, decimal_point_size); avalue_size -= (right_prec + 1); } if ((*flags & NEED_GROUPING) && - thousands_sep != '\0' && /* XXX: need investigation */ + thousands_sep_size > 0 && /* XXX: need investigation */ *grouping != CHAR_MAX && *grouping > 0) { while (avalue_size > (int)*grouping) { @@ -626,8 +634,9 @@ __format_grouped_double(double value, int *flags, } else { bufend -= avalue_size; memcpy(bufend, avalue+padded, avalue_size); + /* decrease assumed $decimal_point */ if (right_prec == 0) - padded--; /* decrease assumed $decimal_point */ + padded -= decimal_point_size; } /* do padding with pad_char */ Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Wed Dec 19 22:56:31 2018 (r342259) +++ head/lib/libc/tests/stdlib/Makefile Wed Dec 19 22:57:47 2018 (r342260) @@ -6,6 +6,7 @@ ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test ATF_TESTS_C+= set_constraint_handler_s_test +ATF_TESTS_C+= strfmon_test ATF_TESTS_C+= tsearch_test .if ${COMPILER_FEATURES:Mc++11} ATF_TESTS_CXX+= cxa_thread_atexit_test Added: head/lib/libc/tests/stdlib/strfmon_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/strfmon_test.c Wed Dec 19 22:57:47 2018 (r342260) @@ -0,0 +1,71 @@ +/*- + * Copyright (C) 2018 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +ATF_TC_WITHOUT_HEAD(strfmon_locale_thousands); +ATF_TC_BODY(strfmon_locale_thousands, tc) +{ + char actual[40], expected[40]; + struct lconv *lc; + const char *ts; + double n; + + setlocale(LC_MONETARY, "sv_SE.UTF-8"); + + lc = localeconv(); + + ts = lc->mon_thousands_sep; + if (strlen(ts) == 0) + ts = lc->thousands_sep; + + if (strlen(ts) < 2) + atf_tc_skip("multi-byte thousands-separator not found"); + + n = 1234.56; + strfmon(actual, sizeof(actual), "%i", n); + + strcpy(expected, "1"); + strlcat(expected, ts, sizeof(expected)); + strlcat(expected, "234", sizeof(expected)); + + /* We're just testing the thousands separator, not all of strmon. */ + actual[strlen(expected)] = '\0'; + ATF_CHECK_STREQ(expected, actual); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, strfmon_locale_thousands); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Wed Dec 19 23:15: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 5A1EA134CF93; Wed, 19 Dec 2018 23:15:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2A2D7644A; Wed, 19 Dec 2018 23:15:49 +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 E61D01CC6B; Wed, 19 Dec 2018 23:15:49 +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 wBJNFnN7065799; Wed, 19 Dec 2018 23:15:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNFnSx065798; Wed, 19 Dec 2018 23:15:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192315.wBJNFnSx065798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 23:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342261 - head/sys/mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/ingenic X-SVN-Commit-Revision: 342261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2A2D7644A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:15:50 -0000 Author: imp Date: Wed Dec 19 23:15:49 2018 New Revision: 342261 URL: https://svnweb.freebsd.org/changeset/base/342261 Log: 32-bit mips SMP is unsupported Per discussions on mips@, 32-bit mips SMP is now unsupported. The files in the tree will compile for a while longer, but when the atomic_swap_64 or similar atomic enters into the MI part of the tree, as currently foreseen sometime next year, these ports will start to no longer link. The JZ4780 is the only such system we have. The UP version of this chip is unaffected by this, and will remain supported. Discussed on: mips@ Relnotes: yes Modified: head/sys/mips/ingenic/files.jz4780 Modified: head/sys/mips/ingenic/files.jz4780 ============================================================================== --- head/sys/mips/ingenic/files.jz4780 Wed Dec 19 22:57:47 2018 (r342260) +++ head/sys/mips/ingenic/files.jz4780 Wed Dec 19 23:15:49 2018 (r342261) @@ -29,7 +29,8 @@ mips/ingenic/jz4780_aic.c optional sound xdma mips/ingenic/jz4780_codec.c optional sound # SMP -mips/ingenic/jz4780_mp.c optional smp +mips/ingenic/jz4780_mp.c optional smp \ + warning "* * * * * 32-bit mips SMP unsupported * * * * *" mips/ingenic/jz4780_mpboot.S optional smp # Custom interface between pinctrl and gpio From owner-svn-src-head@freebsd.org Wed Dec 19 23:19: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 6A4F5134D1E7; Wed, 19 Dec 2018 23:19:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E14E76885; Wed, 19 Dec 2018 23:19:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F1BE01CC6C; Wed, 19 Dec 2018 23:19:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJNJ5F1066012; Wed, 19 Dec 2018 23:19:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNJ5O7066011; Wed, 19 Dec 2018 23:19:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192319.wBJNJ5O7066011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 23:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342262 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E14E76885 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:19:06 -0000 Author: mjg Date: Wed Dec 19 23:19:05 2018 New Revision: 342262 URL: https://svnweb.freebsd.org/changeset/base/342262 Log: Provide SDT_PROBES_ENABLED for kernels without KDTRACE. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Wed Dec 19 23:15:49 2018 (r342261) +++ head/sys/sys/sdt.h Wed Dec 19 23:19:05 2018 (r342262) @@ -90,6 +90,7 @@ extern volatile bool sdt_probes_enabled; #define SDT_PROVIDER_DECLARE(prov) #define SDT_PROBE_DEFINE(prov, mod, func, name) #define SDT_PROBE_DECLARE(prov, mod, func, name) +#define SDT_PROBES_ENABLED() 0 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) From owner-svn-src-head@freebsd.org Wed Dec 19 23:22: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 BF94C134D52B; Wed, 19 Dec 2018 23:22:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63E1476D8C; Wed, 19 Dec 2018 23:22:15 +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 567001CDFF; Wed, 19 Dec 2018 23:22:15 +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 wBJNMFRV070136; Wed, 19 Dec 2018 23:22:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNMF1P070134; Wed, 19 Dec 2018 23:22:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812192322.wBJNMF1P070134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Dec 2018 23:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342263 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 342263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63E1476D8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:22:15 -0000 Author: imp Date: Wed Dec 19 23:22:14 2018 New Revision: 342263 URL: https://svnweb.freebsd.org/changeset/base/342263 Log: Add note to 32-bit mips smp config files documenting the status Modified: head/sys/mips/conf/CI20 head/sys/mips/conf/JZ4780 Modified: head/sys/mips/conf/CI20 ============================================================================== --- head/sys/mips/conf/CI20 Wed Dec 19 23:19:05 2018 (r342262) +++ head/sys/mips/conf/CI20 Wed Dec 19 23:22:14 2018 (r342263) @@ -4,6 +4,8 @@ #NO_UNIVERSE +# Note: SMP on 32-bit mips is no longer supported, which affects this config file. + include "JZ4780" ident CI20 Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Wed Dec 19 23:19:05 2018 (r342262) +++ head/sys/mips/conf/JZ4780 Wed Dec 19 23:22:14 2018 (r342263) @@ -4,6 +4,8 @@ #NO_UNIVERSE +# Note: SMP on 32-bit mips is no longer supported, which affects this config file. + ident JZ4780 machine mips mipselhf cpu CPU_XBURST From owner-svn-src-head@freebsd.org Wed Dec 19 23:28: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 DC906134D6EA; Wed, 19 Dec 2018 23:28:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC3977088; Wed, 19 Dec 2018 23:28:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6AFF71CE16; Wed, 19 Dec 2018 23:28:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJNSU0u071325; Wed, 19 Dec 2018 23:28:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNSUTP071324; Wed, 19 Dec 2018 23:28:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192328.wBJNSUTP071324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 23:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342264 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FC3977088 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:28:31 -0000 Author: mjg Date: Wed Dec 19 23:28:29 2018 New Revision: 342264 URL: https://svnweb.freebsd.org/changeset/base/342264 Log: Check for probes enabled in priv_check_cred before evaluting the error. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_priv.c Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Wed Dec 19 23:22:14 2018 (r342263) +++ head/sys/kern/kern_priv.c Wed Dec 19 23:28:29 2018 (r342264) @@ -194,10 +194,12 @@ priv_check_cred(struct ucred *cred, int priv) */ error = EPERM; out: - if (error) - SDT_PROBE1(priv, kernel, priv_check, priv__err, priv); - else - SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv); + if (SDT_PROBES_ENABLED()) { + if (error) + SDT_PROBE1(priv, kernel, priv_check, priv__err, priv); + else + SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv); + } return (error); } From owner-svn-src-head@freebsd.org Wed Dec 19 23:28: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 74975134D725; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A697771C1; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 006951CE17; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJNSuLK071394; Wed, 19 Dec 2018 23:28:56 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNSuCY071393; Wed, 19 Dec 2018 23:28:56 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201812192328.wBJNSuCY071393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 19 Dec 2018 23:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342265 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 342265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A697771C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:28:57 -0000 Author: yuripv Date: Wed Dec 19 23:28:56 2018 New Revision: 342265 URL: https://svnweb.freebsd.org/changeset/base/342265 Log: regcomp: revert part of r341838 which turned out to be unrelated and caused issues with search in less. PR: 234066 Reviewed by: pfg Differential revision: https://reviews.freebsd.org/D18611 Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Wed Dec 19 23:28:29 2018 (r342264) +++ head/lib/libc/regex/regcomp.c Wed Dec 19 23:28:56 2018 (r342265) @@ -1841,29 +1841,21 @@ computejumps(struct parse *p, struct re_guts *g) { int ch; int mindex; - int cmin, cmax; - /* - * For UTF-8 we process only the first 128 characters corresponding to - * the POSIX locale. - */ - cmin = MB_CUR_MAX == 1 ? CHAR_MIN : 0; - cmax = MB_CUR_MAX == 1 ? CHAR_MAX : 127; - /* Avoid making errors worse */ if (p->error != 0) return; - g->charjump = (int *)malloc((cmax - cmin + 1) * sizeof(int)); + g->charjump = (int *)malloc((NC_MAX + 1) * sizeof(int)); if (g->charjump == NULL) /* Not a fatal error */ return; /* Adjust for signed chars, if necessary */ - g->charjump = &g->charjump[-(cmin)]; + g->charjump = &g->charjump[-(CHAR_MIN)]; /* If the character does not exist in the pattern, the jump * is equal to the number of characters in the pattern. */ - for (ch = cmin; ch < cmax + 1; ch++) + for (ch = CHAR_MIN; ch < (CHAR_MAX + 1); ch++) g->charjump[ch] = g->mlen; /* If the character does exist, compute the jump that would From owner-svn-src-head@freebsd.org Wed Dec 19 23:29: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 DE2D5134D748; Wed, 19 Dec 2018 23:29:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 796BD77211; Wed, 19 Dec 2018 23:29:03 +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 98E1E1CE19; Wed, 19 Dec 2018 23:29:02 +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 wBJNT24e071465; Wed, 19 Dec 2018 23:29:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNT1RF071459; Wed, 19 Dec 2018 23:29:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812192329.wBJNT1RF071459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Dec 2018 23:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342266 - 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: 342266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 796BD77211 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Dec 2018 23:29:04 -0000 Author: np Date: Wed Dec 19 23:29:01 2018 New Revision: 342266 URL: https://svnweb.freebsd.org/changeset/base/342266 Log: cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Dec 19 23:29:01 2018 (r342266) @@ -1265,6 +1265,15 @@ static int snd_win = 128 * 1024; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); +int use_dsgl = 1; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, use_dsgl, CTLFLAG_RWTUN, &use_dsgl, 0, + "Use DSGL for PBL/FastReg (default=1)"); + +int inline_threshold = 128; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, inline_threshold, CTLFLAG_RWTUN, &inline_threshold, 0, + "inline vs dsgl threshold (default=128)"); + + static void start_ep_timer(struct c4iw_ep *ep) { Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Dec 19 23:29:01 2018 (r342266) @@ -70,6 +70,9 @@ #define KTR_IW_CXGBE KTR_SPARE3 extern int c4iw_debug; +extern int use_dsgl; +extern int inline_threshold; + #define PDBG(fmt, args...) \ do { \ if (c4iw_debug) \ Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Wed Dec 19 23:29:01 2018 (r342266) @@ -45,9 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include "iw_cxgbe.h" -int use_dsgl = 1; #define T4_ULPTX_MIN_IO 32 #define C4IW_MAX_INLINE_SIZE 96 +#define T4_ULPTX_MAX_DMA 1024 static int mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) @@ -57,10 +57,60 @@ mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) } static int -write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +_c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr, u32 len, + void *data, int wait) { struct adapter *sc = rdev->adap; struct ulp_mem_io *ulpmc; + struct ulptx_sgl *sgl; + u8 wr_len; + int ret = 0; + struct c4iw_wr_wait wr_wait; + struct wrqe *wr; + + addr &= 0x7FFFFFF; + + if (wait) + c4iw_init_wr_wait(&wr_wait); + wr_len = roundup(sizeof *ulpmc + sizeof *sgl, 16); + + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); + if (wr == NULL) + return -ENOMEM; + ulpmc = wrtod(wr); + + memset(ulpmc, 0, wr_len); + INIT_ULPTX_WR(ulpmc, wr_len, 0, 0); + ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | + (wait ? F_FW_WR_COMPL : 0)); + ulpmc->wr.wr_lo = wait ? (u64)(unsigned long)&wr_wait : 0; + ulpmc->wr.wr_mid = cpu_to_be32(V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16))); + ulpmc->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | + V_T5_ULP_MEMIO_ORDER(1) | + V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id)); + ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5)); + ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16)); + ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr)); + + sgl = (struct ulptx_sgl *)(ulpmc + 1); + sgl->cmd_nsge = cpu_to_be32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | + V_ULPTX_NSGE(1)); + sgl->len0 = cpu_to_be32(len); + sgl->addr0 = cpu_to_be64((u64)data); + + t4_wrq_tx(sc, wr); + + if (wait) + ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, NULL, __func__); + return ret; +} + + +static int +_c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +{ + struct adapter *sc = rdev->adap; + struct ulp_mem_io *ulpmc; struct ulptx_idata *ulpsc; u8 wr_len, *to_dp, *from_dp; int copy_len, num_wqe, i, ret = 0; @@ -84,7 +134,7 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) - return (0); + return -ENOMEM; ulpmc = wrtod(wr); memset(ulpmc, 0, wr_len); @@ -93,7 +143,8 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 if (i == (num_wqe-1)) { ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | F_FW_WR_COMPL); - ulpmc->wr.wr_lo = (__force __be64)(unsigned long) &wr_wait; + ulpmc->wr.wr_lo = + (__force __be64)(unsigned long) &wr_wait; } else ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR)); ulpmc->wr.wr_mid = cpu_to_be32( @@ -126,6 +177,69 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, NULL, __func__); return ret; } + +static int +_c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +{ + struct c4iw_dev *rhp = rdev_to_c4iw_dev(rdev); + u32 remain = len; + u32 dmalen; + int ret = 0; + dma_addr_t daddr; + dma_addr_t save; + + daddr = dma_map_single(rhp->ibdev.dma_device, data, len, DMA_TO_DEVICE); + if (dma_mapping_error(rhp->ibdev.dma_device, daddr)) + return -1; + save = daddr; + + while (remain > inline_threshold) { + if (remain < T4_ULPTX_MAX_DMA) { + if (remain & ~T4_ULPTX_MIN_IO) + dmalen = remain & ~(T4_ULPTX_MIN_IO-1); + else + dmalen = remain; + } else + dmalen = T4_ULPTX_MAX_DMA; + remain -= dmalen; + ret = _c4iw_write_mem_dma_aligned(rdev, addr, dmalen, + (void *)daddr, !remain); + if (ret) + goto out; + addr += dmalen >> 5; + data = (u64 *)data + dmalen; + daddr = daddr + dmalen; + } + if (remain) + ret = _c4iw_write_mem_inline(rdev, addr, remain, data); +out: + dma_unmap_single(rhp->ibdev.dma_device, save, len, DMA_TO_DEVICE); + return ret; +} + +/* + * write len bytes of data into addr (32B aligned address) + * If data is NULL, clear len byte of memory to zero. + */ +static int +write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, + void *data) +{ + if (rdev->adap->params.ulptx_memwrite_dsgl && use_dsgl) { + if (len > inline_threshold) { + if (_c4iw_write_mem_dma(rdev, addr, len, data)) { + log(LOG_ERR, "%s: dma map " + "failure (non fatal)\n", __func__); + return _c4iw_write_mem_inline(rdev, addr, len, + data); + } else + return 0; + } else + return _c4iw_write_mem_inline(rdev, addr, len, data); + } else + return _c4iw_write_mem_inline(rdev, addr, len, data); +} + /* * Build and write a TPT entry. Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Wed Dec 19 23:29:01 2018 (r342266) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "iw_cxgbe.h" #include "user.h" -extern int use_dsgl; + static int fastreg_support = 1; module_param(fastreg_support, int, 0644); MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default = 1)"); Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Wed Dec 19 23:29:01 2018 (r342266) @@ -65,7 +65,7 @@ struct cpl_set_tcb_rpl; #include "iw_cxgbe.h" #include "user.h" -extern int use_dsgl; + static int creds(struct toepcb *toep, struct inpcb *inp, size_t wrsize); static int max_fr_immd = T4_MAX_FR_IMMD;//SYSCTL parameter later... Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Dec 19 23:28:56 2018 (r342265) +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 19 23:29:01 2018 (r342266) @@ -4092,6 +4092,18 @@ get_params__post_init(struct adapter *sc) else sc->params.filter2_wr_support = 0; + /* + * Find out whether we're allowed to use the ULPTX MEMWRITE DSGL. + * This is queried separately for the same reason as other params above. + */ + param[0] = FW_PARAM_DEV(ULPTX_MEMWRITE_DSGL); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.ulptx_memwrite_dsgl = val[0] != 0; + else + sc->params.ulptx_memwrite_dsgl = false; + /* get capabilites */ bzero(&caps, sizeof(caps)); caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | From owner-svn-src-head@freebsd.org Thu Dec 20 01:00: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 4B873135027D; Thu, 20 Dec 2018 01:00:22 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E233882909; Thu, 20 Dec 2018 01:00:21 +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 D46AA1DD8B; Thu, 20 Dec 2018 01:00:21 +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 wBK10LwX019508; Thu, 20 Dec 2018 01:00:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK10Lbx019507; Thu, 20 Dec 2018 01:00:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812200100.wBK10Lbx019507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Dec 2018 01:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342270 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 342270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E233882909 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 01:00:22 -0000 Author: np Date: Thu Dec 20 01:00:21 2018 New Revision: 342270 URL: https://svnweb.freebsd.org/changeset/base/342270 Log: cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle through 4-tuples quickly. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 00:58:16 2018 (r342269) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 01:00:21 2018 (r342270) @@ -1273,6 +1273,9 @@ int inline_threshold = 128; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, inline_threshold, CTLFLAG_RWTUN, &inline_threshold, 0, "inline vs dsgl threshold (default=128)"); +static int reuseaddr = 0; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, reuseaddr, CTLFLAG_RWTUN, &reuseaddr, 0, + "Enable SO_REUSEADDR & SO_REUSEPORT socket options on all iWARP client connections(default = 0)"); static void start_ep_timer(struct c4iw_ep *ep) @@ -2519,8 +2522,9 @@ static int c4iw_sock_create(struct sockaddr_storage *laddr, struct socket **so) { int ret; - int size; + int size, on; struct socket *sock = NULL; + struct sockopt sopt; ret = sock_create_kern(laddr->ss_family, SOCK_STREAM, IPPROTO_TCP, &sock); @@ -2528,6 +2532,33 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc CTR2(KTR_IW_CXGBE, "%s:Failed to create TCP socket. err %d", __func__, ret); return ret; + } + + if (reuseaddr) { + bzero(&sopt, sizeof(struct sockopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_REUSEADDR; + on = 1; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof(on); + ret = sosetopt(sock, &sopt); + if (ret != 0) { + log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEADDR) " + "failed with %d.\n", __func__, sock, ret); + } + bzero(&sopt, sizeof(struct sockopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_REUSEPORT; + on = 1; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof(on); + ret = sosetopt(sock, &sopt); + if (ret != 0) { + log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEPORT) " + "failed with %d.\n", __func__, sock, ret); + } } ret = sobind(sock, (struct sockaddr *)laddr, curthread); From owner-svn-src-head@freebsd.org Thu Dec 20 01:05: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 528FA135066D; Thu, 20 Dec 2018 01:05:10 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19CD82F03; Thu, 20 Dec 2018 01:05:09 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D49141DF32; Thu, 20 Dec 2018 01:05:09 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBK159gZ024506; Thu, 20 Dec 2018 01:05:09 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK159bD024504; Thu, 20 Dec 2018 01:05:09 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201812200105.wBK159bD024504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 20 Dec 2018 01:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342271 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 342271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E19CD82F03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 01:05:10 -0000 Author: mw Date: Thu Dec 20 01:05:09 2018 New Revision: 342271 URL: https://svnweb.freebsd.org/changeset/base/342271 Log: Fix obtaining RSP address in TPM CRB for non-amd64 platforms On amd64 the RSP address can be read in single 8-byte transaction, which is obviously not possible on 32-bit platforms. Fix that by performing 2 4-byte read on them. Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/dev/tpm/tpm20.h head/sys/dev/tpm/tpm_crb.c Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Thu Dec 20 01:00:21 2018 (r342270) +++ head/sys/dev/tpm/tpm20.h Thu Dec 20 01:05:09 2018 (r342271) @@ -153,12 +153,14 @@ RD4(struct tpm_sc *sc, bus_size_t off) return (bus_read_4(sc->mem_res, off)); } +#ifdef __amd64__ static inline uint64_t RD8(struct tpm_sc *sc, bus_size_t off) { return (bus_read_8(sc->mem_res, off)); } +#endif static inline void WR1(struct tpm_sc *sc, bus_size_t off, uint8_t val) { Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Thu Dec 20 01:00:21 2018 (r342270) +++ head/sys/dev/tpm/tpm_crb.c Thu Dec 20 01:05:09 2018 (r342271) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #define TPM_CRB_CTRL_CMD_HADDR 0x60 #define TPM_CRB_CTRL_RSP_SIZE 0x64 #define TPM_CRB_CTRL_RSP_ADDR 0x68 +#define TPM_CRB_CTRL_RSP_HADDR 0x6c #define TPM_CRB_DATA_BUFFER 0x80 #define TPM_LOC_STATE_ESTB BIT(0) @@ -188,7 +189,12 @@ tpmcrb_attach(device_t dev) * addr is stored in two 4 byte neighboring registers, whereas RSP is * stored in a single 8 byte one. */ +#ifdef __amd64__ crb_sc->rsp_off = RD8(sc, TPM_CRB_CTRL_RSP_ADDR); +#else + crb_sc->rsp_off = RD4(sc, TPM_CRB_CTRL_RSP_ADDR); + crb_sc->rsp_off |= ((uint64_t) RD4(sc, TPM_CRB_CTRL_RSP_HADDR) << 32); +#endif crb_sc->cmd_off = RD4(sc, TPM_CRB_CTRL_CMD_LADDR); crb_sc->cmd_off |= ((uint64_t) RD4(sc, TPM_CRB_CTRL_CMD_HADDR) << 32); crb_sc->cmd_buf_size = RD4(sc, TPM_CRB_CTRL_CMD_SIZE); From owner-svn-src-head@freebsd.org Thu Dec 20 01:35: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 7B4491351726; Thu, 20 Dec 2018 01:35:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F78D84366; Thu, 20 Dec 2018 01:35:46 +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 147BE1E4CA; Thu, 20 Dec 2018 01:35:46 +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 wBK1ZjeE040843; Thu, 20 Dec 2018 01:35:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK1ZjhG040842; Thu, 20 Dec 2018 01:35:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812200135.wBK1ZjhG040842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Dec 2018 01:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342272 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 342272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F78D84366 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 01:35:46 -0000 Author: np Date: Thu Dec 20 01:35:45 2018 New Revision: 342272 URL: https://svnweb.freebsd.org/changeset/base/342272 Log: cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 01:05:09 2018 (r342271) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 01:35:45 2018 (r342272) @@ -841,7 +841,7 @@ setiwsockopt(struct socket *so) sopt.sopt_val = (caddr_t)&on; sopt.sopt_valsize = sizeof on; sopt.sopt_td = NULL; - rc = sosetopt(so, &sopt); + rc = -sosetopt(so, &sopt); if (rc) { log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); @@ -1651,7 +1651,7 @@ send_abort(struct c4iw_ep *ep) sopt.sopt_val = (caddr_t)&l; sopt.sopt_valsize = sizeof l; sopt.sopt_td = NULL; - rc = sosetopt(so, &sopt); + rc = -sosetopt(so, &sopt); if (rc != 0) { log(LOG_ERR, "%s: sosetopt(%p, linger = 0) failed with %d.\n", __func__, so, rc); @@ -2542,7 +2542,7 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc on = 1; sopt.sopt_val = &on; sopt.sopt_valsize = sizeof(on); - ret = sosetopt(sock, &sopt); + ret = -sosetopt(sock, &sopt); if (ret != 0) { log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEADDR) " "failed with %d.\n", __func__, sock, ret); @@ -2554,14 +2554,14 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc on = 1; sopt.sopt_val = &on; sopt.sopt_valsize = sizeof(on); - ret = sosetopt(sock, &sopt); + ret = -sosetopt(sock, &sopt); if (ret != 0) { log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEPORT) " "failed with %d.\n", __func__, sock, ret); } } - ret = sobind(sock, (struct sockaddr *)laddr, curthread); + ret = -sobind(sock, (struct sockaddr *)laddr, curthread); if (ret) { CTR2(KTR_IW_CXGBE, "%s:Failed to bind socket. err %p", __func__, ret); @@ -2745,7 +2745,7 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog goto fail; } - rc = solisten(lep->com.so, backlog, curthread); + rc = -solisten(lep->com.so, backlog, curthread); if (rc) { CTR3(KTR_IW_CXGBE, "%s:Failed to listen on sock:%p. err %d", __func__, lep->com.so, rc); From owner-svn-src-head@freebsd.org Thu Dec 20 05:46: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 AC0031335152; Thu, 20 Dec 2018 05:46:57 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5224D8DB4C; Thu, 20 Dec 2018 05:46:57 +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 3E2E621412; Thu, 20 Dec 2018 05:46:57 +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 wBK5ku3W074790; Thu, 20 Dec 2018 05:46:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK5kugB074789; Thu, 20 Dec 2018 05:46:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812200546.wBK5kugB074789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Dec 2018 05:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342275 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 342275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5224D8DB4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 05:46:57 -0000 Author: imp Date: Thu Dec 20 05:46:56 2018 New Revision: 342275 URL: https://svnweb.freebsd.org/changeset/base/342275 Log: Fix panic message when we can't create thread for one wire temperature reading. Modified: head/sys/dev/ow/ow_temp.c Modified: head/sys/dev/ow/ow_temp.c ============================================================================== --- head/sys/dev/ow/ow_temp.c Thu Dec 20 03:10:23 2018 (r342274) +++ head/sys/dev/ow/ow_temp.c Thu Dec 20 05:46:56 2018 (r342275) @@ -232,7 +232,7 @@ ow_temp_attach(device_t dev) if (kproc_create(ow_temp_event_thread, sc, &sc->event_thread, 0, 0, "%s event thread", device_get_nameunit(dev))) { device_printf(dev, "unable to create event thread.\n"); - panic("cbb_create_event_thread"); + panic("ow_temp_attach, can't create thread"); } return 0; From owner-svn-src-head@freebsd.org Thu Dec 20 15:53: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 C675A134B425; Thu, 20 Dec 2018 15:53:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A009862DB; Thu, 20 Dec 2018 15:53:28 +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 30B0827D01; Thu, 20 Dec 2018 15:53:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKFrRRm097885; Thu, 20 Dec 2018 15:53:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKFrR33097884; Thu, 20 Dec 2018 15:53:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812201553.wBKFrR33097884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Dec 2018 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342279 - head/release X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 342279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A009862DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 15:53:28 -0000 Author: emaste Date: Thu Dec 20 15:53:27 2018 New Revision: 342279 URL: https://svnweb.freebsd.org/changeset/base/342279 Log: Remove setting of long-unused MK_NCP option NCP was removed from the tree in 2013 (r248097) and disconnected some time before. Reported by: bz Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Dec 20 08:45:41 2018 (r342278) +++ head/release/Makefile Thu Dec 20 15:53:27 2018 (r342279) @@ -194,7 +194,7 @@ disc1: packagesystem cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/${.TARGET} MK_AMD=no MK_AT=no \ MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ - MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ + MK_TOOLCHAIN=no MK_PROFILE=no \ MK_RESCUE=no MK_DICT=no \ MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \ -DDB_FROM_SRC @@ -224,7 +224,7 @@ bootonly: packagesystem DESTDIR=${.OBJDIR}/${.TARGET} MK_AMD=no MK_AT=no \ MK_GAMES=no \ MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ - MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ + MK_TOOLCHAIN=no MK_PROFILE=no \ MK_RESCUE=no MK_DICT=no \ MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \ -DDB_FROM_SRC From owner-svn-src-head@freebsd.org Thu Dec 20 16:05: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 178CD134B954; Thu, 20 Dec 2018 16:05:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8394869CF; Thu, 20 Dec 2018 16:05:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5207027EAC; Thu, 20 Dec 2018 16:05:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKG5VmC003489; Thu, 20 Dec 2018 16:05:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKG5VcH003488; Thu, 20 Dec 2018 16:05:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201812201605.wBKG5VcH003488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 20 Dec 2018 16:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342280 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 342280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8394869CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 16:05:32 -0000 Author: tuexen Date: Thu Dec 20 16:05:30 2018 New Revision: 342280 URL: https://svnweb.freebsd.org/changeset/base/342280 Log: Fix a regression in the TCP handling of received segments. When receiving TCP segments the stack protects itself by limiting the resources allocated for a TCP connections. This patch adds an exception to these limitations for the TCP segement which is the next expected in-sequence segment. Without this patch, TCP connections may stall and finally fail in some cases of packet loss. Reported by: jhb@ Reviewed by: jtl@, rrs@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18580 Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Dec 20 15:53:27 2018 (r342279) +++ head/sys/netinet/tcp_reass.c Thu Dec 20 16:05:30 2018 (r342280) @@ -579,7 +579,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq */ lenofoh = tcp_reass_overhead_of_chain(m, &mlast); sb = &tp->t_inpcb->inp_socket->so_rcv; - if ((sb->sb_mbcnt + tp->t_segqmbuflen + lenofoh) > sb->sb_mbmax) { + if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && + (sb->sb_mbcnt + tp->t_segqmbuflen + lenofoh) > sb->sb_mbmax) { /* No room */ TCPSTAT_INC(tcps_rcvreassfull); #ifdef TCP_REASS_COUNTERS @@ -588,6 +589,11 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq #ifdef TCP_REASS_LOGGING tcp_log_reassm(tp, NULL, NULL, th->th_seq, lenofoh, TCP_R_LOG_LIMIT_REACHED, 0); #endif + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: mbuf count limit reached, " + "segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } m_freem(m); *tlenp = 0; #ifdef TCP_REASS_LOGGING @@ -936,6 +942,20 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq * is understood. */ new_entry: + if (th->th_seq == tp->rcv_nxt && TCPS_HAVEESTABLISHED(tp->t_state)) { + tp->rcv_nxt += *tlenp; + flags = th->th_flags & TH_FIN; + TCPSTAT_INC(tcps_rcvoopack); + TCPSTAT_ADD(tcps_rcvoobyte, *tlenp); + SOCKBUF_LOCK(&so->so_rcv); + if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { + m_freem(m); + } else { + sbappendstream_locked(&so->so_rcv, m, 0); + } + sorwakeup_locked(so); + return (flags); + } if (tcp_new_limits) { if ((tp->t_segqlen > tcp_reass_queue_guard) && (*tlenp < MSIZE)) { @@ -960,9 +980,7 @@ new_entry: return (0); } } else { - - if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + if (tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; From owner-svn-src-head@freebsd.org Thu Dec 20 19:27: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 19808135147D; Thu, 20 Dec 2018 19:27:47 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1F218F2D1; Thu, 20 Dec 2018 19:27:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9A46B218D; Thu, 20 Dec 2018 19:27:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKJRkXs008525; Thu, 20 Dec 2018 19:27:46 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKJRk1a008524; Thu, 20 Dec 2018 19:27:46 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812201927.wBKJRk1a008524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 20 Dec 2018 19:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342282 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 342282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1F218F2D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 19:27:47 -0000 Author: bcran Date: Thu Dec 20 19:27:46 2018 New Revision: 342282 URL: https://svnweb.freebsd.org/changeset/base/342282 Log: Wait a maximum of 300 seconds for network send/recv in libsa The reason for this change is that currently, a send/recv takes many hours to time out. This is suboptimal in the bootloader because it means for example that NFS will take hours to fail before allowing subsequent access methods such as gzip to be tried. Setting MAXWAIT to 300 seconds (5 minutes) still allows slow connections of 1Mb to be used to download a 30MB kernel file. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18544 Modified: head/stand/libsa/net.c Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Thu Dec 20 18:28:53 2018 (r342281) +++ head/stand/libsa/net.c Thu Dec 20 19:27:46 2018 (r342282) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * timeout is hit. */ #ifndef MAXWAIT -#define MAXWAIT 0 /* seconds */ +#define MAXWAIT 300 /* seconds */ #endif #if MAXWAIT < 0 From owner-svn-src-head@freebsd.org Thu Dec 20 19:39: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 BE6161351A99; Thu, 20 Dec 2018 19:39:40 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7017468339; Thu, 20 Dec 2018 19:39:40 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 34D04234F; Thu, 20 Dec 2018 19:39:40 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKJdeFb015224; Thu, 20 Dec 2018 19:39:40 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKJdbhB015092; Thu, 20 Dec 2018 19:39:37 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812201939.wBKJdbhB015092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 20 Dec 2018 19:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 342283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7017468339 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 19:39:41 -0000 Author: bcran Date: Thu Dec 20 19:39:37 2018 New Revision: 342283 URL: https://svnweb.freebsd.org/changeset/base/342283 Log: Rework UEFI ESP generation Currently, the installer uses pre-created 800KB FAT12 filesystems that it dd's onto the ESP partition. This changeset improves that by having the installer generate a FAT32 filesystem directly onto the ESP using newfs_msdos and then copying loader.efi into /EFI/freebsd. For live installs it then runs efibootmgr to add a FreeBSD boot entry in the BIOS. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D17947 Modified: head/release/amd64/make-memstick.sh head/release/amd64/mkisoimages.sh head/release/arm64/make-memstick.sh head/release/i386/make-memstick.sh head/release/tools/vmimage.subr head/share/man/man8/uefi.8 head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh head/tools/tools/nanobsd/embedded/common head/usr.sbin/bsdinstall/partedit/gpart_ops.c head/usr.sbin/bsdinstall/partedit/partedit_arm64.c head/usr.sbin/bsdinstall/partedit/partedit_x86.c head/usr.sbin/bsdinstall/scripts/bootconfig head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/release/amd64/make-memstick.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -12,6 +12,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -36,11 +39,16 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local +# Make an ESP in a file. +espfilename=$(mktemp /tmp/efiboot.XXXXXX) +make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi + mkimg -s mbr \ -b ${1}/boot/mbr \ - -p efi:=${1}/boot/boot1.efifat \ + -p efi:=${espfilename} \ -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -a 2 \ -o ${2} +rm ${espfilename} rm ${2}.part Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/release/amd64/mkisoimages.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -25,6 +25,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + if [ -z $ETDUMP ]; then ETDUMP=etdump fi @@ -43,18 +46,12 @@ if [ "$1" = "-b" ]; then bootable="-o bootimage=i386;$BASEBITSDIR/boot/cdboot -o no-emul-boot" # Make EFI system partition (should be done with makefs in the future) - dd if=/dev/zero of=efiboot.img bs=4k count=200 - device=`mdconfig -a -t vnode -f efiboot.img` - newfs_msdos -F 12 -m 0xf8 /dev/$device - mkdir efi - mount -t msdosfs /dev/$device efi - mkdir -p efi/efi/boot - cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi - umount efi - rmdir efi - mdconfig -d -u $device - bootable="$bootable -o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi" - + # The ISO file is a special case, in that it only has a maximum of + # 800 KB available for the boot code. So make an 800 KB ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi + bootable="$bootable -o bootimage=i386;${espfilename} -o no-emul-boot -o platformid=efi" + shift else BASEBITSDIR="$3" @@ -73,7 +70,7 @@ publisher="The FreeBSD Project. https://www.FreeBSD.o echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" $MAKEFS -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" rm -f "$BASEBITSDIR/etc/fstab" -rm -f efiboot.img +rm -f ${espfilename} if [ "$bootable" != "" ]; then # Look for the EFI System Partition image we dropped in the ISO image. Modified: head/release/arm64/make-memstick.sh ============================================================================== --- head/release/arm64/make-memstick.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/release/arm64/make-memstick.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -15,6 +15,9 @@ set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + if [ $# -ne 2 ]; then echo "make-memstick.sh /path/to/directory /path/to/image/file" exit 1 @@ -36,9 +39,14 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local +# Make an ESP in a file. +espfilename=$(mktemp /tmp/efiboot.XXXXXX) +make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi + mkimg -s gpt \ - -p efi:=${1}/boot/boot1.efifat \ + -p efi:=${espfilename} \ -p freebsd:=${2}.part \ -o ${2} +rm ${espfilename} rm ${2}.part Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/release/i386/make-memstick.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -12,6 +12,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -36,9 +39,15 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local +# Make an ESP in a file. +espfilename=$(mktemp /tmp/efiboot.XXXXXX) +make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi + mkimg -s mbr \ -b ${1}/boot/mbr \ + -p efi:=${espfilename} -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} +rm ${espfilename} rm ${2}.part Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Thu Dec 20 19:27:46 2018 (r342282) +++ head/release/tools/vmimage.subr Thu Dec 20 19:39:37 2018 (r342283) @@ -6,6 +6,9 @@ # Common functions for virtual machine image build scripts. # +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" trap "cleanup" INT QUIT TRAP ABRT TERM @@ -29,10 +32,14 @@ write_partition_layout() { -o ${VMIMAGE} ;; arm64:aarch64) + # Create an ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi mkimg -s mbr -f ${VMFORMAT} \ - -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \ + -p efi:=${espfilename} \ -p freebsd:=${VMBASE} \ -o ${VMIMAGE} + rm ${espfilename} ;; powerpc:powerpc*) mkimg -s apm -f ${VMFORMAT} \ Modified: head/share/man/man8/uefi.8 ============================================================================== --- head/share/man/man8/uefi.8 Thu Dec 20 19:27:46 2018 (r342282) +++ head/share/man/man8/uefi.8 Thu Dec 20 19:39:37 2018 (r342283) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2018 +.Dd December 14, 2018 .Dt UEFI 8 .Os .Sh NAME @@ -77,20 +77,16 @@ The default boot configuration for .Fx installs -.Pa boot1.efi +.Pa loader.efi in the default path. .It -.Pa boot1.efi +.Pa loader.efi reads boot configuration from .Pa /boot.config or .Pa /boot/config . -Unlike other first-stage boot loaders, -.Pa boot1.efi -passes the configuration to the next stage boot loader and does not -itself act on the contents of the file. .It -.Pa boot1.efi +.Pa loader.efi searches partitions of type .Li freebsd-ufs and @@ -98,7 +94,7 @@ and for .Pa loader.efi . The search begins with partitions on the device from which -.Pa boot1.efi +.Pa loader.efi was loaded, and continues with other available partitions. If both .Li freebsd-ufs @@ -107,9 +103,6 @@ and partitions exist on the same device the .Li freebsd-zfs partition is preferred. -.Pa boot1.efi -then loads and executes -.Pa loader.efi . .It .Pa loader.efi loads and boots the kernel, as described in @@ -122,20 +115,8 @@ system console is automatically selected when booting .Nm . .Sh FILES .Bl -tag -width /boot/loader -compact -.It Pa /boot/boot1.efi -First stage .Nm bootstrap -.It Pa /boot/boot1.efifat -.Xr msdosfs 5 -FAT file system image containing -.Pa boot1.efi -for use by -.Xr bsdinstall 8 -and the -.Ar bootcode -argument to -.Xr gpart 8 . .It Pa /boot/loader.efi Final stage bootstrap .It Pa /boot/kernel/kernel Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/tools/boot/install-boot.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -10,6 +10,10 @@ # insert code here to guess what you have -- yikes! +# Minimum size of FAT filesystems, in KB. +fat32min=33292 +fat16min=2100 + die() { echo $* exit 1 @@ -27,21 +31,152 @@ find-part() { gpart show $dev | tail +2 | awk '$4 == "'$part'" { print $3; }' } -make_esp() { - local dev dst mntpt +get_uefi_bootname() { + case ${TARGET:-$(uname -m)} in + amd64) echo bootx64 ;; + arm64) echo bootaa64 ;; + i386) echo bootia32 ;; + arm) echo bootarm ;; + *) die "machine type $(uname -m) doesn't support UEFI" ;; + esac +} + +make_esp_file() { + local file sizekb loader device mntpt fatbits efibootname + + file=$1 + sizekb=$2 + loader=$3 + + if [ "$sizekb" -ge "$fat32min" ]; then + fatbits=32 + elif [ "$sizekb" -ge "$fat16min" ]; then + fatbits=16 + else + fatbits=12 + fi + + dd if=/dev/zero of="${file}" bs=1k count="${sizekb}" + device=$(mdconfig -a -t vnode -f "${file}") + newfs_msdos -F "${fatbits}" -c 1 -L EFISYS "/dev/${device}" > /dev/null 2>&1 + mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + mount -t msdosfs "/dev/${device}" "${mntpt}" + mkdir -p "${mntpt}/EFI/BOOT" + efibootname=$(get_uefi_bootname) + cp "${loader}" "${mntpt}/EFI/BOOT/${efibootname}.efi" + umount "${mntpt}" + rmdir "${mntpt}" + mdconfig -d -u "${device}" +} + +make_esp_device() { + local dev file mntpt fstype efibootname kbfree loadersize efibootfile + local isboot1 existingbootentryloaderfile bootorder bootentry + + # ESP device node dev=$1 - dst=$2 + file=$2 - newfs_msdos -a 32 ${dev} mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) - mount -t msdos ${dev} ${mntpt} - mkdir -p ${mntpt}/efi/boot - cp ${dst}/boot/loader.efi ${mntpt}/efi/boot/bootx64.efi - umount ${mntpt} - rmdir ${mntpt} + + # See if we're using an existing (formatted) ESP + fstype=$(fstyp "${dev}") + + if [ "${fstype}" != "msdosfs" ]; then + newfs_msdos -F 32 -c 1 -L EFISYS "${dev}" > /dev/null 2>&1 + fi + + mount -t msdosfs "${dev}" "${mntpt}" + if [ $? -ne 0 ]; then + die "Failed to mount ${dev} as an msdosfs filesystem" + fi + + echo "Mounted ESP ${dev} on ${mntpt}" + + efibootname=$(get_uefi_bootname) + kbfree=$(df -k "${mntpt}" | tail -1 | cut -w -f 4) + loadersize=$(stat -f %z "${file}") + loadersize=$((loadersize / 1024)) + + # Check if /EFI/BOOT/BOOTxx.EFI is the FreeBSD boot1.efi + # If it is, remove it to avoid leaving stale files around + efibootfile="${mntpt}/EFI/BOOT/${efibootname}.efi" + if [ -f "${efibootfile}" ]; then + isboot1=$(strings "${efibootfile}" | grep "FreeBSD EFI boot block") + + if [ -n "${isboot1}" ] && [ "$kbfree" -lt "${loadersize}" ]; then + echo "Only ${kbfree}KB space remaining: removing old FreeBSD boot1.efi file /EFI/BOOT/${efibootname}.efi" + rm "${efibootfile}" + rmdir "${mntpt}/EFI/BOOT" + else + echo "${kbfree}KB space remaining on ESP: renaming old boot1.efi file /EFI/BOOT/${efibootname}.efi /EFI/BOOT/${efibootname}-old.efi" + mv "${efibootfile}" "${mntpt}/EFI/BOOT/${efibootname}-old.efi" + fi + fi + + if [ ! -f "${mntpt}/EFI/freebsd/loader.efi" ] && [ "$kbfree" -lt "$loadersize" ]; then + umount "${mntpt}" + rmdir "${mntpt}" + echo "Failed to update the EFI System Partition ${dev}" + echo "Insufficient space remaining for ${file}" + echo "Run e.g \"mount -t msdosfs ${dev} /mnt\" to inspect it for files that can be removed." + die + fi + + mkdir -p "${mntpt}/EFI/freebsd" + + # Keep a copy of the existing loader.efi in case there's a problem with the new one + if [ -f "${mntpt}/EFI/freebsd/loader.efi" ] && [ "$kbfree" -gt "$((loadersize * 2))" ]; then + cp "${mntpt}/EFI/freebsd/loader.efi" "${mntpt}/EFI/freebsd/loader-old.efi" + fi + + echo "Copying loader to /EFI/freebsd on ESP" + cp "${file}" "${mntpt}/EFI/freebsd/loader.efi" + + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/loader.efi") + + if [ -z "$existingbootentryloaderfile" ]; then + # Try again without the double forward-slash in the path + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/loader.efi") + fi + + if [ -z "$existingbootentryloaderfile" ]; then + echo "Creating UEFI boot entry for FreeBSD" + efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + if [ $? -ne 0 ]; then + die "Failed to create new boot entry" + fi + + # When creating new entries, efibootmgr doesn't mark them active, so we need to + # do so. It doesn't make it easy to find which entry it just added, so rely on + # the fact that it places the new entry first in BootOrder. + bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) + bootentry=$(echo "${bootorder}" | cut -w -f 3)$(echo "${bootorder}" | cut -w -f 2) + echo "Marking UEFI boot entry ${bootentry} active" + efibootmgr --activate "${bootentry}" > /dev/null + else + echo "Existing UEFI FreeBSD boot entry found: not creating a new one" + fi + + umount "${mntpt}" + rmdir "${mntpt}" + echo "Finished updating ESP" } +make_esp() { + local file loaderfile + + file=$1 + loaderfile=$2 + + if [ -f "$file" ]; then + make_esp_file ${file} ${fat32min} ${loaderfile} + else + make_esp_device ${file} ${loaderfile} + fi +} + make_esp_mbr() { dev=$1 dst=$2 @@ -53,7 +188,7 @@ make_esp_mbr() { die "No ESP slice found" fi fi - make_esp /dev/${dev}s${s} ${dst} + make_esp /dev/${dev}s${s} ${dst}/boot/loader.efi } make_esp_gpt() { @@ -64,7 +199,7 @@ make_esp_gpt() { if [ -z "$idx" ] ; then die "No ESP partition found" fi - make_esp /dev/${dev}p${idx} ${dst} + make_esp /dev/${dev}p${idx} ${dst}/boot/loader.efi } boot_nogeli_gpt_ufs_legacy() { @@ -218,18 +353,32 @@ boot_nogeli_vtoc8_ufs_ofw() { doit gpart bootcode -p ${vtoc8} ${dev} } -DESTDIR=/ +usage() { + printf 'Usage: %s -b bios [-d destdir] -f fs [-g geli] [-h] [-o optargs] -s scheme \n' "$0" + printf 'Options:\n' + printf ' bootdev device to install the boot code on\n' + printf ' -b bios bios type: legacy, uefi or both\n' + printf ' -d destdir destination filesystem root\n' + printf ' -f fs filesystem type: ufs or zfs\n' + printf ' -g geli yes or no\n' + printf ' -h this help/usage text\n' + printf ' -o optargs optional arguments\n' + printf ' -s scheme mbr or gpt\n' + exit 0 +} +srcroot=/ + # Note: we really don't support geli boot in this script yet. geli=nogeli -while getopts "b:d:f:g:o:s:" opt; do +while getopts "b:d:f:g:ho:s:" opt; do case "$opt" in b) bios=${OPTARG} ;; d) - DESTDIR=${OPTARG} + srcroot=${OPTARG} ;; f) fs=${OPTARG} @@ -246,25 +395,35 @@ while getopts "b:d:f:g:o:s:" opt; do s) scheme=${OPTARG} ;; + + ?|h) + usage + ;; esac done -shift $((OPTIND-1)) -dev=$1 +if [ -n "${scheme}" ] && [ -n "${fs}" ] && [ -n "${bios}" ]; then + shift $((OPTIND-1)) + dev=$1 +fi # For gpt, we need to install pmbr as the primary boot loader # it knows about -gpt0=${DESTDIR}/boot/pmbr -gpt2=${DESTDIR}/boot/gptboot -gptzfs2=${DESTDIR}/boot/gptzfsboot +gpt0=${srcroot}/boot/pmbr +gpt2=${srcroot}/boot/gptboot +gptzfs2=${srcroot}/boot/gptzfsboot # For MBR, we have lots of choices, but select mbr, boot0 has issues with UEFI -mbr0=${DESTDIR}/boot/mbr -mbr2=${DESTDIR}/boot/boot +mbr0=${srcroot}/boot/mbr +mbr2=${srcroot}/boot/boot # VTOC8 -vtoc8=${DESTDIR}/boot/boot1 +vtoc8=${srcroot}/boot/boot1 # sanity check here -eval boot_${geli}_${scheme}_${fs}_${bios} $dev $DESTDIR $opts || echo "Unsupported boot env: ${geli}-${scheme}-${fs}-${bios}" +# Check if we've been given arguments. If not, this script is probably being +# sourced, so we shouldn't run anything. +if [ -n "${dev}" ]; then + eval boot_${geli}_${scheme}_${fs}_${bios} $dev $srcroot $opts || echo "Unsupported boot env: ${geli}-${scheme}-${fs}-${bios}" +fi Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Thu Dec 20 19:27:46 2018 (r342282) +++ head/tools/boot/rootgen.sh Thu Dec 20 19:39:37 2018 (r342283) @@ -5,7 +5,8 @@ passphrase=passphrase iterations=50000 -do_boot1_efi=0 +# The smallest FAT32 filesystem is 33292 KB +espsize=33292 # # Builds all the bat-shit crazy combinations we support booting from, @@ -16,13 +17,13 @@ do_boot1_efi=0 # Sad panda sez: this runs as root, but could be userland if someone # creates userland geli and zfs tools. # -# This assumes an external prograam install-boot.sh which will install +# This assumes an external program install-boot.sh which will install # the appropriate boot files in the appropriate locations. # # These images assume ada0 will be the root image. We should likely # use labels, but we don't. # -# ASsumes you've already rebuilt... maybe bad? Also maybe bad: the env +# Assumes you've already rebuilt... maybe bad? Also maybe bad: the env # vars should likely be conditionally set to allow better automation. # @@ -34,29 +35,6 @@ cpsys() { (cd $src ; tar cf - .) | (cd $dst; tar xf -) } -make_esp() -{ - local src dst md mntpt - src=$1 - dst=$2 - - if [ "${do_boot1_efi}" -eq 1 ]; then - cp ${src}/boot/boot1.efifat ${dst} - else - dd if=/dev/zero of=${dst} count=1 seek=$((100 * 1024 * 1024 / 512)) - md=$(mdconfig -f ${dst}) - newfs_msdos -a 32 /dev/${md} - mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) - mount -t msdos /dev/${md} ${mntpt} -# mkdir -p ${mntpt}/efi/freebsd # not yet - mkdir -p ${mntpt}/efi/boot - cp ${src}/boot/loader.efi ${mntpt}/efi/boot/bootx64.efi - umount ${mntpt} - rmdir ${mntpt} - mdconfig -d -u ${md} - fi -} - mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 @@ -78,7 +56,7 @@ mk_nogeli_gpt_ufs_uefi() { cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < #include #include +#include #include #include @@ -192,7 +193,9 @@ newfs_command(const char *fstype, char *command, int u for (i = 0; i < (int)nitems(items); i++) { if (items[i].state == 0) continue; - if (strcmp(items[i].name, "FAT16") == 0) + if (strcmp(items[i].name, "FAT32") == 0) + strcat(command, "-F 32 -c 1"); + else if (strcmp(items[i].name, "FAT16") == 0) strcat(command, "-F 16 "); else if (strcmp(items[i].name, "FAT12") == 0) strcat(command, "-F 12 "); @@ -400,7 +403,7 @@ gpart_bootcode(struct ggeom *gp) TRUE); return; } - + bootsize = lseek(bootfd, 0, SEEK_END); boot = malloc(bootsize); lseek(bootfd, 0, SEEK_SET); @@ -706,8 +709,17 @@ set_default_part_metadata(const char *name, const char if (strcmp(type, "freebsd-swap") == 0) mountpoint = "none"; if (strcmp(type, bootpart_type(scheme, &default_bootmount)) == 0) { - if (default_bootmount == NULL) + if (default_bootmount == NULL) { + + int fd = open("/tmp/bsdinstall-esps", O_CREAT | O_WRONLY | O_APPEND, + 0600); + if (fd > 0) { + write(fd, md->name, strlen(md->name)); + close(fd); + } + md->bootcode = 1; + } else if (mountpoint == NULL || strlen(mountpoint) == 0) mountpoint = default_bootmount; } Modified: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Thu Dec 20 19:27:46 2018 (r342282) +++ head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Thu Dec 20 19:39:37 2018 (r342283) @@ -35,8 +35,7 @@ #include "partedit.h" /* EFI partition size in bytes */ -#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) -#define EFI_BOOTPART_PATH "/boot/boot1.efifat" +#define EFI_BOOTPART_SIZE (260 * 1024 * 1024) const char * default_scheme(void) @@ -95,10 +94,7 @@ const char * partcode_path(const char *part_type, const char *fs_type) { - if (strcmp(part_type, "GPT") == 0) - return (EFI_BOOTPART_PATH); - - /* No boot partition data for non-GPT */ + /* No boot partition data for ARM64 */ return (NULL); } Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Dec 20 19:27:46 2018 (r342282) +++ head/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Dec 20 19:39:37 2018 (r342283) @@ -35,8 +35,7 @@ #include "partedit.h" /* EFI partition size in bytes */ -#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) -#define EFI_BOOTPART_PATH "/boot/boot1.efifat" +#define EFI_BOOTPART_SIZE (260 * 1024 * 1024) static const char * x86_bootmethod(void) @@ -141,16 +140,14 @@ const char * partcode_path(const char *part_type, const char *fs_type) { - if (strcmp(part_type, "GPT") == 0) { - if (strcmp(x86_bootmethod(), "UEFI") == 0) - return (EFI_BOOTPART_PATH); - else if (strcmp(fs_type, "zfs") == 0) + if (strcmp(part_type, "GPT") == 0 && strcmp(x86_bootmethod(), "UEFI") != 0) { + if (strcmp(fs_type, "zfs") == 0) return ("/boot/gptzfsboot"); else return ("/boot/gptboot"); } - /* No partcode except for GPT */ + /* No partcode except for non-UEFI GPT */ return (NULL); } Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Thu Dec 20 19:27:46 2018 (r342282) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Thu Dec 20 19:39:37 2018 (r342283) @@ -1,5 +1,6 @@ #!/bin/sh #- +# Copyright (c) 2018 Rebecca Cran # Copyright (c) 2017 Nathan Whitehorn # All rights reserved. # @@ -26,6 +27,11 @@ # # $FreeBSD$ +die() { + echo $* + exit 1 +} + if [ `uname -m` == powerpc ]; then platform=`sysctl -n hw.platform` if [ "$platform" == ps3 -o "$platform" == powernv ]; then @@ -35,6 +41,115 @@ if [ `uname -m` == powerpc ]; then fi fi -# For new-style EFI booting, add code here -# Add boot0cfg for MBR BIOS booting? +# Update the ESP (EFI System Partition) with the new bootloader +if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i386" ]; then + X86_BOOTMETHOD=$(sysctl -n machdep.bootmethod) +fi +if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then + UFSBOOT_ESPS=$(cat /tmp/bsdinstall-esps) + num_esps=0 + + if [ -n "$ZFSBOOT_DISKS" ]; then + # We're in a ZFS install environment + for disk in $ZFSBOOT_DISKS; do + index=$(gpart show "$disk" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) + # Check that $index is an integer + [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null + if [ $? -ne 0 ]; then + continue + fi + + if [ -e "/dev/${disk}p${index}" ]; then + ESPS="$ESPS ${disk}p${index}" + elif [ -e "/dev/${disk}s${index}" ]; then + ESPS="$ESPS ${disk}s${index}" + else + continue + fi + + num_esps=$((num_esps + 1)) + done + fi + + if [ -n "$UFSBOOT_ESPS" ]; then + # We're in a UFS install environment + for partition in $UFSBOOT_ESPS; do + ESPS="$ESPS $partition" + num_esps=$((num_esps + 1)) + done + fi + + if [ -z "$ESPS" ]; then + # The installer hasn't given us any ESPs to use. + # Try and figure out which to use by looking for an + # unformatted efi partition + for disk in $(sysctl -n kern.disks); do + hasfreebsd=$(gpart show "$disk" | cut -w -f 4,5 | grep "freebsd") + if [ -n "$hasfreebsd" ]; then + index=$(gpart show "$disk" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) + # Check that $index is a valid integer + [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null + if [ $? -ne 0 ]; then + continue + fi + + mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + if [ -e "/dev/${disk}p${index}" ]; then + dev=${disk}p${index} + elif [ -e "/dev/${disk}s${index}" ]; then + dev=/${disk}s${index} + else + continue + fi + + # Try and mount it. If it fails, assume it's + # unformatted and should be used. + mount -t msdosfs "/dev/${dev}" "${mntpt}" + if [ $? -ne 0 ]; then + ESPS="$ESPS ${dev}" + num_esps=$((num_esps + 1)) + else + umount "${mntpt}" + fi + rmdir "${mntpt}" + fi + done + fi + + for esp in $ESPS; do + newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 + if [ $? -ne 0 ]; then + die "Failed to format ESP $esp as FAT32" + fi + + mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + mount -t msdosfs "/dev/${esp}" "${mntpt}" + if [ $? -ne 0 ]; then + die "Failed to mount ESP ${dev} on ${mntpt}" + fi + + mkdir -p "$mntpt/EFI/freebsd" + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" + + if [ "$num_esps" -gt 1 ]; then + bootlabel="FreeBSD (${esp})" + else + bootlabel="FreeBSD" + fi + + efibootmgr --create --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + + umount "${mntpt}" + rmdir "${mntpt}" + + # When creating new entries, efibootmgr doesn't mark them active, so we need to + # do so. It doesn't make it easy to find which entry it just added, so rely on + # the fact that it places the new entry first in BootOrder. + bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) + bootentry=$(echo "$bootorder" | cut -w -f 3)$(echo "$bootorder" | cut -w -f 2) + efibootmgr --activate "$bootentry" > /dev/null + done +fi + +# Add boot0cfg for MBR BIOS booting? Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 20 19:27:46 2018 (r342282) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 20 19:39:37 2018 (r342283) @@ -213,7 +213,6 @@ KLDLOAD='kldload %s' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' -NEWFS_ESP='newfs_msdos -F %s -L "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' @@ -851,29 +850,7 @@ zfs_create_diskpart() "$align_small" efiboot$index efi 200M \ $disk || return $FAILURE - f_eval_catch $funcname mkdir "$MKDIR_P" \ - "$BSDINSTALL_TMPETC/esp" || - return $FAILURE - f_eval_catch $funcname newfs_msdos "$NEWFS_ESP" "16" \ - "EFISYS" "/dev/${disk}p1" || - return $FAILURE - f_eval_catch $funcname mount "$MOUNT_TYPE" "msdosfs" \ - "/dev/${disk}p1" \ - "$BSDINSTALL_TMPETC/esp" || - return $FAILURE - f_eval_catch $funcname mkdir "$MKDIR_P" \ - "$BSDINSTALL_TMPETC/esp/efi/boot" || - return $FAILURE - f_eval_catch $funcname cp "$COPY" "/boot/loader.efi" \ - "$BSDINSTALL_TMPETC/esp/efi/boot/$ZFSBOOT_ESP_NAME" || - return $FAILURE - f_eval_catch $funcname echo "$ECHO_OVERWRITE" \ - "$ZFSBOOT_ESP_NAME" \ - "$BSDINSTALL_TMPETC/esp/efi/boot/startup.nsh" || - return $FAILURE - f_eval_catch $funcname umount "$UMOUNT" \ - "$BSDINSTALL_TMPETC/esp" || - return $FAILURE + # We'll configure the ESP in bootconfig fi if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o \ @@ -1593,20 +1570,6 @@ arm64) : ${ZFSBOOT_PARTITION_SCHEME:=GPT} fi ;; -esac - -# -# The EFI loader installed in the ESP (EFI System Partition) must -# have the expected name in order to load correctly. -# -[ "$ZFSBOOT_ESP_NAME" ] || case "${UNAME_m:-$( uname -m )}" in - arm64) ZFSBOOT_ESP_NAME=BOOTaa64.efi ;; - arm) ZFSBOOT_ESP_NAME=BOOTarm.efi ;; - i386) ZFSBOOT_ESP_NAME=BOOTia32.efi ;; - amd64) ZFSBOOT_ESP_NAME=BOOTx64.efi ;; - *) - f_dprintf "Unsupported architecture: %s" $UNAME_m - f_die esac *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Dec 20 19:50: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 B7A451351FA3 for ; Thu, 20 Dec 2018 19:50:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 2243F6A3D6 for ; Thu, 20 Dec 2018 19:50:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x332.google.com with SMTP id p6so3520608wmc.1 for ; Thu, 20 Dec 2018 11:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MQQkGCRQFCzY6PkDfxmiRGhGmUC6sW+EMKwcxrSoG5o=; b=HdQlod/ShqqF4xv+mjQrEQ5On+y9k93Pz1YQQ71O/wRBK6V5MMPai/RHtsP4gOBBgr 0OqzwGXTPXEaul63GnyihFExOJT8vfd7LMXZhL8fESUnO+g3NYWmEKBlx+SaWtowgYUj +keb52dfnJGTZkCYUxeRQpuugYYDru8h1IG49Cc/xKjLtcU+yuuMQFLJ8o35TvWPCqPT gWrgzU1xvby/ovwajVJuLJY5Qq5cFIhYO4MxzcL0DAO1u9KPjhsawP7ze2z0SZZ9wX0X 8koC2AdsAypmyYtNQPiJ/3SYcnCpCFsy1RNj0mdOCo0vLFmz83Emkv2Y7wxRiCtQJsE0 Xvuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MQQkGCRQFCzY6PkDfxmiRGhGmUC6sW+EMKwcxrSoG5o=; b=ZKjtQ24SyiNnpSRGhUovC7S5V8nOq6X/clk+HrUGUDq2vEbldMITTePSU0Q40tMXCF V/kN7SfwrbLDkNqB2n9ivzadK9gubHlZZSMxmjg2EkPU/ignf/Lo8p+7OVpBojcPJmsH zDn03+JjwmUK87E4NOUlhcXvYxnk72Ot6LMLriu8IHTJ+5nPu+rSOMuUJmzzbYebA06F gIDmcDYiotzIhY0WLBV9m3mb1TiMnC5Mro+ul4Zx5ERhYOZ7gBaxR/BEL3d8rUMCUERj 6Yj9l71q2+nBp38rL9cBGlSvwgTLYP4wqK2v1H3bRew4ax0mLYRWpyKp1IRmgXs8EHx8 CTCw== X-Gm-Message-State: AA+aEWax0Q/6R+qZWpckXFzz4Nd6bv8ZFbjWiPdsk5ZaRkRFWm4/MZxd MgUA//yQcTAK6WJt4EUZfb2xQw== X-Google-Smtp-Source: AFSGD/U4vHElPecwihAQdLel9MPUbq/VPAbpnKJNDA+Q18vVGwd5yIE/voQupS5K/XDAWOC/m8URlQ== X-Received: by 2002:a7b:cd85:: with SMTP id y5mr3766933wmj.129.1545335437650; Thu, 20 Dec 2018 11:50:37 -0800 (PST) Received: from mutt-hbsd (tor-exit.talyn.se. [79.137.79.167]) by smtp.gmail.com with ESMTPSA id d4sm12079306wrp.89.2018.12.20.11.50.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 11:50:36 -0800 (PST) Date: Thu, 20 Dec 2018 14:49:41 -0500 From: Shawn Webb To: Rebecca Cran Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts Message-ID: <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> References: <201812201939.wBKJdbhB015092@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vxzaspxr2v4rrzcc" Content-Disposition: inline In-Reply-To: <201812201939.wBKJdbhB015092@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 2243F6A3D6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 19:50:40 -0000 --vxzaspxr2v4rrzcc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 20, 2018 at 07:39:37PM +0000, Rebecca Cran wrote: > Author: bcran > Date: Thu Dec 20 19:39:37 2018 > New Revision: 342283 > URL: https://svnweb.freebsd.org/changeset/base/342283 >=20 > Log: > Rework UEFI ESP generation > =20 > Currently, the installer uses pre-created 800KB FAT12 filesystems that > it dd's onto the ESP partition. > This changeset improves that by having the installer generate a FAT32 > filesystem directly onto the ESP using newfs_msdos and then copying > loader.efi into /EFI/freebsd. > For live installs it then runs efibootmgr to add a FreeBSD boot entry > in the BIOS. > =20 > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D17947 >=20 > Modified: > head/release/amd64/make-memstick.sh > head/release/amd64/mkisoimages.sh > head/release/arm64/make-memstick.sh > head/release/i386/make-memstick.sh > head/release/tools/vmimage.subr > head/share/man/man8/uefi.8 > head/tools/boot/install-boot.sh > head/tools/boot/rootgen.sh > head/tools/tools/nanobsd/embedded/common > head/usr.sbin/bsdinstall/partedit/gpart_ops.c > head/usr.sbin/bsdinstall/partedit/partedit_arm64.c > head/usr.sbin/bsdinstall/partedit/partedit_x86.c > head/usr.sbin/bsdinstall/scripts/bootconfig > head/usr.sbin/bsdinstall/scripts/zfsboot >=20 > Modified: head/release/amd64/make-memstick.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/release/amd64/make-memstick.sh Thu Dec 20 19:27:46 2018 (r342282) > +++ head/release/amd64/make-memstick.sh Thu Dec 20 19:39:37 2018 (r342283) > @@ -12,6 +12,9 @@ > =20 > set -e > =20 > +scriptdir=3D$(dirname $(realpath $0)) > +. ${scriptdir}/../../tools/boot/install-boot.sh > + > PATH=3D/bin:/usr/bin:/sbin:/usr/sbin > export PATH > =20 > @@ -36,11 +39,16 @@ makefs -B little -o label=3DFreeBSD_Install -o versio= n=3D2 > rm ${1}/etc/fstab > rm ${1}/etc/rc.conf.local > =20 > +# Make an ESP in a file. > +espfilename=3D$(mktemp /tmp/efiboot.XXXXXX) > +make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi Hey Rebecca, Are there any other bits of the build process that touch files outside of ${MAKEOBJDIRPREFIX}? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --vxzaspxr2v4rrzcc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlwb8k0ACgkQaoRlj1JF bu5p+Q/+IMWdCVIGQhoArzJtoyfLhyPVGAWBlxQW8Wz/+80lD7yXu0rGUvQjqFgq w36z4knfdDnGWZz10mExFmjLTDjA620sj9iLYAuJ/tJ2ZHaiPm3B+0+gyZNls2v3 Ku1NIEBrC0wSSvOOWa5xlcUfoVAqYBVBHYHuaU0iv80lNG7mhTorKnVI93TvdHNe mJGj6sHk1RTOM+WAlryhjh7pJFLKsrvEMvtlruHXo1LojNGRaZ7KOt/zrbCABUvM DsgQRHYuHjTHcGoKExj1PIoQxn3cnrgnMGhqlRRsKdIhefUbQMp9sRwMlJn7dQk/ F5Ei50ie5MFxyniecXEyaFFYBbdBCPVyjU52wLZp4CF+cLq42/x7R4atCbhW3q36 tA0ba8AoV8KHEhtfaTUp647eQvO1ADjeG5HebWV7SpAc2AxcP3aq7J+wrrAJGHRC ms8r7PSF1zvGAPsK36pS1wtaMHqOYulgj7/iNexEDjxamGbuqgoxMa08qxTrOnRg iYsdSUSN9pp83ezz5xBgv+oXtbjBo6RHvcfZxLDDfP7xFyNjKwaiuUq5i2O3eSXu yc78X+XYSI/0S0d+rMlHZ9eevLEOJf+s75QvsQbx2LmTzTPoT3geDbyv2ir+T3pC NZ1tw2iTB/G0QzD4jbfEKONLdQTxQPfBVe+1FODQaHGsJnskth4= =BxUu -----END PGP SIGNATURE----- --vxzaspxr2v4rrzcc-- From owner-svn-src-head@freebsd.org Thu Dec 20 19:54: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 90F53135230E for ; Thu, 20 Dec 2018 19:54:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9878A6A9E7 for ; Thu, 20 Dec 2018 19:54:07 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1545335611; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=fJHhd1Zl3QIlht8qpEtx5QyJY650SJkAmxwO4LN9IRC9L353+XzMVYnrVpyMzL88/jiBzdWu45w/Q kaWErtSQYW0a8kaup9gw2CbYzTd2JjIkES6Itjt4AmWvgX7n2B1cWP8zREMXlT4G5RwLJVpSqf1HL1 Fui4CmOg/NnxeU+H/k0YlBtflx7hpA48YI1uHDSsrMbLsd24NZDlHwRnz+B6tYp8tYHnTU0z4SOj3Z rID8f4phkq8lw/2miby7Izh4+2Jq7WWzmzTyWTsn+nYRLGeBJdEFGElI/fOT9vgvCogDP1xbi3zUDs p2FAwxoAMEdVDzP8pY8JViDnhUpwWnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=Co+k3QcBmeZBbi6rRA9xStFyVq0Y26GZ6LXQ7HzLd/0=; b=E5qfxQTtR2HB4zTa36SLR1ASPfsIozE4wh8FTyFCSVb+f53n2L125YQF2ccAXRhBs07Q8iQ+RuNdF mOsvQ+K269Qf6YfTSs9mY2fZbz4QCl1r/VOmJBc1u0aeaT8FejQsYFm+GwN6DJVA/suG9jCC/b+8mG +0QcDpkhLiYRMm1mrV2doZupnQLv0SPhPxd0Mofwu0ET2xBtrdfc+8lSUHdWzA9psyslP8Y2b/l4yJ rmbMzIhWrEEUuH2xFugLMtitlMqBiFMeRdJjiNGWbvquhd4blKuAMt+G6W27kBpaeKdy7Jzd7YTQkr /o1+dAqFP8QTDjvGeoK12q1/JJdyUBQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=Co+k3QcBmeZBbi6rRA9xStFyVq0Y26GZ6LXQ7HzLd/0=; b=Xu0wNT3/iL2etVyjuGhwdBYZEI3h+RYmj912Bs7ihkFyahMAEEhpvAIAlUozohFyF0hmaE0ImAAO7 iaP0X8NgA048Hiyda2mCDN5UBVqS31aaBdibwGed5ype+Vd29fzgLCPThoCY2LOk63oLAaQOBNG9Zy c1ssKcnetJ05uXuolZUXbtb2By/Z0VV7jA+dbFIikHfaZLwnztVF/sCamSLtkIxl43PEq55pSjICVg /3hq+i2iWJQTYSe9YodPd+Cs4x0hMthIt/5rWNEjuExhM+w1YjWEYx/PSTT1Td6LKedqHVFi8yNmjU L0ylx9XMjPUUM+Hudsi1mIreMBTvOWg== X-MHO-RoutePath: aGlwcGll X-MHO-User: ebcb2ebf-0490-11e9-a59a-7b143e15dabc 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 outbound3.ore.mailhop.org (Halon) with ESMTPSA id ebcb2ebf-0490-11e9-a59a-7b143e15dabc; Thu, 20 Dec 2018 19:53:29 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wBKJrvGN001142; Thu, 20 Dec 2018 12:53:57 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1545335637.87734.36.camel@freebsd.org> Subject: Re: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts From: Ian Lepore To: Shawn Webb , Rebecca Cran Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 20 Dec 2018 12:53:57 -0700 In-Reply-To: <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> References: <201812201939.wBKJdbhB015092@repo.freebsd.org> <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> 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-Rspamd-Queue-Id: 9878A6A9E7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 19:54:08 -0000 On Thu, 2018-12-20 at 14:49 -0500, Shawn Webb wrote: > On Thu, Dec 20, 2018 at 07:39:37PM +0000, Rebecca Cran wrote: > > > > Author: bcran > > Date: Thu Dec 20 19:39:37 2018 > > New Revision: 342283 > > URL: https://svnweb.freebsd.org/changeset/base/342283 > > > > Log: > >   Rework UEFI ESP generation > >    > >   Currently, the installer uses pre-created 800KB FAT12 filesystems > > that > >   it dd's onto the ESP partition. > >   This changeset improves that by having the installer generate a > > FAT32 > >   filesystem directly onto the ESP using newfs_msdos and then > > copying > >   loader.efi into /EFI/freebsd. > >   For live installs it then runs efibootmgr to add a FreeBSD boot > > entry > >   in the BIOS. > >    > >   Sponsored by: Netflix > >   Differential Revision: https://reviews.freebsd.org/D17947 > > > > Modified: > >   head/release/amd64/make-memstick.sh > >   head/release/amd64/mkisoimages.sh > >   head/release/arm64/make-memstick.sh > >   head/release/i386/make-memstick.sh > >   head/release/tools/vmimage.subr > >   head/share/man/man8/uefi.8 > >   head/tools/boot/install-boot.sh > >   head/tools/boot/rootgen.sh > >   head/tools/tools/nanobsd/embedded/common > >   head/usr.sbin/bsdinstall/partedit/gpart_ops.c > >   head/usr.sbin/bsdinstall/partedit/partedit_arm64.c > >   head/usr.sbin/bsdinstall/partedit/partedit_x86.c > >   head/usr.sbin/bsdinstall/scripts/bootconfig > >   head/usr.sbin/bsdinstall/scripts/zfsboot > > > > Modified: head/release/amd64/make-memstick.sh > > =================================================================== > > =========== > > --- head/release/amd64/make-memstick.sh Thu Dec 20 19:27:46 > > 2018 (r342282) > > +++ head/release/amd64/make-memstick.sh Thu Dec 20 19:39:37 > > 2018 (r342283) > > @@ -12,6 +12,9 @@ > >   > >  set -e > >   > > +scriptdir=$(dirname $(realpath $0)) > > +. ${scriptdir}/../../tools/boot/install-boot.sh > > + > >  PATH=/bin:/usr/bin:/sbin:/usr/sbin > >  export PATH > >   > > @@ -36,11 +39,16 @@ makefs -B little -o label=FreeBSD_Install -o > > version=2 > >  rm ${1}/etc/fstab > >  rm ${1}/etc/rc.conf.local > >   > > +# Make an ESP in a file. > > +espfilename=$(mktemp /tmp/efiboot.XXXXXX) > > +make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi > Hey Rebecca, > > Are there any other bits of the build process that touch files > outside > of ${MAKEOBJDIRPREFIX}? Clang puts its temp files in whatever directory TMPDIR is set to (typically /tmp). -- Ian From owner-svn-src-head@freebsd.org Thu Dec 20 20:11: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 58A9C1352A74; Thu, 20 Dec 2018 20:11:23 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (muon.bluestop.org [96.73.9.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB6016B545; Thu, 20 Dec 2018 20:11:22 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id D806A30BDF; Thu, 20 Dec 2018 13:12:13 -0700 (MST) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lCDGdAfm205m; Thu, 20 Dec 2018 13:12:13 -0700 (MST) Received: from macbex.int.bluestop.org.mail (gw.bluestop.org [96.73.9.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA; Thu, 20 Dec 2018 13:12:13 -0700 (MST) Date: Thu, 20 Dec 2018 13:11:20 -0700 From: Rebecca Cran To: Rebecca Cran , Shawn Webb Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Message-ID: In-Reply-To: <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> References: <201812201939.wBKJdbhB015092@repo.freebsd.org> <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> Subject: Re: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts MIME-Version: 1.0 X-Rspamd-Queue-Id: EB6016B545 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 20:11:23 -0000 On December 20, 2018 at 12:51:36 PM, Shawn Webb (shawn.webb=40hardenedbsd= .org) wrote: Are there any other bits of the build process that touch files outside=C2= =A0 of =24=7BMAKEOBJDIRPRE=46IX=7D=3F=C2=A0 Grepping for =E2=80=9C/tmp=E2=80=9D shows lots of other scripts that use = /tmp . =E2=80=94=C2=A0 Rebecca From owner-svn-src-head@freebsd.org Thu Dec 20 20:13: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 859C91352C4F for ; Thu, 20 Dec 2018 20:13:07 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 DFBAB6B8C5 for ; Thu, 20 Dec 2018 20:13:06 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-lf1-x12b.google.com with SMTP id u18so2306813lff.10 for ; Thu, 20 Dec 2018 12:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HKMrP2ctrWvm6inYWsmFPKPjE6sWjcC9UpvAHOCQncY=; b=TZiB5t2Uthy7opwXCdm1tM35b8CB1S1sh4gfpxIpcFK4NMkbDoCOJw1jrr0JBxDqeH D/UrhlClVxBynVeROCVVjFsN6vZJ7nlHAoVBaU5YBb2ScnBc2TFW6csAG+eanUto0VX2 gz0SSeNAMLf7VP0YdI2xVbWqI2SaTzHYI+fq9SRF3qrd96ZjwK2NTzDycK8GQSjfvE1r cNbQN5o3U3YipeHH2fdq+tf6+4f0BpRD57uG8D7Qm6I9dOp3KxdVZbp6qvUFHtH0/7Sc Q9EBgvSMApumYwKxzyNh541MBnhZ7EsXCKE1CdunKiGg+7LZ4nKZIHT5kJyUtpVmLSc4 jcBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HKMrP2ctrWvm6inYWsmFPKPjE6sWjcC9UpvAHOCQncY=; b=Lk70DmFn1CnIlwpxdua1/xR/u+QKixhGm/V47Q34+V9ky2wQf/gylfW5wFadOdldIq cSOWBzdM4Mo+psBa7n+KvGDE2nZ/h90MfPKp/ApRrbmghgo9X46Cf1HkJ1ZAeHc00FQz 8Rp3QqtQvAYbIN0bWGm/BgCeX8lICpyIczKRDSv/lzB1hRO5xvRdJ7kYj1nYzqcfKMlV S9azOk9xIveqRpy8rSI67oCTZlMdnC6zTkSHv+1jlIR6GXebbQmjWuBjGEOk6HT9PEev Yrw9TSL70UbKAMD6i0VBMWGEzaz+nCTj6LvLGKJIrWk8AUhgN+12h/cy7kN9gBXkHSUI YcUA== X-Gm-Message-State: AA+aEWZsCQ8iNmG0EIRmRC4z3kLUwPlo5MOVpNub5p7vVQJFtpEja0xu C7guVP60NpSFQdOfJHcBOiDbBxvw4MdDxUew X-Google-Smtp-Source: AFSGD/WPBbq50j6t2VQ0563VYRTbpSUICYn+jiq+iu35Isd3lkBzFoZebnUJ0/JXyUE4DnfYht6LDA== X-Received: by 2002:a19:1019:: with SMTP id f25mr15385142lfi.54.1545336785031; Thu, 20 Dec 2018 12:13:05 -0800 (PST) Received: from mutt-hbsd (tor24.quintex.com. [199.249.230.77]) by smtp.gmail.com with ESMTPSA id b81-v6sm4296468ljb.7.2018.12.20.12.13.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 12:13:04 -0800 (PST) Date: Thu, 20 Dec 2018 15:12:07 -0500 From: Shawn Webb To: Rebecca Cran Cc: Rebecca Cran , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts Message-ID: <20181220201207.pyoqbl32lyb3rrhy@mutt-hbsd> References: <201812201939.wBKJdbhB015092@repo.freebsd.org> <20181220194941.wikdor2wnsr56g4n@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kbocf4dlq2jg2xcu" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: DFBAB6B8C5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 20:13:07 -0000 --kbocf4dlq2jg2xcu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 20, 2018 at 01:11:20PM -0700, Rebecca Cran wrote: > On December 20, 2018 at 12:51:36 PM, Shawn Webb (shawn.webb@hardenedbsd.o= rg) wrote: >=20 > Are there any other bits of the build process that touch files outside?? > of ${MAKEOBJDIRPREFIX}??? >=20 >=20 > Grepping for ???/tmp??? shows lots of other scripts that use /tmp . Thanks! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --kbocf4dlq2jg2xcu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlwb95IACgkQaoRlj1JF bu5lag//a5XzrvI/aqBskXkosR/O9seQIHpBx8FXpLwyUukyeoN3lPte7bYTeIJN AKQFQ5/MXUOP2qPdD9YNgXoi5HqX+YqHwH1upGicVn/Alfz3fPmkFJfO1ay0i/cb kWyEtNvT8aV1aLCG7a/dvPPhT5IIEZpygVknmKIyy9Tt2nj7HnehDNhFaAwoD2TP pcAKrl4X7QIwIdBEnYD8TLWKIQka2Sx7ZqGVrWSjx6D7IW0eIAKesgpYhTvoMWRy yOg0aTTfr56OEWFXESskQMbmpyt0kx0meawc6rLS3uzjsSAEvUiFCtf98njBVSXS Z6yR2Td5GYcYuJawenq5ORX5GanPy9R3DYA8CcsAZR19z7t3ow3rMfcUJxuZ19ge P890fuitnLCGZLFv/ZVjuvof96pu9Bg4g6BdT9C37lg5N78EuHl9xpujeggAwTis CyJrKNegV2HSdt51qaFBBGkSwnuZ3H3k+mlxbBKMxV3qNw2plFcxnjSvK9FOv0G4 3MEzvynTaGvvO9leDdYp9srZ38B0l8gNab28d705rOHX2KaEi8APGhccWnMGNuWF CGBOko3k3xPVmML2r69AAcppO+kcN04CcriGrrPWCRxTudrrF/IHQ5vfhc2/SiKv 9pDXYk5LxtGYVoN0ChG2IeKVHk9wMwqiWtskRvsYWiEu0Xcl1v8= =UIly -----END PGP SIGNATURE----- --kbocf4dlq2jg2xcu-- From owner-svn-src-head@freebsd.org Thu Dec 20 20:34: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 A07621353463; Thu, 20 Dec 2018 20:34:22 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434B86C9E7; Thu, 20 Dec 2018 20:34:22 +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 348162E67; Thu, 20 Dec 2018 20:34:22 +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 wBKKYMkT047530; Thu, 20 Dec 2018 20:34:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKKYMNC047529; Thu, 20 Dec 2018 20:34:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812202034.wBKKYMNC047529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Dec 2018 20:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342284 - 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: 342284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 434B86C9E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 20:34:22 -0000 Author: np Date: Thu Dec 20 20:34:21 2018 New Revision: 342284 URL: https://svnweb.freebsd.org/changeset/base/342284 Log: cxgbe(4): Make sure the rx queues start off with the correct timestamp settings on initialization. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Dec 20 19:39:37 2018 (r342283) +++ head/sys/dev/cxgbe/t4_sge.c Thu Dec 20 20:34:21 2018 (r342284) @@ -3435,6 +3435,8 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int if (vi->ifp->if_capenable & IFCAP_LRO) rxq->iq.flags |= IQ_LRO_ENABLED; #endif + if (vi->ifp->if_capenable & IFCAP_HWRXTSTMP) + rxq->iq.flags |= IQ_RX_TIMESTAMP; rxq->ifp = vi->ifp; children = SYSCTL_CHILDREN(oid); From owner-svn-src-head@freebsd.org Thu Dec 20 20:55: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 64FD51353C9B; Thu, 20 Dec 2018 20:55:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 073396D637; Thu, 20 Dec 2018 20:55:34 +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 EEEA231BA; Thu, 20 Dec 2018 20:55: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 wBKKtXQK057992; Thu, 20 Dec 2018 20:55:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKKtXWV057991; Thu, 20 Dec 2018 20:55:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812202055.wBKKtXWV057991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 20 Dec 2018 20:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342285 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 342285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 073396D637 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 20:55:34 -0000 Author: cem Date: Thu Dec 20 20:55:33 2018 New Revision: 342285 URL: https://svnweb.freebsd.org/changeset/base/342285 Log: tpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit) Move static variable definition (cdevsw) to a more conventional location (the C file it is used in), rather than a header. This fixes the GCC warning, -Wunused-variable ("defined but not used") when the tpm20.h header is included in files other than tpm20.c (e.g., tpm_tis.c). X-MFC-with: r342084 Sponsored by: Dell EMC Isilon Modified: head/sys/dev/tpm/tpm20.c head/sys/dev/tpm/tpm20.h Modified: head/sys/dev/tpm/tpm20.c ============================================================================== --- head/sys/dev/tpm/tpm20.c Thu Dec 20 20:34:21 2018 (r342284) +++ head/sys/dev/tpm/tpm20.c Thu Dec 20 20:55:33 2018 (r342285) @@ -36,6 +36,22 @@ MALLOC_DEFINE(M_TPM20, "tpm_buffer", "buffer for tpm 2 static void tpm20_discard_buffer(void *arg); static int tpm20_save_state(device_t dev, bool suspend); +static d_open_t tpm20_open; +static d_close_t tpm20_close; +static d_read_t tpm20_read; +static d_write_t tpm20_write; +static d_ioctl_t tpm20_ioctl; + +static struct cdevsw tpm20_cdevsw = { + .d_version = D_VERSION, + .d_open = tpm20_open, + .d_close = tpm20_close, + .d_read = tpm20_read, + .d_write = tpm20_write, + .d_ioctl = tpm20_ioctl, + .d_name = "tpm20", +}; + int tpm20_read(struct cdev *dev, struct uio *uio, int flags) { @@ -162,7 +178,7 @@ tpm20_init(struct tpm_sc *sc) sc->pending_data_length = 0; make_dev_args_init(&args); - args.mda_devsw = &tpm_cdevsw; + args.mda_devsw = &tpm20_cdevsw; args.mda_uid = UID_ROOT; args.mda_gid = GID_WHEEL; args.mda_mode = TPM_CDEV_PERM_FLAG; Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Thu Dec 20 20:34:21 2018 (r342284) +++ head/sys/dev/tpm/tpm20.h Thu Dec 20 20:55:33 2018 (r342285) @@ -124,22 +124,6 @@ int32_t tpm20_get_timeout(uint32_t command); int tpm20_init(struct tpm_sc *sc); void tpm20_release(struct tpm_sc *sc); -d_open_t tpm20_open; -d_close_t tpm20_close; -d_read_t tpm20_read; -d_write_t tpm20_write; -d_ioctl_t tpm20_ioctl; - -static struct cdevsw tpm_cdevsw = { - .d_version = D_VERSION, - .d_open = tpm20_open, - .d_close = tpm20_close, - .d_read = tpm20_read, - .d_write = tpm20_write, - .d_ioctl = tpm20_ioctl, - .d_name = "tpm20", -}; - /* Small helper routines for io ops */ static inline uint8_t RD1(struct tpm_sc *sc, bus_size_t off) From owner-svn-src-head@freebsd.org Thu Dec 20 21:25: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 93E391354BF4; Thu, 20 Dec 2018 21:25:52 +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 0B6416ECA4; Thu, 20 Dec 2018 21:25:51 +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 wBKLPlqW013024; Thu, 20 Dec 2018 13:25:47 -0800 (PST) (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 wBKLPkWo013023; Thu, 20 Dec 2018 13:25:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812202125.wBKLPkWo013023@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342283 - in head: release/amd64 release/arm64 release/i386 release/tools share/man/man8 tools/boot tools/tools/nanobsd/embedded usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts In-Reply-To: <20181220201207.pyoqbl32lyb3rrhy@mutt-hbsd> To: Shawn Webb Date: Thu, 20 Dec 2018 13:25:46 -0800 (PST) CC: Rebecca Cran , Rebecca Cran , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@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-Rspamd-Queue-Id: 0B6416ECA4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 21:25:52 -0000 > On Thu, Dec 20, 2018 at 01:11:20PM -0700, Rebecca Cran wrote: > > On December 20, 2018 at 12:51:36 PM, Shawn Webb (shawn.webb@hardenedbsd.org) wrote: > > > > Are there any other bits of the build process that touch files outside?? > > of ${MAKEOBJDIRPREFIX}??? > > > > > > Grepping for ???/tmp??? shows lots of other scripts that use /tmp . > > Thanks! Should those be updated to use ${TMPDIR}? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Dec 20 22:21: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 6F39E13561B5; Thu, 20 Dec 2018 22:21:42 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB4370C5B; Thu, 20 Dec 2018 22:21:42 +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 005AA440B; Thu, 20 Dec 2018 22:21:42 +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 wBKMLff0003574; Thu, 20 Dec 2018 22:21:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKMLfql003573; Thu, 20 Dec 2018 22:21:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201812202221.wBKMLfql003573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 20 Dec 2018 22:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342286 - 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: 342286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CB4370C5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 22:21:42 -0000 Author: rmacklem Date: Thu Dec 20 22:21:41 2018 New Revision: 342286 URL: https://svnweb.freebsd.org/changeset/base/342286 Log: Fix the NFSv4 server to obey vfs.nfsd.nfs_privport. When the NFSv4 server was coded, I believed that the specification authors did not want NFSv4 servers to require a client to use a reserved port#. However, recently it has been noted that the Linux NFSv4 server does support a check for a reserved port#. Since both the FreeBSD and Linux NFSv4 clients use a reserved port# by default, enabling vfs.nfsd.nfs_privport to require a reserved port# for NFSv4 the same as it does for NFSv2, 3 seems reasonable. The only case where this could cause a POLA violation is a FreeBSD NFSv4 server with vfs.nfsd.nfs_privport set, but with NFSv4 clients doing mounts without using a reserved port# (< 1024). Tested by: chaz.newton58@gmail.com PR: 234106 MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Dec 20 20:55:33 2018 (r342285) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Dec 20 22:21:41 2018 (r342286) @@ -90,7 +90,7 @@ SVCPOOL *nfsrvd_pool; static int nfs_privport = 0; SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RWTUN, &nfs_privport, 0, - "Only allow clients using a privileged port for NFSv2 and 3"); + "Only allow clients using a privileged port for NFSv2, 3 and 4"); static int nfs_minvers = NFS_VER2; SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RWTUN, @@ -166,7 +166,7 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) nd.nd_mreq = NULL; nd.nd_cred = NULL; - if (nfs_privport && (nd.nd_flag & ND_NFSV4) == 0) { + if (nfs_privport != 0) { /* Check if source port is privileged */ u_short port; struct sockaddr *nam = nd.nd_nam; From owner-svn-src-head@freebsd.org Thu Dec 20 22:26: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 64D6C1356429; Thu, 20 Dec 2018 22:26:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF9770EBB; Thu, 20 Dec 2018 22:26:55 +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 F345B4450; Thu, 20 Dec 2018 22:26:54 +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 wBKMQsan005736; Thu, 20 Dec 2018 22:26:54 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKMQst0005735; Thu, 20 Dec 2018 22:26:54 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201812202226.wBKMQst0005735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 20 Dec 2018 22:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342287 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AF9770EBB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 22:26:55 -0000 Author: rmacklem Date: Thu Dec 20 22:26:54 2018 New Revision: 342287 URL: https://svnweb.freebsd.org/changeset/base/342287 Log: Add an UPDATING message for r342286. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Dec 20 22:21:41 2018 (r342286) +++ head/UPDATING Thu Dec 20 22:26:54 2018 (r342287) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181220: + r342286 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport + in the same as it is applied to NFSv2 and 3. This implies that NFSv4 + servers that have vfs.nfsd.nfs_privport set will only allow mounts + from clients using a reserved port#. Since both the FreeBSD and Linux + NFSv4 clients use reserved port#s by default, this should not affect + most NFSv4 mounts. + 20181219: The XLP config has been removed. We can't support 64-bit atomics in this kernel because it is running in 32-bit mode. XLP users must transition From owner-svn-src-head@freebsd.org Thu Dec 20 22:31: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 A8D4A135663B; Thu, 20 Dec 2018 22:31:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDD3710C8; Thu, 20 Dec 2018 22:31:08 +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 293E04485; Thu, 20 Dec 2018 22:31:08 +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 wBKMV8op006722; Thu, 20 Dec 2018 22:31:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKMV7Gm006718; Thu, 20 Dec 2018 22:31:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812202231.wBKMV7Gm006718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Dec 2018 22:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342288 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 342288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDD3710C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 22:31:09 -0000 Author: np Date: Thu Dec 20 22:31:07 2018 New Revision: 342288 URL: https://svnweb.freebsd.org/changeset/base/342288 Log: cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n. Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 22:26:54 2018 (r342287) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 20 22:31:07 2018 (r342288) @@ -429,7 +429,7 @@ static void process_timeout(struct c4iw_ep *ep) abort = 0; break; default: - CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u\n" + CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u" , __func__, ep, ep->hwtid, ep->com.state); abort = 0; } @@ -1020,7 +1020,7 @@ process_newconn(struct c4iw_listen_ep *master_lep, str ret = soaccept(new_so, (struct sockaddr **)&remote); if (ret != 0) { CTR4(KTR_IW_CXGBE, - "%s:listen sock:%p, new sock:%p, ret:%d\n", + "%s:listen sock:%p, new sock:%p, ret:%d", __func__, master_lep->com.so, new_so, ret); if (remote != NULL) free(remote, M_SONAME); @@ -2309,7 +2309,7 @@ process_mpa_request(struct c4iw_ep *ep) MPA_V2_IRD_ORD_MASK; ep->ord = min_t(u32, ep->ord, cur_max_read_depth(ep->com.dev)); - CTR3(KTR_IW_CXGBE, "%s initiator ird %u ord %u\n", + CTR3(KTR_IW_CXGBE, "%s initiator ird %u ord %u", __func__, ep->ird, ep->ord); if (ntohs(mpa_v2_params->ird) & MPA_V2_PEER2PEER_MODEL) if (peer2peer) { @@ -2463,7 +2463,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_c ep->ird = 1; } - CTR4(KTR_IW_CXGBE, "%s %d ird %d ord %d\n", __func__, __LINE__, + CTR4(KTR_IW_CXGBE, "%s %d ird %d ord %d", __func__, __LINE__, ep->ird, ep->ord); ep->com.cm_id = cm_id; Modified: head/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cq.c Thu Dec 20 22:26:54 2018 (r342287) +++ head/sys/dev/cxgbe/iw_cxgbe/cq.c Thu Dec 20 22:31:07 2018 (r342288) @@ -671,7 +671,7 @@ proc_cqe: BUG_ON(wq->sq.in_use <= 0 && wq->sq.in_use >= wq->sq.size); wq->sq.cidx = (uint16_t)idx; - CTR2(KTR_IW_CXGBE, "%s completing sq idx %u\n", + CTR2(KTR_IW_CXGBE, "%s completing sq idx %u", __func__, wq->sq.cidx); *cookie = wq->sq.sw_sq[wq->sq.cidx].wr_id; t4_sq_consume(wq); Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Thu Dec 20 22:26:54 2018 (r342287) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Thu Dec 20 22:31:07 2018 (r342288) @@ -576,7 +576,7 @@ static void free_qp_work(struct work_struct *work) ucontext = qhp->ucontext; rhp = qhp->rhp; - CTR3(KTR_IW_CXGBE, "%s qhp %p ucontext %p\n", __func__, + CTR3(KTR_IW_CXGBE, "%s qhp %p ucontext %p", __func__, qhp, ucontext); destroy_qp(&rhp->rdev, &qhp->wq, ucontext ? &ucontext->uctx : &rhp->rdev.uctx); @@ -1878,10 +1878,10 @@ c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_att qhp->ibqp.qp_num = qhp->wq.sq.qid; init_timer(&(qhp->timer)); - CTR5(KTR_IW_CXGBE, "%s sq id %u size %u memsize %zu num_entries %u\n", + CTR5(KTR_IW_CXGBE, "%s sq id %u size %u memsize %zu num_entries %u", __func__, qhp->wq.sq.qid, qhp->wq.sq.size, qhp->wq.sq.memsize, attrs->cap.max_send_wr); - CTR5(KTR_IW_CXGBE, "%s rq id %u size %u memsize %zu num_entries %u\n", + CTR5(KTR_IW_CXGBE, "%s rq id %u size %u memsize %zu num_entries %u", __func__, qhp->wq.rq.qid, qhp->wq.rq.size, qhp->wq.rq.memsize, attrs->cap.max_recv_wr); return &qhp->ibqp; Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Thu Dec 20 22:26:54 2018 (r342287) +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Thu Dec 20 22:31:07 2018 (r342288) @@ -490,13 +490,13 @@ t4_ring_sq_db(struct t4_wq *wq, u16 inc, union t4_wr * /* Flush host queue memory writes. */ wmb(); if (wc && inc == 1 && wq->sq.bar2_qid == 0 && wqe) { - CTR2(KTR_IW_CXGBE, "%s: WC wq->sq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: WC wq->sq.pidx = %d", __func__, wq->sq.pidx); pio_copy((u64 __iomem *) ((u64)wq->sq.bar2_va + SGE_UDB_WCDOORBELL), (u64 *)wqe); } else { - CTR2(KTR_IW_CXGBE, "%s: DB wq->sq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: DB wq->sq.pidx = %d", __func__, wq->sq.pidx); writel(V_PIDX_T5(inc) | V_QID(wq->sq.bar2_qid), (void __iomem *)((u64)wq->sq.bar2_va + @@ -515,12 +515,12 @@ t4_ring_rq_db(struct t4_wq *wq, u16 inc, union t4_recv /* Flush host queue memory writes. */ wmb(); if (wc && inc == 1 && wq->rq.bar2_qid == 0 && wqe) { - CTR2(KTR_IW_CXGBE, "%s: WC wq->rq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: WC wq->rq.pidx = %d", __func__, wq->rq.pidx); pio_copy((u64 __iomem *)((u64)wq->rq.bar2_va + SGE_UDB_WCDOORBELL), (u64 *)wqe); } else { - CTR2(KTR_IW_CXGBE, "%s: DB wq->rq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: DB wq->rq.pidx = %d", __func__, wq->rq.pidx); writel(V_PIDX_T5(inc) | V_QID(wq->rq.bar2_qid), (void __iomem *)((u64)wq->rq.bar2_va + @@ -604,7 +604,7 @@ static inline void t4_swcq_produce(struct t4_cq *cq) { cq->sw_in_use++; if (cq->sw_in_use == cq->size) { - CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u\n", + CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u", __func__, cq->cqid); cq->error = 1; BUG_ON(1); @@ -676,7 +676,7 @@ static inline int t4_next_hw_cqe(struct t4_cq *cq, str static inline struct t4_cqe *t4_next_sw_cqe(struct t4_cq *cq) { if (cq->sw_in_use == cq->size) { - CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u\n", + CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u", __func__, cq->cqid); cq->error = 1; BUG_ON(1); From owner-svn-src-head@freebsd.org Thu Dec 20 22:39: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 ADEFD13567F4; Thu, 20 Dec 2018 22:39:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 503A57155D; Thu, 20 Dec 2018 22:39:59 +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 43A144613; Thu, 20 Dec 2018 22:39:59 +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 wBKMdxmG010880; Thu, 20 Dec 2018 22:39:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKMdxAl010879; Thu, 20 Dec 2018 22:39:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812202239.wBKMdxAl010879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Dec 2018 22:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342289 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 342289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 503A57155D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Dec 2018 22:39:59 -0000 Author: np Date: Thu Dec 20 22:39:58 2018 New Revision: 342289 URL: https://svnweb.freebsd.org/changeset/base/342289 Log: cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open. This information is readily available elsewhere. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Thu Dec 20 22:31:07 2018 (r342288) +++ head/sys/dev/cxgbe/iw_cxgbe/device.c Thu Dec 20 22:39:58 2018 (r342289) @@ -122,24 +122,7 @@ c4iw_rdev_open(struct c4iw_rdev *rdev) rdev->qpmask = udb_density - 1; rdev->cqshift = PAGE_SHIFT - sp->iq_s_qpp; rdev->cqmask = ucq_density - 1; - CTR5(KTR_IW_CXGBE, "%s dev %s stag start 0x%0x size 0x%0x num stags %d", - __func__, device_get_nameunit(sc->dev), sc->vres.stag.start, - sc->vres.stag.size, c4iw_num_stags(rdev)); - CTR5(KTR_IW_CXGBE, "%s pbl start 0x%0x size 0x%0x" - " rq start 0x%0x size 0x%0x", __func__, - sc->vres.pbl.start, sc->vres.pbl.size, - sc->vres.rq.start, sc->vres.rq.size); - CTR5(KTR_IW_CXGBE, "%s:qp qid start %u size %u cq qid start %u size %u", - __func__, sc->vres.qp.start, sc->vres.qp.size, - sc->vres.cq.start, sc->vres.cq.size); - /*TODO - CTR5(KTR_IW_CXGBE, "%s udb %pR db_reg %p gts_reg %p" - "qpmask 0x%x cqmask 0x%x", __func__, - db_reg,gts_reg,rdev->qpmask, rdev->cqmask); - */ - - if (c4iw_num_stags(rdev) == 0) { rc = -EINVAL; goto err1; @@ -235,11 +218,6 @@ c4iw_alloc(struct adapter *sc) iwsc->rdev.adap = sc; /* init various hw-queue params based on lld info */ - CTR3(KTR_IW_CXGBE, "%s: Ing. padding boundary is %d, " - "egrsstatuspagesize = %d", __func__, - sc->params.sge.pad_boundary, - sc->params.sge.spg_len); - iwsc->rdev.hw_queue.t4_eq_status_entries = sc->params.sge.spg_len / EQ_ESIZE; iwsc->rdev.hw_queue.t4_max_eq_size = 65520; From owner-svn-src-head@freebsd.org Fri Dec 21 01:09: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 67B3F1337009; Fri, 21 Dec 2018 01:09:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB67769E7; Fri, 21 Dec 2018 01:09:26 +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 028C85FB2; Fri, 21 Dec 2018 01:09:26 +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 wBL19PvB089270; Fri, 21 Dec 2018 01:09:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL19PmY089269; Fri, 21 Dec 2018 01:09:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812210109.wBL19PmY089269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 21 Dec 2018 01:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342290 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EB67769E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 01:09:26 -0000 Author: mckusick Date: Fri Dec 21 01:09:25 2018 New Revision: 342290 URL: https://svnweb.freebsd.org/changeset/base/342290 Log: Some filesystems (like cd9660 and ext3) require that VFS_STATFS() be called before VFS_ROOT() is called. Move the call for VFS_STATFS() so that it is done after VFS_MOUNT(), but before VFS_ROOT(). This change actually improves the robustness of the mount system call because it returns an error rather than failing silently when VFS_STATFS() returns failure. Reported by: Rebecca Cran Sponsored by: Netflix Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Dec 20 22:39:58 2018 (r342289) +++ head/sys/kern/vfs_mount.c Fri Dec 21 01:09:25 2018 (r342290) @@ -895,6 +895,7 @@ vfs_domount_first( */ error1 = 0; if ((error = VFS_MOUNT(mp)) != 0 || + (error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { if (error1 != 0) { error = error1; @@ -916,7 +917,6 @@ vfs_domount_first( vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; *optlist = NULL; - (void)VFS_STATFS(mp, &mp->mnt_stat); /* * Prevent external consumers of mount options from reading mnt_optnew. From owner-svn-src-head@freebsd.org Fri Dec 21 04:58: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 37568133D571; Fri, 21 Dec 2018 04:58:00 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D09A6860C2; Fri, 21 Dec 2018 04:57:59 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A4FB88740; Fri, 21 Dec 2018 04:57:59 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBL4vxHt011867; Fri, 21 Dec 2018 04:57:59 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL4vxBR011866; Fri, 21 Dec 2018 04:57:59 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812210457.wBL4vxBR011866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Dec 2018 04:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342295 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D09A6860C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 04:58:00 -0000 Author: bde Date: Fri Dec 21 04:57:59 2018 New Revision: 342295 URL: https://svnweb.freebsd.org/changeset/base/342295 Log: Fix rounding in vop_stdadvise() for POSIX_FADV_NOREUSE (really POSIX_FADV_DONTNEED). The most broken case was for applications that advise for the whole file and then do block-aligned i/o's 1 block at a time. Then advice is sent to VOP_ADVISE() 1 block at a time, but in vop_stdadvise() the 1-block advice was turned into 0-block advice for the buffer cache part. The bugs were caused partly by callers representing the region as (a_start, a_end), where a_end is actually the maximum, and everything else representing the region as (start, end) where 'end' is actually the end (1 after the maximum). The maximum a_end must be rounded up, but was rounded down. Also, rounding to page boundaries was inconsistent. The bugs and fixes have no effect for zfs and other file systems that don't use the buffer cache or the page cache. Most or all file systems currently use the default VOP_FADVISE(), but it finds a null buffer cache and a null page cache for file systems that don't use normal methods. Reviewed by: kib Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Dec 21 02:26:08 2018 (r342294) +++ head/sys/kern/vfs_default.c Fri Dec 21 04:57:59 2018 (r342295) @@ -1063,7 +1063,7 @@ vop_stdadvise(struct vop_advise_args *ap) struct vnode *vp; struct bufobj *bo; daddr_t startn, endn; - off_t start, end; + off_t bstart, bend, start, end; int bsize, error; vp = ap->a_vp; @@ -1085,14 +1085,27 @@ vop_stdadvise(struct vop_advise_args *ap) } /* + * Round to block boundaries (and later possibly further to + * page boundaries). Applications cannot reasonably be aware + * of the boundaries, and the rounding must be to expand at + * both extremities to cover enough. It still doesn't cover + * read-ahead. For partial blocks, this gives unnecessary + * discarding of buffers but is efficient enough since the + * pages usually remain in VMIO for some time. + */ + bsize = vp->v_bufobj.bo_bsize; + bstart = roundup(ap->a_start, bsize); + bend = roundup(ap->a_end, bsize); + + /* * Deactivate pages in the specified range from the backing VM * object. Pages that are resident in the buffer cache will * remain wired until their corresponding buffers are released * below. */ if (vp->v_object != NULL) { - start = trunc_page(ap->a_start); - end = round_page(ap->a_end); + start = trunc_page(bstart); + end = round_page(bend); VM_OBJECT_RLOCK(vp->v_object); vm_object_page_noreuse(vp->v_object, OFF_TO_IDX(start), OFF_TO_IDX(end)); @@ -1101,9 +1114,8 @@ vop_stdadvise(struct vop_advise_args *ap) bo = &vp->v_bufobj; BO_RLOCK(bo); - bsize = vp->v_bufobj.bo_bsize; - startn = ap->a_start / bsize; - endn = ap->a_end / bsize; + startn = bstart / bsize; + endn = bend / bsize; error = bnoreuselist(&bo->bo_clean, bo, startn, endn); if (error == 0) error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); From owner-svn-src-head@freebsd.org Fri Dec 21 06:38: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 697A3133F772; Fri, 21 Dec 2018 06:38:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107CF88A95; Fri, 21 Dec 2018 06:38:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F3AF5980B; Fri, 21 Dec 2018 06:38:13 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBL6cD5V063836; Fri, 21 Dec 2018 06:38:13 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL6cDWF063835; Fri, 21 Dec 2018 06:38:13 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812210638.wBL6cDWF063835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Dec 2018 06:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342296 - head/sbin/mdconfig X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sbin/mdconfig X-SVN-Commit-Revision: 342296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 107CF88A95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 06:38:14 -0000 Author: bde Date: Fri Dec 21 06:38:13 2018 New Revision: 342296 URL: https://svnweb.freebsd.org/changeset/base/342296 Log: Fix missing (sub)options in usage message to prepare for adding a new one. Reviewed by: kib Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Fri Dec 21 04:57:59 2018 (r342295) +++ head/sbin/mdconfig/mdconfig.c Fri Dec 21 06:38:13 2018 (r342296) @@ -88,7 +88,8 @@ usage(void) " mdconfig -l [-v] [-n] [-f file] [-u unit]\n" " mdconfig file\n"); fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); - fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n"); + fprintf(stderr, "\t\toption = {cluster, compress, force,\n"); + fprintf(stderr, "\t\t readonly, reserve, ro, verify}\n"); fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB), \n"); fprintf(stderr, "\t\t %%dt (TB), or %%dp (PB)\n"); From owner-svn-src-head@freebsd.org Fri Dec 21 08:15: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 6B7C9134167B; Fri, 21 Dec 2018 08:15:33 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 048CC8B98E; Fri, 21 Dec 2018 08:15:33 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E5717A915; Fri, 21 Dec 2018 08:15:32 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBL8FWkn015977; Fri, 21 Dec 2018 08:15:32 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL8FWOu015972; Fri, 21 Dec 2018 08:15:32 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812210815.wBL8FWOu015972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Dec 2018 08:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342297 - in head: sbin/mdconfig sys/dev/md sys/sys X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head: sbin/mdconfig sys/dev/md sys/sys X-SVN-Commit-Revision: 342297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 048CC8B98E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 08:15:33 -0000 Author: bde Date: Fri Dec 21 08:15:31 2018 New Revision: 342297 URL: https://svnweb.freebsd.org/changeset/base/342297 Log: Use VOP_ADVISE() with POSIX_FADV_DONTNEED instead of IO_DIRECT to implement not double-caching for reads from vnode-backed md devices. Use VOP_ADVISE() similarly instead of !IO_DIRECT unsimilarly for writes. Add a "cache" option to mdconfig to allow changing the default of not caching. This depends on a recent commit to fix VOP_ADVISE(). A previous version had optimizations for sequential i/o's (merge the i/o's and only uncache for discontiguous i/o's and for full blocks), but optimizations and knowledge of block boundaries belong in VOP_ADVISE(). Read-ahead should also be handled better, by supporting it in md and discarding it in VOP_ADVISE(). POSIX_FADV_DONTNEED is ignored by zfs, but so is IO_DIRECT. POSIX_FADV_DONTNEED works better than IO_DIRECT if it is not ignored, since it only discards from the buffer cache immediately, while IO_DIRECT also discards from the page cache immediately. IO_DIRECT was not used for writes since it was claimed to be too slow, but most of the slowness for writes is from doing them synchronously by default. Non-synchronous writes still deadlock in many cases. IO_DIRECT only has a special implementation for ffs reads with DIRECTIO configured. Otherwise, if it is not ignored than it uses the buffer and page caches normally except for discarding everything after each i/o, and then it has much the same overheads as POSIX_FADV_DONTNEED. The overheads for reading with ffs and DIRECTIO were similar in tests of md. Reviewed by: kib Modified: head/sbin/mdconfig/mdconfig.8 head/sbin/mdconfig/mdconfig.c head/sys/dev/md/md.c head/sys/sys/mdioctl.h Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Fri Dec 21 06:38:13 2018 (r342296) +++ head/sbin/mdconfig/mdconfig.8 Fri Dec 21 08:15:31 2018 (r342297) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 28, 2017 +.Dd December 21, 2018 .Dt MDCONFIG 8 .Os .Sh NAME @@ -206,6 +206,32 @@ backed devices: avoid .Dv IO_SYNC for increased performance but at the risk of deadlocking the entire kernel. +.It Oo Cm no Oc Ns Cm cache +For +.Cm vnode +backed devices: enable/disable caching of data in system caches. +The default is to not cache. +.Pp +Accesses via the device are converted to accesses via the vnode. +The caching policy for the vnode is used initially. +This is normally to cache. +This caching policy is retained if the +.Cm cache +option is used. +Otherwise, caching is limited +by releasing data from caches soon after each access. +The release has the same semantics as the +.Dv POSIX_FADV_DONTNEED +feature of +.Xr posix_fadvise 2 . +The result is that with normal (non-zfs) caching, +buffers are released from the buffer cache soon after they are constructed, +but their data is kept in the page cache at lower priority. +.Pp +The +.Cm cache +option tends to waste memory by giving unwanted double caching, +but it saves time if there is memory to spare. .It Oo Cm no Oc Ns Cm reserve Allocate and reserve all needed storage from the start, rather than as needed. .It Oo Cm no Oc Ns Cm cluster Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Fri Dec 21 06:38:13 2018 (r342296) +++ head/sbin/mdconfig/mdconfig.c Fri Dec 21 08:15:31 2018 (r342297) @@ -88,7 +88,7 @@ usage(void) " mdconfig -l [-v] [-n] [-f file] [-u unit]\n" " mdconfig file\n"); fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); - fprintf(stderr, "\t\toption = {cluster, compress, force,\n"); + fprintf(stderr, "\t\toption = {cache, cluster, compress, force,\n"); fprintf(stderr, "\t\t readonly, reserve, ro, verify}\n"); fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB), \n"); @@ -178,6 +178,10 @@ main(int argc, char **argv) mdio.md_options |= MD_ASYNC; else if (!strcmp(optarg, "noasync")) mdio.md_options &= ~MD_ASYNC; + else if (!strcmp(optarg, "cache")) + mdio.md_options |= MD_CACHE; + else if (!strcmp(optarg, "nocache")) + mdio.md_options &= ~MD_CACHE; else if (!strcmp(optarg, "cluster")) mdio.md_options |= MD_CLUSTER; else if (!strcmp(optarg, "nocluster")) Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri Dec 21 06:38:13 2018 (r342296) +++ head/sys/dev/md/md.c Fri Dec 21 08:15:31 2018 (r342297) @@ -880,7 +880,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) struct buf *pb; bus_dma_segment_t *vlist; struct thread *td; - off_t iolen, len, zerosize; + off_t iolen, iostart, len, zerosize; int ma_offs, npages; switch (bp->bio_cmd) { @@ -983,13 +983,10 @@ unmapped_step: auio.uio_iov = &aiov; auio.uio_iovcnt = 1; } - /* - * When reading set IO_DIRECT to try to avoid double-caching - * the data. When writing IO_DIRECT is not optimal. - */ + iostart = auio.uio_offset; if (auio.uio_rw == UIO_READ) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_READ(vp, &auio, IO_DIRECT, sc->cred); + error = VOP_READ(vp, &auio, 0, sc->cred); VOP_UNLOCK(vp, 0); } else { (void) vn_start_write(vp, &mp, V_WAIT); @@ -1002,6 +999,11 @@ unmapped_step: sc->flags &= ~MD_VERIFY; } + /* When MD_CACHE is set, try to avoid double-caching the data. */ + if (error == 0 && (sc->flags & MD_CACHE) == 0) + VOP_ADVISE(vp, iostart, auio.uio_offset - 1, + POSIX_FADV_DONTNEED); + if (pb != NULL) { pmap_qremove((vm_offset_t)pb->b_data, npages); if (error == 0) { @@ -1464,7 +1466,8 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, st sc->fwheads = mdr->md_fwheads; snprintf(sc->ident, sizeof(sc->ident), "MD-DEV%ju-INO%ju", (uintmax_t)vattr.va_fsid, (uintmax_t)vattr.va_fileid); - sc->flags = mdr->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY); + sc->flags = mdr->md_options & (MD_ASYNC | MD_CACHE | MD_FORCE | + MD_VERIFY); if (!(flags & FWRITE)) sc->flags |= MD_READONLY; sc->vnode = nd.ni_vp; @@ -2184,6 +2187,9 @@ g_md_dumpconf(struct sbuf *sb, const char *indent, str g_conf_printf_escaped(sb, "%s", mp->file); sbuf_printf(sb, "\n"); } + if (mp->type == MD_VNODE) + sbuf_printf(sb, "%s%s\n", indent, + (mp->flags & MD_CACHE) == 0 ? "off": "on"); sbuf_printf(sb, "%s\n"); Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Fri Dec 21 06:38:13 2018 (r342296) +++ head/sys/sys/mdioctl.h Fri Dec 21 08:15:31 2018 (r342297) @@ -92,5 +92,6 @@ struct md_ioctl { #define MD_FORCE 0x20 /* Don't try to prevent foot-shooting */ #define MD_ASYNC 0x40 /* Asynchronous mode */ #define MD_VERIFY 0x80 /* Open file with O_VERIFY (vnode only) */ +#define MD_CACHE 0x100 /* Cache vnode data */ #endif /* _SYS_MDIOCTL_H_*/ From owner-svn-src-head@freebsd.org Fri Dec 21 10:41: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 3E5301344C81; Fri, 21 Dec 2018 10:41:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D889A90A95; Fri, 21 Dec 2018 10:41:45 +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 CA9D5C3F9; Fri, 21 Dec 2018 10:41:45 +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 wBLAfjNs095539; Fri, 21 Dec 2018 10:41:45 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLAfjSB095538; Fri, 21 Dec 2018 10:41:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201812211041.wBLAfjSB095538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 21 Dec 2018 10:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342298 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 342298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D889A90A95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 10:41:46 -0000 Author: ae Date: Fri Dec 21 10:41:45 2018 New Revision: 342298 URL: https://svnweb.freebsd.org/changeset/base/342298 Log: Allow use underscores and dots in service names without escaping. PR: 234237 MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Dec 21 08:15:31 2018 (r342297) +++ head/sbin/ipfw/ipfw2.c Fri Dec 21 10:41:45 2018 (r342298) @@ -940,7 +940,8 @@ strtoport(char *s, char **end, int base, int proto) /* * find separator. '\\' escapes the next char. */ - for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\') ; s1++) + for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\' || + *s1 == '_' || *s1 == '.') ; s1++) if (*s1 == '\\' && s1[1] != '\0') s1++; From owner-svn-src-head@freebsd.org Fri Dec 21 11:32: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 EA4F9134628E; Fri, 21 Dec 2018 11:32:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D426927EA; Fri, 21 Dec 2018 11:32:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7EF9ECCAA; Fri, 21 Dec 2018 11:32:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLBWt6J022293; Fri, 21 Dec 2018 11:32:55 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLBWteq022292; Fri, 21 Dec 2018 11:32:55 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812211132.wBLBWteq022292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 21 Dec 2018 11:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342299 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 342299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D426927EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 11:32:56 -0000 Author: vmaffione Date: Fri Dec 21 11:32:55 2018 New Revision: 342299 URL: https://svnweb.freebsd.org/changeset/base/342299 Log: netmap: pipes: make sure both ends use the same number of slots Modified: head/sys/dev/netmap/netmap_pipe.c Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Fri Dec 21 10:41:45 2018 (r342298) +++ head/sys/dev/netmap/netmap_pipe.c Fri Dec 21 11:32:55 2018 (r342299) @@ -782,9 +782,11 @@ netmap_get_pipe_na(struct nmreq_header *hdr, struct ne /* most fields are the same, copy from master and then fix */ *sna = *mna; sna->up.nm_mem = netmap_mem_get(mna->up.nm_mem); - /* swap the number of tx/rx rings */ + /* swap the number of tx/rx rings and slots */ sna->up.num_tx_rings = mna->up.num_rx_rings; + sna->up.num_tx_desc = mna->up.num_rx_desc; sna->up.num_rx_rings = mna->up.num_tx_rings; + sna->up.num_rx_desc = mna->up.num_tx_desc; snprintf(sna->up.name, sizeof(sna->up.name), "%s}%s", pna->name, pipe_id); sna->role = NM_PIPE_ROLE_SLAVE; error = netmap_attach_common(&sna->up); From owner-svn-src-head@freebsd.org Fri Dec 21 11:50: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 2C9BA13468A9; Fri, 21 Dec 2018 11:50:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2A7992E92; Fri, 21 Dec 2018 11:50:15 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B1135CE70; Fri, 21 Dec 2018 11:50:15 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLBoFcU027967; Fri, 21 Dec 2018 11:50:15 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLBoFEY027965; Fri, 21 Dec 2018 11:50:15 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812211150.wBLBoFEY027965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 21 Dec 2018 11:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342300 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 342300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2A7992E92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 11:50:16 -0000 Author: vmaffione Date: Fri Dec 21 11:50:14 2018 New Revision: 342300 URL: https://svnweb.freebsd.org/changeset/base/342300 Log: netmap: move buf_size validation code to its own function This code validates the netmap buf_size against the interface MTU and maximum descriptor size, to make sure the values are consistent. Moving this functionality to its own function is needed because this function is also called by Linux-specific code. MFC after: 3 days Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Dec 21 11:32:55 2018 (r342299) +++ head/sys/dev/netmap/netmap.c Fri Dec 21 11:50:14 2018 (r342300) @@ -449,7 +449,7 @@ ports attached to the switch) #include /* bus_dmamap_* */ #include #include -#include /* ETHER_BPF_MTAP */ +#include /* ETHER_BPF_MTAP */ #elif defined(linux) @@ -2117,6 +2117,53 @@ netmap_csb_validate(struct netmap_priv_d *priv, struct return 0; } +/* Ensure that the netmap adapter can support the given MTU. + * @return EINVAL if the na cannot be set to mtu, 0 otherwise. + */ +int +netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu) { + unsigned nbs = NETMAP_BUF_SIZE(na); + + if (mtu <= na->rx_buf_maxsize) { + /* The MTU fits a single NIC slot. We only + * Need to check that netmap buffers are + * large enough to hold an MTU. NS_MOREFRAG + * cannot be used in this case. */ + if (nbs < mtu) { + nm_prerr("error: netmap buf size (%u) " + "< device MTU (%u)", nbs, mtu); + return EINVAL; + } + } else { + /* More NIC slots may be needed to receive + * or transmit a single packet. Check that + * the adapter supports NS_MOREFRAG and that + * netmap buffers are large enough to hold + * the maximum per-slot size. */ + if (!(na->na_flags & NAF_MOREFRAG)) { + nm_prerr("error: large MTU (%d) needed " + "but %s does not support " + "NS_MOREFRAG", mtu, + na->ifp->if_xname); + return EINVAL; + } else if (nbs < na->rx_buf_maxsize) { + nm_prerr("error: using NS_MOREFRAG on " + "%s requires netmap buf size " + ">= %u", na->ifp->if_xname, + na->rx_buf_maxsize); + return EINVAL; + } else { + nm_prinf("info: netmap application on " + "%s needs to support " + "NS_MOREFRAG " + "(MTU=%u,netmap_buf_size=%u)", + na->ifp->if_xname, mtu, nbs); + } + } + return 0; +} + + /* * possibly move the interface to netmap-mode. * If success it returns a pointer to netmap_if, otherwise NULL. @@ -2226,11 +2273,10 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net */ if (na->ifp && nm_priv_rx_enabled(priv)) { /* This netmap adapter is attached to an ifnet. */ - unsigned nbs = NETMAP_BUF_SIZE(na); unsigned mtu = nm_os_ifnet_mtu(na->ifp); ND("%s: mtu %d rx_buf_maxsize %d netmap_buf_size %d", - na->name, mtu, na->rx_buf_maxsize, nbs); + na->name, mtu, na->rx_buf_maxsize, NETMAP_BUF_SIZE(na)); if (na->rx_buf_maxsize == 0) { nm_prerr("%s: error: rx_buf_maxsize == 0", na->name); @@ -2238,45 +2284,9 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net goto err_drop_mem; } - if (mtu <= na->rx_buf_maxsize) { - /* The MTU fits a single NIC slot. We only - * Need to check that netmap buffers are - * large enough to hold an MTU. NS_MOREFRAG - * cannot be used in this case. */ - if (nbs < mtu) { - nm_prerr("error: netmap buf size (%u) " - "< device MTU (%u)", nbs, mtu); - error = EINVAL; - goto err_drop_mem; - } - } else { - /* More NIC slots may be needed to receive - * or transmit a single packet. Check that - * the adapter supports NS_MOREFRAG and that - * netmap buffers are large enough to hold - * the maximum per-slot size. */ - if (!(na->na_flags & NAF_MOREFRAG)) { - nm_prerr("error: large MTU (%d) needed " - "but %s does not support " - "NS_MOREFRAG", mtu, - na->ifp->if_xname); - error = EINVAL; - goto err_drop_mem; - } else if (nbs < na->rx_buf_maxsize) { - nm_prerr("error: using NS_MOREFRAG on " - "%s requires netmap buf size " - ">= %u", na->ifp->if_xname, - na->rx_buf_maxsize); - error = EINVAL; - goto err_drop_mem; - } else { - nm_prinf("info: netmap application on " - "%s needs to support " - "NS_MOREFRAG " - "(MTU=%u,netmap_buf_size=%u)", - na->ifp->if_xname, mtu, nbs); - } - } + error = netmap_buf_size_validate(na, mtu); + if (error) + goto err_drop_mem; } /* Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Dec 21 11:32:55 2018 (r342299) +++ head/sys/dev/netmap/netmap_kern.h Fri Dec 21 11:50:14 2018 (r342300) @@ -1454,6 +1454,7 @@ void netmap_set_all_rings(struct netmap_adapter *, int void netmap_disable_all_rings(struct ifnet *); void netmap_enable_all_rings(struct ifnet *); +int netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu); int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags); void netmap_do_unregif(struct netmap_priv_d *priv); From owner-svn-src-head@freebsd.org Fri Dec 21 13:56: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 ECB7C134A4A4; Fri, 21 Dec 2018 13:56:58 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F71A9772A; Fri, 21 Dec 2018 13:56:58 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 95A11E489; Fri, 21 Dec 2018 13:56:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLDuvXJ097891; Fri, 21 Dec 2018 13:56:57 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLDuvED097890; Fri, 21 Dec 2018 13:56:57 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812211356.wBLDuvED097890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 21 Dec 2018 13:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342301 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 342301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F71A9772A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 13:56:59 -0000 Author: vmaffione Date: Fri Dec 21 13:56:57 2018 New Revision: 342301 URL: https://svnweb.freebsd.org/changeset/base/342301 Log: netmap: nmreplay: import various fixes from upstream (2704a51839906) Changelist: - General reformatting - Fix packet duplication in cons(). Whenever cons() reached the burst limit it would send all pending packets without advancing head. This caused the last injected packet to be sent again in the next round. - Fix full-speed transmissions after first loop. MFC after: 3 days Modified: head/tools/tools/netmap/nmreplay.c Modified: head/tools/tools/netmap/nmreplay.c ============================================================================== --- head/tools/tools/netmap/nmreplay.c Fri Dec 21 11:50:14 2018 (r342300) +++ head/tools/tools/netmap/nmreplay.c Fri Dec 21 13:56:57 2018 (r342301) @@ -26,72 +26,69 @@ */ -#if 0 /* COMMENT */ +/* + * This program implements NMREPLAY, a program to replay a pcap file + * enforcing the output rate and possibly random losses and delay + * distributions. + * It is meant to be run from the command line and implemented with a main + * control thread for monitoring, plus a thread to push packets out. + * + * The control thread parses command line arguments, prepares a + * schedule for transmission in a memory buffer and then sits + * in a loop where it periodically reads traffic statistics from + * the other threads and prints them out on the console. + * + * The transmit buffer contains headers and packets. Each header + * includes a timestamp that determines when the packet should be sent out. + * A "consumer" thread cons() reads from the queue and transmits packets + * on the output netmap port when their time has come. + * + * The program does CPU pinning and sets the scheduler and priority + * for the "cons" threads. Externally one should do the + * assignment of other threads (e.g. interrupt handlers) and + * make sure that network interfaces are configured properly. + * + * --- Main functions of the program --- + * within each function, q is used as a pointer to the queue holding + * packets and parameters. + * + * pcap_prod() + * + * reads from the pcap file and prepares packets to transmit. + * After reading a packet from the pcap file, the following information + * are extracted which can be used to determine the schedule: + * + * q->cur_pkt points to the buffer containing the packet + * q->cur_len packet length, excluding CRC + * q->cur_caplen available packet length (may be shorter than cur_len) + * q->cur_tt transmission time for the packet, computed from the trace. + * + * The following functions are then called in sequence: + * + * q->c_loss (set with the -L command line option) decides + * whether the packet should be dropped before even queuing. + * This is generally useful to emulate random loss. + * The function is supposed to set q->c_drop = 1 if the + * packet should be dropped, or leave it to 0 otherwise. + * + * q->c_bw (set with the -B command line option) is used to + * enforce the transmit bandwidth. The function must store + * in q->cur_tt the transmission time (in nanoseconds) of + * the packet, which is typically proportional to the length + * of the packet, i.e. q->cur_tt = q->cur_len / + * Variants are possible, eg. to account for constant framing + * bits as on the ethernet, or variable channel acquisition times, + * etc. + * This mechanism can also be used to simulate variable queueing + * delay e.g. due to the presence of cross traffic. + * + * q->c_delay (set with the -D option) implements delay emulation. + * The function should set q->cur_delay to the additional + * delay the packet is subject to. The framework will take care of + * computing the actual exit time of a packet so that there is no + * reordering. + */ -This program implements NMREPLAY, a program to replay a pcap file -enforcing the output rate and possibly random losses and delay -distributions. -It is meant to be run from the command line and implemented with a main -control thread for monitoring, plus a thread to push packets out. - -The control thread parses command line arguments, prepares a -schedule for transmission in a memory buffer and then sits -in a loop where it periodically reads traffic statistics from -the other threads and prints them out on the console. - -The transmit buffer contains headers and packets. Each header -includes a timestamp that determines when the packet should be sent out. -A "consumer" thread cons() reads from the queue and transmits packets -on the output netmap port when their time has come. - -The program does CPU pinning and sets the scheduler and priority -for the "cons" threads. Externally one should do the -assignment of other threads (e.g. interrupt handlers) and -make sure that network interfaces are configured properly. - ---- Main functions of the program --- -within each function, q is used as a pointer to the queue holding -packets and parameters. - -pcap_prod() - - reads from the pcap file and prepares packets to transmit. - After reading a packet from the pcap file, the following information - are extracted which can be used to determine the schedule: - - q->cur_pkt points to the buffer containing the packet - q->cur_len packet length, excluding CRC - q->cur_caplen available packet length (may be shorter than cur_len) - q->cur_tt transmission time for the packet, computed from the trace. - - The following functions are then called in sequence: - - q->c_loss (set with the -L command line option) decides - whether the packet should be dropped before even queuing. - This is generally useful to emulate random loss. - The function is supposed to set q->c_drop = 1 if the - packet should be dropped, or leave it to 0 otherwise. - - q->c_bw (set with the -B command line option) is used to - enforce the transmit bandwidth. The function must store - in q->cur_tt the transmission time (in nanoseconds) of - the packet, which is typically proportional to the length - of the packet, i.e. q->cur_tt = q->cur_len / - Variants are possible, eg. to account for constant framing - bits as on the ethernet, or variable channel acquisition times, - etc. - This mechanism can also be used to simulate variable queueing - delay e.g. due to the presence of cross traffic. - - q->c_delay (set with the -D option) implements delay emulation. - The function should set q->cur_delay to the additional - delay the packet is subject to. The framework will take care of - computing the actual exit time of a packet so that there is no - reordering. - - -#endif /* COMMENT */ - // debugging macros #define NED(_fmt, ...) do {} while (0) #define ED(_fmt, ...) \ @@ -117,21 +114,20 @@ pcap_prod() /* * -A packet in the queue is q_pkt plus the payload. - -For the packet descriptor we need the following: - - - position of next packet in the queue (can go backwards). - We can reduce to 32 bits if we consider alignments, - or we just store the length to be added to the current - value and assume 0 as a special index. - - actual packet length (16 bits may be ok) - - queue output time, in nanoseconds (64 bits) - - delay line output time, in nanoseconds - One of the two can be packed to a 32bit value - -A convenient coding uses 32 bytes per packet. - + * A packet in the queue is q_pkt plus the payload. + * + * For the packet descriptor we need the following: + * + * - position of next packet in the queue (can go backwards). + * We can reduce to 32 bits if we consider alignments, + * or we just store the length to be added to the current + * value and assume 0 as a special index. + * - actual packet length (16 bits may be ok) + * - queue output time, in nanoseconds (64 bits) + * - delay line output time, in nanoseconds + * One of the two can be packed to a 32bit value + * + * A convenient coding uses 32 bytes per packet. */ struct q_pkt { @@ -411,7 +407,7 @@ readpcap(const char *fn) * average bandwidth of the trace, as follows * first_pkt_ts = p[0].len / avg_bw * In turn avg_bw = (total_len - p[0].len)/(p[n-1].ts - p[0].ts) - * so + * so * first_ts = p[0].ts - p[0].len * (p[n-1].ts - p[0].ts) / (total_len - p[0].len) */ if (pf->tot_bytes == first_len) { @@ -773,7 +769,7 @@ pcap_prod(void *_pa) need = loops * pf->tot_bytes_rounded + sizeof(struct q_pkt); q->buf = calloc(1, need); if (q->buf == NULL) { - D("alloc %ld bytes for queue failed, exiting",(_P64)need); + D("alloc %lld bytes for queue failed, exiting",(long long)need); goto fail; } q->prod_head = q->prod_tail = 0; @@ -834,7 +830,7 @@ pcap_prod(void *_pa) /* insure no reordering and spacing by transmission time */ q->qt_tx = (t_tx >= q->qt_tx + tt) ? t_tx : q->qt_tx + tt; enq(q); - + q->tx++; ND("ins %d q->prod_tail = %lu", (int)insert, (unsigned long)q->prod_tail); } @@ -881,6 +877,7 @@ cons(void *_pa) * add to q->t0 the time for the last packet */ q->t0 += last_ts; + set_tns_now(&q->cons_now, q->t0); q->cons_head = 0; //restart from beginning of the queue continue; } @@ -896,9 +893,7 @@ cons(void *_pa) continue; } /* XXX copy is inefficient but simple */ - pending++; - if (nm_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0 || - pending > q->burst) { + if (nm_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0) { RD(1, "inject failed len %d now %ld tx %ld h %ld t %ld next %ld", (int)p->pktlen, (u_long)q->cons_now, (u_long)p->pt_tx, (u_long)q->_head, (u_long)q->_tail, (u_long)p->next); @@ -906,6 +901,12 @@ cons(void *_pa) pending = 0; continue; } + pending++; + if (pending > q->burst) { + ioctl(pa->pb->fd, NIOCTXSYNC, 0); + pending = 0; + } + q->cons_head = p->next; /* drain packets from the queue */ q->rx++; @@ -973,7 +974,7 @@ usage(void) { fprintf(stderr, "usage: nmreplay [-v] [-D delay] [-B {[constant,]bps|ether,bps|real,speedup}] [-L loss]\n" - "\t[-b burst] -i ifa-or-pcap-file -i ifb\n"); + "\t[-b burst] -f pcap-file -i \n"); exit(1); } @@ -1263,9 +1264,9 @@ main(int argc, char **argv) struct _qs *q0 = &bp[0].q; sleep(1); - ED("%ld -> %ld maxq %d round %ld", - (_P64)(q0->rx - olda.rx), (_P64)(q0->tx - olda.tx), - q0->rx_qmax, (_P64)q0->prod_max_gap + ED("%lld -> %lld maxq %d round %lld", + (long long)(q0->rx - olda.rx), (long long)(q0->tx - olda.tx), + q0->rx_qmax, (long long)q0->prod_max_gap ); ED("plr nominal %le actual %le", (double)(q0->c_loss.d[0])/(1<<24), @@ -1531,7 +1532,7 @@ uniform_delay_parse(struct _qs *q, struct _cfg *dst, i dmax = parse_time(av[2]); if (dmin == U_PARSE_ERR || dmax == U_PARSE_ERR || dmin > dmax) return 1; - D("dmin %ld dmax %ld", (_P64)dmin, (_P64)dmax); + D("dmin %lld dmax %lld", (long long)dmin, (long long)dmax); dst->d[0] = dmin; dst->d[1] = dmax; dst->d[2] = dmax - dmin; @@ -1594,22 +1595,22 @@ exp_delay_run(struct _qs *q, struct _cfg *arg) { uint64_t *t = (uint64_t *)arg->arg; q->cur_delay = t[my_random24() & (PTS_D_EXP - 1)]; - RD(5, "delay %lu", (_P64)q->cur_delay); + RD(5, "delay %llu", (unsigned long long)q->cur_delay); return 0; } /* unused arguments in configuration */ -#define _CFG_END NULL, 0, {0}, {0} +#define TLEM_CFG_END NULL, 0, {0}, {0} static struct _cfg delay_cfg[] = { { const_delay_parse, const_delay_run, - "constant,delay", _CFG_END }, + "constant,delay", TLEM_CFG_END }, { uniform_delay_parse, uniform_delay_run, - "uniform,dmin,dmax # dmin <= dmax", _CFG_END }, + "uniform,dmin,dmax # dmin <= dmax", TLEM_CFG_END }, { exp_delay_parse, exp_delay_run, - "exp,dmin,davg # dmin <= davg", _CFG_END }, - { NULL, NULL, NULL, _CFG_END } + "exp,dmin,davg # dmin <= davg", TLEM_CFG_END }, + { NULL, NULL, NULL, TLEM_CFG_END } }; /* standard bandwidth, also accepts just a number */ @@ -1702,12 +1703,12 @@ real_bw_run(struct _qs *q, struct _cfg *arg) static struct _cfg bw_cfg[] = { { const_bw_parse, const_bw_run, - "constant,bps", _CFG_END }, + "constant,bps", TLEM_CFG_END }, { ether_bw_parse, ether_bw_run, - "ether,bps", _CFG_END }, + "ether,bps", TLEM_CFG_END }, { real_bw_parse, real_bw_run, - "real,scale", _CFG_END }, - { NULL, NULL, NULL, _CFG_END } + "real,scale", TLEM_CFG_END }, + { NULL, NULL, NULL, TLEM_CFG_END } }; /* @@ -1813,8 +1814,8 @@ const_ber_run(struct _qs *q, struct _cfg *arg) static struct _cfg loss_cfg[] = { { const_plr_parse, const_plr_run, - "plr,prob # 0 <= prob <= 1", _CFG_END }, + "plr,prob # 0 <= prob <= 1", TLEM_CFG_END }, { const_ber_parse, const_ber_run, - "ber,prob # 0 <= prob <= 1", _CFG_END }, - { NULL, NULL, NULL, _CFG_END } + "ber,prob # 0 <= prob <= 1", TLEM_CFG_END }, + { NULL, NULL, NULL, TLEM_CFG_END } }; From owner-svn-src-head@freebsd.org Fri Dec 21 14:45: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 4D874134B97D; Fri, 21 Dec 2018 14:45:11 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E49FF6ADAF; Fri, 21 Dec 2018 14:45:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D75F7ED23; Fri, 21 Dec 2018 14:45:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLEjA1q025760; Fri, 21 Dec 2018 14:45:10 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLEjAvZ025758; Fri, 21 Dec 2018 14:45:10 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812211445.wBLEjAvZ025758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 21 Dec 2018 14:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342302 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 342302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E49FF6ADAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 14:45:11 -0000 Author: vmaffione Date: Fri Dec 21 14:45:10 2018 New Revision: 342302 URL: https://svnweb.freebsd.org/changeset/base/342302 Log: netmap: update nmreplay(8) Small modifications to the nmreplay man page. Used igor and mandoc tools to fix warnings and errors. Reviewed by: bcr MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18629 Modified: head/tools/tools/netmap/nmreplay.8 Modified: head/tools/tools/netmap/nmreplay.8 ============================================================================== --- head/tools/tools/netmap/nmreplay.8 Fri Dec 21 13:56:57 2018 (r342301) +++ head/tools/tools/netmap/nmreplay.8 Fri Dec 21 14:45:10 2018 (r342302) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2016 -.Dt NMREPLAY 1 +.Dd December 21, 2018 +.Dt NMREPLAY 8 .Os .Sh NAME .Nm nmreplay @@ -43,6 +43,8 @@ .Op Fl w Ar wait-link .Op Fl v .Op Fl C Ar cpu-placement +.El +.Ek .Sh DESCRIPTION .Nm works like @@ -63,6 +65,9 @@ Command line options are as follows Name of the pcap file to replay. .It Fl i Ar interface Name of the netmap interface to use as output. +See +.Xr netmap 4 +for interface name format. .It Fl v Enable verbose mode .It Fl b Ar batch-size @@ -71,7 +76,7 @@ Maximum batch size to use during transmissions. normally transmits packets one at a time, but it may use larger batches, up to the value specified with this option, when running at high rates. -.It Fl B Ar bps | Cm constant, Ns Ar bps | Cm ether, Ns Ar bps | Cm real Ns Op , Ns Ar speedup +.It Fl B Ar bps | Cm constant , Ns Ar bps | Cm ether , Ns Ar bps | Cm real Ns Op , Ns Ar speedup Bandwidth to be used for transmission. .Ar bps is a floating point number optionally follow by a character @@ -85,11 +90,12 @@ indicates that the ethernet framing (160 bits) and CRC will be included in the computation of the packet size. .Cm real means transmission will occur according to the timestamps -recorded in the trace. The optional +recorded in the trace. +The optional .Ar speedup multiplier (defaults to 1) indicates how much faster or slower than real time the trace should be replayed. -.It Fl D Ar dt | Cm constant, Ns Ar dt | Cm uniform, Ns Ar dmin,dmax | Cm exp, Ar dmin,davg +.It Fl D Ar dt | Cm constant , Ns Ar dt | Cm uniform , Ns Ar dmin,dmax | Cm exp , Ar dmin,davg Adds additional delay to the packet transmission, whose distribution can be constant, uniform or exponential. .Ar dt, dmin, dmax, avt @@ -98,7 +104,7 @@ by a character (s, m, u, n) to indicate seconds, milli microseconds, nanoseconds. The delay is added to the transmit time and adjusted so that there is never packet reordering. -.It Fl L Ar x | Cm plr, Ns Ar x | Cm ber, Ns Ar x +.It Fl L Ar x | Cm plr , Ns Ar x | Cm ber , Ns Ar x Simulates packet or bit errors, causing offending packets to be dropped. .Ar x is a floating point number indicating the packet or bit error rate. @@ -113,14 +119,7 @@ creates an in-memory schedule with all packets to be t and then launches a separate thread to take care of transmissions while the main thread reports statistics every second. .Sh SEE ALSO -.Pa http://info.iet.unipi.it/~luigi/netmap/ -.Pp -Luigi Rizzo, Revisiting network I/O APIs: the netmap framework, -Communications of the ACM, 55 (3), pp.45-51, March 2012 -.Pp -Luigi Rizzo, Giuseppe Lettieri, -VALE, a switched ethernet for virtual machines, -ACM CoNEXT'12, December 2012, Nice +.Xr netmap 4 .Sh AUTHORS .An -nosplit .Nm From owner-svn-src-head@freebsd.org Fri Dec 21 17:22: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 7B36B1351568; Fri, 21 Dec 2018 17:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AAA774620; Fri, 21 Dec 2018 17:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BE431891B; Fri, 21 Dec 2018 17:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHMFPn011620; Fri, 21 Dec 2018 17:22:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHMF3V011619; Fri, 21 Dec 2018 17:22:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812211722.wBLHMF3V011619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Dec 2018 17:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342349 - head/usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/ctladm X-SVN-Commit-Revision: 342349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AAA774620 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 17:22:16 -0000 Author: mav Date: Fri Dec 21 17:22:15 2018 New Revision: 342349 URL: https://svnweb.freebsd.org/changeset/base/342349 Log: Fix passing wrong variables to nvlist_destroy() after r333446. Reported by: Alexander Fedorov (IT-Grad.ru) MFC after: 5 days Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Fri Dec 21 17:18:33 2018 (r342348) +++ head/usr.sbin/ctladm/ctladm.c Fri Dec 21 17:22:15 2018 (r342349) @@ -667,7 +667,7 @@ cctl_port(int fd, int argc, char **argv, char *combine } bailout: - nvlist_destroy(req.args_nvl); + nvlist_destroy(option_list); free(driver); return (retval); @@ -2542,7 +2542,7 @@ cctl_create_lun(int fd, int argc, char **argv, char *c fprintf(stdout, "Device ID: %s\n", req.reqdata.create.device_id); bailout: - nvlist_destroy(req.args_nvl); + nvlist_destroy(option_list); return (retval); } @@ -2644,7 +2644,7 @@ cctl_rm_lun(int fd, int argc, char **argv, char *combi printf("LUN %d removed successfully\n", lun_id); bailout: - nvlist_destroy(req.args_nvl); + nvlist_destroy(option_list); return (retval); } @@ -2764,7 +2764,7 @@ cctl_modify_lun(int fd, int argc, char **argv, char *c printf("LUN %d modified successfully\n", lun_id); bailout: - nvlist_destroy(req.args_nvl); + nvlist_destroy(option_list); return (retval); } From owner-svn-src-head@freebsd.org Fri Dec 21 18:38: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 235051353524; Fri, 21 Dec 2018 18:38:10 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (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 7E168770A7; Fri, 21 Dec 2018 18:38:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lj1-x22b.google.com with SMTP id s5-v6so5567354ljd.12; Fri, 21 Dec 2018 10:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=NFLLjTzBdx1FJ0oSOeMG0cvhg0zzKXMjtBxMXyUHBNw=; b=HlLzVjrFFHxx8RS/Iy6bb2D/OPxRUcFGUIZiPGLOHpEyyjr3aH3lrZERy9U8iwXWzl eUAA9F8NaC9aralqsd2U0Gtm8muBVFB6y6xyLmSzOQsbfgsyS1lnrvqYLoBBDOZtMvSY NBm+kC1wyMJlJmrRstXz6Q7ZDqCQ6y2Ukv8S5OfKXOZu6R/KE4a0hsKYso3gJIkivmOW ZFGbJNE1Kkmca1h92t9rx2ZukLXKb/9QUYb92tYs5vfL5yY1XnN81qDDJWfX+YJzdcWu YiVy9Cw7od5b5nUP8Qe2afzVDkAR0G2ImgfQSh3klpUw67l+wUKnGE4MFcq+W2yTzc7u 5FBw== 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:reply-to :from:date:message-id:subject:to:cc; bh=NFLLjTzBdx1FJ0oSOeMG0cvhg0zzKXMjtBxMXyUHBNw=; b=ShTGhVUjdoS0zN4kmKAPIZEIS5cwe+hcZAJVZKuQ5fMH97tHnWfdJeiKZEz2sDcOk1 XDJpW1P+ukz2GtvOaE/prJFib5G2ZHCln61wi8ryJTDrJ8TVk/SeKib+72ID+kDslKey LzkRZyhRn1RABiZaXMoGCf1xgSvsOr6ASuAKAihQ1UC3q/0NOUecotHeembqDyrNKpvV 38f786FxEojHJhntdCK8mDYGs6Wwqy9OtXu6w03d+I8WoRQzqvmh96zNUjVzCUbXLgV+ bSmR3a//vx8lJv9sHs2Ei8jO9BV12WKWzhtegip0heoRTDHb+26oU9D/M9Oeww7rr+5g IXzA== X-Gm-Message-State: AJcUukekD4IviMursxqfyalJFzjeCnqGUL4wkyYwi3VOFLrLLc9F5Jgf zO3tkzDlk4x4U08apCmGzryzN1y3+mi8aMQG9vMoPg== X-Google-Smtp-Source: ALg8bN7Yi7wqfzeEN1h05Dzu8/7Fe3xUpvhiGElqCNy8RrdLmRWDi1LPtUD4eyapldGZKgT3QabE3PVqk7thU+ao8CE= X-Received: by 2002:a2e:5c07:: with SMTP id q7-v6mr2433712ljb.119.1545417487687; Fri, 21 Dec 2018 10:38:07 -0800 (PST) MIME-Version: 1.0 References: <201812211722.wBLHMF3V011619@repo.freebsd.org> In-Reply-To: <201812211722.wBLHMF3V011619@repo.freebsd.org> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Sat, 22 Dec 2018 02:37:55 +0800 Message-ID: Subject: Re: svn commit: r342349 - head/usr.sbin/ctladm To: Alexander Motin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7E168770A7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 18:38:10 -0000 Em s=C3=A1b, 22 de dez de 2018 =C3=A0s 01:22, Alexander Motin escreveu: > Author: mav > Date: Fri Dec 21 17:22:15 2018 > New Revision: 342349 > URL: https://svnweb.freebsd.org/changeset/base/342349 > > Log: > Fix passing wrong variables to nvlist_destroy() after r333446. > > Reported by: Alexander Fedorov (IT-Grad.ru) > MFC after: 5 days > Thanks to fix that! Out of curiosity, that was reported by email, bugzilla or any other place? Best, > > Modified: > head/usr.sbin/ctladm/ctladm.c > > Modified: head/usr.sbin/ctladm/ctladm.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/ctladm/ctladm.c Fri Dec 21 17:18:33 2018 > (r342348) > +++ head/usr.sbin/ctladm/ctladm.c Fri Dec 21 17:22:15 2018 > (r342349) > @@ -667,7 +667,7 @@ cctl_port(int fd, int argc, char **argv, char *combin= e > } > > bailout: > - nvlist_destroy(req.args_nvl); > + nvlist_destroy(option_list); > free(driver); > return (retval); > > @@ -2542,7 +2542,7 @@ cctl_create_lun(int fd, int argc, char **argv, char > *c > fprintf(stdout, "Device ID: %s\n", > req.reqdata.create.device_id); > > bailout: > - nvlist_destroy(req.args_nvl); > + nvlist_destroy(option_list); > return (retval); > } > > @@ -2644,7 +2644,7 @@ cctl_rm_lun(int fd, int argc, char **argv, char > *combi > printf("LUN %d removed successfully\n", lun_id); > > bailout: > - nvlist_destroy(req.args_nvl); > + nvlist_destroy(option_list); > return (retval); > } > > @@ -2764,7 +2764,7 @@ cctl_modify_lun(int fd, int argc, char **argv, char > *c > printf("LUN %d modified successfully\n", lun_id); > > bailout: > - nvlist_destroy(req.args_nvl); > + nvlist_destroy(option_list); > return (retval); > } > > > --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Dec 21 18:58: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 7D07E1353C47; Fri, 21 Dec 2018 18:58:24 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 2756E77AAE; Fri, 21 Dec 2018 18:58:23 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x12a.google.com with SMTP id f23so4592366lfc.13; Fri, 21 Dec 2018 10:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=fCn5XU9C0ht+AID/hwJd1tG9FxfyK+NWapV3p5m7MP8=; b=CIllWTcNq4MNPV2oSodhaoMV6yg0QBLoM6Zb8BDwxkgxbo9wwA/TkiuJIvMdM5RSoL uaS4CfiTwhyMnhLdBGd0wHTS2e1beSRrs1xRaflJzt0cp0z3OnGOrV/dCNhb4Ijnsxc6 zBL92syVrIgFXLl6ZNV7agcju7iLLp5CchMNjDYGHG4ZSHR4jq/1Op/zTYUJlRT+G2QY fX1KjHW67qoWbtHbAtd7a6N6kGrbQffB4VbHUAfg/ZCBaIsF8nmjEcgdkUEDv/TUx80L xgFb61clk3rcyAXXfy7uqz9aQinmXVC7XrN44opPFNFEni6XYrWTgGG8UmQBeXu4bB0e aAiw== 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:reply-to :from:date:message-id:subject:to:cc; bh=fCn5XU9C0ht+AID/hwJd1tG9FxfyK+NWapV3p5m7MP8=; b=O335RT6Omaf+Xv+be+59NPzESV63JTQY+QF4P5Fj1BBCC6he0uoAOi6vJ6pHB81f2e 66vQ5Hqi/6RHqpkQzWsUITzQeopkuwjL5S2v1qputuEue/rPf/3hTJEsv62ZTLyrPpZa vk+p65vI4ilVO3L8/R60yWLdcXx8gh5vTrzcU0gtj5sjJ/ydG6fSnoWZmBQ6rDzZJcKH S7OIb1ekqOLme699g55GI+PSfuyzA61ZKNQHMndC9/te31uZdQmGIDnQesuhwItRYK0b dVBz0dOatXdtyJoDjvZHsWRsMdsvp1/0sV4eKw2YBl1T5qzNoExJE+x/omWUI45VZJhk /DCg== X-Gm-Message-State: AA+aEWakz0l1RLYoaAKfSNyT2sjEivdsZdPC9xQzd2jXw9DoGr5YRadn 3l4u0+ZTtfCJpvq5TQGIPeElGY7Ibj49EnwnsF9Vmg== X-Google-Smtp-Source: AFSGD/W27vYeH/m9B3JX4vTkEx/YEPBYD8HwiTN3cVxpM2Qb3/tvpO+5DXgcIn5KkNQ50jCnOLRaqY+SGTOLdoDX3H4= X-Received: by 2002:a19:2755:: with SMTP id n82mr1974624lfn.94.1545418701372; Fri, 21 Dec 2018 10:58:21 -0800 (PST) MIME-Version: 1.0 References: <201812211722.wBLHMF3V011619@repo.freebsd.org> <535835db-5220-e660-b464-8400ae407249@FreeBSD.org> In-Reply-To: <535835db-5220-e660-b464-8400ae407249@FreeBSD.org> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Sat, 22 Dec 2018 02:58:19 +0800 Message-ID: Subject: Re: svn commit: r342349 - head/usr.sbin/ctladm To: Alexander Motin Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 2756E77AAE X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=CIllWTcN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of araujobsdport@gmail.com designates 2a00:1450:4864:20::12a as permitted sender) smtp.mailfrom=araujobsdport@gmail.com X-Spamd-Result: default: False [2.19 / 15.00]; HAS_REPLYTO(0.00)[araujo@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.58)[-0.576,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; RSPAMD_URIBL(4.50)[it-grad.ru]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.25)[0.248,0]; BAD_REP_POLICIES(0.10)[]; IP_SCORE(-2.44)[ip: (-9.04), ipnet: 2a00:1450::/32(-1.65), asn: 15169(-1.44), country: US(-0.08)]; NEURAL_SPAM_LONG(0.48)[0.477,0]; RCVD_IN_DNSWL_NONE(0.00)[a.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 18:58:24 -0000 Em s=C3=A1b, 22 de dez de 2018 =C3=A0s 02:53, Alexander Motin escreveu: > On 21.12.2018 13:37, Marcelo Araujo wrote: > > Em s=C3=A1b, 22 de dez de 2018 =C3=A0s 01:22, Alexander Motin > > escreveu: > > > > Author: mav > > Date: Fri Dec 21 17:22:15 2018 > > New Revision: 342349 > > URL: https://svnweb.freebsd.org/changeset/base/342349 > > > > Log: > > Fix passing wrong variables to nvlist_destroy() after r333446. > > > > Reported by: Alexander Fedorov (IT-Grad.ru) > > MFC after: 5 days > > > > > > Thanks to fix that! > > Welcome. > > > Out of curiosity, that was reported by email, bugzilla or any other > place? > Directly to me via OpenZFS slack. > > -- > Alexander Motin > Thank you! Best, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Dec 21 20:12: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 C52EA1355818; Fri, 21 Dec 2018 20:12:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67FB082061; Fri, 21 Dec 2018 20:12:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5B6E91A663; Fri, 21 Dec 2018 20:12:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLKCii9002372; Fri, 21 Dec 2018 20:12:44 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLKCiNc002371; Fri, 21 Dec 2018 20:12:44 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812212012.wBLKCiNc002371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Dec 2018 20:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342353 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 342353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67FB082061 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 20:12:44 -0000 Author: bde Date: Fri Dec 21 20:12:43 2018 New Revision: 342353 URL: https://svnweb.freebsd.org/changeset/base/342353 Log: Quick fix for initialization of mnt_iosize_max. (This limit controls mainly clustering and read-ahead.) Copy the initialization from ffs, and also copy a couple of lines of ffs's nearby style for initialization order and whitespace. A correct fix would de-duplicate the initialization and fix bitrot in it instead of adding another instance of the duplication. Complications to use the size preferred by the device have been reduced to hard-coding slightly pessimal and/or inconsistent defaults, using large code that was almost needed to support the complications. For msdosfs, the result was that mnt_iosize_max was DFTLPHYS (64K) but is now MAXPHYS (128K). Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Dec 21 17:26:22 2018 (r342352) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Dec 21 20:12:43 2018 (r342353) @@ -418,9 +418,12 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) return (error); } dev_ref(dev); - VOP_UNLOCK(devvp, 0); - bo = &devvp->v_bufobj; + VOP_UNLOCK(devvp, 0); + if (dev->si_iosize_max != 0) + mp->mnt_iosize_max = dev->si_iosize_max; + if (mp->mnt_iosize_max > MAXPHYS) + mp->mnt_iosize_max = MAXPHYS; /* * Read the boot sector of the filesystem, and then check the From owner-svn-src-head@freebsd.org Fri Dec 21 20:29: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 724D91355D8A; Fri, 21 Dec 2018 20:29:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1184282A09; Fri, 21 Dec 2018 20:29:18 +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 032A21A84C; Fri, 21 Dec 2018 20:29:18 +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 wBLKTHKO008397; Fri, 21 Dec 2018 20:29:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLKTHx4008393; Fri, 21 Dec 2018 20:29:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812212029.wBLKTHx4008393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Dec 2018 20:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342354 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 342354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1184282A09 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 20:29:18 -0000 Author: cem Date: Fri Dec 21 20:29:16 2018 New Revision: 342354 URL: https://svnweb.freebsd.org/changeset/base/342354 Log: mps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify In the event that the ID command timed out, mps(4)/mpr(4) did not free the command until it could be cancelled. However, it freed the associated buffer (cm_data). Fix the lifetime issue by freeing the associated buffer only after Abort Task or controller reset. Reviewed by: scottl Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18612 Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Fri Dec 21 20:12:43 2018 (r342353) +++ head/sys/dev/mpr/mpr_sas.c Fri Dec 21 20:29:16 2018 (r342354) @@ -1169,6 +1169,12 @@ mprsas_complete_all_commands(struct mpr_softc *sc) cm->cm_reply = NULL; completed = 0; + if (cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) { + MPASS(cm->cm_data); + free(cm->cm_data, M_MPR); + cm->cm_data = NULL; + } + if (cm->cm_flags & MPR_CM_FLAGS_POLLED) cm->cm_flags |= MPR_CM_FLAGS_COMPLETE; Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Fri Dec 21 20:12:43 2018 (r342353) +++ head/sys/dev/mpr/mpr_sas_lsi.c Fri Dec 21 20:29:16 2018 (r342354) @@ -1026,6 +1026,7 @@ out: for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; if (cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) { + free(cm->cm_data, M_MPR); mpr_free_command(sc, cm); } } @@ -1208,15 +1209,14 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 han out: /* * If the SATA_ID_TIMEOUT flag has been set for this command, don't free - * it. The command will be freed after sending a target reset TM. If - * the command did timeout, use EWOULDBLOCK. + * it. The command and buffer will be freed after sending an Abort + * Task TM. If the command did timeout, use EWOULDBLOCK. */ - if ((cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) == 0) + if ((cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) == 0) { mpr_free_command(sc, cm); - else if (error == 0) + free(buffer, M_MPR); + } else if (error == 0) error = EWOULDBLOCK; - cm->cm_data = NULL; - free(buffer, M_MPR); return (error); } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Dec 21 20:12:43 2018 (r342353) +++ head/sys/dev/mps/mps_sas.c Fri Dec 21 20:29:16 2018 (r342354) @@ -1108,6 +1108,12 @@ mpssas_complete_all_commands(struct mps_softc *sc) cm->cm_reply = NULL; completed = 0; + if (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) { + MPASS(cm->cm_data); + free(cm->cm_data, M_MPT2); + cm->cm_data = NULL; + } + if (cm->cm_flags & MPS_CM_FLAGS_POLLED) cm->cm_flags |= MPS_CM_FLAGS_COMPLETE; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Fri Dec 21 20:12:43 2018 (r342353) +++ head/sys/dev/mps/mps_sas_lsi.c Fri Dec 21 20:29:16 2018 (r342354) @@ -818,6 +818,7 @@ out: for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; if (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) { + free(cm->cm_data, M_MPT2); mps_free_command(sc, cm); } } @@ -1000,15 +1001,15 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 han out: /* * If the SATA_ID_TIMEOUT flag has been set for this command, don't free - * it. The command will be freed after sending a target reset TM. If - * the command did timeout, use EWOULDBLOCK. + * it. The command and buffer will be freed after sending an Abort + * Task TM. If the command did timeout, use EWOULDBLOCK. */ if ((cm != NULL) - && (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) == 0) + && (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) == 0) { mps_free_command(sc, cm); - else if (error == 0) + free(buffer, M_MPT2); + } else if (error == 0) error = EWOULDBLOCK; - free(buffer, M_MPT2); return (error); } From owner-svn-src-head@freebsd.org Fri Dec 21 20:30: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 BD7231355FA6; Fri, 21 Dec 2018 20:30:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC6082D3C; Fri, 21 Dec 2018 20:30:54 +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 4C09A1A870; Fri, 21 Dec 2018 20:30:54 +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 wBLKUsf2009276; Fri, 21 Dec 2018 20:30:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLKUrTr009269; Fri, 21 Dec 2018 20:30:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812212030.wBLKUrTr009269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Dec 2018 20:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342355 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 342355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AC6082D3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 20:30:55 -0000 Author: cem Date: Fri Dec 21 20:30:52 2018 New Revision: 342355 URL: https://svnweb.freebsd.org/changeset/base/342355 Log: mps(4), mpr(4): remove SATA ID command cancellation hack Add a generic mechanism to override mp?_wait_command's timeout behavior, which continues to invoke reinit by default. Invokers who set cm_timeout_handler may avoid automatic reinit and do their own handling. Adapt mp?sas_get_sata_identify to this mechanism and remove its callout hack. Reviewed by: scottl Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18614 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mpr/mpr.c Fri Dec 21 20:30:52 2018 (r342355) @@ -3815,12 +3815,15 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm } if (error == EWOULDBLOCK) { - mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s, timeout=%d," - " elapsed=%jd\n", __func__, timeout, - (intmax_t)cur_time.tv_sec); - rc = mpr_reinit(sc); - mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? "success" : - "failed"); + if (cm->cm_timeout_handler == NULL) { + mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s, timeout=%d," + " elapsed=%jd\n", __func__, timeout, + (intmax_t)cur_time.tv_sec); + rc = mpr_reinit(sc); + mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); + } else + cm->cm_timeout_handler(sc, cm); if (sc->mpr_flags & MPR_FLAGS_REALLOCATED) { /* * Tell the caller that we freed the command in a Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mpr/mpr_sas_lsi.c Fri Dec 21 20:30:52 2018 (r342355) @@ -124,7 +124,7 @@ static int mprsas_add_pcie_device(struct mpr_softc *sc static int mprsas_get_sata_identify(struct mpr_softc *sc, u16 handle, Mpi2SataPassthroughReply_t *mpi_reply, char *id_buffer, int sz, u32 devinfo); -static void mprsas_ata_id_timeout(void *data); +static void mprsas_ata_id_timeout(struct mpr_softc *, struct mpr_command *); int mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc, u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD); static int mprsas_volume_add(struct mpr_softc *sc, @@ -1167,23 +1167,19 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 han cm->cm_length = htole32(sz); /* - * Start a timeout counter specifically for the SATA ID command. This - * is used to fix a problem where the FW does not send a reply sometimes + * Use a custom handler to avoid reinit'ing the controller on timeout. + * This fixes a problem where the FW does not send a reply sometimes * when a bad disk is in the topology. So, this is used to timeout the * command so that processing can continue normally. */ - mpr_dprint(sc, MPR_XINFO, "%s start timeout counter for SATA ID " - "command\n", __func__); - callout_reset(&cm->cm_callout, MPR_ATA_ID_TIMEOUT * hz, - mprsas_ata_id_timeout, cm); - error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP); - mpr_dprint(sc, MPR_XINFO, "%s stop timeout counter for SATA ID " - "command\n", __func__); - /* XXX KDM need to fix the case where this command is destroyed */ - callout_stop(&cm->cm_callout); + cm->cm_timeout_handler = mprsas_ata_id_timeout; - if (cm != NULL) - reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply; + error = mpr_wait_command(sc, &cm, MPR_ATA_ID_TIMEOUT, CAN_SLEEP); + + /* mprsas_ata_id_timeout does not reset controller */ + KASSERT(cm != NULL, ("%s: surprise command freed", __func__)); + + reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ /* @@ -1210,61 +1206,28 @@ out: /* * If the SATA_ID_TIMEOUT flag has been set for this command, don't free * it. The command and buffer will be freed after sending an Abort - * Task TM. If the command did timeout, use EWOULDBLOCK. + * Task TM. */ if ((cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) == 0) { mpr_free_command(sc, cm); free(buffer, M_MPR); - } else if (error == 0) - error = EWOULDBLOCK; + } return (error); } static void -mprsas_ata_id_timeout(void *data) +mprsas_ata_id_timeout(struct mpr_softc *sc, struct mpr_command *cm) { - struct mpr_softc *sc; - struct mpr_command *cm; - cm = (struct mpr_command *)data; - sc = cm->cm_sc; - mtx_assert(&sc->mpr_mtx, MA_OWNED); - - mpr_dprint(sc, MPR_INFO, "%s checking ATA ID command %p sc %p\n", + mpr_dprint(sc, MPR_INFO, "%s ATA ID command timeout cm %p sc %p\n", __func__, cm, sc); - if ((callout_pending(&cm->cm_callout)) || - (!callout_active(&cm->cm_callout))) { - mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n", - __func__); - return; - } - callout_deactivate(&cm->cm_callout); /* - * Run the interrupt handler to make sure it's not pending. This - * isn't perfect because the command could have already completed - * and been re-used, though this is unlikely. + * The Abort Task cannot be sent from here because the driver has not + * completed setting up targets. Instead, the command is flagged so + * that special handling will be used to send the abort. */ - mpr_intr_locked(sc); - if (cm->cm_state == MPR_CM_STATE_FREE) { - mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n", - __func__); - return; - } - - mpr_dprint(sc, MPR_INFO, "ATA ID command timeout cm %p\n", cm); - - /* - * Send wakeup() to the sleeping thread that issued this ATA ID command. - * wakeup() will cause msleep to return a 0 (not EWOULDBLOCK), and this - * will keep reinit() from being called. This way, an Abort Task TM can - * be issued so that the timed out command can be cleared. The Abort - * Task cannot be sent from here because the driver has not completed - * setting up targets. Instead, the command is flagged so that special - * handling will be used to send the abort. - */ cm->cm_flags |= MPR_CM_FLAGS_SATA_ID_TIMEOUT; - wakeup(cm); } static int Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mpr/mprvar.h Fri Dec 21 20:30:52 2018 (r342355) @@ -252,6 +252,7 @@ struct mpr_command { uint32_t cm_req_busaddr; bus_addr_t cm_sense_busaddr; struct callout cm_callout; + mpr_command_callback_t *cm_timeout_handler; }; struct mpr_column_map { @@ -613,6 +614,7 @@ mpr_alloc_command(struct mpr_softc *sc) TAILQ_REMOVE(&sc->req_list, cm, cm_link); cm->cm_state = MPR_CM_STATE_BUSY; + cm->cm_timeout_handler = NULL; return (cm); } @@ -654,6 +656,7 @@ mpr_alloc_high_priority_command(struct mpr_softc *sc) TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); cm->cm_state = MPR_CM_STATE_BUSY; + cm->cm_timeout_handler = NULL; return (cm); } Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mps/mps.c Fri Dec 21 20:30:52 2018 (r342355) @@ -3103,12 +3103,15 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm } if (error == EWOULDBLOCK) { - mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s, timeout=%d," - " elapsed=%jd\n", __func__, timeout, - (intmax_t)cur_time.tv_sec); - rc = mps_reinit(sc); - mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : - "failed"); + if (cm->cm_timeout_handler == NULL) { + mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s, timeout=%d," + " elapsed=%jd\n", __func__, timeout, + (intmax_t)cur_time.tv_sec); + rc = mps_reinit(sc); + mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); + } else + cm->cm_timeout_handler(sc, cm); if (sc->mps_flags & MPS_FLAGS_REALLOCATED) { /* * Tell the caller that we freed the command in a Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mps/mps_sas_lsi.c Fri Dec 21 20:30:52 2018 (r342355) @@ -123,7 +123,7 @@ static int mpssas_add_device(struct mps_softc *sc, u16 static int mpssas_get_sata_identify(struct mps_softc *sc, u16 handle, Mpi2SataPassthroughReply_t *mpi_reply, char *id_buffer, int sz, u32 devinfo); -static void mpssas_ata_id_timeout(void *data); +static void mpssas_ata_id_timeout(struct mps_softc *, struct mps_command *); int mpssas_get_sas_address_for_sata_disk(struct mps_softc *sc, u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD); static int mpssas_volume_add(struct mps_softc *sc, @@ -959,23 +959,19 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 han cm->cm_length = htole32(sz); /* - * Start a timeout counter specifically for the SATA ID command. This - * is used to fix a problem where the FW does not send a reply sometimes + * Use a custom handler to avoid reinit'ing the controller on timeout. + * This fixes a problem where the FW does not send a reply sometimes * when a bad disk is in the topology. So, this is used to timeout the * command so that processing can continue normally. */ - mps_dprint(sc, MPS_XINFO, "%s start timeout counter for SATA ID " - "command\n", __func__); - callout_reset(&cm->cm_callout, MPS_ATA_ID_TIMEOUT * hz, - mpssas_ata_id_timeout, cm); - error = mps_wait_command(sc, &cm, 60, CAN_SLEEP); - mps_dprint(sc, MPS_XINFO, "%s stop timeout counter for SATA ID " - "command\n", __func__); - /* XXX KDM need to fix the case where this command is destroyed */ - callout_stop(&cm->cm_callout); + cm->cm_timeout_handler = mpssas_ata_id_timeout; - if (cm != NULL) - reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply; + error = mps_wait_command(sc, &cm, MPS_ATA_ID_TIMEOUT, CAN_SLEEP); + + /* mpssas_ata_id_timeout does not reset controller */ + KASSERT(cm != NULL, ("%s: surprise command freed", __func__)); + + reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ /* @@ -1002,62 +998,28 @@ out: /* * If the SATA_ID_TIMEOUT flag has been set for this command, don't free * it. The command and buffer will be freed after sending an Abort - * Task TM. If the command did timeout, use EWOULDBLOCK. + * Task TM. */ - if ((cm != NULL) - && (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) == 0) { + if ((cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) == 0) { mps_free_command(sc, cm); free(buffer, M_MPT2); - } else if (error == 0) - error = EWOULDBLOCK; + } return (error); } static void -mpssas_ata_id_timeout(void *data) +mpssas_ata_id_timeout(struct mps_softc *sc, struct mps_command *cm) { - struct mps_softc *sc; - struct mps_command *cm; - cm = (struct mps_command *)data; - sc = cm->cm_sc; - mtx_assert(&sc->mps_mtx, MA_OWNED); - - mps_dprint(sc, MPS_INFO, "%s checking ATA ID command %p sc %p\n", + mps_dprint(sc, MPS_INFO, "%s ATA ID command timeout cm %p sc %p\n", __func__, cm, sc); - if ((callout_pending(&cm->cm_callout)) || - (!callout_active(&cm->cm_callout))) { - mps_dprint(sc, MPS_INFO, "%s ATA ID command almost timed out\n", - __func__); - return; - } - callout_deactivate(&cm->cm_callout); /* - * Run the interrupt handler to make sure it's not pending. This - * isn't perfect because the command could have already completed - * and been re-used, though this is unlikely. + * The Abort Task cannot be sent from here because the driver has not + * completed setting up targets. Instead, the command is flagged so + * that special handling will be used to send the abort. */ - mps_intr_locked(sc); - if (cm->cm_state == MPS_CM_STATE_FREE) { - mps_dprint(sc, MPS_INFO, "%s ATA ID command almost timed out\n", - __func__); - return; - } - - mps_dprint(sc, MPS_INFO, "ATA ID command timeout cm %p\n", cm); - - /* - * Send wakeup() to the sleeping thread that issued this ATA ID command. - * wakeup() will cause msleep to return a 0 (not EWOULDBLOCK), and this - * will keep reinit() from being called. This way, an Abort Task TM can - * be issued so that the timed out command can be cleared. The Abort - * Task cannot be sent from here because the driver has not completed - * setting up targets. Instead, the command is flagged so that special - * handling will be used to send the abort. - */ cm->cm_flags |= MPS_CM_FLAGS_SATA_ID_TIMEOUT; - wakeup(cm); } static int Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Fri Dec 21 20:29:16 2018 (r342354) +++ head/sys/dev/mps/mpsvar.h Fri Dec 21 20:30:52 2018 (r342355) @@ -250,6 +250,7 @@ struct mps_command { uint32_t cm_req_busaddr; uint32_t cm_sense_busaddr; struct callout cm_callout; + mps_command_callback_t *cm_timeout_handler; }; struct mps_column_map { @@ -581,6 +582,7 @@ mps_alloc_command(struct mps_softc *sc) TAILQ_REMOVE(&sc->req_list, cm, cm_link); cm->cm_state = MPS_CM_STATE_BUSY; + cm->cm_timeout_handler = NULL; return (cm); } @@ -622,6 +624,7 @@ mps_alloc_high_priority_command(struct mps_softc *sc) TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); cm->cm_state = MPS_CM_STATE_BUSY; + cm->cm_timeout_handler = NULL; return (cm); } From owner-svn-src-head@freebsd.org Fri Dec 21 20:46: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 232D013567E9; Fri, 21 Dec 2018 20:46:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 828BB836CC; Fri, 21 Dec 2018 20:46:46 +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 361421ABAB; Fri, 21 Dec 2018 20:46:46 +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 wBLKkj1F019007; Fri, 21 Dec 2018 20:46:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLKkjIo019006; Fri, 21 Dec 2018 20:46:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812212046.wBLKkjIo019006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 21 Dec 2018 20:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342356 - 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: 342356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 828BB836CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 20:46:47 -0000 Author: np Date: Fri Dec 21 20:46:45 2018 New Revision: 342356 URL: https://svnweb.freebsd.org/changeset/base/342356 Log: Remove unused macros from t4_tom.h. Modified: head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 21 20:30:52 2018 (r342355) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 21 20:46:45 2018 (r342356) @@ -216,10 +216,6 @@ struct flowc_tx_params { unsigned int mss; }; -#define DDP_RETRY_WAIT 5 /* seconds to wait before re-enabling DDP */ -#define DDP_LOW_SCORE 1 -#define DDP_HIGH_SCORE 3 - /* * Compressed state for embryonic connections for a listener. */ From owner-svn-src-head@freebsd.org Fri Dec 21 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 2C06D13574D2; Fri, 21 Dec 2018 21:17:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5FAD846E2; Fri, 21 Dec 2018 21:17:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9D5EF1B0DC; Fri, 21 Dec 2018 21:17:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLLHj1F035126; Fri, 21 Dec 2018 21:17:45 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLLHjXK035125; Fri, 21 Dec 2018 21:17:45 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812212117.wBLLHjXK035125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Dec 2018 21:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342357 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 342357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5FAD846E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 21:17:46 -0000 Author: bde Date: Fri Dec 21 21:17:45 2018 New Revision: 342357 URL: https://svnweb.freebsd.org/changeset/base/342357 Log: Fix clobbering of the fatchain cache for clustered i/o's when full clustering is not done. The bug caused extreme slowness for large files in some cases. There is no way to tell VOP_BMAP() how many blocks are wanted, so for all file systems it has to waste time in some cases by searching for more contiguous blocks than will be accessed. For msdosfs, it also clobbered the fatchain cache in these cases by advancing the cache to point to the chain entry for block that won't be read. This makes the cache useless for the next sequential i/o (or VOP_BMAP()), so the fat chain is searched from the beginning. The cache only has 1 relevant entry, so it is similarly useless for random i/o. Fix this by only advancing the cache to point to the chain entry for the first block that will be read. Clustering uses results from VOP_BMAP(), so when more than 1 block is read by clustering, the cache is not advanced as optimally as before, but it is at most 1 cluster size behind and searching the chain through the blocks for this cluster doesn't take too long. Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Dec 21 20:46:45 2018 (r342356) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Dec 21 21:17:45 2018 (r342357) @@ -1740,6 +1740,7 @@ out: static int msdosfs_bmap(struct vop_bmap_args *ap) { + struct fatcache savefc; struct denode *dep; struct mount *mp; struct msdosfsmount *pmp; @@ -1766,6 +1767,20 @@ msdosfs_bmap(struct vop_bmap_args *ap) if (error != 0 || (ap->a_runp == NULL && ap->a_runb == NULL)) return (error); + /* + * Prepare to back out updates of the fatchain cache after the one + * for the first block done by pcbmap() above. Without the backout, + * then whenever the caller doesn't do i/o to all of the blocks that + * we find, the single useful cache entry would be too far in advance + * of the actual i/o to work for the next sequential i/o. Then the + * FAT would be searched from the beginning. With the backout, the + * FAT is searched starting at most a few blocks early. This wastes + * much less time. Time is also wasted finding more blocks than the + * caller will do i/o to. This is necessary because the runlength + * parameters are output-only. + */ + savefc = dep->de_fc[FC_LASTMAP]; + mp = vp->v_mount; maxio = mp->mnt_iosize_max / mp->mnt_stat.f_iosize; bnpercn = de_cn2bn(pmp, 1); @@ -1787,6 +1802,7 @@ msdosfs_bmap(struct vop_bmap_args *ap) } *ap->a_runb = run - 1; } + dep->de_fc[FC_LASTMAP] = savefc; return (0); } From owner-svn-src-head@freebsd.org Fri Dec 21 23:22: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 BEFF01335AB2; Fri, 21 Dec 2018 23:22:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6568E88B4A; Fri, 21 Dec 2018 23:22: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 576571C720; Fri, 21 Dec 2018 23:22:38 +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 wBLNMcOb004017; Fri, 21 Dec 2018 23:22:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLNMcSG004016; Fri, 21 Dec 2018 23:22:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812212322.wBLNMcSG004016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Dec 2018 23:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342358 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 342358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6568E88B4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 21 Dec 2018 23:22:38 -0000 Author: imp Date: Fri Dec 21 23:22:37 2018 New Revision: 342358 URL: https://svnweb.freebsd.org/changeset/base/342358 Log: Try the first 256 units with nvmecontrol devlist. The nvmecontrol code that did the devlist assumed that we had a tightly-packed allocation of units. Since pci writing exists, this isn't the case. Loop over the first 256 units, which is a reasonable number of possible units. Sponsored by: Netflix Modified: head/sbin/nvmecontrol/devlist.c Modified: head/sbin/nvmecontrol/devlist.c ============================================================================== --- head/sbin/nvmecontrol/devlist.c Fri Dec 21 21:17:45 2018 (r342357) +++ head/sbin/nvmecontrol/devlist.c Fri Dec 21 23:22:37 2018 (r342358) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #define DEVLIST_USAGE \ "devlist\n" +#define NVME_MAX_UNIT 256 + static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { @@ -79,19 +81,17 @@ devlist(const struct nvme_function *nf, int argc, char ctrlr = -1; found = 0; - while (1) { + while (ctrlr < NVME_MAX_UNIT) { ctrlr++; sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr); ret = open_dev(name, &fd, 0, 0); - if (ret != 0) { - if (ret == EACCES) { - warnx("could not open "_PATH_DEV"%s\n", name); - continue; - } else - break; - } + if (ret == EACCES) { + warnx("could not open "_PATH_DEV"%s\n", name); + continue; + } else if (ret != 0) + continue; found++; read_controller_data(fd, &cdata); From owner-svn-src-head@freebsd.org Sat Dec 22 06:02: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 CA2961346697; Sat, 22 Dec 2018 06:02:35 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD1A72071; Sat, 22 Dec 2018 06:02:35 +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 400FB20DD2; Sat, 22 Dec 2018 06:02:35 +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 wBM62Za1018951; Sat, 22 Dec 2018 06:02:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBM62Z3C018950; Sat, 22 Dec 2018 06:02:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201812220602.wBM62Z3C018950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 22 Dec 2018 06:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342362 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 342362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DD1A72071 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 06:02:36 -0000 Author: kevans Date: Sat Dec 22 06:02:34 2018 New Revision: 342362 URL: https://svnweb.freebsd.org/changeset/base/342362 Log: config(8): Allow duplicate options to be specified config(8)'s option handling has been written to allow duplicate options; if the value changes, then the latest value is used and an informative message is printed to stderr like so: /usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1 Currently, this is only a possibility for cpu types, MAXUSERS, and MACHINE_ARCH. Anything else duplicated in a config file will use the first value set and error about duplicated options on subsequent appearances, which is arguably unfriendly since one could specify: include GENERIC nooptions VERBOSE_SYSINIT options VERBOSE_SYSINIT to redefine the value later anyways. Reported by: mmacy MFC after: 1 week Modified: head/usr.sbin/config/config.y Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Fri Dec 21 23:33:28 2018 (r342361) +++ head/usr.sbin/config/config.y Sat Dec 22 06:02:34 2018 (r342362) @@ -99,7 +99,7 @@ static void newdev(char *name); static void newfile(char *name); static void newenvvar(char *name, bool is_file); static void rmdev_schedule(struct device_head *dh, char *name); -static void newopt(struct opt_head *list, char *name, char *value, int append); +static void newopt(struct opt_head *list, char *name, char *value, int append, int dupe); static void rmopt_schedule(struct opt_head *list, char *name); static char * @@ -212,7 +212,7 @@ System_spec: ; System_id: - Save_id { newopt(&mkopt, ns("KERNEL"), $1, 0); }; + Save_id { newopt(&mkopt, ns("KERNEL"), $1, 0, 0); }; System_parameter_list: System_parameter_list ID @@ -232,13 +232,13 @@ NoOpt_list: ; Option: Save_id { - newopt(&opt, $1, NULL, 0); + newopt(&opt, $1, NULL, 0, 1); if (strchr($1, '=') != NULL) errx(1, "%s:%d: The `=' in options should not be " "quoted", yyfile, yyline); } | Save_id EQUALS Opt_value { - newopt(&opt, $1, $3, 0); + newopt(&opt, $1, $3, 0, 1); } ; NoOption: @@ -266,10 +266,10 @@ Mkopt_list: ; Mkoption: - Save_id { newopt(&mkopt, $1, ns(""), 0); } | - Save_id EQUALS { newopt(&mkopt, $1, ns(""), 0); } | - Save_id EQUALS Opt_value { newopt(&mkopt, $1, $3, 0); } | - Save_id PLUSEQUALS Opt_value { newopt(&mkopt, $1, $3, 1); } ; + Save_id { newopt(&mkopt, $1, ns(""), 0, 0); } | + Save_id EQUALS { newopt(&mkopt, $1, ns(""), 0, 0); } | + Save_id EQUALS Opt_value { newopt(&mkopt, $1, $3, 0, 0); } | + Save_id PLUSEQUALS Opt_value { newopt(&mkopt, $1, $3, 1, 0); } ; Dev: ID { $$ = $1; } @@ -295,7 +295,7 @@ NoDev_list: Device: Dev { - newopt(&opt, devopt($1), ns("1"), 0); + newopt(&opt, devopt($1), ns("1"), 0, 0); /* and the device part */ newdev($1); } @@ -432,7 +432,7 @@ findopt(struct opt_head *list, char *name) * Add an option to the list of options. */ static void -newopt(struct opt_head *list, char *name, char *value, int append) +newopt(struct opt_head *list, char *name, char *value, int append, int dupe) { struct opt *op, *op2; @@ -445,7 +445,7 @@ newopt(struct opt_head *list, char *name, char *value, } op2 = findopt(list, name); - if (op2 != NULL && !append) { + if (op2 != NULL && !append && !dupe) { fprintf(stderr, "WARNING: duplicate option `%s' encountered.\n", name); return; @@ -458,9 +458,15 @@ newopt(struct opt_head *list, char *name, char *value, op->op_ownfile = 0; op->op_value = value; if (op2 != NULL) { - while (SLIST_NEXT(op2, op_append) != NULL) - op2 = SLIST_NEXT(op2, op_append); - SLIST_NEXT(op2, op_append) = op; + if (append) { + while (SLIST_NEXT(op2, op_append) != NULL) + op2 = SLIST_NEXT(op2, op_append); + SLIST_NEXT(op2, op_append) = op; + } else { + while (SLIST_NEXT(op2, op_next) != NULL) + op2 = SLIST_NEXT(op2, op_next); + SLIST_NEXT(op2, op_next) = op; + } } else SLIST_INSERT_HEAD(list, op, op_next); } From owner-svn-src-head@freebsd.org Sat Dec 22 06:08: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 69774134683B; Sat, 22 Dec 2018 06:08: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E26672254; Sat, 22 Dec 2018 06:08: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 01A6C20DDB; Sat, 22 Dec 2018 06:08: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 wBM686Zm019266; Sat, 22 Dec 2018 06:08:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBM6860t019265; Sat, 22 Dec 2018 06:08:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201812220608.wBM6860t019265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 22 Dec 2018 06:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342363 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 342363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E26672254 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 06:08:07 -0000 Author: kevans Date: Sat Dec 22 06:08:06 2018 New Revision: 342363 URL: https://svnweb.freebsd.org/changeset/base/342363 Log: config(8): Remove all instances of an option when opting out Quick follow-up to r342362: options can appear multiple times now, so clean up all of them as needed. For non-OPTIONS options, this has no effect since they're already de-duplicated. MFC after: 1 week X-MFC-With: r342362 Modified: head/usr.sbin/config/config.y Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Sat Dec 22 06:02:34 2018 (r342362) +++ head/usr.sbin/config/config.y Sat Dec 22 06:08:06 2018 (r342363) @@ -479,8 +479,7 @@ rmopt_schedule(struct opt_head *list, char *name) { struct opt *op; - op = findopt(list, name); - if (op != NULL) { + while ((op = findopt(list, name)) != NULL) { SLIST_REMOVE(list, op, opt, op_next); free(op->op_name); free(op); From owner-svn-src-head@freebsd.org Sat Dec 22 09:31: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 D4546134CFF2; Sat, 22 Dec 2018 09:31:55 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BED580E4D; Sat, 22 Dec 2018 09:31:55 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 727E7231D1; Sat, 22 Dec 2018 09:31:55 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBM9Vt0P024538; Sat, 22 Dec 2018 09:31:55 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBM9Vt6O024537; Sat, 22 Dec 2018 09:31:55 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812220931.wBM9Vt6O024537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 22 Dec 2018 09:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342364 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7BED580E4D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 09:31:56 -0000 Author: bde Date: Sat Dec 22 09:31:55 2018 New Revision: 342364 URL: https://svnweb.freebsd.org/changeset/base/342364 Log: Oops, rounddown() for the start was misspelled roundup() in r342295, so only aligned starts worked. This broke releasing caches in most cases where the i/o size is smaller than the fs block size. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sat Dec 22 06:08:06 2018 (r342363) +++ head/sys/kern/vfs_default.c Sat Dec 22 09:31:55 2018 (r342364) @@ -1094,7 +1094,7 @@ vop_stdadvise(struct vop_advise_args *ap) * pages usually remain in VMIO for some time. */ bsize = vp->v_bufobj.bo_bsize; - bstart = roundup(ap->a_start, bsize); + bstart = rounddown(ap->a_start, bsize); bend = roundup(ap->a_end, bsize); /* From owner-svn-src-head@freebsd.org Sat Dec 22 11:38: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 9C8A01350413; Sat, 22 Dec 2018 11:38:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43A1B84E7F; Sat, 22 Dec 2018 11:38:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 39F02246EB; Sat, 22 Dec 2018 11:38:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMBctkd091837; Sat, 22 Dec 2018 11:38:55 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMBcsdO091836; Sat, 22 Dec 2018 11:38:54 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812221138.wBMBcsdO091836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 22 Dec 2018 11:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342367 - in head: sbin/ifconfig share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man4 X-SVN-Commit-Revision: 342367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43A1B84E7F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 11:38:55 -0000 Author: eugen Date: Sat Dec 22 11:38:54 2018 New Revision: 342367 URL: https://svnweb.freebsd.org/changeset/base/342367 Log: ifconfig.4, lagg.4: fix documentation bug: -use_flowid needs to be used to force local hash computation and disable usage of RSS hash provided by driver. PR: 234242 MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.8 head/share/man/man4/lagg.4 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat Dec 22 10:57:52 2018 (r342366) +++ head/sbin/ifconfig/ifconfig.8 Sat Dec 22 11:38:54 2018 (r342367) @@ -2469,7 +2469,7 @@ src/dst address for IPv4 or IPv6. .It Cm l4 src/dst port for TCP/UDP/SCTP. .El -.It Cm use_flowid +.It Cm -use_flowid Enable local hash computation for RSS hash on the interface. The .Li loadbalance @@ -2478,7 +2478,7 @@ and modes will use the RSS hash from the network card if available to avoid computing one, this may give poor traffic distribution if the hash is invalid or uses less of the protocol header information. -.Cm use_flowid +.Cm -use_flowid disables use of RSS hash from the network card. The default value can be set via the .Va net.link.lagg.default_use_flowid @@ -2491,8 +2491,8 @@ and .Li 1 means .Dq enabled . -.It Cm -use_flowid -Disable local hash computation for RSS hash on the interface. +.It Cm use_flowid +Use the RSS hash from the network card if available. .It Cm flowid_shift Ar number Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Sat Dec 22 10:57:52 2018 (r342366) +++ head/share/man/man4/lagg.4 Sat Dec 22 11:38:54 2018 (r342367) @@ -146,7 +146,7 @@ modes will use the RSS hash from the network card if a computing one, this may give poor traffic distribution if the hash is invalid or uses less of the protocol header information. Local hash computation can be forced per interface by setting the -.Cm use_flowid +.Cm -use_flowid .Xr ifconfig 8 flag. The default for new interfaces is set via the From owner-svn-src-head@freebsd.org Sat Dec 22 15: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 9D7B413562D7; Sat, 22 Dec 2018 15:15:46 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4417E8B49D; Sat, 22 Dec 2018 15:15:46 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3877B26C45; Sat, 22 Dec 2018 15:15:46 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMFFktU006899; Sat, 22 Dec 2018 15:15:46 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMFFknS006898; Sat, 22 Dec 2018 15:15:46 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812221515.wBMFFknS006898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 22 Dec 2018 15:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342368 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 342368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4417E8B49D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 15:15:46 -0000 Author: vmaffione Date: Sat Dec 22 15:15:45 2018 New Revision: 342368 URL: https://svnweb.freebsd.org/changeset/base/342368 Log: netmap: fix bug in netmap_poll() optimization The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_rx variable to POLLIN, rather than resetting it to POLLIN|POLLRDNORM. It only affects select(), which uses POLLRDNORM. poll() is not affected, because it uses POLLIN. Also, it only affects FreeBSD, because Linux skips the optimization implemented by the piece of code where the bug occurs. MFC after: 3 days Sponsored by: Sunny Valley Networks Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Dec 22 11:38:54 2018 (r342367) +++ head/sys/dev/netmap/netmap.c Sat Dec 22 15:15:45 2018 (r342368) @@ -3304,16 +3304,19 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM } if (want_rx) { enum txrx t = NR_RX; - want_rx = 0; /* look for a reason to run the handlers */ + int rxsync_needed = 0; + + /* look for a reason to run the handlers */ for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ || kring->rhead != kring->ring->head /* release buffers */) { - want_rx = 1; + rxsync_needed = 1; + break; } } - if (!want_rx) - revents |= events & (POLLIN | POLLRDNORM); /* we have data */ + if (!rxsync_needed) + revents |= want_rx; /* we have data */ } #endif From owner-svn-src-head@freebsd.org Sat Dec 22 16:23: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 2CEF313577DE; Sat, 22 Dec 2018 16:23:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C679F8D5D7; Sat, 22 Dec 2018 16:23:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BAA5F2783F; Sat, 22 Dec 2018 16:23:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMGNgHV043762; Sat, 22 Dec 2018 16:23:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMGNgX6043761; Sat, 22 Dec 2018 16:23:42 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812221623.wBMGNgX6043761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 22 Dec 2018 16:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342369 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 342369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C679F8D5D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.935,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 16:23:43 -0000 Author: vmaffione Date: Sat Dec 22 16:23:42 2018 New Revision: 342369 URL: https://svnweb.freebsd.org/changeset/base/342369 Log: netmap: fix txsync check in netmap poll To check if txsync can be skipped, it is necessary to look for unseen TX space. However, this means comparing ring->cur against ring->tail, rather than ring->head against ring->tail (like nm_ring_empty() does). This change also adds some more comments to explain the optimization performed at the beginning of netmap_poll(). MFC after: 3 days Sponsored by: Sunny Valley Networks Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Dec 22 15:15:45 2018 (r342368) +++ head/sys/dev/netmap/netmap.c Sat Dec 22 16:23:42 2018 (r342369) @@ -3292,31 +3292,38 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM * that we must call nm_os_selrecord() unconditionally. */ if (want_tx) { - enum txrx t = NR_TX; - for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { + const enum txrx t = NR_TX; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - /* XXX compare ring->cur and kring->tail */ - if (!nm_ring_empty(kring->ring)) { + if (kring->ring->cur != kring->ring->tail) { + /* Some unseen TX space is available, so what + * we don't need to run txsync. */ revents |= want[t]; - want[t] = 0; /* also breaks the loop */ + want[t] = 0; + break; } } } if (want_rx) { - enum txrx t = NR_RX; + const enum txrx t = NR_RX; int rxsync_needed = 0; - /* look for a reason to run the handlers */ for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ - || kring->rhead != kring->ring->head /* release buffers */) { + if (kring->ring->cur == kring->ring->tail + || kring->rhead != kring->ring->head) { + /* There are no unseen packets on this ring, + * or there are some buffers to be returned + * to the netmap port. We therefore go ahead + * and run rxsync. */ rxsync_needed = 1; break; } } - if (!rxsync_needed) - revents |= want_rx; /* we have data */ + if (!rxsync_needed) { + revents |= want_rx; + want_rx = 0; + } } #endif From owner-svn-src-head@freebsd.org Sat Dec 22 21:49: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 291F9133D3BD; Sat, 22 Dec 2018 21:49:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4C0F733F1; Sat, 22 Dec 2018 21:49:25 +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 B46AD2F1A; Sat, 22 Dec 2018 21:49:25 +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 wBMLnPul016965; Sat, 22 Dec 2018 21:49:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMLnPgn016964; Sat, 22 Dec 2018 21:49:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812222149.wBMLnPgn016964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 22 Dec 2018 21:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342374 - 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: 342374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4C0F733F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 21:49:26 -0000 Author: cy Date: Sat Dec 22 21:49:25 2018 New Revision: 342374 URL: https://svnweb.freebsd.org/changeset/base/342374 Log: Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter source file. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 22 21:32:37 2018 (r342373) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 22 21:49:25 2018 (r342374) @@ -39,9 +39,7 @@ static const char rcsid[] = "@(#)$Id$"; # include # include # include -#if !defined(__hpux) # include -#endif #include # include # include From owner-svn-src-head@freebsd.org Sat Dec 22 22:59: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 595B1133EAE3; Sat, 22 Dec 2018 22:59:12 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F4114758AF; Sat, 22 Dec 2018 22:59:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E8CF03D31; Sat, 22 Dec 2018 22:59:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMMxBR5053910; Sat, 22 Dec 2018 22:59:11 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMMxB1c053909; Sat, 22 Dec 2018 22:59:11 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201812222259.wBMMxB1c053909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 22 Dec 2018 22:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342375 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 342375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F4114758AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 22 Dec 2018 22:59:12 -0000 Author: bde Date: Sat Dec 22 22:59:11 2018 New Revision: 342375 URL: https://svnweb.freebsd.org/changeset/base/342375 Log: Fix devstat on md devices, second attempt. r341765 depends on g_io_deliver() finishing initialization of the bio, but g_io_deliver() actually destroys the bio. INVARIANTS makes the bug obvious by overwriting the bio with garbage. Restore the old order for calling devstat (except don't restore not calling it for the error case), and translate to the devstat KPI so that this order works. Reviewed by: kib Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sat Dec 22 21:49:25 2018 (r342374) +++ head/sys/dev/md/md.c Sat Dec 22 22:59:11 2018 (r342375) @@ -1241,12 +1241,22 @@ md_kthread(void *arg) error = sc->start(sc, bp); } + if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + /* + * Devstat uses (bio_bcount, bio_resid) for + * determining the length of the completed part of + * the i/o. g_io_deliver() will translate from + * bio_completed to that, but it also destroys the + * bio so we must do our own translation. + */ + bp->bio_bcount = bp->bio_length; + bp->bio_resid = (error == -1 ? bp->bio_bcount : 0); + devstat_end_transaction_bio(sc->devstat, bp); + } if (error != -1) { bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); } - if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) - devstat_end_transaction_bio(sc->devstat, bp); } }