From owner-dev-commits-src-main@freebsd.org Mon Sep 6 05:33:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51E1E66BD60; Mon, 6 Sep 2021 05:33:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H2xrQ6127z3m9N; Mon, 6 Sep 2021 05:33:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id AD907E5B8; Mon, 6 Sep 2021 05:33:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f173.google.com with SMTP id bk29so5855972qkb.8; Sun, 05 Sep 2021 22:33:10 -0700 (PDT) X-Gm-Message-State: AOAM530CfY6adlv0cRozTkbfrmIZAgnDEHK4RF2u713rxsY/OtmsaUIF zwzYLfyjvCQEKUfB7gkq3ScdgjmBWuzK3uTlIkY= X-Google-Smtp-Source: ABdhPJwnsEfj02v7gcD+Jn45sOuNBvDjFXZHmOfFwvRxO4wXU47CLH5T0GOVbSWsKv/RYj23c1ApklAe6bTOPVgBRtQ= X-Received: by 2002:a05:620a:2849:: with SMTP id h9mr9268602qkp.69.1630906390125; Sun, 05 Sep 2021 22:33:10 -0700 (PDT) MIME-Version: 1.0 References: <202109031318.183DIvOr082077@gitrepo.freebsd.org> In-Reply-To: <202109031318.183DIvOr082077@gitrepo.freebsd.org> From: Kyle Evans Date: Mon, 6 Sep 2021 00:32:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: c1d255d3ffdb - main - wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff To: Cy Schubert Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 05:33:11 -0000 On Fri, Sep 3, 2021 at 8:19 AM Cy Schubert wrote: > > The branch main has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 > > commit c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 > Merge: a0c64a443e4c 2f6c3ea9600b > Author: Cy Schubert > AuthorDate: 2021-09-03 13:07:19 +0000 > Commit: Cy Schubert > CommitDate: 2021-09-03 13:08:41 +0000 > > wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff > > Merge vendor commits 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a, > efec8223892b3e677acb46eae84ec3534989971f, and > 2f6c3ea9600b494d24cac5a38c1cea0ac192245e. > > Tested by: philip > MFC after: 2 months > Hey, Not sure if you've been looped in, but there seem to be some reports that this has broken things... 10:36 < idwer> wireless networking seems broken in 10:37 < idwer> ehm, beyond commit a0c64a443e4 10:40 < idwer> (most likely) 11:24 < idwer> biab 12:49 < idwer> jep it's broken 14:25 < idwer> wpa_driver_bsd_scan: interface is not up, cannot scan There's also a report on -current@, entitled: "wlan0 no longer functional after n249128-a0c64a443e4c -> n249146-cb5c07649aa0" Thanks, Kyle Evans From owner-dev-commits-src-main@freebsd.org Mon Sep 6 05:48:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3A1166C6B2; Mon, 6 Sep 2021 05:48:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (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 4H2yBc3k5wz3qGN; Mon, 6 Sep 2021 05:48:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id N12NmAPoBczbLN7UwmJ94O; Mon, 06 Sep 2021 05:48:50 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id N7UumgO99xCNkN7UvmJKZr; Mon, 06 Sep 2021 05:48:50 +0000 X-Authority-Analysis: v=2.4 cv=Xe/qcK15 c=1 sm=1 tr=0 ts=6135abc2 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=7QKq2e-ADPsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=_rEsyKiQ66L2SNsxIi4A:9 a=CjuIK1q_8ugA:10 a=vRcdKC0ogzYA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id EB3E5B3; Sun, 5 Sep 2021 22:48:47 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 1865ml3G012919; Sun, 5 Sep 2021 22:48:47 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202109060548.1865ml3G012919@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 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: Kyle Evans cc: Cy Schubert , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: c1d255d3ffdb - main - wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff In-reply-to: References: <202109031318.183DIvOr082077@gitrepo.freebsd.org> Comments: In-reply-to Kyle Evans message dated "Mon, 06 Sep 2021 00:32:59 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 05 Sep 2021 22:48:47 -0700 X-CMAE-Envelope: MS4xfFmgwlTaCXPkmh2GJet6A+0Rb+4fbVXPAehOmrNEXhsiraC9dXSCx/rJxxn0BnDGWWIPSNQUKKUxyxRg/MOdrN9qZ0ZyW8Oye1A3pNRvvgFNj1qpfOWG Knd/fhEbMCNvjfIv7V8ayFF4VpYpPju45nC5nZIp2bMxUaqcBAY82tEz7cxc/Z18VLT8+CA6krSun2eoHLsw3F7lPNT2kFlVnYX+ezbxKDZIV8l3VRbVoeOU 7Yj/pUoErYoP9cWYyWK1mYriuukoImJwn/kGRxdAhMiv5z4xQTzlM/HX2KhWZ3nAv+rL8sbMLf7tdH6hccggBy4MSBI0CgA7git7nrOjLcxZZtt4K6R9iJct bH/i7Kr5 X-Rspamd-Queue-Id: 4H2yBc3k5wz3qGN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 05:48:56 -0000 In message , Kyle Evans writes: > On Fri, Sep 3, 2021 at 8:19 AM Cy Schubert wrote: > > > > The branch main has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c1d255d3ffdbe447de3ab875bf4e7d > 7accc5bfc5 > > > > commit c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 > > Merge: a0c64a443e4c 2f6c3ea9600b > > Author: Cy Schubert > > AuthorDate: 2021-09-03 13:07:19 +0000 > > Commit: Cy Schubert > > CommitDate: 2021-09-03 13:08:41 +0000 > > > > wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff > > > > Merge vendor commits 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a, > > efec8223892b3e677acb46eae84ec3534989971f, and > > 2f6c3ea9600b494d24cac5a38c1cea0ac192245e. > > > > Tested by: philip > > MFC after: 2 months > > > > Hey, > > Not sure if you've been looped in, but there seem to be some reports > that this has broken things... > > 10:36 < idwer> wireless networking seems broken in > 10:37 < idwer> ehm, beyond commit a0c64a443e4 > 10:40 < idwer> (most likely) > 11:24 < idwer> biab > 12:49 < idwer> jep it's broken > 14:25 < idwer> wpa_driver_bsd_scan: interface is not up, cannot scan > > There's also a report on -current@, entitled: > "wlan0 no longer functional after n249128-a0c64a443e4c -> n249146-cb5c07649aa > 0" Thanks. The clue to why it won't associate will be in /var/log/messages. I'll ask. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Mon Sep 6 09:24:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 979F167158D; Mon, 6 Sep 2021 09:24:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H32ym3ZSgz4X1R; Mon, 6 Sep 2021 09:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B02A1C745; Mon, 6 Sep 2021 09:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1869O0pH045830; Mon, 6 Sep 2021 09:24:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1869O09h045829; Mon, 6 Sep 2021 09:24:00 GMT (envelope-from git) Date: Mon, 6 Sep 2021 09:24:00 GMT Message-Id: <202109060924.1869O09h045829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: e7e22476d1d7 - main - Don't default MK_LLVM_TARGET_ALL to yes unless MK_CLANG is requested MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7e22476d1d7864ce59b6eace85d4d4000b81543 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 09:24:00 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=e7e22476d1d7864ce59b6eace85d4d4000b81543 commit e7e22476d1d7864ce59b6eace85d4d4000b81543 Author: Alex Richardson AuthorDate: 2021-09-06 08:31:24 +0000 Commit: Alex Richardson CommitDate: 2021-09-06 08:31:25 +0000 Don't default MK_LLVM_TARGET_ALL to yes unless MK_CLANG is requested When building -DWITH_LLVM_BINUTILS -DWITHOUT_CLANG, this avoids building a few hundred C++ source files that should not be needed by default. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D31059 --- share/mk/src.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index bd360dd1ad29..32346e31a752 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -130,7 +130,6 @@ __DEFAULT_YES_OPTIONS = \ LLVM_ASSERTIONS \ LLVM_COV \ LLVM_CXXFILT \ - LLVM_TARGET_ALL \ LOADER_GELI \ LOADER_LUA \ LOADER_OFW \ @@ -216,6 +215,7 @@ __DEFAULT_NO_OPTIONS = \ # RIGHT option is disabled. __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ + LLVM_TARGET_ALL/CLANG \ LOADER_VERIEXEC/BEARSSL \ LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ From owner-dev-commits-src-main@freebsd.org Mon Sep 6 09:24:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A293E6710CF; Mon, 6 Sep 2021 09:24:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H32yn3zwSz4Wxg; Mon, 6 Sep 2021 09:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A5E51C746; Mon, 6 Sep 2021 09:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1869O187045854; Mon, 6 Sep 2021 09:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1869O1Fw045853; Mon, 6 Sep 2021 09:24:01 GMT (envelope-from git) Date: Mon, 6 Sep 2021 09:24:01 GMT Message-Id: <202109060924.1869O1Fw045853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8e1c989abbd1 - main - Don't build and install {llvm, clang, lldb}-tblgen for the target MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e1c989abbd1db4dac5b2149886012d43e27b9a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 09:24:01 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8e1c989abbd1db4dac5b2149886012d43e27b9a9 commit 8e1c989abbd1db4dac5b2149886012d43e27b9a9 Author: Alex Richardson AuthorDate: 2021-09-06 08:31:58 +0000 Commit: Alex Richardson CommitDate: 2021-09-06 08:32:41 +0000 Don't build and install {llvm,clang,lldb}-tblgen for the target The tablegen binaries are only needed to build software that uses LLVM's infrastructure for command line options, disassembler tables, etc. They are not user-facing binaries and should therefore not be installed by default. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D31058 --- ObsoleteFiles.inc | 5 +++++ usr.bin/clang/Makefile | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index db8441716091..5879ddfc3185 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20210906: stop installing {llvm,clang,lldb}-tblgen +OLD_FILES+=usr/bin/llvm-tblgen +OLD_FILES+=usr/bin/clang-tblgen +OLD_FILES+=usr/bin/lldb-tblgen + # 20210810: remove Pentium-related man pages and references OLD_FILES+=usr/share/man/man3/pmc.p4.3.gz OLD_FILES+=usr/share/man/man3/pmc.p5.3.gz diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index ca68c37b51c1..1c53e94965f7 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -2,12 +2,8 @@ .include +.if ${MK_CLANG} != "no" SUBDIR+= clang -SUBDIR+= clang-tblgen -SUBDIR+= llvm-tblgen - -.if ${MK_LLDB} != "no" -SUBDIR+= lldb-tblgen .endif .if !defined(TOOLS_PREFIX) From owner-dev-commits-src-main@freebsd.org Mon Sep 6 09:24:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5EEF671598; Mon, 6 Sep 2021 09:24:02 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H32yp4k8gz4Wp4; Mon, 6 Sep 2021 09:24:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82FFE1C747; Mon, 6 Sep 2021 09:24:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1869O2P5045878; Mon, 6 Sep 2021 09:24:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1869O2Dk045877; Mon, 6 Sep 2021 09:24:02 GMT (envelope-from git) Date: Mon, 6 Sep 2021 09:24:02 GMT Message-Id: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 021385aba562 - main - Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 021385aba56279febcfdcc64d23673a0106ae45d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 09:24:03 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=021385aba56279febcfdcc64d23673a0106ae45d commit 021385aba56279febcfdcc64d23673a0106ae45d Author: Alex Richardson AuthorDate: 2021-09-06 08:49:49 +0000 Commit: Alex Richardson CommitDate: 2021-09-06 08:49:49 +0000 Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones. Having the LLVM binutils instead of the elftoolchain ones allows us to use features such as LTO that depend on binutils that understand LLVM IR. Another benefit will be an improved user-experience when compiling with AddressSanitizer, since ASAN does not symbolize backtraces correctly if addr2line is elftoolchain addr2line instead of llvm-symbolizer. See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html for more details. This is currently off by default but will be turned on by default at some point in the near future. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D31060 --- Makefile.inc1 | 4 +++- lib/Makefile | 5 ++++- lib/clang/Makefile | 4 +++- lib/clang/libllvm/Makefile | 6 +++--- share/mk/src.opts.mk | 8 ++++++++ tools/build/options/WITH_LLVM_BINUTILS | 2 ++ usr.bin/Makefile | 16 +++++++++++----- usr.bin/clang/Makefile | 13 +++++++++---- usr.bin/clang/llvm-ar/Makefile | 7 +++++++ usr.bin/clang/llvm-nm/Makefile | 7 +++++++ usr.bin/clang/llvm-objcopy/Makefile | 7 +++++++ usr.bin/clang/llvm-objdump/Makefile | 7 +++++++ usr.bin/clang/llvm-size/Makefile | 7 +++++++ usr.bin/clang/llvm-symbolizer/Makefile | 7 +++++++ 14 files changed, 85 insertions(+), 15 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b59c1913f8ce..478824675382 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -771,6 +771,7 @@ XMAKE= ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \ MK_LLDB=no \ + MK_LLVM_BINUTILS=no \ MK_TESTS=no # kernel-tools stage @@ -2339,9 +2340,10 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptree # We need to build tblgen when we're building clang or lld, either as # bootstrap tools, or as the part of the normal build. +# llvm-tblgen is also needed for various llvm binutils (e.g. objcopy). .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \ ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \ - ${MK_LLDB} != "no" + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" _clang_tblgen= \ lib/clang/libllvmminimal \ usr.bin/clang/llvm-tblgen diff --git a/lib/Makefile b/lib/Makefile index 674368a19ffd..1e375bb456e6 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -157,7 +157,10 @@ SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp SUBDIR.${MK_BSNMP}+= libbsnmp .if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) -SUBDIR.${MK_CLANG}+= clang +.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \ + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" +SUBDIR+= clang +.endif .endif SUBDIR.${MK_CUSE}+= libcuse diff --git a/lib/clang/Makefile b/lib/clang/Makefile index bc09ea62dc67..df4aa01a2653 100644 --- a/lib/clang/Makefile +++ b/lib/clang/Makefile @@ -4,10 +4,12 @@ # These have to be built in order. SUBDIR= libllvm +.if ${MK_CLANG} != "no" SUBDIR+= libclang +SUBDIR+= headers +.endif .if ${MK_LLDB} != "no" SUBDIR+= liblldb .endif -SUBDIR+= headers .include diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 09d6336c01d9..7eaedf65dcb3 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -830,7 +830,7 @@ SRCS_MIN+= Object/IRObjectFile.cpp SRCS_MIN+= Object/IRSymtab.cpp SRCS_MIN+= Object/MachOObjectFile.cpp SRCS_MIW+= Object/MachOUniversal.cpp -SRCS_EXT+= Object/MachOUniversalWriter.cpp +SRCS_MIW+= Object/MachOUniversalWriter.cpp SRCS_MIW+= Object/Minidump.cpp SRCS_MIN+= Object/ModuleSymbolTable.cpp SRCS_EXT+= Object/Object.cpp @@ -920,7 +920,7 @@ SRCS_MIN+= Support/Errno.cpp SRCS_MIN+= Support/Error.cpp SRCS_MIN+= Support/ErrorHandling.cpp SRCS_MIN+= Support/FileCollector.cpp -SRCS_EXL+= Support/FileOutputBuffer.cpp +SRCS_MIW+= Support/FileOutputBuffer.cpp SRCS_MIN+= Support/FileUtilities.cpp SRCS_MIN+= Support/FoldingSet.cpp SRCS_MIN+= Support/FormatVariadic.cpp @@ -945,7 +945,7 @@ SRCS_MIN+= Support/MD5.cpp SRCS_MIN+= Support/ManagedStatic.cpp SRCS_MIN+= Support/MathExtras.cpp SRCS_MIN+= Support/MemAlloc.cpp -SRCS_XDL+= Support/Memory.cpp +SRCS_MIW+= Support/Memory.cpp SRCS_MIN+= Support/MemoryBuffer.cpp SRCS_MIN+= Support/MemoryBufferRef.cpp SRCS_MIN+= Support/NativeFormatting.cpp diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 32346e31a752..5363cb6e78f9 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -203,6 +203,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ + LLVM_BINUTILS \ MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ @@ -459,6 +460,7 @@ MK_CLANG:= no MK_INCLUDES:= no MK_LLD:= no MK_LLDB:= no +MK_LLVM_BINUTILS:= no .endif .if ${MK_CLANG} == "no" @@ -468,6 +470,12 @@ MK_CLANG_FULL:= no MK_LLVM_COV:= no .endif +.if ${MK_LLVM_BINUTILS} == "yes" +# MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be +# enabled if MK_LLVM_BINUTILS is set. +MK_LLVM_CXXFILT:= yes +.endif + .if ${MK_LOADER_VERIEXEC} == "no" MK_LOADER_VERIEXEC_PASS_MANIFEST := no .endif diff --git a/tools/build/options/WITH_LLVM_BINUTILS b/tools/build/options/WITH_LLVM_BINUTILS new file mode 100644 index 000000000000..8fa2c55f31a9 --- /dev/null +++ b/tools/build/options/WITH_LLVM_BINUTILS @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install LLVM's binutils (ar, addr2line, nm, etc.) instead of ELF Tool Chain's. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index f1b07a7007be..e8be161db01a 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -195,7 +195,10 @@ SUBDIR.${MK_ATM}+= atm SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BSD_CPIO}+= cpio SUBDIR.${MK_CALENDAR}+= calendar -SUBDIR.${MK_CLANG}+= clang +.if ${MK_CLANG} != "no" || ${MK_LLVM_BINUTILS} != "no" || \ + ${MK_LLD} != "no" || ${MK_LLDB} != "no" +SUBDIR+= clang +.endif SUBDIR.${MK_DIALOG}+= dpv SUBDIR.${MK_EE}+= ee SUBDIR.${MK_FILE}+= file @@ -251,25 +254,28 @@ SUBDIR.${MK_TESTS_SUPPORT}.${MK_CXX}+= kyua SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_TEXTPROC}+= ul SUBDIR.${MK_TFTP}+= tftp +.if ${MK_LLVM_BINUTILS} == "no" +# Only build the elftoolchain tools if we aren't using the LLVM ones. SUBDIR.${MK_TOOLCHAIN}+= addr2line SUBDIR.${MK_TOOLCHAIN}+= ar +SUBDIR.${MK_TOOLCHAIN}+= nm +SUBDIR.${MK_TOOLCHAIN}+= objcopy +SUBDIR.${MK_TOOLCHAIN}+= readelf +SUBDIR.${MK_TOOLCHAIN}+= size +.endif SUBDIR.${MK_TOOLCHAIN}+= c89 SUBDIR.${MK_TOOLCHAIN}+= c99 SUBDIR.${MK_TOOLCHAIN}+= ctags .if ${MK_LLVM_CXXFILT} == "no" SUBDIR.${MK_TOOLCHAIN}+= cxxfilt .endif -SUBDIR.${MK_TOOLCHAIN}+= objcopy SUBDIR.${MK_TOOLCHAIN}+= file2c SUBDIR.${MK_TOOLCHAIN}+= gprof SUBDIR.${MK_TOOLCHAIN}+= indent SUBDIR.${MK_TOOLCHAIN}+= lex SUBDIR.${MK_TOOLCHAIN}+= mkstr -SUBDIR.${MK_TOOLCHAIN}+= nm -SUBDIR.${MK_TOOLCHAIN}+= readelf SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef -SUBDIR.${MK_TOOLCHAIN}+= size SUBDIR.${MK_TOOLCHAIN}+= xstr SUBDIR.${MK_TOOLCHAIN}+= yacc SUBDIR.${MK_VI}+= vi diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index 1c53e94965f7..7fc31e8df194 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -7,12 +7,20 @@ SUBDIR+= clang .endif .if !defined(TOOLS_PREFIX) +# LLVM binutils are needed to support features such as LTO, so we build them +# by default if clang is enabled. If MK_LLVM_BINUTILS is set, we also use them +# as the default binutils (ar,nm,addr2line, etc.). +.if ${MK_CLANG} != "no" || ${MK_LLVM_BINUTILS} != "no" SUBDIR+= llvm-ar SUBDIR+= llvm-nm +SUBDIR+= llvm-objcopy SUBDIR+= llvm-objdump +SUBDIR+= llvm-size +SUBDIR+= llvm-strings SUBDIR+= llvm-symbolizer +.endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLVM_CXXFILT} != "no" +.if ${MK_LLVM_BINUTILS} != "no" || ${MK_LLVM_CXXFILT} != "no" SUBDIR+= llvm-cxxfilt .endif @@ -34,11 +42,8 @@ SUBDIR+= llvm-lto2 SUBDIR+= llvm-mc SUBDIR+= llvm-mca SUBDIR+= llvm-modextract -SUBDIR+= llvm-objcopy SUBDIR+= llvm-pdbutil SUBDIR+= llvm-rtdyld -SUBDIR+= llvm-size -SUBDIR+= llvm-strings SUBDIR+= llvm-xray SUBDIR+= opt .endif diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile index 86d4538271a1..bd43194153d7 100644 --- a/usr.bin/clang/llvm-ar/Makefile +++ b/usr.bin/clang/llvm-ar/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-ar MAN= llvm-ar.1 llvm-ranlib.1 @@ -10,4 +12,9 @@ LIBADD+= z LINKS+= ${BINDIR}/llvm-ar ${BINDIR}/llvm-ranlib +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-ar ${BINDIR}/ar ${BINDIR}/llvm-ar ${BINDIR}/ranlib +MLINKS= llvm-ar.1 ar.1 llvm-ar.1 ranlib.1 +.endif + .include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile index 02f16887a7cf..4a6990cfa22d 100644 --- a/usr.bin/clang/llvm-nm/Makefile +++ b/usr.bin/clang/llvm-nm/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-nm SRCDIR= llvm/tools/llvm-nm @@ -7,4 +9,9 @@ SRCS+= llvm-nm.cpp LIBADD+= z +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-nm ${BINDIR}/nm +MLINKS= llvm-nm.1 nm.1 +.endif + .include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-objcopy/Makefile b/usr.bin/clang/llvm-objcopy/Makefile index 645bbbd7c4e9..2e6fc8aba356 100644 --- a/usr.bin/clang/llvm-objcopy/Makefile +++ b/usr.bin/clang/llvm-objcopy/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-objcopy SRCDIR= llvm/tools/llvm-objcopy @@ -42,4 +44,9 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} LIBADD+= z +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy +MLINKS= llvm-objcopy.1 objcopy.1 +.endif + .include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile index 34b015042718..53b63bd7200e 100644 --- a/usr.bin/clang/llvm-objdump/Makefile +++ b/usr.bin/clang/llvm-objdump/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-objdump SRCDIR= llvm/tools/llvm-objdump @@ -12,4 +14,9 @@ SRCS+= llvm-objdump.cpp LIBADD+= z +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-objdump ${BINDIR}/objdump +MLINKS= llvm-objdump.1 objdump.1 +.endif + .include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-size/Makefile b/usr.bin/clang/llvm-size/Makefile index a4a387aabf6f..4ddaaf86dca3 100644 --- a/usr.bin/clang/llvm-size/Makefile +++ b/usr.bin/clang/llvm-size/Makefile @@ -1,8 +1,15 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-size SRCDIR= llvm/tools/llvm-size SRCS+= llvm-size.cpp +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-size ${BINDIR}/size +MLINKS= llvm-size.1 size.1 +.endif + .include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile index 6352d6a67b94..52a48d428600 100644 --- a/usr.bin/clang/llvm-symbolizer/Makefile +++ b/usr.bin/clang/llvm-symbolizer/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX= llvm-symbolizer MAN= llvm-symbolizer.1 llvm-addr2line.1 @@ -26,4 +28,9 @@ LIBADD+= z LINKS+= ${BINDIR}/llvm-symbolizer ${BINDIR}/llvm-addr2line +.if ${MK_LLVM_BINUTILS} != "no" +LINKS= ${BINDIR}/llvm-symbolizer ${BINDIR}/addr2line +MLINKS= llvm-addr2line.1 addr2line.1 +.endif + .include "../llvm.prog.mk" From owner-dev-commits-src-main@freebsd.org Mon Sep 6 09:25:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DD8B671647; Mon, 6 Sep 2021 09:25:35 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H330b1nnjz4Xh0; Mon, 6 Sep 2021 09:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E6561C84F; Mon, 6 Sep 2021 09:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1869PZZt046105; Mon, 6 Sep 2021 09:25:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1869PZbC046104; Mon, 6 Sep 2021 09:25:35 GMT (envelope-from git) Date: Mon, 6 Sep 2021 09:25:35 GMT Message-Id: <202109060925.1869PZbC046104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 24f586182ff4 - main - Enable MK_LLVM_BINUTILS if MK_ASAN is requested MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24f586182ff4d0e94a5c17cb542e0bffefb51fa7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 09:25:35 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=24f586182ff4d0e94a5c17cb542e0bffefb51fa7 commit 24f586182ff4d0e94a5c17cb542e0bffefb51fa7 Author: Alex Richardson AuthorDate: 2021-09-06 09:24:33 +0000 Commit: Alex Richardson CommitDate: 2021-09-06 09:24:34 +0000 Enable MK_LLVM_BINUTILS if MK_ASAN is requested ASan will not be able to provide backtraces with symbol names with elftoolchain's addr2line. To fix this turn MK_LLVM_BINUTILS on by default when ASan instrumentation is requested. Reviewed By: emaste, markj Differential Revision: https://reviews.freebsd.org/D31061 --- share/mk/src.opts.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 5363cb6e78f9..28e18260affd 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -470,6 +470,12 @@ MK_CLANG_FULL:= no MK_LLVM_COV:= no .endif +.if ${MK_ASAN} == "yes" +# In order to get sensible backtraces from ASAN we have to install +# llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version. +MK_LLVM_BINUTILS:= yes +.endif + .if ${MK_LLVM_BINUTILS} == "yes" # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be # enabled if MK_LLVM_BINUTILS is set. From owner-dev-commits-src-main@freebsd.org Mon Sep 6 13:32:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB1E5674F39; Mon, 6 Sep 2021 13:32:50 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H38Tt554Rz3FM0; Mon, 6 Sep 2021 13:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D62E1F8EA; Mon, 6 Sep 2021 13:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186DWoW7079336; Mon, 6 Sep 2021 13:32:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186DWo2U079335; Mon, 6 Sep 2021 13:32:50 GMT (envelope-from git) Date: Mon, 6 Sep 2021 13:32:50 GMT Message-Id: <202109061332.186DWo2U079335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: c86a43f1c7db - main - stress2: Added a syzkaller reproducer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c86a43f1c7dbaba4042db017a3c3563f5b826c48 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 13:32:51 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=c86a43f1c7dbaba4042db017a3c3563f5b826c48 commit c86a43f1c7dbaba4042db017a3c3563f5b826c48 Author: Peter Holm AuthorDate: 2021-09-06 13:32:23 +0000 Commit: Peter Holm CommitDate: 2021-09-06 13:32:23 +0000 stress2: Added a syzkaller reproducer --- tools/test/stress2/misc/all.exclude | 1 + tools/test/stress2/misc/syzkaller43.sh | 327 +++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 9e9226c28574..d4a57af4d559 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -68,6 +68,7 @@ syzkaller39.sh WiP 20210607 syzkaller40.sh WiP 20210607 syzkaller41.sh WiP 20210607 syzkaller42.sh WiP 20210613 +syzkaller43.sh WiP 20210906 truss3.sh WiP 20200915 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 diff --git a/tools/test/stress2/misc/syzkaller43.sh b/tools/test/stress2/misc/syzkaller43.sh new file mode 100755 index 000000000000..025ee674132d --- /dev/null +++ b/tools/test/stress2/misc/syzkaller43.sh @@ -0,0 +1,327 @@ +#!/bin/sh + +# panic: Assertion done != job_total_nbytes failed at ../../../kern/sys_socket.c:672 +# cpuid = 6 +# time = 1630912129 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00e4f2fa10 +# vpanic() at vpanic+0x187/frame 0xfffffe00e4f2fa70 +# panic() at panic+0x43/frame 0xfffffe00e4f2fad0 +# soaio_process_sb() at soaio_process_sb+0x79a/frame 0xfffffe00e4f2fb70 +# soaio_kproc_loop() at soaio_kproc_loop+0x96/frame 0xfffffe00e4f2fbb0 +# fork_exit() at fork_exit+0x80/frame 0xfffffe00e4f2fbf0 +# fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00e4f2fbf0 +# --- trap 0, rip = 0, rsp = 0, rbp = 0 --- +# KDB: enter: panic +# [ thread pid 26 tid 100163 ] +# Stopped at kdb_enter+0x37: movq $0,0x127297e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n249158-1f7a6325fe1b: Sun Sep 5 09:12:58 CEST 2021 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller43.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void execute_one(void) +{ + int i, call, thread; + for (call = 0; call < 5; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter = 0; + for (;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + sleep_ms(1); + if (current_time_ms() - start < 5000) { + continue; + } + kill_and_wait(pid, &status); + break; + } + } +} + +#ifndef SYS_aio_readv +#define SYS_aio_readv 579 +#endif + +uint64_t r[1] = {0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + res = syscall(SYS_socket, 0x1cul, 5ul, 0x84); + if (res != -1) + r[0] = res; + break; + case 1: + *(uint64_t*)0x20000440 = 0; + *(uint32_t*)0x20000448 = 0; + *(uint64_t*)0x20000450 = 0; + *(uint64_t*)0x20000458 = 0; + *(uint64_t*)0x20000460 = 0; + *(uint64_t*)0x20000468 = 0; + *(uint32_t*)0x20000470 = 0; + syscall(SYS_recvmsg, r[0], 0x20000440ul, 0x40040ul); + break; + case 2: + *(uint32_t*)0x200006c0 = r[0]; + *(uint64_t*)0x200006c8 = 0x800; + *(uint64_t*)0x200006d0 = 0; + *(uint64_t*)0x200006d8 = 0; + *(uint32_t*)0x200006e0 = -1; + *(uint32_t*)0x200006e4 = 8; + *(uint64_t*)0x200006e8 = 0xffffffffffff658c; + *(uint32_t*)0x200006f0 = 4; + *(uint32_t*)0x200006f4 = 0x1ff; + *(uint64_t*)0x200006f8 = 0x40; + *(uint64_t*)0x20000700 = 0; + *(uint64_t*)0x20000708 = 0; + *(uint32_t*)0x20000710 = 4; + *(uint32_t*)0x20000714 = 8; + *(uint32_t*)0x20000718 = 6; + *(uint64_t*)0x20000720 = 0; + *(uint64_t*)0x20000728 = 0; + syscall(SYS_aio_readv, 0x200006c0ul); + break; + case 3: + *(uint32_t*)0x20000140 = 0; + *(uint16_t*)0x20000144 = 4; + *(uint8_t*)0x20000146 = 1; + syscall(SYS_setsockopt, r[0], 0x84, 0x1e, 0x20000140ul, 8ul); + break; + case 4: + *(uint64_t*)0x20000580 = 0x20000080; + *(uint8_t*)0x20000080 = 0x1c; + *(uint8_t*)0x20000081 = 0x1c; + *(uint16_t*)0x20000082 = htobe16(0x4e22); + *(uint32_t*)0x20000084 = 0; + *(uint64_t*)0x20000088 = htobe64(0); + *(uint64_t*)0x20000090 = htobe64(1); + *(uint32_t*)0x20000098 = 0; + *(uint32_t*)0x20000588 = 0x1c; + *(uint64_t*)0x20000590 = 0x20000400; + *(uint64_t*)0x20000400 = 0x200000c0; + memset((void*)0x200000c0, 239, 1); + *(uint64_t*)0x20000408 = 1; + *(uint32_t*)0x20000598 = 1; + *(uint64_t*)0x200005a0 = 0; + *(uint32_t*)0x200005a8 = 0xd0; + *(uint32_t*)0x200005ac = 0; + syscall(SYS_sendmsg, r[0], 0x20000580ul, 0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller43 -Wall -Wextra -O0 /tmp/syzkaller43.c -lpthread || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller43) + +rm -rf /tmp/syzkaller43 syzkaller43.c /tmp/syzkaller.* +exit 0 From owner-dev-commits-src-main@freebsd.org Mon Sep 6 14:42:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B6E66760B6; Mon, 6 Sep 2021 14:42:49 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3B2c6zH2z3pdv; Mon, 6 Sep 2021 14:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D017020853; Mon, 6 Sep 2021 14:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186EgmD5073032; Mon, 6 Sep 2021 14:42:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186Egm1Q073031; Mon, 6 Sep 2021 14:42:48 GMT (envelope-from git) Date: Mon, 6 Sep 2021 14:42:48 GMT Message-Id: <202109061442.186Egm1Q073031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: efe014e6b177 - main - iconv: Make it possible to build iconv(3) test suite. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efe014e6b177ba1b0d70f7df751f5066d4eafe9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 14:42:49 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=efe014e6b177ba1b0d70f7df751f5066d4eafe9b commit efe014e6b177ba1b0d70f7df751f5066d4eafe9b Author: Edward Tomasz Napierala AuthorDate: 2021-09-06 14:41:06 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-06 14:41:26 +0000 iconv: Make it possible to build iconv(3) test suite. It was broken after 1243a98e38a5. Reviewed By: allanjude Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31816 --- tools/test/iconv/gnu/gnu.c | 16 ++++++++-------- tools/test/iconv/posix/posix.c | 16 ++++++++-------- tools/test/iconv/tablegen/tablegen.c | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/test/iconv/gnu/gnu.c b/tools/test/iconv/gnu/gnu.c index 47e83ec3ae3d..ecf180d23b98 100644 --- a/tools/test/iconv/gnu/gnu.c +++ b/tools/test/iconv/gnu/gnu.c @@ -243,8 +243,8 @@ ctl_uc_hook(void) struct iconv_hooks hooks; iconv_t cd; size_t inbytesleft = 15, outbytesleft = 40; - const char **inptr; - const char *s = "Hello World!"; + char **inptr; + char *s = "Hello World!"; char **outptr; char *outbuf; @@ -273,8 +273,8 @@ ctl_wc_hook(void) struct iconv_hooks hooks; iconv_t cd; size_t inbytesleft, outbytesleft = 40; - const char **inptr; - const char *s = "Hello World!"; + char **inptr; + char *s = "Hello World!"; char **outptr; char *outbuf; @@ -350,7 +350,7 @@ ctl_mb_to_uc_fb(void) size_t inbytesleft, outbytesleft; uint16_t inbuf[1] = { 0xF187 }; uint8_t outbuf[4] = { 0x00, 0x00, 0x00, 0x00 }; - const char *inptr; + char *inptr; char *outptr; int ret; @@ -366,7 +366,7 @@ ctl_mb_to_uc_fb(void) if (iconvctl(cd, ICONV_SET_FALLBACKS, (void *)&fb) != 0) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 2; outbytesleft = 4; @@ -389,7 +389,7 @@ gnu_openinto(void) { iconv_allocation_t *myspace; size_t inbytesleft, outbytesleft; - const char *inptr; + char *inptr; char *inbuf = "works!", *outptr; char outbuf[6]; @@ -398,7 +398,7 @@ gnu_openinto(void) if (iconv_open_into("ASCII", "ASCII", myspace) == -1) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 6; outbytesleft = 6; diff --git a/tools/test/iconv/posix/posix.c b/tools/test/iconv/posix/posix.c index 2502393b5509..7faed92416a3 100644 --- a/tools/test/iconv/posix/posix.c +++ b/tools/test/iconv/posix/posix.c @@ -108,7 +108,7 @@ conv_ret(void) { iconv_t cd; size_t inbytesleft, outbytesleft; - const char *inptr; + char *inptr; char *outptr; uint32_t outbuf[4]; uint32_t inbuf[2] = { 0x00000151, 0x00000171 }; @@ -116,7 +116,7 @@ conv_ret(void) if ((cd = iconv_open("ASCII", "UTF-32LE")) == (iconv_t)-1) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 8; outbytesleft = 16; @@ -129,7 +129,7 @@ conv_2big(void) { iconv_t cd; size_t inbytesleft, outbytesleft; - const char *inptr; + char *inptr; char *outptr; uint32_t inbuf[4]; uint32_t outbuf[2]; @@ -138,7 +138,7 @@ conv_2big(void) if ((cd = iconv_open("ASCII", "ASCII")) == (iconv_t)-1) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 16; outbytesleft = 8; @@ -168,7 +168,7 @@ conv_einval(void) { iconv_t cd; size_t inbytesleft, outbytesleft; - const char *inptr; + char *inptr; char *outptr; uint32_t outbuf[4]; uint16_t inbuf[1] = { 0xEA42 }; @@ -177,7 +177,7 @@ conv_einval(void) if ((cd = iconv_open("UTF-32", "BIG5")) == (iconv_t)-1) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 2; outbytesleft = 16; @@ -207,7 +207,7 @@ conv_eilseq(void) { iconv_t cd; size_t inbytesleft, outbytesleft; - const char *inptr; + char *inptr; char *outptr; uint32_t outbuf[4]; uint16_t inbuf[1] = { 0x8AC0 }; @@ -216,7 +216,7 @@ conv_eilseq(void) if ((cd = iconv_open("Latin2", "UTF-16LE")) == (iconv_t)-1) return (1); - inptr = (const char *)inbuf; + inptr = (char *)inbuf; outptr = (char *)outbuf; inbytesleft = 4; outbytesleft = 16; diff --git a/tools/test/iconv/tablegen/tablegen.c b/tools/test/iconv/tablegen/tablegen.c index ee8cecad70d8..a67de54ff310 100644 --- a/tools/test/iconv/tablegen/tablegen.c +++ b/tools/test/iconv/tablegen/tablegen.c @@ -287,7 +287,7 @@ do_conv(iconv_t cd, bool uniinput) { size_t inbytesleft, outbytesleft, ret; uint32_t outbuf; uint32_t inbuf; - const char *inbuf_; + char *inbuf_; char *outbuf_; for (inbuf = 0; inbuf < (lflag ? 0x100000 : 0x10000); inbuf += 1) { @@ -297,7 +297,7 @@ do_conv(iconv_t cd, bool uniinput) { outbytesleft = 4; outbuf = 0x00000000; outbuf_ = (char *)&outbuf; - inbuf_ = (const char *)&inbuf; + inbuf_ = (char *)&inbuf; iconv(cd, NULL, NULL, NULL, NULL); fb_flags = 0; errno = 0; From owner-dev-commits-src-main@freebsd.org Mon Sep 6 14:44:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2140A676495; Mon, 6 Sep 2021 14:44:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3B4S0RrYz3pHy; Mon, 6 Sep 2021 14:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E337B206D7; Mon, 6 Sep 2021 14:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186EiNqW073276; Mon, 6 Sep 2021 14:44:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186EiNms073275; Mon, 6 Sep 2021 14:44:23 GMT (envelope-from git) Date: Mon, 6 Sep 2021 14:44:23 GMT Message-Id: <202109061444.186EiNms073275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: c6da134591a9 - main - iconv: Fix path names used by iconv(3) tests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6da134591a9b5de7511e90128d8c20f5bbcc235 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 14:44:24 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=c6da134591a9b5de7511e90128d8c20f5bbcc235 commit c6da134591a9b5de7511e90128d8c20f5bbcc235 Author: Edward Tomasz Napierala AuthorDate: 2021-09-06 14:43:24 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-06 14:43:40 +0000 iconv: Fix path names used by iconv(3) tests. Reviewed By: allanjude Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31815 --- tools/test/iconv/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/test/iconv/Makefile b/tools/test/iconv/Makefile index bdcec5dab201..3b74be06aac6 100644 --- a/tools/test/iconv/Makefile +++ b/tools/test/iconv/Makefile @@ -29,10 +29,10 @@ ENCODING+= ATARIST BIG5-2003 C99 CP1046 CP1124 CP1125 CP1129 CP1131 CP1133 \ # MACHEBREW .endif -GEN_FWD?= ${.CURDIR}/tablegen/tablegen -t -GEN_REV?= ${.CURDIR}/tablegen/tablegen -tr -REF_FWD?= ${.CURDIR}/refgen/refgen -t -REF_REV?= ${.CURDIR}/refgen/refgen -tr +GEN_FWD?= ${.OBJDIR}/tablegen/tablegen -t +GEN_REV?= ${.OBJDIR}/tablegen/tablegen -tr +REF_FWD?= ${.OBJDIR}/refgen/refgen -t +REF_REV?= ${.OBJDIR}/refgen/refgen -tr CMP?= ${.CURDIR}/tablegen/cmp.sh make-ref: refgen @@ -49,10 +49,10 @@ check: tablegen .for enc in ${ENCODING} @echo "Checking ${enc} --> UTF-32 ..." -@${GEN_FWD} ${enc} >output/${enc} - @${CMP} ref/${enc} output/${enc} + @${CMP} ${.CURDIR}/ref/${enc} ${.OBJDIR}/output/${enc} @echo "Checking UTF-32 --> ${enc} ..." -@${GEN_REV} ${enc} >output/${enc}-rev - @${CMP} ref/${enc}-rev output/${enc}-rev + @${CMP} ${.CURDIR}/ref/${enc}-rev ${.OBJDIR}/output/${enc}-rev .endfor perftest: refgen tablegen @@ -70,10 +70,10 @@ perftest: refgen tablegen .endfor posixtest: posix - @${.CURDIR}/posix/posix + @${.OBJDIR}/posix/posix gnutest: gnu - @${.CURDIR}/gnu/gnu + @${.OBJDIR}/gnu/gnu test-everything: check perftest posixtest gnutest From owner-dev-commits-src-main@freebsd.org Mon Sep 6 14:46:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C6867661D; Mon, 6 Sep 2021 14:46:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3B6h2WZtz3q2L; Mon, 6 Sep 2021 14:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 373CD206D8; Mon, 6 Sep 2021 14:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186EkK0Y073676; Mon, 6 Sep 2021 14:46:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186EkKAH073675; Mon, 6 Sep 2021 14:46:20 GMT (envelope-from git) Date: Mon, 6 Sep 2021 14:46:20 GMT Message-Id: <202109061446.186EkKAH073675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0016b7da3441 - main - iconv: Fix tablegen iconv test utility on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0016b7da344191c1960088d2fc41b0cfc3d5b5ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 14:46:20 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0016b7da344191c1960088d2fc41b0cfc3d5b5ec commit 0016b7da344191c1960088d2fc41b0cfc3d5b5ec Author: Edward Tomasz Napierala AuthorDate: 2021-09-06 14:44:59 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-06 14:45:08 +0000 iconv: Fix tablegen iconv test utility on arm64 Previously it would loop indefinitely on getopt_long(3) due to 'char' being unsigned. Reviewed By: allanjude Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31817 --- tools/test/iconv/tablegen/tablegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/iconv/tablegen/tablegen.c b/tools/test/iconv/tablegen/tablegen.c index a67de54ff310..12d44ae753ff 100644 --- a/tools/test/iconv/tablegen/tablegen.c +++ b/tools/test/iconv/tablegen/tablegen.c @@ -200,7 +200,7 @@ main (int argc, char *argv[]) struct iconv_fallbacks fbs; iconv_t cd; char *tocode; - char c; + int c; while (((c = getopt_long(argc, argv, optstr, long_options, NULL)) != -1)) { switch (c) { From owner-dev-commits-src-main@freebsd.org Mon Sep 6 14:49:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D67046764C1; Mon, 6 Sep 2021 14:49:04 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3B9r5mWQz3rDQ; Mon, 6 Sep 2021 14:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5CAD20C36; Mon, 6 Sep 2021 14:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186En40U073970; Mon, 6 Sep 2021 14:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186En4cG073969; Mon, 6 Sep 2021 14:49:04 GMT (envelope-from git) Date: Mon, 6 Sep 2021 14:49:04 GMT Message-Id: <202109061449.186En4cG073969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 439aa5872860 - main - iconv: Fix "make make-ref" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 439aa5872860f5e1d634433161a64f60dacfda7d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 14:49:04 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=439aa5872860f5e1d634433161a64f60dacfda7d commit 439aa5872860f5e1d634433161a64f60dacfda7d Author: Edward Tomasz Napierala AuthorDate: 2021-09-06 14:47:30 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-06 14:47:35 +0000 iconv: Fix "make make-ref" The purpose of this command is to "refresh" the source reference files generated with GNU libiconv, located in tools/test/iconv/ref/. Previously it would generate copies somewhere in OBJDIR, which we don't use. Reviewed By: allanjude Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31820 --- tools/test/iconv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/iconv/Makefile b/tools/test/iconv/Makefile index 3b74be06aac6..6f390d4deb4d 100644 --- a/tools/test/iconv/Makefile +++ b/tools/test/iconv/Makefile @@ -39,9 +39,9 @@ make-ref: refgen mkdir -p ref .for enc in ${ENCODING} @echo "Generating ${enc} --> UTF-32 ..." - -@${REF_FWD} ${enc} >ref/${enc} + -@${REF_FWD} ${enc} >${.CURDIR}/ref/${enc} @echo "Generating UTF-32 --> ${enc} ..." - -@${REF_REV} ${enc} >ref/${enc}-rev + -@${REF_REV} ${enc} >${.CURDIR}/ref/${enc}-rev .endfor check: tablegen From owner-dev-commits-src-main@freebsd.org Mon Sep 6 15:50:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDCCA6772BC; Mon, 6 Sep 2021 15:50:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3CXX3Rt1z4nMs; Mon, 6 Sep 2021 15:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EEEA219A0; Mon, 6 Sep 2021 15:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186FoKup061365; Mon, 6 Sep 2021 15:50:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186FoKdQ061362; Mon, 6 Sep 2021 15:50:20 GMT (envelope-from git) Date: Mon, 6 Sep 2021 15:50:20 GMT Message-Id: <202109061550.186FoKdQ061362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 8a004a98c2cd - main - git-arc: allow word splitting in build_commit_list() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a004a98c2cdf4fdbb8f5eaaebc2f89c0919168c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 15:50:21 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=8a004a98c2cdf4fdbb8f5eaaebc2f89c0919168c commit 8a004a98c2cdf4fdbb8f5eaaebc2f89c0919168c Author: Robert Wing AuthorDate: 2021-09-06 15:42:46 +0000 Commit: Robert Wing CommitDate: 2021-09-06 15:42:46 +0000 git-arc: allow word splitting in build_commit_list() git-rev-list expects commits to be listed separately, allow word splitting and disable shellcheck SC2086 when using git-rev-list to build the commit list. Fixes: 4fd0c6ab1a9e ("Fix most shellcheck warnings in git-arc.sh") Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31838 --- tools/tools/git/git-arc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 82a549e0868f..0c288e7ac6e2 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -342,7 +342,8 @@ build_commit_list() for chash in "$@"; do _commits=$(git rev-parse "${chash}") if ! git cat-file -e "${chash}"'^{commit}' >/dev/null 2>&1; then - _commits=$(git rev-list "$_commits" | tail -r) + # shellcheck disable=SC2086 + _commits=$(git rev-list $_commits | tail -r) fi [ -n "$_commits" ] || err "invalid commit ID ${chash}" commits="$commits $_commits" From owner-dev-commits-src-main@freebsd.org Mon Sep 6 17:53:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85E1B678BD5; Mon, 6 Sep 2021 17:53:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3GG53B6Wz4W0c; Mon, 6 Sep 2021 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E4F62332A; Mon, 6 Sep 2021 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186Hr1cu025984; Mon, 6 Sep 2021 17:53:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186Hr1Nw025983; Mon, 6 Sep 2021 17:53:01 GMT (envelope-from git) Date: Mon, 6 Sep 2021 17:53:01 GMT Message-Id: <202109061753.186Hr1Nw025983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Murray Subject: git: 292815eac623 - main - Fix powf(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 292815eac623035493854f133200a4b1041fa246 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 17:53:01 -0000 The branch main has been updated by markm: URL: https://cgit.FreeBSD.org/src/commit/?id=292815eac623035493854f133200a4b1041fa246 commit 292815eac623035493854f133200a4b1041fa246 Author: Mark Murray AuthorDate: 2021-09-06 17:26:39 +0000 Commit: Mark Murray CommitDate: 2021-09-06 17:51:31 +0000 Fix powf(). Summary: From Steve Kargl: Paul Zimmermann has identified a bug in Openlibm's powf(), which is identical to FreeBSD's libm. Both derived from fdlibm. https://github.com/JuliaMath/openlibm/issues/212. Consider % cat h.c int main(void) { float x, y, z; x = 0x1.ffffecp-1F; y = -0x1.000002p+27F; z = 0x1.557a86p115F; printf("%e %e %e <-- should be %e\n", x, y, powf(x,y), z); return 0; } % cc -o h -fno-builtin h.c -lm && ./h 9.999994e-01 -1.342177e+08 inf <-- should be 5.540807e+34 Reviewers: manu Subscribers: imp, andrew, emaste Differential Revision: https://reviews.freebsd.org/D31865 --- lib/msun/src/e_powf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c index 33eedad50b16..122da455f740 100644 --- a/lib/msun/src/e_powf.c +++ b/lib/msun/src/e_powf.c @@ -136,7 +136,7 @@ __ieee754_powf(float x, float y) /* |y| is huge */ if(iy>0x4d000000) { /* if |y| > 2**27 */ /* over/underflow if x is not close to one */ - if(ix<0x3f7ffff7) return (hy<0)? sn*huge*huge:sn*tiny*tiny; + if(ix<0x3f7ffff6) return (hy<0)? sn*huge*huge:sn*tiny*tiny; if(ix>0x3f800007) return (hy>0)? sn*huge*huge:sn*tiny*tiny; /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ From owner-dev-commits-src-main@freebsd.org Mon Sep 6 19:24:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E199E679F83; Mon, 6 Sep 2021 19:24:44 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3JHw66RMz3jNN; Mon, 6 Sep 2021 19:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B34D524631; Mon, 6 Sep 2021 19:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186JOiqM047181; Mon, 6 Sep 2021 19:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186JOiRM047180; Mon, 6 Sep 2021 19:24:44 GMT (envelope-from git) Date: Mon, 6 Sep 2021 19:24:44 GMT Message-Id: <202109061924.186JOiRM047180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: efe67f33c322 - main - compiler-rt: add aarch64 init function for LSE atomics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efe67f33c322265eb303ec0ab40275100795b22a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 19:24:45 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=efe67f33c322265eb303ec0ab40275100795b22a commit efe67f33c322265eb303ec0ab40275100795b22a Author: Dimitry Andric AuthorDate: 2021-09-06 19:23:10 +0000 Commit: Dimitry Andric CommitDate: 2021-09-06 19:24:01 +0000 compiler-rt: add aarch64 init function for LSE atomics As reported by Ronald, adding the out-of-line LSE atomics helpers for aarch64 to compiler-rt was not sufficient to link programs using these, as they also require a __aarch64_have_lse_atomics global. This is initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar to the x86 CPU model and feature detection in that file. Since upstream does not yet have a FreeBSD specific implementation for getting the required information, add a simple one that should work for now, while I try to get it sorted with the LLVM people. Reported by: Ronald Klop Fixes: cc55ee8009a5 PR: 257392 MFC after: 2 weeks --- contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c | 6 ++++++ lib/libcompiler_rt/Makefile.inc | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c b/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c index 51bedd98c3d3..13cfeb05dcb8 100644 --- a/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c +++ b/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c @@ -775,8 +775,14 @@ _Bool __aarch64_have_lse_atomics #define HWCAP_ATOMICS (1 << 8) #endif static void CONSTRUCTOR_ATTRIBUTE init_have_lse_atomics(void) { +#if defined(__FreeBSD__) + unsigned long hwcap; + int result = elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); + __aarch64_have_lse_atomics = result == 0 && (hwcap & HWCAP_ATOMICS) != 0; +#else unsigned long hwcap = getauxval(AT_HWCAP); __aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0; +#endif } #endif // defined(__has_include) #endif // __has_include() diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index aa0a6a6c9e69..06d662e38d82 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -146,8 +146,9 @@ SRCF+= floatundisf SRCF+= floatundixf .endif -# __cpu_model support, only used on x86 -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +# __cpu_model support, only used on aarch64 and x86 +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" SRCF+= cpu_model .endif From owner-dev-commits-src-main@freebsd.org Mon Sep 6 21:26:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DE1667BB23; Mon, 6 Sep 2021 21:26:45 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3M0j42MFz3C2r; Mon, 6 Sep 2021 21:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A23326051; Mon, 6 Sep 2021 21:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186LQjPC009509; Mon, 6 Sep 2021 21:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186LQjOm009508; Mon, 6 Sep 2021 21:26:45 GMT (envelope-from git) Date: Mon, 6 Sep 2021 21:26:45 GMT Message-Id: <202109062126.186LQjOm009508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 936f4a42fa2a - main - lltable: do not require prefix lookup when checking lle allocation rules. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 936f4a42fa2a23d21f8f14a8c33627a8207b4b3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 21:26:45 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=936f4a42fa2a23d21f8f14a8c33627a8207b4b3b commit 936f4a42fa2a23d21f8f14a8c33627a8207b4b3b Author: Alexander V. Chernikov AuthorDate: 2021-09-03 11:48:36 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-09-06 21:03:22 +0000 lltable: do not require prefix lookup when checking lle allocation rules. With the new FIB_ALGO infrastructure, nearly all subsystems use fib[46]_lookup() functions, which provides lockless lookups. A number of places remains that uses old-style lookup functions, that still requires RIB read lock to return the result. One of such places is arp processing code. FIB_ALGO implementation makes some tradeoffs, resulting in (relatively) prolonged periods of holding RIB_WLOCK. If the lock is held and datapath competes for it, the RX ring may get blocked, ending in traffic delays and losses. As currently arp processing is performed directly in the interrupt handler, handling ARP replies triggers the problem descibed above when the amount of ARP replies is high. To be more specific, prior to creating new ARP entry, routing lookup for the entry address in interface fib is executed. The following conditions are the verified: 1. If lookup returns an empty result, or the resulting prefix is non-directly-reachable, failure is returned. The only exception are host routes w/ gateway==address. 2. If the routing lookup returns different interface and non-host route, we want to support the use case of having multiple interfaces with the same prefix. In fact, the current code just checks if the returned prefix covers target address (always true) and effectively allow allocating ARP entries for any directly-reachable prefix, regardless of its interface. Change the code to perform the following: 1) use fib4_lookup() to get the nexthop, instead of requesting exact prefix. 2) Rewrite first condition check using nexthop flags (1:1 match) 3) Rewrite second condition to check for interface addresses matching target address on the input interface. Differential Revision: https://reviews.freebsd.org/D31824 Reviewed by: ae MFC after: 1 week PR: 257965 --- sys/netinet/in.c | 73 ++++++++++++++++++-------------------------------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index f9b46b414007..ce03c0b6d4cb 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1358,48 +1359,32 @@ in_lltable_free_entry(struct lltable *llt, struct llentry *lle) static int in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { - struct rt_addrinfo info; - struct sockaddr_in rt_key, rt_mask; - struct sockaddr rt_gateway; - int rt_flags; + struct nhop_object *nh; + struct in_addr addr; KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - bzero(&rt_key, sizeof(rt_key)); - rt_key.sin_len = sizeof(rt_key); - bzero(&rt_mask, sizeof(rt_mask)); - rt_mask.sin_len = sizeof(rt_mask); - bzero(&rt_gateway, sizeof(rt_gateway)); - rt_gateway.sa_len = sizeof(rt_gateway); + addr = ((const struct sockaddr_in *)l3addr)->sin_addr; - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = (struct sockaddr *)&rt_key; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&rt_mask; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; - - if (rib_lookup_info(ifp->if_fib, l3addr, NHR_REF, 0, &info) != 0) + nh = fib4_lookup(ifp->if_fib, addr, 0, NHR_NONE, 0); + if (nh == NULL) return (EINVAL); - rt_flags = info.rti_flags; - /* * If the gateway for an existing host route matches the target L3 * address, which is a special route inserted by some implementation * such as MANET, and the interface is of the correct type, then * allow for ARP to proceed. */ - if (rt_flags & RTF_GATEWAY) { - if (!(rt_flags & RTF_HOST) || !info.rti_ifp || - info.rti_ifp->if_type != IFT_ETHER || - (info.rti_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || - memcmp(rt_gateway.sa_data, l3addr->sa_data, + if (nh->nh_flags & NHF_GATEWAY) { + if (!(nh->nh_flags & NHF_HOST) || nh->nh_ifp->if_type != IFT_ETHER || + (nh->nh_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || + memcmp(nh->gw_sa.sa_data, l3addr->sa_data, sizeof(in_addr_t)) != 0) { - rib_free_info(&info); return (EINVAL); } } - rib_free_info(&info); /* * Make sure that at least the destination address is covered @@ -1408,35 +1393,23 @@ in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr * on one interface and the corresponding outgoing packet leaves * another interface. */ - if (!(rt_flags & RTF_HOST) && info.rti_ifp != ifp) { - const char *sa, *mask, *addr, *lim; - const struct sockaddr_in *l3sin; + if ((nh->nh_ifp != ifp) && (nh->nh_flags & NHF_HOST) == 0) { + struct in_ifaddr *ia = (struct in_ifaddr *)ifaof_ifpforaddr(l3addr, ifp); + struct in_addr dst_addr, mask_addr; - mask = (const char *)&rt_mask; - /* - * Just being extra cautious to avoid some custom - * code getting into trouble. - */ - if ((info.rti_addrs & RTA_NETMASK) == 0) + if (ia == NULL) return (EINVAL); - sa = (const char *)&rt_key; - addr = (const char *)l3addr; - l3sin = (const struct sockaddr_in *)l3addr; - lim = addr + l3sin->sin_len; - - for ( ; addr < lim; sa++, mask++, addr++) { - if ((*sa ^ *addr) & *mask) { -#ifdef DIAGNOSTIC - char addrbuf[INET_ADDRSTRLEN]; + /* + * ifaof_ifpforaddr() returns _best matching_ IFA. + * It is possible that ifa prefix does not cover our address. + * Explicitly verify and fail if that's the case. + */ + dst_addr = IA_SIN(ia)->sin_addr; + mask_addr.s_addr = htonl(ia->ia_subnetmask); - log(LOG_INFO, "IPv4 address: \"%s\" " - "is not on the network\n", - inet_ntoa_r(l3sin->sin_addr, addrbuf)); -#endif - return (EINVAL); - } - } + if (!IN_ARE_MASKED_ADDR_EQUAL(dst_addr, addr, mask_addr)) + return (EINVAL); } return (0); From owner-dev-commits-src-main@freebsd.org Mon Sep 6 23:43:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5AF067CAC9; Mon, 6 Sep 2021 23:43:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Q325v9mz4fsr; Mon, 6 Sep 2021 23:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9D7A27FF8; Mon, 6 Sep 2021 23:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 186NhwRM094832; Mon, 6 Sep 2021 23:43:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 186NhwMK094831; Mon, 6 Sep 2021 23:43:58 GMT (envelope-from git) Date: Mon, 6 Sep 2021 23:43:58 GMT Message-Id: <202109062343.186NhwMK094831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 98168a6e6c12 - main - kqueue: drain kqueue taskqueue if syscall tickled it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98168a6e6c12dab8f608f6b5f5b0b175d2b87ef0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 23:43:59 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98168a6e6c12dab8f608f6b5f5b0b175d2b87ef0 commit 98168a6e6c12dab8f608f6b5f5b0b175d2b87ef0 Author: Konstantin Belousov AuthorDate: 2021-09-06 11:43:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-06 23:43:34 +0000 kqueue: drain kqueue taskqueue if syscall tickled it Otherwise return from the syscall and next syscall, which could be kevent(2) on the kqueue that should be notified, races with the kqueue taskqueue thread, and potentially misses the wakeup. This is reliably visible when kevent(2) only peeks into events using zeroed timeout. PR: 258310 Reported by: arichardson, Jan Kokemüller Reviewed by: arichardson, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31858 --- sys/kern/kern_event.c | 11 +++++++++++ sys/kern/subr_trap.c | 7 ++++++- sys/sys/event.h | 1 + sys/sys/proc.h | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 859248569f76..db505b234268 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1768,9 +1768,16 @@ kqueue_release(struct kqueue *kq, int locked) KQ_UNLOCK(kq); } +void +kqueue_drain_schedtask(void) +{ + taskqueue_quiesce(taskqueue_kqueue_ctx); +} + static void kqueue_schedtask(struct kqueue *kq) { + struct thread *td; KQ_OWNED(kq); KASSERT(((kq->kq_state & KQ_TASKDRAIN) != KQ_TASKDRAIN), @@ -1779,6 +1786,10 @@ kqueue_schedtask(struct kqueue *kq) if ((kq->kq_state & KQ_TASKSCHED) != KQ_TASKSCHED) { taskqueue_enqueue(taskqueue_kqueue_ctx, &kq->kq_task); kq->kq_state |= KQ_TASKSCHED; + td = curthread; + thread_lock(td); + td->td_flags |= TDF_ASTPENDING | TDF_KQTICKLED; + thread_unlock(td); } } diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index edeeded09911..2b86fe75776f 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -241,7 +242,8 @@ ast(struct trapframe *framep) thread_lock(td); flags = td->td_flags; td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK | - TDF_NEEDRESCHED | TDF_ALRMPEND | TDF_PROFPEND | TDF_MACPEND); + TDF_NEEDRESCHED | TDF_ALRMPEND | TDF_PROFPEND | TDF_MACPEND | + TDF_KQTICKLED); thread_unlock(td); VM_CNT_INC(v_trap); @@ -343,6 +345,9 @@ ast(struct trapframe *framep) resched_sigs = false; } + if ((flags & TDF_KQTICKLED) != 0) + kqueue_drain_schedtask(); + /* * Handle deferred update of the fast sigblock value, after * the postsig() loop was performed. diff --git a/sys/sys/event.h b/sys/sys/event.h index cf7db43475fd..80ed1268c8a1 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -349,6 +349,7 @@ int kqfd_register(int fd, struct kevent *kev, struct thread *p, int mflag); int kqueue_add_filteropts(int filt, struct filterops *filtops); int kqueue_del_filteropts(int filt); +void kqueue_drain_schedtask(void); #else /* !_KERNEL */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 39ff1d95f80b..ddc8392481aa 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -451,7 +451,7 @@ do { \ #define TDF_ALLPROCSUSP 0x00000200 /* suspended by SINGLE_ALLPROC */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ #define TDF_ASTPENDING 0x00000800 /* Thread has some asynchronous events. */ -#define TDF_UNUSED12 0x00001000 /* --available-- */ +#define TDF_KQTICKLED 0x00001000 /* AST drain kqueue taskqueue */ #define TDF_SBDRY 0x00002000 /* Stop only on usermode boundary. */ #define TDF_UPIBLOCKED 0x00004000 /* Thread blocked on user PI mutex. */ #define TDF_NEEDSUSPCHK 0x00008000 /* Thread may need to suspend. */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 427AD6A8C21; Tue, 7 Sep 2021 04:45:50 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlL1R93z3k2J; Tue, 7 Sep 2021 04:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111A343B9; Tue, 7 Sep 2021 04:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jnnm095085; Tue, 7 Sep 2021 04:45:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jnKY095084; Tue, 7 Sep 2021 04:45:49 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:49 GMT Message-Id: <202109070445.1874jnKY095084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 7165504a1768 - main - ixgbe: clear all queues on VF reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7165504a17682dc8c96d44c65319bf73c89f7f10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:50 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7165504a17682dc8c96d44c65319bf73c89f7f10 commit 7165504a17682dc8c96d44c65319bf73c89f7f10 Author: Simon Ellmann AuthorDate: 2020-12-17 17:14:52 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: clear all queues on VF reset ixgbe devices support up to 8 Rx and Tx queues per virtual function. Currently, the registers of only seven queues are set to default when resetting a VF. Signed-off-by: Simon Ellmann Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (d2565b347915def3a0f3c68bde6824acf096a0e6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 5dfd28f7bf4f..e692f12ebb0d 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -117,7 +117,7 @@ static void ixgbe_virt_clr_reg(struct ixgbe_hw *hw) IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, 0); - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { IXGBE_WRITE_REG(hw, IXGBE_VFRDH(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), 0); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 700BD6A8775; Tue, 7 Sep 2021 04:45:51 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlM2Dhgz3jty; Tue, 7 Sep 2021 04:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DF3043BA; Tue, 7 Sep 2021 04:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jpxO095109; Tue, 7 Sep 2021 04:45:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jp9A095108; Tue, 7 Sep 2021 04:45:51 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:51 GMT Message-Id: <202109070445.1874jp9A095108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8270b7174c48 - main - ixgbe: fix infinite recursion on PCIe link down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8270b7174c48417a4d5f3effa4a4f4588205e687 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:51 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8270b7174c48417a4d5f3effa4a4f4588205e687 commit 8270b7174c48417a4d5f3effa4a4f4588205e687 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:31 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: fix infinite recursion on PCIe link down In some corner cases the functions ixgbe_clear_rar_generic and ixgbe_clear_vmdq_generic may call one another leading to infinite recursion. When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL flag, it's going to clear MPSAR registers, and proceed to call ixgbe_clear_rar_generic, which in turn will clear the RAR registers, and recursively call back ixgbe_clear_vmdq_generic. Normally, the latter would detect that MPSAR registers have already been cleared and terminate the recursion. However, when PCIe link is down, and before the driver has had the opportunity to shut itself down, all register reads return 0xFFFFFFFF, and all register writes fail silently. In such case, because ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers succeeded, it's going to always call ixgbe_clear_rar_generic, which in turn will always call back ixgbe_clear_vmdq_generic, creating infinite recursion. This patch re-reads MPSAR register values after they had been cleared. In case of PCIe link failure, the values read will be non-zero, which will terminate the recursion. On the other hand, under normal circumstances the value read from MPSAR registers is going to be equal to the value previously written, so this patch is expected not to cause any regressions. Signed-off-by: Robert Konklewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2d04b9e856125197ec8e967471426d56ab7efcf0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index d7da9f81fbf8..92db7c14da45 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3813,11 +3813,11 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) if (vmdq == IXGBE_CLEAR_VMDQ_ALL) { if (mpsar_lo) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0); - mpsar_lo = 0; + mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); } if (mpsar_hi) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0); - mpsar_hi = 0; + mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar)); } } else if (vmdq < 32) { mpsar_lo &= ~(1 << vmdq); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CE506A9062; Tue, 7 Sep 2021 04:45:52 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlN30pVz3jm4; Tue, 7 Sep 2021 04:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48AC73BF2; Tue, 7 Sep 2021 04:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jqVQ095135; Tue, 7 Sep 2021 04:45:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jqV0095134; Tue, 7 Sep 2021 04:45:52 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:52 GMT Message-Id: <202109070445.1874jqV0095134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c4f73d5d6a6c - main - ixgbe: add IPv6 mask for flow director MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4f73d5d6a6c0117e08a03920cce69202865ba13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:52 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c4f73d5d6a6c0117e08a03920cce69202865ba13 commit c4f73d5d6a6c0117e08a03920cce69202865ba13 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:42 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: add IPv6 mask for flow director Write FDIRIP6M register to allow flow director filter to set ipv6 rules without setting ipv6 source/destination address. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (21feefa2fcd5899ee26a10be405c17c0a1109860) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82599.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index e92fb1292da2..15febd08352e 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1868,6 +1868,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ~input_mask->formatted.src_ip[0]); IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRDIP4M, ~input_mask->formatted.dst_ip[0]); + IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRIP6M, 0xFFFFFFFF); } return IXGBE_SUCCESS; } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA1FD6A8C30; Tue, 7 Sep 2021 04:45:53 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlP4Fq0z3jv6; Tue, 7 Sep 2021 04:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63E2D3BF3; Tue, 7 Sep 2021 04:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jrLn095164; Tue, 7 Sep 2021 04:45:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jrh7095163; Tue, 7 Sep 2021 04:45:53 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:53 GMT Message-Id: <202109070445.1874jrh7095163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f511cd22586a - main - ixgbe: improve log about autoneg being disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f511cd22586a9c0358b86334a51e3db60ca2db01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:54 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f511cd22586a9c0358b86334a51e3db60ca2db01 commit f511cd22586a9c0358b86334a51e3db60ca2db01 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:41 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: improve log about autoneg being disabled On ESXi OS, when user disables auto negotiation, the following log appears: "(unsupported) Flow control autoneg is disabled". It is true that auto negotiation is disabled but it is not necessarily true that it is not supported. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (ab6ac48d483ef7f906b90f45182f2ddf3254d876) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 92db7c14da45..34c0f128aae4 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3118,8 +3118,9 @@ void ixgbe_fc_autoneg(struct ixgbe_hw *hw) * - link is not up. */ if (hw->fc.disable_fc_autoneg) { - ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED, - "Flow control autoneg is disabled"); + /* TODO: This should be just an informative log */ + ERROR_REPORT1(IXGBE_ERROR_CAUTION, + "Flow control autoneg is disabled"); goto out; } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED8756A8F4A; Tue, 7 Sep 2021 04:45:54 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlQ5dMBz3jmH; Tue, 7 Sep 2021 04:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DA0B42FA; Tue, 7 Sep 2021 04:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874js3d095188; Tue, 7 Sep 2021 04:45:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jsLq095187; Tue, 7 Sep 2021 04:45:54 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:54 GMT Message-Id: <202109070445.1874jsLq095187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c966c431c764 - main - ixgbe: fix response to apply-update command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c966c431c764c493fafbe65b717243a3c0b291be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:55 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c966c431c764c493fafbe65b717243a3c0b291be commit c966c431c764c493fafbe65b717243a3c0b291be Author: Guinan Sun AuthorDate: 2020-07-09 08:00:29 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: fix response to apply-update command For the "Apply Update" command the firmware does not given an response. For this command, success should be return. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (03b09c71c0c6c516ce05cad8e8aa75e8b9e14fba) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 34c0f128aae4..6ee71dec4fda 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4557,11 +4557,18 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, msec_delay(1); } + /* For each command except "Apply Update" perform + * status checks in the HICR registry. + */ + if ((buffer[0] & IXGBE_HOST_INTERFACE_MASK_CMD) == + IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD) + return IXGBE_SUCCESS; + /* Check command completion */ if ((timeout && i == timeout) || !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) { ERROR_REPORT1(IXGBE_ERROR_CAUTION, - "Command has failed with no status valid.\n"); + "Command has failed with no status valid.\n"); return IXGBE_ERR_HOST_INTERFACE_COMMAND; } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 080CA6A906D; Tue, 7 Sep 2021 04:45:57 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlR5zthz3k4d; Tue, 7 Sep 2021 04:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A96013BF4; Tue, 7 Sep 2021 04:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jtvK095212; Tue, 7 Sep 2021 04:45:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jtuu095211; Tue, 7 Sep 2021 04:45:55 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:55 GMT Message-Id: <202109070445.1874jtuu095211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 31a23e3eb531 - main - ixgbe: fix host interface shadow RAM read MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31a23e3eb5314a6b5929e980a0810803adfaad1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:57 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=31a23e3eb5314a6b5929e980a0810803adfaad1f commit 31a23e3eb5314a6b5929e980a0810803adfaad1f Author: Guinan Sun AuthorDate: 2020-07-09 08:00:28 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:11 +0000 ixgbe: fix host interface shadow RAM read Host interface Shadow RAM Read (0x31) command response buffer length should be stored in two bytes, instead of one byte. This patch fixes it. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (713fc4dd340e5eadd3bfa9a468446afaa5188624) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 3 ++- sys/dev/ixgbe/ixgbe_type.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 6ee71dec4fda..2b9f8a0ca110 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4636,7 +4636,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, * Read Flash command requires reading buffer length from * two byes instead of one byte */ - if (resp->cmd == 0x30) { + if (resp->cmd == IXGBE_HOST_INTERFACE_FLASH_READ_CMD || + resp->cmd == IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD) { for (; bi < dword_len + 2; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 1d00eadc890a..9619b771ea89 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -2426,6 +2426,16 @@ enum { #define IXGBE_FW_LESM_PARAMETERS_PTR 0x2 #define IXGBE_FW_LESM_STATE_1 0x1 #define IXGBE_FW_LESM_STATE_ENABLED 0x8000 /* LESM Enable bit */ +#define IXGBE_FW_LESM_2_STATES_ENABLED_MASK 0x1F +#define IXGBE_FW_LESM_2_STATES_ENABLED 0x12 +#define IXGBE_FW_LESM_STATE0_10G_ENABLED 0x6FFF +#define IXGBE_FW_LESM_STATE1_10G_ENABLED 0x4FFF +#define IXGBE_FW_LESM_STATE0_10G_DISABLED 0x0FFF +#define IXGBE_FW_LESM_STATE1_10G_DISABLED 0x2FFF +#define IXGBE_FW_LESM_PORT0_STATE0_OFFSET 0x2 +#define IXGBE_FW_LESM_PORT0_STATE1_OFFSET 0x3 +#define IXGBE_FW_LESM_PORT1_STATE0_OFFSET 0x6 +#define IXGBE_FW_LESM_PORT1_STATE1_OFFSET 0x7 #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 #define IXGBE_FW_PATCH_VERSION_4 0x7 #define IXGBE_FCOE_IBA_CAPS_BLK_PTR 0x33 /* iSCSI/FCOE block */ @@ -4427,6 +4437,18 @@ struct ixgbe_bypass_eeprom { #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) +/* Code Command (Flash I/F Interface) */ +#define IXGBE_HOST_INTERFACE_FLASH_READ_CMD 0x30 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD 0x31 +#define IXGBE_HOST_INTERFACE_FLASH_WRITE_CMD 0x32 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_WRITE_CMD 0x33 +#define IXGBE_HOST_INTERFACE_FLASH_MODULE_UPDATE_CMD 0x34 +#define IXGBE_HOST_INTERFACE_FLASH_BLOCK_EREASE_CMD 0x35 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_DUMP_CMD 0x36 +#define IXGBE_HOST_INTERFACE_FLASH_INFO_CMD 0x37 +#define IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD 0x38 +#define IXGBE_HOST_INTERFACE_MASK_CMD 0x000000FF + #define IXGBE_REQUEST_TASK_MOD 0x01 #define IXGBE_REQUEST_TASK_MSF 0x02 #define IXGBE_REQUEST_TASK_MBX 0x04 From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59E4F6A8C37; Tue, 7 Sep 2021 04:45:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlV4BBWz3jpR; Tue, 7 Sep 2021 04:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB96D43B6; Tue, 7 Sep 2021 04:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jvgb095260; Tue, 7 Sep 2021 04:45:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jv7Q095259; Tue, 7 Sep 2021 04:45:57 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:57 GMT Message-Id: <202109070445.1874jv7Q095259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 96ef6eb3ae9d - main - ixgbe: fix maximum wait time in comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96ef6eb3ae9d622906fb838c82ede3074f864cdc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:45:59 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=96ef6eb3ae9d622906fb838c82ede3074f864cdc commit 96ef6eb3ae9d622906fb838c82ede3074f864cdc Author: Xiaolong Ye AuthorDate: 2018-11-15 07:20:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:12 +0000 ixgbe: fix maximum wait time in comment As the code has changed the max wait time to 1000ms, the comment should be changed accordingly. Signed-off-by: Xiaolong Ye Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (73247f1ced303c16987bb366d38a2d8a0fc40db4) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index fdb371637d8c..7f32c112f74c 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5377,7 +5377,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, ixgbe_flap_tx_laser(hw); /* Wait for the controller to acquire link. Per IEEE 802.3ap, - * Section 73.10.2, we may have to wait up to 500ms if KR is + * Section 73.10.2, we may have to wait up to 1000ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ for (i = 0; i < 10; i++) { From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 524776A906E; Tue, 7 Sep 2021 04:46:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlW2GWmz3jxQ; Tue, 7 Sep 2021 04:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15D88449C; Tue, 7 Sep 2021 04:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874jxMK095290; Tue, 7 Sep 2021 04:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874jxqk095289; Tue, 7 Sep 2021 04:45:59 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:59 GMT Message-Id: <202109070445.1874jxqk095289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8e9f1b239dc0 - main - ixgbe: fix x550em 10G NIC link status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e9f1b239dc00a2375af87c48321f85a1e37c14e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:00 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8e9f1b239dc00a2375af87c48321f85a1e37c14e commit 8e9f1b239dc00a2375af87c48321f85a1e37c14e Author: Guinan Sun AuthorDate: 2020-07-09 08:00:30 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:12 +0000 ixgbe: fix x550em 10G NIC link status With the NVM image for x550em XFI will not report the auto-negotiation feature correctly. The auto-negotiation should be "No" for supports and advertised items. At the same time update speed makes it support 1G and 10G. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fb03b51da940f1d56d701776fd85a0dfc1ace098) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 868b5cdc2e70..03904c026cae 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1912,7 +1912,14 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_10GB_FULL; } else { + *autoneg = true; + switch (hw->phy.type) { + case ixgbe_phy_x550em_xfi: + *speed = IXGBE_LINK_SPEED_1GB_FULL | + IXGBE_LINK_SPEED_10GB_FULL; + *autoneg = false; + break; case ixgbe_phy_ext_1g_t: case ixgbe_phy_sgmii: *speed = IXGBE_LINK_SPEED_1GB_FULL; @@ -1936,7 +1943,6 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, IXGBE_LINK_SPEED_1GB_FULL; break; } - *autoneg = TRUE; } return IXGBE_SUCCESS; From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:45:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E76566A8E38; Tue, 7 Sep 2021 04:45:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlT3h0kz3k2f; Tue, 7 Sep 2021 04:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D06174123; Tue, 7 Sep 2021 04:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874juLg095236; Tue, 7 Sep 2021 04:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874ju3Z095235; Tue, 7 Sep 2021 04:45:56 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:45:56 GMT Message-Id: <202109070445.1874ju3Z095235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: aaa3af802f90 - main - ixgbe: wait longer for link after fiber MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aaa3af802f90d93fdffb99100fe56f0bc3dda119 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:01 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=aaa3af802f90d93fdffb99100fe56f0bc3dda119 commit aaa3af802f90d93fdffb99100fe56f0bc3dda119 Author: Matthew Smith AuthorDate: 2018-07-16 16:36:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:12 +0000 ixgbe: wait longer for link after fiber MAC setup After setting up the link on a fiber port, the maximum wait time for the link to come up is 500 ms in ixgbe_setup_mac_link_multispeed_fiber(). On an x550 SFP+ port, this is often not sufficiently long for the link to come up. This can result in never being able to retrieve accurate link status for the port using rte_eth_link_get_nowait(). Increase the maximum wait time in ixgbe_setup_mac_link_multispeed_fiber() to 1 s. Signed-off-by: Matthew Smith Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (64f1c8539c8ce99214b9eb1fb728a2c6745f3300) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 2b9f8a0ca110..fdb371637d8c 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5380,7 +5380,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, * Section 73.10.2, we may have to wait up to 500ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 10; i++) { /* Wait for the link partner to also set speed */ msec_delay(100); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D93D6A9074; Tue, 7 Sep 2021 04:46:02 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlY5XVrz3k4x; Tue, 7 Sep 2021 04:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78A4643B8; Tue, 7 Sep 2021 04:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k1i7095338; Tue, 7 Sep 2021 04:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k1aF095337; Tue, 7 Sep 2021 04:46:01 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:01 GMT Message-Id: <202109070446.1874k1aF095337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c1a56b6f5ffd - main - ixgbe: check host interface return status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1a56b6f5ffd6f3180a654d058c1783ccb808e8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:02 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c1a56b6f5ffd6f3180a654d058c1783ccb808e8b commit c1a56b6f5ffd6f3180a654d058c1783ccb808e8b Author: Guinan Sun AuthorDate: 2020-07-09 08:00:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:12 +0000 ixgbe: check host interface return status Writing to read-only fields returns a non-OK Return Status for shadow RAM write command for X550. This information was previously discarded. Signed-off-by: Stanislaw Grzeszczak Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (db18e37090a3b9af47d6a6886248520f6b220bf9) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 02db10b61673..7b120f841d85 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3259,7 +3259,18 @@ s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, status = ixgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), - IXGBE_HI_COMMAND_TIMEOUT, FALSE); + IXGBE_HI_COMMAND_TIMEOUT, TRUE); + if (status != IXGBE_SUCCESS) { + DEBUGOUT2("for offset %04x failed with status %d\n", + offset, status); + return status; + } + + if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) { + DEBUGOUT2("for offset %04x host interface return status %02x\n", + offset, buffer.hdr.rsp.buf_lenh_status); + return IXGBE_ERR_HOST_INTERFACE_COMMAND; + } return status; } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9639F6A8E3F; Tue, 7 Sep 2021 04:46:02 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlX4Z3Xz3jmS; Tue, 7 Sep 2021 04:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46E9B43B7; Tue, 7 Sep 2021 04:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k0Oi095314; Tue, 7 Sep 2021 04:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k0iC095313; Tue, 7 Sep 2021 04:46:00 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:00 GMT Message-Id: <202109070446.1874k0iC095313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b3ebe337ffa0 - main - ixgbe: initialize data field in struct buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:02 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b commit b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b Author: Guinan Sun AuthorDate: 2020-07-09 08:00:40 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:12 +0000 ixgbe: initialize data field in struct buffer While sending request using ixgbe_hic_unlocked() the data field in buffer struct is not used. It is set when the struct is overwritten by FW to deliver the response. To not pass random data to FW the whole structure should be zeroed before use. Signed-off-by: Krzysztof Galazka Signed-off-by: Piotr Pietruszewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40543be5376ca415b2a7e196315d0555725b8bdf) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 03904c026cae..02db10b61673 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3137,6 +3137,7 @@ s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) /* one word */ buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16)); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = hw->mac.ops.acquire_swfw_sync(hw, mask); @@ -3197,6 +3198,7 @@ s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2); buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0558F6A89FF; Tue, 7 Sep 2021 04:46:04 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3XlZ6wLtz3k7D; Tue, 7 Sep 2021 04:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A83243B9; Tue, 7 Sep 2021 04:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k23b095362; Tue, 7 Sep 2021 04:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k287095361; Tue, 7 Sep 2021 04:46:02 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:02 GMT Message-Id: <202109070446.1874k287095361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d5bbb5500cf2 - main - ixgbe: wait for link after copper MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:04 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d commit d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d Author: Ashijeet Acharya AuthorDate: 2019-05-24 09:30:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:22:13 +0000 ixgbe: wait for link after copper MAC setup After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the link does not get set up properly and as a result all the subsequent calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail. Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before beginning to set up the external PHY link speed to ensure that the controller can acquire the link. Signed-off-by: Ashijeet Acharya Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 7b120f841d85..a7759117f5b5 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -4464,6 +4464,8 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, { s32 status; ixgbe_link_speed force_speed; + u32 i; + bool link_up = false; DEBUGFUNC("ixgbe_setup_mac_link_t_X550em"); @@ -4483,6 +4485,19 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) return status; + + /* Wait for the controller to acquire link */ + for (i = 0; i < 10; i++) { + msec_delay(100); + + status = ixgbe_check_link(hw, &force_speed, &link_up, + false); + if (status != IXGBE_SUCCESS) + return status; + + if (link_up) + break; + } } return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3926C6A8C5E; Tue, 7 Sep 2021 04:46:05 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlc3VZrz3jvl; Tue, 7 Sep 2021 04:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC45842FB; Tue, 7 Sep 2021 04:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k3VW095386; Tue, 7 Sep 2021 04:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k335095385; Tue, 7 Sep 2021 04:46:03 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:03 GMT Message-Id: <202109070446.1874k335095385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 994dd6328c66 - main - ixgbe: add typecast for type mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 994dd6328c66fc277438ad51ed074f3c52096147 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:05 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=994dd6328c66fc277438ad51ed074f3c52096147 commit 994dd6328c66fc277438ad51ed074f3c52096147 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:37 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:30:05 +0000 ixgbe: add typecast for type mismatch Add typecast for type mismatch. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d8e52b2cf771c31b523b46852fd86225b5a2c721) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82599.c | 8 ++++---- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 15febd08352e..1f81f6109f1b 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1583,7 +1583,7 @@ void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, * is for FDIRCMD. Then do a 64-bit register write from FDIRHASH. */ fdirhashcmd = (u64)fdircmd << 32; - fdirhashcmd |= ixgbe_atr_compute_sig_hash_82599(input, common); + fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common); IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd); DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd); @@ -1672,7 +1672,7 @@ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { u32 mask = IXGBE_NTOHS(input_mask->formatted.dst_port); mask <<= IXGBE_FDIRTCPM_DPORTM_SHIFT; - mask |= IXGBE_NTOHS(input_mask->formatted.src_port); + mask |= (u32)IXGBE_NTOHS(input_mask->formatted.src_port); mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1); mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2); mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4); @@ -1905,14 +1905,14 @@ s32 ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, /* record source and destination port (little-endian)*/ fdirport = IXGBE_NTOHS(input->formatted.dst_port); fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT; - fdirport |= IXGBE_NTOHS(input->formatted.src_port); + fdirport |= (u32)IXGBE_NTOHS(input->formatted.src_port); IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport); } /* record VLAN (little-endian) and flex_bytes(big-endian) */ fdirvlan = IXGBE_STORE_AS_BE16(input->formatted.flex_bytes); fdirvlan <<= IXGBE_FDIRVLAN_FLEX_SHIFT; - fdirvlan |= IXGBE_NTOHS(input->formatted.vlan_id); + fdirvlan |= (u32)IXGBE_NTOHS(input->formatted.vlan_id); IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, fdirvlan); if (cloud_mode) { diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7f32c112f74c..573f7684e959 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -774,7 +774,7 @@ s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num) DEBUGOUT("NVM Read Error\n"); return ret_val; } - *pba_num |= data; + *pba_num |= (u32)data; return IXGBE_SUCCESS; } diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 0845ba872a1d..37744462bc07 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -198,7 +198,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_TDTQ2TCCR_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_TDTQ2TCCR_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index 4799fe1d943a..3056cbf5c2f3 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -197,7 +197,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_RTTDT2C_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_RTTDT2C_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index a7759117f5b5..6edeeb178289 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -730,7 +730,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) { if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) - setup[0] |= ixgbe_fw_map[i].fw_speed; + setup[0] |= (u32)(ixgbe_fw_map[i].fw_speed); } setup[0] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN; From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA1F26A8C6D; Tue, 7 Sep 2021 04:46:06 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xld4d0Lz3k7R; Tue, 7 Sep 2021 04:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE952449D; Tue, 7 Sep 2021 04:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k4jL095416; Tue, 7 Sep 2021 04:46:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k46B095415; Tue, 7 Sep 2021 04:46:04 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:04 GMT Message-Id: <202109070446.1874k46B095415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b622bdb4ebdf - main - ixgbe: add FW recovery mode check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b622bdb4ebdfc6dfe1a332fcc912426559c829f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:07 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b622bdb4ebdfc6dfe1a332fcc912426559c829f3 commit b622bdb4ebdfc6dfe1a332fcc912426559c829f3 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:40:59 +0000 ixgbe: add FW recovery mode check Add FM NVM recovery mode check. Allow the software to detect this. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_api.c | 12 ++++++++++++ sys/dev/ixgbe/ixgbe_api.h | 1 + sys/dev/ixgbe/ixgbe_type.h | 4 ++++ sys/dev/ixgbe/ixgbe_x550.c | 16 ++++++++++++++++ sys/dev/ixgbe/ixgbe_x550.h | 1 + 5 files changed, 34 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index c71afcb0df67..5e662dac93f9 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1306,6 +1306,18 @@ void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf) hw->mac.ops.restore_mdd_vf(hw, vf); } +/** + * ixgbe_fw_recovery_mode - Check if in FW NVM recovery mode + * @hw: pointer to hardware structure + * + **/ +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw) +{ + if (hw->mac.ops.fw_recovery_mode) + return hw->mac.ops.fw_recovery_mode(hw); + return false; +} + /** * ixgbe_enter_lplu - Transition to low power states * @hw: pointer to hardware structure diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index c59b3a2dea9c..aabe573127f3 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -217,6 +217,7 @@ void ixgbe_disable_mdd(struct ixgbe_hw *hw); void ixgbe_enable_mdd(struct ixgbe_hw *hw); void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap); void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf); +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw); s32 ixgbe_enter_lplu(struct ixgbe_hw *hw); s32 ixgbe_handle_lasi(struct ixgbe_hw *hw); void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 9619b771ea89..c3c29dbdba52 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1080,6 +1080,9 @@ struct ixgbe_dmac_config { #define IXGBE_FWSM_MODE_MASK 0xE #define IXGBE_FWSM_TS_ENABLED 0x1 #define IXGBE_FWSM_FW_MODE_PT 0x4 +#define IXGBE_FWSM_FW_NVM_RECOVERY_MODE (1 << 5) +#define IXGBE_FWSM_EXT_ERR_IND_MASK 0x01F80000 +#define IXGBE_FWSM_FW_VAL_BIT (1 << 15) /* ARC Subsystem registers */ #define IXGBE_HICR 0x15F00 @@ -4010,6 +4013,7 @@ struct ixgbe_mac_operations { void (*enable_mdd)(struct ixgbe_hw *hw); void (*mdd_event)(struct ixgbe_hw *hw, u32 *vf_bitmap); void (*restore_mdd_vf)(struct ixgbe_hw *hw, u32 vf); + bool (*fw_recovery_mode)(struct ixgbe_hw *hw); }; struct ixgbe_phy_operations { diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 6edeeb178289..aa91c4da7019 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -83,6 +83,7 @@ s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw) mac->ops.enable_mdd = ixgbe_enable_mdd_X550; mac->ops.mdd_event = ixgbe_mdd_event_X550; mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550; + mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_X550; mac->ops.disable_rx = ixgbe_disable_rx_x550; /* Manageability interface */ mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_x550; @@ -4676,3 +4677,18 @@ s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, return ret_val; } + +/** + * ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode + * @hw: pointer t hardware structure + * + * Returns true if in FW NVM recovery mode. + **/ +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) +{ + u32 fwsm; + + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)); + + return !!(fwsm & IXGBE_FWSM_FW_NVM_RECOVERY_MODE); +} diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index 44c9d06a42d9..ac2de750cfb7 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -122,4 +122,5 @@ s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw); s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw); s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx); s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx); +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw); #endif /* _IXGBE_X550_H_ */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ED866A8E60; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlj238Cz3k3P; Tue, 7 Sep 2021 04:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FA1D3BF7; Tue, 7 Sep 2021 04:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k5Lq095440; Tue, 7 Sep 2021 04:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k5Ah095439; Tue, 7 Sep 2021 04:46:05 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:05 GMT Message-Id: <202109070446.1874k5Ah095439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 79b36ec91dec - main - ixgbe: Use C99 bool types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79b36ec91decc18d062fc428e2fd34d41aba0630 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:10 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=79b36ec91decc18d062fc428e2fd34d41aba0630 commit 79b36ec91decc18d062fc428e2fd34d41aba0630 Author: Kevin Bowling AuthorDate: 2021-09-07 02:54:22 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 02:54:22 +0000 ixgbe: Use C99 bool types Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/if_ix.c | 86 +++++++++++++------------- sys/dev/ixgbe/if_ixv.c | 30 +++++----- sys/dev/ixgbe/if_sriov.c | 24 ++++---- sys/dev/ixgbe/ix_txrx.c | 12 ++-- sys/dev/ixgbe/ixgbe.h | 4 +- sys/dev/ixgbe/ixgbe_82598.c | 48 +++++++-------- sys/dev/ixgbe/ixgbe_82599.c | 104 ++++++++++++++++---------------- sys/dev/ixgbe/ixgbe_api.c | 14 ++--- sys/dev/ixgbe/ixgbe_common.c | 130 ++++++++++++++++++++-------------------- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 10 ++-- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 4 -- sys/dev/ixgbe/ixgbe_phy.c | 84 +++++++++++++------------- sys/dev/ixgbe/ixgbe_vf.c | 18 +++--- sys/dev/ixgbe/ixgbe_x540.c | 8 +-- sys/dev/ixgbe/ixgbe_x550.c | 98 +++++++++++++++--------------- 18 files changed, 338 insertions(+), 342 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 91bf7e4dd218..42523f82cc01 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -332,7 +332,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, * of unsupported SFP+ modules, note that * doing so you are on your own :) */ -static int allow_unsupported_sfp = FALSE; +static int allow_unsupported_sfp = false; SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN, &allow_unsupported_sfp, 0, "Allow unsupported SFP modules...use at your own risk"); @@ -356,7 +356,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_rss, CTLFLAG_RDTUN, &ixgbe_enable_rss, 0, * is varied over time based on the * traffic for that interrupt vector */ -static int ixgbe_enable_aim = FALSE; +static int ixgbe_enable_aim = false; SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RWTUN, &ixgbe_enable_aim, 0, "Enable adaptive interrupt moderation"); @@ -943,7 +943,7 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Verify adapter fan is still functional (if applicable) */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); - ixgbe_check_fan_failure(adapter, esdp, FALSE); + ixgbe_check_fan_failure(adapter, esdp, false); } /* Ensure SW/FW semaphore is free */ @@ -952,16 +952,16 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Set an initial default flow control value */ hw->fc.requested_mode = ixgbe_flow_control; - hw->phy.reset_if_overtemp = TRUE; + hw->phy.reset_if_overtemp = true; error = ixgbe_reset_hw(hw); - hw->phy.reset_if_overtemp = FALSE; + hw->phy.reset_if_overtemp = false; if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* * No optics in this port, set up * so the timer routine will probe * for later insertion. */ - adapter->sfp_probe = TRUE; + adapter->sfp_probe = true; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!\n"); @@ -1097,7 +1097,7 @@ ixgbe_if_attach_post(if_ctx_t ctx) ixgbe_enable_tx_laser(hw); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); ixgbe_initialize_iov(adapter); @@ -1366,23 +1366,23 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) switch (hw->mac.type) { case ixgbe_mac_82598EB: if (hw->phy.type == ixgbe_phy_nl) - return (TRUE); - return (FALSE); + return (true); + return (false); case ixgbe_mac_82599EB: switch (hw->mac.ops.get_media_type(hw)) { case ixgbe_media_type_fiber: case ixgbe_media_type_fiber_qsfp: - return (TRUE); + return (true); default: - return (FALSE); + return (false); } case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) - return (TRUE); - return (FALSE); + return (true); + return (false); default: - return (FALSE); + return (false); } } /* ixgbe_is_sfp */ @@ -1405,7 +1405,7 @@ ixgbe_config_link(if_ctx_t ctx) } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); if (err) return; autoneg = hw->phy.autoneg_advertised; @@ -1911,7 +1911,7 @@ ixgbe_setup_vlan_hw_support(if_ctx_t ctx) ctrl |= IXGBE_RXDCTL_VME; IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } - rxr->vtag_strip = TRUE; + rxr->vtag_strip = true; } } @@ -1948,7 +1948,7 @@ ixgbe_get_slot_info(struct adapter *adapter) { device_t dev = iflib_get_dev(adapter->ctx); struct ixgbe_hw *hw = &adapter->hw; - int bus_info_valid = TRUE; + int bus_info_valid = true; u32 offset; u16 link; @@ -1997,7 +1997,7 @@ get_parent_info: * Hmm...can't get PCI-Express capabilities. * Falling back to default method. */ - bus_info_valid = FALSE; + bus_info_valid = false; ixgbe_get_bus_info(hw); goto display; } @@ -2423,8 +2423,8 @@ ixgbe_if_media_change(if_ctx_t ctx) goto invalid; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = ((speed & IXGBE_LINK_SPEED_10GB_FULL) ? 4 : 0) | ((speed & IXGBE_LINK_SPEED_1GB_FULL) ? 2 : 0) | @@ -2578,7 +2578,7 @@ ixgbe_msix_link(void *arg) /* Check for fan failure */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { - ixgbe_check_fan_failure(adapter, eicr, TRUE); + ixgbe_check_fan_failure(adapter, eicr, true); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); } @@ -2795,7 +2795,7 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) s32 error = 0; if (!hw->wol_enabled) - ixgbe_set_phy_power(hw, FALSE); + ixgbe_set_phy_power(hw, false); /* Limit power management flow to X550EM baseT */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && @@ -2821,12 +2821,12 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN); /* X550EM baseT adapters need a special LPLU flow */ - hw->phy.reset_disable = TRUE; + hw->phy.reset_disable = true; ixgbe_if_stop(ctx); error = hw->phy.ops.enter_lplu(hw); if (error) device_printf(dev, "Error entering LPLU: %d\n", error); - hw->phy.reset_disable = FALSE; + hw->phy.reset_disable = false; } else { /* Just stop for other adapters */ ixgbe_if_stop(ctx); @@ -3127,7 +3127,7 @@ ixgbe_if_init(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); /* Config/Enable Link */ ixgbe_config_link(ctx); @@ -3336,7 +3336,7 @@ ixgbe_config_delay_values(struct adapter *adapter) hw->fc.low_water[0] = IXGBE_BT2KB(tmp); hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.send_xon = TRUE; + hw->fc.send_xon = true; } /* ixgbe_config_delay_values */ /************************************************************************ @@ -3392,7 +3392,7 @@ ixgbe_if_multi_set(if_ctx_t ctx) if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixgbe_mc_array_itr, TRUE); + ixgbe_mc_array_itr, true); } } /* ixgbe_if_multi_set */ @@ -3455,7 +3455,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct ixgbe_hw *hw = &adapter->hw; device_t dev = iflib_get_dev(ctx); - bool result = FALSE; + bool result = false; if ((hw->phy.type == ixgbe_phy_nl) && (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { @@ -3463,7 +3463,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) if (ret) goto out; ret = hw->phy.ops.reset(hw); - adapter->sfp_probe = FALSE; + adapter->sfp_probe = false; if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!"); device_printf(dev, @@ -3472,7 +3472,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) } else device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ - result = TRUE; + result = true; } out: @@ -3554,7 +3554,7 @@ ixgbe_handle_msf(void *context) if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) - hw->mac.ops.setup_link(hw, autoneg, TRUE); + hw->mac.ops.setup_link(hw, autoneg, true); /* Adjust media types shown in ifconfig */ ifmedia_removeall(adapter->media); @@ -3596,7 +3596,7 @@ ixgbe_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("ixgbe_if_stop: begin\n"); ixgbe_reset_hw(hw); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; ixgbe_stop_adapter(hw); if (hw->mac.type == ixgbe_mac_82599EB) ixgbe_stop_mac_link_on_d3_82599(hw); @@ -3604,7 +3604,7 @@ ixgbe_if_stop(if_ctx_t ctx) ixgbe_disable_tx_laser(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixgbe_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -3627,12 +3627,12 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; /* Update any Flow Control changes */ ixgbe_fc_enable(&adapter->hw); /* Update DMA coalescing config */ @@ -3644,11 +3644,11 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) ixgbe_ping_all_vfs(adapter); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; if (adapter->feat_en & IXGBE_FEATURE_SRIOV) ixgbe_ping_all_vfs(adapter); } @@ -3685,7 +3685,7 @@ ixgbe_config_dmac(struct adapter *adapter) if (dcfg->watchdog_timer ^ adapter->dmac || dcfg->link_speed ^ adapter->link_speed) { dcfg->watchdog_timer = adapter->dmac; - dcfg->fcoe_en = FALSE; + dcfg->fcoe_en = false; dcfg->link_speed = adapter->link_speed; dcfg->num_tcs = 1; @@ -4016,7 +4016,7 @@ ixgbe_set_flowcntl(struct adapter *adapter, int fc) } /* Don't autoneg if forcing a value */ - adapter->hw.fc.disable_fc_autoneg = TRUE; + adapter->hw.fc.disable_fc_autoneg = true; ixgbe_fc_enable(&adapter->hw); return (0); @@ -4115,7 +4115,7 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) ixgbe_link_speed speed = 0; ixgbe_link_speed link_caps = 0; s32 err = IXGBE_NOT_IMPLEMENTED; - bool negotiate = FALSE; + bool negotiate = false; /* Checks to validate new value */ if (adapter->advertise == advertise) /* no change */ @@ -4177,8 +4177,8 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) speed |= IXGBE_LINK_SPEED_10_FULL; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = advertise; return (0); @@ -4201,7 +4201,7 @@ ixgbe_get_advertise(struct adapter *adapter) int speed; ixgbe_link_speed link_caps = 0; s32 err; - bool negotiate = FALSE; + bool negotiate = false; /* * Advertised speed means nothing unless it's copper or diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 301d3c0368ae..acebf0a65e12 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -195,7 +195,7 @@ TUNABLE_INT("hw.ixv.flow_control", &ixv_flow_control); * it can be a performance win in some workloads, but * in others it actually hurts, its off by default. */ -static int ixv_header_split = FALSE; +static int ixv_header_split = false; TUNABLE_INT("hw.ixv.hdr_split", &ixv_header_split); /* @@ -602,7 +602,7 @@ ixv_if_init(if_ctx_t ctx) int error = 0; INIT_DEBUGOUT("ixv_if_init: begin"); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* reprogram the RAR[0] in case user changed it. */ @@ -649,7 +649,7 @@ ixv_if_init(if_ctx_t ctx) /* Config/Enable Link */ hw->mac.ops.check_link(hw, &adapter->link_speed, &adapter->link_up, - FALSE); + false); /* And now turn on interrupts */ ixv_if_enable_intr(ctx); @@ -849,7 +849,7 @@ ixv_if_multi_set(if_ctx_t ctx) update_ptr = mta; adapter->hw.mac.ops.update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixv_mc_array_itr, TRUE); + ixv_mc_array_itr, true); } /* ixv_if_multi_set */ /************************************************************************ @@ -903,33 +903,33 @@ ixv_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); s32 status; - adapter->hw.mac.get_link_status = TRUE; + adapter->hw.mac.get_link_status = true; status = ixgbe_check_link(&adapter->hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); - if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == FALSE) { + if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == false) { /* Mailbox's Clear To Send status is lost or timeout occurred. * We need reinitialization. */ iflib_get_ifp(ctx)->if_init(ctx); } if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; iflib_link_state_change(ctx, LINK_STATE_UP, IF_Gbps(10)); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; } } @@ -955,11 +955,11 @@ ixv_if_stop(if_ctx_t ctx) ixv_if_disable_intr(ctx); hw->mac.ops.reset_hw(hw); - adapter->hw.adapter_stopped = FALSE; + adapter->hw.adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixv_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -1510,7 +1510,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) * Let Rx path know that it needs to store VLAN tag * as part of extra mbuf info. */ - adapter->rx_queues[i].rxr.vtag_strip = TRUE; + adapter->rx_queues[i].rxr.vtag_strip = true; } } @@ -1540,7 +1540,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) continue; vid = (i * 32) + j; /* Call the shared code mailbox routine */ - while (hw->mac.ops.set_vfta(hw, vid, 0, TRUE, FALSE)) { + while (hw->mac.ops.set_vfta(hw, vid, 0, true, false)) { if (++retry > 5) break; } diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 9a7d73a69d2d..3cc4d788ecd4 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -62,11 +62,11 @@ ixgbe_define_iov_schemas(device_t dev, int *error) vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", - IOV_SCHEMA_HASDEFAULT, TRUE); + IOV_SCHEMA_HASDEFAULT, true); pci_iov_schema_add_bool(vf_schema, "allow-set-mac", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); pci_iov_schema_add_bool(vf_schema, "allow-promisc", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); *error = pci_iov_attach(dev, pf_schema, vf_schema); if (*error != 0) { device_printf(dev, @@ -266,7 +266,7 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * frames on PFs and VFs. */ if (adapter->hw.mac.type != ixgbe_mac_82599EB) - return (TRUE); + return (true); switch (vf->api_ver) { case IXGBE_API_VER_1_0: @@ -277,9 +277,9 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) */ if (adapter->max_frame_size > ETHER_MAX_LEN || vf->maximum_frame_size > ETHER_MAX_LEN) - return (FALSE); + return (false); - return (TRUE); + return (true); break; case IXGBE_API_VER_1_1: @@ -289,16 +289,16 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * jumbo frames. */ if (vf->maximum_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); /* * Jumbo frames only work with VFs if the PF is also using jumbo * frames. */ if (adapter->max_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); - return (FALSE); + return (false); } } /* ixgbe_vf_frame_size_compatible */ @@ -362,7 +362,7 @@ ixgbe_vf_reset_msg(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, - vf->pool, TRUE); + vf->pool, true); ack = IXGBE_VT_MSGTYPE_ACK; } else ack = IXGBE_VT_MSGTYPE_NACK; @@ -400,7 +400,7 @@ ixgbe_vf_set_mac(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) bcopy(mac, vf->ether_addr, ETHER_ADDR_LEN); ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, vf->pool, - TRUE); + true); ixgbe_send_vf_ack(adapter, vf, msg[0]); } /* ixgbe_vf_set_mac */ @@ -764,7 +764,7 @@ ixgbe_init_vf(struct adapter *adapter, struct ixgbe_vf *vf) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, - vf->ether_addr, vf->pool, TRUE); + vf->ether_addr, vf->pool, true); } ixgbe_vf_enable_transmit(adapter, vf); diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index fe38919fc594..2cecf79b3422 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -88,7 +88,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) uint32_t olinfo_status, mss_l4len_idx, pktlen, offload; u8 ehdrlen; - offload = TRUE; + offload = true; olinfo_status = mss_l4len_idx = vlan_macip_lens = type_tucmd_mlhl = 0; /* VLAN MACLEN IPLEN */ vlan_macip_lens |= (htole16(pi->ipi_vtag) << IXGBE_ADVTXD_VLAN_SHIFT); @@ -126,7 +126,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) } else if (pi->ipi_flags & IPI_TX_IPV6) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; else - offload = FALSE; + offload = false; vlan_macip_lens |= pi->ipi_ip_hlen; @@ -135,22 +135,22 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP | CSUM_TSO)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; else - offload = FALSE; + offload = false; break; case IPPROTO_UDP: if (pi->ipi_csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; else - offload = FALSE; + offload = false; break; case IPPROTO_SCTP: if (pi->ipi_csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP; else - offload = FALSE; + offload = false; break; default: - offload = FALSE; + offload = false; break; } /* Insert L4 checksum into data descriptors */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 31d5cc41c066..93bfff427a27 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -569,11 +569,11 @@ drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) static inline bool ixv_check_ether_addr(u8 *addr) { - bool status = TRUE; + bool status = true; if ((addr[0] == 0 && addr[1]== 0 && addr[2] == 0 && addr[3] == 0 && addr[4]== 0 && addr[5] == 0)) - status = FALSE; + status = false; return (status); } diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 7c821aea2d03..885dfbf869bc 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -316,17 +316,17 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_AN: @@ -336,7 +336,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; default: @@ -443,7 +443,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) * so if it's on turn it off once we know link_speed. For * more details see 82598 Specification update. */ - hw->mac.ops.check_link(hw, &link_speed, &link_up, FALSE); + hw->mac.ops.check_link(hw, &link_speed, &link_up, false); if (link_up && link_speed == IXGBE_LINK_SPEED_1GB_FULL) { switch (hw->fc.requested_mode) { case ixgbe_fc_full: @@ -550,7 +550,7 @@ out: /** * ixgbe_start_mac_link_82598 - Configures MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -635,7 +635,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) * ixgbe_check_mac_link_82598 - Get link/speed status * @hw: pointer to hardware structure * @speed: pointer to link speed - * @link_up: TRUE is link is up, FALSE otherwise + * @link_up: true is link is up, false otherwise * @link_up_wait_to_complete: bool used to wait for link up or not * * Reads the links register to determine if link is up and the current speed @@ -665,10 +665,10 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, for (i = 0; i < hw->mac.max_link_up_time; i++) { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); hw->phy.ops.read_reg(hw, 0xC79F, @@ -680,12 +680,12 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, } } else { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } - if (*link_up == FALSE) + if (*link_up == false) goto out; } @@ -693,19 +693,19 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < hw->mac.max_link_up_time; i++) { if (links_reg & IXGBE_LINKS_UP) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); } } else { if (links_reg & IXGBE_LINKS_UP) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } if (links_reg & IXGBE_LINKS_SPEED) @@ -713,9 +713,9 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_1GB_FULL; - if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == TRUE) && + if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == true) && (ixgbe_validate_link_ready(hw) != IXGBE_SUCCESS)) - *link_up = FALSE; + *link_up = false; out: return IXGBE_SUCCESS; @@ -725,7 +725,7 @@ out: * ixgbe_setup_mac_link_82598 - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ @@ -733,7 +733,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait_to_complete) { - bool autoneg = FALSE; + bool autoneg = false; s32 status = IXGBE_SUCCESS; ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN; u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -779,7 +779,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE if waiting is needed to complete + * @autoneg_wait_to_complete: true if waiting is needed to complete * * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ @@ -859,7 +859,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) } /* Reset PHY */ - if (hw->phy.reset_disable == FALSE) { + if (hw->phy.reset_disable == false) { /* PHY ops must be identified and initialized prior to reset */ /* Init PHY and function pointers, perform SFP setup */ @@ -915,9 +915,9 @@ mac_reset_top: * AUTOC value since the reset operation sets back to deaults. */ autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); - if (hw->mac.orig_link_settings_stored == FALSE) { + if (hw->mac.orig_link_settings_stored == false) { hw->mac.orig_autoc = autoc; - hw->mac.orig_link_settings_stored = TRUE; + hw->mac.orig_link_settings_stored = true; } else if (autoc != hw->mac.orig_autoc) { IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc); } diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 1f81f6109f1b..d682dfbc9ab8 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -124,7 +124,7 @@ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) { /* Store flag indicating I2C bus access control unit. */ - hw->phy.qsfp_shared_i2c_bus = TRUE; + hw->phy.qsfp_shared_i2c_bus = true; /* Initialize access to QSFP+ I2C bus */ esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); @@ -215,7 +215,7 @@ s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) /* Restart DSP and set SFI mode */ ret_val = hw->mac.ops.prot_autoc_write(hw, hw->mac.orig_autoc | IXGBE_AUTOC_LMS_10G_SERIAL, - FALSE); + false); if (ret_val) { DEBUGOUT("sfp module setup not complete\n"); @@ -252,7 +252,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { s32 ret_val; - *locked = FALSE; + *locked = false; /* If LESM is on then we need to hold the SW/FW semaphore. */ if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { ret_val = hw->mac.ops.acquire_swfw_sync(hw, @@ -260,7 +260,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - *locked = TRUE; + *locked = true; } *reg_val = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -295,7 +295,7 @@ s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - locked = TRUE; + locked = true; } IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); @@ -409,7 +409,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) * ixgbe_get_link_capabilities_82599 - Determines link capabilities * @hw: pointer to hardware structure * @speed: pointer to link speed - * @autoneg: TRUE when autoneg or autotry is enabled + * @autoneg: true when autoneg or autotry is enabled * * Determines the link capabilities by reading the AUTOC register. **/ @@ -431,7 +431,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; goto out; } @@ -448,22 +448,22 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_10G_SERIAL: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_KX4_KX_KR: @@ -475,7 +475,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII: @@ -486,12 +486,12 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_SGMII_1G_100M: *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL; - *autoneg = FALSE; + *autoneg = false; break; default: @@ -508,9 +508,9 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, * Limited autoneg is enabled at 1G */ if (hw->phy.media_type == ixgbe_media_type_fiber_qsfp) - *autoneg = FALSE; + *autoneg = false; else - *autoneg = TRUE; + *autoneg = true; } out: @@ -568,7 +568,7 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) break; case IXGBE_DEV_ID_82599_BYPASS: media_type = ixgbe_media_type_fiber_fixed; - hw->phy.multispeed_fiber = TRUE; + hw->phy.multispeed_fiber = true; break; default: media_type = ixgbe_media_type_unknown; @@ -604,7 +604,7 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) /** * ixgbe_start_mac_link_82599 - Setup MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -616,7 +616,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, u32 links_reg; u32 i; s32 status = IXGBE_SUCCESS; - bool got_lock = FALSE; + bool got_lock = false; DEBUGFUNC("ixgbe_start_mac_link_82599"); @@ -630,7 +630,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) goto out; - got_lock = TRUE; + got_lock = true; } /* Restart link */ @@ -716,11 +716,11 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) * @hw: pointer to hardware structure * * When the driver changes the link speeds that it can support, - * it sets autotry_restart to TRUE to indicate that we need to + * it sets autotry_restart to true to indicate that we need to * initiate a new autotry session with the link partner. To do * so, we set the speed then disable and re-enable the Tx laser, to * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with TRUE clause 37 autoneg, which also + * end. This is consistent with true clause 37 autoneg, which also * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) @@ -734,7 +734,7 @@ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) if (hw->mac.autotry_restart) { *** 1758 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0312A6A8C76; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlj1sTRz3k3M; Tue, 7 Sep 2021 04:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31E2D43BE; Tue, 7 Sep 2021 04:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k77I095464; Tue, 7 Sep 2021 04:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k7H1095463; Tue, 7 Sep 2021 04:46:07 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:07 GMT Message-Id: <202109070446.1874k7H1095463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c85b6f2901e7 - main - ixgbe: replace an operation in X550 setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c85b6f2901e7804105ca1d6d41cc5eb9a60474b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:10 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c85b6f2901e7804105ca1d6d41cc5eb9a60474b8 commit c85b6f2901e7804105ca1d6d41cc5eb9a60474b8 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:11 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 03:01:35 +0000 ixgbe: replace an operation in X550 setup Replace "=" operation with "|=" operation to only set the intended register bits. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (1b665ccd9cd73499e934b807bec2fd77193912ef) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index bcfbe14b30d2..b5f1bc4f6ef8 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -2802,9 +2802,9 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, (IXGBE_CS4227_EDC_MODE_SR << 1)); if (setup_linear) - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; else - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; ret_val = hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1DB96A928F; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlk4MCGz3k5W; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6967544A1; Tue, 7 Sep 2021 04:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k9cv095512; Tue, 7 Sep 2021 04:46:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k9Cs095511; Tue, 7 Sep 2021 04:46:09 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:09 GMT Message-Id: <202109070446.1874k9Cs095511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8455e365f77f - main - ixgbe: Update copyright to 2020 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8455e365f77f5b66ac9521dbcd690f79345ce147 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:11 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8455e365f77f5b66ac9521dbcd690f79345ce147 commit 8455e365f77f5b66ac9521dbcd690f79345ce147 Author: Kevin Bowling AuthorDate: 2021-09-07 03:11:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 03:13:28 +0000 ixgbe: Update copyright to 2020 Synced to the ixgbe shared code with DPDK shared code which has local fixes on top of "not-released-cid-ixgbe.2020.06.09.tar.gz" Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82598.c | 2 +- sys/dev/ixgbe/ixgbe_82598.h | 2 +- sys/dev/ixgbe/ixgbe_82599.c | 2 +- sys/dev/ixgbe/ixgbe_82599.h | 2 +- sys/dev/ixgbe/ixgbe_api.c | 2 +- sys/dev/ixgbe/ixgbe_api.h | 2 +- sys/dev/ixgbe/ixgbe_bypass.h | 2 +- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.h | 2 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_features.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.c | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 2 +- sys/dev/ixgbe/ixgbe_phy.h | 2 +- sys/dev/ixgbe/ixgbe_rss.h | 2 +- sys/dev/ixgbe/ixgbe_sriov.h | 2 +- sys/dev/ixgbe/ixgbe_type.h | 2 +- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_vf.h | 2 +- sys/dev/ixgbe/ixgbe_x540.c | 2 +- sys/dev/ixgbe/ixgbe_x540.h | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- sys/dev/ixgbe/ixgbe_x550.h | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 885dfbf869bc..c1d657afb6f5 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82598.h b/sys/dev/ixgbe/ixgbe_82598.h index dc69c026423c..09b8c6054109 100644 --- a/sys/dev/ixgbe/ixgbe_82598.h +++ b/sys/dev/ixgbe/ixgbe_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index d682dfbc9ab8..f692c19dc979 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.h b/sys/dev/ixgbe/ixgbe_82599.h index ee9a33667e62..2e9a0407a610 100644 --- a/sys/dev/ixgbe/ixgbe_82599.h +++ b/sys/dev/ixgbe/ixgbe_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 2ae2db78d0ed..5bb5d196e2c0 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index aabe573127f3..c70f27c6aa2c 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_bypass.h b/sys/dev/ixgbe/ixgbe_bypass.h index 9a8d6d259cae..42a8eeb72e71 100644 --- a/sys/dev/ixgbe/ixgbe_bypass.h +++ b/sys/dev/ixgbe/ixgbe_bypass.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index be631552babe..6a86445c80e5 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index af0db6e4c7dd..b072770acafa 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.c b/sys/dev/ixgbe/ixgbe_dcb.c index d0ae965bc6ac..5e1f5e44b379 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.c +++ b/sys/dev/ixgbe/ixgbe_dcb.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.h b/sys/dev/ixgbe/ixgbe_dcb.h index 92baad807c30..7dfe8547112f 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.h +++ b/sys/dev/ixgbe/ixgbe_dcb.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 20a350716289..eb39bfb38b57 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.h b/sys/dev/ixgbe/ixgbe_dcb_82598.h index d16471bc395a..74cf2760cc6d 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index c5fc42e23649..591c705aba08 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.h b/sys/dev/ixgbe/ixgbe_dcb_82599.h index faa2ac00f9d3..892a384b4c19 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_fdir.h b/sys/dev/ixgbe/ixgbe_fdir.h index f5e1593072a5..5baafa458470 100644 --- a/sys/dev/ixgbe/ixgbe_fdir.h +++ b/sys/dev/ixgbe/ixgbe_fdir.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index bb05885497dd..a9b3c8e41e6b 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 26e7e5deaf05..385b8e5354f2 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 44ccc071f311..9b3deb28f149 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.c b/sys/dev/ixgbe/ixgbe_osdep.c index e45531ea8c3f..61617b69ff04 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.c +++ b/sys/dev/ixgbe/ixgbe_osdep.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.h b/sys/dev/ixgbe/ixgbe_osdep.h index 281c221b59f0..b7eaa788c99e 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.h +++ b/sys/dev/ixgbe/ixgbe_osdep.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 28930ca3267d..3868ed4fc0ea 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index ea0cd4fca196..9fd3f6d2163e 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_rss.h b/sys/dev/ixgbe/ixgbe_rss.h index 7e7620be63f4..7eda43ec1609 100644 --- a/sys/dev/ixgbe/ixgbe_rss.h +++ b/sys/dev/ixgbe/ixgbe_rss.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_sriov.h b/sys/dev/ixgbe/ixgbe_sriov.h index 36ca7cacc853..f80d5e9dacf9 100644 --- a/sys/dev/ixgbe/ixgbe_sriov.h +++ b/sys/dev/ixgbe/ixgbe_sriov.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index c3c29dbdba52..a538af5d3569 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index a125bcbb8386..f01fd99eb4c0 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.h b/sys/dev/ixgbe/ixgbe_vf.h index cdc59704dcaf..5cdb241ec2aa 100644 --- a/sys/dev/ixgbe/ixgbe_vf.h +++ b/sys/dev/ixgbe/ixgbe_vf.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index db2d90e1230e..ace1ec8a33d3 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.h b/sys/dev/ixgbe/ixgbe_x540.h index 6f630602567b..e48ef52f576c 100644 --- a/sys/dev/ixgbe/ixgbe_x540.h +++ b/sys/dev/ixgbe/ixgbe_x540.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index b5f1bc4f6ef8..df19c4c65201 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index ac2de750cfb7..7a24e50e1b5a 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 679966A9202; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlj5QKHz3kGc; Tue, 7 Sep 2021 04:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BCA04129; Tue, 7 Sep 2021 04:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874k8CJ095488; Tue, 7 Sep 2021 04:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874k8Ph095487; Tue, 7 Sep 2021 04:46:08 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:08 GMT Message-Id: <202109070446.1874k8Ph095487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0b487fb4547a - main - ixgbe: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b487fb4547ad1a939be0d523e555557c94b7cd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:11 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0b487fb4547ad1a939be0d523e555557c94b7cd1 commit 0b487fb4547ad1a939be0d523e555557c94b7cd1 Author: Ferruh Yigit AuthorDate: 2020-06-30 14:45:54 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 03:06:53 +0000 ixgbe: remove dead code The question around getting rid of the assignments seems lived long enough, if they are not needed until now, we can drop them. Signed-off-by: Ferruh Yigit Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (a6395d471e14e5a7432875dad8fb3533238c5167) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_dcb_82598.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 37744462bc07..20a350716289 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -67,14 +67,6 @@ s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw, stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc)); /* Received Bytes */ stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc)); - -#if 0 - /* Can we get rid of these?? Consequently, getting rid - * of the tc_stats structure. - */ - tc_stats_array[up]->in_overflow_discards = 0; - tc_stats_array[up]->out_overflow_discards = 0; -#endif } return IXGBE_SUCCESS; From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 180946A9120; Tue, 7 Sep 2021 04:46:14 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xln3cj2z3k5g; Tue, 7 Sep 2021 04:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6C5344A2; Tue, 7 Sep 2021 04:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kBIe095566; Tue, 7 Sep 2021 04:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kBLM095565; Tue, 7 Sep 2021 04:46:11 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:11 GMT Message-Id: <202109070446.1874kBLM095565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9e65ae746da2 - main - ixgbe: support DCB registers dump MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e65ae746da23e1affdf66adb8944656a9da003c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:14 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9e65ae746da23e1affdf66adb8944656a9da003c commit 9e65ae746da23e1affdf66adb8944656a9da003c Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:18 +0000 ixgbe: support DCB registers dump Add support for DCB registers dump. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (36a036bc6fdd0da74576a39ab74e50954598ba82) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_type.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index a538af5d3569..48751e7386bb 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -863,6 +863,10 @@ struct ixgbe_dmac_config { #define IXGBE_RTTDQSEL 0x04904 #define IXGBE_RTTDT1C 0x04908 #define IXGBE_RTTDT1S 0x0490C +#define IXGBE_RTTQCNCR 0x08B00 +#define IXGBE_RTTQCNTG 0x04A90 +#define IXGBE_RTTBCNRD 0x0498C +#define IXGBE_RTTQCNRR 0x0498C #define IXGBE_RTTDTECC 0x04990 #define IXGBE_RTTDTECC_NO_BCN 0x00000100 @@ -873,6 +877,7 @@ struct ixgbe_dmac_config { #define IXGBE_RTTBCNRC_RF_INT_MASK \ (IXGBE_RTTBCNRC_RF_DEC_MASK << IXGBE_RTTBCNRC_RF_INT_SHIFT) #define IXGBE_RTTBCNRM 0x04980 +#define IXGBE_RTTQCNRM 0x04980 /* BCN (for DCB) Registers */ #define IXGBE_RTTBCNRS 0x04988 From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 427526A8E7A; Tue, 7 Sep 2021 04:46:16 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlq4SQkz3k1V; Tue, 7 Sep 2021 04:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 063B53BF8; Tue, 7 Sep 2021 04:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kCp9095590; Tue, 7 Sep 2021 04:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kCEU095589; Tue, 7 Sep 2021 04:46:12 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:12 GMT Message-Id: <202109070446.1874kCEU095589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 4cdc5e12a849 - main - ixgbe: remove whitespace in function comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cdc5e12a849871e4e8062a62a31f28545901d84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:16 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4cdc5e12a849871e4e8062a62a31f28545901d84 commit 4cdc5e12a849871e4e8062a62a31f28545901d84 Author: Kevin Bowling AuthorDate: 2021-09-07 03:26:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:18 +0000 ixgbe: remove whitespace in function comments Remove unnecessary extra whitespace on all function comments, replacing ' * ' with ' * '. This was done automatically via sed using the following transformation: sed 's/^ \* / * /' Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40023f73c76579e58a859dab87b4c30278eb2e48) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82598.c | 238 +++++----- sys/dev/ixgbe/ixgbe_82599.c | 384 ++++++++-------- sys/dev/ixgbe/ixgbe_api.c | 890 ++++++++++++++++++------------------ sys/dev/ixgbe/ixgbe_common.c | 1030 +++++++++++++++++++++--------------------- sys/dev/ixgbe/ixgbe_dcb.c | 6 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 194 ++++---- sys/dev/ixgbe/ixgbe_phy.c | 394 ++++++++-------- sys/dev/ixgbe/ixgbe_vf.c | 166 +++---- sys/dev/ixgbe/ixgbe_x540.c | 188 ++++---- sys/dev/ixgbe/ixgbe_x550.c | 480 ++++++++++---------- 11 files changed, 1986 insertions(+), 1986 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index c1d657afb6f5..1bfdcae6da55 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -69,14 +69,14 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data); /** - * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout - * @hw: pointer to the HW structure + * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout + * @hw: pointer to the HW structure * - * The defaults for 82598 should be in the range of 50us to 50ms, - * however the hardware default for these parts is 500us to 1ms which is less - * than the 10ms recommended by the pci-e spec. To address this we need to - * increase the value to either 10ms to 250ms for capability version 1 config, - * or 16ms to 55ms for version 2. + * The defaults for 82598 should be in the range of 50us to 50ms, + * however the hardware default for these parts is 500us to 1ms which is less + * than the 10ms recommended by the pci-e spec. To address this we need to + * increase the value to either 10ms to 250ms for capability version 1 config, + * or 16ms to 55ms for version 2. **/ void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw) { @@ -111,11 +111,11 @@ out: } /** - * ixgbe_init_ops_82598 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82598 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82598. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82598. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) { @@ -181,12 +181,12 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82598 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82598 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) @@ -245,11 +245,11 @@ out: } /** - * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx - * @hw: pointer to hardware structure + * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx + * @hw: pointer to hardware structure * - * Starts the hardware using the generic start_hw function. - * Disables relaxed ordering Then set pcie completion timeout + * Starts the hardware using the generic start_hw function. + * Disables relaxed ordering Then set pcie completion timeout * **/ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) @@ -287,12 +287,12 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82598 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: boolean auto-negotiation value + * ixgbe_get_link_capabilities_82598 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: boolean auto-negotiation value * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -348,10 +348,10 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, } /** - * ixgbe_get_media_type_82598 - Determines media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82598 - Determines media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw) { @@ -401,10 +401,10 @@ out: } /** - * ixgbe_fc_enable_82598 - Enable flow control - * @hw: pointer to hardware structure + * ixgbe_fc_enable_82598 - Enable flow control + * @hw: pointer to hardware structure * - * Enable flow control according to the current settings. + * Enable flow control according to the current settings. **/ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) { @@ -548,12 +548,12 @@ out: } /** - * ixgbe_start_mac_link_82598 - Configures MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82598 - Configures MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -597,11 +597,11 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_validate_link_ready - Function looks for phy link - * @hw: pointer to hardware structure + * ixgbe_validate_link_ready - Function looks for phy link + * @hw: pointer to hardware structure * - * Function indicates success when phy link is available. If phy is not ready - * within 5 seconds of MAC indicating link, the function returns error. + * Function indicates success when phy link is available. If phy is not ready + * within 5 seconds of MAC indicating link, the function returns error. **/ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) { @@ -632,13 +632,13 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) } /** - * ixgbe_check_mac_link_82598 - Get link/speed status - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @link_up: true is link is up, false otherwise - * @link_up_wait_to_complete: bool used to wait for link up or not + * ixgbe_check_mac_link_82598 - Get link/speed status + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @link_up: true is link is up, false otherwise + * @link_up_wait_to_complete: bool used to wait for link up or not * - * Reads the links register to determine if link is up and the current speed + * Reads the links register to determine if link is up and the current speed **/ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, bool *link_up, @@ -722,12 +722,12 @@ out: } /** - * ixgbe_setup_mac_link_82598 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82598 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -776,12 +776,12 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, /** - * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Sets the link speed in the AUTOC register in the MAC and restarts link. + * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -801,12 +801,12 @@ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82598 - Performs hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82598 - Performs hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks and - * clears all interrupts, performing a PHY reset, and performing a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks and + * clears all interrupts, performing a PHY reset, and performing a link (MAC) + * reset. **/ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) { @@ -939,10 +939,10 @@ reset_hw_out: } /** - * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq set index + * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq set index **/ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -965,10 +965,10 @@ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq clear index (not used in 82598, but elsewhere) + * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq clear index (not used in 82598, but elsewhere) **/ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -993,14 +993,14 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_set_vfta_82598 - Set VLAN filter table - * @hw: pointer to hardware structure - * @vlan: VLAN id to write to VLAN filter - * @vind: VMDq output index that maps queue to VLAN id in VFTA - * @vlan_on: boolean flag to turn on/off VLAN in VFTA - * @vlvf_bypass: boolean flag - unused + * ixgbe_set_vfta_82598 - Set VLAN filter table + * @hw: pointer to hardware structure + * @vlan: VLAN id to write to VLAN filter + * @vind: VMDq output index that maps queue to VLAN id in VFTA + * @vlan_on: boolean flag to turn on/off VLAN in VFTA + * @vlvf_bypass: boolean flag - unused * - * Turn on/off specified VLAN in the VLAN filter table. + * Turn on/off specified VLAN in the VLAN filter table. **/ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool vlvf_bypass) @@ -1046,10 +1046,10 @@ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, } /** - * ixgbe_clear_vfta_82598 - Clear VLAN filter table - * @hw: pointer to hardware structure + * ixgbe_clear_vfta_82598 - Clear VLAN filter table + * @hw: pointer to hardware structure * - * Clears the VLAN filer table, and the VMDq index associated with the filter + * Clears the VLAN filer table, and the VMDq index associated with the filter **/ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) { @@ -1070,12 +1070,12 @@ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) } /** - * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Atlas analog register specified. + * Performs read operation to Atlas analog register specified. **/ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -1094,12 +1094,12 @@ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Atlas analog register specified. + * Performs write operation to Atlas analog register specified. **/ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -1116,13 +1116,13 @@ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) } /** - * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @dev_addr: address to read from - * @byte_offset: byte offset to read from dev_addr - * @eeprom_data: value read + * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @dev_addr: address to read from + * @byte_offset: byte offset to read from dev_addr + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, u8 byte_offset, u8 *eeprom_data) @@ -1190,12 +1190,12 @@ out: } /** - * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: EEPROM byte offset to read - * @eeprom_data: value read + * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: EEPROM byte offset to read + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data) @@ -1205,12 +1205,12 @@ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: byte offset at address 0xA2 - * @sff8472_data: value read + * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: byte offset at address 0xA2 + * @sff8472_data: value read * - * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C + * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C **/ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data) @@ -1220,10 +1220,10 @@ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type - * @hw: pointer to hardware structure + * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type + * @hw: pointer to hardware structure * - * Determines physical layer capabilities of the current configuration. + * Determines physical layer capabilities of the current configuration. **/ u64 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw) { @@ -1322,12 +1322,12 @@ out: } /** - * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple - * port devices. - * @hw: pointer to the HW structure + * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple + * port devices. + * @hw: pointer to the HW structure * - * Calls common function and corrects issue with some single port devices - * that enable LAN1 but not LAN0. + * Calls common function and corrects issue with some single port devices + * that enable LAN1 but not LAN0. **/ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) { @@ -1356,8 +1356,8 @@ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) } /** - * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering - * @hw: pointer to hardware structure + * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering + * @hw: pointer to hardware structure * **/ void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw) @@ -1426,11 +1426,11 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, } /** - * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit - * @hw: pointer to hardware structure - * @regval: register value to write to RXCTRL + * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit + * @hw: pointer to hardware structure + * @regval: register value to write to RXCTRL * - * Enables the Rx DMA unit + * Enables the Rx DMA unit **/ s32 ixgbe_enable_rx_dma_82598(struct ixgbe_hw *hw, u32 regval) { diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index f692c19dc979..0222acd2f0d5 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -105,12 +105,12 @@ void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82599 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82599 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) @@ -239,14 +239,14 @@ setup_sfp_err: } /** - * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read - * @hw: pointer to hardware structure - * @locked: Return the if we locked for this read. - * @reg_val: Value we read from AUTOC + * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read + * @hw: pointer to hardware structure + * @locked: Return the if we locked for this read. + * @reg_val: Value we read from AUTOC * - * For this part (82599) we need to wrap read-modify-writes with a possible - * FW/SW lock. It is assumed this lock will be freed with the next - * prot_autoc_write_82599(). + * For this part (82599) we need to wrap read-modify-writes with a possible + * FW/SW lock. It is assumed this lock will be freed with the next + * prot_autoc_write_82599(). */ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { @@ -272,7 +272,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) * @hw: pointer to hardware structure * @autoc: value to write to AUTOC * @locked: bool to indicate whether the SW/FW lock was already taken by - * previous proc_autoc_read_82599. + * previous proc_autoc_read_82599. * * This part (82599) may need to hold the SW/FW lock around all writes to * AUTOC. Likewise after a write we need to do a pipeline reset. @@ -312,11 +312,11 @@ out: } /** - * ixgbe_init_ops_82599 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82599 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82599. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82599. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) @@ -406,12 +406,12 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82599 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: true when autoneg or autotry is enabled + * ixgbe_get_link_capabilities_82599 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: true when autoneg or autotry is enabled * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -518,10 +518,10 @@ out: } /** - * ixgbe_get_media_type_82599 - Get media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82599 - Get media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) { @@ -579,10 +579,10 @@ out: } /** - * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 - * @hw: pointer to hardware structure + * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 + * @hw: pointer to hardware structure * - * Disables link during D3 power down sequence. + * Disables link during D3 power down sequence. * **/ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) @@ -602,12 +602,12 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) } /** - * ixgbe_start_mac_link_82599 - Setup MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82599 - Setup MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -670,12 +670,12 @@ out: } /** - * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser - * @hw: pointer to hardware structure + * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively shutting down the Tx - * laser on the PHY, effectively halting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively shutting down the Tx + * laser on the PHY, effectively halting physical link. **/ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -693,12 +693,12 @@ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser - * @hw: pointer to hardware structure + * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively turning on the Tx - * laser on the PHY, effectively starting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively turning on the Tx + * laser on the PHY, effectively starting physical link. **/ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -712,16 +712,16 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser - * @hw: pointer to hardware structure + * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser + * @hw: pointer to hardware structure * - * When the driver changes the link speeds that it can support, - * it sets autotry_restart to true to indicate that we need to - * initiate a new autotry session with the link partner. To do - * so, we set the speed then disable and re-enable the Tx laser, to - * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with true clause 37 autoneg, which also - * involves a loss of signal. + * When the driver changes the link speeds that it can support, + * it sets autotry_restart to true to indicate that we need to + * initiate a new autotry session with the link partner. To do + * so, we set the speed then disable and re-enable the Tx laser, to + * alert the link partner that it also needs to restart autotry on its + * end. This is consistent with true clause 37 autoneg, which also + * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -739,11 +739,11 @@ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_set_hard_rate_select_speed - Set module link speed - * @hw: pointer to hardware structure - * @speed: link speed to set + * ixgbe_set_hard_rate_select_speed - Set module link speed + * @hw: pointer to hardware structure + * @speed: link speed to set * - * Set module link speed via RS0/RS1 rate select pins. + * Set module link speed via RS0/RS1 rate select pins. */ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed) @@ -768,12 +768,12 @@ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, } /** - * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Implements the Intel SmartSpeed algorithm. + * Implements the Intel SmartSpeed algorithm. **/ s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -880,12 +880,12 @@ out: } /** - * ixgbe_setup_mac_link_82599 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82599 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -998,12 +998,12 @@ out: } /** - * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Restarts link on PHY and MAC based on settings passed in. + * Restarts link on PHY and MAC based on settings passed in. **/ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -1023,12 +1023,12 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82599 - Perform hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82599 - Perform hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks - * and clears all interrupts, perform a PHY reset, and perform a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks + * and clears all interrupts, perform a PHY reset, and perform a link (MAC) + * reset. **/ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) { @@ -1224,8 +1224,8 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd) } /** - * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. - * @hw: pointer to hardware structure + * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. + * @hw: pointer to hardware structure **/ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) { @@ -1297,9 +1297,9 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) } /** - * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register + * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register **/ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) { @@ -1338,9 +1338,9 @@ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation **/ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) @@ -1364,11 +1364,11 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation - * @cloud_mode: true - cloud mode, false - other mode + * @cloud_mode: true - cloud mode, false - other mode **/ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, bool cloud_mode) @@ -1403,9 +1403,9 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, } /** - * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue - * @hw: pointer to hardware structure - * @dropqueue: Rx queue index used for the dropped packets + * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue + * @hw: pointer to hardware structure + * @dropqueue: Rx queue index used for the dropped packets **/ void ixgbe_set_fdir_drop_queue_82599(struct ixgbe_hw *hw, u8 dropqueue) { @@ -1461,15 +1461,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash - * @input: input bitstream to compute the hash on - * @common: compressed common input dword + * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash + * @input: input bitstream to compute the hash on + * @common: compressed common input dword * - * This function is almost identical to the function above but contains - * several optimizations such as unwinding all of the loops, letting the - * compiler work out all of the conditional ifs since the keys are static - * defines, and computing two keys at once since the hashed dword stream - * will be the same for both keys. + * This function is almost identical to the function above but contains + * several optimizations such as unwinding all of the loops, letting the + * compiler work out all of the conditional ifs since the keys are static + * defines, and computing two keys at once since the hashed dword stream + * will be the same for both keys. **/ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, union ixgbe_atr_hash_dword common) @@ -1528,11 +1528,11 @@ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, } /** - * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter - * @hw: pointer to hardware structure - * @input: unique input dword - * @common: compressed common input dword - * @queue: queue index to direct traffic to + * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter + * @hw: pointer to hardware structure + * @input: unique input dword + * @common: compressed common input dword + * @queue: queue index to direct traffic to * * Note that the tunnel bit in input must not be set when the hardware * tunneling support does not exist. @@ -1601,15 +1601,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash - * @input: input bitstream to compute the hash on - * @input_mask: mask for the input bitstream + * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash + * @input: input bitstream to compute the hash on + * @input_mask: mask for the input bitstream * - * This function serves two main purposes. First it applies the input_mask - * to the atr_input resulting in a cleaned up atr_input data stream. - * Secondly it computes the hash and stores it in the bkt_hash field at - * the end of the input byte stream. This way it will be available for - * future use without needing to recompute the hash. + * This function serves two main purposes. First it applies the input_mask + * to the atr_input resulting in a cleaned up atr_input data stream. + * Secondly it computes the hash and stores it in the bkt_hash field at + * the end of the input byte stream. This way it will be available for + * future use without needing to recompute the hash. **/ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, union ixgbe_atr_input *input_mask) @@ -1660,13 +1660,13 @@ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, } /** - * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks - * @input_mask: mask to be bit swapped + * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks + * @input_mask: mask to be bit swapped * - * The source and destination port masks for flow director are bit swapped - * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to - * generate a correctly swapped value we need to bit swap the mask and that - * is what is accomplished by this function. + * The source and destination port masks for flow director are bit swapped + * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to + * generate a correctly swapped value we need to bit swap the mask and that + * is what is accomplished by this function. **/ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { @@ -2000,16 +2000,16 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter - * @hw: pointer to hardware structure - * @input: input bitstream - * @input_mask: mask for the input bitstream - * @soft_id: software index for the filters - * @queue: queue index to direct traffic to - * @cloud_mode: unused + * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter + * @hw: pointer to hardware structure + * @input: input bitstream + * @input_mask: mask for the input bitstream + * @soft_id: software index for the filters + * @queue: queue index to direct traffic to + * @cloud_mode: unused * - * Note that the caller to this function must lock before calling, since the - * hardware writes must be protected from one another. + * Note that the caller to this function must lock before calling, since the + * hardware writes must be protected from one another. **/ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, union ixgbe_atr_input *input, @@ -2067,12 +2067,12 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Omer analog register specified. + * Performs read operation to Omer analog register specified. **/ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -2091,12 +2091,12 @@ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Omer analog register specified. + * Performs write operation to Omer analog register specified. **/ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -2113,12 +2113,12 @@ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) } *** 6478 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC7466A9294; Tue, 7 Sep 2021 04:46:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlm2T7Dz3kB1; Tue, 7 Sep 2021 04:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 964EC43BF; Tue, 7 Sep 2021 04:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kA3N095542; Tue, 7 Sep 2021 04:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kAEK095541; Tue, 7 Sep 2021 04:46:10 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:10 GMT Message-Id: <202109070446.1874kAEK095541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0a4f0befab9d - main - ixgbe: update X550 SFP identification MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a4f0befab9d3a048232b00bea77bf3da20cfdd0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:12 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a4f0befab9d3a048232b00bea77bf3da20cfdd0 commit 0a4f0befab9d3a048232b00bea77bf3da20cfdd0 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:12 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:13 +0000 ixgbe: update X550 SFP identification Use ixgbe_identify_sfp_module_X550em to update SFP identification flow. ixgbe_identify_sfp_module_X550em includes specific checks for X550 about supported SFP modules. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (175bedb0cc8f801be3050fa35b8d8d0971cea7cc) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index df19c4c65201..1c79dda6c235 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -351,7 +351,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_A_SFP: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); case IXGBE_DEV_ID_X550EM_X_SFP: /* set up for CS4227 usage */ ixgbe_setup_mux_ctl(hw); @@ -359,7 +359,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* Fallthrough */ case IXGBE_DEV_ID_X550EM_A_SFP_N: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); break; case IXGBE_DEV_ID_X550EM_X_KX4: hw->phy.type = ixgbe_phy_x550em_kx4; From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D03D96A9128; Tue, 7 Sep 2021 04:46:17 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlr7555z3k5y; Tue, 7 Sep 2021 04:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2977142FE; Tue, 7 Sep 2021 04:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kEGr095614; Tue, 7 Sep 2021 04:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kEx5095613; Tue, 7 Sep 2021 04:46:14 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:14 GMT Message-Id: <202109070446.1874kEx5095613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: dc11ba4eb3fe - main - ixgbe: move increments after evaluations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc11ba4eb3fe5cce615f361de83e85e07005ca24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:18 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=dc11ba4eb3fe5cce615f361de83e85e07005ca24 commit dc11ba4eb3fe5cce615f361de83e85e07005ca24 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:18 +0000 ixgbe: move increments after evaluations The retry variable was being incremented before it was evaluated by the subsequent conditional against the maximum retries to figure out which message to print. So we'll move the increment op to the end. Signed-off-by: Jeb Cramer Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (390445ec30b4c52a3d2887c3d2a202d9cf37ea8e) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_phy.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 236d6685f8a9..c1cbc282c790 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -169,12 +169,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read combined error - Retrying.\n"); else DEBUGOUT("I2C byte read combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -234,12 +234,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write combined error - Retrying.\n"); else DEBUGOUT("I2C byte write combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -2066,13 +2066,12 @@ fail: hw->mac.ops.release_swfw_sync(hw, swfw_mask); msec_delay(100); } - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read error - Retrying.\n"); else DEBUGOUT("I2C byte read error.\n"); - - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return status; } @@ -2170,12 +2169,12 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, fail: ixgbe_i2c_bus_clear(hw); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write error - Retrying.\n"); else DEBUGOUT("I2C byte write error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAC456A9411; Tue, 7 Sep 2021 04:46:19 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlt4x7Hz3kHD; Tue, 7 Sep 2021 04:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 494C13BF9; Tue, 7 Sep 2021 04:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kF2o095638; Tue, 7 Sep 2021 04:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kFjG095637; Tue, 7 Sep 2021 04:46:15 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:15 GMT Message-Id: <202109070446.1874kFjG095637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ff8db817abbd - main - ixgbe: add register definitions for NVM update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff8db817abbd348f0a7518ce32f0e52c6ab8e06e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:20 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ff8db817abbd348f0a7518ce32f0e52c6ab8e06e commit ff8db817abbd348f0a7518ce32f0e52c6ab8e06e Author: Guinan Sun AuthorDate: 2020-07-09 08:00:32 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:18 +0000 ixgbe: add register definitions for NVM update Added additional register for X550 and above device family. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4a6847d78814b1c3df896efe31562643d419317d) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 48751e7386bb..1c04f09df77c 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1095,8 +1095,10 @@ struct ixgbe_dmac_config { #define IXGBE_HSMC0R 0x15F04 #define IXGBE_HSMC1R 0x15F08 #define IXGBE_SWSR 0x15F10 +#define IXGBE_FWRESETCNT 0x15F40 #define IXGBE_HFDR 0x15FE8 #define IXGBE_FLEX_MNG 0x15800 /* 0x15800 - 0x15EFC */ +#define IXGBE_FLEX_MNG_PTR(_i) (IXGBE_FLEX_MNG + ((_i) * 4)) #define IXGBE_HICR_EN 0x01 /* Enable bit - RO */ /* Driver sets this bit when done to put command in RAM */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D04A36A91C4; Tue, 7 Sep 2021 04:46:19 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlv0pwKz3k66; Tue, 7 Sep 2021 04:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A46C43C0; Tue, 7 Sep 2021 04:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kGSe095668; Tue, 7 Sep 2021 04:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kGJD095667; Tue, 7 Sep 2021 04:46:16 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:16 GMT Message-Id: <202109070446.1874kGJD095667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 80a39a2bda82 - main - ixgbe: create function to restart autoneg MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80a39a2bda8208c716f614f792c8d9a3628d6c26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:20 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=80a39a2bda8208c716f614f792c8d9a3628d6c26 commit 80a39a2bda8208c716f614f792c8d9a3628d6c26 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:36 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:19 +0000 ixgbe: create function to restart autoneg This patch is for restarting auto negotiation on PHY. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (664ea2614eafbec8eda5c86764ff047475a1e5c6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_phy.c | 48 ++++++++++++++++++++++------------------------- sys/dev/ixgbe/ixgbe_phy.h | 1 + 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index c1cbc282c790..e9e1dd2d8c1c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -573,6 +573,26 @@ out: return status; } +/** + * ixgbe_restart_auto_neg - Restart auto negotiation on the PHY + * @hw: pointer to hardware structure + **/ +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw) +{ + u16 autoneg_reg; + + /* Check if PHY reset is blocked by MNG FW */ + if (ixgbe_check_reset_blocked(hw)) + return; + + /* Restart PHY auto-negotiation. */ + hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); + autoneg_reg |= IXGBE_MII_RESTART; + hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); +} + /** * ixgbe_read_phy_mdi - Reads a value from a specified PHY register without * the SWFW lock @@ -857,19 +877,7 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw) IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } @@ -1093,19 +1101,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw) autoneg_reg); } - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index 9fd3f6d2163e..7f51ccc1dd2c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -163,6 +163,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw); s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw); +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw); s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u16 *phy_data); s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AED4C6A91D0; Tue, 7 Sep 2021 04:46:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlw2gJ5z3kBY; Tue, 7 Sep 2021 04:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 930704431; Tue, 7 Sep 2021 04:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kHWA095692; Tue, 7 Sep 2021 04:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kHD0095691; Tue, 7 Sep 2021 04:46:17 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:17 GMT Message-Id: <202109070446.1874kHD0095691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 3a89005394bc - main - ixgbe: remove unnecessary return value check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a89005394bc5d82ce9b6baa9e7f8dee362354ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:21 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3a89005394bc5d82ce9b6baa9e7f8dee362354ae commit 3a89005394bc5d82ce9b6baa9e7f8dee362354ae Author: Guinan Sun AuthorDate: 2020-07-09 08:00:38 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:19 +0000 ixgbe: remove unnecessary return value check Remove unnecessary return value check. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4b0ee6529b7897c2a08dd56669f07ac1f46a8474) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82599.c | 4 +--- sys/dev/ixgbe/ixgbe_common.c | 4 +--- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 25 +++++++------------------ sys/dev/ixgbe/ixgbe_x540.c | 2 +- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 0222acd2f0d5..9eb3904a30f9 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -2130,9 +2130,7 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); - if (ret_val != IXGBE_SUCCESS) - goto out; + ixgbe_start_hw_gen2(hw); /* We need to run link autotry after the driver loads */ hw->mac.autotry_restart = true; diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 97a392829538..d049b7c6d9cd 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -457,7 +457,7 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) * 82599 * X540 **/ -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw) { u32 i; u32 regval; @@ -482,8 +482,6 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index b072770acafa..051af213b628 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -56,7 +56,7 @@ u16 ixgbe_get_pcie_msix_count_generic(struct ixgbe_hw *hw); s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw); s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw); s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw); -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw); +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw); s32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw); s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num); s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index e9e1dd2d8c1c..5a2f49e9ebac 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -39,10 +39,10 @@ static void ixgbe_i2c_start(struct ixgbe_hw *hw); static void ixgbe_i2c_stop(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); static s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data); static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data); static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); static void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); @@ -77,11 +77,7 @@ static s32 ixgbe_out_i2c_byte_ack(struct ixgbe_hw *hw, u8 byte) */ static s32 ixgbe_in_i2c_byte_ack(struct ixgbe_hw *hw, u8 *byte) { - s32 status; - - status = ixgbe_clock_in_i2c_byte(hw, byte); - if (status) - return status; + ixgbe_clock_in_i2c_byte(hw, byte); /* ACK */ return ixgbe_clock_out_i2c_bit(hw, false); } @@ -154,8 +150,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg, if (ixgbe_in_i2c_byte_ack(hw, &low_bits)) goto fail; /* Get csum */ - if (ixgbe_clock_in_i2c_byte(hw, &csum_byte)) - goto fail; + ixgbe_clock_in_i2c_byte(hw, &csum_byte); /* NACK */ if (ixgbe_clock_out_i2c_bit(hw, false)) goto fail; @@ -2043,9 +2038,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, if (status != IXGBE_SUCCESS) goto fail; - status = ixgbe_clock_in_i2c_byte(hw, data); - if (status != IXGBE_SUCCESS) - goto fail; + ixgbe_clock_in_i2c_byte(hw, data); status = ixgbe_clock_out_i2c_bit(hw, nack); if (status != IXGBE_SUCCESS) @@ -2290,7 +2283,7 @@ static void ixgbe_i2c_stop(struct ixgbe_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -2302,8 +2295,6 @@ static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) ixgbe_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return IXGBE_SUCCESS; } /** @@ -2399,7 +2390,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) { u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL_BY_MAC(hw)); u32 data_oe_bit = IXGBE_I2C_DATA_OE_N_EN_BY_MAC(hw); @@ -2424,8 +2415,6 @@ static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(IXGBE_I2C_T_LOW); - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index 4ba256ede44a..d03b34ee8135 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -323,7 +323,7 @@ s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); + ixgbe_start_hw_gen2(hw); out: return ret_val; From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65AB06A9330; Tue, 7 Sep 2021 04:46:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlx2df7z3k8L; Tue, 7 Sep 2021 04:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2F3544A3; Tue, 7 Sep 2021 04:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kIcF095716; Tue, 7 Sep 2021 04:46:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kIJd095715; Tue, 7 Sep 2021 04:46:18 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:18 GMT Message-Id: <202109070446.1874kIJd095715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 46981e903cf3 - main - ixgbe: cleanup spelling mistakes in comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:22 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07 commit 46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:19 +0000 ixgbe: cleanup spelling mistakes in comments Several functions in the driver code have a weird function comment formatting which uses two spaces instead of only one space for the main function body. This formatting will be mechanically fixed by sed in a future patch, but doing so leads to some spelling warnings on that patch. Cleanup the spelling mistakes that will be detected first. This way, it is easier to verify the mechanical transformation done by sed in the following patch. Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc75eee32037c1379e77e57031c1c353badd2272) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_mbx.c | 4 ++-- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 3650efc9d2bf..f72bbf34256a 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -69,11 +69,11 @@ out: } /** - * ixgbe_poll_for_ack - Wait for message acknowledgement + * ixgbe_poll_for_ack - Wait for message acknowledgment * @hw: pointer to the HW structure * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully received a message acknowledgement + * returns SUCCESS if it successfully received a message acknowledgment **/ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 895d9e06e1d0..82800b4a3d87 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -171,7 +171,7 @@ s32 ixgbe_init_hw_vf(struct ixgbe_hw *hw) * ixgbe_reset_hw_vf - Performs hardware reset * @hw: pointer to hardware structure * - * Resets the hardware by reseting the transmit and receive units, masks and + * Resets the hardware by resetting the transmit and receive units, masks and * clears all interrupts. **/ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 8a42295ab10e..7fc556662b00 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1066,7 +1066,7 @@ void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable, } /** - * ixgbe_set_ethertype_anti_spoofing_X550 - Enable/Disable Ethertype anti-spoofing + * ixgbe_set_ethertype_anti_spoofing_X550 - Configure Ethertype anti-spoofing * @hw: pointer to hardware structure * @enable: enable or disable switch for Ethertype anti-spoofing * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing From owner-dev-commits-src-main@freebsd.org Tue Sep 7 04:46:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65EAC6A913B; Tue, 7 Sep 2021 04:46:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3Xlx32w9z3k44; Tue, 7 Sep 2021 04:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C92C842FF; Tue, 7 Sep 2021 04:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1874kJL7095740; Tue, 7 Sep 2021 04:46:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1874kJ87095739; Tue, 7 Sep 2021 04:46:19 GMT (envelope-from git) Date: Tue, 7 Sep 2021 04:46:19 GMT Message-Id: <202109070446.1874kJ87095739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5fd1f4be8d81 - main - ixgbe: increase the timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fd1f4be8d81a0019c632103121d68e2f20bc238 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 04:46:23 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5fd1f4be8d81a0019c632103121d68e2f20bc238 commit 5fd1f4be8d81a0019c632103121d68e2f20bc238 Author: Qiming Yang AuthorDate: 2018-01-10 16:04:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-07 04:17:19 +0000 ixgbe: increase the timeout Increase SECRX_RDY polling frequency and semaphore timeout which fixes the FWSW.PT check in ixgbe_mng_present(). Signed-off-by: Qiming Yang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (6175260d12cc22852cecf2fb7ecd95cdb07611b5) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index d049b7c6d9cd..50e18bcba997 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3356,7 +3356,7 @@ void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u32 mask) **/ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) { -#define IXGBE_MAX_SECRX_POLL 40 +#define IXGBE_MAX_SECRX_POLL 4000 int i; int secrxreg; @@ -3373,7 +3373,7 @@ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) break; else /* Use interrupt-safe sleep just in case */ - usec_delay(1000); + usec_delay(10); } /* For informational purposes only */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:51:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F00F6AF798; Tue, 7 Sep 2021 09:51:55 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXW2z08z3HBG; Tue, 7 Sep 2021 09:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 459151054D; Tue, 7 Sep 2021 09:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879ptM3010501; Tue, 7 Sep 2021 09:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879ptAG010500; Tue, 7 Sep 2021 09:51:55 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:51:55 GMT Message-Id: <202109070951.1879ptAG010500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d22072a7d5e6 - main - pkgbase: Create a FreeBSD-ggate package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d22072a7d5e671ca0883b93165e374d5f396e0f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:51:55 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d22072a7d5e671ca0883b93165e374d5f396e0f9 commit d22072a7d5e671ca0883b93165e374d5f396e0f9 Author: Emmanuel Vadot AuthorDate: 2021-09-01 15:16:07 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:17:28 +0000 pkgbase: Create a FreeBSD-ggate package Move ggate* to it. Differential Revision: https://reviews.freebsd.org/D31790 --- release/packages/Makefile.package | 2 ++ sbin/ggate/ggatec/Makefile | 1 + sbin/ggate/ggated/Makefile | 1 + sbin/ggate/ggatel/Makefile | 1 + 4 files changed, 5 insertions(+) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index eef58af542e4..254a0fa5afb8 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -40,6 +40,8 @@ ee_COMMENT= Easy Editor Utilities ee_DESC= Easy Editor Utilities gdb_COMMENT= GDB Utilities gdb_DESC= GDB Utilities +ggate_COMMENT= GEOM Gate Utilities +ggate_DESC= GEOM Gate Utilities groff_COMMENT= Groff Utilities groff_DESC= Groff Utilities hast_COMMENT= Highly Available Storage daemon diff --git a/sbin/ggate/ggatec/Makefile b/sbin/ggate/ggatec/Makefile index 0f4eb70e67aa..84db486472b1 100644 --- a/sbin/ggate/ggatec/Makefile +++ b/sbin/ggate/ggatec/Makefile @@ -5,6 +5,7 @@ PROG= ggatec MAN= ggatec.8 SRCS= ggatec.c ggate.c +PACKAGE= ggate CFLAGS+= -DMAX_SEND_SIZE=32768 CFLAGS+= -DLIBGEOM diff --git a/sbin/ggate/ggated/Makefile b/sbin/ggate/ggated/Makefile index c5a61310c4b5..1c53cf2c2efb 100644 --- a/sbin/ggate/ggated/Makefile +++ b/sbin/ggate/ggated/Makefile @@ -5,6 +5,7 @@ PROG= ggated MAN= ggated.8 SRCS= ggated.c ggate.c +PACKAGE= ggate LIBADD= pthread util diff --git a/sbin/ggate/ggatel/Makefile b/sbin/ggate/ggatel/Makefile index af58c73ce1b6..13fb7c2fcf43 100644 --- a/sbin/ggate/ggatel/Makefile +++ b/sbin/ggate/ggatel/Makefile @@ -5,6 +5,7 @@ PROG= ggatel MAN= ggatel.8 SRCS= ggatel.c ggate.c +PACKAGE= ggate CFLAGS+= -DLIBGEOM CFLAGS+= -I${.CURDIR:H}/shared From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:51:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A02D16AF2BC; Tue, 7 Sep 2021 09:51:56 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXX3yYSz3HVG; Tue, 7 Sep 2021 09:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68BCF104DD; Tue, 7 Sep 2021 09:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879puxc010527; Tue, 7 Sep 2021 09:51:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879puY7010524; Tue, 7 Sep 2021 09:51:56 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:51:56 GMT Message-Id: <202109070951.1879puY7010524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: c7fd29f0f29a - main - pkgbase: Create a FreeBSD-telnet package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7fd29f0f29ae3eb9d86cc019f6c1bab35634548 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:51:56 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c7fd29f0f29ae3eb9d86cc019f6c1bab35634548 commit c7fd29f0f29ae3eb9d86cc019f6c1bab35634548 Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:02:00 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:18:11 +0000 pkgbase: Create a FreeBSD-telnet package both telnet and telnetd aren't that useful nowadays but some might want them. Create a FreeBSD-telnet package so users have a choice to have them or not. Differential Revision: https://reviews.freebsd.org/D31791 Reviewed by: emaste --- lib/libpam/pam.d/Makefile | 1 + libexec/telnetd/Makefile | 2 ++ release/packages/Makefile.package | 2 ++ usr.bin/telnet/Makefile | 2 ++ 4 files changed, 7 insertions(+) diff --git a/lib/libpam/pam.d/Makefile b/lib/libpam/pam.d/Makefile index 43e43780ee33..1a9caeef940f 100644 --- a/lib/libpam/pam.d/Makefile +++ b/lib/libpam/pam.d/Makefile @@ -34,6 +34,7 @@ afterinstallconfig: .if ${MK_TELNET} != "no" CONFGROUPS+= TELNET TELNET+= telnetd +TELNETPACKAGE= telnet .endif .include diff --git a/libexec/telnetd/Makefile b/libexec/telnetd/Makefile index 24119797ec8b..15dc0af01f0b 100644 --- a/libexec/telnetd/Makefile +++ b/libexec/telnetd/Makefile @@ -5,6 +5,8 @@ .include +PACKAGE= telnet + TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/telnetd diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index 254a0fa5afb8..f38644c84d32 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -88,6 +88,8 @@ svn_COMMENT= Subversion Version Control System svn_DESC= Subversion Version Control System syscons_COMMENT= Syscons Console syscons_DESC= Syscons Console +telnet_COMMENT= Telnet and telnetd +telnet_DESC= Telnet and telnetd tests_COMMENT= Test Suite tests_DESC= Test Suite unbound_COMMENT= Unbound DNS Resolver diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile index cb5d886e9d36..33c8b9cba193 100644 --- a/usr.bin/telnet/Makefile +++ b/usr.bin/telnet/Makefile @@ -2,6 +2,8 @@ .include +PACKAGE= telnet + TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/telnet From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:51:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 166B26AF89A; Tue, 7 Sep 2021 09:51:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXY751pz3HBN; Tue, 7 Sep 2021 09:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D73D1054F; Tue, 7 Sep 2021 09:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879pvE5010551; Tue, 7 Sep 2021 09:51:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879pvVR010550; Tue, 7 Sep 2021 09:51:57 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:51:57 GMT Message-Id: <202109070951.1879pvVR010550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 0818f499bc28 - main - pkgbase: Move spppcontrol to FreeBSD-ppp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0818f499bc28835c7db6df80d9aa5cc3dc99b2d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:51:58 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=0818f499bc28835c7db6df80d9aa5cc3dc99b2d9 commit 0818f499bc28835c7db6df80d9aa5cc3dc99b2d9 Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:03:38 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:18:53 +0000 pkgbase: Move spppcontrol to FreeBSD-ppp This program belong with the other ppp-related programs. Differential Revision: https://reviews.freebsd.org/D31792 Reviewed by: emaste --- sbin/spppcontrol/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/spppcontrol/Makefile b/sbin/spppcontrol/Makefile index 3287fcf24126..04173201cfde 100644 --- a/sbin/spppcontrol/Makefile +++ b/sbin/spppcontrol/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= ppp + PROG= spppcontrol MAN= spppcontrol.8 WARNS?= 2 From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:51:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2410E6AFA12; Tue, 7 Sep 2021 09:51:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXZ6FLTz3HBT; Tue, 7 Sep 2021 09:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B02317EDA; Tue, 7 Sep 2021 09:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879pwR6010582; Tue, 7 Sep 2021 09:51:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879pwrS010581; Tue, 7 Sep 2021 09:51:58 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:51:58 GMT Message-Id: <202109070951.1879pwrS010581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: b8876cac2d23 - main - pkgbase: Create a cxgbe-tools package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8876cac2d230098b902e7f927ef170312a06c03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:51:59 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b8876cac2d230098b902e7f927ef170312a06c03 commit b8876cac2d230098b902e7f927ef170312a06c03 Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:08:49 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:19:37 +0000 pkgbase: Create a cxgbe-tools package cxgbetool is only useful for users who have a Chelsio card. Create a package for it so users that don't have this card can avoid having this program. Differential Revision: https://reviews.freebsd.org/D31793 --- release/packages/Makefile.package | 2 ++ usr.sbin/cxgbetool/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index f38644c84d32..da89352eaa78 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -30,6 +30,8 @@ clang_COMMENT= Clang Utilities clang_DESC= Clang Utilities clibs_COMMENT= Core C Libraries clibs_DESC= Core C Libraries +cxgbe-tools_COMMENT= Chelsio cxbge Utilities +cxgbe-tools_DESC= Chelsio cxbge Utilities dma_COMMENT= DMA Mail Agent Utilities dma_DESC= DMA Mail Agent Utilities docs_COMMENT= Documentation diff --git a/usr.sbin/cxgbetool/Makefile b/usr.sbin/cxgbetool/Makefile index ee31cdda5858..ed0f90d1ef33 100644 --- a/usr.sbin/cxgbetool/Makefile +++ b/usr.sbin/cxgbetool/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= cxgbe-tools PROG= cxgbetool MAN= cxgbetool.8 SRCS= cxgbetool.c From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 914BC6AF84A; Tue, 7 Sep 2021 09:52:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXd1lW5z3Hgq; Tue, 7 Sep 2021 09:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5C23104E1; Tue, 7 Sep 2021 09:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q09W010632; Tue, 7 Sep 2021 09:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q0ev010631; Tue, 7 Sep 2021 09:52:00 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:00 GMT Message-Id: <202109070952.1879q0ev010631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a3266ba2697a - main - pkgbase: Create a FreeBSD-dwatch package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3266ba2697a383d2ede56803320d941866c7e76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:02 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a3266ba2697a383d2ede56803320d941866c7e76 commit a3266ba2697a383d2ede56803320d941866c7e76 Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:38:40 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:20:40 +0000 pkgbase: Create a FreeBSD-dwatch package While dwatch is useful some users might not want it by default. Create a package for it. Differential Revision: https://reviews.freebsd.org/D31796 --- cddl/usr.sbin/dwatch/Makefile | 2 ++ cddl/usr.sbin/dwatch/examples/Makefile | 1 + cddl/usr.sbin/dwatch/libexec/Makefile | 1 + release/packages/Makefile.package | 2 ++ 4 files changed, 6 insertions(+) diff --git a/cddl/usr.sbin/dwatch/Makefile b/cddl/usr.sbin/dwatch/Makefile index 647f07388890..aa2873ec4681 100644 --- a/cddl/usr.sbin/dwatch/Makefile +++ b/cddl/usr.sbin/dwatch/Makefile @@ -2,6 +2,8 @@ .include +PACKAGE= dwatch + SUBDIR= libexec .if ${MK_EXAMPLES} != "no" diff --git a/cddl/usr.sbin/dwatch/examples/Makefile b/cddl/usr.sbin/dwatch/examples/Makefile index 33364044942f..344d67d27ec8 100644 --- a/cddl/usr.sbin/dwatch/examples/Makefile +++ b/cddl/usr.sbin/dwatch/examples/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= dwatch FILESDIR= ${SHAREDIR}/examples/dwatch FILES= profile_template diff --git a/cddl/usr.sbin/dwatch/libexec/Makefile b/cddl/usr.sbin/dwatch/libexec/Makefile index d84fc370519b..581556eeebd0 100644 --- a/cddl/usr.sbin/dwatch/libexec/Makefile +++ b/cddl/usr.sbin/dwatch/libexec/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= dwatch FILESDIR= ${LIBEXECDIR}/dwatch FILES= chmod \ errno \ diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index b5957f8d5b53..04c8ef0536f0 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -38,6 +38,8 @@ docs_COMMENT= Documentation docs_DESC= Documentation dtrace_COMMENT= Dtrace Utilities dtrace_DESC= Dtrace Utilities +dwatch_COMMENT= Dwatch Utilities +dwatch_DESC= Dwatch Utilities ee_COMMENT= Easy Editor Utilities ee_DESC= Easy Editor Utilities gdb_COMMENT= GDB Utilities From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 647D96AFA91; Tue, 7 Sep 2021 09:52:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXc0N2sz3HNF; Tue, 7 Sep 2021 09:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3ECD104DF; Tue, 7 Sep 2021 09:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879pxrE010608; Tue, 7 Sep 2021 09:51:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879pxlF010607; Tue, 7 Sep 2021 09:51:59 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:51:59 GMT Message-Id: <202109070951.1879pxlF010607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 80645e1ce557 - main - pkgbase: Create a mlx-tools package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80645e1ce5574ce4d63f0a1cad287949440384da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:00 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=80645e1ce5574ce4d63f0a1cad287949440384da commit 80645e1ce5574ce4d63f0a1cad287949440384da Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:12:09 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:20:16 +0000 pkgbase: Create a mlx-tools package mlx* are only useful for users who have a Mellanox card. Create a package for it so users that don't have this card can avoid having this program. Differential Revision: https://reviews.freebsd.org/D31795 --- release/packages/Makefile.package | 2 ++ usr.sbin/mlx5tool/Makefile | 2 ++ usr.sbin/mlxcontrol/Makefile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index da89352eaa78..b5957f8d5b53 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -63,6 +63,8 @@ kernel_COMMENT= FreeBSD Kernel kernel_DESC= FreeBSD Kernel manuals_COMMENT= Manual Pages manuals_DESC= Manual Pages +mlx-tools_COMMENT= Mellanox Utilities +mlx-tools_DESC= Mellanox Utilities nfs_COMMENT= NFS Utilities nfs_DESC= NFS Utilities openssl_COMMENT= OpenSSL Library and Utility diff --git a/usr.sbin/mlx5tool/Makefile b/usr.sbin/mlx5tool/Makefile index 43b725516d2a..c8d0277c541d 100644 --- a/usr.sbin/mlx5tool/Makefile +++ b/usr.sbin/mlx5tool/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= mlx-tools + PROG= mlx5tool MAN= mlx5tool.8 diff --git a/usr.sbin/mlxcontrol/Makefile b/usr.sbin/mlxcontrol/Makefile index 5a425fd003da..3f2755bda929 100644 --- a/usr.sbin/mlxcontrol/Makefile +++ b/usr.sbin/mlxcontrol/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= mlx-tools + PROG= mlxcontrol MAN= mlxcontrol.8 SRCS= command.c config.c interface.c util.c From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF1CF6AF6B1; Tue, 7 Sep 2021 09:52:02 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXf3Scfz3HKg; Tue, 7 Sep 2021 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20D1410724; Tue, 7 Sep 2021 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q1q3010658; Tue, 7 Sep 2021 09:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q1ee010657; Tue, 7 Sep 2021 09:52:01 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:01 GMT Message-Id: <202109070952.1879q1ee010657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 88ba5e895551 - main - pkgbase: Create a vt-data package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88ba5e8955518c1e032eafbce27d548eaf5a59ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:03 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=88ba5e8955518c1e032eafbce27d548eaf5a59ea commit 88ba5e8955518c1e032eafbce27d548eaf5a59ea Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:56:55 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:21:09 +0000 pkgbase: Create a vt-data package vt files for either keyboards and fonts are totally optional so create a separate package for them. Differential Revision: https://reviews.freebsd.org/D31797 --- release/packages/Makefile.package | 2 ++ share/vt/fonts/Makefile | 2 ++ share/vt/keymaps/Makefile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index 04c8ef0536f0..aaf883c93a5b 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -104,5 +104,7 @@ utilities_COMMENT= Non-vital programs and librairies utilities_DESC= Non-vital programs and librairies vi_COMMENT= Vi Editor vi_DESC= Vi Editor +vt_COMMENT= VT fonts and keyboard files +vt_DESC= VT fonts and keyboard files wpa_COMMENT= 802.11 Supplicant wpa_DESC= 802.11 Supplicant diff --git a/share/vt/fonts/Makefile b/share/vt/fonts/Makefile index 7062c0c69542..2599d1d1ce1d 100644 --- a/share/vt/fonts/Makefile +++ b/share/vt/fonts/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= vt-data + FONTS= gallant.fnt \ terminus-b32.fnt \ tom-thumb.fnt \ diff --git a/share/vt/keymaps/Makefile b/share/vt/keymaps/Makefile index 8b9fc4d26dc9..31ef7e3466dc 100644 --- a/share/vt/keymaps/Makefile +++ b/share/vt/keymaps/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= vt-data + FILES= INDEX.keymaps \ am.kbd \ be.acc.kbd \ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DE526AFB0D; Tue, 7 Sep 2021 09:52:04 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXg5s78z3HkD; Tue, 7 Sep 2021 09:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43BBF10692; Tue, 7 Sep 2021 09:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q38k010682; Tue, 7 Sep 2021 09:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q3sa010681; Tue, 7 Sep 2021 09:52:03 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:03 GMT Message-Id: <202109070952.1879q3sa010681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 27a7ae0ce00f - main - pkgbase: Create a syscons-data package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27a7ae0ce00fbd6ab6e76e6dd3c51eadefff6f12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:04 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=27a7ae0ce00fbd6ab6e76e6dd3c51eadefff6f12 commit 27a7ae0ce00fbd6ab6e76e6dd3c51eadefff6f12 Author: Emmanuel Vadot AuthorDate: 2021-09-01 17:58:27 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:21:40 +0000 pkgbase: Create a syscons-data package syscons is mostly deprecated and all it's files aren't needed for most users so create a separate package for them. Differential Revision: https://reviews.freebsd.org/D31798 Reviewed by: emaste --- share/syscons/fonts/Makefile | 2 ++ share/syscons/keymaps/Makefile | 2 ++ share/syscons/scrnmaps/Makefile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/share/syscons/fonts/Makefile b/share/syscons/fonts/Makefile index c7c6a1b36dc7..b60631e3805b 100644 --- a/share/syscons/fonts/Makefile +++ b/share/syscons/fonts/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= syscons-data + FILES= armscii8-8x8.fnt armscii8-8x14.fnt armscii8-8x16.fnt \ cp437-8x8.fnt cp437-8x14.fnt cp437-8x16.fnt \ cp437-thin-8x8.fnt cp437-thin-8x16.fnt \ diff --git a/share/syscons/keymaps/Makefile b/share/syscons/keymaps/Makefile index f04b4fa75d35..079ffa91f7bc 100644 --- a/share/syscons/keymaps/Makefile +++ b/share/syscons/keymaps/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= syscons-data + FILES= INDEX.keymaps \ be.iso.kbd be.iso.acc.kbd \ bg.bds.ctrlcaps.kbd bg.phonetic.ctrlcaps.kbd \ diff --git a/share/syscons/scrnmaps/Makefile b/share/syscons/scrnmaps/Makefile index 0f11c777fa02..fb6bf59131b9 100644 --- a/share/syscons/scrnmaps/Makefile +++ b/share/syscons/scrnmaps/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= syscons-data + SCRMAPS = armscii8-2haik8.scm \ iso-8859-1_to_cp437.scm iso-8859-4_for_vga9.scm \ iso-8859-7_to_cp437.scm \ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76B2F6AF7C2; Tue, 7 Sep 2021 09:52:06 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXk01lnz3HgN; Tue, 7 Sep 2021 09:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91EE510694; Tue, 7 Sep 2021 09:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q5QP010738; Tue, 7 Sep 2021 09:52:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q52B010737; Tue, 7 Sep 2021 09:52:05 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:05 GMT Message-Id: <202109070952.1879q52B010737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 30975efbaff0 - main - pkgbase: Put libbsdxml in FreeBSD-runtime MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30975efbaff0a021545e81bd9fa09d848edfaafa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:06 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=30975efbaff0a021545e81bd9fa09d848edfaafa commit 30975efbaff0a021545e81bd9fa09d848edfaafa Author: Emmanuel Vadot AuthorDate: 2021-09-01 18:25:50 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:22:45 +0000 pkgbase: Put libbsdxml in FreeBSD-runtime libbsdxml is used by a lot of programs so just put it in FreeBSD-runtime. Differential Revision: https://reviews.freebsd.org/D31800 Reviewed by: emaste --- lib/libexpat/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index d79afc53c865..5cbbca253700 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=lib${LIB} +PACKAGE= runtime EXPAT= ${SRCTOP}/contrib/expat LIB= bsdxml From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFF746AFB13; Tue, 7 Sep 2021 09:52:06 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXh68K4z3HQN; Tue, 7 Sep 2021 09:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61EE210551; Tue, 7 Sep 2021 09:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q4bv010714; Tue, 7 Sep 2021 09:52:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q4Y9010713; Tue, 7 Sep 2021 09:52:04 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:04 GMT Message-Id: <202109070952.1879q4Y9010713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cab6a39d7b34 - main - pkgbase: Create a FreeBSD-rdma package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cab6a39d7b343596a5823e65c0f7b426551ec22d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:07 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cab6a39d7b343596a5823e65c0f7b426551ec22d commit cab6a39d7b343596a5823e65c0f7b426551ec22d Author: Emmanuel Vadot AuthorDate: 2021-09-01 18:23:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:22:16 +0000 pkgbase: Create a FreeBSD-rdma package Put all the rdma related tools into this package. Differential Revision: https://reviews.freebsd.org/D31799 --- release/packages/Makefile.package | 2 ++ usr.bin/ofed/libibverbs/Makefile | 2 ++ usr.bin/ofed/libibverbs/asyncwatch/Makefile | 1 + usr.bin/ofed/libibverbs/devices/Makefile | 1 + usr.bin/ofed/libibverbs/devinfo/Makefile | 1 + usr.bin/ofed/libibverbs/rc_pingpong/Makefile | 1 + usr.bin/ofed/libibverbs/srq_pingpong/Makefile | 1 + usr.bin/ofed/libibverbs/uc_pingpong/Makefile | 1 + usr.bin/ofed/libibverbs/ud_pingpong/Makefile | 1 + usr.bin/ofed/librdmacm/mckey/Makefile | 1 + usr.bin/ofed/librdmacm/rping/Makefile | 1 + usr.bin/ofed/librdmacm/ucmatose/Makefile | 1 + usr.bin/ofed/librdmacm/udaddy/Makefile | 1 + 13 files changed, 15 insertions(+) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index aaf883c93a5b..ba70e2c2dcc8 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -75,6 +75,8 @@ rc_COMMENT= RC Scripts rc_DESC= RC Scripts rcmds_COMMENT= Remote Command Utilities rcmds_DESC= Remote Command Utilities +rdma_COMMENT= RDMA Utilities +rdma_DESC= RDMA Utilities rescue_COMMENT= Rescue Utilities rescue_DESC= Rescue Utilities runtime_COMMENT= FreeBSD Base System diff --git a/usr.bin/ofed/libibverbs/Makefile b/usr.bin/ofed/libibverbs/Makefile index bd164751c9ce..533474368372 100644 --- a/usr.bin/ofed/libibverbs/Makefile +++ b/usr.bin/ofed/libibverbs/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= FreeBSD-rdma + SUBDIR= \ asyncwatch \ devinfo \ diff --git a/usr.bin/ofed/libibverbs/asyncwatch/Makefile b/usr.bin/ofed/libibverbs/asyncwatch/Makefile index c82c0024d577..761b1d223c9d 100644 --- a/usr.bin/ofed/libibverbs/asyncwatch/Makefile +++ b/usr.bin/ofed/libibverbs/asyncwatch/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_asyncwatch MAN= ibv_asyncwatch.1 SRCS= asyncwatch.c diff --git a/usr.bin/ofed/libibverbs/devices/Makefile b/usr.bin/ofed/libibverbs/devices/Makefile index c2440ff40a9c..1cb3a4cf31ee 100644 --- a/usr.bin/ofed/libibverbs/devices/Makefile +++ b/usr.bin/ofed/libibverbs/devices/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_devices MAN= ibv_devices.1 SRCS= device_list.c diff --git a/usr.bin/ofed/libibverbs/devinfo/Makefile b/usr.bin/ofed/libibverbs/devinfo/Makefile index 83a61318faef..d5b55bd6b512 100644 --- a/usr.bin/ofed/libibverbs/devinfo/Makefile +++ b/usr.bin/ofed/libibverbs/devinfo/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_devinfo MAN= ibv_devinfo.1 SRCS= devinfo.c diff --git a/usr.bin/ofed/libibverbs/rc_pingpong/Makefile b/usr.bin/ofed/libibverbs/rc_pingpong/Makefile index 4145967dd0a3..12d847e9e238 100644 --- a/usr.bin/ofed/libibverbs/rc_pingpong/Makefile +++ b/usr.bin/ofed/libibverbs/rc_pingpong/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_rc_pingpong MAN= ibv_rc_pingpong.1 SRCS= rc_pingpong.c pingpong.c diff --git a/usr.bin/ofed/libibverbs/srq_pingpong/Makefile b/usr.bin/ofed/libibverbs/srq_pingpong/Makefile index ee2a6e07daca..405625476c6d 100644 --- a/usr.bin/ofed/libibverbs/srq_pingpong/Makefile +++ b/usr.bin/ofed/libibverbs/srq_pingpong/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_srq_pingpong MAN= ibv_srq_pingpong.1 SRCS= srq_pingpong.c pingpong.c diff --git a/usr.bin/ofed/libibverbs/uc_pingpong/Makefile b/usr.bin/ofed/libibverbs/uc_pingpong/Makefile index 8740e7062977..55f3709e5664 100644 --- a/usr.bin/ofed/libibverbs/uc_pingpong/Makefile +++ b/usr.bin/ofed/libibverbs/uc_pingpong/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_uc_pingpong MAN= ibv_uc_pingpong.1 SRCS= uc_pingpong.c pingpong.c diff --git a/usr.bin/ofed/libibverbs/ud_pingpong/Makefile b/usr.bin/ofed/libibverbs/ud_pingpong/Makefile index 7a153f5395a8..dc2ed672c712 100644 --- a/usr.bin/ofed/libibverbs/ud_pingpong/Makefile +++ b/usr.bin/ofed/libibverbs/ud_pingpong/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ibv_ud_pingpong MAN= ibv_ud_pingpong.1 SRCS= ud_pingpong.c pingpong.c diff --git a/usr.bin/ofed/librdmacm/mckey/Makefile b/usr.bin/ofed/librdmacm/mckey/Makefile index f0dd7f023fed..b9d9f8deeb46 100644 --- a/usr.bin/ofed/librdmacm/mckey/Makefile +++ b/usr.bin/ofed/librdmacm/mckey/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= mckey MAN= mckey.1 SRCS= mckey.c diff --git a/usr.bin/ofed/librdmacm/rping/Makefile b/usr.bin/ofed/librdmacm/rping/Makefile index 1112357558f8..99881c73682b 100644 --- a/usr.bin/ofed/librdmacm/rping/Makefile +++ b/usr.bin/ofed/librdmacm/rping/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= rping MAN= rping.1 SRCS= rping.c common.c diff --git a/usr.bin/ofed/librdmacm/ucmatose/Makefile b/usr.bin/ofed/librdmacm/ucmatose/Makefile index 9f984a8a49a8..4a5e00854ff0 100644 --- a/usr.bin/ofed/librdmacm/ucmatose/Makefile +++ b/usr.bin/ofed/librdmacm/ucmatose/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= ucmatose MAN= ucmatose.1 SRCS= cmatose.c common.c diff --git a/usr.bin/ofed/librdmacm/udaddy/Makefile b/usr.bin/ofed/librdmacm/udaddy/Makefile index df8f86de428f..afcf3c6ea74f 100644 --- a/usr.bin/ofed/librdmacm/udaddy/Makefile +++ b/usr.bin/ofed/librdmacm/udaddy/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= rdma PROG= udaddy MAN= udaddy.1 SRCS= udaddy.c common.c From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8376AFAB5; Tue, 7 Sep 2021 09:52:08 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXm4fd4z3HhS; Tue, 7 Sep 2021 09:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2E7710727; Tue, 7 Sep 2021 09:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q7ks010788; Tue, 7 Sep 2021 09:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q74h010787; Tue, 7 Sep 2021 09:52:07 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:07 GMT Message-Id: <202109070952.1879q74h010787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: dfa9131d7091 - main - pkgbase: Remove FreeBSD-libregex package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfa9131d709121b2e502a82ff66cf3e376654942 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:09 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=dfa9131d709121b2e502a82ff66cf3e376654942 commit dfa9131d709121b2e502a82ff66cf3e376654942 Author: Emmanuel Vadot AuthorDate: 2021-09-02 06:14:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:23:53 +0000 pkgbase: Remove FreeBSD-libregex package The only user of libregex is grep (and its variation), no need for a dedicated package. This moves libregex to the default package (FreeBSD-utilities). Differential Revision: https://reviews.freebsd.org/D31802 --- lib/libregex/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libregex/Makefile b/lib/libregex/Makefile index 5e54c3a5312a..5bf248801b32 100644 --- a/lib/libregex/Makefile +++ b/lib/libregex/Makefile @@ -2,7 +2,6 @@ .include -PACKAGE=lib${LIB} LIB= regex SHLIB_MAJOR= 1 SHLIB_MINOR= 0 From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37C966AFA9F; Tue, 7 Sep 2021 09:52:07 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXk6j78z3HQZ; Tue, 7 Sep 2021 09:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4C1210884; Tue, 7 Sep 2021 09:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q6TP010764; Tue, 7 Sep 2021 09:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q63H010763; Tue, 7 Sep 2021 09:52:06 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:06 GMT Message-Id: <202109070952.1879q63H010763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a30235a4c360 - main - pkgbase: Create a FreeBSD-kerberos package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a30235a4c360c06bb57be1f10ae6866a71fb5622 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:07 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a30235a4c360c06bb57be1f10ae6866a71fb5622 commit a30235a4c360c06bb57be1f10ae6866a71fb5622 Author: Emmanuel Vadot AuthorDate: 2021-09-02 04:09:15 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:23:14 +0000 pkgbase: Create a FreeBSD-kerberos package This allows users to install or not kerberos related utilities and libs. Differential Revision: https://reviews.freebsd.org/D31801 --- kerberos5/lib/libasn1/Makefile | 2 ++ kerberos5/lib/libgssapi_krb5/Makefile | 2 ++ kerberos5/lib/libgssapi_ntlm/Makefile | 2 ++ kerberos5/lib/libgssapi_spnego/Makefile | 2 ++ kerberos5/lib/libhdb/Makefile | 2 ++ kerberos5/lib/libheimbase/Makefile | 2 ++ kerberos5/lib/libheimipcc/Makefile | 2 ++ kerberos5/lib/libheimipcs/Makefile | 2 ++ kerberos5/lib/libheimntlm/Makefile | 2 ++ kerberos5/lib/libhx509/Makefile | 2 ++ kerberos5/lib/libkadm5clnt/Makefile | 2 ++ kerberos5/lib/libkadm5srv/Makefile | 2 ++ kerberos5/lib/libkafs5/Makefile | 2 ++ kerberos5/lib/libkdc/Makefile | 2 ++ kerberos5/lib/libkrb5/Makefile | 2 ++ kerberos5/lib/libroken/Makefile | 2 ++ kerberos5/lib/libsl/Makefile | 2 ++ kerberos5/lib/libvers/Makefile | 2 ++ kerberos5/lib/libwind/Makefile | 2 ++ kerberos5/libexec/digest-service/Makefile | 2 ++ kerberos5/libexec/hprop/Makefile | 2 ++ kerberos5/libexec/hpropd/Makefile | 2 ++ kerberos5/libexec/ipropd-master/Makefile | 2 ++ kerberos5/libexec/ipropd-slave/Makefile | 2 ++ kerberos5/libexec/kadmind/Makefile | 2 ++ kerberos5/libexec/kcm/Makefile | 2 ++ kerberos5/libexec/kdc/Makefile | 2 ++ kerberos5/libexec/kdigest/Makefile | 2 ++ kerberos5/libexec/kfd/Makefile | 2 ++ kerberos5/libexec/kimpersonate/Makefile | 2 ++ kerberos5/libexec/kpasswdd/Makefile | 2 ++ kerberos5/tools/asn1_compile/Makefile | 2 ++ kerberos5/tools/make-roken/Makefile | 2 ++ kerberos5/tools/slc/Makefile | 2 ++ kerberos5/usr.bin/hxtool/Makefile | 2 ++ kerberos5/usr.bin/kadmin/Makefile | 2 ++ kerberos5/usr.bin/kcc/Makefile | 2 ++ kerberos5/usr.bin/kdestroy/Makefile | 2 ++ kerberos5/usr.bin/kf/Makefile | 2 ++ kerberos5/usr.bin/kgetcred/Makefile | 2 ++ kerberos5/usr.bin/kinit/Makefile | 2 ++ kerberos5/usr.bin/kpasswd/Makefile | 2 ++ kerberos5/usr.bin/krb5-config/Makefile | 2 ++ kerberos5/usr.bin/ksu/Makefile | 2 ++ kerberos5/usr.bin/string2key/Makefile | 2 ++ kerberos5/usr.bin/verify_krb5_conf/Makefile | 2 ++ kerberos5/usr.sbin/iprop-log/Makefile | 2 ++ kerberos5/usr.sbin/kstash/Makefile | 2 ++ kerberos5/usr.sbin/ktutil/Makefile | 2 ++ lib/libcom_err/Makefile | 2 ++ lib/libpam/modules/pam_krb5/Makefile | 2 ++ lib/libpam/modules/pam_ksu/Makefile | 2 ++ libexec/rc/rc.d/Makefile | 7 ++++++- release/packages/Makefile.package | 2 ++ usr.bin/compile_et/Makefile | 2 ++ usr.sbin/gssd/Makefile | 2 ++ 56 files changed, 116 insertions(+), 1 deletion(-) diff --git a/kerberos5/lib/libasn1/Makefile b/kerberos5/lib/libasn1/Makefile index f75445e47f63..1772965239e8 100644 --- a/kerberos5/lib/libasn1/Makefile +++ b/kerberos5/lib/libasn1/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= asn1 LDFLAGS= -Wl,--no-undefined INCS= asn1_err.h asn1-common.h heim_asn1.h der.h der-protos.h der-private.h diff --git a/kerberos5/lib/libgssapi_krb5/Makefile b/kerberos5/lib/libgssapi_krb5/Makefile index 9ba59dcb48c5..fe64b99d57f0 100644 --- a/kerberos5/lib/libgssapi_krb5/Makefile +++ b/kerberos5/lib/libgssapi_krb5/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= gssapi_krb5 LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined LIBADD= gssapi krb5 crypto roken asn1 com_err diff --git a/kerberos5/lib/libgssapi_ntlm/Makefile b/kerberos5/lib/libgssapi_ntlm/Makefile index b5edb08a8d47..224404600205 100644 --- a/kerberos5/lib/libgssapi_ntlm/Makefile +++ b/kerberos5/lib/libgssapi_ntlm/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= gssapi_ntlm LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined LIBADD= crypto gssapi krb5 heimntlm roken diff --git a/kerberos5/lib/libgssapi_spnego/Makefile b/kerberos5/lib/libgssapi_spnego/Makefile index 1ccf1377e8bc..bfd235b27981 100644 --- a/kerberos5/lib/libgssapi_spnego/Makefile +++ b/kerberos5/lib/libgssapi_spnego/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= gssapi_spnego LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined LIBADD= gssapi heimbase asn1 roken diff --git a/kerberos5/lib/libhdb/Makefile b/kerberos5/lib/libhdb/Makefile index fda622d6945a..647ee1513148 100644 --- a/kerberos5/lib/libhdb/Makefile +++ b/kerberos5/lib/libhdb/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= hdb LDFLAGS= -Wl,--no-undefined ${LDAPLDFLAGS} VERSION_MAP= ${KRB5DIR}/lib/hdb/version-script.map diff --git a/kerberos5/lib/libheimbase/Makefile b/kerberos5/lib/libheimbase/Makefile index b6bf526b3522..d98d6ebbb4f4 100644 --- a/kerberos5/lib/libheimbase/Makefile +++ b/kerberos5/lib/libheimbase/Makefile @@ -1,5 +1,7 @@ #$FreeBSD$ +PACKAGE= kerberos + LIB= heimbase LDFLAGS= -Wl,--no-undefined LIBADD= pthread diff --git a/kerberos5/lib/libheimipcc/Makefile b/kerberos5/lib/libheimipcc/Makefile index 9ec712572371..d102058720e7 100644 --- a/kerberos5/lib/libheimipcc/Makefile +++ b/kerberos5/lib/libheimipcc/Makefile @@ -1,5 +1,7 @@ #$FreeBSD$ +PACKAGE= kerberos + LIB= heimipcc PRIVATELIB= LIBADD= heimbase roken pthread diff --git a/kerberos5/lib/libheimipcs/Makefile b/kerberos5/lib/libheimipcs/Makefile index b1201f65a842..308b5ecd6840 100644 --- a/kerberos5/lib/libheimipcs/Makefile +++ b/kerberos5/lib/libheimipcs/Makefile @@ -1,5 +1,7 @@ #$FreeBSD$ +PACKAGE= kerberos + LIB= heimipcs PRIVATELIB= LIBADD= heimbase roken pthread diff --git a/kerberos5/lib/libheimntlm/Makefile b/kerberos5/lib/libheimntlm/Makefile index 148aa8df1f70..a422ef641a49 100644 --- a/kerberos5/lib/libheimntlm/Makefile +++ b/kerberos5/lib/libheimntlm/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= heimntlm LDFLAGS= -Wl,--no-undefined LIBADD= crypto com_err krb5 roken diff --git a/kerberos5/lib/libhx509/Makefile b/kerberos5/lib/libhx509/Makefile index 1696ffb73cb8..175dc63a0bb7 100644 --- a/kerberos5/lib/libhx509/Makefile +++ b/kerberos5/lib/libhx509/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= hx509 LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/hx509/version-script.map diff --git a/kerberos5/lib/libkadm5clnt/Makefile b/kerberos5/lib/libkadm5clnt/Makefile index fecdf915070e..e336f85fc302 100644 --- a/kerberos5/lib/libkadm5clnt/Makefile +++ b/kerberos5/lib/libkadm5clnt/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= kadm5clnt LDFLAGS= -Wl,--no-undefined LIBADD= com_err krb5 roken diff --git a/kerberos5/lib/libkadm5srv/Makefile b/kerberos5/lib/libkadm5srv/Makefile index 733242ce99af..fac25253d26e 100644 --- a/kerberos5/lib/libkadm5srv/Makefile +++ b/kerberos5/lib/libkadm5srv/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= kadm5srv LDFLAGS= -Wl,--no-undefined LIBADD= com_err hdb krb5 roken diff --git a/kerberos5/lib/libkafs5/Makefile b/kerberos5/lib/libkafs5/Makefile index 24400b8b2edc..67ad3920bbd9 100644 --- a/kerberos5/lib/libkafs5/Makefile +++ b/kerberos5/lib/libkafs5/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= kafs5 LDFLAGS= -Wl,--no-undefined LIBADD= asn1 krb5 roken diff --git a/kerberos5/lib/libkdc/Makefile b/kerberos5/lib/libkdc/Makefile index 24267a8dd419..423a8919bc28 100644 --- a/kerberos5/lib/libkdc/Makefile +++ b/kerberos5/lib/libkdc/Makefile @@ -1,5 +1,7 @@ #$FreeBSD$ +PACKAGE= kerberos + LIB= kdc LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/kdc/version-script.map diff --git a/kerberos5/lib/libkrb5/Makefile b/kerberos5/lib/libkrb5/Makefile index 75e065a2192e..2aaa0da9fe1e 100644 --- a/kerberos5/lib/libkrb5/Makefile +++ b/kerberos5/lib/libkrb5/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= krb5 LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map diff --git a/kerberos5/lib/libroken/Makefile b/kerberos5/lib/libroken/Makefile index 95505d2a1ff9..bea5694ce348 100644 --- a/kerberos5/lib/libroken/Makefile +++ b/kerberos5/lib/libroken/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= roken LIBADD= crypt VERSION_MAP= ${KRB5DIR}/lib/roken/version-script.map diff --git a/kerberos5/lib/libsl/Makefile b/kerberos5/lib/libsl/Makefile index 71a38a5729d1..766d5931d8d8 100644 --- a/kerberos5/lib/libsl/Makefile +++ b/kerberos5/lib/libsl/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= sl INTERNALLIB= SRCS= sl.c diff --git a/kerberos5/lib/libvers/Makefile b/kerberos5/lib/libvers/Makefile index cef5a88a7461..a4f46d62f043 100644 --- a/kerberos5/lib/libvers/Makefile +++ b/kerberos5/lib/libvers/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= vers INTERNALLIB= SRCS= print_version.c roken.h diff --git a/kerberos5/lib/libwind/Makefile b/kerberos5/lib/libwind/Makefile index 0e4fa4303b98..ef1ca66696c9 100644 --- a/kerberos5/lib/libwind/Makefile +++ b/kerberos5/lib/libwind/Makefile @@ -1,5 +1,7 @@ #$FreeBSD$ +PACKAGE= kerberos + LIB= wind LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/wind/version-script.map diff --git a/kerberos5/libexec/digest-service/Makefile b/kerberos5/libexec/digest-service/Makefile index 7b888f5481cd..caeb6427af45 100644 --- a/kerberos5/libexec/digest-service/Makefile +++ b/kerberos5/libexec/digest-service/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= digest-service MAN= CFLAGS+= -I${KRB5DIR}/kdc \ diff --git a/kerberos5/libexec/hprop/Makefile b/kerberos5/libexec/hprop/Makefile index 1c5d4b20e1bf..0a8c46e15a44 100644 --- a/kerberos5/libexec/hprop/Makefile +++ b/kerberos5/libexec/hprop/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= hprop MAN= hprop.8 SRCS= hprop.c mit_dump.c diff --git a/kerberos5/libexec/hpropd/Makefile b/kerberos5/libexec/hpropd/Makefile index 56a598f08312..005125ec1544 100644 --- a/kerberos5/libexec/hpropd/Makefile +++ b/kerberos5/libexec/hpropd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= hpropd MAN= hpropd.8 CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 \ diff --git a/kerberos5/libexec/ipropd-master/Makefile b/kerberos5/libexec/ipropd-master/Makefile index 9f0bddbae4fd..3f3097ce062b 100644 --- a/kerberos5/libexec/ipropd-master/Makefile +++ b/kerberos5/libexec/ipropd-master/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= ipropd-master MAN= iprop.8 SRCS= ipropd_common.c ipropd_master.c kadm5_err.h diff --git a/kerberos5/libexec/ipropd-slave/Makefile b/kerberos5/libexec/ipropd-slave/Makefile index cae84aa5ffb5..f9287251fda6 100644 --- a/kerberos5/libexec/ipropd-slave/Makefile +++ b/kerberos5/libexec/ipropd-slave/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= ipropd-slave MAN= SRCS= ipropd_common.c ipropd_slave.c kadm5_err.h diff --git a/kerberos5/libexec/kadmind/Makefile b/kerberos5/libexec/kadmind/Makefile index b2f3f71cc1e8..ac92fc3ba292 100644 --- a/kerberos5/libexec/kadmind/Makefile +++ b/kerberos5/libexec/kadmind/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kadmind MAN= kadmind.8 SRCS= rpc.c \ diff --git a/kerberos5/libexec/kcm/Makefile b/kerberos5/libexec/kcm/Makefile index 35165ef9e424..c061e94de6ee 100644 --- a/kerberos5/libexec/kcm/Makefile +++ b/kerberos5/libexec/kcm/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kcm MAN= kcm.8 diff --git a/kerberos5/libexec/kdc/Makefile b/kerberos5/libexec/kdc/Makefile index 338a508de20b..66063a5d669f 100644 --- a/kerberos5/libexec/kdc/Makefile +++ b/kerberos5/libexec/kdc/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kdc MAN= kdc.8 diff --git a/kerberos5/libexec/kdigest/Makefile b/kerberos5/libexec/kdigest/Makefile index 5f3fb2450646..5ce04da70b6d 100644 --- a/kerberos5/libexec/kdigest/Makefile +++ b/kerberos5/libexec/kdigest/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kdigest MAN= kdigest.8 CFLAGS+= -I${KRB5DIR}/lib/asn1 \ diff --git a/kerberos5/libexec/kfd/Makefile b/kerberos5/libexec/kfd/Makefile index 82df3adbb6da..8561a770a42c 100644 --- a/kerberos5/libexec/kfd/Makefile +++ b/kerberos5/libexec/kfd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kfd MAN= kfd.8 CFLAGS+= -I${KRB5DIR}/lib/asn1 \ diff --git a/kerberos5/libexec/kimpersonate/Makefile b/kerberos5/libexec/kimpersonate/Makefile index 3c94db6857d0..8bada272688f 100644 --- a/kerberos5/libexec/kimpersonate/Makefile +++ b/kerberos5/libexec/kimpersonate/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kimpersonate MAN= kimpersonate.8 CFLAGS+= -I${KRB5DIR}/lib/hx509 \ diff --git a/kerberos5/libexec/kpasswdd/Makefile b/kerberos5/libexec/kpasswdd/Makefile index ec36c24fc034..867c9f19961d 100644 --- a/kerberos5/libexec/kpasswdd/Makefile +++ b/kerberos5/libexec/kpasswdd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kpasswdd MAN= kpasswdd.8 CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/libhdb ${LDAPCFLAGS} diff --git a/kerberos5/tools/asn1_compile/Makefile b/kerberos5/tools/asn1_compile/Makefile index 5e9cbfa5ea45..ac54c9dfa134 100644 --- a/kerberos5/tools/asn1_compile/Makefile +++ b/kerberos5/tools/asn1_compile/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= asn1_compile MAN= LIBROKEN_A= ${.OBJDIR:H:H}/lib/libroken/libroken.a diff --git a/kerberos5/tools/make-roken/Makefile b/kerberos5/tools/make-roken/Makefile index fb7487016c65..6bb9b889b517 100644 --- a/kerberos5/tools/make-roken/Makefile +++ b/kerberos5/tools/make-roken/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= make-roken MAN= diff --git a/kerberos5/tools/slc/Makefile b/kerberos5/tools/slc/Makefile index df64d829d080..7b34a442019d 100644 --- a/kerberos5/tools/slc/Makefile +++ b/kerberos5/tools/slc/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= slc LIBROKEN_A= ${.OBJDIR:H:H}/lib/libroken/libroken.a LIBADD= vers diff --git a/kerberos5/usr.bin/hxtool/Makefile b/kerberos5/usr.bin/hxtool/Makefile index 7cec9ee729b1..cbae762b3091 100644 --- a/kerberos5/usr.bin/hxtool/Makefile +++ b/kerberos5/usr.bin/hxtool/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= hxtool MAN= CFLAGS+= -I${KRB5DIR}/lib/hx509 \ diff --git a/kerberos5/usr.bin/kadmin/Makefile b/kerberos5/usr.bin/kadmin/Makefile index 729b9f7f418e..b735637e1201 100644 --- a/kerberos5/usr.bin/kadmin/Makefile +++ b/kerberos5/usr.bin/kadmin/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kadmin MAN= kadmin.8 diff --git a/kerberos5/usr.bin/kcc/Makefile b/kerberos5/usr.bin/kcc/Makefile index 7c4b7ab3962a..c0dafd57af9d 100644 --- a/kerberos5/usr.bin/kcc/Makefile +++ b/kerberos5/usr.bin/kcc/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kcc MAN= klist.1 kswitch.1 LINKS= ${BINDIR}/kcc ${BINDIR}/klist \ diff --git a/kerberos5/usr.bin/kdestroy/Makefile b/kerberos5/usr.bin/kdestroy/Makefile index 23e90237c658..c192d33a3634 100644 --- a/kerberos5/usr.bin/kdestroy/Makefile +++ b/kerberos5/usr.bin/kdestroy/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kdestroy CFLAGS+=-I${KRB5DIR}/lib/roken LIBADD= kafs5 krb5 roken vers diff --git a/kerberos5/usr.bin/kf/Makefile b/kerberos5/usr.bin/kf/Makefile index 44d91830baaf..65618e1f59dc 100644 --- a/kerberos5/usr.bin/kf/Makefile +++ b/kerberos5/usr.bin/kf/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kf MAN= kf.1 CFLAGS+= -I${KRB5DIR}/lib/asn1 \ diff --git a/kerberos5/usr.bin/kgetcred/Makefile b/kerberos5/usr.bin/kgetcred/Makefile index 1451154f9cf8..9e4ae650a8a5 100644 --- a/kerberos5/usr.bin/kgetcred/Makefile +++ b/kerberos5/usr.bin/kgetcred/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kgetcred CFLAGS+= -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken diff --git a/kerberos5/usr.bin/kinit/Makefile b/kerberos5/usr.bin/kinit/Makefile index 7622b8da956e..12db5bfde044 100644 --- a/kerberos5/usr.bin/kinit/Makefile +++ b/kerberos5/usr.bin/kinit/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kinit CFLAGS+=-I${KRB5DIR}/lib/roken LIBADD= kafs5 krb5 heimntlm roken crypto vers diff --git a/kerberos5/usr.bin/kpasswd/Makefile b/kerberos5/usr.bin/kpasswd/Makefile index 05e07dddc03d..2f1102315ab7 100644 --- a/kerberos5/usr.bin/kpasswd/Makefile +++ b/kerberos5/usr.bin/kpasswd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kpasswd CFLAGS+=-I${KRB5DIR}/lib/roken LIBADD= hdb krb5 roken vers crypto diff --git a/kerberos5/usr.bin/krb5-config/Makefile b/kerberos5/usr.bin/krb5-config/Makefile index 5224f7c54503..38a47811c6a8 100644 --- a/kerberos5/usr.bin/krb5-config/Makefile +++ b/kerberos5/usr.bin/krb5-config/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + SCRIPTS=krb5-config MAN= krb5-config.1 diff --git a/kerberos5/usr.bin/ksu/Makefile b/kerberos5/usr.bin/ksu/Makefile index ebd39c677b54..a286f658e4dd 100644 --- a/kerberos5/usr.bin/ksu/Makefile +++ b/kerberos5/usr.bin/ksu/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= ksu .if defined(ENABLE_SUID_K5SU) BINMODE=4555 diff --git a/kerberos5/usr.bin/string2key/Makefile b/kerberos5/usr.bin/string2key/Makefile index 129d12cbcf0d..bf343ceaddaa 100644 --- a/kerberos5/usr.bin/string2key/Makefile +++ b/kerberos5/usr.bin/string2key/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= string2key MAN= string2key.8 CFLAGS+= -I${KRB5DIR}/kdc \ diff --git a/kerberos5/usr.bin/verify_krb5_conf/Makefile b/kerberos5/usr.bin/verify_krb5_conf/Makefile index 372870c1ecc9..c56112a028aa 100644 --- a/kerberos5/usr.bin/verify_krb5_conf/Makefile +++ b/kerberos5/usr.bin/verify_krb5_conf/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= verify_krb5_conf MAN= verify_krb5_conf.8 CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ diff --git a/kerberos5/usr.sbin/iprop-log/Makefile b/kerberos5/usr.sbin/iprop-log/Makefile index 1f71f9b2a400..736b702f7629 100644 --- a/kerberos5/usr.sbin/iprop-log/Makefile +++ b/kerberos5/usr.sbin/iprop-log/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= iprop-log MAN= iprop-log.8 SRCS= iprop-log.c iprop-commands.c iprop-commands.h kadm5_err.h diff --git a/kerberos5/usr.sbin/kstash/Makefile b/kerberos5/usr.sbin/kstash/Makefile index 1eec313766d3..cd7318f01462 100644 --- a/kerberos5/usr.sbin/kstash/Makefile +++ b/kerberos5/usr.sbin/kstash/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= kstash MAN= kstash.8 CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ diff --git a/kerberos5/usr.sbin/ktutil/Makefile b/kerberos5/usr.sbin/ktutil/Makefile index c79d09e6d94d..4adbbcef15ab 100644 --- a/kerberos5/usr.sbin/ktutil/Makefile +++ b/kerberos5/usr.sbin/ktutil/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + PROG= ktutil MAN= ktutil.8 diff --git a/lib/libcom_err/Makefile b/lib/libcom_err/Makefile index 89fed48e1dd1..4bb69614453e 100644 --- a/lib/libcom_err/Makefile +++ b/lib/libcom_err/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= kerberos + LIB= com_err SRCS= com_err.c error.c INCS= ${COM_ERRDIR}/com_err.h ${COM_ERRDIR}/com_right.h diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile index 97fd49092298..a11cad75ebce 100644 --- a/lib/libpam/modules/pam_krb5/Makefile +++ b/lib/libpam/modules/pam_krb5/Makefile @@ -24,6 +24,8 @@ # # $FreeBSD$ +PACKAGE= kerberos + LIB= pam_krb5 SRCS= pam_krb5.c MAN= pam_krb5.8 diff --git a/lib/libpam/modules/pam_ksu/Makefile b/lib/libpam/modules/pam_ksu/Makefile index 26f3f850daaa..b16e923bde89 100644 --- a/lib/libpam/modules/pam_ksu/Makefile +++ b/lib/libpam/modules/pam_ksu/Makefile @@ -24,6 +24,8 @@ # # $FreeBSD$ +PACKAGE= kerberos + LIB= pam_ksu SRCS= pam_ksu.c MAN= pam_ksu.8 diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 24a4e7edb9d9..2271c27b7f89 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -34,7 +34,6 @@ CONFS= DAEMON \ geli2 \ gptboot \ growfs \ - gssd \ hostid \ hostid_save \ hostname \ @@ -191,6 +190,12 @@ CONFS+= ccd CONFS+= ftpd .endif +.if ${MK_GSSAPI} != "no" +CONFGROUPS+= gssd +GSSD= gssd +GSSDPACKAGE= kerberos +.endif + .if ${MK_HAST} != "no" CONFGROUPS+= HAST HAST= hastd diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index ba70e2c2dcc8..cc971617a4e0 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -61,6 +61,8 @@ jail-lib32_DESCR= 32-bit Libraries jail-lib32-debug_DESCR=32-bit Debugging Symbols jail-lib32-development_DESCR=32-bit Development Files jail-lib32-profile_DESCR=32-bit Profiling Libraries +kerberos_COMMENT= Kerberos Utilities +kerberos_DESC= Kerberos Utilities kernel_COMMENT= FreeBSD Kernel kernel_DESC= FreeBSD Kernel manuals_COMMENT= Manual Pages diff --git a/usr.bin/compile_et/Makefile b/usr.bin/compile_et/Makefile index aeccbf3fd55f..a7a7130e9228 100644 --- a/usr.bin/compile_et/Makefile +++ b/usr.bin/compile_et/Makefile @@ -2,6 +2,8 @@ .PATH: ${SRCTOP}/contrib/com_err +PACKAGE= kerberos + PROG= compile_et SRCS= compile_et.c parse.y lex.l LIBADD= roken vers diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile index e40017016f18..d22a01597ced 100644 --- a/usr.sbin/gssd/Makefile +++ b/usr.sbin/gssd/Makefile @@ -2,6 +2,8 @@ .include +PACKAGE= kerberos + PROG= gssd MAN= gssd.8 SRCS= gssd.c gssd.h gssd_svc.c gssd_xdr.c gssd_prot.c From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E5476AFB1F; Tue, 7 Sep 2021 09:52:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXp1KJrz3HQm; Tue, 7 Sep 2021 09:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04E7B7EDB; Tue, 7 Sep 2021 09:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879q86w010812; Tue, 7 Sep 2021 09:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879q8P5010811; Tue, 7 Sep 2021 09:52:08 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:08 GMT Message-Id: <202109070952.1879q8P5010811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d8d41d3b8429 - main - pkgbase: Remove libefivar package and add a efi-tools one MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8d41d3b842980e7b76c8f3081ed8b571af97e0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:11 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d41d3b842980e7b76c8f3081ed8b571af97e0c commit d8d41d3b842980e7b76c8f3081ed8b571af97e0c Author: Emmanuel Vadot AuthorDate: 2021-09-02 15:12:51 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:24:21 +0000 pkgbase: Remove libefivar package and add a efi-tools one Put all the efi related tools into FreeBSD-efi-tools. Differential Revision: https://reviews.freebsd.org/D31803 --- lib/libefivar/Makefile | 2 +- release/packages/Makefile.package | 2 ++ usr.sbin/efibootmgr/Makefile | 2 ++ usr.sbin/efidp/Makefile | 2 ++ usr.sbin/efitable/Makefile | 2 ++ usr.sbin/efivar/Makefile | 2 ++ 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/libefivar/Makefile b/lib/libefivar/Makefile index c1503f4e5b62..7b814898721f 100644 --- a/lib/libefivar/Makefile +++ b/lib/libefivar/Makefile @@ -31,7 +31,7 @@ EDK2INC=${SRCTOP}/sys/contrib/edk2/Include .PATH: ${EFIBOOT}/libefi -PACKAGE=lib${LIB} +PACKAGE= efi-tools LIB= efivar SRCS= efivar.c efichar.c efivar-dp-format.c \ efivar-dp-parse.c \ diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index cc971617a4e0..cc75e07a8943 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -42,6 +42,8 @@ dwatch_COMMENT= Dwatch Utilities dwatch_DESC= Dwatch Utilities ee_COMMENT= Easy Editor Utilities ee_DESC= Easy Editor Utilities +efi-tools_COMMENT= UEFI Utilities +efi-tools_DESC= UEFI Utilities gdb_COMMENT= GDB Utilities gdb_DESC= GDB Utilities ggate_COMMENT= GEOM Gate Utilities diff --git a/usr.sbin/efibootmgr/Makefile b/usr.sbin/efibootmgr/Makefile index d485537e7515..9e98412f6f74 100644 --- a/usr.sbin/efibootmgr/Makefile +++ b/usr.sbin/efibootmgr/Makefile @@ -5,6 +5,8 @@ EFIVAR=${SRCTOP}/usr.sbin/efivar .PATH: ${EFIBOOT}/libefi ${EFIVAR} CFLAGS+= -I${EFIVAR} -I${EFIINCL} +PACKAGE= efi-tools + PROG=efibootmgr MAN= efibootmgr.8 SRCS= efichar.c efiutil.c efibootmgr.c diff --git a/usr.sbin/efidp/Makefile b/usr.sbin/efidp/Makefile index 56dd2659b777..7b8bf2d1d556 100644 --- a/usr.sbin/efidp/Makefile +++ b/usr.sbin/efidp/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= efi-tools + PROG= efidp MAN= efidp.8 diff --git a/usr.sbin/efitable/Makefile b/usr.sbin/efitable/Makefile index 83db6d9f74a6..d318a5818da9 100644 --- a/usr.sbin/efitable/Makefile +++ b/usr.sbin/efitable/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= efi-tools + PROG= efitable MAN= efitable.8 SRCS= efitable.c diff --git a/usr.sbin/efivar/Makefile b/usr.sbin/efivar/Makefile index 3bc1868bf77b..aa00f4b79502 100644 --- a/usr.sbin/efivar/Makefile +++ b/usr.sbin/efivar/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= efi-tools + PROG= efivar MAN= efivar.8 From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 413666AF7D5; Tue, 7 Sep 2021 09:52:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXq1H0yz3HhY; Tue, 7 Sep 2021 09:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2340010812; Tue, 7 Sep 2021 09:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879qAHV010844; Tue, 7 Sep 2021 09:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879qAo2010843; Tue, 7 Sep 2021 09:52:10 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:10 GMT Message-Id: <202109070952.1879qAo2010843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: db953e8b9775 - main - pkgbase: Create a FreeBSD-hyperv package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db953e8b97756df2d6907408388952bcc301c762 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:12 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=db953e8b97756df2d6907408388952bcc301c762 commit db953e8b97756df2d6907408388952bcc301c762 Author: Emmanuel Vadot AuthorDate: 2021-09-02 15:13:45 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:24:54 +0000 pkgbase: Create a FreeBSD-hyperv package Put all hyperv utilities in it. Differential Revision: https://reviews.freebsd.org/D31805 --- libexec/hyperv/Makefile | 1 + release/packages/Makefile.package | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libexec/hyperv/Makefile b/libexec/hyperv/Makefile index 6e251b24faa7..1d1fbf375a0e 100644 --- a/libexec/hyperv/Makefile +++ b/libexec/hyperv/Makefile @@ -4,6 +4,7 @@ BINDIR= ${LIBEXECDIR}/hyperv +PACKAGE= hyperv-tools SCRIPTS= hv_set_ifconfig hv_get_dns_info hv_get_dhcp_info SCRIPTS+= hyperv_vfattach hyperv_vfup diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index cc75e07a8943..add10d648c22 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -54,6 +54,8 @@ hast_COMMENT= Highly Available Storage daemon hast_DESC= Highly Available Storage daemon hostapd_COMMENT= 802.11 Access Point Daemon an Utilities hostapd_DESC= 802.11 Access Point Daemon an Utilities +hyperv-tools_COMMENT= Microsoft HyperV Utilities +hyperv-tools_DESC= Microsoft HyperV Utilities jail_COMMENT= Jail Utilities jail_DESC= Jail Utilities jail-debug_DESCR= Debugging Symbols From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:52:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C80146AF872; Tue, 7 Sep 2021 09:52:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gXr4jQvz3Hkl; Tue, 7 Sep 2021 09:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BF3E10815; Tue, 7 Sep 2021 09:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879qBl1010868; Tue, 7 Sep 2021 09:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879qBam010867; Tue, 7 Sep 2021 09:52:11 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:52:11 GMT Message-Id: <202109070952.1879qBam010867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: b5be5c35dbaf - main - pkgbase: Create a FreeBSD-ftp package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5be5c35dbaf38caaa9c70a83025f3535abbfd4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:52:12 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b5be5c35dbaf38caaa9c70a83025f3535abbfd4f commit b5be5c35dbaf38caaa9c70a83025f3535abbfd4f Author: Emmanuel Vadot AuthorDate: 2021-09-02 15:14:20 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-07 08:25:23 +0000 pkgbase: Create a FreeBSD-ftp package ftp tools aren't that useful nowadays but some might want them. Create a FreeBSD-ftp package so users have a choice to have them or not. Differential Revision: https://reviews.freebsd.org/D31794 --- lib/libpam/pam.d/Makefile | 1 + release/packages/Makefile.package | 2 ++ usr.bin/ftp/Makefile | 2 ++ 3 files changed, 5 insertions(+) diff --git a/lib/libpam/pam.d/Makefile b/lib/libpam/pam.d/Makefile index 1a9caeef940f..ca9691714091 100644 --- a/lib/libpam/pam.d/Makefile +++ b/lib/libpam/pam.d/Makefile @@ -26,6 +26,7 @@ ATPACKAGE+= at .if ${MK_FTP} != "no" CONFGROUPS+= FTP FTP+= ftpd +FTPPACKAGE= ftp afterinstallconfig: ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${CONFDIR}/ftpd ${DESTDIR}${CONFDIR}/ftp diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index add10d648c22..f41a31c8fb3b 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -44,6 +44,8 @@ ee_COMMENT= Easy Editor Utilities ee_DESC= Easy Editor Utilities efi-tools_COMMENT= UEFI Utilities efi-tools_DESC= UEFI Utilities +ftp_COMMENT= FTP Utilities +ftp_DESC= FTP Utilities gdb_COMMENT= GDB Utilities gdb_DESC= GDB Utilities ggate_COMMENT= GEOM Gate Utilities diff --git a/usr.bin/ftp/Makefile b/usr.bin/ftp/Makefile index e7de6e6c496c..3be674cfb2c6 100644 --- a/usr.bin/ftp/Makefile +++ b/usr.bin/ftp/Makefile @@ -8,6 +8,8 @@ # #CFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21 +PACKAGE= ftp + TNFTP= ${SRCTOP}/contrib/tnftp .PATH: ${TNFTP}/src From owner-dev-commits-src-main@freebsd.org Tue Sep 7 09:54:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 418B16AFEEF; Tue, 7 Sep 2021 09:54:46 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3gbp1GwSz3JJq; Tue, 7 Sep 2021 09:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BDB710836; Tue, 7 Sep 2021 09:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1879sjNe011336; Tue, 7 Sep 2021 09:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1879sjC0011335; Tue, 7 Sep 2021 09:54:45 GMT (envelope-from git) Date: Tue, 7 Sep 2021 09:54:45 GMT Message-Id: <202109070954.1879sjC0011335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 94d9439b6be6 - main - Fix cross-builds after 4e5d32a445f90d37966cd6de571978551654e3f3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94d9439b6be6bd5ef9febfaf38128e0cad91476d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 09:54:46 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=94d9439b6be6bd5ef9febfaf38128e0cad91476d commit 94d9439b6be6bd5ef9febfaf38128e0cad91476d Author: Jose Luis Duran AuthorDate: 2021-08-30 19:29:17 +0000 Commit: Alex Richardson CommitDate: 2021-09-07 09:53:50 +0000 Fix cross-builds after 4e5d32a445f90d37966cd6de571978551654e3f3 Add alignment macros to cross-build's sys/cdefs.h Pull Request: https://github.com/freebsd/freebsd-src/pull/531 MFC after: immediately (build fix) --- tools/build/cross-build/include/common/sys/cdefs.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/build/cross-build/include/common/sys/cdefs.h b/tools/build/cross-build/include/common/sys/cdefs.h index c129542b6180..6d62333bcffe 100644 --- a/tools/build/cross-build/include/common/sys/cdefs.h +++ b/tools/build/cross-build/include/common/sys/cdefs.h @@ -255,3 +255,22 @@ #define __BSD_VISIBLE 1 #define __ISO_C_VISIBLE 2011 #define __EXT1_VISIBLE 1 + +/* Alignment builtins for better type checking and improved code generation. */ +/* Provide fallback versions for other compilers (GCC/Clang < 10): */ +#if !__has_builtin(__builtin_is_aligned) +#define __builtin_is_aligned(x, align) \ + (((__uintptr_t)x & ((align) - 1)) == 0) +#endif +#if !__has_builtin(__builtin_align_up) +#define __builtin_align_up(x, align) \ + ((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1)))) +#endif +#if !__has_builtin(__builtin_align_down) +#define __builtin_align_down(x, align) \ + ((__typeof__(x))((x)&(~((align)-1)))) +#endif + +#define __align_up(x, y) __builtin_align_up(x, y) +#define __align_down(x, y) __builtin_align_down(x, y) +#define __is_aligned(x, y) __builtin_is_aligned(x, y) From owner-dev-commits-src-main@freebsd.org Tue Sep 7 12:56:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9371D664361; Tue, 7 Sep 2021 12:56:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ldR3MtBz3lhB; Tue, 7 Sep 2021 12:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F86712C51; Tue, 7 Sep 2021 12:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187CuR9s053215; Tue, 7 Sep 2021 12:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187CuRPG053214; Tue, 7 Sep 2021 12:56:27 GMT (envelope-from git) Date: Tue, 7 Sep 2021 12:56:27 GMT Message-Id: <202109071256.187CuRPG053214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 5fcdc19a8111 - main - wpa: Address CTRL-EVENT-SCAN-FAILED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fcdc19a81115d975e238270754e28557a2fcfc5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 12:56:27 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5fcdc19a81115d975e238270754e28557a2fcfc5 commit 5fcdc19a81115d975e238270754e28557a2fcfc5 Author: Cy Schubert AuthorDate: 2021-09-07 01:48:39 +0000 Commit: Cy Schubert CommitDate: 2021-09-07 12:55:48 +0000 wpa: Address CTRL-EVENT-SCAN-FAILED Some installations may experience CTRL-EVENT-SCAN-FAILED when associating to an AP. Installations that specify ifconfig_wlan0="WPA ... up" in rc.conf do not experience the problem whereas those which specify ifconfig_wlan0="WPA" without the "up" will experience CTRL-EVENT-SCAN_FAILED. However those that specify "up" in ifconfig_wlan0 will be able to reproduce this problem by service netif stop wlan0; service netif start wlan0. Interestingly The service netif stop/start problem is reproducible on the older wpa 2.9 as well. Reported by: dhw Reported by: "Oleg V. Nauman" Reported by: Filipe da Silva Santos Reported by: Jakob Alvermark MFC after: 3 days --- libexec/rc/rc.d/wpa_supplicant | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.d/wpa_supplicant b/libexec/rc/rc.d/wpa_supplicant index 8a86fec90e4d..3c5c9d243f68 100755 --- a/libexec/rc/rc.d/wpa_supplicant +++ b/libexec/rc/rc.d/wpa_supplicant @@ -12,6 +12,7 @@ name="wpa_supplicant" desc="WPA/802.11i Supplicant for wireless network devices" +start_postcmd="wpa_poststart" rcvar= ifn="$2" @@ -27,6 +28,10 @@ is_ndis_interface() esac } +wpa_poststart() { + ifconfig ${ifn} up +} + if is_wired_interface ${ifn} ; then driver="wired" elif is_ndis_interface ${ifn} ; then From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:12:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46AC166679E; Tue, 7 Sep 2021 15:12:25 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pfK1PMtz4tSQ; Tue, 7 Sep 2021 15:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1008914E19; Tue, 7 Sep 2021 15:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FCOcs042267; Tue, 7 Sep 2021 15:12:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FCOlJ042266; Tue, 7 Sep 2021 15:12:24 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:12:24 GMT Message-Id: <202109071512.187FCOlJ042266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: bb25e36e133b - main - pf: remove unused function prototype MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb25e36e133bd723d5c5bdecf9f73452d597e100 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:12:25 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bb25e36e133bd723d5c5bdecf9f73452d597e100 commit bb25e36e133bd723d5c5bdecf9f73452d597e100 Author: Kristof Provost AuthorDate: 2021-09-07 12:33:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-07 14:38:49 +0000 pf: remove unused function prototype MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 90d2a8c6a6b0..5755a2d7e98d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2082,7 +2082,6 @@ int pf_match_tag(struct mbuf *, struct pf_krule *, int *, int); int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); int pf_addr_cmp(struct pf_addr *, struct pf_addr *, sa_family_t); -void pf_qid2qname(u_int32_t, char *); u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); u_int8_t pf_get_wscale(struct mbuf *, int, u_int16_t, sa_family_t); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 709E86667F7; Tue, 7 Sep 2021 15:25:52 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxr2crPz4x4k; Tue, 7 Sep 2021 15:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 360FC15029; Tue, 7 Sep 2021 15:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPq4g055462; Tue, 7 Sep 2021 15:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPqGs055461; Tue, 7 Sep 2021 15:25:52 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:52 GMT Message-Id: <202109071525.187FPqGs055461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c17b531bedd1 - main - sctp: Fix races around sctp_inpcb_free() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c17b531bedd10c7ebea08919fd73ee708ff37336 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:52 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c17b531bedd10c7ebea08919fd73ee708ff37336 commit c17b531bedd10c7ebea08919fd73ee708ff37336 Author: Mark Johnston AuthorDate: 2021-09-07 13:44:12 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 sctp: Fix races around sctp_inpcb_free() sctp_close() and sctp_abort() disassociate the PCB from its socket. As a part of this, they attempt to free the PCB, which may end up lingering. Fix some bugs in this area: - For some reason, sctp_close() and sctp_abort() set SCTP_PCB_FLAGS_SOCKET_GONE using an atomic compare-and-set without the PCB lock held. This is racy since sctp_flags is normally updated without atomics, using the PCB lock to synchronize. So, the update can be lost, which can cause all sort of races with other SCTP components which look for the _GONE flag. Fix the problem simply by acquiring the PCB lock in order to set the flag. Note that we have to drop and re-acquire the lock again in sctp_inpcb_free(), but I don't see a good way around that for now. If it's a real problem, the _GONE flag could be split out of sctp_flags and into a dedicated sctp_inpcb field. - In sctp_inpcb_free(), load sctp_socket after acquiring the PCB lock, to avoid possible races with parallel sctp_inpcb_free() calls. - Add an assertion sctp_inpcb_free() to verify that _ALLGONE is not set. Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31811 --- sys/netinet/sctp_pcb.c | 16 ++++++---------- sys/netinet/sctp_usrreq.c | 31 +++++++++++-------------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 3e517889d171..85ea5a3f8a53 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3321,19 +3321,15 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); SCTP_ITERATOR_UNLOCK(); - so = inp->sctp_socket; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { - /* been here before.. eeks.. get out of here */ - SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 1); -#endif - return; - } + SCTP_ASOC_CREATE_LOCK(inp); SCTP_INP_INFO_WLOCK(); - SCTP_INP_WLOCK(inp); + so = inp->sctp_socket; + KASSERT((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) != 0, + ("%s: inp %p still has socket", __func__, inp)); + KASSERT((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0, + ("%s: double free of inp %p", __func__, inp)); if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 822a8ffb534f..62d6996ab60d 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -416,24 +416,23 @@ sctp_abort(struct socket *so) { struct epoch_tracker et; struct sctp_inpcb *inp; - uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { return; } + SCTP_INP_WLOCK(inp); NET_EPOCH_ENTER(et); -sctp_must_try_again: - flags = inp->sctp_flags; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 17); #endif - if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && - (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { + if (((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0)) { + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 16); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); SOCK_LOCK(so); @@ -448,13 +447,9 @@ sctp_must_try_again: so->so_pcb = NULL; SOCK_UNLOCK(so); } else { - flags = inp->sctp_flags; - if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - goto sctp_must_try_again; - } + SCTP_INP_WUNLOCK(inp); } NET_EPOCH_EXIT(et); - return; } static int @@ -516,7 +511,6 @@ sctp_close(struct socket *so) { struct epoch_tracker et; struct sctp_inpcb *inp; - uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) @@ -525,25 +519,26 @@ sctp_close(struct socket *so) /* * Inform all the lower layer assoc that we are done. */ + SCTP_INP_WLOCK(inp); NET_EPOCH_ENTER(et); -sctp_must_try_again: - flags = inp->sctp_flags; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 17); #endif - if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && - (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP; if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || (so->so_rcv.sb_cc > 0)) { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 13); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); } else { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 14); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); } @@ -563,13 +558,9 @@ sctp_must_try_again: so->so_pcb = NULL; SOCK_UNLOCK(so); } else { - flags = inp->sctp_flags; - if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - goto sctp_must_try_again; - } + SCTP_INP_WUNLOCK(inp); } NET_EPOCH_EXIT(et); - return; } int From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DA5D666C31; Tue, 7 Sep 2021 15:25:53 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxs3j6Cz4x6v; Tue, 7 Sep 2021 15:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EC9414FCD; Tue, 7 Sep 2021 15:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPrOC055486; Tue, 7 Sep 2021 15:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPrrb055485; Tue, 7 Sep 2021 15:25:53 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:53 GMT Message-Id: <202109071525.187FPrrb055485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e8e23ec127d4 - main - sctp: Remove an unused sctp_inpcb field MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8e23ec127d44e04c9be1cba381eaa3aa1041ea5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:53 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e8e23ec127d44e04c9be1cba381eaa3aa1041ea5 commit e8e23ec127d44e04c9be1cba381eaa3aa1041ea5 Author: Mark Johnston AuthorDate: 2021-09-07 13:44:48 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 sctp: Remove an unused sctp_inpcb field This appears to be unused in usrsctp as well. No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31812 --- sys/netinet/sctp_input.c | 1 - sys/netinet/sctp_pcb.h | 1 - sys/netinet/sctp_peeloff.c | 1 - 3 files changed, 3 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 61455e47dd71..77d15dcc955b 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2667,7 +2667,6 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, inp->sctp_context = (*inp_p)->sctp_context; inp->local_strreset_support = (*inp_p)->local_strreset_support; inp->fibnum = (*inp_p)->fibnum; - inp->inp_starting_point_for_iterator = NULL; /* * copy in the authentication parameters from the * original endpoint diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index e14c9f39356c..f93e8f11b3e4 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -395,7 +395,6 @@ struct sctp_inpcb { #ifdef SCTP_TRACK_FREED_ASOCS struct sctpasochead sctp_asoc_free_list; #endif - struct sctp_iterator *inp_starting_point_for_iterator; uint32_t sctp_frag_point; uint32_t partial_delivery_point; uint32_t sctp_context; diff --git a/sys/netinet/sctp_peeloff.c b/sys/netinet/sctp_peeloff.c index 6490fb5596b0..aeff4acb9dae 100644 --- a/sys/netinet/sctp_peeloff.c +++ b/sys/netinet/sctp_peeloff.c @@ -132,7 +132,6 @@ sctp_do_peeloff(struct socket *head, struct socket *so, sctp_assoc_t assoc_id) n_inp->sctp_context = inp->sctp_context; n_inp->max_cwnd = inp->max_cwnd; n_inp->local_strreset_support = inp->local_strreset_support; - n_inp->inp_starting_point_for_iterator = NULL; /* copy in the authentication parameters from the original endpoint */ if (n_inp->sctp_ep.local_hmacs) sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2B72666DE1; Tue, 7 Sep 2021 15:25:54 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxt4Y92z4xJx; Tue, 7 Sep 2021 15:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B08914D4E; Tue, 7 Sep 2021 15:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPs84055517; Tue, 7 Sep 2021 15:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPsIs055516; Tue, 7 Sep 2021 15:25:54 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:54 GMT Message-Id: <202109071525.187FPsIs055516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 173a7a4ee4fa - main - sctp: Fix iterator synchronization in sctp_sendall() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 173a7a4ee4fa8fbce6b4532d4d324bc72ee25fe0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:54 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=173a7a4ee4fa8fbce6b4532d4d324bc72ee25fe0 commit 173a7a4ee4fa8fbce6b4532d4d324bc72ee25fe0 Author: Mark Johnston AuthorDate: 2021-09-07 13:44:57 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 sctp: Fix iterator synchronization in sctp_sendall() - The SCTP_PCB_FLAGS_SND_ITERATOR_UP check was racy, since two threads could observe that the flag is not set and then both set it. I'm not sure if this is actually a problem in practice, i.e., maybe there's no problem having multiple sends for a single PCB in the iterator list? - sctp_sendall() was modifying sctp_flags without the inp lock held. The change simply acquires the PCB write lock before toggling the flag, fixing both problems. Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31813 --- sys/netinet/sctp_output.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index be91084f1287..142c5dbf33b6 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6770,7 +6770,9 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UNUSED) /* now free everything */ if (ca->inp) { /* Lets clear the flag to allow others to run. */ + SCTP_INP_WLOCK(ca->inp); ca->inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(ca->inp); } sctp_m_freem(ca->m); SCTP_FREE(ca, SCTP_M_COPYAL); @@ -6825,10 +6827,6 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, int ret; struct sctp_copy_all *ca; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) { - /* There is another. */ - return (EBUSY); - } if (uio->uio_resid > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { /* You must not be larger than the limit! */ return (EMSGSIZE); @@ -6846,6 +6844,18 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, if (srcv) { memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); } + + /* Serialize. */ + SCTP_INP_WLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) != 0) { + SCTP_INP_WUNLOCK(inp); + sctp_m_freem(m); + SCTP_FREE(ca, SCTP_M_COPYAL); + return (EBUSY); + } + inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); + /* * take off the sendall flag, it would be bad if we failed to do * this :-0 @@ -6857,6 +6867,10 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); + sctp_m_freem(m); + SCTP_INP_WLOCK(inp); + inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -6869,14 +6883,15 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, ca->sndlen += SCTP_BUF_LEN(mat); } } - inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, (void *)ca, 0, sctp_sendall_completes, inp, 1); if (ret) { + SCTP_INP_WLOCK(inp); inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); SCTP_FREE(ca, SCTP_M_COPYAL); SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); return (EFAULT); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33813666DE4; Tue, 7 Sep 2021 15:25:56 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxv6QnZz4xX9; Tue, 7 Sep 2021 15:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C8C214AD9; Tue, 7 Sep 2021 15:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPt3V055541; Tue, 7 Sep 2021 15:25:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPtpc055540; Tue, 7 Sep 2021 15:25:55 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:55 GMT Message-Id: <202109071525.187FPtpc055540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5402baa5b5d1 - main - g_label: Handle small sector sizes when tasting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5402baa5b5d14819101e1e847df66b02cedf1639 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:56 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5402baa5b5d14819101e1e847df66b02cedf1639 commit 5402baa5b5d14819101e1e847df66b02cedf1639 Author: Mark Johnston AuthorDate: 2021-09-07 13:46:58 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 g_label: Handle small sector sizes when tasting Make sure that the provider sector size is large enough to contain a valid label before trying to read it. We performed this check already for most label types, but not for several filesystem labels. Reported by: syzbot+f52918174cdf193ae29c@syzkaller.appspotmail.com MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/geom/label/g_label.c | 2 ++ sys/geom/label/g_label_ext2fs.c | 4 +++- sys/geom/label/g_label_iso9660.c | 5 +++-- sys/geom/label/g_label_ntfs.c | 6 +++++- sys/geom/label/g_label_reiserfs.c | 4 +++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index 026f5318b4ed..1df7e799b014 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -310,6 +310,8 @@ g_label_read_metadata(struct g_consumer *cp, struct g_label_metadata *md) int error; pp = cp->provider; + if (pp->sectorsize < sizeof(*md)) + return (EINVAL); buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, &error); if (buf == NULL) diff --git a/sys/geom/label/g_label_ext2fs.c b/sys/geom/label/g_label_ext2fs.c index 2003d9b631f6..3420efb7ca3a 100644 --- a/sys/geom/label/g_label_ext2fs.c +++ b/sys/geom/label/g_label_ext2fs.c @@ -64,8 +64,10 @@ g_label_ext2fs_taste(struct g_consumer *cp, char *label, size_t size) if ((EXT2FS_SB_OFFSET % pp->sectorsize) != 0) return; + if (pp->sectorsize < sizeof(*fs)) + return; - fs = (e2sb_t *)g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); + fs = g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); if (fs == NULL) return; diff --git a/sys/geom/label/g_label_iso9660.c b/sys/geom/label/g_label_iso9660.c index bd44a38cb972..b46a47bbd36a 100644 --- a/sys/geom/label/g_label_iso9660.c +++ b/sys/geom/label/g_label_iso9660.c @@ -54,8 +54,9 @@ g_label_iso9660_taste(struct g_consumer *cp, char *label, size_t size) if ((ISO9660_OFFSET % pp->sectorsize) != 0) return; - sector = (char *)g_read_data(cp, ISO9660_OFFSET, pp->sectorsize, - NULL); + if (pp->sectorsize < 0x28 + VOLUME_LEN) + return; + sector = g_read_data(cp, ISO9660_OFFSET, pp->sectorsize, NULL); if (sector == NULL) return; if (bcmp(sector, ISO9660_MAGIC, sizeof(ISO9660_MAGIC) - 1) != 0) { diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index dee105bcc833..f78d4d28b967 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -108,9 +108,13 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) label[0] = '\0'; pp = cp->provider; + bf = NULL; filerecp = NULL; - bf = (struct ntfs_bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); + if (pp->sectorsize < sizeof(*bf)) + goto done; + + bf = g_read_data(cp, 0, pp->sectorsize, NULL); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; diff --git a/sys/geom/label/g_label_reiserfs.c b/sys/geom/label/g_label_reiserfs.c index 4ed04f632324..d6f9a0428b6a 100644 --- a/sys/geom/label/g_label_reiserfs.c +++ b/sys/geom/label/g_label_reiserfs.c @@ -61,8 +61,10 @@ g_label_reiserfs_read_super(struct g_consumer *cp, off_t offset) if ((offset % secsize) != 0) return (NULL); + if (secsize < sizeof(*fs)) + return (NULL); - fs = (reiserfs_sb_t *)g_read_data(cp, offset, secsize, NULL); + fs = g_read_data(cp, offset, secsize, NULL); if (fs == NULL) return (NULL); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E5A2666EB1; Tue, 7 Sep 2021 15:25:57 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxw697Zz4xK6; Tue, 7 Sep 2021 15:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2FA814FCE; Tue, 7 Sep 2021 15:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPusF055565; Tue, 7 Sep 2021 15:25:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPu25055564; Tue, 7 Sep 2021 15:25:56 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:56 GMT Message-Id: <202109071525.187FPu25055564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9a94097cd0f4 - main - nd6: Make the DAD callout MPSAFE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a94097cd0f46aacf688973d15b3b462c79f0008 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:57 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9a94097cd0f46aacf688973d15b3b462c79f0008 commit 9a94097cd0f46aacf688973d15b3b462c79f0008 Author: Mark Johnston AuthorDate: 2021-09-07 13:49:47 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 nd6: Make the DAD callout MPSAFE Interface addresses with pending duplicate address detection (DAD) live in a global queue. In this case, a callout is associated with each entry. The callout transmits neighbour solicitations until the system decides the address is no longer tentative, or until a duplicate address is discovered. At this point the entry is dequeued and freed. DAD may be manually stopped as well. The callout currently runs (and potentially transmits packets) with Giant held. Reorganize DAD queue locking to interlock properly with the callout: - Configure the callout to acquire the DAD queue lock before running. The lock is dropped before transmitting any packets. Stop protecting the callout with Giant. - When looking up DAD queue entries for an incoming NS or NA, don't bother fiddling with the DAD queue entry reference count. - Split nd6_dad_starttimer() so that the caller is responsible to transmitting a NS if it so desires. - Remove the DAD entry from the queue before stopping the timer. Use a temporary reference to make sure that the entry doesn't get freed by the callout while we're draining. Reported by: mav Reviewed by: bz, hrs Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31826 --- sys/netinet6/nd6_nbr.c | 116 +++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 30d73f9d71a9..2100700733ad 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -84,9 +84,9 @@ static struct dadq *nd6_dad_find(struct ifaddr *, struct nd_opt_nonce *); static void nd6_dad_add(struct dadq *dp); static void nd6_dad_del(struct dadq *dp); static void nd6_dad_rele(struct dadq *); -static void nd6_dad_starttimer(struct dadq *, int, int); +static void nd6_dad_starttimer(struct dadq *, int); static void nd6_dad_stoptimer(struct dadq *); -static void nd6_dad_timer(struct dadq *); +static void nd6_dad_timer(void *); static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); static void nd6_dad_ns_output(struct dadq *); static void nd6_dad_ns_input(struct ifaddr *, struct nd_opt_nonce *); @@ -1135,26 +1135,31 @@ VNET_DEFINE_STATIC(struct rwlock, dad_rwlock); #define V_dadq VNET(dadq) #define V_dad_rwlock VNET(dad_rwlock) -#define DADQ_RLOCK() rw_rlock(&V_dad_rwlock) -#define DADQ_RUNLOCK() rw_runlock(&V_dad_rwlock) -#define DADQ_WLOCK() rw_wlock(&V_dad_rwlock) -#define DADQ_WUNLOCK() rw_wunlock(&V_dad_rwlock) +#define DADQ_LOCKPTR() (&V_dad_rwlock) +#define DADQ_LOCK_INIT() rw_init(DADQ_LOCKPTR(), "nd6 DAD queue") +#define DADQ_RLOCK() rw_rlock(DADQ_LOCKPTR()) +#define DADQ_RUNLOCK() rw_runlock(DADQ_LOCKPTR()) +#define DADQ_WLOCK() rw_wlock(DADQ_LOCKPTR()) +#define DADQ_WUNLOCK() rw_wunlock(DADQ_LOCKPTR()) + +#define DADQ_LOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_LOCKED); +#define DADQ_RLOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_RLOCKED); +#define DADQ_WLOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_WLOCKED); static void nd6_dad_add(struct dadq *dp) { + DADQ_WLOCK_ASSERT(); - DADQ_WLOCK(); TAILQ_INSERT_TAIL(&V_dadq, dp, dad_list); dp->dad_ondadq = true; - DADQ_WUNLOCK(); } static void nd6_dad_del(struct dadq *dp) { + DADQ_WLOCK_ASSERT(); - DADQ_WLOCK(); if (dp->dad_ondadq) { /* * Remove dp from the dadq and release the dadq's @@ -1162,10 +1167,8 @@ nd6_dad_del(struct dadq *dp) */ TAILQ_REMOVE(&V_dadq, dp, dad_list); dp->dad_ondadq = false; - DADQ_WUNLOCK(); nd6_dad_rele(dp); - } else - DADQ_WUNLOCK(); + } } static struct dadq * @@ -1173,10 +1176,12 @@ nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) { struct dadq *dp; - DADQ_RLOCK(); + DADQ_LOCK_ASSERT(); + TAILQ_FOREACH(dp, &V_dadq, dad_list) { if (dp->dad_ifa != ifa) continue; + /* * Skip if the nonce matches the received one. * +2 in the length is required because of type and @@ -1185,42 +1190,35 @@ nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) if (n != NULL && n->nd_opt_nonce_len == (ND_OPT_NONCE_LEN + 2) / 8 && memcmp(&n->nd_opt_nonce[0], &dp->dad_nonce[0], - ND_OPT_NONCE_LEN) == 0) { + ND_OPT_NONCE_LEN) == 0) { dp->dad_ns_lcount++; continue; } - refcount_acquire(&dp->dad_refcnt); break; } - DADQ_RUNLOCK(); return (dp); } static void -nd6_dad_starttimer(struct dadq *dp, int ticks, int send_ns) +nd6_dad_starttimer(struct dadq *dp, int ticks) { + DADQ_WLOCK_ASSERT(); - NET_EPOCH_ASSERT(); - - if (send_ns != 0) - nd6_dad_ns_output(dp); - callout_reset(&dp->dad_timer_ch, ticks, - (void (*)(void *))nd6_dad_timer, (void *)dp); + callout_reset(&dp->dad_timer_ch, ticks, nd6_dad_timer, dp); } static void nd6_dad_stoptimer(struct dadq *dp) { - callout_drain(&dp->dad_timer_ch); } static void nd6_dad_rele(struct dadq *dp) { - if (refcount_release(&dp->dad_refcnt)) { + KASSERT(!dp->dad_ondadq, ("dp %p still on DAD queue", dp)); ifa_free(dp->dad_ifa); free(dp, M_IP6NDP); } @@ -1229,8 +1227,7 @@ nd6_dad_rele(struct dadq *dp) void nd6_dad_init(void) { - - rw_init(&V_dad_rwlock, "nd6 DAD queue"); + DADQ_LOCK_INIT(); TAILQ_INIT(&V_dadq); } @@ -1243,7 +1240,6 @@ nd6_dad_start(struct ifaddr *ifa, int delay) struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - struct epoch_tracker et; KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0, ("starting DAD on non-tentative address %p", ifa)); @@ -1265,12 +1261,13 @@ nd6_dad_start(struct ifaddr *ifa, int delay) (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED) != 0) return; + DADQ_WLOCK(); if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* * DAD is already in progress. Let the existing entry * finish it. */ - nd6_dad_rele(dp); + DADQ_WUNLOCK(); return; } @@ -1282,7 +1279,8 @@ nd6_dad_start(struct ifaddr *ifa, int delay) ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); return; } - callout_init(&dp->dad_timer_ch, 0); + callout_init_rw(&dp->dad_timer_ch, DADQ_LOCKPTR(), + CALLOUT_RETURNUNLOCKED); #ifdef VIMAGE dp->dad_vnet = curvnet; #endif @@ -1305,9 +1303,8 @@ nd6_dad_start(struct ifaddr *ifa, int delay) /* Add this to the dadq and add a reference for the dadq. */ refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); - NET_EPOCH_ENTER(et); - nd6_dad_starttimer(dp, delay, 0); - NET_EPOCH_EXIT(et); + nd6_dad_starttimer(dp, delay); + DADQ_WUNLOCK(); } /* @@ -1318,29 +1315,36 @@ nd6_dad_stop(struct ifaddr *ifa) { struct dadq *dp; + DADQ_WLOCK(); dp = nd6_dad_find(ifa, NULL); - if (!dp) { + if (dp == NULL) { + DADQ_WUNLOCK(); /* DAD wasn't started yet */ return; } - nd6_dad_stoptimer(dp); + /* + * Acquire a temporary reference so that we can safely stop the callout. + */ + (void)refcount_acquire(&dp->dad_refcnt); nd6_dad_del(dp); + DADQ_WUNLOCK(); - /* Release this function's reference, acquired by nd6_dad_find(). */ + nd6_dad_stoptimer(dp); nd6_dad_rele(dp); } static void -nd6_dad_timer(struct dadq *dp) +nd6_dad_timer(void *arg) { - CURVNET_SET(dp->dad_vnet); + struct dadq *dp = arg; struct ifaddr *ifa = dp->dad_ifa; struct ifnet *ifp = dp->dad_ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; char ip6buf[INET6_ADDRSTRLEN]; struct epoch_tracker et; + CURVNET_SET(dp->dad_vnet); KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); NET_EPOCH_ENTER(et); @@ -1381,17 +1385,18 @@ nd6_dad_timer(struct dadq *dp) * We have more NS to go. Send NS packet for DAD. */ nd6_dad_starttimer(dp, - (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000, 1); + (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000); + nd6_dad_ns_output(dp); goto done; } else { /* * We have transmitted sufficient number of DAD packets. * See what we've got. */ - if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) + if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) { /* We've seen NS or NA, means DAD has failed. */ nd6_dad_duplicated(ifa, dp); - else if (V_dad_enhanced != 0 && + } else if (V_dad_enhanced != 0 && dp->dad_ns_lcount > 0 && dp->dad_ns_lcount > dp->dad_loopbackprobe) { /* @@ -1412,8 +1417,8 @@ nd6_dad_timer(struct dadq *dp) dp->dad_count = dp->dad_ns_ocount + V_nd6_mmaxtries - 1; nd6_dad_starttimer(dp, - (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000, - 1); + (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000); + nd6_dad_ns_output(dp); goto done; } else { /* @@ -1439,6 +1444,7 @@ nd6_dad_timer(struct dadq *dp) } err: nd6_dad_del(dp); + DADQ_WUNLOCK(); done: NET_EPOCH_EXIT(et); CURVNET_RESTORE(); @@ -1498,6 +1504,10 @@ nd6_dad_duplicated(struct ifaddr *ifa, struct dadq *dp) } } +/* + * Transmit a neighbour solicitation for the purpose of DAD. Returns with the + * DAD queue unlocked. + */ static void nd6_dad_ns_output(struct dadq *dp) { @@ -1505,11 +1515,15 @@ nd6_dad_ns_output(struct dadq *dp) struct ifnet *ifp = dp->dad_ifa->ifa_ifp; int i; + DADQ_WLOCK_ASSERT(); + dp->dad_ns_tcount++; if ((ifp->if_flags & IFF_UP) == 0) { + DADQ_WUNLOCK(); return; } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + DADQ_WUNLOCK(); return; } @@ -1526,6 +1540,7 @@ nd6_dad_ns_output(struct dadq *dp) * should work well in almost all cases. */ } + DADQ_WUNLOCK(); nd6_ns_output(ifp, NULL, NULL, &ia->ia_addr.sin6_addr, (uint8_t *)&dp->dad_nonce[0]); } @@ -1541,12 +1556,11 @@ nd6_dad_ns_input(struct ifaddr *ifa, struct nd_opt_nonce *ndopt_nonce) /* Ignore Nonce option when Enhanced DAD is disabled. */ if (V_dad_enhanced == 0) ndopt_nonce = NULL; + DADQ_RLOCK(); dp = nd6_dad_find(ifa, ndopt_nonce); - if (dp == NULL) - return; - - dp->dad_ns_icount++; - nd6_dad_rele(dp); + if (dp != NULL) + dp->dad_ns_icount++; + DADQ_RUNLOCK(); } static void @@ -1557,9 +1571,9 @@ nd6_dad_na_input(struct ifaddr *ifa) if (ifa == NULL) panic("ifa == NULL in nd6_dad_na_input"); + DADQ_RLOCK(); dp = nd6_dad_find(ifa, NULL); - if (dp != NULL) { + if (dp != NULL) dp->dad_na_icount++; - nd6_dad_rele(dp); - } + DADQ_RUNLOCK(); } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25170666CED; Tue, 7 Sep 2021 15:25:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxy049sz4xXN; Tue, 7 Sep 2021 15:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2EA414D4F; Tue, 7 Sep 2021 15:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPvq7055589; Tue, 7 Sep 2021 15:25:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPvg8055588; Tue, 7 Sep 2021 15:25:57 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:57 GMT Message-Id: <202109071525.187FPvg8055588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: eec892a8458b - main - efirt: Mark buffers filled out by EFI firmware as initialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eec892a8458b748bfd5273c7c675d73ef1805823 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:58 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eec892a8458b748bfd5273c7c675d73ef1805823 commit eec892a8458b748bfd5273c7c675d73ef1805823 Author: Mark Johnston AuthorDate: 2021-09-07 14:07:04 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 efirt: Mark buffers filled out by EFI firmware as initialized Otherwise KMSAN may report false positives. Sponsored by: The FreeBSD Foundation --- sys/dev/efidev/efirt.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 9ba0508f1902..387cde5be331 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -533,6 +534,7 @@ static int efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) { struct efirt_callinfo ec; + int error; EFI_TIME_OWNED(); if (efi_runtime == NULL) @@ -543,7 +545,10 @@ efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) ec.ec_arg1 = (uintptr_t)tm; ec.ec_arg2 = (uintptr_t)tmcap; ec.ec_fptr = EFI_RT_METHOD_PA(rt_gettime); - return (efi_call(&ec)); + error = efi_call(&ec); + if (error == 0) + kmsan_mark(tm, sizeof(*tm), KMSAN_STATE_INITED); + return (error); } static int @@ -640,6 +645,7 @@ var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib, size_t *datasize, void *data) { struct efirt_callinfo ec; + int error; if (efi_runtime == NULL) return (ENXIO); @@ -652,13 +658,17 @@ var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib, ec.ec_arg4 = (uintptr_t)datasize; ec.ec_arg5 = (uintptr_t)data; ec.ec_fptr = EFI_RT_METHOD_PA(rt_getvar); - return (efi_call(&ec)); + error = efi_call(&ec); + if (error == 0) + kmsan_mark(data, *datasize, KMSAN_STATE_INITED); + return (error); } static int var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor) { struct efirt_callinfo ec; + int error; if (efi_runtime == NULL) return (ENXIO); @@ -669,7 +679,10 @@ var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor) ec.ec_arg2 = (uintptr_t)name; ec.ec_arg3 = (uintptr_t)vendor; ec.ec_fptr = EFI_RT_METHOD_PA(rt_scanvar); - return (efi_call(&ec)); + error = efi_call(&ec); + if (error == 0) + kmsan_mark(name, *namesize, KMSAN_STATE_INITED); + return (error); } static int From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:25:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C178666F80; Tue, 7 Sep 2021 15:25:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3pxz206Fz4xTx; Tue, 7 Sep 2021 15:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1029B14D50; Tue, 7 Sep 2021 15:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FPwq8055613; Tue, 7 Sep 2021 15:25:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FPw7X055612; Tue, 7 Sep 2021 15:25:58 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:25:58 GMT Message-Id: <202109071525.187FPw7X055612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 353783964c60 - main - ip6mrouter: Make the expiration callout MPSAFE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 353783964c605e9cd71f359444c1230226d5782f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:25:59 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=353783964c605e9cd71f359444c1230226d5782f commit 353783964c605e9cd71f359444c1230226d5782f Author: Mark Johnston AuthorDate: 2021-09-07 15:15:49 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 ip6mrouter: Make the expiration callout MPSAFE - Protect the `expire_upcalls` callout with the MFC6 mutex. The callout handler needs this mutex anyway. - Convert the MROUTER6 mutex to a sleepable sx lock. It is only used when configuring the global v6 multicast routing socket, so is only used in system call paths where sleeping is safe. This lets us drain the callout without having to drop the lock. - For all locking macros in the file, convert to using a _LOCKPTR macro. Reported by: mav MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31836 --- sys/netinet6/ip6_mroute.c | 56 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 503c83490940..087e0c5059fd 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -167,16 +167,13 @@ SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 -static struct mtx mrouter6_mtx; -#define MROUTER6_LOCK() mtx_lock(&mrouter6_mtx) -#define MROUTER6_UNLOCK() mtx_unlock(&mrouter6_mtx) -#define MROUTER6_LOCK_ASSERT() do { \ - mtx_assert(&mrouter6_mtx, MA_OWNED); \ - NET_ASSERT_GIANT(); \ -} while (0) -#define MROUTER6_LOCK_INIT() \ - mtx_init(&mrouter6_mtx, "IPv6 multicast forwarding", NULL, MTX_DEF) -#define MROUTER6_LOCK_DESTROY() mtx_destroy(&mrouter6_mtx) +static struct sx mrouter6_mtx; +#define MROUTER6_LOCKPTR() (&mrouter6_mtx) +#define MROUTER6_LOCK() sx_xlock(MROUTER6_LOCKPTR()) +#define MROUTER6_UNLOCK() sx_xunlock(MROUTER6_LOCKPTR()) +#define MROUTER6_LOCK_ASSERT() sx_assert(MROUTER6_LOCKPTR(), SA_XLOCKED +#define MROUTER6_LOCK_INIT() sx_init(MROUTER6_LOCKPTR(), "mrouter6") +#define MROUTER6_LOCK_DESTROY() sx_destroy(MROUTER6_LOCKPTR()) static struct mf6c *mf6ctable[MF6CTBLSIZ]; SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, @@ -185,15 +182,14 @@ SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, "netinet6/ip6_mroute.h)"); static struct mtx mfc6_mtx; -#define MFC6_LOCK() mtx_lock(&mfc6_mtx) -#define MFC6_UNLOCK() mtx_unlock(&mfc6_mtx) -#define MFC6_LOCK_ASSERT() do { \ - mtx_assert(&mfc6_mtx, MA_OWNED); \ - NET_ASSERT_GIANT(); \ -} while (0) -#define MFC6_LOCK_INIT() \ - mtx_init(&mfc6_mtx, "IPv6 multicast forwarding cache", NULL, MTX_DEF) -#define MFC6_LOCK_DESTROY() mtx_destroy(&mfc6_mtx) +#define MFC6_LOCKPTR() (&mfc6_mtx) +#define MFC6_LOCK() mtx_lock(MFC6_LOCKPTR()) +#define MFC6_UNLOCK() mtx_unlock(MFC6_LOCKPTR()) +#define MFC6_LOCK_ASSERT() mtx_assert(MFC6_LOCKPTR(), MA_OWNED) +#define MFC6_LOCK_INIT() mtx_init(MFC6_LOCKPTR(), \ + "IPv6 multicast forwarding cache", \ + NULL, MTX_DEF) +#define MFC6_LOCK_DESTROY() mtx_destroy(MFC6_LOCKPTR()) static u_char n6expire[MF6CTBLSIZ]; @@ -230,12 +226,13 @@ SYSCTL_PROC(_net_inet6_ip6, OID_AUTO, mif6table, "netinet6/ip6_mroute.h)"); static struct mtx mif6_mtx; -#define MIF6_LOCK() mtx_lock(&mif6_mtx) -#define MIF6_UNLOCK() mtx_unlock(&mif6_mtx) -#define MIF6_LOCK_ASSERT() mtx_assert(&mif6_mtx, MA_OWNED) +#define MIF6_LOCKPTR() (&mif6_mtx) +#define MIF6_LOCK() mtx_lock(MIF6_LOCKPTR()) +#define MIF6_UNLOCK() mtx_unlock(MIF6_LOCKPTR()) +#define MIF6_LOCK_ASSERT() mtx_assert(MIF6_LOCKPTR(), MA_OWNED) #define MIF6_LOCK_INIT() \ - mtx_init(&mif6_mtx, "IPv6 multicast interfaces", NULL, MTX_DEF) -#define MIF6_LOCK_DESTROY() mtx_destroy(&mif6_mtx) + mtx_init(MIF6_LOCKPTR(), "IPv6 multicast interfaces", NULL, MTX_DEF) +#define MIF6_LOCK_DESTROY() mtx_destroy(MIF6_LOCKPTR()) #ifdef MRT6DEBUG VNET_DEFINE_STATIC(u_int, mrt6debug) = 0; /* debug level */ @@ -583,11 +580,12 @@ ip6_mrouter_init(struct socket *so, int v, int cmd) V_pim6 = 0;/* used for stubbing out/in pim stuff */ - callout_init(&expire_upcalls_ch, 0); + callout_init_mtx(&expire_upcalls_ch, MFC6_LOCKPTR(), 0); callout_reset(&expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, NULL); MROUTER6_UNLOCK(); + MRT6_DLOG(DEBUG_ANY, "finished"); return (0); @@ -626,8 +624,6 @@ X_ip6_mrouter_done(void) V_pim6 = 0; /* used to stub out/in pim specific code */ - callout_stop(&expire_upcalls_ch); - /* * Free all multicast forwarding cache entries. */ @@ -652,6 +648,8 @@ X_ip6_mrouter_done(void) bzero((caddr_t)mf6ctable, sizeof(mf6ctable)); MFC6_UNLOCK(); + callout_drain(&expire_upcalls_ch); + /* * Reset register interface */ @@ -1315,7 +1313,8 @@ expire_upcalls(void *unused) struct mf6c *mfc, **nptr; u_long i; - MFC6_LOCK(); + MFC6_LOCK_ASSERT(); + for (i = 0; i < MF6CTBLSIZ; i++) { if (n6expire[i] == 0) continue; @@ -1353,7 +1352,6 @@ expire_upcalls(void *unused) } } } - MFC6_UNLOCK(); callout_reset(&expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, NULL); } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:26:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD427666C45; Tue, 7 Sep 2021 15:26:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3py139znz4xMM; Tue, 7 Sep 2021 15:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4636914D52; Tue, 7 Sep 2021 15:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FQ1dV055667; Tue, 7 Sep 2021 15:26:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FQ1mo055666; Tue, 7 Sep 2021 15:26:01 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:26:01 GMT Message-Id: <202109071526.187FQ1mo055666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 13d9437a6074 - main - dtrace.1: Document -x ldpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d9437a6074b02770546d1ec329b306e1a0f30e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:26:01 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=13d9437a6074b02770546d1ec329b306e1a0f30e commit 13d9437a6074b02770546d1ec329b306e1a0f30e Author: Mark Johnston AuthorDate: 2021-09-07 15:18:28 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 dtrace.1: Document -x ldpath MFC after: 1 week Sponsored by: The FreeBSD Foundation --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index c91dfc8270bb..8112fa7da4dc 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2021 +.Dd September 7, 2021 .Dt DTRACE 1 .Os .Sh NAME @@ -602,6 +602,14 @@ Number of default stack frames for .It Sy jstackstrsize Ns = Ns Ar scalar Default string space size for .Fn jstack . +.It Sy ldpath Ns = Ns Ar path +When +.Fl G +is specified, use the specified path for a static linker +rather than searching for +.Dq "ld" +in +.Ev PATH . .It Sy libdir Ns = Ns Ar path Add a directory to the system library path. .It Sy nspec Ns = Ns Ar scalar From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:26:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8B13666ED8; Tue, 7 Sep 2021 15:26:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3py02ZBPz4xKL; Tue, 7 Sep 2021 15:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A5AF14D51; Tue, 7 Sep 2021 15:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FQ0lD055643; Tue, 7 Sep 2021 15:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FQ0nU055642; Tue, 7 Sep 2021 15:26:00 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:26:00 GMT Message-Id: <202109071526.187FQ0nU055642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f756c911681d - main - kqueue.2: Document the fact that EVFILT_READ can be used on kqueues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f756c911681d7730ca34c23b69dbdb6143965858 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:26:00 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f756c911681d7730ca34c23b69dbdb6143965858 commit f756c911681d7730ca34c23b69dbdb6143965858 Author: Mark Johnston AuthorDate: 2021-09-07 15:17:33 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 15:19:29 +0000 kqueue.2: Document the fact that EVFILT_READ can be used on kqueues Reviewed by: bcr, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31864 --- lib/libc/sys/kqueue.2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 9be380bb5d99..ed737c626ef8 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2021 +.Dd September 7, 2021 .Dt KQUEUE 2 .Os .Sh NAME @@ -346,6 +346,10 @@ Returns when the counter is greater than 0; .Va data contains the counter value, which must be cast to .Vt uint64_t . +.It Kqueues +Returns when pending events are present on the queue; +.Va data +contains the number of events available. .El .It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever From owner-dev-commits-src-main@freebsd.org Tue Sep 7 15:55:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C39B6679AF; Tue, 7 Sep 2021 15:55:34 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3qc632GKz56wB; Tue, 7 Sep 2021 15:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49A7415761; Tue, 7 Sep 2021 15:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187FtYW3095408; Tue, 7 Sep 2021 15:55:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187FtYfA095407; Tue, 7 Sep 2021 15:55:34 GMT (envelope-from git) Date: Tue, 7 Sep 2021 15:55:34 GMT Message-Id: <202109071555.187FtYfA095407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1e7b5f950b2d - main - cdefs.h: Remove redundant #ifdefs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e7b5f950b2d54ddb257d008592563c4d753aa54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 15:55:34 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e7b5f950b2d54ddb257d008592563c4d753aa54 commit 1e7b5f950b2d54ddb257d008592563c4d753aa54 Author: Warner Losh AuthorDate: 2021-09-07 15:34:02 +0000 Commit: Warner Losh CommitDate: 2021-09-07 15:51:48 +0000 cdefs.h: Remove redundant #ifdefs Remove redunant #ifdef __GNUC__ inside an #if defined(__GNUC__) block. They are nops. Sponsored by: Netflix --- sys/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 4db720d08b9f..2295dd39f5ad 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -96,16 +96,12 @@ #define __GNUCLIKE_BUILTIN_VAALIST 1 #endif -#if defined(__GNUC__) #define __GNUC_VA_LIST_COMPATIBILITY 1 -#endif /* * Compiler memory barriers, specific to gcc and clang. */ -#if defined(__GNUC__) #define __compiler_membar() __asm __volatile(" " : : : "memory") -#endif #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 #define __GNUCLIKE_MATH_BUILTIN_RELOPS From owner-dev-commits-src-main@freebsd.org Tue Sep 7 16:12:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA1C46682B8; Tue, 7 Sep 2021 16:12:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3r0B4KXwz3Dl9; Tue, 7 Sep 2021 16:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 758D015864; Tue, 7 Sep 2021 16:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187GCwq8022268; Tue, 7 Sep 2021 16:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187GCwF4022267; Tue, 7 Sep 2021 16:12:58 GMT (envelope-from git) Date: Tue, 7 Sep 2021 16:12:58 GMT Message-Id: <202109071612.187GCwF4022267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ecfbb2e30241 - main - genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecfbb2e30241ee460617ad4e0c0be16d9930945a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 16:12:58 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfbb2e30241ee460617ad4e0c0be16d9930945a commit ecfbb2e30241ee460617ad4e0c0be16d9930945a Author: Warner Losh AuthorDate: 2021-09-07 16:08:51 +0000 Commit: Warner Losh CommitDate: 2021-09-07 16:08:51 +0000 genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations Linux fails to build now because the mkdtemp in the bootstrapped environment wants 6 or more X's. Use 10 out of an abundance of caution. Sponsored by: Netflix Reviewed by: arichards Differential Revision: https://reviews.freebsd.org/D31863 --- sys/kern/genoffset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/genoffset.sh b/sys/kern/genoffset.sh index f7185e7ae396..aedccfd84c6e 100644 --- a/sys/kern/genoffset.sh +++ b/sys/kern/genoffset.sh @@ -42,7 +42,7 @@ work() echo "#define _OFFSET_INC_" echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))" last= - temp=$(mktemp -d genoffset.XXXXX) + temp=$(mktemp -d genoffset.XXXXXXXXXX) trap "rm -rf ${temp}" EXIT # Note: we need to print symbol values in decimal so the numeric sort works ${NM:='nm'} ${NMFLAGS} -t d "$1" | grep __assym_offset__ | sed -e 's/__/ /g' | sort -k 4 -k 1 -n | From owner-dev-commits-src-main@freebsd.org Tue Sep 7 16:29:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3A09668575; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3rLx5VR2z3Hbd; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CBFD1565C; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187GTDEc037002; Tue, 7 Sep 2021 16:29:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187GTDls037001; Tue, 7 Sep 2021 16:29:13 GMT (envelope-from git) Date: Tue, 7 Sep 2021 16:29:13 GMT Message-Id: <202109071629.187GTDls037001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 85bea309f935 - main - mprotect.2: Improve the description of prot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85bea309f935111cb362035795a59c263536b065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 16:29:13 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=85bea309f935111cb362035795a59c263536b065 commit 85bea309f935111cb362035795a59c263536b065 Author: Brooks Davis AuthorDate: 2021-09-07 16:28:50 +0000 Commit: Brooks Davis CommitDate: 2021-09-07 16:28:50 +0000 mprotect.2: Improve the description of prot The new wording for standard flags is losely based on the POSIX description. Make it clearer that PROT_MAX() is a local extension. Reviewed by: alc, mckusick, imp, kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D31777 --- lib/libc/sys/mprotect.2 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2 index 5c024dd24d56..c2c7701d624e 100644 --- a/lib/libc/sys/mprotect.2 +++ b/lib/libc/sys/mprotect.2 @@ -28,7 +28,7 @@ .\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 3, 2021 +.Dd September 7, 2021 .Dt MPROTECT 2 .Os .Sh NAME @@ -47,12 +47,16 @@ system call changes the specified pages to have protection .Fa prot . .Pp -Currently these protection bits are known, -which can be combined, OR'd together: +The +.Fa prot +argument shall be +.Dv PROT_NONE +(no permissions at all) +or the bitwise +.Em or +of one or more of the following values: .Pp .Bl -tag -width ".Dv PROT_WRITE" -compact -.It Dv PROT_NONE -No permissions at all. .It Dv PROT_READ The pages can be read. .It Dv PROT_WRITE @@ -61,13 +65,16 @@ The pages can be written. The pages can be executed. .El .Pp -In addition to these protection flags, +In addition to these standard protection flags, +the .Fx +implementation of +.Fn mprotect provides the ability to set the maximum protection of a region (which prevents .Nm -from upgrading the permissions). -This is accomplished by +from adding to the permissions later). +This is accomplished by bitwise .Em or Ns 'ing one or more .Dv PROT_ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 18:05:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1DE76698C1; Tue, 7 Sep 2021 18:05:44 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3tVJ4fy4z4b9f; Tue, 7 Sep 2021 18:05:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 802F116EDB; Tue, 7 Sep 2021 18:05:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187I5iUN070528; Tue, 7 Sep 2021 18:05:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187I5iRA070527; Tue, 7 Sep 2021 18:05:44 GMT (envelope-from git) Date: Tue, 7 Sep 2021 18:05:44 GMT Message-Id: <202109071805.187I5iRA070527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a40c4ae86677 - main - dtrace.1: Document a couple of preprocessor-related options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a40c4ae8667772d7e4c4c3d8d8ae843e63c05019 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 18:05:44 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a40c4ae8667772d7e4c4c3d8d8ae843e63c05019 commit a40c4ae8667772d7e4c4c3d8d8ae843e63c05019 Author: Mark Johnston AuthorDate: 2021-09-07 18:03:23 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 18:04:50 +0000 dtrace.1: Document a couple of preprocessor-related options Suggested by: swills MFC after: 1 week Sponsored by: The FreeBSD Foundation --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 8112fa7da4dc..8724b27f4cbb 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -577,6 +577,17 @@ Must be specified in number-per-second with the suffix. .It Sy cpu Ns = Ns Ar scalar Specifies the CPU on which to enable tracing. +.It Sy cpp +Run a C preprocessor over input files. +Same as the +.Fl C +flag. +.It Sy cpppath Ns = Ns Ar path +Use the specified path for the C preprocessor rather than +searching for +.Dq cpp +in +.Ev PATH . .It Sy defaultargs Allow references to unspecified macro arguments. .It Sy destructive From owner-dev-commits-src-main@freebsd.org Tue Sep 7 18:05:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11F476698C4; Tue, 7 Sep 2021 18:05:46 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3tVK6nllz4b5c; Tue, 7 Sep 2021 18:05:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A473C1712E; Tue, 7 Sep 2021 18:05:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187I5jOO070555; Tue, 7 Sep 2021 18:05:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187I5jC0070554; Tue, 7 Sep 2021 18:05:45 GMT (envelope-from git) Date: Tue, 7 Sep 2021 18:05:45 GMT Message-Id: <202109071805.187I5jC0070554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 686aa9287c6b - main - swap_pager: Handle large swap_pager_reserve() requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 686aa9287c6b3658daa2ca0ef1917f2e70a6c07e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 18:05:46 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=686aa9287c6b3658daa2ca0ef1917f2e70a6c07e commit 686aa9287c6b3658daa2ca0ef1917f2e70a6c07e Author: Mark Johnston AuthorDate: 2021-09-07 18:03:52 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 18:04:50 +0000 swap_pager: Handle large swap_pager_reserve() requests This interface is used solely by md(4) when the MD_RESERVE flag is specified, as in `mdconfig -a -t swap -s 1G -o reserve`. It pre-allocates swap blocks for the entire object. The number of blocks to be reserved is specified as a vm_size_t, but swp_pager_getswapspace() can allocate at most INT_MAX blocks. vm_size_t also seems like the incorrect type to use here it refers only to the size of the VM object, not the size of a mapping. So: - change the type of "size" in swap_pager_reserve() to vm_pindex_t, and - clamp the requested number of blocks for a single swp_pager_getswapspace() call to INT_MAX. Reported by: syzkaller Reviewed by: dougm, alc, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31875 --- sys/vm/swap_pager.c | 8 +++++--- sys/vm/swap_pager.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 63f0d22ed705..6d64ff883966 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -977,15 +978,16 @@ swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) * Returns 0 on success, -1 on failure. */ int -swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_size_t size) +swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_pindex_t size) { daddr_t addr, blk, n_free, s_free; - int i, j, n; + vm_pindex_t i, j; + int n; swp_pager_init_freerange(&s_free, &n_free); VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += n) { - n = size - i; + n = MIN(size - i, INT_MAX); blk = swp_pager_getswapspace(&n); if (blk == SWAPBLK_NONE) { swp_pager_meta_free(object, start, i); diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 20ff70acc3d8..6761d4f99ee4 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -78,7 +78,7 @@ void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); void swap_pager_swap_init(void); int swap_pager_nswapdev(void); -int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); +int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_pindex_t); void swap_pager_status(int *total, int *used); u_long swap_pager_swapped_pages(vm_object_t object); void swapoff_all(void); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95F6966C36F; Tue, 7 Sep 2021 21:12:33 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3yds3mwkz4VNN; Tue, 7 Sep 2021 21:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 625D9199A4; Tue, 7 Sep 2021 21:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCX2V023354; Tue, 7 Sep 2021 21:12:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCXk3023353; Tue, 7 Sep 2021 21:12:33 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:33 GMT Message-Id: <202109072112.187LCXk3023353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 97cf43ebc5c9 - main - socket: Reorder socket and sockbuf fields to eliminate some padding MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97cf43ebc5c9cd4b43190ba2b1ff3d0e0f9372cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97cf43ebc5c9cd4b43190ba2b1ff3d0e0f9372cc commit 97cf43ebc5c9cd4b43190ba2b1ff3d0e0f9372cc Author: Mark Johnston AuthorDate: 2021-09-07 18:45:22 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 18:59:24 +0000 socket: Reorder socket and sockbuf fields to eliminate some padding This is in preparation for moving sockbuf locks into the owning socket, in order to provide proper interlocking for listen(2). In particular, listening sockets do not use the socket buffers and repurpose that space in struct socket for their own purposes. Moving the locks out of the socket buffers and into the socket proper makes it possible to safely lock socket buffers and test for a listening socket before deciding how to proceed. Reordering these fields saves some space and helps ensure that UMA will provide the same space efficiency for sockets as before. No functional change intended. Reviewed by: tuexen, gallatin Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31656 --- sys/sys/sockbuf.h | 4 ++-- sys/sys/socketvar.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 4c56f4eaf234..e7a4c8883054 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -85,7 +85,8 @@ struct sockbuf { struct sx sb_sx; /* prevent I/O interlacing */ struct selinfo *sb_sel; /* process selecting read/write */ short sb_state; /* (a) socket state on sockbuf */ -#define sb_startzero sb_mb +#define sb_startzero sb_flags + short sb_flags; /* (a) flags, see above */ struct mbuf *sb_mb; /* (a) the mbuf chain */ struct mbuf *sb_mbtail; /* (a) the last mbuf in the chain */ struct mbuf *sb_lastrecord; /* (a) first mbuf of last @@ -109,7 +110,6 @@ struct sockbuf { struct ktls_session *sb_tls_info; /* (a + b) TLS state */ struct mbuf *sb_mtls; /* (a) TLS mbuf chain */ struct mbuf *sb_mtlstail; /* (a) last mbuf in TLS chain */ - short sb_flags; /* (a) flags, see above */ int (*sb_upcall)(struct socket *, void *, int); /* (a) */ void *sb_upcallarg; /* (a) */ TAILQ_HEAD(, kaiocb) sb_aiojobq; /* (a) pending AIO ops */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 47033fdabbfa..506a328b1e0a 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -91,13 +91,13 @@ struct socket { volatile u_int so_count; /* (b / refcount) */ struct selinfo so_rdsel; /* (b/cr) for so_rcv/so_comp */ struct selinfo so_wrsel; /* (b/cs) for so_snd */ - short so_type; /* (a) generic type, see socket.h */ int so_options; /* (b) from socket call, see socket.h */ - short so_linger; /* time to linger close(2) */ + short so_type; /* (a) generic type, see socket.h */ short so_state; /* (b) internal state flags SS_* */ void *so_pcb; /* protocol control block */ struct vnet *so_vnet; /* (a) network stack instance */ struct protosw *so_proto; /* (a) protocol handle */ + short so_linger; /* time to linger close(2) */ short so_timeo; /* (g) connection timeout */ u_short so_error; /* (f) error affecting connection */ u_short so_rerror; /* (f) error affecting connection */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE8DB66C371; Tue, 7 Sep 2021 21:12:34 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydt4kXmz4Vkp; Tue, 7 Sep 2021 21:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EF8919BB6; Tue, 7 Sep 2021 21:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCY9U023394; Tue, 7 Sep 2021 21:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCYeA023393; Tue, 7 Sep 2021 21:12:34 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:34 GMT Message-Id: <202109072112.187LCYeA023393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f94acf52a408 - main - socket: Rename sb(un)lock() and interlock with listen(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f94acf52a408316ed61ba94705d7ec0a69ba5ec8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:34 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f94acf52a408316ed61ba94705d7ec0a69ba5ec8 commit f94acf52a408316ed61ba94705d7ec0a69ba5ec8 Author: Mark Johnston AuthorDate: 2021-09-07 18:49:31 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 19:06:48 +0000 socket: Rename sb(un)lock() and interlock with listen(2) In preparation for moving sockbuf locks into the containing socket, provide alternative macros for the sockbuf I/O locks: SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK(). These operate on a socket rather than a socket buffer. Note that these locks are used only to prevent concurrent readers and writters from interleaving I/O. When locking for I/O, return an error if the socket is a listening socket. Currently the check is racy since the sockbuf sx locks are destroyed during the transition to a listening socket, but that will no longer be true after some follow-up changes. Modify a few places to check for errors from sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. In particular, add checks to sendfile() and sorflush(). Reviewed by: tuexen, gallatin MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31657 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 18 ++++----- sys/dev/hyperv/hvsock/hv_sock.c | 31 ++++++--------- sys/kern/kern_sendfile.c | 8 ++-- sys/kern/uipc_ktls.c | 10 ++--- sys/kern/uipc_sockbuf.c | 28 ------------- sys/kern/uipc_socket.c | 55 +++++++++++++++++++++----- sys/netinet/sctputil.c | 19 +++++---- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 11 +++--- sys/sys/sockbuf.h | 3 -- sys/sys/socketvar.h | 13 +++++- 10 files changed, 103 insertions(+), 93 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 9013f03ddaa3..ca04cb88b10f 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2203,14 +2203,14 @@ t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) /* Inline sosend_generic(). */ - error = sblock(sb, SBL_WAIT); + error = SOCK_IO_SEND_LOCK(so, SBL_WAIT); MPASS(error == 0); sendanother: SOCKBUF_LOCK(sb); if (so->so_snd.sb_state & SBS_CANTSENDMORE) { SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); if ((so->so_options & SO_NOSIGPIPE) == 0) { PROC_LOCK(job->userproc); kern_psignal(job->userproc, SIGPIPE); @@ -2223,12 +2223,12 @@ sendanother: error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); goto out; } if ((so->so_state & SS_ISCONNECTED) == 0) { SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); error = ENOTCONN; goto out; } @@ -2241,13 +2241,13 @@ sendanother: */ if (!aio_set_cancel_function(job, t4_aiotx_cancel)) { SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); error = ECANCELED; goto out; } TAILQ_INSERT_HEAD(&toep->aiotx_jobq, job, list); SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); goto out; } @@ -2274,7 +2274,7 @@ sendanother: m = alloc_aiotx_mbuf(job, len); if (m == NULL) { - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); error = EFAULT; goto out; } @@ -2285,7 +2285,7 @@ sendanother: INP_WLOCK(inp); if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); error = ECONNRESET; goto out; } @@ -2307,7 +2307,7 @@ sendanother: INP_WUNLOCK(inp); if (sendmore) goto sendanother; - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); if (error) goto out; diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index a920d1850c7d..b95b8eebb77d 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -664,18 +664,17 @@ hvs_trans_soreceive(struct socket *so, struct sockaddr **paddr, if (uio->uio_resid == 0 || uio->uio_rw != UIO_READ) return (EINVAL); - sb = &so->so_rcv; - orig_resid = uio->uio_resid; /* Prevent other readers from entering the socket. */ - error = sblock(sb, SBLOCKWAIT(flags)); + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) { HVSOCK_DBG(HVSOCK_DBG_ERR, - "%s: sblock returned error = %d\n", __func__, error); + "%s: soiolock returned error = %d\n", __func__, error); return (error); } + sb = &so->so_rcv; SOCKBUF_LOCK(sb); cbarg.uio = uio; @@ -779,8 +778,7 @@ hvs_trans_soreceive(struct socket *so, struct sockaddr **paddr, out: SOCKBUF_UNLOCK(sb); - - sbunlock(sb); + SOCK_IO_RECV_UNLOCK(so); /* We recieved a FIN in this call */ if (so->so_error == ESHUTDOWN) { @@ -823,18 +821,17 @@ hvs_trans_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, if (uio->uio_resid == 0 || uio->uio_rw != UIO_WRITE) return (EINVAL); - sb = &so->so_snd; - orig_resid = uio->uio_resid; /* Prevent other writers from entering the socket. */ - error = sblock(sb, SBLOCKWAIT(flags)); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) { HVSOCK_DBG(HVSOCK_DBG_ERR, - "%s: sblock returned error = %d\n", __func__, error); + "%s: soiolocak returned error = %d\n", __func__, error); return (error); } + sb = &so->so_snd; SOCKBUF_LOCK(sb); if ((sb->sb_state & SBS_CANTSENDMORE) || @@ -893,7 +890,7 @@ hvs_trans_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, out: SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_SEND_UNLOCK(so); return (error); } @@ -1674,7 +1671,7 @@ hvsock_detach(device_t dev) { struct hvsock_sc *sc = (struct hvsock_sc *)device_get_softc(dev); struct socket *so; - int error, retry; + int retry; if (bootverbose) device_printf(dev, "hvsock_detach called.\n"); @@ -1703,8 +1700,7 @@ hvsock_detach(device_t dev) */ if (so) { retry = 0; - while ((error = sblock(&so->so_rcv, 0)) == - EWOULDBLOCK) { + while (SOCK_IO_RECV_LOCK(so, 0) == EWOULDBLOCK) { /* * Someone is reading, rx br is busy */ @@ -1715,8 +1711,7 @@ hvsock_detach(device_t dev) "retry = %d\n", retry++); } retry = 0; - while ((error = sblock(&so->so_snd, 0)) == - EWOULDBLOCK) { + while (SOCK_IO_SEND_LOCK(so, 0) == EWOULDBLOCK) { /* * Someone is sending, tx br is busy */ @@ -1734,8 +1729,8 @@ hvsock_detach(device_t dev) sc->pcb = NULL; if (so) { - sbunlock(&so->so_rcv); - sbunlock(&so->so_snd); + SOCK_IO_RECV_UNLOCK(so); + SOCK_IO_SEND_UNLOCK(so); so->so_pcb = NULL; } diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index ac1072ca2406..d3043d16f4ec 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -741,7 +741,9 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, * XXXRW: Historically this has assumed non-interruptibility, so now * we implement that, but possibly shouldn't. */ - (void)sblock(&so->so_snd, SBL_WAIT | SBL_NOINTR); + error = SOCK_IO_SEND_LOCK(so, SBL_WAIT | SBL_NOINTR); + if (error != 0) + goto out; #ifdef KERN_TLS tls = ktls_hold(so->so_snd.sb_tls_info); #endif @@ -1211,7 +1213,7 @@ prepend_header: * Send trailers. Wimp out and use writev(2). */ if (trl_uio != NULL) { - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); error = kern_writev(td, sockfd, trl_uio); if (error == 0) sbytes += td->td_retval[0]; @@ -1219,7 +1221,7 @@ prepend_header: } done: - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); out: /* * If there was no error we have to clear td->td_retval[0] diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index ee615255d16a..28fc7a0a97ec 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1171,7 +1171,7 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) return (error); } - error = sblock(&so->so_snd, SBL_WAIT); + error = SOCK_IO_SEND_LOCK(so, SBL_WAIT); if (error) { ktls_cleanup(tls); return (error); @@ -1191,7 +1191,7 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) so->so_snd.sb_flags |= SB_TLS_IFNET; SOCKBUF_UNLOCK(&so->so_snd); INP_WUNLOCK(inp); - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); counter_u64_add(ktls_offload_total, 1); @@ -1292,7 +1292,7 @@ ktls_set_tx_mode(struct socket *so, int mode) return (error); } - error = sblock(&so->so_snd, SBL_WAIT); + error = SOCK_IO_SEND_LOCK(so, SBL_WAIT); if (error) { counter_u64_add(ktls_switch_failed, 1); ktls_free(tls_new); @@ -1307,7 +1307,7 @@ ktls_set_tx_mode(struct socket *so, int mode) */ if (tls != so->so_snd.sb_tls_info) { counter_u64_add(ktls_switch_failed, 1); - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); ktls_free(tls_new); ktls_free(tls); INP_WLOCK(inp); @@ -1319,7 +1319,7 @@ ktls_set_tx_mode(struct socket *so, int mode) if (tls_new->mode != TCP_TLS_MODE_SW) so->so_snd.sb_flags |= SB_TLS_IFNET; SOCKBUF_UNLOCK(&so->so_snd); - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); /* * Drop two references on 'tls'. The first is for the diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index b2202fe15192..bb179043682e 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -475,34 +475,6 @@ sbwait(struct sockbuf *sb) sb->sb_timeo, 0, 0)); } -int -sblock(struct sockbuf *sb, int flags) -{ - - KASSERT((flags & SBL_VALID) == flags, - ("sblock: flags invalid (0x%x)", flags)); - - if (flags & SBL_WAIT) { - if ((sb->sb_flags & SB_NOINTR) || - (flags & SBL_NOINTR)) { - sx_xlock(&sb->sb_sx); - return (0); - } - return (sx_xlock_sig(&sb->sb_sx)); - } else { - if (sx_try_xlock(&sb->sb_sx) == 0) - return (EWOULDBLOCK); - return (0); - } -} - -void -sbunlock(struct sockbuf *sb) -{ - - sx_xunlock(&sb->sb_sx); -} - /* * Wakeup processes waiting on a socket buffer. Do asynchronous notification * via SIGIO if the socket has the SS_ASYNC flag set. diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 602d6c8b4216..5932c28aca2f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1587,7 +1587,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, if (control != NULL) clen = control->m_len; - error = sblock(&so->so_snd, SBLOCKWAIT(flags)); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) goto out; @@ -1785,7 +1785,7 @@ restart: } while (resid); release: - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); out: #ifdef KERN_TLS if (tls != NULL) @@ -1932,7 +1932,7 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, (*pr->pr_usrreqs->pru_rcvd)(so, 0); } - error = sblock(&so->so_rcv, SBLOCKWAIT(flags)); + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); @@ -2387,7 +2387,7 @@ dontblock: if (flagsp != NULL) *flagsp |= flags; release: - sbunlock(&so->so_rcv); + SOCK_IO_RECV_UNLOCK(so); return (error); } @@ -2434,7 +2434,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, #endif /* Prevent other readers from entering the socket. */ - error = sblock(sb, SBLOCKWAIT(flags)); + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); SOCKBUF_LOCK(sb); @@ -2442,7 +2442,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, #ifdef KERN_TLS if (sb->sb_tls_info != NULL) { SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_RECV_UNLOCK(so); return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); } @@ -2605,11 +2605,10 @@ deliver: if ((flags & MSG_WAITALL) && uio->uio_resid > 0) goto restart; out: - SOCKBUF_LOCK_ASSERT(sb); SBLASTRECORDCHK(sb); SBLASTMBUFCHK(sb); SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_RECV_UNLOCK(so); return (error); } @@ -2876,6 +2875,7 @@ sorflush(struct socket *so) struct sockbuf *sb = &so->so_rcv; struct protosw *pr = so->so_proto; struct socket aso; + int error; VNET_SO_ASSERT(so); @@ -2893,7 +2893,9 @@ sorflush(struct socket *so) * despite any existing socket disposition on interruptable waiting. */ socantrcvmore(so); - (void) sblock(sb, SBL_WAIT | SBL_NOINTR); + error = SOCK_IO_RECV_LOCK(so, SBL_WAIT | SBL_NOINTR); + KASSERT(error == 0, ("%s: cannot lock sock %p recv buffer", + __func__, so)); /* * Invalidate/clear most of the sockbuf structure, but leave selinfo @@ -2907,7 +2909,7 @@ sorflush(struct socket *so) bzero(&sb->sb_startzero, sizeof(*sb) - offsetof(struct sockbuf, sb_startzero)); SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_RECV_UNLOCK(so); /* * Dispose of special rights and flush the copied socket. Don't call @@ -4100,6 +4102,39 @@ soisdisconnected(struct socket *so) wakeup(&so->so_timeo); } +int +soiolock(struct socket *so, struct sx *sx, int flags) +{ + int error; + + KASSERT((flags & SBL_VALID) == flags, + ("soiolock: invalid flags %#x", flags)); + + if ((flags & SBL_WAIT) != 0) { + if ((flags & SBL_NOINTR) != 0) { + sx_xlock(sx); + } else { + error = sx_xlock_sig(sx); + if (error != 0) + return (error); + } + } else if (!sx_try_xlock(sx)) { + return (EWOULDBLOCK); + } + + if (__predict_false(SOLISTENING(so))) { + sx_xunlock(sx); + return (ENOTCONN); + } + return (0); +} + +void +soiounlock(struct sx *sx) +{ + sx_xunlock(sx); +} + /* * Make a copy of a sockaddr in a malloced buffer of type M_SONAME. */ diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index f331fb70ded5..0993f8eb302f 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4796,10 +4796,10 @@ sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp, old_so = old_inp->sctp_socket; new_so = new_inp->sctp_socket; TAILQ_INIT(&tmp_queue); - error = sblock(&old_so->so_rcv, waitflags); + error = SOCK_IO_RECV_LOCK(old_so, waitflags); if (error) { /* - * Gak, can't get sblock, we have a problem. data will be + * Gak, can't get I/O lock, we have a problem. data will be * left stranded.. and we don't dare look at it since the * other thread may be reading something. Oh well, its a * screwed up app that does a peeloff OR a accept while @@ -4831,9 +4831,8 @@ sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp, } } SCTP_INP_READ_UNLOCK(old_inp); - /* Remove the sb-lock on the old socket */ - - sbunlock(&old_so->so_rcv); + /* Remove the recv-lock on the old socket */ + SOCK_IO_RECV_UNLOCK(old_so); /* Now we move them over to the new socket buffer */ SCTP_INP_READ_LOCK(new_inp); TAILQ_FOREACH_SAFE(control, &tmp_queue, next, nctl) { @@ -5586,7 +5585,7 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, (uint32_t)uio->uio_resid); } - error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); + error = SOCK_IO_RECV_LOCK(so, (block_allowed ? SBL_WAIT : 0)); if (error) { goto release_unlocked; } @@ -6234,8 +6233,8 @@ get_more_data: } /* * We need to wait for more data a few things: - We don't - * sbunlock() so we don't get someone else reading. - We - * must be sure to account for the case where what is added + * release the I/O lock so we don't get someone else reading. + * - We must be sure to account for the case where what is added * is NOT to our control when we wakeup. */ @@ -6383,7 +6382,7 @@ release: hold_sblock = 0; } - sbunlock(&so->so_rcv); + SOCK_IO_RECV_UNLOCK(so); sockbuf_lock = 0; release_unlocked: @@ -6418,7 +6417,7 @@ out: SOCKBUF_UNLOCK(&so->so_rcv); } if (sockbuf_lock) { - sbunlock(&so->so_rcv); + SOCK_IO_RECV_UNLOCK(so); } if (freecnt_applied) { diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index a38bdfcbed59..ed9dd1fcb224 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -1105,7 +1105,7 @@ sdp_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, td->td_ru.ru_msgsnd++; ssk = sdp_sk(so); - error = sblock(&so->so_snd, SBLOCKWAIT(flags)); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) goto out; @@ -1196,7 +1196,7 @@ restart: } while (resid); release: - sbunlock(&so->so_snd); + SOCK_IO_SEND_UNLOCK(so); out: if (top != NULL) m_freem(top); @@ -1267,9 +1267,9 @@ sdp_sorecv(struct socket *so, struct sockaddr **psa, struct uio *uio, ssk = sdp_sk(so); /* Prevent other readers from entering the socket. */ - error = sblock(sb, SBLOCKWAIT(flags)); + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) - goto out; + return (error); SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ @@ -1423,11 +1423,10 @@ deliver: if ((flags & MSG_WAITALL) && uio->uio_resid > 0) goto restart; out: - SOCKBUF_LOCK_ASSERT(sb); SBLASTRECORDCHK(sb); SBLASTMBUFCHK(sb); SOCKBUF_UNLOCK(sb); - sbunlock(sb); + SOCK_IO_RECV_UNLOCK(so); return (error); } diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index e7a4c8883054..3d74a6d953f7 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -78,7 +78,6 @@ struct selinfo; * * Locking key to struct sockbuf: * (a) locked by SOCKBUF_LOCK(). - * (b) locked by sblock() */ struct sockbuf { struct mtx sb_mtx; /* sockbuf lock */ @@ -183,8 +182,6 @@ struct mbuf * struct mbuf * sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); int sbwait(struct sockbuf *sb); -int sblock(struct sockbuf *sb, int flags); -void sbunlock(struct sockbuf *sb); void sballoc(struct sockbuf *, struct mbuf *); void sbfree(struct sockbuf *, struct mbuf *); void sballoc_ktls_rx(struct sockbuf *sb, struct mbuf *m); diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 506a328b1e0a..a12e60e1b5c6 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -249,12 +249,21 @@ struct socket { */ /* - * Flags to sblock(). + * Flags to soiolock(). */ #define SBL_WAIT 0x00000001 /* Wait if not immediately available. */ #define SBL_NOINTR 0x00000002 /* Force non-interruptible sleep. */ #define SBL_VALID (SBL_WAIT | SBL_NOINTR) +#define SOCK_IO_SEND_LOCK(so, flags) \ + soiolock((so), &(so)->so_snd.sb_sx, (flags)) +#define SOCK_IO_SEND_UNLOCK(so) \ + soiounlock(&(so)->so_snd.sb_sx) +#define SOCK_IO_RECV_LOCK(so, flags) \ + soiolock((so), &(so)->so_rcv.sb_sx, (flags)) +#define SOCK_IO_RECV_UNLOCK(so) \ + soiounlock(&(so)->so_rcv.sb_sx) + /* * Do we need to notify the other side when I/O is possible? */ @@ -484,6 +493,8 @@ void socantsendmore(struct socket *so); void socantsendmore_locked(struct socket *so); void soroverflow(struct socket *so); void soroverflow_locked(struct socket *so); +int soiolock(struct socket *so, struct sx *sx, int flags); +void soiounlock(struct sx *sx); /* * Accept filter functions (duh). From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0641566C5A1; Tue, 7 Sep 2021 21:12:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydw6V1Yz4VRJ; Tue, 7 Sep 2021 21:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE66319947; Tue, 7 Sep 2021 21:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCaQI023444; Tue, 7 Sep 2021 21:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCajS023443; Tue, 7 Sep 2021 21:12:36 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:36 GMT Message-Id: <202109072112.187LCajS023443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bd4a39cc93d9 - main - socket: Properly interlock when transitioning to a listening socket MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd4a39cc93d9faf8b5c000855d5aa90df592dd49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd4a39cc93d9faf8b5c000855d5aa90df592dd49 commit bd4a39cc93d9faf8b5c000855d5aa90df592dd49 Author: Mark Johnston AuthorDate: 2021-09-07 18:49:53 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:11:43 +0000 socket: Properly interlock when transitioning to a listening socket Currently, most protocols implement pru_listen with something like the following: SOCK_LOCK(so); error = solisten_proto_check(so); if (error) { SOCK_UNLOCK(so); return (error); } solisten_proto(so); SOCK_UNLOCK(so); solisten_proto_check() fails if the socket is connected or connecting. However, the socket lock is not used during I/O, so this pattern is racy. The change modifies solisten_proto_check() to additionally acquire socket buffer locks, and the calling thread holds them until solisten_proto() or solisten_proto_abort() is called. Now that the socket buffer locks are preserved across a listen(2), this change allows socket I/O paths to properly interlock with listen(2). This fixes a large number of syzbot reports, only one is listed below and the rest will be dup'ed to it. Reported by: syzbot+9fece8a63c0e27273821@syzkaller.appspotmail.com Reviewed by: tuexen, gallatin MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31659 --- sys/kern/uipc_socket.c | 58 ++++++++++++++++++---- sys/kern/uipc_usrreq.c | 28 +++++++---- sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c | 3 ++ sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c | 5 +- sys/netinet/sctp_usrreq.c | 41 ++++++++------- sys/netinet/tcp_usrreq.c | 40 ++++++++++++--- sys/sys/socketvar.h | 1 + 7 files changed, 130 insertions(+), 46 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5932c28aca2f..b26d0591cbdd 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -418,12 +418,14 @@ soalloc(struct vnet *vnet) * a feature to change class of an existing lock, so we use DUPOK. */ mtx_init(&so->so_lock, "socket", NULL, MTX_DEF | MTX_DUPOK); + so->so_snd.sb_mtx = &so->so_snd_mtx; + so->so_rcv.sb_mtx = &so->so_rcv_mtx; SOCKBUF_LOCK_INIT(&so->so_snd, "so_snd"); SOCKBUF_LOCK_INIT(&so->so_rcv, "so_rcv"); so->so_rcv.sb_sel = &so->so_rdsel; so->so_snd.sb_sel = &so->so_wrsel; - sx_init(&so->so_snd.sb_sx, "so_snd_sx"); - sx_init(&so->so_rcv.sb_sx, "so_rcv_sx"); + sx_init(&so->so_snd_sx, "so_snd_sx"); + sx_init(&so->so_rcv_sx, "so_rcv_sx"); TAILQ_INIT(&so->so_snd.sb_aiojobq); TAILQ_INIT(&so->so_rcv.sb_aiojobq); TASK_INIT(&so->so_snd.sb_aiotask, 0, soaio_snd, so); @@ -487,8 +489,8 @@ sodealloc(struct socket *so) if (so->so_snd.sb_hiwat) (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, 0, RLIM_INFINITY); - sx_destroy(&so->so_snd.sb_sx); - sx_destroy(&so->so_rcv.sb_sx); + sx_destroy(&so->so_snd_sx); + sx_destroy(&so->so_rcv_sx); SOCKBUF_LOCK_DESTROY(&so->so_snd); SOCKBUF_LOCK_DESTROY(&so->so_rcv); } @@ -899,18 +901,48 @@ solisten(struct socket *so, int backlog, struct thread *td) return (error); } +/* + * Prepare for a call to solisten_proto(). Acquire all socket buffer locks in + * order to interlock with socket I/O. + */ int solisten_proto_check(struct socket *so) { - SOCK_LOCK_ASSERT(so); - if (so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | - SS_ISDISCONNECTING)) + if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | + SS_ISDISCONNECTING)) != 0) return (EINVAL); + + /* + * Sleeping is not permitted here, so simply fail if userspace is + * attempting to transmit or receive on the socket. This kind of + * transient failure is not ideal, but it should occur only if userspace + * is misusing the socket interfaces. + */ + if (!sx_try_xlock(&so->so_snd_sx)) + return (EAGAIN); + if (!sx_try_xlock(&so->so_rcv_sx)) { + sx_xunlock(&so->so_snd_sx); + return (EAGAIN); + } + mtx_lock(&so->so_snd_mtx); + mtx_lock(&so->so_rcv_mtx); return (0); } +/* + * Undo the setup done by solisten_proto_check(). + */ +void +solisten_proto_abort(struct socket *so) +{ + mtx_unlock(&so->so_snd_mtx); + mtx_unlock(&so->so_rcv_mtx); + sx_xunlock(&so->so_snd_sx); + sx_xunlock(&so->so_rcv_sx); +} + void solisten_proto(struct socket *so, int backlog) { @@ -920,6 +952,9 @@ solisten_proto(struct socket *so, int backlog) sbintime_t sbrcv_timeo, sbsnd_timeo; SOCK_LOCK_ASSERT(so); + KASSERT((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | + SS_ISDISCONNECTING)) == 0, + ("%s: bad socket state %p", __func__, so)); if (SOLISTENING(so)) goto listening; @@ -938,10 +973,6 @@ solisten_proto(struct socket *so, int backlog) sbdestroy(&so->so_snd, so); sbdestroy(&so->so_rcv, so); - sx_destroy(&so->so_snd.sb_sx); - sx_destroy(&so->so_rcv.sb_sx); - SOCKBUF_LOCK_DESTROY(&so->so_snd); - SOCKBUF_LOCK_DESTROY(&so->so_rcv); #ifdef INVARIANTS bzero(&so->so_rcv, @@ -974,6 +1005,11 @@ listening: if (backlog < 0 || backlog > somaxconn) backlog = somaxconn; so->sol_qlimit = backlog; + + mtx_unlock(&so->so_snd_mtx); + mtx_unlock(&so->so_rcv_mtx); + sx_xunlock(&so->so_snd_sx); + sx_xunlock(&so->so_rcv_sx); } /* diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index c736f35b5ee0..5add930bfa8e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -890,13 +890,17 @@ uipc_listen(struct socket *so, int backlog, struct thread *td) if (so->so_type != SOCK_STREAM && so->so_type != SOCK_SEQPACKET) return (EOPNOTSUPP); + /* + * Synchronize with concurrent connection attempts. + */ + error = 0; unp = sotounpcb(so); - KASSERT(unp != NULL, ("uipc_listen: unp == NULL")); - UNP_PCB_LOCK(unp); - if (unp->unp_vnode == NULL) { - /* Already connected or not bound to an address. */ - error = unp->unp_conn != NULL ? EINVAL : EDESTADDRREQ; + if (unp->unp_conn != NULL || (unp->unp_flags & UNP_CONNECTING) != 0) + error = EINVAL; + else if (unp->unp_vnode == NULL) + error = EDESTADDRREQ; + if (error != 0) { UNP_PCB_UNLOCK(unp); return (error); } @@ -1523,6 +1527,7 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, bcopy(soun->sun_path, buf, len); buf[len] = 0; + error = 0; unp = sotounpcb(so); UNP_PCB_LOCK(unp); for (;;) { @@ -1538,13 +1543,16 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, * lock the peer socket, to ensure that unp_conn cannot * transition between two valid sockets while locks are dropped. */ - if (unp->unp_conn != NULL) { - UNP_PCB_UNLOCK(unp); - return (EISCONN); + if (SOLISTENING(so)) + error = EOPNOTSUPP; + else if (unp->unp_conn != NULL) + error = EISCONN; + else if ((unp->unp_flags & UNP_CONNECTING) != 0) { + error = EALREADY; } - if ((unp->unp_flags & UNP_CONNECTING) != 0) { + if (error != 0) { UNP_PCB_UNLOCK(unp); - return (EALREADY); + return (error); } if (unp->unp_pairbusy > 0) { unp->unp_flags |= UNP_WAITING; diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index cd620fe3aef9..18d7a89b7a2f 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -2506,14 +2506,17 @@ ng_btsocket_l2cap_listen(struct socket *so, int backlog, struct thread *td) if (error != 0) goto out; if (pcb == NULL) { + solisten_proto_abort(so); error = EINVAL; goto out; } if (ng_btsocket_l2cap_node == NULL) { + solisten_proto_abort(so); error = EINVAL; goto out; } if (pcb->psm == 0) { + solisten_proto_abort(so); error = EADDRNOTAVAIL; goto out; } diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c index c0704bce55fa..5b7bbeb45407 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c @@ -894,6 +894,7 @@ ng_btsocket_rfcomm_listen(struct socket *so, int backlog, struct thread *td) * from socreate() */ if (l2so == NULL) { + solisten_proto_abort(so); error = socreate_error; goto out; } @@ -907,8 +908,10 @@ ng_btsocket_rfcomm_listen(struct socket *so, int backlog, struct thread *td) */ error = ng_btsocket_rfcomm_session_create(&s, l2so, NG_HCI_BDADDR_ANY, NULL, td); - if (error != 0) + if (error != 0) { + solisten_proto_abort(so); goto out; + } l2so = NULL; } SOCK_LOCK(so); diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 62d6996ab60d..76d73a11304a 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -7201,7 +7201,8 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) } } } - SCTP_INP_RLOCK(inp); + SCTP_INP_INFO_WLOCK(); + SCTP_INP_WLOCK(inp); #ifdef SCTP_LOCK_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOCK_LOGGING_ENABLE) { sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK); @@ -7209,10 +7210,9 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) #endif SOCK_LOCK(so); error = solisten_proto_check(so); - SOCK_UNLOCK(so); if (error) { - SCTP_INP_RUNLOCK(inp); - return (error); + SOCK_UNLOCK(so); + goto out; } if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { @@ -7223,39 +7223,44 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) * move the guy that was listener to the TCP Pool. */ if (sctp_swap_inpcb_for_listen(inp)) { - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); - return (EADDRINUSE); + SOCK_UNLOCK(so); + solisten_proto_abort(so); + error = EADDRINUSE; + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + goto out; } } if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) { - /* We are already connected AND the TCP model */ - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); - return (EADDRINUSE); + SOCK_UNLOCK(so); + solisten_proto_abort(so); + error = EADDRINUSE; + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + goto out; } - SCTP_INP_RUNLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { - /* We must do a bind. */ - if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) { + if ((error = sctp_inpcb_bind_locked(inp, NULL, NULL, p))) { + SOCK_UNLOCK(so); + solisten_proto_abort(so); /* bind error, probably perm */ - return (error); + goto out; } } - SCTP_INP_WLOCK(inp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) == 0) { - SOCK_LOCK(so); solisten_proto(so, backlog); - SOCK_UNLOCK(so); + } else { + solisten_proto_abort(so); } + SOCK_UNLOCK(so); if (backlog > 0) { inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; } else { inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; } +out: SCTP_INP_WUNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return (error); } diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index bcd7d18d9d62..3a1608cc106a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -457,10 +457,15 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) TCPDEBUG1(); SOCK_LOCK(so); error = solisten_proto_check(so); - INP_HASH_WLOCK(&V_tcbinfo); - if (error == 0 && inp->inp_lport == 0) - error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); - INP_HASH_WUNLOCK(&V_tcbinfo); + if (error != 0) { + SOCK_UNLOCK(so); + goto out; + } + if (inp->inp_lport == 0) { + INP_HASH_WLOCK(&V_tcbinfo); + error = in_pcbbind(inp, NULL, td->td_ucred); + INP_HASH_WUNLOCK(&V_tcbinfo); + } if (error == 0) { tcp_state_change(tp, TCPS_LISTEN); solisten_proto(so, backlog); @@ -468,6 +473,8 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) if ((so->so_options & SO_NO_OFFLOAD) == 0) tcp_offload_listen_start(tp); #endif + } else { + solisten_proto_abort(so); } SOCK_UNLOCK(so); @@ -504,12 +511,16 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) TCPDEBUG1(); SOCK_LOCK(so); error = solisten_proto_check(so); + if (error != 0) { + SOCK_UNLOCK(so); + goto out; + } INP_HASH_WLOCK(&V_tcbinfo); - if (error == 0 && inp->inp_lport == 0) { + if (inp->inp_lport == 0) { inp->inp_vflag &= ~INP_IPV4; if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) inp->inp_vflag |= INP_IPV4; - error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); + error = in6_pcbbind(inp, NULL, td->td_ucred); } INP_HASH_WUNLOCK(&V_tcbinfo); if (error == 0) { @@ -519,6 +530,8 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) if ((so->so_options & SO_NO_OFFLOAD) == 0) tcp_offload_listen_start(tp); #endif + } else { + solisten_proto_abort(so); } SOCK_UNLOCK(so); @@ -581,6 +594,10 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = ECONNREFUSED; goto out; } + if (SOLISTENING(so)) { + error = EOPNOTSUPP; + goto out; + } tp = intotcpcb(inp); TCPDEBUG1(); NET_EPOCH_ENTER(et); @@ -643,6 +660,10 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = ECONNREFUSED; goto out; } + if (SOLISTENING(so)) { + error = EINVAL; + goto out; + } tp = intotcpcb(inp); TCPDEBUG1(); #ifdef INET @@ -1021,6 +1042,10 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, TCPDEBUG1(); if (nam != NULL && tp->t_state < TCPS_SYN_SENT) { + if (tp->t_state == TCPS_LISTEN) { + error = EINVAL; + goto out; + } switch (nam->sa_family) { #ifdef INET case AF_INET: @@ -1119,6 +1144,9 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, sbappendstream(&so->so_snd, m, flags); m = NULL; if (nam && tp->t_state < TCPS_SYN_SENT) { + KASSERT(tp->t_state == TCPS_CLOSED, + ("%s: tp %p is listening", __func__, tp)); + /* * Do implied connect if not yet connected, * initialize window to default value, and diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 69e182dfa9a5..69dd1706e366 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -453,6 +453,7 @@ void sofree(struct socket *so); void sohasoutofband(struct socket *so); int solisten(struct socket *so, int backlog, struct thread *td); void solisten_proto(struct socket *so, int backlog); +void solisten_proto_abort(struct socket *so); int solisten_proto_check(struct socket *so); int solisten_dequeue(struct socket *, struct socket **, int); struct socket * From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AD7B66C373; Tue, 7 Sep 2021 21:12:36 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydv6hgfz4Vdp; Tue, 7 Sep 2021 21:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3404199A5; Tue, 7 Sep 2021 21:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCZgb023418; Tue, 7 Sep 2021 21:12:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCZfh023417; Tue, 7 Sep 2021 21:12:35 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:35 GMT Message-Id: <202109072112.187LCZfh023417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c67f3b8b78e5 - main - socket: Move sockbuf mutexes into the owning socket MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c67f3b8b78e50c6df7c057d6cf108e4d6b4312d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:36 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c67f3b8b78e50c6df7c057d6cf108e4d6b4312d0 commit c67f3b8b78e50c6df7c057d6cf108e4d6b4312d0 Author: Mark Johnston AuthorDate: 2021-09-07 18:49:40 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 19:09:02 +0000 socket: Move sockbuf mutexes into the owning socket This is necessary to provide proper interlocking with listen(2), which destroys the socket buffers. Otherwise, code must lock the socket itself and check SOLISTENING(so), but most I/O paths do not otherwise need to acquire the socket lock, so the extra overhead needed to check a rare error case is undesirable. listen(2) calls are relatively rare. Thus, the strategy is to have it acquire all socket buffer locks when transitioning to a listening socket. To do this safely, these locks must be stable, and not destroyed during listen(2) as they are today. So, move them out of the sockbuf and into the owning socket. For the sockbuf mutexes, keep a pointer to the mutex in the sockbuf itself, for now. This can be removed by replacing SOCKBUF_LOCK() etc. with macros which operate on the socket itself, as was done for the sockbuf I/O locks. Reviewed by: tuexen, gallatin MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31658 --- sys/sys/sockbuf.h | 7 +++---- sys/sys/socketvar.h | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 3d74a6d953f7..3b345870bd5f 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -79,9 +79,8 @@ struct selinfo; * Locking key to struct sockbuf: * (a) locked by SOCKBUF_LOCK(). */ -struct sockbuf { - struct mtx sb_mtx; /* sockbuf lock */ - struct sx sb_sx; /* prevent I/O interlacing */ +struct sockbuf { + struct mtx *sb_mtx; /* sockbuf lock */ struct selinfo *sb_sel; /* process selecting read/write */ short sb_state; /* (a) socket state on sockbuf */ #define sb_startzero sb_flags @@ -122,7 +121,7 @@ struct sockbuf { * Per-socket buffer mutex used to protect most fields in the socket * buffer. */ -#define SOCKBUF_MTX(_sb) (&(_sb)->sb_mtx) +#define SOCKBUF_MTX(_sb) ((_sb)->sb_mtx) #define SOCKBUF_LOCK_INIT(_sb, _name) \ mtx_init(SOCKBUF_MTX(_sb), _name, NULL, MTX_DEF) #define SOCKBUF_LOCK_DESTROY(_sb) mtx_destroy(SOCKBUF_MTX(_sb)) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index a12e60e1b5c6..69e182dfa9a5 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -121,6 +121,17 @@ struct socket { int so_ts_clock; /* type of the clock used for timestamps */ uint32_t so_max_pacing_rate; /* (f) TX rate limit in bytes/s */ + + /* + * Mutexes to prevent interleaving of socket I/O. These have to be + * outside of the socket buffers in order to interlock with listen(2). + */ + struct sx so_snd_sx __aligned(CACHE_LINE_SIZE); + struct mtx so_snd_mtx; + + struct sx so_rcv_sx __aligned(CACHE_LINE_SIZE); + struct mtx so_rcv_mtx; + union { /* Regular (data flow) socket. */ struct { @@ -256,13 +267,13 @@ struct socket { #define SBL_VALID (SBL_WAIT | SBL_NOINTR) #define SOCK_IO_SEND_LOCK(so, flags) \ - soiolock((so), &(so)->so_snd.sb_sx, (flags)) + soiolock((so), &(so)->so_snd_sx, (flags)) #define SOCK_IO_SEND_UNLOCK(so) \ - soiounlock(&(so)->so_snd.sb_sx) + soiounlock(&(so)->so_snd_sx) #define SOCK_IO_RECV_LOCK(so, flags) \ - soiolock((so), &(so)->so_rcv.sb_sx, (flags)) + soiolock((so), &(so)->so_rcv_sx, (flags)) #define SOCK_IO_RECV_UNLOCK(so) \ - soiounlock(&(so)->so_rcv.sb_sx) + soiounlock(&(so)->so_rcv_sx) /* * Do we need to notify the other side when I/O is possible? From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B880C66C530; Tue, 7 Sep 2021 21:12:38 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydy2TGvz4Vmy; Tue, 7 Sep 2021 21:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E53A0196D5; Tue, 7 Sep 2021 21:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCbRS023469; Tue, 7 Sep 2021 21:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCbMh023468; Tue, 7 Sep 2021 21:12:37 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:37 GMT Message-Id: <202109072112.187LCbMh023468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 523d58aad179 - main - socket: Remove unneeded SOLISTENING checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 523d58aad179440bc2440d11b6b4280c18b3dc28 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=523d58aad179440bc2440d11b6b4280c18b3dc28 commit 523d58aad179440bc2440d11b6b4280c18b3dc28 Author: Mark Johnston AuthorDate: 2021-09-07 18:50:02 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:12:09 +0000 socket: Remove unneeded SOLISTENING checks Now that SOCK_IO_*_LOCK() checks for listening sockets, we can eliminate some racy SOLISTENING() checks. No functional change intended. Reviewed by: tuexen MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31660 --- sys/kern/kern_sendfile.c | 2 -- sys/kern/uipc_socket.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index d3043d16f4ec..ba1fc201c2de 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -668,8 +668,6 @@ sendfile_getsock(struct thread *td, int s, struct file **sock_fp, */ if ((*so)->so_proto->pr_protocol == IPPROTO_SCTP) return (EINVAL); - if (SOLISTENING(*so)) - return (ENOTCONN); return (0); } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index b26d0591cbdd..a502b06ce00e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1352,10 +1352,6 @@ soconnectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) { int error; - /* XXXMJ racy */ - if (SOLISTENING(so)) - return (EOPNOTSUPP); - CURVNET_SET(so->so_vnet); /* * If protocol is connection-based, can only connect once. @@ -1841,14 +1837,8 @@ sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, int error; CURVNET_SET(so->so_vnet); - if (!SOLISTENING(so)) - error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, - top, control, flags, td); - else { - m_freem(top); - m_freem(control); - error = ENOTCONN; - } + error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, + top, control, flags, td); CURVNET_RESTORE(); return (error); } @@ -2843,11 +2833,8 @@ soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, int error; CURVNET_SET(so->so_vnet); - if (!SOLISTENING(so)) - error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, - mp0, controlp, flagsp)); - else - error = ENOTCONN; + error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, + mp0, controlp, flagsp)); CURVNET_RESTORE(); return (error); } From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F21866C242; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydz2VCBz4Vn1; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10C1E19AB7; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCcli023502; Tue, 7 Sep 2021 21:12:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCcUw023501; Tue, 7 Sep 2021 21:12:38 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:38 GMT Message-Id: <202109072112.187LCcUw023501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c4b44adcf0b6 - main - sctp: Remove special handling for a listen(2) backlog of 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4b44adcf0b631eb2d4187f285ed37cf4ce1caff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4b44adcf0b631eb2d4187f285ed37cf4ce1caff commit c4b44adcf0b631eb2d4187f285ed37cf4ce1caff Author: Mark Johnston AuthorDate: 2021-09-07 18:51:19 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:12:09 +0000 sctp: Remove special handling for a listen(2) backlog of 0 ... when applied to one-to-one-style sockets. sctp_listen() cannot be used to toggle the listening state of such a socket. See RFC 6458's description of expected listen(2) semantics for one-to-one- and one-to-many-style sockets. Reviewed by: tuexen MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31774 --- sys/netinet/sctp_usrreq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 76d73a11304a..516e58753163 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -7249,14 +7249,16 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) } if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) == 0) { solisten_proto(so, backlog); - } else { - solisten_proto_abort(so); - } - SOCK_UNLOCK(so); - if (backlog > 0) { + SOCK_UNLOCK(so); inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; + solisten_proto_abort(so); + SOCK_UNLOCK(so); + if (backlog > 0) { + inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; + } else { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; + } } out: SCTP_INP_WUNLOCK(inp); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BCB866C246; Tue, 7 Sep 2021 21:12:41 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3yf04HhFz4Vn8; Tue, 7 Sep 2021 21:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27117197AC; Tue, 7 Sep 2021 21:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCe3L023679; Tue, 7 Sep 2021 21:12:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCeOX023678; Tue, 7 Sep 2021 21:12:40 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:40 GMT Message-Id: <202109072112.187LCeOX023678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a8aa6f1f784b - main - socket: Avoid clearing SS_ISCONNECTING if soconnect() fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8aa6f1f784b91acb4ef9387a28c78311493eb66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:41 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a8aa6f1f784b91acb4ef9387a28c78311493eb66 commit a8aa6f1f784b91acb4ef9387a28c78311493eb66 Author: Mark Johnston AuthorDate: 2021-09-07 18:51:54 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:12:09 +0000 socket: Avoid clearing SS_ISCONNECTING if soconnect() fails This behaviour appears to date from the 4.4 BSD import. It has two problems: 1. The update to so_state is not protected by the socket lock, so concurrent updates to so_state may be lost. 2. Suppose two threads race to call connect(2) on a socket, and one succeeds while the other fails. Then the failing thread may incorrectly clear SS_ISCONNECTING, confusing the state machine. Simply remove the update. It does not appear to be necessary: pru_connect implementations which call soisconnecting() only do so after all failure modes have been handled. For instance, tcp_connect() and tcp6_connect() will never return an error after calling soisconnected(). However, we cannot correctly assert that SS_ISCONNECTED is not set after an error from soconnect() since the socket lock is not held across the pru_connect call, so a concurrent connect(2) may have set the flag. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31699 --- sys/kern/uipc_syscalls.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 3208dc0491dd..44079bae1e9b 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -484,7 +484,7 @@ kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) { struct socket *so; struct file *fp; - int error, interrupted = 0; + int error; #ifdef CAPABILITY_MODE if (IN_CAPABILITY_MODE(td) && (dirfd == AT_FDCWD)) @@ -522,11 +522,8 @@ kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { error = msleep(&so->so_timeo, &so->so_lock, PSOCK | PCATCH, "connec", 0); - if (error != 0) { - if (error == EINTR || error == ERESTART) - interrupted = 1; + if (error != 0) break; - } } if (error == 0) { error = so->so_error; @@ -534,8 +531,6 @@ kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) } SOCK_UNLOCK(so); bad: - if (!interrupted) - so->so_state &= ~SS_ISCONNECTING; if (error == ERESTART) error = EINTR; done1: From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:15:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0971D66CE2D; Tue, 7 Sep 2021 21:15:07 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3yhp65gDz4XJS; Tue, 7 Sep 2021 21:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B17FF19A53; Tue, 7 Sep 2021 21:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LF6fn024514; Tue, 7 Sep 2021 21:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LF6lE024513; Tue, 7 Sep 2021 21:15:06 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:15:06 GMT Message-Id: <202109072115.187LF6lE024513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c751d067c166 - main - Bump __FreeBSD_version for the recent socket KPI changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c751d067c166db71ce8bf3a323c62ac3428bd32a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:15:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c751d067c166db71ce8bf3a323c62ac3428bd32a commit c751d067c166db71ce8bf3a323c62ac3428bd32a Author: Mark Johnston AuthorDate: 2021-09-07 21:14:36 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:14:36 +0000 Bump __FreeBSD_version for the recent socket KPI changes Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 04baa3cf3690..be1488b9011a 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400032 +#define __FreeBSD_version 1400033 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:43:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D602766DD19; Tue, 7 Sep 2021 21:43:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3zKN5ZJHz4kgd; Tue, 7 Sep 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F04619FB2; Tue, 7 Sep 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LhKAY063614; Tue, 7 Sep 2021 21:43:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LhKww063613; Tue, 7 Sep 2021 21:43:20 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:43:20 GMT Message-Id: <202109072143.187LhKww063613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4b631fc832ac - main - routing: fix source address selection rules for IPv4 over IPv6. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b631fc832acf1bab24aa88aa06229d368d8e131 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:43:20 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4b631fc832acf1bab24aa88aa06229d368d8e131 commit 4b631fc832acf1bab24aa88aa06229d368d8e131 Author: Alexander V. Chernikov AuthorDate: 2021-09-06 22:08:15 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-09-07 21:41:05 +0000 routing: fix source address selection rules for IPv4 over IPv6. Current logic always selects an IFA of the same family from the outgoing interfaces. In IPv4 over IPv6 setup there can be just single non-127.0.0.1 ifa, attached to the loopback interface. Create a separate rt_getifa_family() to handle entire ifa selection for the IPv4 over IPv6. Differential Revision: https://reviews.freebsd.org/D31868 MFC after: 1 week --- sys/net/route.c | 38 ++++++++++++++++++++++++++++++++++++++ sys/netinet/in.c | 34 ++++++++++++++++++++++++++++++++++ sys/netinet/in.h | 1 + 3 files changed, 73 insertions(+) diff --git a/sys/net/route.c b/sys/net/route.c index e4ed7d1a2fd1..b99939179ff2 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -534,6 +534,41 @@ info_get_ifp(struct rt_addrinfo *info) return (NULL); } +/* + * Calculates proper ifa/ifp for the cases when gateway AF is different + * from dst AF. + * + * Returns 0 on success. + */ +__noinline static int +rt_getifa_family(struct rt_addrinfo *info, uint32_t fibnum) +{ + if (info->rti_ifp == NULL) { + struct ifaddr *ifa = NULL; + /* + * No transmit interface specified. Guess it by checking gw sa. + */ + const struct sockaddr *gw = info->rti_info[RTAX_GATEWAY]; + ifa = ifa_ifwithroute(RTF_GATEWAY, gw, gw, fibnum); + if (ifa == NULL) + return (ENETUNREACH); + info->rti_ifp = ifa->ifa_ifp; + } + + /* Prefer address from outgoing interface */ + info->rti_ifa = ifaof_ifpforaddr(info->rti_info[RTAX_DST], info->rti_ifp); +#ifdef INET + if (info->rti_ifa == NULL) { + /* Use first found IPv4 address */ + bool loopback_ok = info->rti_ifp->if_flags & IFF_LOOPBACK; + info->rti_ifa = (struct ifaddr *)in_findlocal(fibnum, loopback_ok); + } +#endif + if (info->rti_ifa == NULL) + return (ENETUNREACH); + return (0); +} + /* * Look up rt_addrinfo for a specific fib. * @@ -566,6 +601,9 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) */ if (info->rti_ifa == NULL && ifaaddr != NULL) info->rti_ifa = ifa_ifwithaddr(ifaaddr); + if ((info->rti_ifa == NULL) && ((info->rti_flags & RTF_GATEWAY) != 0) && + (gateway->sa_family != dst->sa_family)) + return (rt_getifa_family(info, fibnum)); if (info->rti_ifa == NULL) { const struct sockaddr *sa; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index ce03c0b6d4cb..e968a559a13c 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -188,6 +188,40 @@ in_localip_more(struct in_ifaddr *original_ia) return (NULL); } +/* + * Tries to find first IPv4 address in the provided fib. + * Prefers non-loopback addresses and return loopback IFF + * @loopback_ok is set. + * + * Returns ifa or NULL. + */ +struct in_ifaddr * +in_findlocal(uint32_t fibnum, bool loopback_ok) +{ + struct rm_priotracker in_ifa_tracker; + struct in_ifaddr *ia = NULL, *ia_lo = NULL; + + NET_EPOCH_ASSERT(); + + IN_IFADDR_RLOCK(&in_ifa_tracker); + CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { + uint32_t ia_fib = ia->ia_ifa.ifa_ifp->if_fib; + if (!V_rt_add_addr_allfibs && (fibnum != ia_fib)) + continue; + + if (!IN_LOOPBACK(ntohl(IA_SIN(ia)->sin_addr.s_addr))) + break; + if (loopback_ok) + ia_lo = ia; + } + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + + if (ia == NULL) + ia = ia_lo; + + return (ia); +} + /* * Determine whether an IP address is in a reserved set of addresses * that may not be forwarded, or whether datagrams to that destination diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 28d6721edc53..0206fd16d2fe 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -651,6 +651,7 @@ int in_canforward(struct in_addr); int in_localaddr(struct in_addr); int in_localip(struct in_addr); int in_ifhasaddr(struct ifnet *, struct in_addr); +struct in_ifaddr *in_findlocal(uint32_t, bool); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ From owner-dev-commits-src-main@freebsd.org Tue Sep 7 23:25:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56FEE66F517; Tue, 7 Sep 2021 23:25:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H41Zv1Y4lz3qf2; Tue, 7 Sep 2021 23:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15E511B88D; Tue, 7 Sep 2021 23:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187NPAus096993; Tue, 7 Sep 2021 23:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187NPAt4096992; Tue, 7 Sep 2021 23:25:10 GMT (envelope-from git) Date: Tue, 7 Sep 2021 23:25:10 GMT Message-Id: <202109072325.187NPAt4096992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 83a611e09238 - main - cxgbe(4): Display HMA information in meminfo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83a611e09238ead5a765c0ea2c02699fe8175756 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 23:25:11 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=83a611e09238ead5a765c0ea2c02699fe8175756 commit 83a611e09238ead5a765c0ea2c02699fe8175756 Author: Navdeep Parhar AuthorDate: 2021-09-07 20:39:44 +0000 Commit: Navdeep Parhar CommitDate: 2021-09-07 23:05:33 +0000 cxgbe(4): Display HMA information in meminfo. This should have been added with initial T6 support many years ago. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 2 +- sys/dev/cxgbe/t4_main.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index c132cb779204..07d8ab2b40f0 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -49,7 +49,7 @@ enum { T5_REGMAP_SIZE = (332 * 1024), }; -enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1 }; +enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1, MEM_HMA }; enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9865bd7048ae..eabe52387227 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -9600,7 +9600,9 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc, i, n; uint32_t lo, hi, used, alloc; - static const char *memory[] = {"EDC0:", "EDC1:", "MC:", "MC0:", "MC1:"}; + static const char *memory[] = { + "EDC0:", "EDC1:", "MC:", "MC0:", "MC1:", "HMA:" + }; static const char *region[] = { "DBQ contexts:", "IMSG contexts:", "FLM cache:", "TCBs:", "Pstructs:", "Timers:", "Rx FL:", "Tx FL:", "Pstruct FL:", @@ -9653,19 +9655,25 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) if (lo & F_EXT_MEM_ENABLE) { hi = t4_read_reg(sc, A_MA_EXT_MEMORY_BAR); avail[i].base = G_EXT_MEM_BASE(hi) << 20; - avail[i].limit = avail[i].base + - (G_EXT_MEM_SIZE(hi) << 20); + avail[i].limit = avail[i].base + (G_EXT_MEM_SIZE(hi) << 20); avail[i].idx = is_t5(sc) ? 3 : 2; /* Call it MC0 for T5 */ i++; } if (is_t5(sc) && lo & F_EXT_MEM1_ENABLE) { hi = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR); avail[i].base = G_EXT_MEM1_BASE(hi) << 20; - avail[i].limit = avail[i].base + - (G_EXT_MEM1_SIZE(hi) << 20); + avail[i].limit = avail[i].base + (G_EXT_MEM1_SIZE(hi) << 20); avail[i].idx = 4; i++; } + if (is_t6(sc) && lo & F_HMA_MUX) { + hi = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR); + avail[i].base = G_EXT_MEM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + (G_EXT_MEM1_SIZE(hi) << 20); + avail[i].idx = 5; + i++; + } + MPASS(i <= nitems(avail)); if (!i) /* no memory available */ goto done; qsort(avail, i, sizeof(struct mem_desc), mem_desc_cmp); From owner-dev-commits-src-main@freebsd.org Tue Sep 7 23:53:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4923266FAEF; Tue, 7 Sep 2021 23:53:50 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H42Cy1VfCz4SVr; Tue, 7 Sep 2021 23:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 132C31BD11; Tue, 7 Sep 2021 23:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187NrnBT036442; Tue, 7 Sep 2021 23:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187Nrn6C036441; Tue, 7 Sep 2021 23:53:49 GMT (envelope-from git) Date: Tue, 7 Sep 2021 23:53:49 GMT Message-Id: <202109072353.187Nrn6C036441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 92de73799666 - main - cxgbe(4): Fix the decode and display of the DBVFIFO region in meminfo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92de737996660b70376a8b72b80037f89d876056 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 23:53:50 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=92de737996660b70376a8b72b80037f89d876056 commit 92de737996660b70376a8b72b80037f89d876056 Author: Navdeep Parhar AuthorDate: 2021-09-07 23:28:11 +0000 Commit: Navdeep Parhar CommitDate: 2021-09-07 23:28:11 +0000 cxgbe(4): Fix the decode and display of the DBVFIFO region in meminfo. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index eabe52387227..af24977ec29b 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -9728,23 +9728,24 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) #undef ulp_region md->base = 0; - md->idx = nitems(region); - if (!is_t4(sc)) { + if (is_t4(sc)) + md->idx = nitems(region); + else { uint32_t size = 0; uint32_t sge_ctrl = t4_read_reg(sc, A_SGE_CONTROL2); uint32_t fifo_size = t4_read_reg(sc, A_SGE_DBVFIFO_SIZE); if (is_t5(sc)) { if (sge_ctrl & F_VFIFO_ENABLE) - size = G_DBVFIFO_SIZE(fifo_size); + size = fifo_size << 2; } else - size = G_T6_DBVFIFO_SIZE(fifo_size); + size = G_T6_DBVFIFO_SIZE(fifo_size) << 6; if (size) { - md->base = G_BASEADDR(t4_read_reg(sc, - A_SGE_DBVFIFO_BADDR)); - md->limit = md->base + (size << 2) - 1; - } + md->base = t4_read_reg(sc, A_SGE_DBVFIFO_BADDR); + md->limit = md->base + size - 1; + } else + md->idx = nitems(region); } md++; From owner-dev-commits-src-main@freebsd.org Wed Sep 8 00:39:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 482A067126C; Wed, 8 Sep 2021 00:39:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H43D41YZ0z4jc2; Wed, 8 Sep 2021 00:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 151F01C5CD; Wed, 8 Sep 2021 00:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1880cxdQ090721; Wed, 8 Sep 2021 00:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1880cxvH090720; Wed, 8 Sep 2021 00:38:59 GMT (envelope-from git) Date: Wed, 8 Sep 2021 00:38:59 GMT Message-Id: <202109080038.1880cxvH090720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c5128c48df3c - main - VOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5128c48df3c2f3828432aff2ea536bb9c887e14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 00:39:00 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c5128c48df3c2f3828432aff2ea536bb9c887e14 commit c5128c48df3c2f3828432aff2ea536bb9c887e14 Author: Rick Macklem AuthorDate: 2021-09-08 00:35:26 +0000 Commit: Rick Macklem CommitDate: 2021-09-08 00:35:26 +0000 VOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag Although it is not specified in the RFCs, the concept that the NFSv4 server should reply to an RPC request within a reasonable time is accepted practice within the NFSv4 community. Without this patch, the NFSv4.2 server attempts to reply to a Copy operation within 1second by limiting the copy to vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at best, given the large variation in I/O subsystem performance. This patch adds a kernel only flag COPY_FILE_RANGE_TIMEO1SEC that the NFSv4.2 can specify, which tells VOP_COPY_FILE_RANGE() to return after approximately 1 second with a partial result and implements this in vn_generic_copy_file_range(), used by vop_stdcopyfilerange(). Modifying the NFSv4.2 server to set this flag will be done in a separate patch. Also under consideration is exposing the COPY_FILE_RANGE_TIMEO1SEC to userland for use on the FreeBSD copy_file_range(2) syscall. MFC after: 2 weeks Reviewed by: khng Differential Revision: https://reviews.freebsd.org/D31829 --- sys/kern/vfs_vnops.c | 31 +++++++++++++++++++++++++++++-- sys/sys/vnode.h | 4 ++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index bf1270dc8ad8..93d5a9e6b127 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3162,6 +3162,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, size_t copylen, len, rem, savlen; char *dat; long holein, holeout; + struct timespec curts, endts; holein = holeout = 0; savlen = len = *lenp; @@ -3258,7 +3259,15 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, * in the inner loop where the data copying is done. * Note that some file systems such as NFSv3, NFSv4.0 and NFSv4.1 may * support holes on the server, but do not support FIOSEEKHOLE. + * The kernel flag COPY_FILE_RANGE_TIMEO1SEC is used to indicate + * that this function should return after 1second with a partial + * completion. */ + if ((flags & COPY_FILE_RANGE_TIMEO1SEC) != 0) { + getnanouptime(&endts); + endts.tv_sec++; + } else + timespecclear(&endts); holetoeof = eof = false; while (len > 0 && error == 0 && !eof && interrupted == 0) { endoff = 0; /* To shut up compilers. */ @@ -3327,8 +3336,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, *inoffp += xfer; *outoffp += xfer; len -= xfer; - if (len < savlen) + if (len < savlen) { interrupted = sig_intr(); + if (timespecisset(&endts) && + interrupted == 0) { + getnanouptime(&curts); + if (timespeccmp(&curts, + &endts, >=)) + interrupted = + EINTR; + } + } } } copylen = MIN(len, endoff - startoff); @@ -3391,8 +3409,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, *outoffp += xfer; copylen -= xfer; len -= xfer; - if (len < savlen) + if (len < savlen) { interrupted = sig_intr(); + if (timespecisset(&endts) && + interrupted == 0) { + getnanouptime(&curts); + if (timespeccmp(&curts, + &endts, >=)) + interrupted = + EINTR; + } + } } } xfer = blksize; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 61c6a13010f6..81f3f3d5489c 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -616,6 +616,10 @@ typedef void vop_getpages_iodone_t(void *, vm_page_t *, int, int); #define VN_OPEN_NAMECACHE 0x00000004 #define VN_OPEN_INVFS 0x00000008 +/* copy_file_range kernel flags */ +#define COPY_FILE_RANGE_KFLAGS 0xff000000 +#define COPY_FILE_RANGE_TIMEO1SEC 0x01000000 /* Return after 1sec. */ + /* * Public vnode manipulation functions. */ From owner-dev-commits-src-main@freebsd.org Wed Sep 8 01:07:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E68567133E; Wed, 8 Sep 2021 01:07:52 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H43sN1jbRz4qrM; Wed, 8 Sep 2021 01:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A3881CA43; Wed, 8 Sep 2021 01:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18817qkY030854; Wed, 8 Sep 2021 01:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18817pdj030849; Wed, 8 Sep 2021 01:07:51 GMT (envelope-from git) Date: Wed, 8 Sep 2021 01:07:51 GMT Message-Id: <202109080107.18817pdj030849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19261079b74319502c6ffa1249920079f0f69a72 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 01:07:52 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 commit 19261079b74319502c6ffa1249920079f0f69a72 Merge: c5128c48df3c 66719ee573ac Author: Ed Maste AuthorDate: 2021-09-08 01:05:51 +0000 Commit: Ed Maste CommitDate: 2021-09-08 01:05:51 +0000 openssh: update to OpenSSH v8.7p1 Some notable changes, from upstream's release notes: - sshd(8): Remove support for obsolete "host/port" syntax. - ssh(1): When prompting whether to record a new host key, accept the key fingerprint as a synonym for "yes". - ssh-keygen(1): when acting as a CA and signing certificates with an RSA key, default to using the rsa-sha2-512 signature algorithm. - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" (RSA/SHA1) algorithm from those accepted for certificate signatures. - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F support to provide address-space isolation for token middleware libraries (including the internal one). - ssh(1): this release enables UpdateHostkeys by default subject to some conservative preconditions. - scp(1): this release changes the behaviour of remote to remote copies (e.g. "scp host-a:/path host-b:") to transfer through the local host by default. - scp(1): experimental support for transfers using the SFTP protocol as a replacement for the venerable SCP/RCP protocol that it has traditionally used. Additional integration work is needed to support FIDO/U2F in the base system. Deprecation Notice ------------------ OpenSSH will disable the ssh-rsa signature scheme by default in the next release. Reviewed by: imp MFC after: 1 month Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29985 crypto/openssh/.depend | 354 +- crypto/openssh/.github/ci-status.md | 4 + crypto/openssh/.github/configs | 170 + crypto/openssh/.github/configure.sh | 6 + crypto/openssh/.github/run_test.sh | 34 + crypto/openssh/.github/setup_ci.sh | 115 + crypto/openssh/.github/workflows/c-cpp.yml | 76 + crypto/openssh/.github/workflows/selfhosted.yml | 93 + crypto/openssh/.github/workflows/upstream.yml | 43 + crypto/openssh/.gitignore | 8 + crypto/openssh/.skipped-commit-ids | 18 + crypto/openssh/CREDITS | 2 +- crypto/openssh/ChangeLog | 16777 ++++++++++++------- crypto/openssh/FREEBSD-vendor | 4 +- crypto/openssh/INSTALL | 79 +- crypto/openssh/LICENCE | 64 +- crypto/openssh/Makefile.in | 328 +- crypto/openssh/OVERVIEW | 7 +- crypto/openssh/PROTOCOL | 89 +- crypto/openssh/PROTOCOL.agent | 6 +- crypto/openssh/PROTOCOL.certkeys | 35 +- crypto/openssh/PROTOCOL.chacha20poly1305 | 4 +- crypto/openssh/PROTOCOL.key | 9 +- crypto/openssh/PROTOCOL.mux | 4 +- crypto/openssh/PROTOCOL.sshsig | 100 + crypto/openssh/PROTOCOL.u2f | 309 + crypto/openssh/README | 36 +- crypto/openssh/README.dns | 8 +- crypto/openssh/README.md | 84 + crypto/openssh/README.platform | 16 +- crypto/openssh/README.privsep | 11 +- crypto/openssh/aclocal.m4 | 193 +- crypto/openssh/addr.c | 423 + crypto/openssh/addr.h | 60 + crypto/openssh/addrmatch.c | 351 +- crypto/openssh/atomicio.c | 32 +- crypto/openssh/atomicio.h | 4 +- crypto/openssh/audit-bsm.c | 41 +- crypto/openssh/audit-linux.c | 4 +- crypto/openssh/audit.c | 2 +- crypto/openssh/audit.h | 4 +- crypto/openssh/auth-bsdauth.c | 2 - crypto/openssh/auth-krb5.c | 19 +- crypto/openssh/auth-options.c | 194 +- crypto/openssh/auth-options.h | 13 +- crypto/openssh/auth-pam.c | 119 +- crypto/openssh/auth-pam.h | 2 +- crypto/openssh/auth-passwd.c | 6 +- crypto/openssh/auth-rhosts.c | 19 +- crypto/openssh/auth-skey.c | 107 - crypto/openssh/auth.c | 303 +- crypto/openssh/auth.h | 36 +- crypto/openssh/auth2-chall.c | 43 +- crypto/openssh/auth2-gss.c | 29 +- crypto/openssh/auth2-hostbased.c | 71 +- crypto/openssh/auth2-kbdint.c | 8 +- crypto/openssh/auth2-none.c | 4 +- crypto/openssh/auth2-passwd.c | 9 +- crypto/openssh/auth2-pubkey.c | 264 +- crypto/openssh/auth2.c | 209 +- crypto/openssh/authfd.c | 178 +- crypto/openssh/authfd.h | 12 +- crypto/openssh/authfile.c | 265 +- crypto/openssh/authfile.h | 10 +- crypto/openssh/blacklist.c | 6 +- crypto/openssh/buildpkg.sh.in | 8 +- crypto/openssh/canohost.c | 12 +- crypto/openssh/chacha.h | 4 +- crypto/openssh/channels.c | 761 +- crypto/openssh/channels.h | 38 +- crypto/openssh/cipher-chachapoly-libcrypto.c | 166 + crypto/openssh/cipher-chachapoly.c | 32 +- crypto/openssh/cipher-chachapoly.h | 13 +- crypto/openssh/cipher.c | 48 +- crypto/openssh/cipher.h | 5 +- crypto/openssh/clientloop.c | 1074 +- crypto/openssh/clientloop.h | 5 +- crypto/openssh/compat.c | 92 +- crypto/openssh/compat.h | 20 +- crypto/openssh/config.guess | 882 +- crypto/openssh/config.h | 241 +- crypto/openssh/config.sub | 2528 ++- crypto/openssh/configure.ac | 970 +- crypto/openssh/contrib/Makefile | 6 +- crypto/openssh/contrib/cygwin/README | 4 +- crypto/openssh/contrib/cygwin/ssh-host-config | 59 +- crypto/openssh/contrib/findssl.sh | 0 crypto/openssh/contrib/gnome-ssh-askpass1.c | 7 +- crypto/openssh/contrib/gnome-ssh-askpass2.c | 210 +- crypto/openssh/contrib/gnome-ssh-askpass3.c | 305 + crypto/openssh/contrib/redhat/gnome-ssh-askpass.sh | 0 crypto/openssh/contrib/redhat/openssh.spec | 55 +- crypto/openssh/contrib/solaris/README | 0 crypto/openssh/contrib/ssh-copy-id | 303 +- crypto/openssh/contrib/ssh-copy-id.1 | 11 +- crypto/openssh/contrib/suse/openssh.spec | 6 +- crypto/openssh/crc32.c | 105 - crypto/openssh/crc32.h | 30 - crypto/openssh/crypto_api.h | 20 +- crypto/openssh/defines.h | 54 +- crypto/openssh/dh.c | 39 +- crypto/openssh/dh.h | 10 +- crypto/openssh/digest-libc.c | 33 +- crypto/openssh/digest-openssl.c | 19 +- crypto/openssh/dispatch.c | 6 +- crypto/openssh/dispatch.h | 9 +- crypto/openssh/dns.c | 72 +- crypto/openssh/dns.h | 3 +- crypto/openssh/entropy.c | 175 +- crypto/openssh/fatal.c | 7 +- crypto/openssh/groupaccess.c | 5 +- crypto/openssh/gss-genr.c | 19 +- crypto/openssh/gss-serv.c | 4 +- crypto/openssh/hash.c | 36 +- crypto/openssh/hmac.c | 7 +- crypto/openssh/hostfile.c | 269 +- crypto/openssh/hostfile.h | 27 +- crypto/openssh/int32_minmax.inc | 0 crypto/openssh/kex.c | 490 +- crypto/openssh/kex.h | 92 +- crypto/openssh/kexc25519.c | 182 +- crypto/openssh/kexc25519c.c | 169 - crypto/openssh/kexc25519s.c | 158 - crypto/openssh/kexdh.c | 205 +- crypto/openssh/kexdhc.c | 224 - crypto/openssh/kexdhs.c | 222 - crypto/openssh/kexecdh.c | 239 +- crypto/openssh/kexecdhc.c | 222 - crypto/openssh/kexecdhs.c | 203 - crypto/openssh/kexgen.c | 346 + crypto/openssh/kexgex.c | 30 +- crypto/openssh/kexgexc.c | 123 +- crypto/openssh/kexgexs.c | 119 +- crypto/openssh/kexsntrup761x25519.c | 251 + crypto/openssh/krl.c | 223 +- crypto/openssh/krl.h | 5 +- crypto/openssh/log.c | 219 +- crypto/openssh/log.h | 93 +- crypto/openssh/loginrec.c | 13 +- crypto/openssh/loginrec.h | 7 +- crypto/openssh/logintest.c | 60 +- crypto/openssh/m4/openssh.m4 | 200 + crypto/openssh/mac.c | 7 +- crypto/openssh/match.c | 34 +- crypto/openssh/match.h | 7 +- crypto/openssh/misc.c | 962 +- crypto/openssh/misc.h | 75 +- crypto/openssh/moduli | 876 +- crypto/openssh/moduli.c | 29 +- crypto/openssh/monitor.c | 708 +- crypto/openssh/monitor.h | 13 +- crypto/openssh/monitor_fdpass.c | 24 +- crypto/openssh/monitor_wrap.c | 305 +- crypto/openssh/monitor_wrap.h | 26 +- crypto/openssh/msg.c | 18 +- crypto/openssh/mux.c | 640 +- crypto/openssh/myproposal.h | 144 +- crypto/openssh/nchan.c | 77 +- crypto/openssh/opacket.c | 320 - crypto/openssh/opacket.h | 154 - crypto/openssh/openbsd-compat/Makefile.in | 11 +- crypto/openssh/openbsd-compat/arc4random.c | 12 +- crypto/openssh/openbsd-compat/base64.c | 2 +- crypto/openssh/openbsd-compat/bcrypt_pbkdf.c | 4 +- crypto/openssh/openbsd-compat/bsd-closefrom.c | 88 +- crypto/openssh/openbsd-compat/bsd-cygwin_util.c | 149 + crypto/openssh/openbsd-compat/bsd-cygwin_util.h | 1 + crypto/openssh/openbsd-compat/bsd-misc.c | 113 + crypto/openssh/openbsd-compat/bsd-misc.h | 41 +- crypto/openssh/openbsd-compat/bsd-openpty.c | 17 +- crypto/openssh/openbsd-compat/bsd-poll.h | 2 +- crypto/openssh/openbsd-compat/bsd-pselect.c | 205 + crypto/openssh/openbsd-compat/bsd-setres_id.c | 12 +- crypto/openssh/openbsd-compat/bsd-signal.c | 29 +- crypto/openssh/openbsd-compat/bsd-signal.h | 7 +- crypto/openssh/openbsd-compat/bsd-snprintf.c | 18 +- crypto/openssh/openbsd-compat/bsd-statvfs.c | 10 +- crypto/openssh/openbsd-compat/bsd-waitpid.h | 2 +- crypto/openssh/openbsd-compat/explicit_bzero.c | 10 +- crypto/openssh/openbsd-compat/fnmatch.c | 495 + crypto/openssh/openbsd-compat/fnmatch.h | 66 + crypto/openssh/openbsd-compat/getopt_long.c | 2 +- crypto/openssh/openbsd-compat/glob.c | 157 +- crypto/openssh/openbsd-compat/glob.h | 9 +- .../openssh/openbsd-compat/libressl-api-compat.c | 6 +- crypto/openssh/openbsd-compat/memmem.c | 196 + crypto/openssh/openbsd-compat/mktemp.c | 4 +- crypto/openssh/openbsd-compat/openbsd-compat.h | 42 +- crypto/openssh/openbsd-compat/openssl-compat.c | 22 +- crypto/openssh/openbsd-compat/openssl-compat.h | 59 +- crypto/openssh/openbsd-compat/port-aix.c | 25 +- crypto/openssh/openbsd-compat/port-aix.h | 7 +- crypto/openssh/openbsd-compat/port-irix.c | 2 + crypto/openssh/openbsd-compat/port-linux.c | 25 +- crypto/openssh/openbsd-compat/port-net.c | 18 +- crypto/openssh/openbsd-compat/port-prngd.c | 164 + crypto/openssh/openbsd-compat/port-solaris.c | 14 +- crypto/openssh/openbsd-compat/port-uw.c | 2 +- crypto/openssh/openbsd-compat/pwcache.c | 4 +- crypto/openssh/openbsd-compat/regress/Makefile.in | 4 +- .../openssh/openbsd-compat/regress/closefromtest.c | 4 +- .../openbsd-compat/regress/opensslvertest.c | 2 + .../openssh/openbsd-compat/regress/snprintftest.c | 5 +- crypto/openssh/openbsd-compat/regress/strduptest.c | 2 + .../openssh/openbsd-compat/regress/strtonumtest.c | 2 + .../openssh/openbsd-compat/regress/utimensattest.c | 120 + crypto/openssh/openbsd-compat/rmd160.c | 378 - crypto/openssh/openbsd-compat/rmd160.h | 61 - crypto/openssh/openbsd-compat/setenv.c | 2 + crypto/openssh/openbsd-compat/setproctitle.c | 1 + crypto/openssh/openbsd-compat/sha1.c | 13 +- crypto/openssh/openbsd-compat/sha2.c | 336 +- crypto/openssh/openbsd-compat/sha2.h | 138 +- crypto/openssh/openbsd-compat/strtonum.c | 6 +- crypto/openssh/openbsd-compat/sys-queue.h | 376 +- crypto/openssh/packet.c | 264 +- crypto/openssh/packet.h | 14 +- crypto/openssh/pathnames.h | 9 +- crypto/openssh/platform.c | 1 + crypto/openssh/progressmeter.c | 60 +- crypto/openssh/progressmeter.h | 3 +- crypto/openssh/readconf.c | 1338 +- crypto/openssh/readconf.h | 37 +- crypto/openssh/readpass.c | 191 +- crypto/openssh/regress/Makefile | 75 +- crypto/openssh/regress/README.regress | 80 +- crypto/openssh/regress/addrmatch.sh | 16 +- crypto/openssh/regress/agent-getpeereid.sh | 6 +- crypto/openssh/regress/agent-pkcs11.sh | 99 +- crypto/openssh/regress/agent-ptrace.sh | 2 +- crypto/openssh/regress/agent-subprocess.sh | 22 + crypto/openssh/regress/agent-timeout.sh | 12 +- crypto/openssh/regress/agent.sh | 124 +- crypto/openssh/regress/allow-deny-users.sh | 8 +- crypto/openssh/regress/banner.sh | 6 +- crypto/openssh/regress/cert-file.sh | 4 +- crypto/openssh/regress/cert-hostkey.sh | 36 +- crypto/openssh/regress/cert-userkey.sh | 53 +- crypto/openssh/regress/cfginclude.sh | 24 +- crypto/openssh/regress/cfgmatch.sh | 55 +- crypto/openssh/regress/cfgparse.sh | 0 crypto/openssh/regress/conch-ciphers.sh | 4 +- crypto/openssh/regress/connect-privsep.sh | 5 +- crypto/openssh/regress/connect.sh | 11 +- crypto/openssh/regress/dhgex.sh | 14 +- crypto/openssh/regress/ed25519_openssh.prv | 7 + crypto/openssh/regress/ed25519_openssh.pub | 1 + crypto/openssh/regress/forward-control.sh | 6 +- crypto/openssh/regress/forwarding.sh | 44 +- crypto/openssh/regress/host-expand.sh | 0 crypto/openssh/regress/hostkey-agent.sh | 10 +- crypto/openssh/regress/hostkey-rotate.sh | 80 +- crypto/openssh/regress/integrity.sh | 8 +- crypto/openssh/regress/kextype.sh | 0 crypto/openssh/regress/key-options.sh | 10 +- crypto/openssh/regress/keygen-change.sh | 7 +- crypto/openssh/regress/keygen-comment.sh | 52 + crypto/openssh/regress/keygen-convert.sh | 54 +- crypto/openssh/regress/keygen-knownhosts.sh | 0 crypto/openssh/regress/keygen-moduli.sh | 17 +- crypto/openssh/regress/keygen-sshfp.sh | 29 + crypto/openssh/regress/keys-command.sh | 11 +- crypto/openssh/regress/keyscan.sh | 17 +- crypto/openssh/regress/keytype.sh | 57 +- crypto/openssh/regress/knownhosts-command.sh | 53 + crypto/openssh/regress/krl.sh | 41 +- crypto/openssh/regress/limit-keytype.sh | 69 +- crypto/openssh/regress/localcommand.sh | 0 crypto/openssh/regress/misc/Makefile | 2 +- crypto/openssh/regress/misc/fuzz-harness/Makefile | 51 +- .../regress/misc/fuzz-harness/agent_fuzz.cc | 15 + .../regress/misc/fuzz-harness/agent_fuzz_helper.c | 177 + .../openssh/regress/misc/fuzz-harness/fixed-keys.h | 119 + .../openssh/regress/misc/fuzz-harness/kex_fuzz.cc | 461 + .../regress/misc/fuzz-harness/privkey_fuzz.cc | 21 + .../openssh/regress/misc/fuzz-harness/sig_fuzz.cc | 24 +- .../regress/misc/fuzz-harness/ssh-sk-null.cc | 51 + .../regress/misc/fuzz-harness/sshsig_fuzz.cc | 37 + .../regress/misc/fuzz-harness/sshsigopt_fuzz.cc | 29 + .../regress/misc/fuzz-harness/testdata/README | 4 + .../fuzz-harness/testdata/create-agent-corpus.sh | 44 + .../regress/misc/fuzz-harness/testdata/id_dsa | 21 + .../misc/fuzz-harness/testdata/id_dsa-cert.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_dsa.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_ecdsa | 8 + .../misc/fuzz-harness/testdata/id_ecdsa-cert.pub | 1 + .../misc/fuzz-harness/testdata/id_ecdsa.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_ecdsa_sk | 14 + .../fuzz-harness/testdata/id_ecdsa_sk-cert.pub | 1 + .../misc/fuzz-harness/testdata/id_ecdsa_sk.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_ed25519 | 7 + .../misc/fuzz-harness/testdata/id_ed25519-cert.pub | 1 + .../misc/fuzz-harness/testdata/id_ed25519.pub | 2 + .../misc/fuzz-harness/testdata/id_ed25519_sk | 8 + .../fuzz-harness/testdata/id_ed25519_sk-cert.pub | 1 + .../misc/fuzz-harness/testdata/id_ed25519_sk.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_rsa | 27 + .../misc/fuzz-harness/testdata/id_rsa-cert.pub | 1 + .../regress/misc/fuzz-harness/testdata/id_rsa.pub | 1 + crypto/openssh/regress/misc/kexfuzz/Makefile | 88 - crypto/openssh/regress/misc/kexfuzz/README | 34 - crypto/openssh/regress/misc/kexfuzz/kexfuzz.c | 459 - crypto/openssh/regress/misc/sk-dummy/fatal.c | 27 + crypto/openssh/regress/misc/sk-dummy/sk-dummy.c | 539 + crypto/openssh/regress/modpipe.c | 0 crypto/openssh/regress/multiplex.sh | 32 +- crypto/openssh/regress/multipubkey.sh | 19 +- crypto/openssh/regress/netcat.c | 46 +- crypto/openssh/regress/percent.sh | 119 + crypto/openssh/regress/portnum.sh | 0 crypto/openssh/regress/principals-command.sh | 16 +- crypto/openssh/regress/proxy-connect.sh | 10 +- crypto/openssh/regress/putty-ciphers.sh | 4 +- crypto/openssh/regress/putty-kex.sh | 4 +- crypto/openssh/regress/putty-transfer.sh | 10 +- crypto/openssh/regress/reconfigure.sh | 24 +- crypto/openssh/regress/reexec.sh | 5 +- crypto/openssh/regress/rekey.sh | 8 +- crypto/openssh/regress/scp-ssh-wrapper.sh | 14 +- crypto/openssh/regress/scp-uri.sh | 81 +- crypto/openssh/regress/scp.sh | 183 +- crypto/openssh/regress/scp3.sh | 60 + crypto/openssh/regress/servcfginclude.sh | 188 + crypto/openssh/regress/sftp-badcmds.sh | 4 +- crypto/openssh/regress/sftp-chroot.sh | 7 +- crypto/openssh/regress/sftp-cmds.sh | 4 - crypto/openssh/regress/sftp-perm.sh | 18 +- crypto/openssh/regress/ssh2putty.sh | 8 +- crypto/openssh/regress/sshcfgparse.sh | 68 +- crypto/openssh/regress/sshfp-connect.sh | 66 + crypto/openssh/regress/sshsig.sh | 236 + crypto/openssh/regress/test-exec.sh | 280 +- crypto/openssh/regress/unittests/Makefile | 4 +- crypto/openssh/regress/unittests/Makefile.inc | 38 +- crypto/openssh/regress/unittests/authopt/tests.c | 10 +- crypto/openssh/regress/unittests/bitmap/tests.c | 4 + .../openssh/regress/unittests/conversion/Makefile | 3 +- .../openssh/regress/unittests/conversion/tests.c | 32 +- crypto/openssh/regress/unittests/hostkeys/Makefile | 12 +- .../regress/unittests/hostkeys/mktestdata.sh | 0 .../regress/unittests/hostkeys/test_iterate.c | 119 +- crypto/openssh/regress/unittests/kex/Makefile | 31 +- crypto/openssh/regress/unittests/kex/test_kex.c | 29 +- crypto/openssh/regress/unittests/match/Makefile | 4 +- crypto/openssh/regress/unittests/match/tests.c | 4 +- crypto/openssh/regress/unittests/misc/test_argv.c | 187 + .../openssh/regress/unittests/misc/test_convtime.c | 59 + .../openssh/regress/unittests/misc/test_expand.c | 90 + crypto/openssh/regress/unittests/misc/test_parse.c | 86 + .../openssh/regress/unittests/misc/test_strdelim.c | 202 + crypto/openssh/regress/unittests/misc/tests.c | 38 + crypto/openssh/regress/unittests/sshbuf/Makefile | 10 +- .../regress/unittests/sshbuf/test_sshbuf_fuzz.c | 9 +- .../unittests/sshbuf/test_sshbuf_getput_basic.c | 231 +- .../unittests/sshbuf/test_sshbuf_getput_crypto.c | 160 +- .../unittests/sshbuf/test_sshbuf_getput_fuzz.c | 31 +- .../regress/unittests/sshbuf/test_sshbuf_misc.c | 71 +- crypto/openssh/regress/unittests/sshbuf/tests.c | 2 + crypto/openssh/regress/unittests/sshkey/Makefile | 14 +- crypto/openssh/regress/unittests/sshkey/common.c | 17 +- .../openssh/regress/unittests/sshkey/mktestdata.sh | 85 +- .../openssh/regress/unittests/sshkey/test_file.c | 141 +- .../openssh/regress/unittests/sshkey/test_fuzz.c | 78 +- .../openssh/regress/unittests/sshkey/test_sshkey.c | 55 +- .../regress/unittests/sshkey/testdata/dsa_n | 33 +- .../regress/unittests/sshkey/testdata/ecdsa_n | 13 +- .../regress/unittests/sshkey/testdata/ecdsa_sk1 | 13 + .../unittests/sshkey/testdata/ecdsa_sk1-cert.fp | 1 + .../unittests/sshkey/testdata/ecdsa_sk1-cert.pub | 1 + .../regress/unittests/sshkey/testdata/ecdsa_sk1.fp | 1 + .../unittests/sshkey/testdata/ecdsa_sk1.fp.bb | 1 + .../unittests/sshkey/testdata/ecdsa_sk1.pub | 1 + .../regress/unittests/sshkey/testdata/ecdsa_sk1_pw | 14 + .../regress/unittests/sshkey/testdata/ecdsa_sk2 | 13 + .../regress/unittests/sshkey/testdata/ecdsa_sk2.fp | 1 + .../unittests/sshkey/testdata/ecdsa_sk2.fp.bb | 1 + .../unittests/sshkey/testdata/ecdsa_sk2.pub | 1 + .../regress/unittests/sshkey/testdata/ed25519_1_pw | 12 +- .../regress/unittests/sshkey/testdata/ed25519_sk1 | 8 + .../unittests/sshkey/testdata/ed25519_sk1-cert.fp | 1 + .../unittests/sshkey/testdata/ed25519_sk1-cert.pub | 1 + .../unittests/sshkey/testdata/ed25519_sk1.fp | 1 + .../unittests/sshkey/testdata/ed25519_sk1.fp.bb | 1 + .../unittests/sshkey/testdata/ed25519_sk1.pub | 1 + .../unittests/sshkey/testdata/ed25519_sk1_pw | 9 + .../regress/unittests/sshkey/testdata/ed25519_sk2 | 8 + .../unittests/sshkey/testdata/ed25519_sk2.fp | 1 + .../unittests/sshkey/testdata/ed25519_sk2.fp.bb | 1 + .../unittests/sshkey/testdata/ed25519_sk2.pub | 1 + .../regress/unittests/sshkey/testdata/rsa1_1 | Bin 533 -> 0 bytes .../regress/unittests/sshkey/testdata/rsa1_1.fp | 1 - .../regress/unittests/sshkey/testdata/rsa1_1.fp.bb | 1 - .../unittests/sshkey/testdata/rsa1_1.param.n | 1 - .../regress/unittests/sshkey/testdata/rsa1_1.pub | 1 - .../regress/unittests/sshkey/testdata/rsa1_1_pw | Bin 533 -> 0 bytes .../regress/unittests/sshkey/testdata/rsa1_2 | Bin 981 -> 0 bytes .../regress/unittests/sshkey/testdata/rsa1_2.fp | 1 - .../regress/unittests/sshkey/testdata/rsa1_2.fp.bb | 1 - .../unittests/sshkey/testdata/rsa1_2.param.n | 1 - .../regress/unittests/sshkey/testdata/rsa1_2.pub | 1 - .../regress/unittests/sshkey/testdata/rsa_n | 31 +- crypto/openssh/regress/unittests/sshkey/tests.c | 5 - crypto/openssh/regress/unittests/sshsig/Makefile | 25 + .../openssh/regress/unittests/sshsig/mktestdata.sh | 42 + .../openssh/regress/unittests/sshsig/testdata/dsa | 12 + .../regress/unittests/sshsig/testdata/dsa.pub | 1 + .../regress/unittests/sshsig/testdata/dsa.sig | 13 + .../regress/unittests/sshsig/testdata/ecdsa | 5 + .../regress/unittests/sshsig/testdata/ecdsa.pub | 1 + .../regress/unittests/sshsig/testdata/ecdsa.sig | 7 + .../regress/unittests/sshsig/testdata/ecdsa_sk | 13 + .../regress/unittests/sshsig/testdata/ecdsa_sk.pub | 1 + .../regress/unittests/sshsig/testdata/ecdsa_sk.sig | 8 + .../sshsig/testdata/ecdsa_sk_webauthn.pub | 1 + .../sshsig/testdata/ecdsa_sk_webauthn.sig | 13 + .../regress/unittests/sshsig/testdata/ed25519 | 7 + .../regress/unittests/sshsig/testdata/ed25519.pub | 1 + .../regress/unittests/sshsig/testdata/ed25519.sig | 6 + .../regress/unittests/sshsig/testdata/ed25519_sk | 8 + .../unittests/sshsig/testdata/ed25519_sk.pub | 1 + .../unittests/sshsig/testdata/ed25519_sk.sig | 7 + .../regress/unittests/sshsig/testdata/namespace | 1 + .../openssh/regress/unittests/sshsig/testdata/rsa | 39 + .../regress/unittests/sshsig/testdata/rsa.pub | 1 + .../regress/unittests/sshsig/testdata/rsa.sig | 19 + .../regress/unittests/sshsig/testdata/signed-data | 1 + crypto/openssh/regress/unittests/sshsig/tests.c | 139 + .../openssh/regress/unittests/sshsig/webauthn.html | 766 + .../regress/unittests/test_helper/test_helper.c | 60 +- .../regress/unittests/test_helper/test_helper.h | 8 +- crypto/openssh/regress/unittests/utf8/tests.c | 2 + crypto/openssh/regress/valgrind-unit.sh | 2 + crypto/openssh/sandbox-darwin.c | 2 +- crypto/openssh/sandbox-pledge.c | 8 +- crypto/openssh/sandbox-rlimit.c | 18 +- crypto/openssh/sandbox-seccomp-filter.c | 76 +- crypto/openssh/sandbox-systrace.c | 7 +- crypto/openssh/scp.1 | 87 +- crypto/openssh/scp.c | 679 +- crypto/openssh/servconf.c | 1165 +- crypto/openssh/servconf.h | 63 +- crypto/openssh/serverloop.c | 566 +- crypto/openssh/session.c | 461 +- crypto/openssh/sftp-client.c | 1162 +- crypto/openssh/sftp-client.h | 64 +- crypto/openssh/sftp-common.c | 5 +- crypto/openssh/sftp-glob.c | 4 +- .../{openbsd-compat/realpath.c => sftp-realpath.c} | 13 +- crypto/openssh/sftp-server-main.c | 5 +- crypto/openssh/sftp-server.8 | 32 +- crypto/openssh/sftp-server.c | 491 +- crypto/openssh/sftp.1 | 126 +- crypto/openssh/sftp.c | 304 +- crypto/openssh/sk-api.h | 98 + crypto/openssh/sk-usbhid.c | 1267 ++ crypto/openssh/sntrup761.c | 1273 ++ crypto/openssh/sntrup761.sh | 85 + crypto/openssh/srclimit.c | 140 + crypto/openssh/srclimit.h | 18 + crypto/openssh/ssh-add.1 | 81 +- crypto/openssh/ssh-add.c | 315 +- crypto/openssh/ssh-agent.1 | 178 +- crypto/openssh/ssh-agent.c | 697 +- crypto/openssh/ssh-dss.c | 8 +- crypto/openssh/ssh-ecdsa-sk.c | 324 + crypto/openssh/ssh-ecdsa.c | 14 +- crypto/openssh/ssh-ed25519-sk.c | 163 + crypto/openssh/ssh-ed25519.c | 23 +- crypto/openssh/ssh-gss.h | 4 +- crypto/openssh/ssh-keygen.1 | 717 +- crypto/openssh/ssh-keygen.c | 2111 ++- crypto/openssh/ssh-keyscan.1 | 6 +- crypto/openssh/ssh-keyscan.c | 105 +- crypto/openssh/ssh-keysign.8 | 6 +- crypto/openssh/ssh-keysign.c | 77 +- crypto/openssh/ssh-pkcs11-client.c | 212 +- crypto/openssh/ssh-pkcs11-helper.8 | 29 +- crypto/openssh/ssh-pkcs11-helper.c | 210 +- crypto/openssh/ssh-pkcs11.c | 1774 +- crypto/openssh/ssh-pkcs11.h | 20 +- crypto/openssh/ssh-sk-client.c | 448 + crypto/openssh/ssh-sk-helper.8 | 66 + crypto/openssh/ssh-sk-helper.c | 364 + crypto/openssh/ssh-sk.c | 826 + crypto/openssh/ssh-sk.h | 69 + crypto/openssh/ssh-xmss.c | 27 +- crypto/openssh/ssh.1 | 166 +- crypto/openssh/ssh.c | 925 +- crypto/openssh/ssh.h | 11 +- crypto/openssh/ssh2.h | 4 +- crypto/openssh/ssh_api.c | 234 +- crypto/openssh/ssh_config | 6 +- crypto/openssh/ssh_config.5 | 651 +- crypto/openssh/ssh_namespace.h | 223 +- crypto/openssh/sshbuf-getput-basic.c | 171 +- crypto/openssh/sshbuf-getput-crypto.c | 76 +- crypto/openssh/sshbuf-io.c | 117 + crypto/openssh/sshbuf-misc.c | 152 +- crypto/openssh/sshbuf.c | 22 +- crypto/openssh/sshbuf.h | 79 +- crypto/openssh/sshconnect.c | 882 +- crypto/openssh/sshconnect.h | 63 +- crypto/openssh/sshconnect2.c | 942 +- crypto/openssh/sshd.8 | 115 +- crypto/openssh/sshd.c | 975 +- crypto/openssh/sshd_config | 12 +- crypto/openssh/sshd_config.5 | 351 +- crypto/openssh/ssherr.c | 6 +- crypto/openssh/ssherr.h | 4 +- crypto/openssh/sshkey-xmss.c | 160 +- crypto/openssh/sshkey-xmss.h | 16 +- crypto/openssh/sshkey.c | 1516 +- crypto/openssh/sshkey.h | 103 +- crypto/openssh/sshlogin.c | 9 +- crypto/openssh/sshpty.c | 23 +- crypto/openssh/sshsig.c | 1098 ++ crypto/openssh/sshsig.h | 107 + crypto/openssh/ttymodes.c | 44 +- crypto/openssh/uidswap.c | 40 +- crypto/openssh/umac.c | 10 +- crypto/openssh/umac.h | 6 +- crypto/openssh/utf8.c | 27 +- crypto/openssh/utf8.h | 11 +- crypto/openssh/uuencode.c | 95 - crypto/openssh/uuencode.h | 29 - crypto/openssh/version.h | 6 +- crypto/openssh/xmalloc.c | 31 +- crypto/openssh/xmalloc.h | 8 +- crypto/openssh/xmss_commons.c | 2 +- crypto/openssh/xmss_fast.c | 2 +- crypto/openssh/xmss_hash.c | 2 +- crypto/openssh/xmss_hash_address.c | 2 +- crypto/openssh/xmss_wots.c | 2 +- lib/libpam/modules/pam_ssh/pam_ssh.c | 2 +- secure/lib/libssh/Makefile | 19 +- secure/usr.bin/scp/Makefile | 2 +- secure/usr.bin/ssh-add/Makefile | 2 +- secure/usr.bin/ssh-keygen/Makefile | 3 +- secure/usr.sbin/sshd/Makefile | 2 +- 539 files changed, 54039 insertions(+), 25574 deletions(-) diff --cc crypto/openssh/.github/ci-status.md index 000000000000,0ad8bf5aaf44..0ad8bf5aaf44 mode 000000,100644..100644 --- a/crypto/openssh/.github/ci-status.md +++ b/crypto/openssh/.github/ci-status.md diff --cc crypto/openssh/.github/configs index 000000000000,12578c067348..12578c067348 mode 000000,100755..100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs diff --cc crypto/openssh/.github/configure.sh index 000000000000,e098730f02d6..e098730f02d6 mode 000000,100755..100755 --- a/crypto/openssh/.github/configure.sh +++ b/crypto/openssh/.github/configure.sh diff --cc crypto/openssh/.github/run_test.sh index 000000000000,adf2568ad1e2..adf2568ad1e2 mode 000000,100755..100755 --- a/crypto/openssh/.github/run_test.sh +++ b/crypto/openssh/.github/run_test.sh diff --cc crypto/openssh/.github/setup_ci.sh index 000000000000,70a444e4eff4..70a444e4eff4 mode 000000,100755..100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh diff --cc crypto/openssh/.github/workflows/c-cpp.yml index 000000000000,289b18b7f621..289b18b7f621 mode 000000,100644..100644 --- a/crypto/openssh/.github/workflows/c-cpp.yml +++ b/crypto/openssh/.github/workflows/c-cpp.yml diff --cc crypto/openssh/.github/workflows/selfhosted.yml index 000000000000,df6eca714fb5..df6eca714fb5 mode 000000,100644..100644 --- a/crypto/openssh/.github/workflows/selfhosted.yml +++ b/crypto/openssh/.github/workflows/selfhosted.yml diff --cc crypto/openssh/.github/workflows/upstream.yml index 000000000000,f0493c12d7d5..f0493c12d7d5 mode 000000,100644..100644 --- a/crypto/openssh/.github/workflows/upstream.yml +++ b/crypto/openssh/.github/workflows/upstream.yml diff --cc crypto/openssh/.gitignore index 650eb3c3c90c,000000000000..5e4ae5a60d06 mode 100644,000000..100644 --- a/crypto/openssh/.gitignore +++ b/crypto/openssh/.gitignore @@@ -1,28 -1,0 +1,36 @@@ +Makefile +buildpkg.sh +config.h +config.h.in ++config.h.in~ ++config.log +config.status +configure ++aclocal.m4 +openbsd-compat/Makefile +openbsd-compat/regress/Makefile +openssh.xml +opensshd.init +survey.sh +**/*.0 +**/*.o ++**/*.lo ++**/*.so +**/*.out +**/*.a +autom4te.cache/ +scp +sftp +sftp-server +ssh +ssh-add +ssh-agent +ssh-keygen +ssh-keyscan +ssh-keysign +ssh-pkcs11-helper ++ssh-sk-helper +sshd +!regress/misc/fuzz-harness/Makefile ++!regress/unittests/sshsig/Makefile ++tags diff --cc crypto/openssh/FREEBSD-vendor index f48cbb6c3079,000000000000..c7f6462985a2 mode 100644,000000..100644 --- a/crypto/openssh/FREEBSD-vendor +++ b/crypto/openssh/FREEBSD-vendor @@@ -1,6 -1,0 +1,6 @@@ +# $FreeBSD$ +Project: Portable OpenSSH +ProjectURL: http://www.openssh.com/portable.html - Version: 7.9p1 ++Version: 8.7p1 +License: BSD - Maintainer: des ++Maintainer: emaste diff --cc crypto/openssh/INSTALL index 775eb6c05342,000000000000..8ab8a403a4e2 mode 100644,000000..100644 --- a/crypto/openssh/INSTALL +++ b/crypto/openssh/INSTALL @@@ -1,276 -1,0 +1,301 @@@ +1. Prerequisites +---------------- + +A C compiler. Any C89 or better compiler should work. Where supported, +configure will attempt to enable the compiler's run-time integrity checking +options. Some notes about specific compilers: + - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime + (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure) + - You will need working installations of Zlib and libcrypto (LibreSSL / - OpenSSL) ++To support Privilege Separation (which is now required) you will need ++to create the user, group and directory used by sshd for privilege ++separation. See README.privsep for details. + ++ ++The remaining items are optional. ++ ++A working installation of zlib: +Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems): +http://www.gzip.org/zlib/ + - libcrypto (LibreSSL or OpenSSL >= 1.0.1 < 1.1.0) - LibreSSL http://www.libressl.org/ ; or - OpenSSL http://www.openssl.org/ ++libcrypto from either of LibreSSL or OpenSSL. Building without libcrypto ++is supported but severely restricts the available ciphers and algorithms. ++ - LibreSSL (https://www.libressl.org/) ++ - OpenSSL (https://www.openssl.org) with any of the following versions: ++ - 1.0.x >= 1.0.1 or 1.1.0 >= 1.1.0g or any 1.1.1 ++ ++Note that due to a bug in EVP_CipherInit OpenSSL 1.1 versions prior to ++1.1.0g can't be used. + +LibreSSL/OpenSSL should be compiled as a position-independent library - (i.e. with -fPIC) otherwise OpenSSH will not be able to link with it. - If you must use a non-position-independent libcrypto, then you may need - to configure OpenSSH --without-pie. Note that because of API changes, - OpenSSL 1.1.x is not currently supported. ++(i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC" ++or LibreSSL as "CFLAGS=-fPIC ./configure") otherwise OpenSSH will not ++be able to link with it. If you must use a non-position-independent ++libcrypto, then you may need to configure OpenSSH --without-pie. + - The remaining items are optional. ++If you build either from source, running the OpenSSL self-test ("make ++tests") or the LibreSSL equivalent ("make check") and ensuring that all ++tests pass is strongly recommended. + +NB. If you operating system supports /dev/random, you should configure +libcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's - direct support of /dev/random, or failing that, either prngd or egd ++direct support of /dev/random, or failing that, either prngd or egd. + +PRNGD: + +If your system lacks kernel-based random collection, the use of Lutz - Jaenicke's PRNGd is recommended. ++Jaenicke's PRNGd is recommended. It requires that libcrypto be configured ++to support it. + +http://prngd.sourceforge.net/ + +EGD: + - If the kernel lacks /dev/random the Entropy Gathering Daemon (EGD) is - supported only if libcrypto supports it. ++The Entropy Gathering Daemon (EGD) supports the same interface as prngd. ++It also supported only if libcrypto is configured to support it. + +http://egd.sourceforge.net/ + +PAM: + +OpenSSH can utilise Pluggable Authentication Modules (PAM) if your +system supports it. PAM is standard most Linux distributions, Solaris, - HP-UX 11, AIX >= 5.2, FreeBSD and NetBSD. ++HP-UX 11, AIX >= 5.2, FreeBSD, NetBSD and Mac OS X. + +Information about the various PAM implementations are available: + +Solaris PAM: http://www.sun.com/software/solaris/pam/ +Linux PAM: http://www.kernel.org/pub/linux/libs/pam/ +OpenPAM: http://www.openpam.org/ + +If you wish to build the GNOME passphrase requester, you will need the GNOME +libraries and headers. + +GNOME: +http://www.gnome.org/ + +Alternatively, Jim Knoble has written an excellent X11 +passphrase requester. This is maintained separately at: + +http://www.jmknoble.net/software/x11-ssh-askpass/ + +TCP Wrappers: + +If you wish to use the TCP wrappers functionality you will need at least +tcpd.h and libwrap.a, either in the standard include and library paths, +or in the directory specified by --with-tcp-wrappers. Version 7.6 is +known to work. + +http://ftp.porcupine.org/pub/security/index.html + +LibEdit: + +sftp supports command-line editing via NetBSD's libedit. If your platform +has it available natively you can use that, alternatively you might try +these multi-platform ports: + +http://www.thrysoee.dk/editline/ +http://sourceforge.net/projects/libedit/ + +LDNS: + +LDNS is a DNS BSD-licensed resolver library which supports DNSSEC. + +http://nlnetlabs.nl/projects/ldns/ + +Autoconf: + +If you modify configure.ac or configure doesn't exist (eg if you checked - the code out of git yourself) then you will need autoconf-2.69 to rebuild - the automatically generated files by running "autoreconf". Earlier - versions may also work but this is not guaranteed. ++the code out of git yourself) then you will need autoconf-2.69 and ++automake-1.16.1 to rebuild the automatically generated files by running ++"autoreconf". Earlier versions may also work but this is not guaranteed. + +http://www.gnu.org/software/autoconf/ ++http://www.gnu.org/software/automake/ + +Basic Security Module (BSM): + +Native BSM support is known to exist in Solaris from at least 2.5.1, +FreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM +implementation (http://www.openbsm.org). + +makedepend: + +https://www.x.org/archive/individual/util/ + +If you are making significant changes to the code you may need to rebuild +the dependency (.depend) file using "make depend", which requires the +"makedepend" tool from the X11 distribution. + ++libfido2: ++ ++libfido2 allows the use of hardware security keys over USB. libfido2 ++in turn depends on libcbor. libfido2 >= 1.5.0 is strongly recommended. ++Limited functionality is possible with earlier libfido2 versions. ++ ++https://github.com/Yubico/libfido2 ++https://github.com/pjk/libcbor ++ ++ +2. Building / Installation +-------------------------- + +To install OpenSSH with default options: + +./configure +make +make install + +This will install the OpenSSH binaries in /usr/local/bin, configuration files +in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different +installation prefix, use the --prefix option to configure: + +./configure --prefix=/opt +make +make install + +Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override +specific paths, for example: + +./configure --prefix=/opt --sysconfdir=/etc/ssh +make +make install + +This will install the binaries in /opt/{bin,lib,sbin}, but will place the +configuration files in /etc/ssh. + - If you are using Privilege Separation (which is enabled by default) - then you will also need to create the user, group and directory used by - sshd for privilege separation. See README.privsep for details. - +If you are using PAM, you may need to manually install a PAM control +file as "/etc/pam.d/sshd" (or wherever your system prefers to keep +them). Note that the service name used to start PAM is __progname, +which is the basename of the path of your sshd (e.g., the service name +for /usr/sbin/osshd will be osshd). If you have renamed your sshd +executable, your PAM configuration may need to be modified. + +A generic PAM configuration is included as "contrib/sshd.pam.generic", +you may need to edit it before using it on your system. If you are +using a recent version of Red Hat Linux, the config file in +contrib/redhat/sshd.pam should be more useful. Failure to install a +valid PAM file may result in an inability to use password +authentication. On HP-UX 11 and Solaris, the standard /etc/pam.conf +configuration will work with sshd (sshd will match the other service +name). + +There are a few other options to the configure script: + +--with-audit=[module] enable additional auditing via the specified module. +Currently, drivers for "debug" (additional info via syslog) and "bsm" +(Sun's Basic Security Module) are supported. + +--with-pam enables PAM support. If PAM support is compiled in, it must +also be enabled in sshd_config (refer to the UsePAM directive). + +--with-prngd-socket=/some/file allows you to enable EGD or PRNGD +support and to specify a PRNGd socket. Use this if your Unix lacks +/dev/random. + +--with-prngd-port=portnum allows you to enable EGD or PRNGD support +and to specify a EGD localhost TCP port. Use this if your Unix lacks +/dev/random. + +--with-lastlog=FILE will specify the location of the lastlog file. +./configure searches a few locations for lastlog, but may not find +it if lastlog is installed in a different place. + +--without-lastlog will disable lastlog support entirely. + +--with-osfsia, --without-osfsia will enable or disable OSF1's Security +Integration Architecture. The default for OSF1 machines is enable. + +--with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny) +support. + +--with-md5-passwords will enable the use of MD5 passwords. Enable this +if your operating system uses MD5 passwords and the system crypt() does +not support them directly (see the crypt(3/3c) man page). If enabled, the +resulting binary will support both MD5 and traditional crypt passwords. + +--with-utmpx enables utmpx support. utmpx support is automatic for +some platforms. + +--without-shadow disables shadow password support. + +--with-ipaddr-display forces the use of a numeric IP address in the +$DISPLAY environment variable. Some broken systems need this. + +--with-default-path=PATH allows you to specify a default $PATH for sessions +started by sshd. This replaces the standard path entirely. + +--with-pid-dir=PATH specifies the directory in which the sshd.pid file is +created. + +--with-xauth=PATH specifies the location of the xauth binary + +--with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL +libraries are installed. + +--with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support + ++--without-openssl builds without using OpenSSL. Only a subset of ciphers ++and algorithms are supported in this configuration. ++ ++--without-zlib builds without zlib. This disables the Compression option. ++ +--with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to +real (AF_INET) IPv4 addresses. Works around some quirks on Linux. + +If you need to pass special options to the compiler or linker, you +can specify these as environment variables before running ./configure. +For example: + +CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure + +3. Configuration +---------------- + +The runtime configuration files are installed by in ${prefix}/etc or +whatever you specified as your --sysconfdir (/usr/local/etc by default). + +The default configuration should be instantly usable, though you should +review it to ensure that it matches your security requirements. + +To generate a host key, run "make host-key". Alternately you can do so +manually using the following commands: + + ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N "" + +for each of the types you wish to generate (rsa, dsa or ecdsa) or + + ssh-keygen -A + +to generate keys for all supported types. + +Replacing /etc/ssh with the correct path to the configuration directory. +(${prefix}/etc or whatever you specified with --sysconfdir during *** 20555 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Sep 8 01:32:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B2DC672232; Wed, 8 Sep 2021 01:32:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H44Pr3tZ1z3Gp9; Wed, 8 Sep 2021 01:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 663F11CD4F; Wed, 8 Sep 2021 01:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1881WWcZ069825; Wed, 8 Sep 2021 01:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1881WWPU069824; Wed, 8 Sep 2021 01:32:32 GMT (envelope-from git) Date: Wed, 8 Sep 2021 01:32:32 GMT Message-Id: <202109080132.1881WWPU069824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 3c253d03d94e - main - Hide acpi_timer_test behind a tunable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c253d03d94e89cf1a26716b58fc27653df2a4f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 01:32:32 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3c253d03d94e89cf1a26716b58fc27653df2a4f3 commit 3c253d03d94e89cf1a26716b58fc27653df2a4f3 Author: Colin Percival AuthorDate: 2021-09-07 23:58:18 +0000 Commit: Colin Percival CommitDate: 2021-09-08 01:31:50 +0000 Hide acpi_timer_test behind a tunable When hw.acpi.timer_test_enabled is set to 0, this makes acpi_timer_test return 1 without actually testing the ACPI timer; this results in the ACPI-fast timecounter always being used rather than potentially using ACPI-safe. The ACPI timer testing was introduced in 2002 as a workaround for errata in Pentium II and Pentium III chipsets, and is unlikely to be needed in 2021. While I'm here, add TSENTER/TSEXIT to make it easier to see the time spent on the test (if it is enabled). Reviewed by: allanjude, imp MFC After: 1 week --- sys/dev/acpica/acpi_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 763a47a1a959..8be6e0edea7f 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -79,6 +79,8 @@ static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); static void acpi_timer_boot_test(void); static int acpi_timer_test(void); +static int acpi_timer_test_enabled = 1; +TUNABLE_INT("hw.acpi.timer_test_enabled", &acpi_timer_test_enabled); static device_method_t acpi_timer_methods[] = { DEVMETHOD(device_identify, acpi_timer_identify), @@ -404,6 +406,12 @@ acpi_timer_test() int delta, max, max2, min, n; register_t s; + /* Skip the test based on the hw.acpi.timer_test_enabled tunable. */ + if (!acpi_timer_test_enabled) + return (1); + + TSENTER(); + min = INT32_MAX; max = max2 = 0; @@ -434,6 +442,8 @@ acpi_timer_test() if (bootverbose) printf(" %d/%d", n, delta); + TSEXIT(); + return (n); } #undef N From owner-dev-commits-src-main@freebsd.org Wed Sep 8 01:32:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34DD36723D3; Wed, 8 Sep 2021 01:32:34 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H44Ps6Ynwz3Gvb; Wed, 8 Sep 2021 01:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BD891D344; Wed, 8 Sep 2021 01:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1881WXC5069849; Wed, 8 Sep 2021 01:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1881WXPv069848; Wed, 8 Sep 2021 01:32:33 GMT (envelope-from git) Date: Wed, 8 Sep 2021 01:32:33 GMT Message-Id: <202109080132.1881WXPv069848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: a8b89dff6ac0 - main - Disable acpi_timer_test by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8b89dff6ac026e60983824889d3666842ff409b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 01:32:34 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a8b89dff6ac026e60983824889d3666842ff409b commit a8b89dff6ac026e60983824889d3666842ff409b Author: Colin Percival AuthorDate: 2021-09-07 23:59:45 +0000 Commit: Colin Percival CommitDate: 2021-09-08 01:31:55 +0000 Disable acpi_timer_test by default This disables testing the ACPI timer by default, forcing the use of ACPI-fast rather than ACPI-safe. The broken-ACPI-timers workaround can be re-enabled by setting the hw.acpi.timer_test_enabled=1 tunable. This speeds up the FreeBSD boot process by 140 ms on an EC2 c5.xlarge instance. This change will not be MFCed. Assuming no problems are reported, acpi_timer_test, the associated tunable, and the ACPI-safe timecounter should be removed in FreeBSD 15. Relnotes: The ACPI-safe timer is disabled in favour of ACPI-fast; if timekeeping issues are observed, please test with hw.acpi.timer_test_enabled=1 in loader.conf and report if that fixes the problem. --- sys/dev/acpica/acpi_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 8be6e0edea7f..8e3947709b61 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -79,7 +79,7 @@ static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); static void acpi_timer_boot_test(void); static int acpi_timer_test(void); -static int acpi_timer_test_enabled = 1; +static int acpi_timer_test_enabled = 0; TUNABLE_INT("hw.acpi.timer_test_enabled", &acpi_timer_test_enabled); static device_method_t acpi_timer_methods[] = { From owner-dev-commits-src-main@freebsd.org Wed Sep 8 01:52:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 214B467281E; Wed, 8 Sep 2021 01:52:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H44rm0GNJz3M1r; Wed, 8 Sep 2021 01:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE85C1D3E9; Wed, 8 Sep 2021 01:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1881qNf8095397; Wed, 8 Sep 2021 01:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1881qNsx095396; Wed, 8 Sep 2021 01:52:23 GMT (envelope-from git) Date: Wed, 8 Sep 2021 01:52:23 GMT Message-Id: <202109080152.1881qNsx095396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0e642632e64a - main - openssh: remove unnecessary $FreeBSD$ tags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e642632e64a8b8ca740ce3307abe116c990e0b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 01:52:24 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0e642632e64a8b8ca740ce3307abe116c990e0b6 commit 0e642632e64a8b8ca740ce3307abe116c990e0b6 Author: Ed Maste AuthorDate: 2021-09-08 01:48:15 +0000 Commit: Ed Maste CommitDate: 2021-09-08 01:52:06 +0000 openssh: remove unnecessary $FreeBSD$ tags Diff reduction against upstream: remove $FreeBSD$ tags from files where the tag itself is the only difference from upstream. --- crypto/openssh/mux.c | 1 - crypto/openssh/sftp-common.c | 1 - 2 files changed, 2 deletions(-) diff --git a/crypto/openssh/mux.c b/crypto/openssh/mux.c index ee26e880c996..4c0eb4249bcd 100644 --- a/crypto/openssh/mux.c +++ b/crypto/openssh/mux.c @@ -18,7 +18,6 @@ /* ssh session multiplexing support */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include diff --git a/crypto/openssh/sftp-common.c b/crypto/openssh/sftp-common.c index bff14228e14b..3ad57673d41e 100644 --- a/crypto/openssh/sftp-common.c +++ b/crypto/openssh/sftp-common.c @@ -25,7 +25,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include From owner-dev-commits-src-main@freebsd.org Wed Sep 8 03:01:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E25A467336A; Wed, 8 Sep 2021 03:01:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H46NM3nYXz3vP6; Wed, 8 Sep 2021 03:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B4801E233; Wed, 8 Sep 2021 03:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18831Mii089327; Wed, 8 Sep 2021 03:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18831MQr089326; Wed, 8 Sep 2021 03:01:22 GMT (envelope-from git) Date: Wed, 8 Sep 2021 03:01:22 GMT Message-Id: <202109080301.18831MQr089326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4ccbbe5f0689 - main - top(1): indicate how to reset grep string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ccbbe5f0689513de4399d6dad43e85d97ad9cde Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 03:01:25 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ccbbe5f0689513de4399d6dad43e85d97ad9cde commit 4ccbbe5f0689513de4399d6dad43e85d97ad9cde Author: John Grafton AuthorDate: 2021-09-07 17:39:59 +0000 Commit: Warner Losh CommitDate: 2021-09-08 02:56:45 +0000 top(1): indicate how to reset grep string Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/536/files --- usr.bin/top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 4fbf11b50299..08248911e99a 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -910,7 +910,7 @@ restart: case CMD_grep: /* grep command name */ new_message(MT_standout, - "Grep command name: "); + "Grep command name (+ for all): "); if (readline(tempbuf1, sizeof(tempbuf1), false) > 0) { free(ps.command); if (tempbuf1[0] == '+' && tempbuf1[1] == '\0') { From owner-dev-commits-src-main@freebsd.org Wed Sep 8 11:43:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 943696796B4; Wed, 8 Sep 2021 11:43:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Kyr3nzlz4rsD; Wed, 8 Sep 2021 11:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6282B25353; Wed, 8 Sep 2021 11:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188BhWBG084601; Wed, 8 Sep 2021 11:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188BhWIL084600; Wed, 8 Sep 2021 11:43:32 GMT (envelope-from git) Date: Wed, 8 Sep 2021 11:43:32 GMT Message-Id: <202109081143.188BhWIL084600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 4f7c436548ea - main - powerpc64: fix radix on pseries TLB invalidation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f7c436548ea1cc935c4f4b237693fbe8ed7939a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 11:43:32 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=4f7c436548ea1cc935c4f4b237693fbe8ed7939a commit 4f7c436548ea1cc935c4f4b237693fbe8ed7939a Author: Leandro Lupori AuthorDate: 2021-09-08 11:37:11 +0000 Commit: Leandro Lupori CommitDate: 2021-09-08 11:37:11 +0000 powerpc64: fix radix on pseries TLB invalidation When running in a virtualized environment, TLB invalidations can only be performed on process scope, as only the hypervisor is allowed to invalidate a global scope, or else a Program Interrupt is triggered. Since we are here, also make sure that the register process table hypercall returns success. Reviewed by: jhibbits MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31775 --- sys/powerpc/aim/mmu_radix.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 8c3f6e2cf37a..50c658e58a4a 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -657,10 +657,10 @@ extern void bs_remap_earlyboot(void); #define PARTTAB_HR (1UL << 63) /* host uses radix */ #define PARTTAB_GR (1UL << 63) /* guest uses radix must match host */ -/* TLB flush actions. Used as argument to tlbiel_all() */ +/* TLB flush actions. Used as argument to tlbiel_flush() */ enum { - TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for current LPID */ - TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ + TLB_INVAL_SCOPE_LPID = 2, /* invalidate TLBs for current LPID */ + TLB_INVAL_SCOPE_GLOBAL = 3, /* invalidate all TLBs */ }; #define NPV_LIST_LOCKS MAXCPU @@ -758,9 +758,11 @@ tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) * and partition table entries. Then flush the remaining sets of the * TLB. */ - tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); - for (set = 1; set < num_sets; set++) - tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); + if (is == TLB_INVAL_SCOPE_GLOBAL) { + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); + for (set = 1; set < num_sets; set++) + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); + } /* Do the same for process scoped entries. */ tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); @@ -773,13 +775,10 @@ tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) static void mmu_radix_tlbiel_flush(int scope) { - int is; - MPASS(scope == TLB_INVAL_SCOPE_LPID || scope == TLB_INVAL_SCOPE_GLOBAL); - is = scope + 2; - tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, scope); __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); } @@ -2200,9 +2199,15 @@ mmu_radix_proctab_init(void) __asm __volatile("eieio; tlbsync; ptesync" : : : "memory"); #ifdef PSERIES } else { - phyp_hcall(H_REGISTER_PROC_TBL, + int64_t rc; + + rc = phyp_hcall(H_REGISTER_PROC_TBL, PROC_TABLE_NEW | PROC_TABLE_RADIX | PROC_TABLE_GTSE, proctab0pa, 0, PROCTAB_SIZE_SHIFT - 12); + if (rc != H_SUCCESS) + panic("mmu_radix_proctab_init: " + "failed to register process table: rc=%jd", + (intmax_t)rc); #endif } From owner-dev-commits-src-main@freebsd.org Wed Sep 8 12:05:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EF25679F55; Wed, 8 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4LRm306tz3DpK; Wed, 8 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435D724F6C; Wed, 8 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188C58Uv012975; Wed, 8 Sep 2021 12:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188C58qs012974; Wed, 8 Sep 2021 12:05:08 GMT (envelope-from git) Date: Wed, 8 Sep 2021 12:05:08 GMT Message-Id: <202109081205.188C58qs012974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: c90cab0d668a - main - i386 loaders: avoid lld 13 garbage collecting linker sets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c90cab0d668af5d947054e47184d4f8dcb874ec8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 12:05:08 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c90cab0d668af5d947054e47184d4f8dcb874ec8 commit c90cab0d668af5d947054e47184d4f8dcb874ec8 Author: Dimitry Andric AuthorDate: 2021-09-08 12:04:13 +0000 Commit: Dimitry Andric CommitDate: 2021-09-08 12:04:13 +0000 i386 loaders: avoid lld 13 garbage collecting linker sets Because lld 13 and higher default to garbage collecting start/stop symbols when using --gc-sections, the linker sets used in the i386 boot loaders will disappear. This leads to the loaders not recognizing any commands, and failure to boot. Until we have a good set of linker scripts for the loaders, work around it by disabling the start-stop-gc feature. MFC after: 1 week --- stand/i386/loader/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 0abf6120c1e3..571e3b2cb653 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -61,6 +61,12 @@ ORG= 0x0 CFLAGS+= -Wall LDFLAGS+= -static ${LDFLAGS_ORG} -Wl,--gc-sections +.if ${LINKER_TYPE} == "lld" && ${LINKER_VERSION} >= 130000 +# lld 13 and higher default to garbage collecting start/stop symbols, +# completely ruining our linker sets. For now, work around it by +# disabling this un-feature. +LDFLAGS+= -Wl,-z,nostart-stop-gc +.endif # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a From owner-dev-commits-src-main@freebsd.org Wed Sep 8 12:49:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B554F67ABD2; Wed, 8 Sep 2021 12:49:38 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4MR64d7qz3l8j; Wed, 8 Sep 2021 12:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EED2617A; Wed, 8 Sep 2021 12:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188CncRP065954; Wed, 8 Sep 2021 12:49:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188CncXF065953; Wed, 8 Sep 2021 12:49:38 GMT (envelope-from git) Date: Wed, 8 Sep 2021 12:49:38 GMT Message-Id: <202109081249.188CncXF065953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: b4cb3fe0e39a - main - loader: implement mount/unmount rootfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4cb3fe0e39a31e60292018dc9fb7510b3de92bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 12:49:38 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=b4cb3fe0e39a31e60292018dc9fb7510b3de92bf commit b4cb3fe0e39a31e60292018dc9fb7510b3de92bf Author: Toomas Soome AuthorDate: 2021-08-12 05:45:52 +0000 Commit: Toomas Soome CommitDate: 2021-09-08 01:01:20 +0000 loader: implement mount/unmount rootfs We want to keep our root file system open to preserve bcache segment between file accesses, thus reducing physical disk IO. Reviewed by: imp, allanjude, kevans (previous version) Differential Revision: https://reviews.freebsd.org/D30848 MFC after: 1 month --- stand/common/bootstrap.h | 4 + stand/common/misc.c | 22 ++++ stand/efi/boot1/zfs_module.c | 2 +- stand/efi/libefi/devicename.c | 5 +- stand/efi/loader/main.c | 14 +-- stand/i386/gptzfsboot/Makefile | 2 +- stand/i386/libi386/devicename.c | 14 +-- stand/i386/loader/main.c | 4 + stand/i386/zfsboot/Makefile | 2 +- stand/i386/zfsboot/zfsboot.c | 4 + stand/libofw/devicename.c | 14 +-- stand/libsa/Makefile | 2 +- stand/libsa/cd9660.c | 158 +++++++++++++++++++++----- stand/libsa/dosfs.c | 134 ++++++++++++++++++---- stand/libsa/mount.c | 163 +++++++++++++++++++++++++++ stand/libsa/netif.c | 1 - stand/libsa/stand.h | 4 + stand/libsa/ufs.c | 210 +++++++++++++++++++++++------------ stand/libsa/zfs/zfs.c | 137 ++++++++++++++++++----- stand/libsa/zfs/zfsimpl.c | 14 ++- stand/mips/beri/loader/devicename.c | 14 +-- stand/powerpc/kboot/main.c | 1 - stand/powerpc/ofw/main.c | 3 + stand/uboot/common/main.c | 3 + stand/uboot/lib/devicename.c | 4 +- stand/userboot/userboot/devicename.c | 4 +- stand/userboot/userboot/main.c | 4 + 27 files changed, 752 insertions(+), 191 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index eb4e50203133..ea03519f5b39 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -29,6 +29,7 @@ #ifndef _BOOTSTRAP_H_ #define _BOOTSTRAP_H_ +#include #include #include #include @@ -400,6 +401,9 @@ int nvstore_set_var_from_string(void *, const char *, const char *, const char *); int nvstore_unset_var(void *, const char *); +/* common code to set currdev variable. */ +extern int mount_currdev(struct env_var *, int, const void *); + #ifndef CTASSERT #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") #endif diff --git a/stand/common/misc.c b/stand/common/misc.c index 9e6bea1e244c..9cb5550344ca 100644 --- a/stand/common/misc.c +++ b/stand/common/misc.c @@ -179,3 +179,25 @@ dev_cleanup(void) if (devsw[i]->dv_cleanup != NULL) (devsw[i]->dv_cleanup)(); } + +/* + * mount new rootfs and unmount old, set "currdev" environment variable. + */ +int mount_currdev(struct env_var *ev, int flags, const void *value) +{ + int rv; + + /* mount new rootfs */ + rv = mount(value, "/", 0, NULL); + if (rv == 0) { + /* + * Note we unmount any previously mounted fs only after + * successfully mounting the new because we do not want to + * end up with unmounted rootfs. + */ + if (ev->ev_value != NULL) + unmount(ev->ev_value, 0); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + } + return (rv); +} diff --git a/stand/efi/boot1/zfs_module.c b/stand/efi/boot1/zfs_module.c index 583d6b1d101f..7aaca72e30f1 100644 --- a/stand/efi/boot1/zfs_module.c +++ b/stand/efi/boot1/zfs_module.c @@ -160,7 +160,7 @@ load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize) return (EFI_NOT_FOUND); } - if ((err = zfs_mount(spa, 0, &zmount)) != 0) { + if ((err = zfs_mount_impl(spa, 0, &zmount)) != 0) { DPRINTF("Failed to mount pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } diff --git a/stand/efi/libefi/devicename.c b/stand/efi/libefi/devicename.c index fbce0016338c..cdf4830697fd 100644 --- a/stand/efi/libefi/devicename.c +++ b/stand/efi/libefi/devicename.c @@ -209,8 +209,7 @@ efi_setcurrdev(struct env_var *ev, int flags, const void *value) rv = efi_parsedev(&ncurr, value, NULL); if (rv != 0) return (rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return (0); + + return (mount_currdev(ev, flags, value)); } diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index d46f3f4161b1..b687255181e3 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -187,15 +187,12 @@ static void set_currdev(const char *devname) { + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); /* - * Don't execute hooks here; we may need to try setting these more than - * once here if we're probing for the ZFS pool we're supposed to boot. - * The currdev hook is intended to just validate user input anyways, - * while the loaddev hook makes it immutable once we've determined what - * the proper currdev is. + * Don't execute hook here; the loaddev hook makes it immutable + * once we've determined what the proper currdev is. */ - env_setenv("currdev", EV_VOLATILE | EV_NOHOOK, devname, efi_setcurrdev, - env_nounset); env_setenv("loaddev", EV_VOLATILE | EV_NOHOOK, devname, env_noset, env_nounset); } @@ -958,6 +955,9 @@ main(int argc, CHAR16 *argv[]) #endif cons_probe(); + /* Set up currdev variable to have hooks in place. */ + env_setenv("currdev", EV_VOLATILE, "", efi_setcurrdev, env_nounset); + /* Init the time source */ efi_time_init(); diff --git a/stand/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile index aa8b497f8f3a..09615c5f97c1 100644 --- a/stand/i386/gptzfsboot/Makefile +++ b/stand/i386/gptzfsboot/Makefile @@ -66,7 +66,7 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o -OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o +OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o misc.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out ${OBJS} ${OPENCRYPTO_XTS} # i386 standalone support library diff --git a/stand/i386/libi386/devicename.c b/stand/i386/libi386/devicename.c index 926a2c5a850e..061f2ba9ce9f 100644 --- a/stand/i386/libi386/devicename.c +++ b/stand/i386/libi386/devicename.c @@ -204,12 +204,12 @@ i386_fmtdev(void *vdev) int i386_setcurrdev(struct env_var *ev, int flags, const void *value) { - struct i386_devdesc *ncurr; - int rv; + struct i386_devdesc *ncurr; + int rv; - if ((rv = i386_parsedev(&ncurr, value, NULL)) != 0) - return(rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return(0); + if ((rv = i386_parsedev(&ncurr, value, NULL)) != 0) + return (rv); + free(ncurr); + + return (mount_currdev(ev, flags, value)); } diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 6b81ef411f7f..cb716d7a9f21 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -164,6 +164,10 @@ main(void) } cons_probe(); + /* Set up currdev variable to have hooks in place. */ + env_setenv("currdev", EV_VOLATILE | EV_NOHOOK, "", + i386_setcurrdev, env_nounset); + /* * Initialise the block cache. Set the upper limit. */ diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile index 7e362b43a39c..243b5e99287c 100644 --- a/stand/i386/zfsboot/Makefile +++ b/stand/i386/zfsboot/Makefile @@ -59,7 +59,7 @@ zfsboot1: zfsldr.out zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} zfsldr.o -OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o +OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o misc.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ ${OBJS} diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c index 1067c4c6cd42..8dd3066f15e5 100644 --- a/stand/i386/zfsboot/zfsboot.c +++ b/stand/i386/zfsboot/zfsboot.c @@ -207,6 +207,10 @@ main(void) snprintf(boot_devname, sizeof (boot_devname), "disk%d:", bd_bios2unit(bootinfo.bi_bios_dev)); + /* Set up currdev variable to have hooks in place. */ + env_setenv("currdev", EV_VOLATILE, "", i386_setcurrdev, + env_nounset); + for (i = 0; devsw[i] != NULL; i++) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c index 786e5549c0fc..11c0a1719ff3 100644 --- a/stand/libofw/devicename.c +++ b/stand/libofw/devicename.c @@ -134,13 +134,13 @@ found: int ofw_setcurrdev(struct env_var *ev, int flags, const void *value) { - struct ofw_devdesc *ncurr; - int rv; + struct ofw_devdesc *ncurr; + int rv; - if ((rv = ofw_parsedev(&ncurr, value, NULL)) != 0) - return rv; + if ((rv = ofw_parsedev(&ncurr, value, NULL)) != 0) + return (rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return 0; + free(ncurr); + + return (mount_currdev(ev, flags, value)); } diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 815f479b5a0a..6fe145d681db 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -131,7 +131,7 @@ CLEANDIRS+=${FAKE_DIRS} CLEANFILES+= ${SAFE_INCS} ${STAND_H_INC} ${OTHER_INC} # io routines -SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ +SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c mount.c \ fstat.c close.c lseek.c open.c read.c write.c readdir.c # SMBios routines diff --git a/stand/libsa/cd9660.c b/stand/libsa/cd9660.c index c339678d96fe..57e4916c0fb5 100644 --- a/stand/libsa/cd9660.c +++ b/stand/libsa/cd9660.c @@ -70,6 +70,8 @@ static int cd9660_read(struct open_file *f, void *buf, size_t size, static off_t cd9660_seek(struct open_file *f, off_t offset, int where); static int cd9660_stat(struct open_file *f, struct stat *sb); static int cd9660_readdir(struct open_file *f, struct dirent *d); +static int cd9660_mount(const char *, const char *, void **); +static int cd9660_unmount(const char *, void *); static int dirmatch(struct open_file *f, const char *path, struct iso_directory_record *dp, int use_rrip, int lenskip); static int rrip_check(struct open_file *f, struct iso_directory_record *dp, @@ -81,16 +83,28 @@ static ISO_SUSP_HEADER *susp_lookup_record(struct open_file *f, int lenskip); struct fs_ops cd9660_fsops = { - "cd9660", - cd9660_open, - cd9660_close, - cd9660_read, - null_write, - cd9660_seek, - cd9660_stat, - cd9660_readdir + .fs_name = "cd9660", + .fo_open = cd9660_open, + .fo_close = cd9660_close, + .fo_read = cd9660_read, + .fo_write = null_write, + .fo_seek = cd9660_seek, + .fo_stat = cd9660_stat, + .fo_readdir = cd9660_readdir, + .fo_mount = cd9660_mount, + .fo_unmount = cd9660_unmount }; +typedef struct cd9660_mnt { + struct devdesc *cd_dev; + int cd_fd; + struct iso_directory_record cd_rec; + STAILQ_ENTRY(cd9660_mnt) cd_link; +} cd9660_mnt_t; + +typedef STAILQ_HEAD(cd9660_mnt_list, cd9660_mnt) cd9660_mnt_list_t; +static cd9660_mnt_list_t mnt_list = STAILQ_HEAD_INITIALIZER(mnt_list); + #define F_ISDIR 0x0001 /* Directory */ #define F_ROOTDIR 0x0002 /* Root directory */ #define F_RR 0x0004 /* Rock Ridge on this volume */ @@ -281,26 +295,23 @@ dirmatch(struct open_file *f, const char *path, struct iso_directory_record *dp, } static int -cd9660_open(const char *path, struct open_file *f) +cd9660_read_dr(struct open_file *f, struct iso_directory_record *rec) { - struct file *fp = NULL; - void *buf; struct iso_primary_descriptor *vd; - size_t read, dsize, off; - daddr_t bno, boff; - struct iso_directory_record rec; - struct iso_directory_record *dp = NULL; - int rc, first, use_rrip, lenskip; - bool isdir = false; + size_t read; + daddr_t bno; + int rc; - /* First find the volume descriptor */ - buf = malloc(MAX(ISO_DEFAULT_BLOCK_SIZE, + errno = 0; + vd = malloc(MAX(ISO_DEFAULT_BLOCK_SIZE, sizeof(struct iso_primary_descriptor))); - vd = buf; + if (vd == NULL) + return (errno); + for (bno = 16;; bno++) { twiddle(1); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), - ISO_DEFAULT_BLOCK_SIZE, buf, &read); + ISO_DEFAULT_BLOCK_SIZE, (char *)vd, &read); if (rc) goto out; if (read != ISO_DEFAULT_BLOCK_SIZE) { @@ -308,18 +319,61 @@ cd9660_open(const char *path, struct open_file *f) goto out; } rc = EINVAL; - if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof(vd->id)) != 0) goto out; if (isonum_711(vd->type) == ISO_VD_END) goto out; if (isonum_711(vd->type) == ISO_VD_PRIMARY) break; } - if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE) + if (isonum_723(vd->logical_block_size) == ISO_DEFAULT_BLOCK_SIZE) { + bcopy(vd->root_directory_record, rec, sizeof(*rec)); + rc = 0; + } +out: + free(vd); + return (rc); +} + +static int +cd9660_open(const char *path, struct open_file *f) +{ + struct file *fp = NULL; + void *buf; + size_t read, dsize, off; + daddr_t bno, boff; + struct iso_directory_record rec; + struct iso_directory_record *dp = NULL; + int rc, first, use_rrip, lenskip; + bool isdir = false; + struct devdesc *dev; + cd9660_mnt_t *mnt; + + /* First find the volume descriptor */ + errno = 0; + buf = malloc(MAX(ISO_DEFAULT_BLOCK_SIZE, + sizeof(struct iso_primary_descriptor))); + if (buf == NULL) + return (errno); + + dev = f->f_devdata; + STAILQ_FOREACH(mnt, &mnt_list, cd_link) { + if (dev->d_dev->dv_type == mnt->cd_dev->d_dev->dv_type && + dev->d_unit == mnt->cd_dev->d_unit) + break; + } + + rc = 0; + if (mnt == NULL) + rc = cd9660_read_dr(f, &rec); + else + rec = mnt->cd_rec; + + if (rc != 0) goto out; - bcopy(vd->root_directory_record, &rec, sizeof(rec)); - if (*path == '/') path++; /* eat leading '/' */ + if (*path == '/') + path++; /* eat leading '/' */ first = 1; use_rrip = 0; @@ -621,3 +675,57 @@ cd9660_stat(struct open_file *f, struct stat *sb) sb->st_size = fp->f_size; return 0; } + +static int +cd9660_mount(const char *dev, const char *path, void **data) +{ + cd9660_mnt_t *mnt; + struct open_file *f; + char *fs; + + errno = 0; + mnt = calloc(1, sizeof(*mnt)); + if (mnt == NULL) + return (errno); + mnt->cd_fd = -1; + + if (asprintf(&fs, "%s%s", dev, path) < 0) + goto done; + + mnt->cd_fd = open(fs, O_RDONLY); + free(fs); + if (mnt->cd_fd == -1) + goto done; + + f = fd2open_file(mnt->cd_fd); + /* Is it cd9660 file system? */ + if (strcmp(f->f_ops->fs_name, "cd9660") == 0) { + mnt->cd_dev = f->f_devdata; + errno = cd9660_read_dr(f, &mnt->cd_rec); + STAILQ_INSERT_TAIL(&mnt_list, mnt, cd_link); + } else { + errno = ENXIO; + } + +done: + if (errno != 0) { + free(mnt->cd_dev); + if (mnt->cd_fd >= 0) + close(mnt->cd_fd); + free(mnt); + } else { + *data = mnt; + } + return (errno); +} + +static int +cd9660_unmount(const char *dev __unused, void *data) +{ + cd9660_mnt_t *mnt = data; + + STAILQ_REMOVE(&mnt_list, mnt, cd9660_mnt, cd_link); + close(mnt->cd_fd); + free(mnt); + return (0); +} diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 656af3642c88..452a79ae12dc 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -38,9 +38,19 @@ __FBSDID("$FreeBSD$"); #include #include "stand.h" +#include "disk.h" #include "dosfs.h" +typedef struct dos_mnt { + char *dos_dev; + DOS_FS *dos_fs; + int dos_fd; + STAILQ_ENTRY(dos_mnt) dos_link; +} dos_mnt_t; + +typedef STAILQ_HEAD(dos_mnt_list, dos_mnt) dos_mnt_list_t; +static dos_mnt_list_t mnt_list = STAILQ_HEAD_INITIALIZER(mnt_list); static int dos_open(const char *path, struct open_file *fd); static int dos_close(struct open_file *fd); @@ -48,16 +58,20 @@ static int dos_read(struct open_file *fd, void *buf, size_t size, size_t *resid) static off_t dos_seek(struct open_file *fd, off_t offset, int whence); static int dos_stat(struct open_file *fd, struct stat *sb); static int dos_readdir(struct open_file *fd, struct dirent *d); +static int dos_mount(const char *dev, const char *path, void **data); +static int dos_unmount(const char *dev, void *data); struct fs_ops dosfs_fsops = { - "dosfs", - dos_open, - dos_close, - dos_read, - null_write, - dos_seek, - dos_stat, - dos_readdir + .fs_name = "dosfs", + .fo_open = dos_open, + .fo_close = dos_close, + .fo_read = dos_read, + .fo_write = null_write, + .fo_seek = dos_seek, + .fo_stat = dos_stat, + .fo_readdir = dos_readdir, + .fo_mount = dos_mount, + .fo_unmount = dos_unmount }; #define SECSIZ 512 /* sector size */ @@ -179,12 +193,11 @@ dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) * Mount DOS filesystem */ static int -dos_mount(DOS_FS *fs, struct open_file *fd) +dos_mount_impl(DOS_FS *fs, struct open_file *fd) { int err; u_char *buf; - bzero(fs, sizeof(DOS_FS)); fs->fd = fd; if ((buf = malloc(secbyt(1))) == NULL) @@ -215,11 +228,70 @@ dos_mount(DOS_FS *fs, struct open_file *fd) return (0); } +static int +dos_mount(const char *dev, const char *path, void **data) +{ + char *fs; + dos_mnt_t *mnt; + struct open_file *f; + DOS_FILE *df; + + errno = 0; + mnt = calloc(1, sizeof(*mnt)); + if (mnt == NULL) + return (errno); + mnt->dos_fd = -1; + mnt->dos_dev = strdup(dev); + if (mnt->dos_dev == NULL) + goto done; + + if (asprintf(&fs, "%s%s", dev, path) < 0) + goto done; + + mnt->dos_fd = open(fs, O_RDONLY); + free(fs); + if (mnt->dos_fd == -1) + goto done; + + f = fd2open_file(mnt->dos_fd); + if (strcmp(f->f_ops->fs_name, "dosfs") == 0) { + df = f->f_fsdata; + mnt->dos_fs = df->fs; + STAILQ_INSERT_TAIL(&mnt_list, mnt, dos_link); + } else { + errno = ENXIO; + } + +done: + if (errno != 0) { + free(mnt->dos_dev); + if (mnt->dos_fd >= 0) + close(mnt->dos_fd); + free(mnt); + } else { + *data = mnt; + } + + return (errno); +} + +static int +dos_unmount(const char *dev __unused, void *data) +{ + dos_mnt_t *mnt = data; + + STAILQ_REMOVE(&mnt_list, mnt, dos_mnt, dos_link); + free(mnt->dos_dev); + close(mnt->dos_fd); + free(mnt); + return (0); +} + /* * Unmount mounted filesystem */ static int -dos_unmount(DOS_FS *fs) +dos_unmount_impl(DOS_FS *fs) { if (fs->links) return (EBUSY); @@ -237,19 +309,32 @@ dos_open(const char *path, struct open_file *fd) DOS_DE *de; DOS_FILE *f; DOS_FS *fs; + dos_mnt_t *mnt; + const char *dev; u_int size, clus; int err; - /* Allocate mount structure, associate with open */ - if ((fs = malloc(sizeof(DOS_FS))) == NULL) - return (errno); - if ((err = dos_mount(fs, fd))) { - free(fs); - return (err); + dev = disk_fmtdev(fd->f_devdata); + STAILQ_FOREACH(mnt, &mnt_list, dos_link) { + if (strcmp(dev, mnt->dos_dev) == 0) + break; + } + + if (mnt == NULL) { + /* Allocate mount structure, associate with open */ + if ((fs = malloc(sizeof(DOS_FS))) == NULL) + return (errno); + if ((err = dos_mount_impl(fs, fd))) { + free(fs); + return (err); + } + } else { + fs = mnt->dos_fs; } if ((err = namede(fs, path, &de))) { - dos_unmount(fs); + if (mnt == NULL) + dos_unmount_impl(fs); return (err); } @@ -259,19 +344,20 @@ dos_open(const char *path, struct open_file *fd) if ((!(de->attr & FA_DIR) && (!clus != !size)) || ((de->attr & FA_DIR) && size) || (clus && !okclus(fs, clus))) { - dos_unmount(fs); + if (mnt == NULL) + dos_unmount_impl(fs); return (EINVAL); } - if ((f = malloc(sizeof(DOS_FILE))) == NULL) { + if ((f = calloc(1, sizeof(DOS_FILE))) == NULL) { err = errno; - dos_unmount(fs); + if (mnt == NULL) + dos_unmount_impl(fs); return (err); } - bzero(f, sizeof(DOS_FILE)); f->fs = fs; fs->links++; f->de = *de; - fd->f_fsdata = (void *)f; + fd->f_fsdata = f; return (0); } @@ -381,7 +467,7 @@ dos_close(struct open_file *fd) f->fs->links--; free(f); - dos_unmount(fs); + dos_unmount_impl(fs); return (0); } diff --git a/stand/libsa/mount.c b/stand/libsa/mount.c new file mode 100644 index 000000000000..c9abe6b945fe --- /dev/null +++ b/stand/libsa/mount.c @@ -0,0 +1,163 @@ +/*- + * Copyright 2021 Toomas Soome + * + * 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 + +/* + * While setting "currdev" environment variable, alse "mount" the + * new root file system. This is done to hold disk device open + * in between file accesses, and thus preserve block cache for + * this device. Additionally, this allows us to optimize filesystem + * access by sharing filesystem metadata (like superblock). + */ + +typedef STAILQ_HEAD(mnt_info_list, mnt_info) mnt_info_list_t; + +typedef struct mnt_info { + STAILQ_ENTRY(mnt_info) mnt_link; /* link in mount list */ + const struct fs_ops *mnt_fs; + char *mnt_dev; + char *mnt_path; + unsigned mnt_refcount; + void *mnt_data; /* Private state */ +} mnt_info_t; + +/* list of mounted filesystems. */ +static mnt_info_list_t mnt_list = STAILQ_HEAD_INITIALIZER(mnt_list); + +static void +free_mnt(mnt_info_t *mnt) +{ + free(mnt->mnt_dev); + free(mnt->mnt_path); + free(mnt); +} + +static int +add_mnt_info(struct fs_ops *fs, const char *dev, const char *path, void *data) +{ + mnt_info_t *mnt; + + mnt = malloc(sizeof(*mnt)); + if (mnt == NULL) + return (ENOMEM); + + mnt->mnt_fs = fs; + mnt->mnt_dev = strdup(dev); + mnt->mnt_path = strdup(path); + mnt->mnt_data = data; + mnt->mnt_refcount = 1; + + if (mnt->mnt_dev == NULL || mnt->mnt_path == NULL) { + free_mnt(mnt); + return (ENOMEM); + } + STAILQ_INSERT_TAIL(&mnt_list, mnt, mnt_link); + return (0); +} + +static void +delete_mnt_info(mnt_info_t *mnt) +{ + STAILQ_REMOVE(&mnt_list, mnt, mnt_info, mnt_link); + free_mnt(mnt); +} + +int +mount(const char *dev, const char *path, int flags __unused, void *data) +{ + mnt_info_t *mnt; + int rc = -1; + + /* Is it already mounted? */ + STAILQ_FOREACH(mnt, &mnt_list, mnt_link) { + if (strcmp(dev, mnt->mnt_dev) == 0 && + strcmp(path, mnt->mnt_path) == 0) { + mnt->mnt_refcount++; + return (0); + } + } + + for (int i = 0; file_system[i] != NULL; i++) { + struct fs_ops *fs; + + fs = file_system[i]; + if (fs->fo_mount == NULL) + continue; + + if (fs->fo_mount(dev, path, &data) != 0) + continue; + + rc = add_mnt_info(fs, dev, path, data); + if (rc != 0 && mnt->mnt_fs->fo_unmount != NULL) { + printf("failed to mount %s: %s\n", dev, + strerror(rc)); + (void)mnt->mnt_fs->fo_unmount(dev, data); + } + break; + } + + + /* + * if rc is -1, it means we have no file system with fo_mount() + * callback, or all fo_mount() calls failed. As long as we + * have missing fo_mount() callbacks, we allow mount() to return 0. + */ + if (rc == -1) + rc = 0; + + return (rc); +} + +int +unmount(const char *dev, int flags __unused) +{ + mnt_info_t *mnt; + int rv; + + rv = 0; + STAILQ_FOREACH(mnt, &mnt_list, mnt_link) { + if (strcmp(dev, mnt->mnt_dev) == 0) { + if (mnt->mnt_refcount > 1) { + mnt->mnt_refcount--; + break; + } + + if (mnt->mnt_fs->fo_unmount != NULL) + rv = mnt->mnt_fs->fo_unmount(dev, + mnt->mnt_data); + delete_mnt_info(mnt); + break; + } + } + + if (rv != 0) + printf("failed to unmount %s: %d\n", dev, rv); + return (0); +} diff --git a/stand/libsa/netif.c b/stand/libsa/netif.c index 2d32ccd9de7e..f199da3b6e95 100644 --- a/stand/libsa/netif.c +++ b/stand/libsa/netif.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index 535fee31d586..ab0961b77086 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -111,6 +111,8 @@ struct fs_ops { off_t (*fo_seek)(struct open_file *f, off_t offset, int where); int (*fo_stat)(struct open_file *f, struct stat *sb); int (*fo_readdir)(struct open_file *f, struct dirent *d); + int (*fo_mount)(const char *, const char *, void **); + int (*fo_unmount)(const char *, void *); }; /* @@ -283,6 +285,8 @@ extern void ngets(char *, int); #define gets(x) ngets((x), 0) extern int fgetstr(char *buf, int size, int fd); +extern int mount(const char *dev, const char *path, int flags, void *data); +extern int unmount(const char *dev, int flags); extern int open(const char *, int); #define O_RDONLY 0x0 #define O_WRONLY 0x1 diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c index 02d13aa29722..a4015dea74c2 100644 --- a/stand/libsa/ufs.c +++ b/stand/libsa/ufs.c @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "stand.h" +#include "disk.h" #include "string.h" static int ufs_open(const char *path, struct open_file *f); @@ -91,16 +92,20 @@ static int ufs_read(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t ufs_seek(struct open_file *f, off_t offset, int where); static int ufs_stat(struct open_file *f, struct stat *sb); static int ufs_readdir(struct open_file *f, struct dirent *d); +static int ufs_mount(const char *dev, const char *path, void **data); +static int ufs_unmount(const char *dev, void *data); struct fs_ops ufs_fsops = { - "ufs", - ufs_open, - ufs_close, - ufs_read, - ufs_write, - ufs_seek, - ufs_stat, - ufs_readdir + .fs_name = "ufs", + .fo_open = ufs_open, + .fo_close = ufs_close, + .fo_read = ufs_read, + .fo_write = ufs_write, + .fo_seek = ufs_seek, + .fo_stat = ufs_stat, + .fo_readdir = ufs_readdir, + .fo_mount = ufs_mount, + .fo_unmount = ufs_unmount }; /* @@ -130,6 +135,15 @@ struct file { ((fp)->f_fs->fs_magic == FS_UFS1_MAGIC ? \ (fp)->f_di.di1.field : (fp)->f_di.di2.field) +typedef struct ufs_mnt { + char *um_dev; + int um_fd; + STAILQ_ENTRY(ufs_mnt) um_link; +} ufs_mnt_t; + +typedef STAILQ_HEAD(ufs_mnt_list, ufs_mnt) ufs_mnt_list_t; +static ufs_mnt_list_t mnt_list = STAILQ_HEAD_INITIALIZER(mnt_list); + static int read_inode(ino_t, struct open_file *); static int block_map(struct open_file *, ufs2_daddr_t, ufs2_daddr_t *); static int buf_read_file(struct open_file *, char **, size_t *); @@ -150,9 +164,7 @@ int ffs_sbget(void *, struct fs **, off_t, char *, * Read a new inode into a file structure. */ static int -read_inode(inumber, f) - ino_t inumber; - struct open_file *f; +read_inode(ino_t inumber, struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; struct fs *fs = fp->f_fs; @@ -207,10 +219,8 @@ out: * contains that block. */ static int -block_map(f, file_block, disk_block_p) - struct open_file *f; - ufs2_daddr_t file_block; - ufs2_daddr_t *disk_block_p; /* out */ +block_map(struct open_file *f, ufs2_daddr_t file_block, + ufs2_daddr_t *disk_block_p) { *** 586 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Sep 8 13:19:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28DDA67B22B; Wed, 8 Sep 2021 13:19:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4N5D0BJ0z4S3M; Wed, 8 Sep 2021 13:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7AE326536; Wed, 8 Sep 2021 13:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188DJBpx006505; Wed, 8 Sep 2021 13:19:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188DJBKk006504; Wed, 8 Sep 2021 13:19:11 GMT (envelope-from git) Date: Wed, 8 Sep 2021 13:19:11 GMT Message-Id: <202109081319.188DJBKk006504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: aab1d593b2ec - main - sctp: minor cleanups, no functional change intended MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aab1d593b2ec2c24a808eed39c39890b066d5fba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 13:19:12 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=aab1d593b2ec2c24a808eed39c39890b066d5fba commit aab1d593b2ec2c24a808eed39c39890b066d5fba Author: Michael Tuexen AuthorDate: 2021-09-08 13:13:05 +0000 Commit: Michael Tuexen CommitDate: 2021-09-08 13:13:49 +0000 sctp: minor cleanups, no functional change intended --- sys/netinet/sctp_input.c | 4 ++-- sys/netinet/sctp_output.c | 6 +++--- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_timer.c | 12 ++++++------ sys/netinet/sctp_usrreq.c | 6 +++--- sys/netinet/sctputil.c | 16 ++++++++-------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 77d15dcc955b..34f30799ec79 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2444,10 +2444,10 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, if ((uint32_t)diff.tv_sec > UINT32_MAX / 1000000) { staleness = UINT32_MAX; } else { - staleness = diff.tv_sec * 1000000; + staleness = (uint32_t)diff.tv_sec * 1000000; } if (UINT32_MAX - staleness >= (uint32_t)diff.tv_usec) { - staleness += diff.tv_usec; + staleness += (uint32_t)diff.tv_usec; } else { staleness = UINT32_MAX; } diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 142c5dbf33b6..24c6879e1925 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -11328,7 +11328,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked) /* Fill out hb parameter */ hb->heartbeat.hb_info.ph.param_type = htons(SCTP_HEARTBEAT_INFO); hb->heartbeat.hb_info.ph.param_length = htons(sizeof(struct sctp_heartbeat_info_param)); - hb->heartbeat.hb_info.time_value_1 = now.tv_sec; + hb->heartbeat.hb_info.time_value_1 = (uint32_t)now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ hb->heartbeat.hb_info.addr_family = (uint8_t)net->ro._l_addr.sa.sa_family; @@ -12847,7 +12847,7 @@ sctp_lower_sosend(struct socket *so, SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } else { - atomic_add_int(&stcb->asoc.sb_send_resv, sndlen); + atomic_add_int(&stcb->asoc.sb_send_resv, (int)sndlen); } local_soresv = sndlen; if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { @@ -13684,7 +13684,7 @@ out: out_unlocked: if (local_soresv && stcb) { - atomic_subtract_int(&stcb->asoc.sb_send_resv, sndlen); + atomic_subtract_int(&stcb->asoc.sb_send_resv, (int)sndlen); } if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 85ea5a3f8a53..473c71917ce7 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2576,7 +2576,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) /* Setup the initial secret */ (void)SCTP_GETTIME_TIMEVAL(&time); - m->time_of_secret_change = time.tv_sec; + m->time_of_secret_change = (unsigned int)time.tv_sec; for (i = 0; i < SCTP_NUMBER_OF_SECRETS; i++) { m->secret_key[0][i] = sctp_select_initial_TSN(m); diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 2d3836829e89..4866356bdf5c 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -542,8 +542,8 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, min_wait.tv_sec = min_wait.tv_usec = 0; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { - sctp_log_fr(cur_rto, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); - sctp_log_fr(0, min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(cur_rto, (uint32_t)now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(0, (uint32_t)min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); } /* * Our rwnd will be incorrect here since we are not adding back the @@ -590,7 +590,7 @@ start_again: /* validate its been outstanding long enough */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(chk->rec.data.tsn, - chk->sent_rcv_time.tv_sec, + (uint32_t)chk->sent_rcv_time.tv_sec, chk->sent_rcv_time.tv_usec, SCTP_FR_T3_MARK_TIME); } @@ -602,7 +602,7 @@ start_again: */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(0, - chk->sent_rcv_time.tv_sec, + (uint32_t)chk->sent_rcv_time.tv_sec, chk->sent_rcv_time.tv_usec, SCTP_FR_T3_STOPPED); } @@ -853,11 +853,11 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, if (net != stcb->asoc.primary_destination) { /* send a immediate HB if our RTO is stale */ struct timeval now; - unsigned int ms_goneby; + uint32_t ms_goneby; (void)SCTP_GETTIME_TIMEVAL(&now); if (net->last_sent_time.tv_sec) { - ms_goneby = (now.tv_sec - net->last_sent_time.tv_sec) * 1000; + ms_goneby = (uint32_t)(now.tv_sec - net->last_sent_time.tv_sec) * 1000; } else { ms_goneby = 0; } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 516e58753163..7079cdf7c403 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -2738,7 +2738,7 @@ flags_out: sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times; sasoc->sasoc_number_peer_destinations = 0; sasoc->sasoc_peer_rwnd = 0; - sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv); + sasoc->sasoc_local_rwnd = (uint32_t)sbspace(&inp->sctp_socket->so_rcv); SCTP_INP_RUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -2839,7 +2839,7 @@ flags_out: { struct sctp_hmacalgo *shmac; sctp_hmaclist_t *hmaclist; - uint32_t size; + size_t size; int i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, *optsize); @@ -2855,7 +2855,7 @@ flags_out: /* is there room for all of the hmac ids? */ size = sizeof(*shmac) + (hmaclist->num_algo * sizeof(shmac->shmac_idents[0])); - if ((size_t)(*optsize) < size) { + if (*optsize < size) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; SCTP_INP_RUNLOCK(inp); diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 0993f8eb302f..09d486038b65 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1936,7 +1936,7 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - inp->sctp_ep.time_of_secret_change = tv.tv_sec; + inp->sctp_ep.time_of_secret_change = (unsigned int)tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; inp->sctp_ep.current_secret_number++; @@ -6081,7 +6081,7 @@ get_more_data: copied_so_far += cp_len; freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; - atomic_subtract_int(&control->length, cp_len); + atomic_subtract_int(&control->length, (int)cp_len); control->data = sctp_m_free(m); m = control->data; /* @@ -6123,10 +6123,10 @@ get_more_data: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len); } - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); + atomic_subtract_int(&so->so_rcv.sb_cc, (int)cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); + atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); } copied_so_far += cp_len; freed_so_far += (uint32_t)cp_len; @@ -6135,7 +6135,7 @@ get_more_data: sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } - atomic_subtract_int(&control->length, cp_len); + atomic_subtract_int(&control->length, (int)cp_len); } else { copied_so_far += cp_len; } @@ -6233,9 +6233,9 @@ get_more_data: } /* * We need to wait for more data a few things: - We don't - * release the I/O lock so we don't get someone else reading. - * - We must be sure to account for the case where what is added - * is NOT to our control when we wakeup. + * release the I/O lock so we don't get someone else + * reading. - We must be sure to account for the case where + * what is added is NOT to our control when we wakeup. */ /* From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:18:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6675F67CE3F; Wed, 8 Sep 2021 15:18:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Qkw2Lw6z3NMw; Wed, 8 Sep 2021 15:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 321C9254; Wed, 8 Sep 2021 15:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FIWo1067081; Wed, 8 Sep 2021 15:18:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FIWlE067080; Wed, 8 Sep 2021 15:18:32 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:18:32 GMT Message-Id: <202109081518.188FIWlE067080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0b95680e077b - main - ipfw: Introduce dnctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b95680e077b7ef5bc6930c7c0f1a41106251d5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:18:32 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b95680e077b7ef5bc6930c7c0f1a41106251d5d commit 0b95680e077b7ef5bc6930c7c0f1a41106251d5d Author: Kristof Provost AuthorDate: 2021-05-25 14:54:32 +0000 Commit: Kristof Provost CommitDate: 2021-09-08 15:17:50 +0000 ipfw: Introduce dnctl Introduce a link to the ipfw command, dnctl, for dummynet configuration. dnctl only handles dummynet configuration, and is part of the effort to support dummynet in pf. /sbin/ipfw continues to accept pipe, queue and sched commands, but these can now also be issued via the new dnctl command. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30465 --- sbin/ipfw/Makefile | 4 + sbin/ipfw/ipfw.8 | 68 ++++++++--------- sbin/ipfw/ipfw2.c | 6 ++ sbin/ipfw/ipfw2.h | 8 ++ sbin/ipfw/main.c | 219 +++++++++++++++++++++++++++++++++-------------------- 5 files changed, 189 insertions(+), 116 deletions(-) diff --git a/sbin/ipfw/Makefile b/sbin/ipfw/Makefile index 552755a16961..c0b7e56226c4 100644 --- a/sbin/ipfw/Makefile +++ b/sbin/ipfw/Makefile @@ -4,6 +4,10 @@ PACKAGE=ipfw PROG= ipfw + +LINKS= ${BINDIR}/ipfw ${BINDIR}/dnctl +MLINKS= ipfw.8 dnctl.8 + SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c tables.c SRCS+= nat64clat.c nat64lsn.c nat64stl.c nptv6.c diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 6f11a24075b8..cb22bee44a1e 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,11 +1,11 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2021 +.Dd June 14, 2021 .Dt IPFW 8 .Os .Sh NAME -.Nm ipfw +.Nm ipfw , dnctl .Nd User interface for firewall, traffic shaper, packet scheduler, in-kernel NAT. .Sh SYNOPSIS @@ -88,12 +88,12 @@ in-kernel NAT. .Brq Ar name | all .Cm flush .Ss DUMMYNET CONFIGURATION (TRAFFIC SHAPER AND PACKET SCHEDULER) -.Nm +.Nm dnctl .Brq Cm pipe | queue | sched .Ar number .Cm config .Ar config-options -.Nm +.Nm dnctl .Op Fl s Op Ar field .Brq Cm pipe | queue | sched .Brq Cm delete | list | show @@ -440,7 +440,7 @@ them on the local hostname) and the use of macros to centralize frequently required arguments like IP addresses. .Ss TRAFFIC SHAPER CONFIGURATION The -.Nm +.Nm dnctl .Cm pipe , queue and .Cm sched @@ -2650,11 +2650,11 @@ Bandwidth, measured in A value of 0 (default) means unlimited bandwidth. The unit must immediately follow the number, as in .Pp -.Dl "ipfw pipe 1 config bw 300Kbit/s" +.Dl "dnctl pipe 1 config bw 300Kbit/s" .Pp If a device name is specified instead of a numeric value, as in .Pp -.Dl "ipfw pipe 1 config bw tun0" +.Dl "dnctl pipe 1 config bw tun0" .Pp then the transmit clock is supplied by the specified device. At the moment only the @@ -2731,7 +2731,7 @@ The file format is the following, with whitespace acting as a separator and '#' indicating the beginning a comment: .Bl -tag -width indent .It Cm name Ar identifier -optional name (listed by "ipfw pipe show") +optional name (listed by "dnctl pipe show") to identify the delay distribution; .It Cm bw Ar value the bandwidth used for the pipe. @@ -4356,15 +4356,15 @@ A similar effect can be achieved making use of .Nm dummynet pipes: .Pp -.Dl "ipfw add pipe 10 ip from any to any" -.Dl "ipfw pipe 10 config plr 0.05" +.Dl "dnctl add pipe 10 ip from any to any" +.Dl "dnctl pipe 10 config plr 0.05" .Pp We can use pipes to artificially limit bandwidth, e.g.\& on a machine acting as a router, if we want to limit traffic from local clients on 192.168.2.0/24 we do: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" -.Dl "ipfw pipe 1 config bw 300Kbit/s queue 50KBytes" +.Dl "dnctl pipe 1 config bw 300Kbit/s queue 50KBytes" .Pp note that we use the .Cm out @@ -4378,8 +4378,8 @@ limitations, the correct way is the following: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config bw 64Kbit/s queue 10Kbytes" -.Dl "ipfw pipe 2 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 1 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 2 config bw 64Kbit/s queue 10Kbytes" .Pp The above can be very useful, e.g.\& if you want to see how your fancy Web page will look for a residential user who @@ -4394,7 +4394,7 @@ Should we want to verify network performance with the RED queue management algorithm: .Pp .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" +.Dl "dnctl pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" .Pp Another typical application of the traffic shaper is to introduce some delay in the communication. @@ -4405,8 +4405,8 @@ bandwidth: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config delay 250ms bw 1Mbit/s" -.Dl "ipfw pipe 2 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 1 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 2 config delay 250ms bw 1Mbit/s" .Pp Per-flow queueing can be useful for a variety of purposes. A very simple one is counting traffic: @@ -4414,7 +4414,7 @@ A very simple one is counting traffic: .Dl "ipfw add pipe 1 tcp from any to any" .Dl "ipfw add pipe 1 udp from any to any" .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config mask all" +.Dl "dnctl pipe 1 config mask all" .Pp The above set of rules will create queues (and collect statistics) for all traffic. @@ -4432,8 +4432,8 @@ on a net with per-host limits, rather than per-network limits: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" .Dl "ipfw add pipe 2 ip from any to 192.168.2.0/24 in" -.Dl "ipfw pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" -.Dl "ipfw pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" .Ss LOOKUP TABLES In the following example, we need to create several traffic bandwidth classes and we need different hosts/networks to fall into different classes. @@ -4443,8 +4443,8 @@ For each subnet/host we set the argument equal to the number of the pipe that it should use. Then we classify traffic using a single rule: .Pp -.Dl "ipfw pipe 1 config bw 1000Kbyte/s" -.Dl "ipfw pipe 4 config bw 4000Kbyte/s" +.Dl "dnctl pipe 1 config bw 1000Kbyte/s" +.Dl "dnctl pipe 4 config bw 4000Kbyte/s" .Dl "..." .Dl "ipfw table T1 create type addr" .Dl "ipfw table T1 add 192.168.2.0/24 1" @@ -4626,7 +4626,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s codel" +.Dl "dnctl pipe 1 config bw 1mbits/s codel" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4636,8 +4636,8 @@ with AQM using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 codel target 8ms interval 160ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 codel target 8ms interval 160ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4647,7 +4647,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s pie" +.Dl "dnctl pipe 1 config bw 1mbits/s pie" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4657,8 +4657,8 @@ with AQM using different configuration parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp .Cm fq_codel @@ -4673,9 +4673,9 @@ To configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_codel" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_codel" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To change @@ -4686,7 +4686,7 @@ such as disable ECN and change the .Ar target to 10ms, we do: .Pp -.Dl "ipfw sched 1 config pipe 1 type fq_codel target 10ms noecn" +.Dl "dnctl sched 1 config pipe 1 type fq_codel target 10ms noecn" .Pp Similar to .Cm fq_codel , @@ -4695,9 +4695,9 @@ to configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_pie" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_pie" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp The configurations of diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index deb46fc64e00..e210cbfd02ec 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -411,6 +411,12 @@ static void object_sort_ctlv(ipfw_obj_ctlv *ctlv); static char *object_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx, uint16_t type); +int +is_ipfw(void) +{ + return (g_co.prog == cmdline_prog_ipfw); +} + /* * Simple string buffer API. * Used to simplify buffer passing between function and for diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 42e4f4777792..9a39c215692d 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -20,6 +20,11 @@ * $FreeBSD$ */ +enum cmdline_prog { + cmdline_prog_ipfw, + cmdline_prog_dnctl +}; + /* * Options that can be set on the command line. * When reading commands from a file, a subset of the options can also @@ -54,8 +59,11 @@ struct cmdline_opts { uint32_t use_set; /* work with specified set number */ /* 0 means all sets, otherwise apply to set use_set - 1 */ + enum cmdline_prog prog; /* Are we ipfw or dnctl? */ }; +int is_ipfw(void); + enum { TIMESTAMP_NONE = 0, TIMESTAMP_STRING, diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c index 89f21062811c..f7aa6af5369c 100644 --- a/sbin/ipfw/main.c +++ b/sbin/ipfw/main.c @@ -36,7 +36,8 @@ static void help(void) { - fprintf(stderr, + if (is_ipfw()) { + fprintf(stderr, "ipfw syntax summary (but please do read the ipfw(8) manpage):\n\n" "\tipfw [-abcdefhnNqStTv] \n\n" "where is one of the following:\n\n" @@ -76,6 +77,16 @@ help(void) " setup | {tcpack|tcpseq|tcpwin} NN | tcpflags SPEC | tcpoptions SPEC |\n" " tcpdatalen LIST | verrevpath | versrcreach | antispoof\n" ); + } else { + fprintf(stderr, +"dnctl syntax summary (but please do read the dnctl(8) manpage):\n\n" +"\tdnctl [-hnsv] \n\n" +"where is one of the following:\n\n" +"[pipe|queue|sched] N config PIPE-BODY\n" +"[pipe|queue|sched] {delete|list|show} [N{,N}]\n" +"\n" +); + } exit(0); } @@ -231,7 +242,8 @@ ipfw_main(int oldac, char **oldav) g_co.do_force = !isatty(STDIN_FILENO); #ifdef EMULATE_SYSCTL /* sysctl emulation */ - if ( ac >= 2 && !strcmp(av[1], "sysctl")) { + if (is_ipfw() && ac >= 2 && + !strcmp(av[1], "sysctl")) { char *s; int i; @@ -263,87 +275,115 @@ ipfw_main(int oldac, char **oldav) save_av = av; optind = optreset = 1; /* restart getopt() */ - while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) - switch (ch) { - case 'a': - do_acct = 1; - break; + if (is_ipfw()) { + while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) + switch (ch) { + case 'a': + do_acct = 1; + break; - case 'b': - g_co.comment_only = 1; - g_co.do_compact = 1; - break; + case 'b': + g_co.comment_only = 1; + g_co.do_compact = 1; + break; - case 'c': - g_co.do_compact = 1; - break; + case 'c': + g_co.do_compact = 1; + break; - case 'd': - g_co.do_dynamic = 1; - break; + case 'd': + g_co.do_dynamic = 1; + break; - case 'D': - g_co.do_dynamic = 2; - break; + case 'D': + g_co.do_dynamic = 2; + break; - case 'e': - /* nop for compatibility */ - break; + case 'e': + /* nop for compatibility */ + break; - case 'f': - g_co.do_force = 1; - break; + case 'f': + g_co.do_force = 1; + break; - case 'h': /* help */ - free(save_av); - help(); - break; /* NOTREACHED */ + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ - case 'i': - g_co.do_value_as_ip = 1; - break; + case 'i': + g_co.do_value_as_ip = 1; + break; - case 'n': - g_co.test_only = 1; - break; + case 'n': + g_co.test_only = 1; + break; - case 'N': - g_co.do_resolv = 1; - break; + case 'N': + g_co.do_resolv = 1; + break; - case 'p': - errx(EX_USAGE, "An absolute pathname must be used " - "with -p option."); - /* NOTREACHED */ + case 'p': + errx(EX_USAGE, "An absolute pathname must be used " + "with -p option."); + /* NOTREACHED */ - case 'q': - g_co.do_quiet = 1; - break; + case 'q': + g_co.do_quiet = 1; + break; - case 's': /* sort */ - g_co.do_sort = atoi(optarg); - break; + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; - case 'S': - g_co.show_sets = 1; - break; + case 'S': + g_co.show_sets = 1; + break; - case 't': - g_co.do_time = TIMESTAMP_STRING; - break; + case 't': + g_co.do_time = TIMESTAMP_STRING; + break; - case 'T': - g_co.do_time = TIMESTAMP_NUMERIC; - break; + case 'T': + g_co.do_time = TIMESTAMP_NUMERIC; + break; - case 'v': /* verbose */ - g_co.verbose = 1; - break; + case 'v': /* verbose */ + g_co.verbose = 1; + break; - default: - free(save_av); - return 1; - } + default: + free(save_av); + return 1; + } + } else { + while ((ch = getopt(ac, av, "hns:v")) != -1) + switch (ch) { + + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ + + case 'n': + g_co.test_only = 1; + break; + + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; + + case 'v': /* verbose */ + g_co.verbose = 1; + break; + + default: + free(save_av); + return 1; + } + + } ac -= optind; av += optind; @@ -367,7 +407,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_nat = 0; g_co.do_pipe = 0; g_co.use_set = 0; - if (!strncmp(*av, "nat", strlen(*av))) + if (is_ipfw() && !strncmp(*av, "nat", strlen(*av))) g_co.do_nat = 1; else if (!strncmp(*av, "pipe", strlen(*av))) g_co.do_pipe = 1; @@ -377,7 +417,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_pipe = 2; else if (_substrcmp(*av, "sched") == 0) g_co.do_pipe = 3; - else if (!strncmp(*av, "set", strlen(*av))) { + else if (is_ipfw() && !strncmp(*av, "set", strlen(*av))) { if (ac > 1 && isdigit(av[1][0])) { g_co.use_set = strtonum(av[1], 0, resvd_set_number, &errstr); @@ -406,8 +446,12 @@ ipfw_main(int oldac, char **oldav) av[1] = p; } + if (! is_ipfw() && g_co.do_pipe == 0) { + help(); + } + if (g_co.use_set == 0) { - if (_substrcmp(*av, "add") == 0) + if (is_ipfw() && _substrcmp(*av, "add") == 0) ipfw_add(av); else if (g_co.do_nat && _substrcmp(*av, "show") == 0) ipfw_show_nat(ac, av); @@ -415,13 +459,13 @@ ipfw_main(int oldac, char **oldav) ipfw_config_pipe(ac, av); else if (g_co.do_nat && _substrcmp(*av, "config") == 0) ipfw_config_nat(ac, av); - else if (_substrcmp(*av, "set") == 0) + else if (is_ipfw() && _substrcmp(*av, "set") == 0) ipfw_sets_handler(av); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "enable") == 0) + else if (is_ipfw() && _substrcmp(*av, "enable") == 0) ipfw_sysctl_handler(av, 1); - else if (_substrcmp(*av, "disable") == 0) + else if (is_ipfw() && _substrcmp(*av, "disable") == 0) ipfw_sysctl_handler(av, 0); else try_next = 1; @@ -430,28 +474,28 @@ ipfw_main(int oldac, char **oldav) if (g_co.use_set || try_next) { if (_substrcmp(*av, "delete") == 0) ipfw_delete(av); - else if (!strncmp(*av, "nat64clat", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64clat", strlen(*av))) ipfw_nat64clat_handler(ac, av); - else if (!strncmp(*av, "nat64stl", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64stl", strlen(*av))) ipfw_nat64stl_handler(ac, av); - else if (!strncmp(*av, "nat64lsn", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64lsn", strlen(*av))) ipfw_nat64lsn_handler(ac, av); - else if (!strncmp(*av, "nptv6", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nptv6", strlen(*av))) ipfw_nptv6_handler(ac, av); else if (_substrcmp(*av, "flush") == 0) ipfw_flush(g_co.do_force); - else if (_substrcmp(*av, "zero") == 0) + else if (is_ipfw() && _substrcmp(*av, "zero") == 0) ipfw_zero(ac, av, 0 /* IP_FW_ZERO */); - else if (_substrcmp(*av, "resetlog") == 0) + else if (is_ipfw() && _substrcmp(*av, "resetlog") == 0) ipfw_zero(ac, av, 1 /* IP_FW_RESETLOG */); else if (_substrcmp(*av, "print") == 0 || _substrcmp(*av, "list") == 0) ipfw_list(ac, av, do_acct); else if (_substrcmp(*av, "show") == 0) ipfw_list(ac, av, 1 /* show counters */); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "internal") == 0) + else if (is_ipfw() && _substrcmp(*av, "internal") == 0) ipfw_internal_handler(ac, av); else errx(EX_USAGE, "bad command `%s'", *av); @@ -620,12 +664,22 @@ main(int ac, char *av[]) } } #endif + + if (strcmp(av[0], "dnctl") == 0) + g_co.prog = cmdline_prog_dnctl; + else + g_co.prog = cmdline_prog_ipfw; + /* * If the last argument is an absolute pathname, interpret it * as a file to be preprocessed. */ if (ac > 1 && av[ac - 1][0] == '/') { + if (! is_ipfw()) + errx(EX_USAGE, "usage: dnctl [options]\n" + "do \"dnctl -h\" for details"); + if (access(av[ac - 1], R_OK) == 0) ipfw_readfile(ac, av); else @@ -633,8 +687,9 @@ main(int ac, char *av[]) } else { if (ipfw_main(ac, av)) { errx(EX_USAGE, - "usage: ipfw [options]\n" - "do \"ipfw -h\" or \"man ipfw\" for details"); + "usage: %s [options]\n" + "do \"%s -h\" or \"man %s\" for details", av[0], + av[0], av[0]); } } return EX_OK; From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:18:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8A3D67CC48; Wed, 8 Sep 2021 15:18:33 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Qkx4T0lz3NQQ; Wed, 8 Sep 2021 15:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502BA1DE; Wed, 8 Sep 2021 15:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FIXw1067105; Wed, 8 Sep 2021 15:18:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FIXKF067104; Wed, 8 Sep 2021 15:18:33 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:18:33 GMT Message-Id: <202109081518.188FIXKF067104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5fda5913e16a - main - dummynet tests: pipe test for IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fda5913e16afac72f3f420e227803e33d4c1542 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:18:33 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5fda5913e16afac72f3f420e227803e33d4c1542 commit 5fda5913e16afac72f3f420e227803e33d4c1542 Author: Kristof Provost AuthorDate: 2021-06-14 19:24:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-08 15:17:59 +0000 dummynet tests: pipe test for IPv6 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31787 --- tests/sys/netpfil/common/dummynet.sh | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 82cd22b77fef..42fbd83f297e 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -70,6 +70,50 @@ pipe_cleanup() firewall_cleanup $1 } +pipe_v6_head() +{ + atf_set descr 'Basic IPv6 pipe test' + atf_set require.user root +} + +pipe_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + + jexec alcatraz dnctl pipe 1 config bw 100Byte/s + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip6 from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Saturate the link + ping6 -i .1 -c 5 -s 1200 2001:db8:42::2 + + # We should now be hitting the limit and get this packet dropped. + atf_check -s exit:2 -o ignore ping6 -c 1 -s 1200 2001:db8:42::2 +} + +pipe_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ + ipfw \ + pipe_v6 \ ipfw From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:18:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB91867CD77; Wed, 8 Sep 2021 15:18:34 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Qky5DJDz3NW2; Wed, 8 Sep 2021 15:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 815FD289; Wed, 8 Sep 2021 15:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FIYPp067129; Wed, 8 Sep 2021 15:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FIYpw067128; Wed, 8 Sep 2021 15:18:34 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:18:34 GMT Message-Id: <202109081518.188FIYpw067128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cb6bfef9ca78 - main - netpfil tests: dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb6bfef9ca78623e33d2aef347dcee112a639103 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:18:34 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cb6bfef9ca78623e33d2aef347dcee112a639103 commit cb6bfef9ca78623e33d2aef347dcee112a639103 Author: Kristof Provost AuthorDate: 2021-09-02 13:38:04 +0000 Commit: Kristof Provost CommitDate: 2021-09-08 15:17:59 +0000 netpfil tests: dummynet queue test Test prioritisation and dummynet queues. We need to give the pipe sufficient bandwidth for dummynet to work. Given that we can't rely on the TCP connection failing alltogether, but we can measure the effect of dummynet by imposing a time limit on a larger data transfer. If TCP is prioritised it'll get most of the pipe bandwidth and easily manage to transfer the data in 3 seconds or less. When not prioritised this will not succeed. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31788 --- tests/sys/netpfil/common/dummynet.sh | 104 +++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 42fbd83f297e..4b3d01e124eb 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -112,8 +112,112 @@ pipe_v6_cleanup() firewall_cleanup $1 } +queue_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + reply=$(echo "foo" | nc -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 100 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 200 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping -f -s 1300 192.0.2.2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # This will fail if we reverse the pola^W priority + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 200 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 100 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + jexec alcatraz ping -f -s 1300 192.0.2.1 & + sleep 1 + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ + ipfw \ + queue \ ipfw From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:18:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3398567CDC8; Wed, 8 Sep 2021 15:18:36 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Qkz5STMz3NFj; Wed, 8 Sep 2021 15:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FFCF255; Wed, 8 Sep 2021 15:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FIZ7w067153; Wed, 8 Sep 2021 15:18:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FIZ6e067152; Wed, 8 Sep 2021 15:18:35 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:18:35 GMT Message-Id: <202109081518.188FIZ6e067152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 12184311c161 - main - netpfil tests: IPv6 dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12184311c16160464a36ae05b1cd8c5e3c24fbaa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:18:36 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=12184311c16160464a36ae05b1cd8c5e3c24fbaa commit 12184311c16160464a36ae05b1cd8c5e3c24fbaa Author: Kristof Provost AuthorDate: 2021-09-02 13:40:51 +0000 Commit: Kristof Provost CommitDate: 2021-09-08 15:17:59 +0000 netpfil tests: IPv6 dummynet queue test Same as the v4 test, but with IPv6. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31789 --- tests/sys/netpfil/common/dummynet.sh | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 4b3d01e124eb..7ff9a1e18fdc 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -214,10 +214,117 @@ queue_cleanup() firewall_cleanup $1 } +queue_v6_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 no_dad up + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2 no_dad up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + reply=$(echo "foo" | nc -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 100 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 200 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 100" \ + "pass out proto icmp6 dnqueue 200" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping6 -f -s 1200 2001:db8:42::2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # What happens if we prioritise ICMP over TCP? + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 200 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 100 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 200" \ + "pass out proto icmp6 dnqueue 100" + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ ipfw \ queue \ + ipfw \ + queue_v6 \ ipfw From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:18:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C448D67D002; Wed, 8 Sep 2021 15:18:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Ql13D15z3NYJ; Wed, 8 Sep 2021 15:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDB6FB8; Wed, 8 Sep 2021 15:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FIaH8067177; Wed, 8 Sep 2021 15:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FIa88067176; Wed, 8 Sep 2021 15:18:36 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:18:36 GMT Message-Id: <202109081518.188FIa88067176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 415e81d5d9ed - main - dummynet: remove unused definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 415e81d5d9ed7a73825d371c0b538765fa57a801 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:18:38 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=415e81d5d9ed7a73825d371c0b538765fa57a801 commit 415e81d5d9ed7a73825d371c0b538765fa57a801 Author: Kristof Provost AuthorDate: 2021-06-16 14:52:25 +0000 Commit: Kristof Provost CommitDate: 2021-09-08 15:18:00 +0000 dummynet: remove unused definitions No functional change. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31806 --- sys/netpfil/ipfw/ip_dn_private.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index 8dedd071bd81..cc084f2fcc0d 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -77,15 +77,7 @@ MALLOC_DECLARE(M_DUMMYNET); #define DN_BH_WUNLOCK() mtx_unlock(&V_dn_cfg.uh_mtx) #define DN_BH_LOCK_ASSERT() mtx_assert(&V_dn_cfg.uh_mtx, MA_OWNED) -SLIST_HEAD(dn_schk_head, dn_schk); -SLIST_HEAD(dn_sch_inst_head, dn_sch_inst); SLIST_HEAD(dn_fsk_head, dn_fsk); -SLIST_HEAD(dn_queue_head, dn_queue); -SLIST_HEAD(dn_alg_head, dn_alg); - -#ifdef NEW_AQM -SLIST_HEAD(dn_aqm_head, dn_aqm); /* for new AQMs */ -#endif struct mq { /* a basic queue of packets*/ struct mbuf *head, *tail; From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:41:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FB8567D6D2; Wed, 8 Sep 2021 15:41:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4RFJ47JCz3mG2; Wed, 8 Sep 2021 15:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D64773F; Wed, 8 Sep 2021 15:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FfOCB004120; Wed, 8 Sep 2021 15:41:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FfOQR004119; Wed, 8 Sep 2021 15:41:24 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:41:24 GMT Message-Id: <202109081541.188FfOQR004119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6e3af6321ba4 - main - sctp: Fix lock recursion in sctp_swap_inpcb_for_listen() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e3af6321ba46010272c78487634ec16816ff3e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:41:24 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6e3af6321ba46010272c78487634ec16816ff3e6 commit 6e3af6321ba46010272c78487634ec16816ff3e6 Author: Mark Johnston AuthorDate: 2021-09-08 03:02:15 +0000 Commit: Mark Johnston CommitDate: 2021-09-08 15:41:18 +0000 sctp: Fix lock recursion in sctp_swap_inpcb_for_listen() After commit bd4a39cc93d9 we now hold the global inp info lock across the call to sctp_swap_inpcb_for_listen(), which attempts to acquire it again. Since sctp_swap_inpcb_for_listen()'s sole caller is sctp_listen(), we can simply change it to not try to acquire the lock. Reported by: syzbot+a76b19ea2f8e1190c451@syzkaller.appspotmail.com Reported by: syzbot+a1b6cef257ad145b7187@syzkaller.appspotmail.com Reviewed by: tuexen Fixes: bd4a39cc93d9 ("socket: Properly interlock when transitioning to a listening socket") MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31878 --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 473c71917ce7..cdecb9f4bc9c 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -1845,6 +1845,8 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) struct sctppcbhead *head; struct sctp_inpcb *tinp, *ninp; + SCTP_INP_INFO_WLOCK_ASSERT(); + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE)) { /* only works with port reuse on */ return (-1); @@ -1853,7 +1855,6 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) return (0); } SCTP_INP_RUNLOCK(inp); - SCTP_INP_INFO_WLOCK(); head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(inp->sctp_lport, SCTP_BASE_INFO(hashmark))]; /* Kick out all non-listeners to the TCP hash */ @@ -1885,7 +1886,6 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) LIST_INSERT_HEAD(head, inp, sctp_hash); SCTP_INP_WUNLOCK(inp); SCTP_INP_RLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); return (0); } From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:41:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBCCC67D0C4; Wed, 8 Sep 2021 15:41:25 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4RFK574zz3mG6; Wed, 8 Sep 2021 15:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC05927; Wed, 8 Sep 2021 15:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FfPVZ004151; Wed, 8 Sep 2021 15:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FfP0C004150; Wed, 8 Sep 2021 15:41:25 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:41:25 GMT Message-Id: <202109081541.188FfP0C004150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ee4731179cb8 - main - sctp: Fix a lock order reversal in sctp_swap_inpcb_for_listen() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee4731179cb818570c8f708e77d238bf094d556c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:41:26 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ee4731179cb818570c8f708e77d238bf094d556c commit ee4731179cb818570c8f708e77d238bf094d556c Author: Mark Johnston AuthorDate: 2021-09-08 03:20:21 +0000 Commit: Mark Johnston CommitDate: 2021-09-08 15:41:19 +0000 sctp: Fix a lock order reversal in sctp_swap_inpcb_for_listen() When port reuse is enabled in a one-to-one-style socket, sctp_listen() may call sctp_swap_inpcb_for_listen() to move the PCB out of the "TCP pool". In so doing it will drop the PCB lock, yielding an LOR since we now hold several socket locks. Reorder sctp_listen() so that it performs this operation before beginning the conversion to a listening socket. Also modify sctp_swap_inpcb_for_listen() to return with PCB write-locked, since that's what sctp_listen() expects now. Reviewed by: tuexen Fixes: bd4a39cc93d9 ("socket: Properly interlock when transitioning to a listening socket") MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31879 --- sys/netinet/sctp_pcb.c | 5 ++--- sys/netinet/sctp_usrreq.c | 15 ++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index cdecb9f4bc9c..ee5308ff6192 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -1846,6 +1846,7 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) struct sctp_inpcb *tinp, *ninp; SCTP_INP_INFO_WLOCK_ASSERT(); + SCTP_INP_WLOCK_ASSERT(inp); if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE)) { /* only works with port reuse on */ @@ -1854,7 +1855,7 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) { return (0); } - SCTP_INP_RUNLOCK(inp); + SCTP_INP_WUNLOCK(inp); head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(inp->sctp_lport, SCTP_BASE_INFO(hashmark))]; /* Kick out all non-listeners to the TCP hash */ @@ -1884,8 +1885,6 @@ sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp) inp->sctp_flags &= ~SCTP_PCB_FLAGS_IN_TCPPOOL; head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(inp->sctp_lport, SCTP_BASE_INFO(hashmark))]; LIST_INSERT_HEAD(head, inp, sctp_hash); - SCTP_INP_WUNLOCK(inp); - SCTP_INP_RLOCK(inp); return (0); } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 7079cdf7c403..309cce10fe9b 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -7208,12 +7208,6 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK); } #endif - SOCK_LOCK(so); - error = solisten_proto_check(so); - if (error) { - SOCK_UNLOCK(so); - goto out; - } if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* @@ -7223,14 +7217,17 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) * move the guy that was listener to the TCP Pool. */ if (sctp_swap_inpcb_for_listen(inp)) { - SOCK_UNLOCK(so); - solisten_proto_abort(so); error = EADDRINUSE; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); goto out; } } - + SOCK_LOCK(so); + error = solisten_proto_check(so); + if (error) { + SOCK_UNLOCK(so); + goto out; + } if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) { SOCK_UNLOCK(so); From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:41:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA0267D0CC; Wed, 8 Sep 2021 15:41:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4RFL6VS0z3mJZ; Wed, 8 Sep 2021 15:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACF965E1; Wed, 8 Sep 2021 15:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FfQCH004175; Wed, 8 Sep 2021 15:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FfQnE004174; Wed, 8 Sep 2021 15:41:26 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:41:26 GMT Message-Id: <202109081541.188FfQnE004174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8b83b656a507 - main - path_test: Fix the unix socket test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b83b656a507ee767fcb6921985720d1df61101b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:41:27 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8b83b656a507ee767fcb6921985720d1df61101b commit 8b83b656a507ee767fcb6921985720d1df61101b Author: Mark Johnston AuthorDate: 2021-09-08 14:57:04 +0000 Commit: Mark Johnston CommitDate: 2021-09-08 15:41:19 +0000 path_test: Fix the unix socket test The intent was to specify O_PATH to open(2). MFC after: 1 week Sponsored by: The FreeBSD Foundation --- tests/sys/file/path_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 50a77f16736c..0265aa095720 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -865,7 +865,7 @@ ATF_TC_BODY(path_unix, tc) ATF_REQUIRE_MSG(bind(sd, (struct sockaddr *)&sun, SUN_LEN(&sun)) == 0, FMT_ERR("bind")); - pathfd = open(path, O_RDONLY); + pathfd = open(path, O_PATH); ATF_REQUIRE_ERRNO(EOPNOTSUPP, pathfd < 0); CHECKED_CLOSE(sd); From owner-dev-commits-src-main@freebsd.org Wed Sep 8 15:41:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01E3767D5CD; Wed, 8 Sep 2021 15:41:29 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4RFN28f8z3mMC; Wed, 8 Sep 2021 15:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF40779C; Wed, 8 Sep 2021 15:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188FfRRa004201; Wed, 8 Sep 2021 15:41:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188FfRPE004200; Wed, 8 Sep 2021 15:41:27 GMT (envelope-from git) Date: Wed, 8 Sep 2021 15:41:27 GMT Message-Id: <202109081541.188FfRPE004200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c4c661532438 - main - path_test: Fix test sorting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4c66153243896f9de49474c817fe450584a3bf3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 15:41:29 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4c66153243896f9de49474c817fe450584a3bf3 commit c4c66153243896f9de49474c817fe450584a3bf3 Author: Mark Johnston AuthorDate: 2021-09-08 14:59:42 +0000 Commit: Mark Johnston CommitDate: 2021-09-08 15:41:19 +0000 path_test: Fix test sorting MFC after: 1 week Sponsored by: The FreeBSD Foundation --- tests/sys/file/path_test.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 0265aa095720..ad88c691a914 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -63,25 +63,6 @@ #define CHECKED_CLOSE(fd) \ ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close")) -/* - * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd. - * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT. - */ -ATF_TC_WITHOUT_HEAD(path_pipe_fstatat); -ATF_TC_BODY(path_pipe_fstatat, tc) -{ - struct stat sb; - int fd[2]; - - ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe")); - ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0, - FMT_ERR("fstatat pipe")); - ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb, - AT_EMPTY_PATH) == -1); - CHECKED_CLOSE(fd[0]); - CHECKED_CLOSE(fd[1]); -} - /* Create a temporary regular file containing some data. */ static void mktfile(char path[PATH_MAX], const char *template) @@ -776,6 +757,25 @@ ATF_TC_BODY(path_lock, tc) CHECKED_CLOSE(pathfd); } +/* + * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd. + * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT. + */ +ATF_TC_WITHOUT_HEAD(path_pipe_fstatat); +ATF_TC_BODY(path_pipe_fstatat, tc) +{ + struct stat sb; + int fd[2]; + + ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe")); + ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat pipe")); + ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb, + AT_EMPTY_PATH) == -1); + CHECKED_CLOSE(fd[0]); + CHECKED_CLOSE(fd[1]); +} + /* Verify that we can send an O_PATH descriptor over a unix socket. */ ATF_TC_WITHOUT_HEAD(path_rights); ATF_TC_BODY(path_rights, tc) @@ -890,9 +890,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, path_io); ATF_TP_ADD_TC(tp, path_ioctl); ATF_TP_ADD_TC(tp, path_lock); + ATF_TP_ADD_TC(tp, path_pipe_fstatat); ATF_TP_ADD_TC(tp, path_rights); ATF_TP_ADD_TC(tp, path_unix); - ATF_TP_ADD_TC(tp, path_pipe_fstatat); return (atf_no_error()); } From owner-dev-commits-src-main@freebsd.org Wed Sep 8 16:01:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 204D567DA3F; Wed, 8 Sep 2021 16:01:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Rj20PX7z3sJy; Wed, 8 Sep 2021 16:01:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7AB3CBB3B; Wed, 8 Sep 2021 16:01:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: a8b89dff6ac0 - main - Disable acpi_timer_test by default To: Colin Percival , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109080132.1881WXPv069848@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 8 Sep 2021 09:01:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <202109080132.1881WXPv069848@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 16:01:58 -0000 On 9/7/21 6:32 PM, Colin Percival wrote: > The branch main has been updated by cperciva: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a8b89dff6ac026e60983824889d3666842ff409b > > commit a8b89dff6ac026e60983824889d3666842ff409b > Author: Colin Percival > AuthorDate: 2021-09-07 23:59:45 +0000 > Commit: Colin Percival > CommitDate: 2021-09-08 01:31:55 +0000 > > Disable acpi_timer_test by default > > This disables testing the ACPI timer by default, forcing the use of > ACPI-fast rather than ACPI-safe. The broken-ACPI-timers workaround > can be re-enabled by setting the hw.acpi.timer_test_enabled=1 tunable. > > This speeds up the FreeBSD boot process by 140 ms on an EC2 c5.xlarge > instance. > > This change will not be MFCed. > > Assuming no problems are reported, acpi_timer_test, the associated > tunable, and the ACPI-safe timecounter should be removed in FreeBSD 15. > > Relnotes: The ACPI-safe timer is disabled in favour of ACPI-fast; > if timekeeping issues are observed, please test with > hw.acpi.timer_test_enabled=1 in loader.conf and report > if that fixes the problem. Perhaps it should default to '1' for i386 and '0' otherwise? The relevant chipsets were 32-bit only, so this would be a simple way to skip the test for modern hardware, and you could probably MFC that safely. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Sep 8 16:02:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C3D67DD82; Wed, 8 Sep 2021 16:02:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Rjs4yVbz3snd; Wed, 8 Sep 2021 16:02:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 20A02B9A4; Wed, 8 Sep 2021 16:02:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109070951.1879pxlF010607@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 80645e1ce557 - main - pkgbase: Create a mlx-tools package Message-ID: Date: Wed, 8 Sep 2021 09:02:40 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <202109070951.1879pxlF010607@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 16:02:41 -0000 On 9/7/21 2:51 AM, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=80645e1ce5574ce4d63f0a1cad287949440384da > > commit 80645e1ce5574ce4d63f0a1cad287949440384da > Author: Emmanuel Vadot > AuthorDate: 2021-09-01 17:12:09 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-09-07 08:20:16 +0000 > > pkgbase: Create a mlx-tools package > > mlx* are only useful for users who have a Mellanox card. > Create a package for it so users that don't have this card can > avoid having this program. > > Differential Revision: https://reviews.freebsd.org/D31795 Uh, mlxcontrol(8) is for mlx(4) which is an old Mylex RAID controller. It's not for Mellanox tools. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Sep 8 17:47:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41A1267ED60 for ; Wed, 8 Sep 2021 17:47:44 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 4H4V340wvsz4pYp for ; Wed, 8 Sep 2021 17:47:44 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 86911 invoked from network); 8 Sep 2021 17:47:38 -0000 Received: from unknown (HELO dell7390.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 8 Sep 2021 17:47:38 -0000 Received: (qmail 1150 invoked from network); 8 Sep 2021 17:47:38 -0000 Received: from unknown (HELO dell7390.daemonology.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2021 17:47:38 -0000 To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109080132.1881WXPv069848@gitrepo.freebsd.org> From: Colin Percival Subject: Re: git: a8b89dff6ac0 - main - Disable acpi_timer_test by default Message-ID: <4b7bf983-8333-f4bc-6ce8-a59ac2fc7380@freebsd.org> Date: Wed, 8 Sep 2021 10:47:37 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4H4V340wvsz4pYp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 17:47:44 -0000 On 9/8/21 9:01 AM, John Baldwin wrote: > On 9/7/21 6:32 PM, Colin Percival wrote: >>      Disable acpi_timer_test by default >>           This disables testing the ACPI timer by default, forcing the use of >>      ACPI-fast rather than ACPI-safe.  The broken-ACPI-timers workaround >>      can be re-enabled by setting the hw.acpi.timer_test_enabled=1 tunable. >>           This speeds up the FreeBSD boot process by 140 ms on an EC2 c5.xlarge >>      instance. >>           This change will not be MFCed. >>           Assuming no problems are reported, acpi_timer_test, the associated >>      tunable, and the ACPI-safe timecounter should be removed in FreeBSD 15. >>           Relnotes:       The ACPI-safe timer is disabled in favour of >> ACPI-fast; >>                      if timekeeping issues are observed, please test with >>                      hw.acpi.timer_test_enabled=1 in loader.conf and report >>                      if that fixes the problem. > > Perhaps it should default to '1' for i386 and '0' otherwise?  The relevant > chipsets were 32-bit only, so this would be a simple way to skip the test for > modern hardware, and you could probably MFC that safely. That option was discussed, but I decided that it was probably safer to keep it enabled by default in 13 in case the test was detecting systems which are broken in other ways. Googling for "ACPI-safe" (which shows up if the test fails) finds forum discussions from the mid-2010s, but it's not clear whether that's due to very old hardware, new ACPI timer issues, or other timekeeping problems -- I figured it was best to play it safe for something which would be going into a stable branch though. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-dev-commits-src-main@freebsd.org Wed Sep 8 18:11:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CCA367F3A3 for ; Wed, 8 Sep 2021 18:11:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4VZ46RZKz3C1S for ; Wed, 8 Sep 2021 18:11:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe33.google.com with SMTP id p14so2845155vsm.2 for ; Wed, 08 Sep 2021 11:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JjBmv9cHs56Jei8qQcF3UXx+A/bG+VGL7URpog8vZxk=; b=HJrLOCYGe/qrMGnXRf52nKNpjIIxow3W5CFIroQkggnQCnakj+fQukcMx9HN3dN30H CNcKORklI1CqBCjJAqLZmh8ZVkNNqj4iNqNH5qy8vVc38M9slmZ4H7KDyuWKo1SGIAnH ZwahJY1f3bms9r5DpH5TlOAYbjeHiW+xeRD+VGy7kItoCH7GTk7MDTQtpoe/AP6SNKCa XE+7QyYmmvlhHFSiPg8Wf7rTLHWuiErciwPpbEP+E3zBu/ug4UkCYyESJ6TGji4ikuIq YYS8EMmwXQbfZIprYSvnOHswUVdX6lNJkgbuBAU/XRI2+OrJPHW7ky1SnmOCCDVfIa0Z uJMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JjBmv9cHs56Jei8qQcF3UXx+A/bG+VGL7URpog8vZxk=; b=cYJQetFHudw03n1aTgx180v93QW0t1ZpSE61dFba4ZHO401QxR6FTtjm2h75kkvdmO oXt4rXbDh8hbII1qRYjfcVMSsw84qRovxJjntGD9OeA1jauCK982pD3eM+r/qgr4YbaL XipBHCLeifoi/qnGQUYBmpviYlnQAxjwUS++RPloeSkPPUzQ2y89w0Fp2pEJ6kynxhtd wpbpcI9+/CZXvh8lRRbPbZoEw2adijnQwCBDyjZu3vJKyBMXY2tmsCL21eZAngSdECuO EvprG0pIHejmdVHsnW0tAMQino59d8ETyKRJnzThvlM2KtXrf8nlAYl1RJBR5nNpkcuH 8ysw== X-Gm-Message-State: AOAM533t/026hMrZ4aj54bYVogGZvxrzmH6yk3aWcDgdLRmcOM3fioOy zGSdLq90dXbXJYdue8lQBWOWyCQB8zHwPg3aP7uTcg== X-Google-Smtp-Source: ABdhPJz9y6GGaDyRJ2HZ5YINgiYNKSpKouWLqs7vCjzsFLtclPuSI1NfhBH7OPEkVRHXagwew4c5frO9DDUPHdHFwxc= X-Received: by 2002:a67:1985:: with SMTP id 127mr3421717vsz.44.1631124668262; Wed, 08 Sep 2021 11:11:08 -0700 (PDT) MIME-Version: 1.0 References: <202109080132.1881WXPv069848@gitrepo.freebsd.org> <4b7bf983-8333-f4bc-6ce8-a59ac2fc7380@freebsd.org> In-Reply-To: <4b7bf983-8333-f4bc-6ce8-a59ac2fc7380@freebsd.org> From: Warner Losh Date: Wed, 8 Sep 2021 12:10:56 -0600 Message-ID: Subject: Re: git: a8b89dff6ac0 - main - Disable acpi_timer_test by default To: Colin Percival Cc: John Baldwin , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H4VZ46RZKz3C1S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 18:11:09 -0000 On Wed, Sep 8, 2021, 11:47 AM Colin Percival wrote: > On 9/8/21 9:01 AM, John Baldwin wrote: > > On 9/7/21 6:32 PM, Colin Percival wrote: > >> Disable acpi_timer_test by default > >> This disables testing the ACPI timer by default, forcing the > use of > >> ACPI-fast rather than ACPI-safe. The broken-ACPI-timers workaround > >> can be re-enabled by setting the hw.acpi.timer_test_enabled=1 > tunable. > >> This speeds up the FreeBSD boot process by 140 ms on an EC2 > c5.xlarge > >> instance. > >> This change will not be MFCed. > >> Assuming no problems are reported, acpi_timer_test, the > associated > >> tunable, and the ACPI-safe timecounter should be removed in > FreeBSD 15. > >> Relnotes: The ACPI-safe timer is disabled in favour of > >> ACPI-fast; > >> if timekeeping issues are observed, please test > with > >> hw.acpi.timer_test_enabled=1 in loader.conf and > report > >> if that fixes the problem. > > > > Perhaps it should default to '1' for i386 and '0' otherwise? The > relevant > > chipsets were 32-bit only, so this would be a simple way to skip the > test for > > modern hardware, and you could probably MFC that safely. > > That option was discussed, but I decided that it was probably safer to > keep it enabled by default in 13 in case the test was detecting systems > which are broken in other ways. > > Googling for "ACPI-safe" (which shows up if the test fails) finds forum > discussions from the mid-2010s, but it's not clear whether that's due to > very old hardware, new ACPI timer issues, or other timekeeping problems > -- I figured it was best to play it safe for something which would be > going into a stable branch though. > I think John's suggestion is a good balance. It will also tell us if there is a need on amd64. Having it tagged as i386 also will highlight it better should the time come to remove it later. Warner -- > Colin Percival > Security Officer Emeritus, FreeBSD | The power to serve > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid > From owner-dev-commits-src-main@freebsd.org Wed Sep 8 21:32:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9971662048; Wed, 8 Sep 2021 21:32:48 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4b2m4qljz4sfc; Wed, 8 Sep 2021 21:32:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8680C505B; Wed, 8 Sep 2021 21:32:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188LWmia075183; Wed, 8 Sep 2021 21:32:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188LWm28075182; Wed, 8 Sep 2021 21:32:48 GMT (envelope-from git) Date: Wed, 8 Sep 2021 21:32:48 GMT Message-Id: <202109082132.188LWm28075182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 103b207536f9 - main - nfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 103b207536f976cb350558769f5f428e05ec61dc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 21:32:48 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=103b207536f976cb350558769f5f428e05ec61dc commit 103b207536f976cb350558769f5f428e05ec61dc Author: Rick Macklem AuthorDate: 2021-09-08 21:29:20 +0000 Commit: Rick Macklem CommitDate: 2021-09-08 21:29:20 +0000 nfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag Although it is not specified in the RFCs, the concept that the NFSv4 server should reply to an RPC request within a reasonable time is accepted practice within the NFSv4 community. Without this patch, the NFSv4.2 server attempts to reply to a Copy operation within 1 second by limiting the copy to vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at best, given the large variation in I/O subsystem performance. This patch uses the COPY_FILE_RANGE_TIMEO1SEC flag added by commit c5128c48df3c to limit the reply time for a Copy operation to approximately 1 second. MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 2d4635c75204..d82057fb9d9e 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -65,7 +65,6 @@ extern int nfsd_debuglevel; extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; -extern int nfs_maxcopyrange; extern uint32_t nfs_srvmaxio; static int nfs_async = 0; @@ -5506,7 +5505,6 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, int cnt, error = 0, ret; off_t inoff, outoff; uint64_t len; - size_t xfer; struct nfsstate inst, outst, *instp = &inst, *outstp = &outst; struct nfslock inlo, outlo, *inlop = &inlo, *outlop = &outlo; nfsquad_t clientid; @@ -5681,21 +5679,10 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = error; } - /* - * Do the actual copy to an upper limit of vfs.nfs.maxcopyrange. - * This limit is applied to ensure that the RPC replies in a - * reasonable time. - */ - if (len > nfs_maxcopyrange) - xfer = nfs_maxcopyrange; - else - xfer = len; - if (nd->nd_repstat == 0) { + if (nd->nd_repstat == 0) nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff, - &xfer, 0, nd->nd_cred, nd->nd_cred, NULL); - if (nd->nd_repstat == 0) - len = xfer; - } + &len, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, + NULL); /* Unlock the ranges. */ if (rl_rcookie != NULL) From owner-dev-commits-src-main@freebsd.org Wed Sep 8 23:27:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB067663EA8; Wed, 8 Sep 2021 23:27:03 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4dZb5fXKz3kYr; Wed, 8 Sep 2021 23:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EAC86F05; Wed, 8 Sep 2021 23:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 188NR3wd022849; Wed, 8 Sep 2021 23:27:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 188NR30v022848; Wed, 8 Sep 2021 23:27:03 GMT (envelope-from git) Date: Wed, 8 Sep 2021 23:27:03 GMT Message-Id: <202109082327.188NR30v022848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 58a7bf124cc2 - main - sctp: cleanup timewait handling for vtags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58a7bf124cc2b20e069bb89f2fd9ea5c1b7049c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 23:27:04 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=58a7bf124cc2b20e069bb89f2fd9ea5c1b7049c2 commit 58a7bf124cc2b20e069bb89f2fd9ea5c1b7049c2 Author: Michael Tuexen AuthorDate: 2021-09-08 23:18:58 +0000 Commit: Michael Tuexen CommitDate: 2021-09-08 23:18:58 +0000 sctp: cleanup timewait handling for vtags MFC after: 1 week --- sys/netinet/sctp_pcb.c | 161 +++++++++++++++---------------------------------- sys/netinet/sctp_pcb.h | 10 +-- 2 files changed, 49 insertions(+), 122 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index ee5308ff6192..82b7157c7ad7 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4497,99 +4497,70 @@ sctp_del_remote_addr(struct sctp_tcb *stcb, struct sockaddr *remaddr) return (-2); } -void -sctp_delete_from_timewait(uint32_t tag, uint16_t lport, uint16_t rport) +static bool +sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) { struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; - int found = 0; int i; + SCTP_INP_INFO_RLOCK_ASSERT(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && + if ((twait_block->vtag_block[i].tv_sec_at_expire >= now) && + (twait_block->vtag_block[i].v_tag == tag) && (twait_block->vtag_block[i].lport == lport) && (twait_block->vtag_block[i].rport == rport)) { - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - found = 1; - break; + return (true); } } - if (found) - break; } + return (false); } -int -sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport) +static void +sctp_set_vtag_block(struct sctp_timewait *vtag_block, uint32_t time, + uint32_t tag, uint16_t lport, uint16_t rport) { - struct sctpvtaghead *chain; - struct sctp_tagblock *twait_block; - int found = 0; - int i; - - SCTP_INP_INFO_WLOCK(); - chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - found = 1; - break; - } - } - if (found) - break; - } - SCTP_INP_INFO_WUNLOCK(); - return (found); + vtag_block->tv_sec_at_expire = time; + vtag_block->v_tag = tag; + vtag_block->lport = lport; + vtag_block->rport = rport; } -void -sctp_add_vtag_to_timewait(uint32_t tag, uint32_t time, uint16_t lport, uint16_t rport) +static void +sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) { struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; struct timeval now; - int set, i; + uint32_t time; + int i; + bool set; - if (time == 0) { - /* Its disabled */ - return; - } + SCTP_INP_INFO_WLOCK_ASSERT(); (void)SCTP_GETTIME_TIMEVAL(&now); + time = now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - set = 0; + set = false; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* Block(s) present, lets find space, and expire on the fly */ for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == 0) && - !set) { - twait_block->vtag_block[i].tv_sec_at_expire = - now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; - } else if ((twait_block->vtag_block[i].v_tag) && - ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - if (set == 0) { - /* Reuse it for my new tag */ - twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; + if ((twait_block->vtag_block[i].v_tag == 0) && !set) { + sctp_set_vtag_block(twait_block->vtag_block + i, time, tag, lport, rport); + set = true; + continue; + } + if ((twait_block->vtag_block[i].v_tag != 0) && + (twait_block->vtag_block[i].tv_sec_at_expire < (uint32_t)now.tv_sec)) { + if (set) { + /* Audit expires this guy */ + sctp_set_vtag_block(twait_block->vtag_block + i, 0, 0, 0, 0); + } else { + /* Reuse it for the new tag */ + sctp_set_vtag_block(twait_block->vtag_block + i, time, tag, lport, rport); + set = true; } } } @@ -4610,10 +4581,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint32_t time, uint16_t lport, uint16_t } memset(twait_block, 0, sizeof(struct sctp_tagblock)); LIST_INSERT_HEAD(chain, twait_block, sctp_nxt_tagblock); - twait_block->vtag_block[0].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[0].v_tag = tag; - twait_block->vtag_block[0].lport = lport; - twait_block->vtag_block[0].rport = rport; + sctp_set_vtag_block(twait_block->vtag_block, time, tag, lport, rport); } } @@ -4906,8 +4874,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre } /* pull from vtag hash */ LIST_REMOVE(stcb, sctp_asocs); - sctp_add_vtag_to_timewait(asoc->my_vtag, SCTP_BASE_SYSCTL(sctp_vtag_time_wait), - inp->sctp_lport, stcb->rport); + sctp_add_vtag_to_timewait(asoc->my_vtag, inp->sctp_lport, stcb->rport); /* * Now restop the timers to be sure this is paranoia at is finest! @@ -6697,24 +6664,15 @@ sctp_set_primary_addr(struct sctp_tcb *stcb, struct sockaddr *sa, } } -int +bool sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval *now) { - /* - * This function serves two purposes. It will see if a TAG can be - * re-used and return 1 for yes it is ok and 0 for don't use that - * tag. A secondary function it will do is purge out old tags that - * can be removed. - */ - struct sctpvtaghead *chain; - struct sctp_tagblock *twait_block; struct sctpasochead *head; struct sctp_tcb *stcb; - int i; + bool result; SCTP_INP_INFO_RLOCK(); - head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(tag, - SCTP_BASE_INFO(hashasocmark))]; + head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(tag, SCTP_BASE_INFO(hashasocmark))]; LIST_FOREACH(stcb, head, sctp_asocs) { /* * We choose not to lock anything here. TCB's can't be @@ -6733,40 +6691,15 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * if (stcb->sctp_ep->sctp_lport != lport) { continue; } - /* Its a used tag set */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } - } - chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - /* Now what about timed wait ? */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - /* - * Block(s) are present, lets see if we have this tag in the - * list - */ - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if (twait_block->vtag_block[i].v_tag == 0) { - /* not used */ - continue; - } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < - now->tv_sec) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - } else if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - /* Bad tag, sorry :< */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } + /* The tag is currently used, so don't use it. */ + result = false; + goto out; } } + result = !sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec); +out: SCTP_INP_INFO_RUNLOCK(); - return (1); + return (result); } static void diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index f93e8f11b3e4..a3d0b489eb82 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -580,13 +580,6 @@ sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); -void sctp_delete_from_timewait(uint32_t, uint16_t, uint16_t); - -int sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport); - -void - sctp_add_vtag_to_timewait(uint32_t tag, uint32_t time, uint16_t lport, uint16_t rport); - void sctp_add_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *, uint32_t); void sctp_del_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *); @@ -612,7 +605,8 @@ int sctp_set_primary_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets *); -int sctp_is_vtag_good(uint32_t, uint16_t lport, uint16_t rport, struct timeval *); +bool + sctp_is_vtag_good(uint32_t, uint16_t lport, uint16_t rport, struct timeval *); /* void sctp_drain(void); */ From owner-dev-commits-src-main@freebsd.org Thu Sep 9 00:31:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89CAC664D35; Thu, 9 Sep 2021 00:31:31 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4g0z2rzTz4ZD0; Thu, 9 Sep 2021 00:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4100376FA; Thu, 9 Sep 2021 00:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1890VVte011215; Thu, 9 Sep 2021 00:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1890VViJ011214; Thu, 9 Sep 2021 00:31:31 GMT (envelope-from git) Date: Thu, 9 Sep 2021 00:31:31 GMT Message-Id: <202109090031.1890VViJ011214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: d06d7eb09131 - main - wpa: Address CTRL-EVENT-SCAN-FAILED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d06d7eb09131edea666bf049d6c0c55672726f76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 00:31:31 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d06d7eb09131edea666bf049d6c0c55672726f76 commit d06d7eb09131edea666bf049d6c0c55672726f76 Author: Cy Schubert AuthorDate: 2021-09-09 00:20:52 +0000 Commit: Cy Schubert CommitDate: 2021-09-09 00:20:52 +0000 wpa: Address CTRL-EVENT-SCAN-FAILED 5fcdc19a8111 didn't fully resolve the issue. There remains a report that an ifconfig wlan0 up by itself is insufficient. Ifconfig down must precede it. Reported by: Filipe da Silva Santos Fixes: 5fcdc19a8111 MFC after: 3 days --- libexec/rc/rc.d/wpa_supplicant | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rc/rc.d/wpa_supplicant b/libexec/rc/rc.d/wpa_supplicant index 3c5c9d243f68..9e5f64a5373f 100755 --- a/libexec/rc/rc.d/wpa_supplicant +++ b/libexec/rc/rc.d/wpa_supplicant @@ -29,6 +29,8 @@ is_ndis_interface() } wpa_poststart() { + ifconfig ${ifn} down + sleep 2 ifconfig ${ifn} up } From owner-dev-commits-src-main@freebsd.org Thu Sep 9 01:58:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 494FB666D9C; Thu, 9 Sep 2021 01:58:35 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4hxR1G26z3J28; Thu, 9 Sep 2021 01:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0954E10FAF; Thu, 9 Sep 2021 01:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1891wYSH022869; Thu, 9 Sep 2021 01:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1891wYIw022868; Thu, 9 Sep 2021 01:58:34 GMT (envelope-from git) Date: Thu, 9 Sep 2021 01:58:34 GMT Message-Id: <202109090158.1891wYIw022868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f1c8811d2d25 - main - nfsd: Fix build after commit 103b207536f9 for 32bit arches MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1c8811d2d250aac5a59bb2109d905139c119925 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 01:58:35 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f1c8811d2d250aac5a59bb2109d905139c119925 commit f1c8811d2d250aac5a59bb2109d905139c119925 Author: Rick Macklem AuthorDate: 2021-09-09 01:55:06 +0000 Commit: Rick Macklem CommitDate: 2021-09-09 01:55:06 +0000 nfsd: Fix build after commit 103b207536f9 for 32bit arches MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index d82057fb9d9e..85834f7796f7 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5505,6 +5505,7 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, int cnt, error = 0, ret; off_t inoff, outoff; uint64_t len; + size_t xfer; struct nfsstate inst, outst, *instp = &inst, *outstp = &outst; struct nfslock inlo, outlo, *inlop = &inlo, *outlop = &outlo; nfsquad_t clientid; @@ -5679,10 +5680,14 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = error; } - if (nd->nd_repstat == 0) + xfer = len; + if (nd->nd_repstat == 0) { nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff, - &len, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, + &xfer, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, NULL); + if (nd->nd_repstat == 0) + len = xfer; + } /* Unlock the ranges. */ if (rl_rcookie != NULL) From owner-dev-commits-src-main@freebsd.org Thu Sep 9 04:19:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EC60668E25; Thu, 9 Sep 2021 04:19:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4m442RgPz4jl3; Thu, 9 Sep 2021 04:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C9112B74; Thu, 9 Sep 2021 04:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1894JWt3009783; Thu, 9 Sep 2021 04:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1894JW5R009782; Thu, 9 Sep 2021 04:19:32 GMT (envelope-from git) Date: Thu, 9 Sep 2021 04:19:32 GMT Message-Id: <202109090419.1894JW5R009782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 53c17de2b472 - main - cxgbe/t4_tom: Use stale L2T entry and avoid busy-waiting for resolution. MFC after: 1 week Sponsored by: Chelsio Communications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53c17de2b472c5c4982d5a020268ad3098241498 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 04:19:32 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=53c17de2b472c5c4982d5a020268ad3098241498 commit 53c17de2b472c5c4982d5a020268ad3098241498 Author: Navdeep Parhar AuthorDate: 2021-09-09 03:46:42 +0000 Commit: Navdeep Parhar CommitDate: 2021-09-09 03:55:47 +0000 cxgbe/t4_tom: Use stale L2T entry and avoid busy-waiting for resolution. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_tom_l2t.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index 682c99840dcd..1d094c30d25e 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -271,8 +271,7 @@ again: switch (e->state) { case L2T_STATE_STALE: /* entry is stale, kick off revalidation */ - if (resolve_entry(sc, e) != EWOULDBLOCK) - goto again; /* entry updated, re-examine state */ + resolve_entry(sc, e); /* Fall through */ From owner-dev-commits-src-main@freebsd.org Thu Sep 9 06:16:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E49BB66A11D; Thu, 9 Sep 2021 06:16:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4pfr5sqqz3lyV; Thu, 9 Sep 2021 06:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9C2414850; Thu, 9 Sep 2021 06:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1896GKcx074681; Thu, 9 Sep 2021 06:16:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1896GKt4074680; Thu, 9 Sep 2021 06:16:20 GMT (envelope-from git) Date: Thu, 9 Sep 2021 06:16:20 GMT Message-Id: <202109090616.1896GKt4074680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 06cce53d5623 - main - pkgbase: Move back mlxcontrol in the default package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06cce53d5623c1106a54caee28791ed3994df23f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 06:16:21 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=06cce53d5623c1106a54caee28791ed3994df23f commit 06cce53d5623c1106a54caee28791ed3994df23f Author: Emmanuel Vadot AuthorDate: 2021-09-09 06:14:53 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-09 06:14:53 +0000 pkgbase: Move back mlxcontrol in the default package mlxcontrol(8) is a tool for mlx(4) raid card and isn't related to Mellanox card. Reported by: jhb --- usr.sbin/mlxcontrol/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/mlxcontrol/Makefile b/usr.sbin/mlxcontrol/Makefile index 3f2755bda929..5a425fd003da 100644 --- a/usr.sbin/mlxcontrol/Makefile +++ b/usr.sbin/mlxcontrol/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE= mlx-tools - PROG= mlxcontrol MAN= mlxcontrol.8 SRCS= command.c config.c interface.c util.c From owner-dev-commits-src-main@freebsd.org Thu Sep 9 06:17:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D5DD66A410; Thu, 9 Sep 2021 06:17:24 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4ph33wvlz3m02; Thu, 9 Sep 2021 06:17:23 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1631168236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pf4cqMtHqHHnP1biUNCopGIFEFTtRvTxqOxQdiLajqE=; b=k+O4nV5rSOnkShjuisRkZgFZ4NBydwFidipJ5LoDar//NVPtP56UnP5Zr3xvbWF7FMhSOE +CYPuWZygAcHamMP44xBFMVsim1F131fUrVZoGmcjYxV6yjj9OuonsZbiDBm1xZMPhvJQi s4PFGjc61XdRj5ig3+nSBQ5f3HbvHqk= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 80c0ca10 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 9 Sep 2021 06:17:16 +0000 (UTC) Date: Thu, 9 Sep 2021 08:17:15 +0200 From: Emmanuel Vadot To: John Baldwin Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 80645e1ce557 - main - pkgbase: Create a mlx-tools package Message-Id: <20210909081715.2d9ec308d93cf89af4571989@bidouilliste.com> In-Reply-To: References: <202109070951.1879pxlF010607@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H4ph33wvlz3m02 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 06:17:24 -0000 On Wed, 8 Sep 2021 09:02:40 -0700 John Baldwin wrote: > On 9/7/21 2:51 AM, Emmanuel Vadot wrote: > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=80645e1ce5574ce4d63f0a1cad287949440384da > > > > commit 80645e1ce5574ce4d63f0a1cad287949440384da > > Author: Emmanuel Vadot > > AuthorDate: 2021-09-01 17:12:09 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2021-09-07 08:20:16 +0000 > > > > pkgbase: Create a mlx-tools package > > > > mlx* are only useful for users who have a Mellanox card. > > Create a package for it so users that don't have this card can > > avoid having this program. > > > > Differential Revision: https://reviews.freebsd.org/D31795 > > Uh, mlxcontrol(8) is for mlx(4) which is an old Mylex RAID controller. It's > not for Mellanox tools. Meh yeah, sorry for that, fixed in 06cce53d5623. -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Thu Sep 9 07:02:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 896E466AF27; Thu, 9 Sep 2021 07:02:21 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4qgx3KDxz4Rvb; Thu, 9 Sep 2021 07:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F0515267; Thu, 9 Sep 2021 07:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18972Lp3040542; Thu, 9 Sep 2021 07:02:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18972LAu040541; Thu, 9 Sep 2021 07:02:21 GMT (envelope-from git) Date: Thu, 9 Sep 2021 07:02:21 GMT Message-Id: <202109090702.18972LAu040541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 763bcebe0b6d - main - lualoader: remove shadowed local from graphics:drawitem() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 763bcebe0b6d5e53e5c8940a677de662e5652b6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 07:02:21 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=763bcebe0b6d5e53e5c8940a677de662e5652b6d commit 763bcebe0b6d5e53e5c8940a677de662e5652b6d Author: Kyle Evans AuthorDate: 2021-09-08 21:32:53 +0000 Commit: Kyle Evans CommitDate: 2021-09-09 07:01:50 +0000 lualoader: remove shadowed local from graphics:drawitem() for loop vars are local already and distinct from this earlier declaration; remove it. --- stand/lua/drawer.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 6324c2262c11..b592b416033d 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -377,7 +377,6 @@ end local function drawitem(func) local console = loader.getenv("console") - local c for c in string.gmatch(console, "%w+") do loader.setenv("console", c) From owner-dev-commits-src-main@freebsd.org Thu Sep 9 07:02:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C5CC66B020; Thu, 9 Sep 2021 07:02:23 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4qgy5LTwz4SNB; Thu, 9 Sep 2021 07:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 790BE152E3; Thu, 9 Sep 2021 07:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18972MI0040568; Thu, 9 Sep 2021 07:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18972MSb040567; Thu, 9 Sep 2021 07:02:22 GMT (envelope-from git) Date: Thu, 9 Sep 2021 07:02:22 GMT Message-Id: <202109090702.18972MSb040567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: e19d9a9b6e44 - main - lualoader: allow brands to specify a shift MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e19d9a9b6e44e15087a140a26ab3e24b07f6ba56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 07:02:23 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e19d9a9b6e44e15087a140a26ab3e24b07f6ba56 commit e19d9a9b6e44e15087a140a26ab3e24b07f6ba56 Author: Kyle Evans AuthorDate: 2021-09-08 21:33:28 +0000 Commit: Kyle Evans CommitDate: 2021-09-09 07:01:50 +0000 lualoader: allow brands to specify a shift Some brands will want to specify a shift to make sure they're properly centered; let it happen. --- stand/lua/drawer.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index b592b416033d..6f6e2fe1b3e8 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -308,6 +308,11 @@ local function drawbrand() x = x + shift.x y = y + shift.y + if branddef.shift ~= nil then + x = x + branddef.shift.x + y = y + branddef.shift.y + end + if core.isFramebufferConsole() and loader.term_putimage ~= nil and branddef.image ~= nil then From owner-dev-commits-src-main@freebsd.org Thu Sep 9 07:02:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30A0466B091; Thu, 9 Sep 2021 07:02:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4qgz6J3mz4SDm; Thu, 9 Sep 2021 07:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A159F153CC; Thu, 9 Sep 2021 07:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18972Nme040592; Thu, 9 Sep 2021 07:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18972Nfo040591; Thu, 9 Sep 2021 07:02:23 GMT (envelope-from git) Date: Thu, 9 Sep 2021 07:02:23 GMT Message-Id: <202109090702.18972Nfo040591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: ed107537b43c - main - lualoader: use more concise verbiage for autoboot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed107537b43cabf7a18e73a17856a9d9e170c6e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 07:02:24 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ed107537b43cabf7a18e73a17856a9d9e170c6e9 commit ed107537b43cabf7a18e73a17856a9d9e170c6e9 Author: Kyle Evans AuthorDate: 2021-09-08 21:34:33 +0000 Commit: Kyle Evans CommitDate: 2021-09-09 07:01:50 +0000 lualoader: use more concise verbiage for autoboot The behavior remains the same, but lualoader now uses the more concise verbiage that forthloader used. This is particularly important because the previous line would exceed the right boundary of the menu and run straight into space that would typically be allowed for the logo. This makes it slightly easier to port logos from forthloader to lualoader. --- stand/lua/menu.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index a6470e9f70ef..d1e1ee012834 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -522,8 +522,7 @@ function menu.autoboot(delay) last = time screen.setcursor(x, y) print("Autoboot in " .. time .. - " seconds, hit [Enter] to boot" .. - " or any other key to stop ") + " seconds. [Space] to pause") screen.defcursor() end if io.ischar() then From owner-dev-commits-src-main@freebsd.org Thu Sep 9 07:31:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CB0E66B453; Thu, 9 Sep 2021 07:31:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4rKB49q5z4bDn; Thu, 9 Sep 2021 07:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46DE315A08; Thu, 9 Sep 2021 07:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1897VAc7076668; Thu, 9 Sep 2021 07:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1897VAdP076667; Thu, 9 Sep 2021 07:31:10 GMT (envelope-from git) Date: Thu, 9 Sep 2021 07:31:10 GMT Message-Id: <202109090731.1897VAdP076667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: f2c9a8b9d95d - main - stress2: Add a syzkaller reproducer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2c9a8b9d95de2b2aefd9e2067cf77fb1378ea7e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 07:31:11 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=f2c9a8b9d95de2b2aefd9e2067cf77fb1378ea7e commit f2c9a8b9d95de2b2aefd9e2067cf77fb1378ea7e Author: Peter Holm AuthorDate: 2021-09-09 07:30:47 +0000 Commit: Peter Holm CommitDate: 2021-09-09 07:30:47 +0000 stress2: Add a syzkaller reproducer --- tools/test/stress2/misc/syzkaller44.sh | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/tools/test/stress2/misc/syzkaller44.sh b/tools/test/stress2/misc/syzkaller44.sh new file mode 100755 index 000000000000..625891f45925 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller44.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# panic: __rw_wlock_hard: recursing but non-recursive rw sctp-info @ /usr/src/sys/netinet/sctp_pcb.c:1856 +# cpuid = 10 +# time = 1631108444 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe065f32e7f0 +# vpanic() at vpanic+0x187/frame 0xfffffe065f32e850 +# panic() at panic+0x43/frame 0xfffffe065f32e8b0 +# __rw_wlock_hard() at __rw_wlock_hard+0x7d1/frame 0xfffffe065f32e960 +# _rw_wlock_cookie() at _rw_wlock_cookie+0xb7/frame 0xfffffe065f32e9a0 +# sctp_swap_inpcb_for_listen() at sctp_swap_inpcb_for_listen+0x7f/frame 0xfffffe065f32e9f0 +# sctp_listen() at sctp_listen+0x248/frame 0xfffffe065f32ea60 +# solisten() at solisten+0x42/frame 0xfffffe065f32ea80 +# kern_listen() at kern_listen+0x7d/frame 0xfffffe065f32eac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe065f32ebf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe065f32ebf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x800380a4a, rsp = 0x7fffffffe9b8, rbp = 0x7fffffffe9d0 --- +# KDB: enter: panic +# [ thread pid 26683 tid 924765 ] +# Stopped at kdb_enter+0x37: movq $0,0x12724de(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n249253-4ccbbe5f0689: Wed Sep 8 07:26:48 CEST 2021 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 +# db> + +# Fixed by 6e3af6321ba4 - main - sctp: Fix lock recursion in sctp_swap_inpcb_for_listen() + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller44.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + res = syscall(SYS_socket, 0x1cul, 1ul, 0x84); + if (res != -1) + r[0] = res; + *(uint32_t*)0x20000140 = 0; + syscall(SYS_setsockopt, r[0], 0x84, 0x1c, 0x20000140ul, 4ul); + *(uint8_t*)0x20000080 = 0x46; + *(uint8_t*)0x20000081 = 0x1c; + *(uint16_t*)0x20000082 = htobe16(0x4e22); + *(uint32_t*)0x20000084 = 0; + memset((void*)0x20000088, 0, 16); + *(uint32_t*)0x20000098 = 0; + syscall(SYS_bind, r[0], 0x20000080ul, 0x1cul); + res = syscall(SYS_socket, 0x1cul, 1ul, 0x84); + if (res != -1) + r[1] = res; + *(uint32_t*)0x20000140 = 0; + syscall(SYS_setsockopt, r[1], 0x84, 0x1c, 0x20000140ul, 4ul); + *(uint8_t*)0x20000080 = 0x46; + *(uint8_t*)0x20000081 = 0x1c; + *(uint16_t*)0x20000082 = htobe16(0x4e22); + *(uint32_t*)0x20000084 = 0; + memset((void*)0x20000088, 0, 16); + *(uint32_t*)0x20000098 = 0; + syscall(SYS_bind, r[1], 0x20000080ul, 0x1cul); + syscall(SYS_listen, r[1], 0); + return 0; +} +EOF +mycc -o /tmp/syzkaller44 -Wall -Wextra -O0 /tmp/syzkaller44.c || exit 1 + +kldstat -v | grep -q sctp || kldload sctp.ko +(cd /tmp; timeout 3m ./syzkaller44) + +rm -rf /tmp/syzkaller44 /tmp/syzkaller44.c /tmp/syzkaller.* +exit 0 From owner-dev-commits-src-main@freebsd.org Thu Sep 9 10:47:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC55F66E4B4; Thu, 9 Sep 2021 10:47:15 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4wgR4fGYz4VpM; Thu, 9 Sep 2021 10:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB0018179; Thu, 9 Sep 2021 10:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189AlFr8035289; Thu, 9 Sep 2021 10:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189AlFRm035288; Thu, 9 Sep 2021 10:47:15 GMT (envelope-from git) Date: Thu, 9 Sep 2021 10:47:15 GMT Message-Id: <202109091047.189AlFRm035288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 395db99f32bc - main - Export _mmap and __sys_mmap from libc.so MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 395db99f32bc615a3df2cd469e9537938d022c88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 10:47:15 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=395db99f32bc615a3df2cd469e9537938d022c88 commit 395db99f32bc615a3df2cd469e9537938d022c88 Author: Alex Richardson AuthorDate: 2021-09-09 10:46:53 +0000 Commit: Alex Richardson CommitDate: 2021-09-09 10:46:53 +0000 Export _mmap and __sys_mmap from libc.so Unlike the other syscalls these two symbols were missing from the version script. I noticed this while looking into the compiler-rt runtime libraries for CHERI. Reviewed by: brooks Obtained from: https://github.com/CTSRD-CHERI/cheribsd/pull/1063 MFC after: 3 days --- lib/libc/sys/Symbol.map | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index eb379874c247..a70d14b51f7c 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -765,6 +765,8 @@ FBSDprivate_1.0 { __sys_mlock; _mlockall; __sys_mlockall; + _mmap; + __sys_mmap; _modfind; __sys_modfind; _modfnext; From owner-dev-commits-src-main@freebsd.org Thu Sep 9 11:24:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6366766E6CC; Thu, 9 Sep 2021 11:24:12 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4xV42Rnkz4gkr; Thu, 9 Sep 2021 11:24:12 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from marvin.madpilot.net (host-79-53-52-60.retail.telecomitalia.it [79.53.52.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2765024B3E; Thu, 9 Sep 2021 11:24:11 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109080107.18817pdj030849@gitrepo.freebsd.org> From: Guido Falsi Message-ID: <8309c83d-9dc2-d0bc-3985-b5d7a5c853f1@FreeBSD.org> Date: Thu, 9 Sep 2021 13:24:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202109080107.18817pdj030849@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 11:24:12 -0000 On 08/09/21 03:07, Ed Maste wrote: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 > > commit 19261079b74319502c6ffa1249920079f0f69a72 > Merge: c5128c48df3c 66719ee573ac > Author: Ed Maste > AuthorDate: 2021-09-08 01:05:51 +0000 > Commit: Ed Maste > CommitDate: 2021-09-08 01:05:51 +0000 > > openssh: update to OpenSSH v8.7p1 > > Some notable changes, from upstream's release notes: > > - sshd(8): Remove support for obsolete "host/port" syntax. > - ssh(1): When prompting whether to record a new host key, accept the key > fingerprint as a synonym for "yes". > - ssh-keygen(1): when acting as a CA and signing certificates with an RSA > key, default to using the rsa-sha2-512 signature algorithm. > - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" > (RSA/SHA1) algorithm from those accepted for certificate signatures. > - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F > support to provide address-space isolation for token middleware > libraries (including the internal one). > - ssh(1): this release enables UpdateHostkeys by default subject to some > conservative preconditions. > - scp(1): this release changes the behaviour of remote to remote copies > (e.g. "scp host-a:/path host-b:") to transfer through the local host > by default. > - scp(1): experimental support for transfers using the SFTP protocol as > a replacement for the venerable SCP/RCP protocol that it has > traditionally used. > > Additional integration work is needed to support FIDO/U2F in the base > system. > > Deprecation Notice > ------------------ > > OpenSSH will disable the ssh-rsa signature scheme by default in the > next release. > > Reviewed by: imp > MFC after: 1 month > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D29985 > While upgrading my current machines I encountered an issue with pam_ssh which seems to be caused by this update. I filed a bug report with all the details: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258384 Could you take a look? Seems to be caused by the ssh code trying to call a function available only when FIDO/U2F support is enabled, which is not the case in our source base. I tried a quick fix by adding some ifdefs, but it failed to make it work, I'm still trying to find a solution myself. -- Guido Falsi From owner-dev-commits-src-main@freebsd.org Thu Sep 9 12:47:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E99CC670218; Thu, 9 Sep 2021 12:47:06 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4zKk6GlVz3J77; Thu, 9 Sep 2021 12:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B718D199F8; Thu, 9 Sep 2021 12:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189Cl65b096767; Thu, 9 Sep 2021 12:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189Cl6Uw096766; Thu, 9 Sep 2021 12:47:06 GMT (envelope-from git) Date: Thu, 9 Sep 2021 12:47:06 GMT Message-Id: <202109091247.189Cl6Uw096766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4250aa1188b5 - main - sctp: Clear assoc socket references when freeing a PCB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4250aa1188b5622a6cef871003abd4a50067bdae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 12:47:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4250aa1188b5622a6cef871003abd4a50067bdae commit 4250aa1188b5622a6cef871003abd4a50067bdae Author: Mark Johnston AuthorDate: 2021-09-09 12:33:26 +0000 Commit: Mark Johnston CommitDate: 2021-09-09 12:33:26 +0000 sctp: Clear assoc socket references when freeing a PCB This restores behaviour present in the first import of SCTP. Commit ceaad40ae729dea2c5d8ffcfdd45bb96fb8969d2 commented this out and commit 62fb761ff28bb184a2543e539dd689fefd5d3246 removed it. However, once sctp_inpcb_free() returns, the socket reference is gone no matter what, so we need to clear it. Reported by: syzbot+30dd69297fcbc5f0e10a@syzkaller.appspotmail.com Reported by: syzbot+7b2f9d4bcac1c9569291@syzkaller.appspotmail.com Reported by: syzbot+ed3e651f7d040af480a6@syzkaller.appspotmail.com Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31886 --- sys/netinet/sctp_pcb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 82b7157c7ad7..e571f80e472a 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3358,6 +3358,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) LIST_FOREACH_SAFE(asoc, &inp->sctp_asoc_list, sctp_tcblist, nasoc) { SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + asoc->sctp_socket = NULL; /* Skip guys being freed */ cnt_in_sd++; if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { From owner-dev-commits-src-main@freebsd.org Thu Sep 9 14:00:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA6C670AFC; Thu, 9 Sep 2021 14:00:09 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H50y15wcrz3wF2; Thu, 9 Sep 2021 14:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB61A1AAA6; Thu, 9 Sep 2021 14:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189E09pb094788; Thu, 9 Sep 2021 14:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189E09ja094785; Thu, 9 Sep 2021 14:00:09 GMT (envelope-from git) Date: Thu, 9 Sep 2021 14:00:09 GMT Message-Id: <202109091400.189E09ja094785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b645ee1815da - main - openssh: remove update notes about upstreamed changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b645ee1815daf96ee9512633b55c423bc897b244 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 14:00:09 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b645ee1815daf96ee9512633b55c423bc897b244 commit b645ee1815daf96ee9512633b55c423bc897b244 Author: Ed Maste AuthorDate: 2021-09-09 13:57:22 +0000 Commit: Ed Maste CommitDate: 2021-09-09 13:57:22 +0000 openssh: remove update notes about upstreamed changes Two local changes were committed upstream and are present in OpenSSH 8.7p1. Remove references from FREEBSD-upgrade now that we have updated to that version. --- crypto/openssh/FREEBSD-upgrade | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index f064583af495..02c953ddd765 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -110,14 +110,6 @@ An overview of FreeBSD changes to OpenSSH-portable ================================================== -* don't free string returned by login_getcapstr(3) - - Committed upstream as f060c2bc85d59d111fa18a12eb3872ee4b9f7e97 - -* Use login_getpwclass() instead of login_getclass() - - Committed upstream as 3d05e5881ceb2e48e1948ba14292216b56ed792e - 0) VersionAddendum The SSH protocol allows for a human-readable version string of up From owner-dev-commits-src-main@freebsd.org Thu Sep 9 14:14:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14F0C671066; Thu, 9 Sep 2021 14:14:42 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H51Gn3mpvz4X9X; Thu, 9 Sep 2021 14:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 621721AF18; Thu, 9 Sep 2021 14:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189EEfcB017966; Thu, 9 Sep 2021 14:14:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189EEfFc017965; Thu, 9 Sep 2021 14:14:41 GMT (envelope-from git) Date: Thu, 9 Sep 2021 14:14:41 GMT Message-Id: <202109091414.189EEfFc017965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 187afc58791c - main - osd: Fix racy assertions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 187afc58791cd877c8ba0573b7826c31db8c6f73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 14:14:42 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=187afc58791cd877c8ba0573b7826c31db8c6f73 commit 187afc58791cd877c8ba0573b7826c31db8c6f73 Author: Mark Johnston AuthorDate: 2021-09-09 13:50:27 +0000 Commit: Mark Johnston CommitDate: 2021-09-09 14:11:02 +0000 osd: Fix racy assertions osd_register(9) may reallocate and expand the destructor array for a given object type if no space is available for a new key. This happens with the object lock held. Thus, when verifying that a given slot in the array is occupied, we need to hold the object lock to avoid racing with a reallocation. Reported by: syzbot+69ce54c7d7d813315dd3@syzkaller.appspotmail.com MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_osd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index e15ffde5d7bc..9e318b27c250 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -156,10 +156,11 @@ osd_deregister(u_int type, u_int slot) KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); sx_xlock(&osdm[type].osd_module_lock); rm_wlock(&osdm[type].osd_object_lock); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + /* * Free all OSD for the given slot. */ @@ -222,9 +223,10 @@ osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); rm_rlock(&osdm[type].osd_object_lock, &tracker); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + if (slot > osd->osd_nslots) { void **newptr; @@ -300,9 +302,10 @@ osd_get(u_int type, struct osd *osd, u_int slot) KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); rm_rlock(&osdm[type].osd_object_lock, &tracker); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + if (slot > osd->osd_nslots) { value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); From owner-dev-commits-src-main@freebsd.org Thu Sep 9 14:33:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BBA567125A; Thu, 9 Sep 2021 14:33:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H51j0118Fz4f94; Thu, 9 Sep 2021 14:33:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id EFC5826868; Thu, 9 Sep 2021 14:33:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f46.google.com with SMTP id 93so1247897qva.7; Thu, 09 Sep 2021 07:33:55 -0700 (PDT) X-Gm-Message-State: AOAM530Zvm8A82wr/UJ0T92gD7KAx7+wzMA80Jeu7NeJJNG9IA2YKiuw PPGZwjvtxGCoS+VV1kyHmUrF/WM4LkSMNNaIc4U= X-Google-Smtp-Source: ABdhPJzDHQICl5LtBCFYsnt9EykL4liC0hBnrLzywE3rniFRHpiU5TwPntRvTTK0BhYzw7AAIpl2MGbrCb2NE5IR+yE= X-Received: by 2002:a05:6214:f68:: with SMTP id iy8mr3061822qvb.51.1631198035441; Thu, 09 Sep 2021 07:33:55 -0700 (PDT) MIME-Version: 1.0 References: <202109080107.18817pdj030849@gitrepo.freebsd.org> <8309c83d-9dc2-d0bc-3985-b5d7a5c853f1@FreeBSD.org> In-Reply-To: <8309c83d-9dc2-d0bc-3985-b5d7a5c853f1@FreeBSD.org> From: Kyle Evans Date: Thu, 9 Sep 2021 09:33:44 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 To: Guido Falsi Cc: Ed Maste , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 14:33:56 -0000 On Thu, Sep 9, 2021 at 6:24 AM Guido Falsi wrote: > > On 08/09/21 03:07, Ed Maste wrote: > > The branch main has been updated by emaste: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 > > > > commit 19261079b74319502c6ffa1249920079f0f69a72 > > Merge: c5128c48df3c 66719ee573ac > > Author: Ed Maste > > AuthorDate: 2021-09-08 01:05:51 +0000 > > Commit: Ed Maste > > CommitDate: 2021-09-08 01:05:51 +0000 > > > > openssh: update to OpenSSH v8.7p1 > > > > Some notable changes, from upstream's release notes: > > > > - sshd(8): Remove support for obsolete "host/port" syntax. > > - ssh(1): When prompting whether to record a new host key, accept the key > > fingerprint as a synonym for "yes". > > - ssh-keygen(1): when acting as a CA and signing certificates with an RSA > > key, default to using the rsa-sha2-512 signature algorithm. > > - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" > > (RSA/SHA1) algorithm from those accepted for certificate signatures. > > - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F > > support to provide address-space isolation for token middleware > > libraries (including the internal one). > > - ssh(1): this release enables UpdateHostkeys by default subject to some > > conservative preconditions. > > - scp(1): this release changes the behaviour of remote to remote copies > > (e.g. "scp host-a:/path host-b:") to transfer through the local host > > by default. > > - scp(1): experimental support for transfers using the SFTP protocol as > > a replacement for the venerable SCP/RCP protocol that it has > > traditionally used. > > > > Additional integration work is needed to support FIDO/U2F in the base > > system. > > > > Deprecation Notice > > ------------------ > > > > OpenSSH will disable the ssh-rsa signature scheme by default in the > > next release. > > > > Reviewed by: imp > > MFC after: 1 month > > Relnotes: Yes > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D29985 > > > > While upgrading my current machines I encountered an issue with pam_ssh > which seems to be caused by this update. > > I filed a bug report with all the details: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258384 > > Could you take a look? > > Seems to be caused by the ssh code trying to call a function available > only when FIDO/U2F support is enabled, which is not the case in our > source base. > > I tried a quick fix by adding some ifdefs, but it failed to make it > work, I'm still trying to find a solution myself. > Looks like the reference in openssh/sshkey.c... probably the correct thing to do is add ssh-sk.c to the secure/lib/libssh build; it still requires additional integration for FIDO/U2F, though. From owner-dev-commits-src-main@freebsd.org Thu Sep 9 14:51:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FE456715FC; Thu, 9 Sep 2021 14:51:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H525P2vx7z4kbJ; Thu, 9 Sep 2021 14:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4572F1B7C2; Thu, 9 Sep 2021 14:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189EpbIC069817; Thu, 9 Sep 2021 14:51:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189Epbbu069816; Thu, 9 Sep 2021 14:51:37 GMT (envelope-from git) Date: Thu, 9 Sep 2021 14:51:37 GMT Message-Id: <202109091451.189Epbbu069816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 635eb7ac7990 - main - fetch: do not confuse capacity and length MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 635eb7ac7990a2bb29e1992b739617a9db012bf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 14:51:37 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=635eb7ac7990a2bb29e1992b739617a9db012bf2 commit 635eb7ac7990a2bb29e1992b739617a9db012bf2 Author: Baptiste Daroussin AuthorDate: 2021-09-09 14:48:21 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-09 14:51:26 +0000 fetch: do not confuse capacity and length The patch converting fetch to getline (ee3ca711a898cf41330c320826ea1e0e6e451f1d), did confuse the capacity of the line buffer with the actual len of the read line confusing fetch -v. --- lib/libfetch/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 61f0f393ed98..bcb089dc0fc4 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1526,12 +1526,13 @@ http_get_proxy(struct url * url, const char *flags) static void http_print_html(FILE *out, FILE *in) { - size_t len = 0; + ssize_t len = 0; + size_t cap; char *line = NULL, *p, *q; int comment, tag; comment = tag = 0; - while (getline(&line, &len, in) >= 0) { + while ((len = getline(&line, &cap, in)) >= 0) { while (len && isspace((unsigned char)line[len - 1])) --len; for (p = q = line; q < line + len; ++q) { From owner-dev-commits-src-main@freebsd.org Thu Sep 9 15:41:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36CCD6726A2; Thu, 9 Sep 2021 15:41:37 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H53C46hZ1z3KkY; Thu, 9 Sep 2021 15:41:36 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from marvin.madpilot.net (host-79-53-52-60.retail.telecomitalia.it [79.53.52.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2E5A52762A; Thu, 9 Sep 2021 15:41:36 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 To: Kyle Evans Cc: Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202109080107.18817pdj030849@gitrepo.freebsd.org> <8309c83d-9dc2-d0bc-3985-b5d7a5c853f1@FreeBSD.org> From: Guido Falsi Message-ID: <3ded4f48-38d7-1caf-5fb3-8fc101e1519c@FreeBSD.org> Date: Thu, 9 Sep 2021 17:41:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 15:41:37 -0000 On 09/09/21 16:33, Kyle Evans wrote: > On Thu, Sep 9, 2021 at 6:24 AM Guido Falsi wrote: >> >> On 08/09/21 03:07, Ed Maste wrote: >>> The branch main has been updated by emaste: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 >>> >>> commit 19261079b74319502c6ffa1249920079f0f69a72 >>> Merge: c5128c48df3c 66719ee573ac >>> Author: Ed Maste >>> AuthorDate: 2021-09-08 01:05:51 +0000 >>> Commit: Ed Maste >>> CommitDate: 2021-09-08 01:05:51 +0000 >>> >>> openssh: update to OpenSSH v8.7p1 >>> >>> Some notable changes, from upstream's release notes: >>> >>> - sshd(8): Remove support for obsolete "host/port" syntax. >>> - ssh(1): When prompting whether to record a new host key, accept the key >>> fingerprint as a synonym for "yes". >>> - ssh-keygen(1): when acting as a CA and signing certificates with an RSA >>> key, default to using the rsa-sha2-512 signature algorithm. >>> - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" >>> (RSA/SHA1) algorithm from those accepted for certificate signatures. >>> - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F >>> support to provide address-space isolation for token middleware >>> libraries (including the internal one). >>> - ssh(1): this release enables UpdateHostkeys by default subject to some >>> conservative preconditions. >>> - scp(1): this release changes the behaviour of remote to remote copies >>> (e.g. "scp host-a:/path host-b:") to transfer through the local host >>> by default. >>> - scp(1): experimental support for transfers using the SFTP protocol as >>> a replacement for the venerable SCP/RCP protocol that it has >>> traditionally used. >>> >>> Additional integration work is needed to support FIDO/U2F in the base >>> system. >>> >>> Deprecation Notice >>> ------------------ >>> >>> OpenSSH will disable the ssh-rsa signature scheme by default in the >>> next release. >>> >>> Reviewed by: imp >>> MFC after: 1 month >>> Relnotes: Yes >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews.freebsd.org/D29985 >>> >> >> While upgrading my current machines I encountered an issue with pam_ssh >> which seems to be caused by this update. >> >> I filed a bug report with all the details: >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258384 >> >> Could you take a look? >> >> Seems to be caused by the ssh code trying to call a function available >> only when FIDO/U2F support is enabled, which is not the case in our >> source base. >> >> I tried a quick fix by adding some ifdefs, but it failed to make it >> work, I'm still trying to find a solution myself. >> > > Looks like the reference in openssh/sshkey.c... probably the correct > thing to do is add ssh-sk.c to the secure/lib/libssh build; it still > requires additional integration for FIDO/U2F, though. > You suggestion is correct, but adding only ssh-sk.c solved the error, but unmassked more missing symbols, I ended up adding "ssh-sk.c ssh-ecdsa-sk.c ssh-ed25519-sk.c". Now things are back to normal for me. I attached a patch to the bug report [1], I don't have any U2F/FIDO hardware so I can't test that and, egoistically, don't need it, but this patch at least fixes the regression, so I think it should be committed to head. I can send the patch as a review if required. Thanks for your suggestion Kyle! [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258384 -- Guido Falsi From owner-dev-commits-src-main@freebsd.org Thu Sep 9 16:04:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D59F1672969; Thu, 9 Sep 2021 16:04:05 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H53j15LGbz3hPv; Thu, 9 Sep 2021 16:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 985DB1C7FE; Thu, 9 Sep 2021 16:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189G453p064955; Thu, 9 Sep 2021 16:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189G45Km064954; Thu, 9 Sep 2021 16:04:05 GMT (envelope-from git) Date: Thu, 9 Sep 2021 16:04:05 GMT Message-Id: <202109091604.189G45Km064954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0c1a20beb456 - main - sctp: use appropriate argument when freeing association MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c1a20beb4560eaae69202bc49026ab9e2a677a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 16:04:05 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0c1a20beb4560eaae69202bc49026ab9e2a677a4 commit 0c1a20beb4560eaae69202bc49026ab9e2a677a4 Author: Michael Tuexen AuthorDate: 2021-09-09 16:01:35 +0000 Commit: Michael Tuexen CommitDate: 2021-09-09 16:01:35 +0000 sctp: use appropriate argument when freeing association Reported by: syzbot+7fe26e26911344e7211d@syzkaller.appspotmail.com MFC after: 3 days --- sys/netinet/sctp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 24c6879e1925..6ae35ae2deba 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12757,7 +12757,7 @@ sctp_lower_sosend(struct socket *so, if (control) { if (sctp_process_cmsgs_for_init(stcb, control, &error)) { - sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, + sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_6); hold_tcblock = 0; stcb = NULL; From owner-dev-commits-src-main@freebsd.org Thu Sep 9 17:27:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 897AE673956; Thu, 9 Sep 2021 17:27:18 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp4-2.goneo.de (smtp4-2.goneo.de [85.220.129.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H55Y13nBBz4h6W; Thu, 9 Sep 2021 17:27:17 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from thor.intern.walstatt.dynvpn.de (dynamic-078-054-046-104.78.54.pool.telefonica.de [78.54.46.104]) by smtp4.goneo.de (Postfix) with ESMTPSA id 6F57D2040D93; Thu, 9 Sep 2021 19:27:10 +0200 (CEST) Date: Thu, 9 Sep 2021 19:26:42 +0200 From: FreeBSD User To: Ed Maste Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 Message-ID: <20210909192709.173d0bb6@thor.intern.walstatt.dynvpn.de> In-Reply-To: <202109080107.18817pdj030849@gitrepo.freebsd.org> References: <202109080107.18817pdj030849@gitrepo.freebsd.org> Organization: walstatt-de.de MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H55Y13nBBz4h6W X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@walstatt-de.de has no SPF policy when checking 85.220.129.61) smtp.mailfrom=freebsd@walstatt-de.de X-Spamd-Result: default: False [-0.15 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[walstatt-de.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.95)[0.954]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25394, ipnet:85.220.128.0/17, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RWL_MAILSPIKE_POSSIBLE(0.00)[85.220.129.61:from] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 17:27:18 -0000 Am Wed, 8 Sep 2021 01:07:51 GMT Ed Maste schrieb: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 > > commit 19261079b74319502c6ffa1249920079f0f69a72 > Merge: c5128c48df3c 66719ee573ac > Author: Ed Maste > AuthorDate: 2021-09-08 01:05:51 +0000 > Commit: Ed Maste > CommitDate: 2021-09-08 01:05:51 +0000 > > openssh: update to OpenSSH v8.7p1 > > Some notable changes, from upstream's release notes: > > - sshd(8): Remove support for obsolete "host/port" syntax. > - ssh(1): When prompting whether to record a new host key, accept the key > fingerprint as a synonym for "yes". > - ssh-keygen(1): when acting as a CA and signing certificates with an RSA > key, default to using the rsa-sha2-512 signature algorithm. > - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" > (RSA/SHA1) algorithm from those accepted for certificate signatures. > - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F > support to provide address-space isolation for token middleware > libraries (including the internal one). > - ssh(1): this release enables UpdateHostkeys by default subject to some > conservative preconditions. > - scp(1): this release changes the behaviour of remote to remote copies > (e.g. "scp host-a:/path host-b:") to transfer through the local host > by default. > - scp(1): experimental support for transfers using the SFTP protocol as > a replacement for the venerable SCP/RCP protocol that it has > traditionally used. > > Additional integration work is needed to support FIDO/U2F in the base > system. > > Deprecation Notice > ------------------ > > OpenSSH will disable the ssh-rsa signature scheme by default in the > next release. > > Reviewed by: imp > MFC after: 1 month > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D29985 > > crypto/openssh/.depend | 354 +- > crypto/openssh/.github/ci-status.md | 4 + > crypto/openssh/.github/configs | 170 + > crypto/openssh/.github/configure.sh | 6 + > crypto/openssh/.github/run_test.sh | 34 + > crypto/openssh/.github/setup_ci.sh | 115 + > crypto/openssh/.github/workflows/c-cpp.yml | 76 + > crypto/openssh/.github/workflows/selfhosted.yml | 93 + > crypto/openssh/.github/workflows/upstream.yml | 43 + > crypto/openssh/.gitignore | 8 + > crypto/openssh/.skipped-commit-ids | 18 + > crypto/openssh/CREDITS | 2 +- > crypto/openssh/ChangeLog | 16777 ++++++++++++------- > crypto/openssh/FREEBSD-vendor | 4 +- > crypto/openssh/INSTALL | 79 +- > crypto/openssh/LICENCE | 64 +- > crypto/openssh/Makefile.in | 328 +- > crypto/openssh/OVERVIEW | 7 +- > crypto/openssh/PROTOCOL | 89 +- > crypto/openssh/PROTOCOL.agent | 6 +- > crypto/openssh/PROTOCOL.certkeys | 35 +- > crypto/openssh/PROTOCOL.chacha20poly1305 | 4 +- > crypto/openssh/PROTOCOL.key | 9 +- > crypto/openssh/PROTOCOL.mux | 4 +- > crypto/openssh/PROTOCOL.sshsig | 100 + > crypto/openssh/PROTOCOL.u2f | 309 + > crypto/openssh/README | 36 +- > crypto/openssh/README.dns | 8 +- > crypto/openssh/README.md | 84 + > crypto/openssh/README.platform | 16 +- > crypto/openssh/README.privsep | 11 +- > crypto/openssh/aclocal.m4 | 193 +- > crypto/openssh/addr.c | 423 + > crypto/openssh/addr.h | 60 + > crypto/openssh/addrmatch.c | 351 +- > crypto/openssh/atomicio.c | 32 +- > crypto/openssh/atomicio.h | 4 +- > crypto/openssh/audit-bsm.c | 41 +- > crypto/openssh/audit-linux.c | 4 +- > crypto/openssh/audit.c | 2 +- > crypto/openssh/audit.h | 4 +- > crypto/openssh/auth-bsdauth.c | 2 - > crypto/openssh/auth-krb5.c | 19 +- > crypto/openssh/auth-options.c | 194 +- > crypto/openssh/auth-options.h | 13 +- > crypto/openssh/auth-pam.c | 119 +- > crypto/openssh/auth-pam.h | 2 +- > crypto/openssh/auth-passwd.c | 6 +- > crypto/openssh/auth-rhosts.c | 19 +- > crypto/openssh/auth-skey.c | 107 - > crypto/openssh/auth.c | 303 +- > crypto/openssh/auth.h | 36 +- > crypto/openssh/auth2-chall.c | 43 +- > crypto/openssh/auth2-gss.c | 29 +- > crypto/openssh/auth2-hostbased.c | 71 +- > crypto/openssh/auth2-kbdint.c | 8 +- > crypto/openssh/auth2-none.c | 4 +- > crypto/openssh/auth2-passwd.c | 9 +- > crypto/openssh/auth2-pubkey.c | 264 +- > crypto/openssh/auth2.c | 209 +- > crypto/openssh/authfd.c | 178 +- > crypto/openssh/authfd.h | 12 +- > crypto/openssh/authfile.c | 265 +- > crypto/openssh/authfile.h | 10 +- > crypto/openssh/blacklist.c | 6 +- > crypto/openssh/buildpkg.sh.in | 8 +- > crypto/openssh/canohost.c | 12 +- > crypto/openssh/chacha.h | 4 +- > crypto/openssh/channels.c | 761 +- > crypto/openssh/channels.h | 38 +- > crypto/openssh/cipher-chachapoly-libcrypto.c | 166 + > crypto/openssh/cipher-chachapoly.c | 32 +- > crypto/openssh/cipher-chachapoly.h | 13 +- > crypto/openssh/cipher.c | 48 +- > crypto/openssh/cipher.h | 5 +- > crypto/openssh/clientloop.c | 1074 +- > crypto/openssh/clientloop.h | 5 +- > crypto/openssh/compat.c | 92 +- > crypto/openssh/compat.h | 20 +- > crypto/openssh/config.guess | 882 +- > crypto/openssh/config.h | 241 +- > crypto/openssh/config.sub | 2528 ++- > crypto/openssh/configure.ac | 970 +- > crypto/openssh/contrib/Makefile | 6 +- > crypto/openssh/contrib/cygwin/README | 4 +- > crypto/openssh/contrib/cygwin/ssh-host-config | 59 +- > crypto/openssh/contrib/findssl.sh | 0 > crypto/openssh/contrib/gnome-ssh-askpass1.c | 7 +- > crypto/openssh/contrib/gnome-ssh-askpass2.c | 210 +- > crypto/openssh/contrib/gnome-ssh-askpass3.c | 305 + > crypto/openssh/contrib/redhat/gnome-ssh-askpass.sh | 0 > crypto/openssh/contrib/redhat/openssh.spec | 55 +- > crypto/openssh/contrib/solaris/README | 0 > crypto/openssh/contrib/ssh-copy-id | 303 +- > crypto/openssh/contrib/ssh-copy-id.1 | 11 +- > crypto/openssh/contrib/suse/openssh.spec | 6 +- > crypto/openssh/crc32.c | 105 - > crypto/openssh/crc32.h | 30 - > crypto/openssh/crypto_api.h | 20 +- > crypto/openssh/defines.h | 54 +- > crypto/openssh/dh.c | 39 +- > crypto/openssh/dh.h | 10 +- > crypto/openssh/digest-libc.c | 33 +- > crypto/openssh/digest-openssl.c | 19 +- > crypto/openssh/dispatch.c | 6 +- > crypto/openssh/dispatch.h | 9 +- > crypto/openssh/dns.c | 72 +- > crypto/openssh/dns.h | 3 +- > crypto/openssh/entropy.c | 175 +- > crypto/openssh/fatal.c | 7 +- > crypto/openssh/groupaccess.c | 5 +- > crypto/openssh/gss-genr.c | 19 +- > crypto/openssh/gss-serv.c | 4 +- > crypto/openssh/hash.c | 36 +- > crypto/openssh/hmac.c | 7 +- > crypto/openssh/hostfile.c | 269 +- > crypto/openssh/hostfile.h | 27 +- > crypto/openssh/int32_minmax.inc | 0 > crypto/openssh/kex.c | 490 +- > crypto/openssh/kex.h | 92 +- > crypto/openssh/kexc25519.c | 182 +- > crypto/openssh/kexc25519c.c | 169 - > crypto/openssh/kexc25519s.c | 158 - > crypto/openssh/kexdh.c | 205 +- > crypto/openssh/kexdhc.c | 224 - > crypto/openssh/kexdhs.c | 222 - > crypto/openssh/kexecdh.c | 239 +- > crypto/openssh/kexecdhc.c | 222 - > crypto/openssh/kexecdhs.c | 203 - > crypto/openssh/kexgen.c | 346 + > crypto/openssh/kexgex.c | 30 +- > crypto/openssh/kexgexc.c | 123 +- > crypto/openssh/kexgexs.c | 119 +- > crypto/openssh/kexsntrup761x25519.c | 251 + > crypto/openssh/krl.c | 223 +- > crypto/openssh/krl.h | 5 +- > crypto/openssh/log.c | 219 +- > crypto/openssh/log.h | 93 +- > crypto/openssh/loginrec.c | 13 +- > crypto/openssh/loginrec.h | 7 +- > crypto/openssh/logintest.c | 60 +- > crypto/openssh/m4/openssh.m4 | 200 + > crypto/openssh/mac.c | 7 +- > crypto/openssh/match.c | 34 +- > crypto/openssh/match.h | 7 +- > crypto/openssh/misc.c | 962 +- > crypto/openssh/misc.h | 75 +- > crypto/openssh/moduli | 876 +- > crypto/openssh/moduli.c | 29 +- > crypto/openssh/monitor.c | 708 +- > crypto/openssh/monitor.h | 13 +- > crypto/openssh/monitor_fdpass.c | 24 +- > crypto/openssh/monitor_wrap.c | 305 +- > crypto/openssh/monitor_wrap.h | 26 +- > crypto/openssh/msg.c | 18 +- > crypto/openssh/mux.c | 640 +- > crypto/openssh/myproposal.h | 144 +- > crypto/openssh/nchan.c | 77 +- > crypto/openssh/opacket.c | 320 - > crypto/openssh/opacket.h | 154 - > crypto/openssh/openbsd-compat/Makefile.in | 11 +- > crypto/openssh/openbsd-compat/arc4random.c | 12 +- > crypto/openssh/openbsd-compat/base64.c | 2 +- > crypto/openssh/openbsd-compat/bcrypt_pbkdf.c | 4 +- > crypto/openssh/openbsd-compat/bsd-closefrom.c | 88 +- > crypto/openssh/openbsd-compat/bsd-cygwin_util.c | 149 + > crypto/openssh/openbsd-compat/bsd-cygwin_util.h | 1 + > crypto/openssh/openbsd-compat/bsd-misc.c | 113 + > crypto/openssh/openbsd-compat/bsd-misc.h | 41 +- > crypto/openssh/openbsd-compat/bsd-openpty.c | 17 +- > crypto/openssh/openbsd-compat/bsd-poll.h | 2 +- > crypto/openssh/openbsd-compat/bsd-pselect.c | 205 + > crypto/openssh/openbsd-compat/bsd-setres_id.c | 12 +- > crypto/openssh/openbsd-compat/bsd-signal.c | 29 +- > crypto/openssh/openbsd-compat/bsd-signal.h | 7 +- > crypto/openssh/openbsd-compat/bsd-snprintf.c | 18 +- > crypto/openssh/openbsd-compat/bsd-statvfs.c | 10 +- > crypto/openssh/openbsd-compat/bsd-waitpid.h | 2 +- > crypto/openssh/openbsd-compat/explicit_bzero.c | 10 +- > crypto/openssh/openbsd-compat/fnmatch.c | 495 + > crypto/openssh/openbsd-compat/fnmatch.h | 66 + > crypto/openssh/openbsd-compat/getopt_long.c | 2 +- > crypto/openssh/openbsd-compat/glob.c | 157 +- > crypto/openssh/openbsd-compat/glob.h | 9 +- > .../openssh/openbsd-compat/libressl-api-compat.c | 6 +- > crypto/openssh/openbsd-compat/memmem.c | 196 + > crypto/openssh/openbsd-compat/mktemp.c | 4 +- > crypto/openssh/openbsd-compat/openbsd-compat.h | 42 +- > crypto/openssh/openbsd-compat/openssl-compat.c | 22 +- > crypto/openssh/openbsd-compat/openssl-compat.h | 59 +- > crypto/openssh/openbsd-compat/port-aix.c | 25 +- > crypto/openssh/openbsd-compat/port-aix.h | 7 +- > crypto/openssh/openbsd-compat/port-irix.c | 2 + > crypto/openssh/openbsd-compat/port-linux.c | 25 +- > crypto/openssh/openbsd-compat/port-net.c | 18 +- > crypto/openssh/openbsd-compat/port-prngd.c | 164 + > crypto/openssh/openbsd-compat/port-solaris.c | 14 +- > crypto/openssh/openbsd-compat/port-uw.c | 2 +- > crypto/openssh/openbsd-compat/pwcache.c | 4 +- > crypto/openssh/openbsd-compat/regress/Makefile.in | 4 +- > .../openssh/openbsd-compat/regress/closefromtest.c | 4 +- > .../openbsd-compat/regress/opensslvertest.c | 2 + > .../openssh/openbsd-compat/regress/snprintftest.c | 5 +- > crypto/openssh/openbsd-compat/regress/strduptest.c | 2 + > .../openssh/openbsd-compat/regress/strtonumtest.c | 2 + > .../openssh/openbsd-compat/regress/utimensattest.c | 120 + > crypto/openssh/openbsd-compat/rmd160.c | 378 - > crypto/openssh/openbsd-compat/rmd160.h | 61 - > crypto/openssh/openbsd-compat/setenv.c | 2 + > crypto/openssh/openbsd-compat/setproctitle.c | 1 + > crypto/openssh/openbsd-compat/sha1.c | 13 +- > crypto/openssh/openbsd-compat/sha2.c | 336 +- > crypto/openssh/openbsd-compat/sha2.h | 138 +- > crypto/openssh/openbsd-compat/strtonum.c | 6 +- > crypto/openssh/openbsd-compat/sys-queue.h | 376 +- > crypto/openssh/packet.c | 264 +- > crypto/openssh/packet.h | 14 +- > crypto/openssh/pathnames.h | 9 +- > crypto/openssh/platform.c | 1 + > crypto/openssh/progressmeter.c | 60 +- > crypto/openssh/progressmeter.h | 3 +- > crypto/openssh/readconf.c | 1338 +- > crypto/openssh/readconf.h | 37 +- > crypto/openssh/readpass.c | 191 +- > crypto/openssh/regress/Makefile | 75 +- > crypto/openssh/regress/README.regress | 80 +- > crypto/openssh/regress/addrmatch.sh | 16 +- > crypto/openssh/regress/agent-getpeereid.sh | 6 +- > crypto/openssh/regress/agent-pkcs11.sh | 99 +- > crypto/openssh/regress/agent-ptrace.sh | 2 +- > crypto/openssh/regress/agent-subprocess.sh | 22 + > crypto/openssh/regress/agent-timeout.sh | 12 +- > crypto/openssh/regress/agent.sh | 124 +- > crypto/openssh/regress/allow-deny-users.sh | 8 +- > crypto/openssh/regress/banner.sh | 6 +- > crypto/openssh/regress/cert-file.sh | 4 +- > crypto/openssh/regress/cert-hostkey.sh | 36 +- > crypto/openssh/regress/cert-userkey.sh | 53 +- > crypto/openssh/regress/cfginclude.sh | 24 +- > crypto/openssh/regress/cfgmatch.sh | 55 +- > crypto/openssh/regress/cfgparse.sh | 0 > crypto/openssh/regress/conch-ciphers.sh | 4 +- > crypto/openssh/regress/connect-privsep.sh | 5 +- > crypto/openssh/regress/connect.sh | 11 +- > crypto/openssh/regress/dhgex.sh | 14 +- > crypto/openssh/regress/ed25519_openssh.prv | 7 + > crypto/openssh/regress/ed25519_openssh.pub | 1 + > crypto/openssh/regress/forward-control.sh | 6 +- > crypto/openssh/regress/forwarding.sh | 44 +- > crypto/openssh/regress/host-expand.sh | 0 > crypto/openssh/regress/hostkey-agent.sh | 10 +- > crypto/openssh/regress/hostkey-rotate.sh | 80 +- > crypto/openssh/regress/integrity.sh | 8 +- > crypto/openssh/regress/kextype.sh | 0 > crypto/openssh/regress/key-options.sh | 10 +- > crypto/openssh/regress/keygen-change.sh | 7 +- > crypto/openssh/regress/keygen-comment.sh | 52 + > crypto/openssh/regress/keygen-convert.sh | 54 +- > crypto/openssh/regress/keygen-knownhosts.sh | 0 > crypto/openssh/regress/keygen-moduli.sh | 17 +- > crypto/openssh/regress/keygen-sshfp.sh | 29 + > crypto/openssh/regress/keys-command.sh | 11 +- > crypto/openssh/regress/keyscan.sh | 17 +- > crypto/openssh/regress/keytype.sh | 57 +- > crypto/openssh/regress/knownhosts-command.sh | 53 + > crypto/openssh/regress/krl.sh | 41 +- > crypto/openssh/regress/limit-keytype.sh | 69 +- > crypto/openssh/regress/localcommand.sh | 0 > crypto/openssh/regress/misc/Makefile | 2 +- > crypto/openssh/regress/misc/fuzz-harness/Makefile | 51 +- > .../regress/misc/fuzz-harness/agent_fuzz.cc | 15 + > .../regress/misc/fuzz-harness/agent_fuzz_helper.c | 177 + > .../openssh/regress/misc/fuzz-harness/fixed-keys.h | 119 + > .../openssh/regress/misc/fuzz-harness/kex_fuzz.cc | 461 + > .../regress/misc/fuzz-harness/privkey_fuzz.cc | 21 + > .../openssh/regress/misc/fuzz-harness/sig_fuzz.cc | 24 +- > .../regress/misc/fuzz-harness/ssh-sk-null.cc | 51 + > .../regress/misc/fuzz-harness/sshsig_fuzz.cc | 37 + > .../regress/misc/fuzz-harness/sshsigopt_fuzz.cc | 29 + > .../regress/misc/fuzz-harness/testdata/README | 4 + > .../fuzz-harness/testdata/create-agent-corpus.sh | 44 + > .../regress/misc/fuzz-harness/testdata/id_dsa | 21 + > .../misc/fuzz-harness/testdata/id_dsa-cert.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_dsa.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_ecdsa | 8 + > .../misc/fuzz-harness/testdata/id_ecdsa-cert.pub | 1 + > .../misc/fuzz-harness/testdata/id_ecdsa.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_ecdsa_sk | 14 + > .../fuzz-harness/testdata/id_ecdsa_sk-cert.pub | 1 + > .../misc/fuzz-harness/testdata/id_ecdsa_sk.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_ed25519 | 7 + > .../misc/fuzz-harness/testdata/id_ed25519-cert.pub | 1 + > .../misc/fuzz-harness/testdata/id_ed25519.pub | 2 + > .../misc/fuzz-harness/testdata/id_ed25519_sk | 8 + > .../fuzz-harness/testdata/id_ed25519_sk-cert.pub | 1 + > .../misc/fuzz-harness/testdata/id_ed25519_sk.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_rsa | 27 + > .../misc/fuzz-harness/testdata/id_rsa-cert.pub | 1 + > .../regress/misc/fuzz-harness/testdata/id_rsa.pub | 1 + > crypto/openssh/regress/misc/kexfuzz/Makefile | 88 - > crypto/openssh/regress/misc/kexfuzz/README | 34 - > crypto/openssh/regress/misc/kexfuzz/kexfuzz.c | 459 - > crypto/openssh/regress/misc/sk-dummy/fatal.c | 27 + > crypto/openssh/regress/misc/sk-dummy/sk-dummy.c | 539 + > crypto/openssh/regress/modpipe.c | 0 > crypto/openssh/regress/multiplex.sh | 32 +- > crypto/openssh/regress/multipubkey.sh | 19 +- > crypto/openssh/regress/netcat.c | 46 +- > crypto/openssh/regress/percent.sh | 119 + > crypto/openssh/regress/portnum.sh | 0 > crypto/openssh/regress/principals-command.sh | 16 +- > crypto/openssh/regress/proxy-connect.sh | 10 +- > crypto/openssh/regress/putty-ciphers.sh | 4 +- > crypto/openssh/regress/putty-kex.sh | 4 +- > crypto/openssh/regress/putty-transfer.sh | 10 +- > crypto/openssh/regress/reconfigure.sh | 24 +- > crypto/openssh/regress/reexec.sh | 5 +- > crypto/openssh/regress/rekey.sh | 8 +- > crypto/openssh/regress/scp-ssh-wrapper.sh | 14 +- > crypto/openssh/regress/scp-uri.sh | 81 +- > crypto/openssh/regress/scp.sh | 183 +- > crypto/openssh/regress/scp3.sh | 60 + > crypto/openssh/regress/servcfginclude.sh | 188 + > crypto/openssh/regress/sftp-badcmds.sh | 4 +- > crypto/openssh/regress/sftp-chroot.sh | 7 +- > crypto/openssh/regress/sftp-cmds.sh | 4 - > crypto/openssh/regress/sftp-perm.sh | 18 +- > crypto/openssh/regress/ssh2putty.sh | 8 +- > crypto/openssh/regress/sshcfgparse.sh | 68 +- > crypto/openssh/regress/sshfp-connect.sh | 66 + > crypto/openssh/regress/sshsig.sh | 236 + > crypto/openssh/regress/test-exec.sh | 280 +- > crypto/openssh/regress/unittests/Makefile | 4 +- > crypto/openssh/regress/unittests/Makefile.inc | 38 +- > crypto/openssh/regress/unittests/authopt/tests.c | 10 +- > crypto/openssh/regress/unittests/bitmap/tests.c | 4 + > .../openssh/regress/unittests/conversion/Makefile | 3 +- > .../openssh/regress/unittests/conversion/tests.c | 32 +- > crypto/openssh/regress/unittests/hostkeys/Makefile | 12 +- > .../regress/unittests/hostkeys/mktestdata.sh | 0 > .../regress/unittests/hostkeys/test_iterate.c | 119 +- > crypto/openssh/regress/unittests/kex/Makefile | 31 +- > crypto/openssh/regress/unittests/kex/test_kex.c | 29 +- > crypto/openssh/regress/unittests/match/Makefile | 4 +- > crypto/openssh/regress/unittests/match/tests.c | 4 +- > crypto/openssh/regress/unittests/misc/test_argv.c | 187 + > .../openssh/regress/unittests/misc/test_convtime.c | 59 + > .../openssh/regress/unittests/misc/test_expand.c | 90 + > crypto/openssh/regress/unittests/misc/test_parse.c | 86 + > .../openssh/regress/unittests/misc/test_strdelim.c | 202 + > crypto/openssh/regress/unittests/misc/tests.c | 38 + > crypto/openssh/regress/unittests/sshbuf/Makefile | 10 +- > .../regress/unittests/sshbuf/test_sshbuf_fuzz.c | 9 +- > .../unittests/sshbuf/test_sshbuf_getput_basic.c | 231 +- > .../unittests/sshbuf/test_sshbuf_getput_crypto.c | 160 +- > .../unittests/sshbuf/test_sshbuf_getput_fuzz.c | 31 +- > .../regress/unittests/sshbuf/test_sshbuf_misc.c | 71 +- > crypto/openssh/regress/unittests/sshbuf/tests.c | 2 + > crypto/openssh/regress/unittests/sshkey/Makefile | 14 +- > crypto/openssh/regress/unittests/sshkey/common.c | 17 +- > .../openssh/regress/unittests/sshkey/mktestdata.sh | 85 +- > .../openssh/regress/unittests/sshkey/test_file.c | 141 +- > .../openssh/regress/unittests/sshkey/test_fuzz.c | 78 +- > .../openssh/regress/unittests/sshkey/test_sshkey.c | 55 +- > .../regress/unittests/sshkey/testdata/dsa_n | 33 +- > .../regress/unittests/sshkey/testdata/ecdsa_n | 13 +- > .../regress/unittests/sshkey/testdata/ecdsa_sk1 | 13 + > .../unittests/sshkey/testdata/ecdsa_sk1-cert.fp | 1 + > .../unittests/sshkey/testdata/ecdsa_sk1-cert.pub | 1 + > .../regress/unittests/sshkey/testdata/ecdsa_sk1.fp | 1 + > .../unittests/sshkey/testdata/ecdsa_sk1.fp.bb | 1 + > .../unittests/sshkey/testdata/ecdsa_sk1.pub | 1 + > .../regress/unittests/sshkey/testdata/ecdsa_sk1_pw | 14 + > .../regress/unittests/sshkey/testdata/ecdsa_sk2 | 13 + > .../regress/unittests/sshkey/testdata/ecdsa_sk2.fp | 1 + > .../unittests/sshkey/testdata/ecdsa_sk2.fp.bb | 1 + > .../unittests/sshkey/testdata/ecdsa_sk2.pub | 1 + > .../regress/unittests/sshkey/testdata/ed25519_1_pw | 12 +- > .../regress/unittests/sshkey/testdata/ed25519_sk1 | 8 + > .../unittests/sshkey/testdata/ed25519_sk1-cert.fp | 1 + > .../unittests/sshkey/testdata/ed25519_sk1-cert.pub | 1 + > .../unittests/sshkey/testdata/ed25519_sk1.fp | 1 + > .../unittests/sshkey/testdata/ed25519_sk1.fp.bb | 1 + > .../unittests/sshkey/testdata/ed25519_sk1.pub | 1 + > .../unittests/sshkey/testdata/ed25519_sk1_pw | 9 + > .../regress/unittests/sshkey/testdata/ed25519_sk2 | 8 + > .../unittests/sshkey/testdata/ed25519_sk2.fp | 1 + > .../unittests/sshkey/testdata/ed25519_sk2.fp.bb | 1 + > .../unittests/sshkey/testdata/ed25519_sk2.pub | 1 + > .../regress/unittests/sshkey/testdata/rsa1_1 | Bin 533 -> 0 bytes > .../regress/unittests/sshkey/testdata/rsa1_1.fp | 1 - > .../regress/unittests/sshkey/testdata/rsa1_1.fp.bb | 1 - > .../unittests/sshkey/testdata/rsa1_1.param.n | 1 - > .../regress/unittests/sshkey/testdata/rsa1_1.pub | 1 - > .../regress/unittests/sshkey/testdata/rsa1_1_pw | Bin 533 -> 0 bytes > .../regress/unittests/sshkey/testdata/rsa1_2 | Bin 981 -> 0 bytes > .../regress/unittests/sshkey/testdata/rsa1_2.fp | 1 - > .../regress/unittests/sshkey/testdata/rsa1_2.fp.bb | 1 - > .../unittests/sshkey/testdata/rsa1_2.param.n | 1 - > .../regress/unittests/sshkey/testdata/rsa1_2.pub | 1 - > .../regress/unittests/sshkey/testdata/rsa_n | 31 +- > crypto/openssh/regress/unittests/sshkey/tests.c | 5 - > crypto/openssh/regress/unittests/sshsig/Makefile | 25 + > .../openssh/regress/unittests/sshsig/mktestdata.sh | 42 + > .../openssh/regress/unittests/sshsig/testdata/dsa | 12 + > .../regress/unittests/sshsig/testdata/dsa.pub | 1 + > .../regress/unittests/sshsig/testdata/dsa.sig | 13 + > .../regress/unittests/sshsig/testdata/ecdsa | 5 + > .../regress/unittests/sshsig/testdata/ecdsa.pub | 1 + > .../regress/unittests/sshsig/testdata/ecdsa.sig | 7 + > .../regress/unittests/sshsig/testdata/ecdsa_sk | 13 + > .../regress/unittests/sshsig/testdata/ecdsa_sk.pub | 1 + > .../regress/unittests/sshsig/testdata/ecdsa_sk.sig | 8 + > .../sshsig/testdata/ecdsa_sk_webauthn.pub | 1 + > .../sshsig/testdata/ecdsa_sk_webauthn.sig | 13 + > .../regress/unittests/sshsig/testdata/ed25519 | 7 + > .../regress/unittests/sshsig/testdata/ed25519.pub | 1 + > .../regress/unittests/sshsig/testdata/ed25519.sig | 6 + > .../regress/unittests/sshsig/testdata/ed25519_sk | 8 + > .../unittests/sshsig/testdata/ed25519_sk.pub | 1 + > .../unittests/sshsig/testdata/ed25519_sk.sig | 7 + > .../regress/unittests/sshsig/testdata/namespace | 1 + > .../openssh/regress/unittests/sshsig/testdata/rsa | 39 + > .../regress/unittests/sshsig/testdata/rsa.pub | 1 + > .../regress/unittests/sshsig/testdata/rsa.sig | 19 + > .../regress/unittests/sshsig/testdata/signed-data | 1 + > crypto/openssh/regress/unittests/sshsig/tests.c | 139 + > .../openssh/regress/unittests/sshsig/webauthn.html | 766 + > .../regress/unittests/test_helper/test_helper.c | 60 +- > .../regress/unittests/test_helper/test_helper.h | 8 +- > crypto/openssh/regress/unittests/utf8/tests.c | 2 + > crypto/openssh/regress/valgrind-unit.sh | 2 + > crypto/openssh/sandbox-darwin.c | 2 +- > crypto/openssh/sandbox-pledge.c | 8 +- > crypto/openssh/sandbox-rlimit.c | 18 +- > crypto/openssh/sandbox-seccomp-filter.c | 76 +- > crypto/openssh/sandbox-systrace.c | 7 +- > crypto/openssh/scp.1 | 87 +- > crypto/openssh/scp.c | 679 +- > crypto/openssh/servconf.c | 1165 +- > crypto/openssh/servconf.h | 63 +- > crypto/openssh/serverloop.c | 566 +- > crypto/openssh/session.c | 461 +- > crypto/openssh/sftp-client.c | 1162 +- > crypto/openssh/sftp-client.h | 64 +- > crypto/openssh/sftp-common.c | 5 +- > crypto/openssh/sftp-glob.c | 4 +- > .../{openbsd-compat/realpath.c => sftp-realpath.c} | 13 +- > crypto/openssh/sftp-server-main.c | 5 +- > crypto/openssh/sftp-server.8 | 32 +- > crypto/openssh/sftp-server.c | 491 +- > crypto/openssh/sftp.1 | 126 +- > crypto/openssh/sftp.c | 304 +- > crypto/openssh/sk-api.h | 98 + > crypto/openssh/sk-usbhid.c | 1267 ++ > crypto/openssh/sntrup761.c | 1273 ++ > crypto/openssh/sntrup761.sh | 85 + > crypto/openssh/srclimit.c | 140 + > crypto/openssh/srclimit.h | 18 + > crypto/openssh/ssh-add.1 | 81 +- > crypto/openssh/ssh-add.c | 315 +- > crypto/openssh/ssh-agent.1 | 178 +- > crypto/openssh/ssh-agent.c | 697 +- > crypto/openssh/ssh-dss.c | 8 +- > crypto/openssh/ssh-ecdsa-sk.c | 324 + > crypto/openssh/ssh-ecdsa.c | 14 +- > crypto/openssh/ssh-ed25519-sk.c | 163 + > crypto/openssh/ssh-ed25519.c | 23 +- > crypto/openssh/ssh-gss.h | 4 +- > crypto/openssh/ssh-keygen.1 | 717 +- > crypto/openssh/ssh-keygen.c | 2111 ++- > crypto/openssh/ssh-keyscan.1 | 6 +- > crypto/openssh/ssh-keyscan.c | 105 +- > crypto/openssh/ssh-keysign.8 | 6 +- > crypto/openssh/ssh-keysign.c | 77 +- > crypto/openssh/ssh-pkcs11-client.c | 212 +- > crypto/openssh/ssh-pkcs11-helper.8 | 29 +- > crypto/openssh/ssh-pkcs11-helper.c | 210 +- > crypto/openssh/ssh-pkcs11.c | 1774 +- > crypto/openssh/ssh-pkcs11.h | 20 +- > crypto/openssh/ssh-sk-client.c | 448 + > crypto/openssh/ssh-sk-helper.8 | 66 + > crypto/openssh/ssh-sk-helper.c | 364 + > crypto/openssh/ssh-sk.c | 826 + > crypto/openssh/ssh-sk.h | 69 + > crypto/openssh/ssh-xmss.c | 27 +- > crypto/openssh/ssh.1 | 166 +- > crypto/openssh/ssh.c | 925 +- > crypto/openssh/ssh.h | 11 +- > crypto/openssh/ssh2.h | 4 +- > crypto/openssh/ssh_api.c | 234 +- > crypto/openssh/ssh_config | 6 +- > crypto/openssh/ssh_config.5 | 651 +- > crypto/openssh/ssh_namespace.h | 223 +- > crypto/openssh/sshbuf-getput-basic.c | 171 +- > crypto/openssh/sshbuf-getput-crypto.c | 76 +- > crypto/openssh/sshbuf-io.c | 117 + > crypto/openssh/sshbuf-misc.c | 152 +- > crypto/openssh/sshbuf.c | 22 +- > crypto/openssh/sshbuf.h | 79 +- > crypto/openssh/sshconnect.c | 882 +- > crypto/openssh/sshconnect.h | 63 +- > crypto/openssh/sshconnect2.c | 942 +- > crypto/openssh/sshd.8 | 115 +- > crypto/openssh/sshd.c | 975 +- > crypto/openssh/sshd_config | 12 +- > crypto/openssh/sshd_config.5 | 351 +- > crypto/openssh/ssherr.c | 6 +- > crypto/openssh/ssherr.h | 4 +- > crypto/openssh/sshkey-xmss.c | 160 +- > crypto/openssh/sshkey-xmss.h | 16 +- > crypto/openssh/sshkey.c | 1516 +- > crypto/openssh/sshkey.h | 103 +- > crypto/openssh/sshlogin.c | 9 +- > crypto/openssh/sshpty.c | 23 +- > crypto/openssh/sshsig.c | 1098 ++ > crypto/openssh/sshsig.h | 107 + > crypto/openssh/ttymodes.c | 44 +- > crypto/openssh/uidswap.c | 40 +- > crypto/openssh/umac.c | 10 +- > crypto/openssh/umac.h | 6 +- > crypto/openssh/utf8.c | 27 +- > crypto/openssh/utf8.h | 11 +- > crypto/openssh/uuencode.c | 95 - > crypto/openssh/uuencode.h | 29 - > crypto/openssh/version.h | 6 +- > crypto/openssh/xmalloc.c | 31 +- > crypto/openssh/xmalloc.h | 8 +- > crypto/openssh/xmss_commons.c | 2 +- > crypto/openssh/xmss_fast.c | 2 +- > crypto/openssh/xmss_hash.c | 2 +- > crypto/openssh/xmss_hash_address.c | 2 +- > crypto/openssh/xmss_wots.c | 2 +- > lib/libpam/modules/pam_ssh/pam_ssh.c | 2 +- > secure/lib/libssh/Makefile | 19 +- > secure/usr.bin/scp/Makefile | 2 +- > secure/usr.bin/ssh-add/Makefile | 2 +- > secure/usr.bin/ssh-keygen/Makefile | 3 +- > secure/usr.sbin/sshd/Makefile | 2 +- > 539 files changed, 54039 insertions(+), 25574 deletions(-) > > diff --cc crypto/openssh/.github/ci-status.md > index 000000000000,0ad8bf5aaf44..0ad8bf5aaf44 > mode 000000,100644..100644 > --- a/crypto/openssh/.github/ci-status.md > +++ b/crypto/openssh/.github/ci-status.md > diff --cc crypto/openssh/.github/configs > index 000000000000,12578c067348..12578c067348 > mode 000000,100755..100755 > --- a/crypto/openssh/.github/configs > +++ b/crypto/openssh/.github/configs > diff --cc crypto/openssh/.github/configure.sh > index 000000000000,e098730f02d6..e098730f02d6 > mode 000000,100755..100755 > --- a/crypto/openssh/.github/configure.sh > +++ b/crypto/openssh/.github/configure.sh > diff --cc crypto/openssh/.github/run_test.sh > index 000000000000,adf2568ad1e2..adf2568ad1e2 > mode 000000,100755..100755 > --- a/crypto/openssh/.github/run_test.sh > +++ b/crypto/openssh/.github/run_test.sh > diff --cc crypto/openssh/.github/setup_ci.sh > index 000000000000,70a444e4eff4..70a444e4eff4 > mode 000000,100755..100755 > --- a/crypto/openssh/.github/setup_ci.sh > +++ b/crypto/openssh/.github/setup_ci.sh > diff --cc crypto/openssh/.github/workflows/c-cpp.yml > index 000000000000,289b18b7f621..289b18b7f621 > mode 000000,100644..100644 > --- a/crypto/openssh/.github/workflows/c-cpp.yml > +++ b/crypto/openssh/.github/workflows/c-cpp.yml > diff --cc crypto/openssh/.github/workflows/selfhosted.yml > index 000000000000,df6eca714fb5..df6eca714fb5 > mode 000000,100644..100644 > --- a/crypto/openssh/.github/workflows/selfhosted.yml > +++ b/crypto/openssh/.github/workflows/selfhosted.yml > diff --cc crypto/openssh/.github/workflows/upstream.yml > index 000000000000,f0493c12d7d5..f0493c12d7d5 > mode 000000,100644..100644 > --- a/crypto/openssh/.github/workflows/upstream.yml > +++ b/crypto/openssh/.github/workflows/upstream.yml > diff --cc crypto/openssh/.gitignore > index 650eb3c3c90c,000000000000..5e4ae5a60d06 > mode 100644,000000..100644 > --- a/crypto/openssh/.gitignore > +++ b/crypto/openssh/.gitignore > @@@ -1,28 -1,0 +1,36 @@@ > +Makefile > +buildpkg.sh > +config.h > +config.h.in > ++config.h.in~ > ++config.log > +config.status > +configure > ++aclocal.m4 > +openbsd-compat/Makefile > +openbsd-compat/regress/Makefile > +openssh.xml > +opensshd.init > +survey.sh > +**/*.0 > +**/*.o > ++**/*.lo > ++**/*.so > +**/*.out > +**/*.a > +autom4te.cache/ > +scp > +sftp > +sftp-server > +ssh > +ssh-add > +ssh-agent > +ssh-keygen > +ssh-keyscan > +ssh-keysign > +ssh-pkcs11-helper > ++ssh-sk-helper > +sshd > +!regress/misc/fuzz-harness/Makefile > ++!regress/unittests/sshsig/Makefile > ++tags > diff --cc crypto/openssh/FREEBSD-vendor > index f48cbb6c3079,000000000000..c7f6462985a2 > mode 100644,000000..100644 > --- a/crypto/openssh/FREEBSD-vendor > +++ b/crypto/openssh/FREEBSD-vendor > @@@ -1,6 -1,0 +1,6 @@@ > +# $FreeBSD$ > +Project: Portable OpenSSH > +ProjectURL: http://www.openssh.com/portable.html > - Version: 7.9p1 > ++Version: 8.7p1 > +License: BSD > - Maintainer: des > ++Maintainer: emaste > diff --cc crypto/openssh/INSTALL > index 775eb6c05342,000000000000..8ab8a403a4e2 > mode 100644,000000..100644 > --- a/crypto/openssh/INSTALL > +++ b/crypto/openssh/INSTALL > @@@ -1,276 -1,0 +1,301 @@@ > +1. Prerequisites > +---------------- > + > +A C compiler. Any C89 or better compiler should work. Where supported, > +configure will attempt to enable the compiler's run-time integrity checking > +options. Some notes about specific compilers: > + - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime > + (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure) > + > - You will need working installations of Zlib and libcrypto (LibreSSL / > - OpenSSL) > ++To support Privilege Separation (which is now required) you will need > ++to create the user, group and directory used by sshd for privilege > ++separation. See README.privsep for details. > + > ++ > ++The remaining items are optional. > ++ > ++A working installation of zlib: > +Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems): > +http://www.gzip.org/zlib/ > + > - libcrypto (LibreSSL or OpenSSL >= 1.0.1 < 1.1.0) > - LibreSSL http://www.libressl.org/ ; or > - OpenSSL http://www.openssl.org/ > ++libcrypto from either of LibreSSL or OpenSSL. Building without libcrypto > ++is supported but severely restricts the available ciphers and algorithms. > ++ - LibreSSL (https://www.libressl.org/) > ++ - OpenSSL (https://www.openssl.org) with any of the following versions: > ++ - 1.0.x >= 1.0.1 or 1.1.0 >= 1.1.0g or any 1.1.1 > ++ > ++Note that due to a bug in EVP_CipherInit OpenSSL 1.1 versions prior to > ++1.1.0g can't be used. > + > +LibreSSL/OpenSSL should be compiled as a position-independent library > - (i.e. with -fPIC) otherwise OpenSSH will not be able to link with it. > - If you must use a non-position-independent libcrypto, then you may need > - to configure OpenSSH --without-pie. Note that because of API changes, > - OpenSSL 1.1.x is not currently supported. > ++(i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC" > ++or LibreSSL as "CFLAGS=-fPIC ./configure") otherwise OpenSSH will not > ++be able to link with it. If you must use a non-position-independent > ++libcrypto, then you may need to configure OpenSSH --without-pie. > + > - The remaining items are optional. > ++If you build either from source, running the OpenSSL self-test ("make > ++tests") or the LibreSSL equivalent ("make check") and ensuring that all > ++tests pass is strongly recommended. > + > +NB. If you operating system supports /dev/random, you should configure > +libcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's > - direct support of /dev/random, or failing that, either prngd or egd > ++direct support of /dev/random, or failing that, either prngd or egd. > + > +PRNGD: > + > +If your system lacks kernel-based random collection, the use of Lutz > - Jaenicke's PRNGd is recommended. > ++Jaenicke's PRNGd is recommended. It requires that libcrypto be configured > ++to support it. > + > +http://prngd.sourceforge.net/ > + > +EGD: > + > - If the kernel lacks /dev/random the Entropy Gathering Daemon (EGD) is > - supported only if libcrypto supports it. > ++The Entropy Gathering Daemon (EGD) supports the same interface as prngd. > ++It also supported only if libcrypto is configured to support it. > + > +http://egd.sourceforge.net/ > + > +PAM: > + > +OpenSSH can utilise Pluggable Authentication Modules (PAM) if your > +system supports it. PAM is standard most Linux distributions, Solaris, > - HP-UX 11, AIX >= 5.2, FreeBSD and NetBSD. > ++HP-UX 11, AIX >= 5.2, FreeBSD, NetBSD and Mac OS X. > + > +Information about the various PAM implementations are available: > + > +Solaris PAM: http://www.sun.com/software/solaris/pam/ > +Linux PAM: http://www.kernel.org/pub/linux/libs/pam/ > +OpenPAM: http://www.openpam.org/ > + > +If you wish to build the GNOME passphrase requester, you will need the GNOME > +libraries and headers. > + > +GNOME: > +http://www.gnome.org/ > + > +Alternatively, Jim Knoble has written an excellent X11 > +passphrase requester. This is maintained separately at: > + > +http://www.jmknoble.net/software/x11-ssh-askpass/ > + > +TCP Wrappers: > + > +If you wish to use the TCP wrappers functionality you will need at least > +tcpd.h and libwrap.a, either in the standard include and library paths, > +or in the directory specified by --with-tcp-wrappers. Version 7.6 is > +known to work. > + > +http://ftp.porcupine.org/pub/security/index.html > + > +LibEdit: > + > +sftp supports command-line editing via NetBSD's libedit. If your platform > +has it available natively you can use that, alternatively you might try > +these multi-platform ports: > + > +http://www.thrysoee.dk/editline/ > +http://sourceforge.net/projects/libedit/ > + > +LDNS: > + > +LDNS is a DNS BSD-licensed resolver library which supports DNSSEC. > + > +http://nlnetlabs.nl/projects/ldns/ > + > +Autoconf: > + > +If you modify configure.ac or configure doesn't exist (eg if you checked > - the code out of git yourself) then you will need autoconf-2.69 to rebuild > - the automatically generated files by running "autoreconf". Earlier > - versions may also work but this is not guaranteed. > ++the code out of git yourself) then you will need autoconf-2.69 and > ++automake-1.16.1 to rebuild the automatically generated files by running > ++"autoreconf". Earlier versions may also work but this is not guaranteed. > + > +http://www.gnu.org/software/autoconf/ > ++http://www.gnu.org/software/automake/ > + > +Basic Security Module (BSM): > + > +Native BSM support is known to exist in Solaris from at least 2.5.1, > +FreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM > +implementation (http://www.openbsm.org). > + > +makedepend: > + > +https://www.x.org/archive/individual/util/ > + > +If you are making significant changes to the code you may need to rebuild > +the dependency (.depend) file using "make depend", which requires the > +"makedepend" tool from the X11 distribution. > + > ++libfido2: > ++ > ++libfido2 allows the use of hardware security keys over USB. libfido2 > ++in turn depends on libcbor. libfido2 >= 1.5.0 is strongly recommended. > ++Limited functionality is possible with earlier libfido2 versions. > ++ > ++https://github.com/Yubico/libfido2 > ++https://github.com/pjk/libcbor > ++ > ++ > +2. Building / Installation > +-------------------------- > + > +To install OpenSSH with default options: > + > +./configure > +make > +make install > + > +This will install the OpenSSH binaries in /usr/local/bin, configuration files > +in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different > +installation prefix, use the --prefix option to configure: > + > +./configure --prefix=/opt > +make > +make install > + > +Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override > +specific paths, for example: > + > +./configure --prefix=/opt --sysconfdir=/etc/ssh > +make > +make install > + > +This will install the binaries in /opt/{bin,lib,sbin}, but will place the > +configuration files in /etc/ssh. > + > - If you are using Privilege Separation (which is enabled by default) > - then you will also need to create the user, group and directory used by > - sshd for privilege separation. See README.privsep for details. > - > +If you are using PAM, you may need to manually install a PAM control > +file as "/etc/pam.d/sshd" (or wherever your system prefers to keep > +them). Note that the service name used to start PAM is __progname, > +which is the basename of the path of your sshd (e.g., the service name > +for /usr/sbin/osshd will be osshd). If you have renamed your sshd > +executable, your PAM configuration may need to be modified. > + > +A generic PAM configuration is included as "contrib/sshd.pam.generic", > +you may need to edit it before using it on your system. If you are > +using a recent version of Red Hat Linux, the config file in > +contrib/redhat/sshd.pam should be more useful. Failure to install a > +valid PAM file may result in an inability to use password > +authentication. On HP-UX 11 and Solaris, the standard /etc/pam.conf > +configuration will work with sshd (sshd will match the other service > +name). > + > +There are a few other options to the configure script: > + > +--with-audit=[module] enable additional auditing via the specified module. > +Currently, drivers for "debug" (additional info via syslog) and "bsm" > +(Sun's Basic Security Module) are supported. > + > +--with-pam enables PAM support. If PAM support is compiled in, it must > +also be enabled in sshd_config (refer to the UsePAM directive). > + > +--with-prngd-socket=/some/file allows you to enable EGD or PRNGD > +support and to specify a PRNGd socket. Use this if your Unix lacks > +/dev/random. > + > +--with-prngd-port=portnum allows you to enable EGD or PRNGD support > +and to specify a EGD localhost TCP port. Use this if your Unix lacks > +/dev/random. > + > +--with-lastlog=FILE will specify the location of the lastlog file. > +./configure searches a few locations for lastlog, but may not find > +it if lastlog is installed in a different place. > + > +--without-lastlog will disable lastlog support entirely. > + > +--with-osfsia, --without-osfsia will enable or disable OSF1's Security > +Integration Architecture. The default for OSF1 machines is enable. > + > +--with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny) > +support. > + > +--with-md5-passwords will enable the use of MD5 passwords. Enable this > +if your operating system uses MD5 passwords and the system crypt() does > +not support them directly (see the crypt(3/3c) man page). If enabled, the > +resulting binary will support both MD5 and traditional crypt passwords. > + > +--with-utmpx enables utmpx support. utmpx support is automatic for > +some platforms. > + > +--without-shadow disables shadow password support. > + > +--with-ipaddr-display forces the use of a numeric IP address in the > +$DISPLAY environment variable. Some broken systems need this. > + > +--with-default-path=PATH allows you to specify a default $PATH for sessions > +started by sshd. This replaces the standard path entirely. > + > +--with-pid-dir=PATH specifies the directory in which the sshd.pid file is > +created. > + > +--with-xauth=PATH specifies the location of the xauth binary > + > +--with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL > +libraries are installed. > + > +--with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support > + > ++--without-openssl builds without using OpenSSL. Only a subset of ciphers > ++and algorithms are supported in this configuration. > ++ > ++--without-zlib builds without zlib. This disables the Compression option. > ++ > +--with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to > +real (AF_INET) IPv4 addresses. Works around some quirks on Linux. > + > +If you need to pass special options to the compiler or linker, you > +can specify these as environment variables before running ./configure. > +For example: > + > +CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure > + > +3. Configuration > +---------------- > + > +The runtime configuration files are installed by in ${prefix}/etc or > +whatever you specified as your --sysconfdir (/usr/local/etc by default). > + > +The default configuration should be instantly usable, though you should > +review it to ensure that it matches your security requirements. > + > +To generate a host key, run "make host-key". Alternately you can do so > +manually using the following commands: > + > + ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N "" > + > +for each of the types you wish to generate (rsa, dsa or ecdsa) or > + > + ssh-keygen -A > + > +to generate keys for all supported types. > + > +Replacing /etc/ssh with the correct path to the configuration directory. > +(${prefix}/etc or whatever you specified with --sysconfdir during > *** 20555 LINES SKIPPED *** > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" After upgrading 14-CURRENT to this commit, we are unable to use "scp" from certain FreeBSD 13-STABLE hosts as well as from Linux Xubuntu 20.04 clients with the latest updates. scp from 14-CURRENT to 14-CURRENT works with public key authetication, if password/built-in-password or PAM is used, we receive the password prompter, but then the connection is refused: Permission denied or, taken from /var/log/auth.log: Sep 9 17:19:10 <4.6> thor sshd[1450]: Failed password for ohartmann from 192.168.0.1 port 24332 ssh2 I do not see essential changes so scp works now exclusively/only with publickey. What is wrong? Is this a bug? How to return to normal/expected behaviour? It is also confusing that the manpage for sshd_config states for "UsePAM as an regular config tag: "...UsePAM Enables the Pluggable Authentication Module interface. If set to yes this will enable PAM ... blablabla ... The default is yes ..." If "UsePAM yes" used explicetely in /etc/ssh/sshd_config and restarting sshd, i.e. "service sshd restart", then one receives this error message in /var/log/auth.log: Sep 9 17:22:44 <4.6> thor sshd[1480]: rexec line 89: Unsupported option UsePAM and on the console, this weird message appears: # service sshd restart Performing sanity check on sshd configuration. /etc/ssh/sshd_config line 89: Unsupported option UsePAM Stopping sshd. Waiting for PIDS: 1423, 1423. Performing sanity check on sshd configuration. /etc/ssh/sshd_config line 89: Unsupported option UsePAM Starting sshd. /etc/ssh/sshd_config line 89: Unsupported option UsePAM Kind regards, O. Hartmann -- O. Hartmann From owner-dev-commits-src-main@freebsd.org Thu Sep 9 18:13:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A56F675600; Thu, 9 Sep 2021 18:13:40 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H56ZW6d8bz4vn7; Thu, 9 Sep 2021 18:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46AF1E40C; Thu, 9 Sep 2021 18:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189IDdIt037331; Thu, 9 Sep 2021 18:13:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189IDdiJ037330; Thu, 9 Sep 2021 18:13:39 GMT (envelope-from git) Date: Thu, 9 Sep 2021 18:13:39 GMT Message-Id: <202109091813.189IDdiJ037330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3ea2cdd45ec1 - main - sctp: add explicit cast, no functional change intended MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ea2cdd45ec1e057315ccc3aea16a65d62aad337 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 18:13:40 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3ea2cdd45ec1e057315ccc3aea16a65d62aad337 commit 3ea2cdd45ec1e057315ccc3aea16a65d62aad337 Author: Michael Tuexen AuthorDate: 2021-09-09 17:13:47 +0000 Commit: Michael Tuexen CommitDate: 2021-09-09 17:13:47 +0000 sctp: add explicit cast, no functional change intended MFC after: 3 days --- sys/netinet/sctp_pcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index e571f80e472a..6ccd4ddf96b7 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4542,7 +4542,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) SCTP_INP_INFO_WLOCK_ASSERT(); (void)SCTP_GETTIME_TIMEVAL(&now); - time = now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); + time = (uint32_t)now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = false; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { From owner-dev-commits-src-main@freebsd.org Thu Sep 9 18:26:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E8C0675548; Thu, 9 Sep 2021 18:26:51 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H56sk5s0rz3H5M; Thu, 9 Sep 2021 18:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A963C1E559; Thu, 9 Sep 2021 18:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189IQofp050492; Thu, 9 Sep 2021 18:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189IQoKK050490; Thu, 9 Sep 2021 18:26:50 GMT (envelope-from git) Date: Thu, 9 Sep 2021 18:26:50 GMT Message-Id: <202109091826.189IQoKK050490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 9d3bc1638254 - main - rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d3bc163825415f900d06d62efdf02caaad2d51d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 18:26:51 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=9d3bc163825415f900d06d62efdf02caaad2d51d commit 9d3bc163825415f900d06d62efdf02caaad2d51d Author: Henri Hennebert AuthorDate: 2021-09-09 17:33:51 +0000 Commit: Jung-uk Kim CommitDate: 2021-09-09 18:26:17 +0000 rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic - Some configurations, e.g. HP EliteBook 840 G3, come with a dummy card in the card slot which is detected as a valid SD card. This added long timeout at boot time. To alleviate the problem, the default timeout is reduced to one second during the setup phase. [1] - Some configurations crash at boot if rtsx(4) is defined in the kernel config. At boot time, without a card inserted, the driver found that a card is present and just after that a "spontaneous" interrupt is generated showing that no card is present. To solve this problem, DELAY(9) is set to one quarter of a second before checking card presence during driver attach. - As advised by adrian, taskqueue and DMA are set up sooner during the driver attach. A heuristic to try to detect configuration needing inversion was added. PR: 255130 [1] MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30499 --- share/man/man4/rtsx.4 | 13 +++-- sys/dev/rtsx/rtsx.c | 132 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 99 insertions(+), 46 deletions(-) diff --git a/share/man/man4/rtsx.4 b/share/man/man4/rtsx.4 index 3f2ffcf6be66..10d1f54b285c 100644 --- a/share/man/man4/rtsx.4 +++ b/share/man/man4/rtsx.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2020 +.Dd April 25, 2021 .Dt RTSX 4 .Os .Sh NAME @@ -108,12 +108,19 @@ with modifications found in Linux and .It The timeouts experienced during card insert and during I/O are solved in version 1.0g. .It -RTS522A on Lenovo P50s and Lenovo T470p, card detection and read-only switch are reversed. -This is sovled by adding in +RTS522A on Lenovo T470p, card detection and read-only switch are reversed. +This is solved by adding in .Em loader.conf(5) : .Bd -ragged .Cd dev.rtsx.0.inversion=1 .Ed +.Pp +The driver tries to automate those exceptions. +If this automation is wrong, it can be avoided by adding in +.Em loader.conf(5) : +.Bd -ragged +.Cd dev.rtsx.0.inversion=0 +.Ed .It Mounting a filesystem with write access on a card write protected may involve a kernel crash. .It diff --git a/sys/dev/rtsx/rtsx.c b/sys/dev/rtsx/rtsx.c index cae35243d137..fe27f067b916 100644 --- a/sys/dev/rtsx/rtsx.c +++ b/sys/dev/rtsx/rtsx.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -83,11 +84,13 @@ struct rtsx_softc { struct resource *rtsx_irq_res; /* bus IRQ resource */ void *rtsx_irq_cookie; /* bus IRQ resource cookie */ struct callout rtsx_timeout_callout; /* callout for timeout */ - int rtsx_timeout; /* interrupt timeout value */ + int rtsx_timeout_cmd; /* interrupt timeout for setup commands */ + int rtsx_timeout_io; /* interrupt timeout for I/O commands */ void (*rtsx_intr_trans_ok)(struct rtsx_softc *sc); /* function to call if transfer succeed */ void (*rtsx_intr_trans_ko)(struct rtsx_softc *sc); /* function to call if transfer fail */ + struct timeout_task rtsx_card_insert_task; /* card insert delayed task */ struct task rtsx_card_remove_task; /* card remove task */ @@ -166,25 +169,35 @@ struct rtsx_softc { #define RTSX_RTL8411 0x5289 #define RTSX_RTL8411B 0x5287 -#define RTSX_VERSION "2.0c" +#define RTSX_VERSION "2.0i" static const struct rtsx_device { uint16_t vendor_id; uint16_t device_id; const char *desc; } rtsx_devices[] = { - { RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCIe MMC/SD Card Reader"}, { 0, 0, NULL} }; +/* See `kenv | grep smbios.system` */ +static const struct rtsx_inversion_model { + char *maker; + char *family; + char *product; +} rtsx_inversion_models[] = { + { "LENOVO", "ThinkPad T470p", "20J7S0PM00"}, + { NULL, NULL, NULL} +}; + static int rtsx_dma_alloc(struct rtsx_softc *sc); static void rtsx_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void rtsx_dma_free(struct rtsx_softc *sc); @@ -601,7 +614,7 @@ rtsx_handle_card_present(struct rtsx_softc *sc) #ifdef MMCCAM was_present = sc->rtsx_cam_status; -#else +#else /* !MMCCAM */ was_present = sc->rtsx_mmc_dev != NULL; #endif /* MMCCAM */ is_present = rtsx_is_card_present(sc); @@ -640,7 +653,7 @@ rtsx_card_task(void *arg, int pending __unused) if (sc->rtsx_cam_status == 0) { union ccb *ccb; uint32_t pathid; -#else +#else /* !MMCCAM */ if (sc->rtsx_mmc_dev == NULL) { #endif /* MMCCAM */ if (bootverbose) @@ -669,7 +682,7 @@ rtsx_card_task(void *arg, int pending __unused) } RTSX_UNLOCK(sc); xpt_rescan(ccb); -#else +#else /* !MMCCAM */ sc->rtsx_mmc_dev = device_add_child(sc->rtsx_dev, "mmc", -1); RTSX_UNLOCK(sc); if (sc->rtsx_mmc_dev == NULL) { @@ -688,7 +701,7 @@ rtsx_card_task(void *arg, int pending __unused) if (sc->rtsx_cam_status != 0) { union ccb *ccb; uint32_t pathid; -#else +#else /* !MMCCAM */ if (sc->rtsx_mmc_dev != NULL) { #endif /* MMCCAM */ if (bootverbose) @@ -719,7 +732,7 @@ rtsx_card_task(void *arg, int pending __unused) } RTSX_UNLOCK(sc); xpt_rescan(ccb); -#else +#else /* !MMCCAM */ RTSX_UNLOCK(sc); if (device_delete_child(sc->rtsx_dev, sc->rtsx_mmc_dev)) device_printf(sc->rtsx_dev, "Detaching MMC bus failed\n"); @@ -984,7 +997,7 @@ rtsx_init(struct rtsx_softc *sc) RTSX_PHY_REV_CLKREQ_DT_1_0 | RTSX_PHY_REV_STOP_CLKRD | RTSX_PHY_REV_STOP_CLKWR))) return (error); - DELAY(10); + DELAY(1000); if ((error = rtsx_write_phy(sc, RTSX_PHY_BPCR, RTSX_PHY_BPCR_IBRXSEL | RTSX_PHY_BPCR_IBTXSEL | RTSX_PHY_BPCR_IB_FILTER | RTSX_PHY_BPCR_CMIRROR_EN))) @@ -1604,7 +1617,7 @@ rtsx_bus_power_on(struct rtsx_softc *sc) RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PARTIAL_PWR_ON); RTSX_BITOP(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_PWR_MASK, RTSX_LDO3318_VCC1); - DELAY(200); + DELAY(20000); /* Full power. */ RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PWR_ON); @@ -1632,7 +1645,7 @@ rtsx_bus_power_on(struct rtsx_softc *sc) RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PARTIAL_PWR_ON); RTSX_BITOP(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_PWR_MASK, RTSX_LDO3318_VCC1); - DELAY(200); + DELAY(5000); /* Full power. */ RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PWR_ON); @@ -1983,7 +1996,7 @@ rtsx_sd_tuning_rx_cmd_wait(struct rtsx_softc *sc, struct mmc_command *cmd) status = sc->rtsx_intr_status & mask; while (status == 0) { - if (msleep(&sc->rtsx_intr_status, &sc->rtsx_mtx, 0, "rtsxintr", sc->rtsx_timeout) == EWOULDBLOCK) { + if (msleep(&sc->rtsx_intr_status, &sc->rtsx_mtx, 0, "rtsxintr", sc->rtsx_timeout_cmd) == EWOULDBLOCK) { cmd->error = MMC_ERR_TIMEOUT; return (MMC_ERR_TIMEOUT); } @@ -2254,7 +2267,7 @@ rtsx_req_done(struct rtsx_softc *sc) sc->rtsx_ccb = NULL; ccb->ccb_h.status = (req->cmd->error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); xpt_done(ccb); -#else +#else /* !MMCCAM */ req->done(req); #endif /* MMCCAM */ } @@ -2899,6 +2912,7 @@ rtsx_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_GET_TRAN_SETTINGS: case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -2923,6 +2937,7 @@ rtsx_cam_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_SET_TRAN_SETTINGS: case XPT_SET_TRAN_SETTINGS: if (bootverbose || sc->rtsx_debug) device_printf(sc->rtsx_dev, "rtsx_cam_action() - got XPT_SET_TRAN_SETTINGS\n"); @@ -3022,7 +3037,7 @@ rtsx_cam_set_tran_settings(struct rtsx_softc *sc, union ccb *ccb) if (bootverbose || sc->rtsx_debug) device_printf(sc->rtsx_dev, "rtsx_cam_set_tran_settings() - vccq: %d\n", ios->vccq); } -#endif +#endif /* __FreeBSD__ > 12 */ if (rtsx_mmcbr_update_ios(sc->rtsx_dev, NULL) == 0) ccb->ccb_h.status = CAM_REQ_CMP; else @@ -3426,6 +3441,7 @@ rtsx_mmcbr_request(device_t bus, device_t child __unused, struct mmc_request *re { struct rtsx_softc *sc; struct mmc_command *cmd; + int timeout; int error; sc = device_get_softc(bus); @@ -3473,15 +3489,18 @@ rtsx_mmcbr_request(device_t bus, device_t child __unused, struct mmc_request *re if (cmd->data == NULL) { DELAY(200); + timeout = sc->rtsx_timeout_cmd; error = rtsx_send_req(sc, cmd); } else if (cmd->data->len <= 512) { + timeout = sc->rtsx_timeout_io; error = rtsx_xfer_short(sc, cmd); } else { + timeout = sc->rtsx_timeout_io; error = rtsx_xfer(sc, cmd); } end: if (error == MMC_ERR_NONE) { - callout_reset(&sc->rtsx_timeout_callout, sc->rtsx_timeout * hz, rtsx_timeout, sc); + callout_reset(&sc->rtsx_timeout_callout, timeout * hz, rtsx_timeout, sc); } else { rtsx_req_done(sc); } @@ -3587,6 +3606,10 @@ rtsx_attach(device_t dev) int msi_count = 1; uint32_t sdio_cfg; int error; + char *maker; + char *family; + char *product; + int i; if (bootverbose) device_printf(dev, "Attach - Vendor ID: 0x%x - Device ID: 0x%x\n", @@ -3594,32 +3617,53 @@ rtsx_attach(device_t dev) sc->rtsx_dev = dev; sc->rtsx_req = NULL; - sc->rtsx_timeout = 10; + sc->rtsx_timeout_cmd = 1; + sc->rtsx_timeout_io = 10; sc->rtsx_read_only = 0; + sc->rtsx_inversion = 0; sc->rtsx_force_timing = 0; sc->rtsx_debug = 0; sc->rtsx_read_count = 0; sc->rtsx_write_count = 0; + maker = kern_getenv("smbios.system.maker"); + family = kern_getenv("smbios.system.family"); + product = kern_getenv("smbios.system.product"); + for (i = 0; rtsx_inversion_models[i].maker != NULL; i++) { + if (strcmp(rtsx_inversion_models[i].maker, maker) == 0 && + strcmp(rtsx_inversion_models[i].family, family) == 0 && + strcmp(rtsx_inversion_models[i].product, product) == 0) { + device_printf(dev, "Inversion activated for %s/%s/%s, see BUG in rtsx(4)\n", maker, family, product); + device_printf(dev, "If a card is detected without an SD card present," + " add dev.rtsx.0.inversion=0 in loader.conf(5)\n"); + sc->rtsx_inversion = 1; + } + } + RTSX_LOCK_INIT(sc); ctx = device_get_sysctl_ctx(dev); tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "req_timeout", CTLFLAG_RW, - &sc->rtsx_timeout, 0, "Request timeout in seconds"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "timeout_io", CTLFLAG_RW, + &sc->rtsx_timeout_io, 0, "Request timeout for I/O commands in seconds"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "timeout_cmd", CTLFLAG_RW, + &sc->rtsx_timeout_cmd, 0, "Request timeout for setup commands in seconds"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "read_only", CTLFLAG_RD, &sc->rtsx_read_only, 0, "Card is write protected"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "inversion", CTLFLAG_RWTUN, &sc->rtsx_inversion, 0, "Inversion of card detection and read only status"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "force_timing", CTLFLAG_RW, &sc->rtsx_force_timing, 0, "Force bus_timing_uhs_sdr50"); - SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "debug", CTLFLAG_RW, + SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->rtsx_debug, 0, "Debugging flag"); SYSCTL_ADD_U64(ctx, tree, OID_AUTO, "read_count", CTLFLAG_RD, &sc->rtsx_read_count, 0, "Count of read operations"); SYSCTL_ADD_U64(ctx, tree, OID_AUTO, "write_count", CTLFLAG_RD, &sc->rtsx_write_count, 0, "Count of write operations"); + if (bootverbose || sc->rtsx_debug) + device_printf(dev, "We are running with inversion: %d\n", sc->rtsx_inversion); + /* Allocate IRQ. */ sc->rtsx_irq_res_id = 0; if (pci_alloc_msi(dev, &msi_count) == 0) @@ -3652,6 +3696,15 @@ rtsx_attach(device_t dev) sc->rtsx_btag = rman_get_bustag(sc->rtsx_res); sc->rtsx_bhandle = rman_get_bushandle(sc->rtsx_res); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->rtsx_card_insert_task, 0, + rtsx_card_task, sc); + TASK_INIT(&sc->rtsx_card_remove_task, 0, rtsx_card_task, sc); + + /* Allocate two DMA buffers: a command buffer and a data buffer. */ + error = rtsx_dma_alloc(sc); + if (error) + goto destroy_rtsx_irq_res; + /* Activate the interrupt. */ error = bus_setup_intr(dev, sc->rtsx_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, rtsx_intr, sc, &sc->rtsx_irq_cookie); @@ -3667,17 +3720,6 @@ rtsx_attach(device_t dev) sc->rtsx_flags |= RTSX_F_SDIO_SUPPORT; } - /* Allocate two DMA buffers: a command buffer and a data buffer. */ - error = rtsx_dma_alloc(sc); - if (error) { - goto destroy_rtsx_irq; - } - - /* From dwmmc.c. */ - TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->rtsx_card_insert_task, 0, - rtsx_card_task, sc); - TASK_INIT(&sc->rtsx_card_remove_task, 0, rtsx_card_task, sc); - #ifdef MMCCAM sc->rtsx_ccb = NULL; sc->rtsx_cam_status = 0; @@ -3713,13 +3755,16 @@ rtsx_attach(device_t dev) /* * Schedule a card detection as we won't get an interrupt - * if the card is inserted when we attach + * if the card is inserted when we attach. We wait a quarter + * of a second to allow for a "spontaneous" interrupt which may + * change the card presence state. This delay avoid a panic + * on some configuration (e.g. Lenovo T540p). */ - DELAY(500); + DELAY(250000); if (rtsx_is_card_present(sc)) - device_printf(sc->rtsx_dev, "Card present\n"); + device_printf(sc->rtsx_dev, "A card is detected\n"); else - device_printf(sc->rtsx_dev, "Card absent\n"); + device_printf(sc->rtsx_dev, "No card is detected\n"); rtsx_card_task(sc, 0); if (bootverbose) @@ -3732,6 +3777,7 @@ rtsx_attach(device_t dev) destroy_rtsx_res: bus_release_resource(dev, SYS_RES_MEMORY, sc->rtsx_res_id, sc->rtsx_res); + rtsx_dma_free(sc); destroy_rtsx_irq_res: callout_drain(&sc->rtsx_timeout_callout); bus_release_resource(dev, SYS_RES_IRQ, sc->rtsx_irq_res_id, @@ -3833,7 +3879,7 @@ rtsx_suspend(device_t dev) device_printf(dev, "Request in progress: CMD%u, rtsr_intr_status: 0x%08x\n", sc->rtsx_ccb->mmcio.cmd.opcode, sc->rtsx_intr_status); } -#else +#else /* !MMCCAM */ if (sc->rtsx_req != NULL) { device_printf(dev, "Request in progress: CMD%u, rtsr_intr_status: 0x%08x\n", sc->rtsx_req->cmd->opcode, sc->rtsx_intr_status); From owner-dev-commits-src-main@freebsd.org Thu Sep 9 21:41:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32F0F67772C; Thu, 9 Sep 2021 21:41:42 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5CBZ10V0z3G8l; Thu, 9 Sep 2021 21:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028BD21187; Thu, 9 Sep 2021 21:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189LffMC016216; Thu, 9 Sep 2021 21:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189Lffnv016215; Thu, 9 Sep 2021 21:41:41 GMT (envelope-from git) Date: Thu, 9 Sep 2021 21:41:41 GMT Message-Id: <202109092141.189Lffnv016215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: bedf31ad7e15 - main - psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 21:41:42 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa commit bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:37:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-09 21:37:40 +0000 psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. r123442 introduced solution for clamping of PS/2 mice jitter when using a KVM. Solution is to buffer mouse packets for 0.050ms if mouse activity has not been seen for more than 0.5 seconds. Then flush that data to driver if no validation errors found or drop the entire queue otherwise. While it works well with relative devices it has issues with absolute ones Depending on history buffering may results in delaying of the touch front edge for 0.050ms that affects gesture processing (tap detection). As absolute touchpads usually are built-in devices we can safely disable bufferization and KVM jitter clamping to avoid such a delays. MFC after: 2 weeks --- sys/dev/atkbdc/psm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f27a49f82a71..9b47a7a6b0c5 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -3134,8 +3134,12 @@ next: /* * If we've filled the queue then call the softintr ourselves, * otherwise schedule the interrupt for later. + * Do not postpone interrupts for absolute devices as it + * affects tap detection timings. */ - if (!timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || + if (sc->hw.model == MOUSE_MODEL_SYNAPTICS || + sc->hw.model == MOUSE_MODEL_ELANTECH || + !timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || (sc->pqueue_end == sc->pqueue_start)) { if ((sc->state & PSM_SOFTARMED) != 0) { sc->state &= ~PSM_SOFTARMED; From owner-dev-commits-src-main@freebsd.org Thu Sep 9 21:41:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E279677BAE; Thu, 9 Sep 2021 21:41:43 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5CBb1tJFz3GH4; Thu, 9 Sep 2021 21:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D00120DA3; Thu, 9 Sep 2021 21:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189Lfhd2016240; Thu, 9 Sep 2021 21:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189LfhGL016239; Thu, 9 Sep 2021 21:41:43 GMT (envelope-from git) Date: Thu, 9 Sep 2021 21:41:43 GMT Message-Id: <202109092141.189LfhGL016239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3ef9023f935f - main - hkbd(4): Reduce diff with ukbd(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ef9023f935ff721f72ed44cf26911b9af72dba1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 21:41:43 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3ef9023f935ff721f72ed44cf26911b9af72dba1 commit 3ef9023f935ff721f72ed44cf26911b9af72dba1 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:39:05 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-09 21:39:05 +0000 hkbd(4): Reduce diff with ukbd(4) MFC after: 2 weeks --- sys/dev/hid/hkbd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 55eba6d321ea..729602b12f3a 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -657,7 +657,6 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) uint32_t i; uint8_t id = 0; uint8_t modifiers; - int offset; HKBD_LOCK_ASSERT(sc); @@ -709,13 +708,15 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } else if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { - offset = sc->sc_loc_key[0].count; - if (offset < 0 || offset > len) - offset = len; - while (offset--) { + struct hid_location tmp_loc = sc->sc_loc_key[0]; + /* range check array size */ + if (tmp_loc.count > HKBD_NKEYCODE) + tmp_loc.count = HKBD_NKEYCODE; + while (tmp_loc.count--) { uint32_t key = - hid_get_data(buf + offset, len - offset, - &sc->sc_loc_key[i]); + hid_get_udata(buf, len, &tmp_loc); + /* advance to next location */ + tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); sc->sc_ndata = sc->sc_odata; From owner-dev-commits-src-main@freebsd.org Thu Sep 9 21:41:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85CCD677BB5; Thu, 9 Sep 2021 21:41:44 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5CBc3BV2z3GPP; Thu, 9 Sep 2021 21:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49D8C20D34; Thu, 9 Sep 2021 21:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189LfiQj016264; Thu, 9 Sep 2021 21:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189LfidC016263; Thu, 9 Sep 2021 21:41:44 GMT (envelope-from git) Date: Thu, 9 Sep 2021 21:41:44 GMT Message-Id: <202109092141.189LfidC016263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 04918395f18d - main - hkbd(4): Use bitstring(3) KPI for key bitmaps processing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04918395f18dfb115dc0fe2865780dc607c5dc71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 21:41:44 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=04918395f18dfb115dc0fe2865780dc607c5dc71 commit 04918395f18dfb115dc0fe2865780dc607c5dc71 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:39:46 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-09 21:39:46 +0000 hkbd(4): Use bitstring(3) KPI for key bitmaps processing. No functional changes intended. MFC after: 2 weeks --- sys/dev/hid/hkbd.c | 160 ++++++++++++++++++++--------------------------------- 1 file changed, 61 insertions(+), 99 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 729602b12f3a..65e8b9446e9d 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -116,7 +117,7 @@ SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, #define HKBD_BUFFER_SIZE 64 /* bytes */ #define HKBD_KEY_PRESSED(map, key) ({ \ CTASSERT((key) >= 0 && (key) < HKBD_NKEYCODE); \ - ((map)[(key) / 64] & (1ULL << ((key) % 64))); \ + bit_test(map, key); \ }) #define MOD_EJECT 0x01 @@ -125,10 +126,6 @@ SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, #define MOD_MIN 0xe0 #define MOD_MAX 0xe7 -struct hkbd_data { - uint64_t bitmap[howmany(HKBD_NKEYCODE, 64)]; -}; - struct hkbd_softc { device_t sc_dev; @@ -136,7 +133,7 @@ struct hkbd_softc { keymap_t sc_keymap; accentmap_t sc_accmap; fkeytab_t sc_fkeymap[HKBD_NFKEY]; - uint64_t sc_loc_key_valid[howmany(HKBD_NKEYCODE, 64)]; + bitstr_t bit_decl(sc_loc_key_valid, HKBD_NKEYCODE); struct hid_location sc_loc_apple_eject; struct hid_location sc_loc_apple_fn; struct hid_location sc_loc_key[HKBD_NKEYCODE]; @@ -146,8 +143,8 @@ struct hkbd_softc { struct mtx sc_mtx; struct task sc_task; struct callout sc_callout; - struct hkbd_data sc_ndata; - struct hkbd_data sc_odata; + bitstr_t bit_decl(sc_ndata, HKBD_NKEYCODE); + bitstr_t bit_decl(sc_odata, HKBD_NKEYCODE); struct thread *sc_poll_thread; #ifdef EVDEV_SUPPORT @@ -328,23 +325,19 @@ static const struct evdev_methods hkbd_evdev_methods = { static bool hkbd_any_key_pressed(struct hkbd_softc *sc) { - bool ret = false; - unsigned i; + int result; - for (i = 0; i != howmany(HKBD_NKEYCODE, 64); i++) - ret |= (sc->sc_odata.bitmap[i] != 0); - return (ret); + bit_ffs(sc->sc_odata, HKBD_NKEYCODE, &result); + return (result != -1); } static bool hkbd_any_key_valid(struct hkbd_softc *sc) { - bool ret = false; - unsigned i; + int result; - for (i = 0; i != howmany(HKBD_NKEYCODE, 64); i++) - ret |= (sc->sc_loc_key_valid[i] != 0); - return (ret); + bit_ffs(sc->sc_loc_key_valid, HKBD_NKEYCODE, &result); + return (result != -1); } static bool @@ -487,65 +480,47 @@ hkbd_interrupt(struct hkbd_softc *sc) HKBD_LOCK_ASSERT(sc); - /* Check for key changes, the order is: - * 1. Modifier keys down - * 2. Regular keys up/down - * 3. Modifier keys up + /* + * Check for key changes, the order is: + * 1. Regular keys up + * 2. Modifier keys up + * 3. Modifier keys down + * 4. Regular keys down * * This allows devices which send events changing the state of * both a modifier key and a regular key, to be correctly * translated. */ - for (key = MOD_MIN; key <= MOD_MAX; key++) { - const uint64_t mask = 1ULL << (key % 64); + bit_foreach(sc->sc_odata, HKBD_NKEYCODE, key) { + if (hkbd_is_modifier_key(key) || bit_test(sc->sc_ndata, key)) + continue; + hkbd_put_key(sc, key | KEY_RELEASE); - if (!(sc->sc_odata.bitmap[key / 64] & mask) && - (sc->sc_ndata.bitmap[key / 64] & mask)) { - hkbd_put_key(sc, key | KEY_PRESS); - } + /* clear repeating key, if any */ + if (sc->sc_repeat_key == key) + sc->sc_repeat_key = 0; } - for (key = 0; key != HKBD_NKEYCODE; key++) { - const uint64_t mask = 1ULL << (key % 64); - const uint64_t delta = - sc->sc_odata.bitmap[key / 64] ^ - sc->sc_ndata.bitmap[key / 64]; - - if (hkbd_is_modifier_key(key)) + bit_foreach_at(sc->sc_odata, MOD_MIN, MOD_MAX + 1, key) + if (!bit_test(sc->sc_ndata, key)) + hkbd_put_key(sc, key | KEY_RELEASE); + bit_foreach_at(sc->sc_ndata, MOD_MIN, MOD_MAX + 1, key) + if (!bit_test(sc->sc_odata, key)) + hkbd_put_key(sc, key | KEY_PRESS); + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, key) { + if (hkbd_is_modifier_key(key) || bit_test(sc->sc_odata, key)) continue; + hkbd_put_key(sc, key | KEY_PRESS); - if (mask == 1 && delta == 0) { - key += 63; - continue; /* skip empty areas */ - } else if (delta & mask) { - if (sc->sc_odata.bitmap[key / 64] & mask) { - hkbd_put_key(sc, key | KEY_RELEASE); - - /* clear repeating key, if any */ - if (sc->sc_repeat_key == key) - sc->sc_repeat_key = 0; - } else { - hkbd_put_key(sc, key | KEY_PRESS); - - sc->sc_co_basetime = sbinuptime(); - sc->sc_delay = sc->sc_kbd.kb_delay1; - hkbd_start_timer(sc); - - /* set repeat time for last key */ - sc->sc_repeat_time = now + sc->sc_kbd.kb_delay1; - sc->sc_repeat_key = key; - } - } - } - for (key = MOD_MIN; key <= MOD_MAX; key++) { - const uint64_t mask = 1ULL << (key % 64); + sc->sc_co_basetime = sbinuptime(); + sc->sc_delay = sc->sc_kbd.kb_delay1; + hkbd_start_timer(sc); - if ((sc->sc_odata.bitmap[key / 64] & mask) && - !(sc->sc_ndata.bitmap[key / 64] & mask)) { - hkbd_put_key(sc, key | KEY_RELEASE); - } + /* set repeat time for last key */ + sc->sc_repeat_time = now + sc->sc_kbd.kb_delay1; + sc->sc_repeat_key = key; } /* synchronize old data with new data */ - sc->sc_odata = sc->sc_ndata; + memcpy(sc->sc_odata, sc->sc_ndata, bitstr_size(HKBD_NKEYCODE)); /* check if last key is still pressed */ if (sc->sc_repeat_key != 0) { @@ -679,7 +654,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } /* clear temporary storage */ - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); /* clear modifiers */ modifiers = 0; @@ -696,16 +671,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) modifiers |= MOD_FN; } - for (i = 0; i != HKBD_NKEYCODE; i++) { - const uint64_t valid = sc->sc_loc_key_valid[i / 64]; - const uint64_t mask = 1ULL << (i % 64); - - if (mask == 1 && valid == 0) { - i += 63; - continue; /* skip empty areas */ - } else if (~valid & mask) { - continue; /* location is not valid */ - } else if (id != sc->sc_id_loc_key[i]) { + bit_foreach(sc->sc_loc_key_valid, HKBD_NKEYCODE, i) { + if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { struct hid_location tmp_loc = sc->sc_loc_key[0]; @@ -719,7 +686,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); - sc->sc_ndata = sc->sc_odata; + memcpy(sc->sc_ndata, sc->sc_odata, + bitstr_size(HKBD_NKEYCODE)); return; /* ignore */ } if (modifiers & MOD_FN) @@ -729,7 +697,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) if (key == KEY_NONE || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ - sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); + bit_set(sc->sc_ndata, key); } } else if (hid_get_data(buf, len, &sc->sc_loc_key[i])) { uint32_t key = i; @@ -741,18 +709,13 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) if (key == KEY_NONE || key == KEY_ERROR || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ - sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); + bit_set(sc->sc_ndata, key); } } #ifdef HID_DEBUG DPRINTF("modifiers = 0x%04x\n", modifiers); - for (i = 0; i != HKBD_NKEYCODE; i++) { - const uint64_t valid = sc->sc_ndata.bitmap[i / 64]; - const uint64_t mask = 1ULL << (i % 64); - - if (valid & mask) - DPRINTF("Key 0x%02x pressed\n", i); - } + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, i) + DPRINTF("Key 0x%02x pressed\n", i); #endif hkbd_interrupt(sc); } @@ -795,7 +758,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, sc->sc_flags &= ~HKBD_FLAG_HID_MASK; /* reset detected keys */ - memset(sc->sc_loc_key_valid, 0, sizeof(sc->sc_loc_key_valid)); + memset(sc->sc_loc_key_valid, 0, bitstr_size(HKBD_NKEYCODE)); /* check if there is an ID byte */ sc->sc_kbd_size = hid_report_size_max(ptr, len, @@ -828,7 +791,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, if (flags & HIO_VARIABLE) { DPRINTFN(1, "Ignoring keyboard event control\n"); } else { - sc->sc_loc_key_valid[0] |= 1; + bit_set(sc->sc_loc_key_valid, 0); DPRINTFN(1, "Found keyboard event array\n"); } } @@ -840,8 +803,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, hid_input, tlc_index, 0, &sc->sc_loc_key[key], &flags, &sc->sc_id_loc_key[key], NULL)) { if (flags & HIO_VARIABLE) { - sc->sc_loc_key_valid[key / 64] |= - 1ULL << (key % 64); + bit_set(sc->sc_loc_key_valid, key); DPRINTFN(1, "Found key 0x%02x\n", key); } } @@ -1057,7 +1019,7 @@ hkbd_detach(device_t dev) hidbus_intr_stop(dev); /* release all leftover keys, if any */ - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); /* process releasing of all keys */ HKBD_LOCK(sc); @@ -1305,11 +1267,11 @@ hkbd_read(keyboard_t *kbd, int wait) ++(kbd->kb_count); #ifdef HKBD_EMULATE_ATSCANCODE - keycode = hkbd_atkeycode(usbcode, sc->sc_ndata.bitmap); + keycode = hkbd_atkeycode(usbcode, sc->sc_ndata); if (keycode == NN) { return -1; } - return (hkbd_key2scan(sc, keycode, sc->sc_ndata.bitmap, + return (hkbd_key2scan(sc, keycode, sc->sc_ndata, (usbcode & KEY_RELEASE))); #else /* !HKBD_EMULATE_ATSCANCODE */ return (usbcode); @@ -1375,13 +1337,13 @@ next_code: #ifdef HKBD_EMULATE_ATSCANCODE /* USB key index -> key code -> AT scan code */ - keycode = hkbd_atkeycode(usbcode, sc->sc_ndata.bitmap); + keycode = hkbd_atkeycode(usbcode, sc->sc_ndata); if (keycode == NN) { return (NOKEY); } /* return an AT scan code for the K_RAW mode */ if (sc->sc_mode == K_RAW) { - return (hkbd_key2scan(sc, keycode, sc->sc_ndata.bitmap, + return (hkbd_key2scan(sc, keycode, sc->sc_ndata, (usbcode & KEY_RELEASE))); } #else /* !HKBD_EMULATE_ATSCANCODE */ @@ -1720,8 +1682,8 @@ hkbd_clear_state(keyboard_t *kbd) sc->sc_buffered_char[0] = 0; sc->sc_buffered_char[1] = 0; #endif - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); - memset(&sc->sc_odata, 0, sizeof(sc->sc_odata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_odata, 0, bitstr_size(HKBD_NKEYCODE)); sc->sc_repeat_time = 0; sc->sc_repeat_key = 0; } @@ -1865,7 +1827,7 @@ hkbd_set_typematic(keyboard_t *kbd, int code) #ifdef HKBD_EMULATE_ATSCANCODE static uint32_t -hkbd_atkeycode(int usbcode, const uint64_t *bitmap) +hkbd_atkeycode(int usbcode, const bitstr_t *bitmap) { uint32_t keycode; @@ -1892,7 +1854,7 @@ hkbd_atkeycode(int usbcode, const uint64_t *bitmap) } static int -hkbd_key2scan(struct hkbd_softc *sc, int code, const uint64_t *bitmap, int up) +hkbd_key2scan(struct hkbd_softc *sc, int code, const bitstr_t *bitmap, int up) { static const int scan[] = { /* 89 */ From owner-dev-commits-src-main@freebsd.org Thu Sep 9 21:41:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7FD96773DF; Thu, 9 Sep 2021 21:41:45 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5CBd4CRCz3GPY; Thu, 9 Sep 2021 21:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ED1620D35; Thu, 9 Sep 2021 21:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189LfjsE016288; Thu, 9 Sep 2021 21:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189Lfj5O016287; Thu, 9 Sep 2021 21:41:45 GMT (envelope-from git) Date: Thu, 9 Sep 2021 21:41:45 GMT Message-Id: <202109092141.189Lfj5O016287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 598f0580f682 - main - hkbd(4): Fix key repeats on multireport keyboards MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 598f0580f6822e2492231d055f49465a5b55d270 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 21:41:46 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=598f0580f6822e2492231d055f49465a5b55d270 commit 598f0580f6822e2492231d055f49465a5b55d270 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:40:13 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-09 21:40:13 +0000 hkbd(4): Fix key repeats on multireport keyboards Currently hkbd counts all key states to be "Up" at the start of interrupt callback. That results in generation of "Key Up" event for each key that has been downed before but is not listed in current report while is still downed. Fix that with clearing of temporary key data storage bits only for keys contained in processed report. Reported by: Greg V Obtained from: sysutils/iichid MFC after: 2 weeks --- sys/dev/hid/hkbd.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 65e8b9446e9d..bfd8e12df746 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -143,8 +143,12 @@ struct hkbd_softc { struct mtx sc_mtx; struct task sc_task; struct callout sc_callout; + /* All reported keycodes */ bitstr_t bit_decl(sc_ndata, HKBD_NKEYCODE); bitstr_t bit_decl(sc_odata, HKBD_NKEYCODE); + /* Keycodes reported in array fields only */ + bitstr_t bit_decl(sc_ndata0, HKBD_NKEYCODE); + bitstr_t bit_decl(sc_odata0, HKBD_NKEYCODE); struct thread *sc_poll_thread; #ifdef EVDEV_SUPPORT @@ -520,6 +524,7 @@ hkbd_interrupt(struct hkbd_softc *sc) } /* synchronize old data with new data */ + memcpy(sc->sc_odata0, sc->sc_ndata0, bitstr_size(HKBD_NKEYCODE)); memcpy(sc->sc_odata, sc->sc_ndata, bitstr_size(HKBD_NKEYCODE)); /* check if last key is still pressed */ @@ -654,7 +659,14 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } /* clear temporary storage */ - memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); + if (bit_test(sc->sc_loc_key_valid, 0) && id == sc->sc_id_loc_key[0]) { + bit_foreach(sc->sc_ndata0, HKBD_NKEYCODE, i) + bit_clear(sc->sc_ndata, i); + memset(&sc->sc_ndata0, 0, bitstr_size(HKBD_NKEYCODE)); + } + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, i) + if (id == sc->sc_id_loc_key[i]) + bit_clear(sc->sc_ndata, i); /* clear modifiers */ modifiers = 0; @@ -686,6 +698,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); + memcpy(sc->sc_ndata0, sc->sc_odata0, + bitstr_size(HKBD_NKEYCODE)); memcpy(sc->sc_ndata, sc->sc_odata, bitstr_size(HKBD_NKEYCODE)); return; /* ignore */ @@ -698,6 +712,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) continue; /* set key in bitmap */ bit_set(sc->sc_ndata, key); + bit_set(sc->sc_ndata0, key); } } else if (hid_get_data(buf, len, &sc->sc_loc_key[i])) { uint32_t key = i; @@ -1684,6 +1699,8 @@ hkbd_clear_state(keyboard_t *kbd) #endif memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); memset(&sc->sc_odata, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_ndata0, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_odata0, 0, bitstr_size(HKBD_NKEYCODE)); sc->sc_repeat_time = 0; sc->sc_repeat_key = 0; } From owner-dev-commits-src-main@freebsd.org Thu Sep 9 22:52:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59DE56789B9; Thu, 9 Sep 2021 22:52:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5Dm61wVWz3rPF; Thu, 9 Sep 2021 22:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21E5821D79; Thu, 9 Sep 2021 22:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189MqM9F009663; Thu, 9 Sep 2021 22:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189MqMid009662; Thu, 9 Sep 2021 22:52:22 GMT (envelope-from git) Date: Thu, 9 Sep 2021 22:52:22 GMT Message-Id: <202109092252.189MqMid009662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 38d2e9314b12 - main - hkbd(4): Fix build on 32bit platforms MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38d2e9314b127b3466e8ae4120e21fe1ad076dfc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 22:52:22 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=38d2e9314b127b3466e8ae4120e21fe1ad076dfc commit 38d2e9314b127b3466e8ae4120e21fe1ad076dfc Author: Vladimir Kondratyev AuthorDate: 2021-09-09 22:49:26 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-09 22:51:25 +0000 hkbd(4): Fix build on 32bit platforms MFC after: 2 weeks --- sys/dev/hid/hkbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index bfd8e12df746..ad9b3dde3d37 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -301,8 +301,8 @@ static void hkbd_timeout(void *); static int hkbd_set_leds(struct hkbd_softc *, uint8_t); static int hkbd_set_typematic(keyboard_t *, int); #ifdef HKBD_EMULATE_ATSCANCODE -static uint32_t hkbd_atkeycode(int, const uint64_t *); -static int hkbd_key2scan(struct hkbd_softc *, int, const uint64_t *, int); +static uint32_t hkbd_atkeycode(int, const bitstr_t *); +static int hkbd_key2scan(struct hkbd_softc *, int, const bitstr_t *, int); #endif static uint32_t hkbd_read_char(keyboard_t *, int); static void hkbd_clear_state(keyboard_t *); From owner-dev-commits-src-main@freebsd.org Thu Sep 9 22:57:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7411A678D0D; Thu, 9 Sep 2021 22:57:49 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5DtP2cLnz3tML; Thu, 9 Sep 2021 22:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 396EC21F8D; Thu, 9 Sep 2021 22:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189MvnbH011020; Thu, 9 Sep 2021 22:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189MvnGF011019; Thu, 9 Sep 2021 22:57:49 GMT (envelope-from git) Date: Thu, 9 Sep 2021 22:57:49 GMT Message-Id: <202109092257.189MvnGF011019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guido Falsi Subject: git: f448c3ed4ae1 - main - openssh: Add new source files to libssl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f448c3ed4ae1281861913a56377f9d93d49f8e8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 22:57:49 -0000 The branch main has been updated by madpilot (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f448c3ed4ae1281861913a56377f9d93d49f8e8e commit f448c3ed4ae1281861913a56377f9d93d49f8e8e Author: Guido Falsi AuthorDate: 2021-09-09 22:56:24 +0000 Commit: Guido Falsi CommitDate: 2021-09-09 22:56:24 +0000 openssh: Add new source files to libssl Add some new OpenSSH v8.7p1 source files to the ones being used to build libssl to avoid missing symbols. PR: 258384 Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1") Approved by: kevans (src) --- secure/lib/libssh/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index b97bd7f2693f..95024efa192e 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -5,7 +5,8 @@ LIB= ssh PRIVATELIB= true SHLIB_MAJOR= 5 -SRCS= ssh_api.c ssherr.c sshbuf.c sshkey.c sshbuf-getput-basic.c \ +SRCS= ssh_api.c ssh-sk.c ssh-ecdsa-sk.c ssh-ed25519-sk.c ssherr.c \ + sshbuf.c sshkey.c sshbuf-getput-basic.c \ sshbuf-misc.c sshbuf-getput-crypto.c krl.c bitmap.c SRCS+= authfd.c authfile.c \ canohost.c channels.c cipher.c cipher-aes.c cipher-aesctr.c \ From owner-dev-commits-src-main@freebsd.org Thu Sep 9 23:19:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDCEB678BD6 for ; Thu, 9 Sep 2021 23:19:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5FMZ6l5Nz4TJ5 for ; Thu, 9 Sep 2021 23:19:38 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f52.google.com with SMTP id i23so930731wrb.2 for ; Thu, 09 Sep 2021 16:19:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=up5+k6OXNOua0WoeJDe5GpZ5xvPYuoEatkZbty/qdlE=; b=l3Y12CrIs1NxMLtttYZfIRCuhKmKlPjuSC++X9/5j9TfsbG7/sbpR2H8cDXSEtEHY+ +oDnLa30Umzo9LfS/HyAHshhtVHwoOelWKGCLi3jr0tM/UdcZ3FMMFs/S2a84hHRhdD8 l+W45Qzi5Ufy40UzaqE9jjMJiE9e0XcLTlkd09/N8OOnnUi6fH8DbE1aXJFK/pzDaom/ cKnZRvyLLtWlg0/FlO24Z8V4vF2BWnRaemXTwwUw0Es8/njaJg1FjI3r3+V5jO2TnrNo 1Tq5rGUqSlNvX0i5ri/LPcAynX92hEv9syz9ImCcItUYjmhPReYwVP3ajm+0PB3v3fOR Rbpw== X-Gm-Message-State: AOAM533xYFbqBtlcUpJGTz9pXJN7eHCoI3v7pVWwvPeCXlkgWMjHuDwU 56+8a4Ph9TJLrtj68Gm8luuNVg== X-Google-Smtp-Source: ABdhPJy44DPAFt+ZJB78C4R/IivB1MTiKaAWyVmUecQjCoeOQ1bhIpilYs50rb3PBl+JkRMrlytIZQ== X-Received: by 2002:adf:9f4d:: with SMTP id f13mr6357041wrg.169.1631229571954; Thu, 09 Sep 2021 16:19:31 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id l3sm610073wms.4.2021.09.09.16.19.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Sep 2021 16:19:31 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 49ad342cc10c - main - Add _Fork() From: Jessica Clarke In-Reply-To: <202108031819.173IJgPB060470@gitrepo.freebsd.org> Date: Fri, 10 Sep 2021 00:19:30 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <42166E5E-A749-4FC7-A834-8A35D58706EF@freebsd.org> References: <202108031819.173IJgPB060470@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H5FMZ6l5Nz4TJ5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.52:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.52:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 23:19:39 -0000 On 3 Aug 2021, at 19:19, Konstantin Belousov wrote: >=20 > The branch main has been updated by kib: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D49ad342cc10cba14b3a40ba26cf8bb21= 50e2925a >=20 > commit 49ad342cc10cba14b3a40ba26cf8bb2150e2925a > Author: Konstantin Belousov > AuthorDate: 2021-08-02 09:50:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-08-03 18:19:32 +0000 >=20 > Add _Fork() >=20 > Current POSIX standard requires fork() to be async-signal safe. = Neither > our implementation, nor implementations in other operating systems = are, > and practically it is impossible to make fork() async-signal safe = without > too much efforts. Also, that would put undue requirement that all = atfork > handlers should be async-signal safe as well, which contradicts its = main > use. >=20 > As result, Austin Group dropped the requirement, and added a new = function > _Fork() that should be async-signal safe, but it does not call = atfork > handlers. Basically, _Fork() can be implemented as a raw syscall. >=20 > Release of glibc 2.34 added _Fork(), do the same for FreeBSD. > Clarify threading behavior for fork() in the manpage. >=20 > Reviewed by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D31378 This breaks the build on case-insensitive filesystems like macOS has, since _Fork.o for this C file and _fork.o for __sys_fork and _fork conflict, leading to either build failures (because _fork.o gets replaced and __sys_fork is undefined) or silently not including _Fork (because _Fork.o gets replaced) in the library, with it being non-deterministic based on whichever order the files happen to be built in, and potentially varying between the three different libraries as the .o, .pico and .nossppico files are independent. Jess From owner-dev-commits-src-main@freebsd.org Thu Sep 9 23:21:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E38D3678CED; Thu, 9 Sep 2021 23:21:19 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5FPW60Chz4TPF; Thu, 9 Sep 2021 23:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE1A2223EA; Thu, 9 Sep 2021 23:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189NLJKD047358; Thu, 9 Sep 2021 23:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189NLJZq047357; Thu, 9 Sep 2021 23:21:19 GMT (envelope-from git) Date: Thu, 9 Sep 2021 23:21:19 GMT Message-Id: <202109092321.189NLJZq047357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d780a23a9947 - main - tabs: a hacky version of tabs appeared in 1st edition Unix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d780a23a9947039c997e785105160c78db1d134c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 23:21:20 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d780a23a9947039c997e785105160c78db1d134c commit d780a23a9947039c997e785105160c78db1d134c Author: Warner Losh AuthorDate: 2021-09-09 23:11:18 +0000 Commit: Warner Losh CommitDate: 2021-09-09 23:11:18 +0000 tabs: a hacky version of tabs appeared in 1st edition Unix First edition Unix had an /etc/tabs file. It contained the escape sequences to set tabs to every 8 stops on an old Teletype Model 37 and compatible terminals. One would 'cat /etc/tabs' to reset them. Unix at the time effectively mandated this because the delays in the tty driver assumed this and tabs didn't work when they were too different from '8'. Document this historical niggle in HISTORY after it was brought to my attention on a Hacker News thread. Sponsored by: Netflix --- usr.bin/tabs/tabs.1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.bin/tabs/tabs.1 b/usr.bin/tabs/tabs.1 index 9075de5fa7ff..614c8c96cb13 100644 --- a/usr.bin/tabs/tabs.1 +++ b/usr.bin/tabs/tabs.1 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd September 9, 2021 .Dt TABS 1 .Os .Sh NAME @@ -147,9 +147,14 @@ The utility conforms to .St -p1003.1-2001 . .Sh HISTORY +.Pa /etc/tabs +appeared in +.At v1 +which set tabs every 8 on Teletype model 37 and compatible printing terminals +when printed. A .Nm -utility appeared in PWB UNIX. +utility that worked on many terminals appeared in PWB UNIX. This implementation was introduced in .Fx 5.0 . .Sh BUGS From owner-dev-commits-src-main@freebsd.org Fri Sep 10 00:02:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15F016793E8; Fri, 10 Sep 2021 00:02:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5GJy74Z4z4jbD; Fri, 10 Sep 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D442B2286A; Fri, 10 Sep 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18A02QOC004257; Fri, 10 Sep 2021 00:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18A02Q91004256; Fri, 10 Sep 2021 00:02:26 GMT (envelope-from git) Date: Fri, 10 Sep 2021 00:02:26 GMT Message-Id: <202109100002.18A02Q91004256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: cd165c8bf054 - main - x86/tsc.c: Add TSLOG to test_tsc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd165c8bf05452d38ce552ae819d87378fecf52f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 00:02:27 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cd165c8bf05452d38ce552ae819d87378fecf52f commit cd165c8bf05452d38ce552ae819d87378fecf52f Author: Colin Percival AuthorDate: 2021-09-10 00:01:00 +0000 Commit: Colin Percival CommitDate: 2021-09-10 00:02:15 +0000 x86/tsc.c: Add TSLOG to test_tsc On my benchmark system this takes ~ 14 ms; enough to be worth recording in the boot time profile. --- sys/x86/x86/tsc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 0ebcea895cd3..15e6037c68ee 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -511,6 +511,7 @@ test_tsc(int adj_max_count) if (vm_guest == VM_GUEST_VBOX) return (0); + TSENTER(); size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); adj = 0; @@ -531,6 +532,7 @@ retry: printf("SMP: %sed TSC synchronization test%s\n", smp_tsc ? "pass" : "fail", adj > 0 ? " after adjustment" : ""); + TSEXIT(); if (smp_tsc && tsc_is_invariant) { switch (cpu_vendor_id) { case CPU_VENDOR_AMD: From owner-dev-commits-src-main@freebsd.org Fri Sep 10 00:16:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC85E679C70; Fri, 10 Sep 2021 00:16:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5Gdl5tj0z4mQr; Fri, 10 Sep 2021 00:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9D3322D43; Fri, 10 Sep 2021 00:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18A0Gx6D017683; Fri, 10 Sep 2021 00:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18A0GxiJ017682; Fri, 10 Sep 2021 00:16:59 GMT (envelope-from git) Date: Fri, 10 Sep 2021 00:16:59 GMT Message-Id: <202109100016.18A0GxiJ017682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1f290c707a19 - main - openssh: regen config.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f290c707a19d1695c303e6c8ead9cc414ccc6dc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 00:16:59 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1f290c707a19d1695c303e6c8ead9cc414ccc6dc commit 1f290c707a19d1695c303e6c8ead9cc414ccc6dc Author: Ed Maste AuthorDate: 2021-09-09 23:04:10 +0000 Commit: Ed Maste CommitDate: 2021-09-10 00:16:14 +0000 openssh: regen config.h Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1") Reported by: O. Hartmann Sponsored by: The FreeBSD Foundation --- crypto/openssh/config.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 43ec7ab6b3fe..966e2679bd17 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -857,7 +857,7 @@ /* #undef HAVE_LIBCRYPT */ /* Define to 1 if you have the `dl' library (-ldl). */ -/* #undef HAVE_LIBDL */ +#define HAVE_LIBDL 1 /* Define to 1 if you have the header file. */ #define HAVE_LIBGEN_H 1 @@ -869,7 +869,7 @@ /* #undef HAVE_LIBNETWORK */ /* Define to 1 if you have the `pam' library (-lpam). */ -/* #undef HAVE_LIBPAM */ +#define HAVE_LIBPAM 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBPROC_H */ @@ -1033,13 +1033,13 @@ /* #undef HAVE_OSF_SIA */ /* Define to 1 if you have the `pam_getenvlist' function. */ -/* #undef HAVE_PAM_GETENVLIST */ +#define HAVE_PAM_GETENVLIST 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PAM_PAM_APPL_H */ /* Define to 1 if you have the `pam_putenv' function. */ -/* #undef HAVE_PAM_PUTENV */ +#define HAVE_PAM_PUTENV 1 /* Define to 1 if you have the header file. */ #define HAVE_PATHS_H 1 @@ -1970,16 +1970,16 @@ /* #undef USE_BTMP */ /* Use libedit for sftp */ -/* #undef USE_LIBEDIT */ +#define USE_LIBEDIT 1 /* Use Linux audit module */ /* #undef USE_LINUX_AUDIT */ /* Enable OpenSSL engine support */ -/* #undef USE_OPENSSL_ENGINE */ +#define USE_OPENSSL_ENGINE 1 /* Define if you want to enable PAM support */ -/* #undef USE_PAM */ +#define USE_PAM 1 /* Use PIPES instead of a socketpair() */ /* #undef USE_PIPES */ From owner-dev-commits-src-main@freebsd.org Fri Sep 10 00:19:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52DB36798FE; Fri, 10 Sep 2021 00:19:45 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5Ghx1sR6z4nGt; Fri, 10 Sep 2021 00:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DFA622D44; Fri, 10 Sep 2021 00:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18A0Jjbl017979; Fri, 10 Sep 2021 00:19:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18A0JjTb017978; Fri, 10 Sep 2021 00:19:45 GMT (envelope-from git) Date: Fri, 10 Sep 2021 00:19:45 GMT Message-Id: <202109100019.18A0JjTb017978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 877175a17a0a - main - libc: Fix build on case-insensitive file systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 877175a17a0a5da3f4f43ca9f38adb04042f4cf5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 00:19:45 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=877175a17a0a5da3f4f43ca9f38adb04042f4cf5 commit 877175a17a0a5da3f4f43ca9f38adb04042f4cf5 Author: Jessica Clarke AuthorDate: 2021-09-10 00:19:38 +0000 Commit: Jessica Clarke CommitDate: 2021-09-10 00:19:38 +0000 libc: Fix build on case-insensitive file systems On case-insensitive file systems (most likely to be seen on macOS, where it is the default), _Fork.o for the new POSIX _Fork function conflicts with _fork.o for the PSEUDO file. This results in non-determinsitic behaviour in terms of which ends up being present; if _Fork.o wins then the build fails to link libc.so due to missing __sys_fork, and if _fork.o wins then libc silently fails to include the implementation of _Fork. A similar issue occurred in the past for C99's _Exit conflicting with exit(2) and was fixed in cb1cb6a2a83f, so this adds a fix based on that. As a longer-term solution it might be better to instead make the generated files use a different prefix that's less likely to conflict with other things (such as __sys_foo.o given they always contain that) but that's a rather more invasive change. Fixes: 49ad342cc10c ("Add _Fork()") Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31895 --- lib/libc/sys/Makefile.inc | 2 +- lib/libc/sys/{_Fork.c => POSIX2x_Fork.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 29e914872a8d..58ba333080b7 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -49,7 +49,7 @@ SRCS+= closefrom.c SRCS+= pipe.c SRCS+= shm_open.c SRCS+= vadvise.c -SRCS+= _Fork.c +SRCS+= POSIX2x_Fork.c SRCS+= compat-stub.c diff --git a/lib/libc/sys/_Fork.c b/lib/libc/sys/POSIX2x_Fork.c similarity index 100% rename from lib/libc/sys/_Fork.c rename to lib/libc/sys/POSIX2x_Fork.c From owner-dev-commits-src-main@freebsd.org Fri Sep 10 00:30:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85F9C67A127; Fri, 10 Sep 2021 00:30:49 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5Gxh4HGJz4qMq; Fri, 10 Sep 2021 00:30:48 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f44.google.com with SMTP id a22so170275iok.12; Thu, 09 Sep 2021 17:30:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=/Frvdwydfmja1dDN9W880s8QbrCiLfqdzgV9nVolqqw=; b=5t7N7UGuB/xO7A0ZnyA39uKay9iQaKDSljNRK8ikWJUSbOf06aqKj/IZt+Ry/uxpNN QrV6+25wfVUSe+KRxrCDHqdugb9wLspO5S8apwnx6+nzFaxXt0/V+tiXDibR+v0FQkAS a3OmxcdoThiGODnKmcY3VdiQBACVu5bqkwYbScVfpEYqnetuPZ+p1tSZ9pMAzNtc9SwQ IcJKqNdKQSCTcRHtChdyH6HAX6mhBfgXQo4DJ4FsHjRW9eGvwtH8lJQ2T9CV8iN8xjxK dhSNc10CNp6fDV6arglfTPBFiAXofSKQtH0WWkCH/t0a9lYHNtiYWyNHZzxXWvi4LQQj PA4g== X-Gm-Message-State: AOAM532CEwZt4QuGqHz/1qhXUQiY9dM54zUnjC0adInTDAj59kLuB8ZR AElj8TXGHf85FGLRq+zXBp+FyQx0517z6lR2IDrgmzDc X-Google-Smtp-Source: ABdhPJy+anIPAwc8nsgPtWPsliYK9hMv87jBbEvYqZQxE16FwrNoeIettIKfazN4KkEfdNxyTpOZSgAR9P3M7aneke8= X-Received: by 2002:a05:6638:5aa:: with SMTP id b10mr2185390jar.76.1631233841049; Thu, 09 Sep 2021 17:30:41 -0700 (PDT) MIME-Version: 1.0 References: <202109080107.18817pdj030849@gitrepo.freebsd.org> In-Reply-To: <202109080107.18817pdj030849@gitrepo.freebsd.org> From: Ed Maste Date: Thu, 9 Sep 2021 20:30:12 -0400 Message-ID: Subject: Re: git: 19261079b743 - main - openssh: update to OpenSSH v8.7p1 To: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H5Gxh4HGJz4qMq X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.44 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-1.23 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_NA(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.77)[0.773]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.44:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.44:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 00:30:49 -0000 On Tue, 7 Sept 2021 at 21:07, Ed Maste wrote: > > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=19261079b74319502c6ffa1249920079f0f69a72 > > commit 19261079b74319502c6ffa1249920079f0f69a72 > Merge: c5128c48df3c 66719ee573ac > Author: Ed Maste > AuthorDate: 2021-09-08 01:05:51 +0000 > Commit: Ed Maste > CommitDate: 2021-09-08 01:05:51 +0000 > > openssh: update to OpenSSH v8.7p1 Note that this update also removes the DSA host key path from the default list. I intended to do it as a second commit but accidentally rolled it into the overall update. (OpenSSH upstream removed DSA host key from the default list some time ago, but we restored it temporarily to afford backwards compatibility.) From owner-dev-commits-src-main@freebsd.org Fri Sep 10 00:41:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D906267A143; Fri, 10 Sep 2021 00:41:48 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5HBN5Zq7z4sxl; Fri, 10 Sep 2021 00:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FFF5236FD; Fri, 10 Sep 2021 00:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18A0fmPf056016; Fri, 10 Sep 2021 00:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18A0fmY9056015; Fri, 10 Sep 2021 00:41:48 GMT (envelope-from git) Date: Fri, 10 Sep 2021 00:41:48 GMT Message-Id: <202109100041.18A0fmY9056015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 35aa1d6e4542 - main - kern: drop remaining references to removed makesyscalls.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35aa1d6e4542ce7c8be127b85da2a5c9e8ade3f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 00:41:48 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=35aa1d6e4542ce7c8be127b85da2a5c9e8ade3f7 commit 35aa1d6e4542ce7c8be127b85da2a5c9e8ade3f7 Author: Kyle Evans AuthorDate: 2021-05-13 18:46:17 +0000 Commit: Kyle Evans CommitDate: 2021-09-10 00:40:54 +0000 kern: drop remaining references to removed makesyscalls.sh This was accidentally omitted from the recent removal of makeyscalls.sh. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30250 --- sys/cddl/dev/systrace/systrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index c455ea9482dc..3ac3bb80596b 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -95,7 +95,7 @@ extern struct sysent linux32_sysent[]; #elif defined(FREEBSD32_SYSTRACE) /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/kern/makesyscalls.sh. + * using a generated function. See sys/tools/makesyscalls.lua. */ #include #include @@ -109,7 +109,7 @@ extern const char *freebsd32_syscallnames[]; #else /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/kern/makesyscalls.sh. + * using a generated function. See sys/tools/makesyscalls.lua. */ #include #include From owner-dev-commits-src-main@freebsd.org Fri Sep 10 05:30:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5723B67F0F7; Fri, 10 Sep 2021 05:30:02 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5PZx61Ndz4tnv; Fri, 10 Sep 2021 05:30:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 18A5Tr7w096048 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 9 Sep 2021 22:29:53 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 18A5TrhW096047; Thu, 9 Sep 2021 22:29:53 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 9 Sep 2021 22:29:53 -0700 From: Gleb Smirnoff To: Mateusz Guzik , kp@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test Message-ID: References: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4H5PZx61Ndz4tnv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 05:30:02 -0000 Mateusz, On Tue, Aug 17, 2021 at 07:59:02PM +0000, Mateusz Guzik wrote: M> The branch main has been updated by mjg: M> M> URL: https://cgit.FreeBSD.org/src/commit/?id=5091ca26507b83ebd5ce677dd26bd10e4bad4153 M> M> commit 5091ca26507b83ebd5ce677dd26bd10e4bad4153 M> Author: Mateusz Guzik M> AuthorDate: 2021-08-17 18:04:31 +0000 M> Commit: Mateusz Guzik M> CommitDate: 2021-08-17 19:56:33 +0000 M> M> pf: save on branching in the common case in pf_test M> M> Reviewed by: kp M> Sponsored by: Rubicon Communications, LLC ("Netgate") M> --- M> sys/netpfil/pf/pf.c | 6 +++--- M> 1 file changed, 3 insertions(+), 3 deletions(-) M> M> diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c M> index e2dd3eb7c0de..add76c7b98d4 100644 M> --- a/sys/netpfil/pf/pf.c M> +++ b/sys/netpfil/pf/pf.c M> @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * M> M> PF_RULES_RLOCK(); M> M> - if (ip_divert_ptr != NULL && M> + if (__predict_false(ip_divert_ptr != NULL) && This is an optimization for a setup without divert(4) at cost of pessimization for a setup with divert(4). IMHO, __predict_false() predicate should guard against error paths and other unusual events, not favor one setup over other. -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Sep 10 05:30:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F61C67ECEA; Fri, 10 Sep 2021 05:30:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5PbX3BBlz4tlS; Fri, 10 Sep 2021 05:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44F2527290; Fri, 10 Sep 2021 05:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18A5UW2R039706; Fri, 10 Sep 2021 05:30:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18A5UWGB039705; Fri, 10 Sep 2021 05:30:32 GMT (envelope-from git) Date: Fri, 10 Sep 2021 05:30:32 GMT Message-Id: <202109100530.18A5UWGB039705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7955efd574b9 - main - Add support for jail.conf.d MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7955efd574b98601a95da45d6d8e7f452631fddd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 05:30:32 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7955efd574b98601a95da45d6d8e7f452631fddd commit 7955efd574b98601a95da45d6d8e7f452631fddd Author: Antranig Vartanian AuthorDate: 2021-09-08 07:07:49 +0000 Commit: Kyle Evans CommitDate: 2021-09-10 05:30:04 +0000 Add support for jail.conf.d Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very messy if you have many jails. This patch allows one to move these config files out of the way into /etc/jail.conf.d/{jailname}.conf. Note that the same caveat as /etc/jail.*.conf applies: the jail service will not autodiscover all of these for starting 'all' jails. This is considered future work, since the behavior matches. Reviewed by: kevans MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D24570 --- etc/mtree/BSD.root.dist | 2 ++ libexec/rc/rc.d/jail | 4 ++++ share/man/man5/rc.conf.5 | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index f734f7891429..8bea31212217 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -56,6 +56,8 @@ .. gss .. + jail.conf.d + .. kyua tags=package=tests .. mail diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail index ff4336131bc9..1d544501e32b 100755 --- a/libexec/rc/rc.d/jail +++ b/libexec/rc/rc.d/jail @@ -120,12 +120,16 @@ parse_options() fi eval _jconf=\"\${jail_${_jv}_conf:-/etc/jail.${_j}.conf}\" eval _rootdir=\"\$jail_${_jv}_rootdir\" + eval _jconfdir=\"/etc/jail.conf.d/${_j}.conf\" eval _hostname=\"\$jail_${_jv}_hostname\" if [ -z "$_rootdir" -o \ -z "$_hostname" ]; then if [ -r "$_jconf" ]; then _conf="$_jconf" return 0 + elif [ -r "$_jconfdir" ]; then + _conf="$_jconfdir" + return 0 elif [ -r "$jail_conf" ]; then _conf="$jail_conf" return 0 diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 57404b8c0e89..b9d22a789c3a 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2021 +.Dd September 10, 2021 .Dt RC.CONF 5 .Os .Sh NAME @@ -3883,6 +3883,13 @@ The configuration filename used by utility. The default value is .Pa /etc/jail.conf . +.Pa /etc/jail. Ns Ao Ar jname Ac Ns Va .conf +and +.Pa /etc/jail.conf.d/ Ns Ao Ar jname Ac Ns Va .conf +will also be used if +.Va Ao Ar jname Ac Va +is set in +.Va jail_list . .It Va jail_parallel_start .Pq Vt bool If set to From owner-dev-commits-src-main@freebsd.org Fri Sep 10 07:43:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6287E6A88D8; Fri, 10 Sep 2021 07:43:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5SXY27x4z4TfJ; Fri, 10 Sep 2021 07:43:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x12d.google.com with SMTP id l11so2296604lfe.1; Fri, 10 Sep 2021 00:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oT5s8+qti6k9hUtBxS5kS4ID9RzWZ8lWdOCoJVDB5R0=; b=BWdWgdzFOhdJDgCYZYOty3cxyoZHHDY+DGBBvoQjbW6ZxZp28b2GhVKCqc0OFl5fDx RhVsMlc9odWAcuYbV2xduYBdpdD/AkxrIWuyO81Q1VtWqEInNKTwfbNW85rlOnWI6q6G 1mzafg5IbxmSC91BbwGk+3dzgyAVD0P6LQf0A8SpOKjRdZJQhspKbR/y1TgjV6jdXHQy Ra4dYyj4SqNwT3xnGhMt0sFBMwdKXTWB2wFzTrdzsnrswDOipzwhsu5s71YXzBDL/rMf 4sukXwIVZ+p/ONixNBKwRUSlAEVFVdgUvJxAZp2RMjwyNECdqMfd4eXedvcAtX6fZb4R Hp1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oT5s8+qti6k9hUtBxS5kS4ID9RzWZ8lWdOCoJVDB5R0=; b=tL8ZKbFnAyPxMexxHERxClPziytSwZWd0J6F03NDkdp0UEfPhpMwXF/I+xTneolvr8 BNXEvZ8uIXjTM6OTCZ68dlpoz095I7DC/JBpdCHH2tV10qjIv2dLksnrI4Zr289froSA MsM0xTReP98UWj9aP0OjnIeOALXit8pahpHYMVYIqx3r7eBVmhHivApc+OULa3XUTQoH ghGmHAvSkmrfhr8eUiJGWQ4P4lBJZbWqyNz0K79hmPZVoU9twU2Po33cFKK0jHlfPfXV D2iK0sKksEAyQylgm1wEgS85lqTEzIjFXRs9FeudGEKVwl+18WCeJta03cfEavgRRGIw H46w== X-Gm-Message-State: AOAM532uP7kPkxFvsZOHURLp0YAMHykRoF7flFLukhE3wN3YzO0qVncP Df6YFRMQBvTG2HZRFxW7gzi5q5eWhOr7zqIyr8TikV8l X-Google-Smtp-Source: ABdhPJzgWBER8ogaWkR3lbf6VUPhrstuZ1H8q7x6U/JG5Zx7jdIAJYs61qv9PiTR9Xuxd28q5SSvG+QCH70Kvw+TJ4k= X-Received: by 2002:a05:6512:1114:: with SMTP id l20mr2982483lfg.550.1631259787529; Fri, 10 Sep 2021 00:43:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:6f04:0:0:0:0:0 with HTTP; Fri, 10 Sep 2021 00:43:06 -0700 (PDT) In-Reply-To: References: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> From: Mateusz Guzik Date: Fri, 10 Sep 2021 09:43:06 +0200 Message-ID: Subject: Re: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test To: Gleb Smirnoff Cc: kp@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H5SXY27x4z4TfJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 07:43:09 -0000 On 9/10/21, Gleb Smirnoff wrote: > Mateusz, > > On Tue, Aug 17, 2021 at 07:59:02PM +0000, Mateusz Guzik wrote: > M> The branch main has been updated by mjg: > M> > M> URL: > https://cgit.FreeBSD.org/src/commit/?id=5091ca26507b83ebd5ce677dd26bd10e4bad4153 > M> > M> commit 5091ca26507b83ebd5ce677dd26bd10e4bad4153 > M> Author: Mateusz Guzik > M> AuthorDate: 2021-08-17 18:04:31 +0000 > M> Commit: Mateusz Guzik > M> CommitDate: 2021-08-17 19:56:33 +0000 > M> > M> pf: save on branching in the common case in pf_test > M> > M> Reviewed by: kp > M> Sponsored by: Rubicon Communications, LLC ("Netgate") > M> --- > M> sys/netpfil/pf/pf.c | 6 +++--- > M> 1 file changed, 3 insertions(+), 3 deletions(-) > M> > M> diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c > M> index e2dd3eb7c0de..add76c7b98d4 100644 > M> --- a/sys/netpfil/pf/pf.c > M> +++ b/sys/netpfil/pf/pf.c > M> @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, > struct mbuf **m0, struct inpcb * > M> > M> PF_RULES_RLOCK(); > M> > M> - if (ip_divert_ptr != NULL && > M> + if (__predict_false(ip_divert_ptr != NULL) && > > This is an optimization for a setup without divert(4) at cost of > pessimization > for a setup with divert(4). IMHO, __predict_false() predicate should guard > against error paths and other unusual events, not favor one setup over > other. > divert is non-standard and comes with tons of overhead, so I think this is justified. The real fix would be to either implement hot patchable branches or otherwise generate pf_test always (or never) doing divert without having to check for it, but that's far in the future. -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Fri Sep 10 13:09:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FAAA6AC6BF; Fri, 10 Sep 2021 13:09:21 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5bmx0hfRz3h9d; Fri, 10 Sep 2021 13:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9A4850CD; Fri, 10 Sep 2021 13:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AD9Kv6048376; Fri, 10 Sep 2021 13:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AD9Kl9048375; Fri, 10 Sep 2021 13:09:20 GMT (envelope-from git) Date: Fri, 10 Sep 2021 13:09:20 GMT Message-Id: <202109101309.18AD9Kl9048375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b1e6a792d68e - main - net: Enter a net epoch around protocol if_up/down notifications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1e6a792d68e9c59740d5e925405d8d4343d099b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 13:09:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b1e6a792d68e9c59740d5e925405d8d4343d099b commit b1e6a792d68e9c59740d5e925405d8d4343d099b Author: Mark Johnston AuthorDate: 2021-09-10 13:07:40 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 13:07:40 +0000 net: Enter a net epoch around protocol if_up/down notifications When traversing a list of interface addresses, we need to be in a net epoch section, and protocol ctlinput routines need a stable reference to the address. Reported by: syzbot+3219af764ead146a3a4e@syzkaller.appspotmail.com Reviewed by: kp, melifaro MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31889 --- sys/kern/uipc_domain.c | 2 ++ sys/net/if.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index d572e0ec19db..9092ff335eb0 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -516,6 +516,8 @@ pfctlinput(int cmd, struct sockaddr *sa) struct domain *dp; struct protosw *pr; + NET_EPOCH_ASSERT(); + for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_ctlinput) diff --git a/sys/net/if.c b/sys/net/if.c index 8d2a66471836..83a0b07805ee 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2195,14 +2195,17 @@ static void if_unroute(struct ifnet *ifp, int flag, int fam) { struct ifaddr *ifa; + struct epoch_tracker et; KASSERT(flag == IFF_UP, ("if_unroute: flag != IFF_UP")); ifp->if_flags &= ~flag; getmicrotime(&ifp->if_lastchange); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFDOWN, ifa->ifa_addr); + NET_EPOCH_EXIT(et); ifp->if_qflush(ifp); if (ifp->if_carp) @@ -2218,14 +2221,17 @@ static void if_route(struct ifnet *ifp, int flag, int fam) { struct ifaddr *ifa; + struct epoch_tracker et; KASSERT(flag == IFF_UP, ("if_route: flag != IFF_UP")); ifp->if_flags |= flag; getmicrotime(&ifp->if_lastchange); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFUP, ifa->ifa_addr); + NET_EPOCH_EXIT(et); if (ifp->if_carp) (*carp_linkstate_p)(ifp); rt_ifmsg(ifp); From owner-dev-commits-src-main@freebsd.org Fri Sep 10 13:09:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FE786AC542; Fri, 10 Sep 2021 13:09:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5bmy17cqz3hM0; Fri, 10 Sep 2021 13:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F202A50CE; Fri, 10 Sep 2021 13:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AD9LNY048400; Fri, 10 Sep 2021 13:09:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AD9Lu8048399; Fri, 10 Sep 2021 13:09:21 GMT (envelope-from git) Date: Fri, 10 Sep 2021 13:09:21 GMT Message-Id: <202109101309.18AD9Lu8048399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 10eb2a2bde61 - main - ipsec: Validate the protocol identifier in ipsec4_ctlinput() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10eb2a2bde616e52ae2939df90c04483383a34f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 13:09:22 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10eb2a2bde616e52ae2939df90c04483383a34f7 commit 10eb2a2bde616e52ae2939df90c04483383a34f7 Author: Mark Johnston AuthorDate: 2021-09-10 13:07:59 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 13:09:00 +0000 ipsec: Validate the protocol identifier in ipsec4_ctlinput() key_allocsa() expects to handle only IPSec protocols and has an assertion to this effect. However, ipsec4_ctlinput() has to handle messages from ICMP unreachable packets and was not validating the protocol number. In practice such a packet would simply fail to match any SADB entries and would thus be ignored. Reported by: syzbot+6a9ef6fcfadb9f3877fe@syzkaller.appspotmail.com Reviewed by: ae MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31890 --- sys/netipsec/ipsec_input.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c index 07a3ef583be8..73202cbb528b 100644 --- a/sys/netipsec/ipsec_input.c +++ b/sys/netipsec/ipsec_input.c @@ -276,6 +276,7 @@ ipsec4_ctlinput(int code, struct sockaddr *sa, void *v) struct icmp *icp; struct ip *ip = v; uint32_t pmtu, spi; + uint8_t proto; if (code != PRC_MSGSIZE || ip == NULL) return (EINVAL); @@ -289,8 +290,13 @@ ipsec4_ctlinput(int code, struct sockaddr *sa, void *v) if (pmtu < V_ip4_ipsec_min_pmtu) return (EINVAL); + proto = ip->ip_p; + if (proto != IPPROTO_ESP && proto != IPPROTO_AH && + proto != IPPROTO_IPCOMP) + return (EINVAL); + memcpy(&spi, (caddr_t)ip + (ip->ip_hl << 2), sizeof(spi)); - sav = key_allocsa((union sockaddr_union *)sa, ip->ip_p, spi); + sav = key_allocsa((union sockaddr_union *)sa, proto, spi); if (sav == NULL) return (ENOENT); From owner-dev-commits-src-main@freebsd.org Fri Sep 10 13:17:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 305C56AC763; Fri, 10 Sep 2021 13:17:04 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5bxr0Wn4z3kFJ; Fri, 10 Sep 2021 13:17:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20AE5074; Fri, 10 Sep 2021 13:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ADH3XQ062080; Fri, 10 Sep 2021 13:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ADH3PE062079; Fri, 10 Sep 2021 13:17:03 GMT (envelope-from git) Date: Fri, 10 Sep 2021 13:17:03 GMT Message-Id: <202109101317.18ADH3PE062079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0a51d74c3ab8 - main - pf: fix synproxy to local MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 13:17:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef commit 0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef Author: Kristof Provost AuthorDate: 2021-09-01 07:54:55 +0000 Commit: Kristof Provost CommitDate: 2021-09-10 13:16:37 +0000 pf: fix synproxy to local When we're synproxy-ing a connection that's going to us (as opposed to a forwarded one) we wound up trying to send out the pf-generated tcp packets through pf_intr(), which called ip(6)_output(). That doesn't work all that well for packets that are destined for us, so in that case we must call ip(6)_input() instead. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31853 --- sys/netpfil/pf/pf.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 8a81aeb1c010..5d6c7363b3ab 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1482,6 +1482,42 @@ pf_send(struct pf_send_entry *pfse) swi_sched(V_pf_swi_cookie, 0); } +static bool +pf_isforlocal(struct mbuf *m, int af) +{ + switch (af) { + case AF_INET: { + struct rm_priotracker in_ifa_tracker; + struct ip *ip; + struct in_ifaddr *ia = NULL; + + ip = mtod(m, struct ip *); + IN_IFADDR_RLOCK(&in_ifa_tracker); + LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { + if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) { + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + return (true); + } + } + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + break; + } + case AF_INET6: { + struct ip6_hdr *ip6; + struct in6_ifaddr *ia; + ip6 = mtod(m, struct ip6_hdr *); + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */, false); + if (ia == NULL) + return (false); + return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); + } + default: + panic("Unsupported af %d", af); + } + + return (false); +} + void pf_intr(void *v) { @@ -1501,9 +1537,18 @@ pf_intr(void *v) STAILQ_FOREACH_SAFE(pfse, &queue, pfse_next, next) { switch (pfse->pfse_type) { #ifdef INET - case PFSE_IP: - ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL); + case PFSE_IP: { + if (pf_isforlocal(pfse->pfse_m, AF_INET)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + pfse->pfse_m->m_pkthdr.csum_flags |= + CSUM_IP_VALID | CSUM_IP_CHECKED; + ip_input(pfse->pfse_m); + } else { + ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL); + } break; + } case PFSE_ICMP: icmp_error(pfse->pfse_m, pfse->icmpopts.type, pfse->icmpopts.code, 0, pfse->icmpopts.mtu); @@ -1511,8 +1556,13 @@ pf_intr(void *v) #endif /* INET */ #ifdef INET6 case PFSE_IP6: - ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL, - NULL); + if (pf_isforlocal(pfse->pfse_m, AF_INET6)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + ip6_input(pfse->pfse_m); + } else { + ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL, NULL); + } break; case PFSE_ICMP6: icmp6_error(pfse->pfse_m, pfse->icmpopts.type, @@ -2656,7 +2706,9 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, #endif /* ALTQ */ m->m_data += max_linkhdr; m->m_pkthdr.len = m->m_len = len; - m->m_pkthdr.rcvif = NULL; + /* The rest of the stack assumes a rcvif, so provide one. + * This is a locally generated packet, so .. close enough. */ + m->m_pkthdr.rcvif = V_loif; bzero(m->m_data, len); switch (af) { #ifdef INET From owner-dev-commits-src-main@freebsd.org Fri Sep 10 13:17:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 393676AC764; Fri, 10 Sep 2021 13:17:05 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5bxs16lkz3kKk; Fri, 10 Sep 2021 13:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 080A856A5; Fri, 10 Sep 2021 13:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ADH4Fu062109; Fri, 10 Sep 2021 13:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ADH42f062108; Fri, 10 Sep 2021 13:17:04 GMT (envelope-from git) Date: Fri, 10 Sep 2021 13:17:04 GMT Message-Id: <202109101317.18ADH42f062108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6598cababf64 - main - pf tests: synproxy to localhost test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6598cababf6425181a755ec97c3fa66d7ee31393 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 13:17:05 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6598cababf6425181a755ec97c3fa66d7ee31393 commit 6598cababf6425181a755ec97c3fa66d7ee31393 Author: Kristof Provost AuthorDate: 2021-06-30 12:22:27 +0000 Commit: Kristof Provost CommitDate: 2021-09-10 13:16:37 +0000 pf tests: synproxy to localhost test Test syn-proxying a connection to the local host. Sponsored by: Modirum MDPay MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31854 --- tests/sys/netpfil/pf/synproxy.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/synproxy.sh b/tests/sys/netpfil/pf/synproxy.sh index aedbb8885129..a111f40cfbcf 100644 --- a/tests/sys/netpfil/pf/synproxy.sh +++ b/tests/sys/netpfil/pf/synproxy.sh @@ -79,7 +79,90 @@ synproxy_cleanup() pft_cleanup } +atf_test_case "local" "cleanup" +local_head() +{ + atf_set descr 'Synproxy a locally terminated connection' + atf_set require.user root +} + +local_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Check that we can talk to the jail, after synproxying + reply=$(echo ping | nc -N -w 5 192.0.2.1 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + +atf_test_case "local_v6" "cleanup" +local_v6_head() +{ + atf_set descr 'Synproxy (v6) a locally terminated connection' + atf_set require.user root +} + +local_v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + reply=$(echo ping | nc -N -w 5 2001:db8:42::2 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_v6_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "synproxy" + atf_add_test_case "local" + atf_add_test_case "local_v6" } From owner-dev-commits-src-main@freebsd.org Fri Sep 10 13:59:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C4766AD1BD; Fri, 10 Sep 2021 13:59:20 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5ctc41hNz3v4L; Fri, 10 Sep 2021 13:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684C85ECE; Fri, 10 Sep 2021 13:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ADxK5R015205; Fri, 10 Sep 2021 13:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ADxKhk015204; Fri, 10 Sep 2021 13:59:20 GMT (envelope-from git) Date: Fri, 10 Sep 2021 13:59:20 GMT Message-Id: <202109101359.18ADxKhk015204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f5777c123a63 - main - net: Fix memory leaks upon arp_fillheader() failures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5777c123a6382f5fdc9732a87c8fa1ff672f148 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 13:59:20 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f5777c123a6382f5fdc9732a87c8fa1ff672f148 commit f5777c123a6382f5fdc9732a87c8fa1ff672f148 Author: orange30 <44566632+orange30@users.noreply.github.com> AuthorDate: 2021-09-01 15:37:36 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 13:45:26 +0000 net: Fix memory leaks upon arp_fillheader() failures Free memory before return from arprequest_internal(). In in_arpinput(), if arp_fillheader() fails, it should use goto drop. Reviewed by: melifaro, imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/534 --- sys/netinet/if_ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 2f92d623feeb..5400f35d953f 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -418,6 +418,7 @@ arprequest_internal(struct ifnet *ifp, const struct in_addr *sip, linkhdrsize = sizeof(linkhdr); error = arp_fillheader(ifp, ah, 1, linkhdr, &linkhdrsize); if (error != 0 && error != EAFNOSUPPORT) { + m_freem(m); ARP_LOG(LOG_ERR, "Failed to calculate ARP header on %s: %d\n", if_name(ifp), error); return (error); @@ -1128,7 +1129,7 @@ reply: if (error != 0 && error != EAFNOSUPPORT) { ARP_LOG(LOG_ERR, "Failed to calculate ARP header on %s: %d\n", if_name(ifp), error); - return; + goto drop; } ro.ro_prepend = linkhdr; From owner-dev-commits-src-main@freebsd.org Fri Sep 10 14:05:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E52966AD902; Fri, 10 Sep 2021 14:05:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5d1M67fhz4QnB; Fri, 10 Sep 2021 14:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEDBB6468; Fri, 10 Sep 2021 14:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AE5BRF029031; Fri, 10 Sep 2021 14:05:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AE5BiE029030; Fri, 10 Sep 2021 14:05:11 GMT (envelope-from git) Date: Fri, 10 Sep 2021 14:05:11 GMT Message-Id: <202109101405.18AE5BiE029030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6d042d7c861a - main - wpi: Fix a lock leak in an error path in wpi_run() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d042d7c861a8fffd1784c720720c3b89c7c0883 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 14:05:12 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d042d7c861a8fffd1784c720720c3b89c7c0883 commit 6d042d7c861a8fffd1784c720720c3b89c7c0883 Author: Mark Johnston AuthorDate: 2021-09-10 14:03:51 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 14:03:51 +0000 wpi: Fix a lock leak in an error path in wpi_run() PR: 258243 Reported by: dinghao.liu@zju.edu.cn MFC after: 1 week --- sys/dev/wpi/if_wpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index dd8b17c8d21c..3d4e80ab61ad 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -4547,6 +4547,7 @@ wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) sc->rxon.chan, sc->rxon.flags); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { + WPI_RXON_UNLOCK(sc); device_printf(sc->sc_dev, "%s: could not send RXON\n", __func__); return error; From owner-dev-commits-src-main@freebsd.org Fri Sep 10 15:10:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E7216AE71E; Fri, 10 Sep 2021 15:10:13 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5fSP12Ssz4jsj; Fri, 10 Sep 2021 15:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035896E41; Fri, 10 Sep 2021 15:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AFACLS016107; Fri, 10 Sep 2021 15:10:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AFACqe016100; Fri, 10 Sep 2021 15:10:12 GMT (envelope-from git) Date: Fri, 10 Sep 2021 15:10:12 GMT Message-Id: <202109101510.18AFACqe016100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b64f7ce98f52 - main - pf: qid and pqid can be uint16_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b64f7ce98f5286721a38b31fa2180313f800fb1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 15:10:13 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b64f7ce98f5286721a38b31fa2180313f800fb1d commit b64f7ce98f5286721a38b31fa2180313f800fb1d Author: Kristof Provost AuthorDate: 2021-09-07 12:41:37 +0000 Commit: Kristof Provost CommitDate: 2021-09-10 15:07:57 +0000 pf: qid and pqid can be uint16_t tag2name() returns a uint16_t, so we don't need to use uint32_t for the qid (or pqid). This reduces the size of struct pf_kstate slightly. That in turn buys us space to add extra fields for dummynet later. Happily these fields are not exposed to user space (there are user space versions of them, but they can just stay uint32_t), so there's no ABI breakage in modifying this. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31873 --- sys/net/pfvar.h | 12 ++++++------ sys/netpfil/pf/pf_altq.h | 2 +- sys/netpfil/pf/pf_ioctl.c | 14 +++++++------- sys/netpfil/pf/pf_mtag.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 5755a2d7e98d..2c5c0037cb92 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -561,8 +561,8 @@ struct pf_kpool { }; struct pf_rule_actions { - u_int32_t qid; - u_int32_t pqid; + uint16_t qid; + uint16_t pqid; }; union pf_krule_ptr { @@ -606,8 +606,8 @@ struct pf_krule { u_int32_t limit; u_int32_t seconds; } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int32_t nr; u_int32_t prob; uid_t cuid; @@ -856,8 +856,8 @@ struct pf_kstate { u_int32_t creation; u_int32_t expire; u_int32_t pfsync_time; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int16_t tag; u_int8_t log; }; diff --git a/sys/netpfil/pf/pf_altq.h b/sys/netpfil/pf/pf_altq.h index 35d2d5cb8bbe..0b913a19c2ff 100644 --- a/sys/netpfil/pf/pf_altq.h +++ b/sys/netpfil/pf/pf_altq.h @@ -220,7 +220,7 @@ struct pf_kaltq { struct fairq_opts fairq_opts; } pq_u; - uint32_t qid; /* return value */ + uint16_t qid; /* return value */ }; #endif /* _KERNEL */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 08a2946ae484..6d240326361e 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -112,8 +112,8 @@ static int pf_rollback_altq(u_int32_t); static int pf_commit_altq(u_int32_t); static int pf_enable_altq(struct pf_altq *); static int pf_disable_altq(struct pf_altq *); -static u_int32_t pf_qname2qid(const char *); -static void pf_qid_unref(u_int32_t); +static uint16_t pf_qname2qid(const char *); +static void pf_qid_unref(uint16_t); #endif /* ALTQ */ static int pf_begin_rules(u_int32_t *, int, const char *); static int pf_rollback_rules(u_int32_t, int, char *); @@ -653,23 +653,23 @@ tag_unref(struct pf_tagset *ts, u_int16_t tag) } } -static u_int16_t +static uint16_t pf_tagname2tag(const char *tagname) { return (tagname2tag(&V_pf_tags, tagname)); } #ifdef ALTQ -static u_int32_t +static uint16_t pf_qname2qid(const char *qname) { - return ((u_int32_t)tagname2tag(&V_pf_qids, qname)); + return (tagname2tag(&V_pf_qids, qname)); } static void -pf_qid_unref(u_int32_t qid) +pf_qid_unref(uint16_t qid) { - tag_unref(&V_pf_qids, (u_int16_t)qid); + tag_unref(&V_pf_qids, qid); } static int diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index 2135c9e69dbd..e3f6f85f21d0 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -47,7 +47,7 @@ struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ - u_int32_t qid; /* queue id */ + u_int16_t qid; /* queue id */ u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ u_int16_t tag; /* tag id */ u_int8_t flags; From owner-dev-commits-src-main@freebsd.org Fri Sep 10 16:19:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEEEA6AF3A2; Fri, 10 Sep 2021 16:19:07 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5gzv49vDz3Pyk; Fri, 10 Sep 2021 16:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7100D7F43; Fri, 10 Sep 2021 16:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AGJ7R1005125; Fri, 10 Sep 2021 16:19:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AGJ7g6005124; Fri, 10 Sep 2021 16:19:07 GMT (envelope-from git) Date: Fri, 10 Sep 2021 16:19:07 GMT Message-Id: <202109101619.18AGJ7g6005124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9bdff593ead9 - main - pf: fix NOINET6 builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bdff593ead9434e01cfb6084f21c3e93a22963d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 16:19:07 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bdff593ead9434e01cfb6084f21c3e93a22963d commit 9bdff593ead9434e01cfb6084f21c3e93a22963d Author: Kristof Provost AuthorDate: 2021-09-10 15:20:39 +0000 Commit: Kristof Provost CommitDate: 2021-09-10 16:15:44 +0000 pf: fix NOINET6 builds MFC after: 1 week Sponsored by: Modirum MDPay --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5d6c7363b3ab..221e0c87c11f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1486,6 +1486,7 @@ static bool pf_isforlocal(struct mbuf *m, int af) { switch (af) { +#ifdef INET case AF_INET: { struct rm_priotracker in_ifa_tracker; struct ip *ip; @@ -1502,6 +1503,8 @@ pf_isforlocal(struct mbuf *m, int af) IN_IFADDR_RUNLOCK(&in_ifa_tracker); break; } +#endif +#ifdef INET6 case AF_INET6: { struct ip6_hdr *ip6; struct in6_ifaddr *ia; @@ -1511,6 +1514,7 @@ pf_isforlocal(struct mbuf *m, int af) return (false); return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); } +#endif default: panic("Unsupported af %d", af); } From owner-dev-commits-src-main@freebsd.org Fri Sep 10 18:27:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 868F3660B32; Fri, 10 Sep 2021 18:27:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5krb3Bbnz4lCv; Fri, 10 Sep 2021 18:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA8611AFD; Fri, 10 Sep 2021 18:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AIRx9m077223; Fri, 10 Sep 2021 18:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AIRxCR077222; Fri, 10 Sep 2021 18:27:59 GMT (envelope-from git) Date: Fri, 10 Sep 2021 18:27:59 GMT Message-Id: <202109101827.18AIRxCR077222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: b2954f0a8f7d - main - netgraph: add ng_uncallout_drain(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2954f0a8f7db160053555d4ad86ce3abf036077 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 18:27:59 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b2954f0a8f7db160053555d4ad86ce3abf036077 commit b2954f0a8f7db160053555d4ad86ce3abf036077 Author: Gleb Smirnoff AuthorDate: 2021-08-06 20:16:32 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-10 18:27:04 +0000 netgraph: add ng_uncallout_drain(). Move shared code into ng_uncallout_internal(). While here add a comment mentioning a problem with scheduled+executing callout. Reviewed by: mjg, markj Differential Revision: https://reviews.freebsd.org/D31476 --- sys/netgraph/netgraph.h | 1 + sys/netgraph/ng_base.c | 50 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 9cc298b38236..d0be5a88b088 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -1162,6 +1162,7 @@ int ng_send_fn1(node_p node, hook_p hook, ng_item_fn *fn, void *arg1, int ng_send_fn2(node_p node, hook_p hook, item_p pitem, ng_item_fn2 *fn, void *arg1, int arg2, int flags); int ng_uncallout(struct callout *c, node_p node); +int ng_uncallout_drain(struct callout *c, node_p node); int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, ng_item_fn *fn, void * arg1, int arg2); #define ng_callout_init(c) callout_init(c, 1) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index e0832e794089..655761c2f897 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3816,20 +3816,18 @@ ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, return (0); } -/* A special modified version of callout_stop() */ -int -ng_uncallout(struct callout *c, node_p node) +/* + * Free references and item if callout_stop/callout_drain returned 1, + * meaning that callout was successfully stopped and now references + * belong to us. + */ +static void +ng_uncallout_internal(struct callout *c, node_p node) { item_p item; - int rval; - - KASSERT(c != NULL, ("ng_uncallout: NULL callout")); - KASSERT(node != NULL, ("ng_uncallout: NULL node")); - rval = callout_stop(c); item = c->c_arg; - /* Do an extra check */ - if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && + if ((c->c_func == &ng_callout_trampoline) && (item != NULL) && (NGI_NODE(item) == node)) { /* * We successfully removed it from the queue before it ran @@ -3839,6 +3837,38 @@ ng_uncallout(struct callout *c, node_p node) NG_FREE_ITEM(item); } c->c_arg = NULL; +} + + +/* A special modified version of callout_stop() */ +int +ng_uncallout(struct callout *c, node_p node) +{ + int rval; + + rval = callout_stop(c); + if (rval > 0) + /* + * XXXGL: in case if callout is already running and next + * invocation is scheduled at the same time, callout_stop() + * returns 0. See d153eeee97d. In this case netgraph(4) would + * leak resources. However, no nodes are known to induce such + * behavior. + */ + ng_uncallout_internal(c, node); + + return (rval); +} + +/* A special modified version of callout_drain() */ +int +ng_uncallout_drain(struct callout *c, node_p node) +{ + int rval; + + rval = callout_drain(c); + if (rval > 0) + ng_uncallout_internal(c, node); return (rval); } From owner-dev-commits-src-main@freebsd.org Fri Sep 10 18:27:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68D4B660AF7; Fri, 10 Sep 2021 18:27:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5krZ2F1Rz4lPG; Fri, 10 Sep 2021 18:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC6611C53; Fri, 10 Sep 2021 18:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AIRwKx077199; Fri, 10 Sep 2021 18:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AIRw67077198; Fri, 10 Sep 2021 18:27:58 GMT (envelope-from git) Date: Fri, 10 Sep 2021 18:27:58 GMT Message-Id: <202109101827.18AIRw67077198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 26cf4b53d9c1 - main - netgraph: pass return value from callout_stop() unmodified to callers of ng_uncallout. Most of them do not check it anyway, so very little node changes are required. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26cf4b53d9c12238479d4b2068d3037cb1940a39 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 18:27:58 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=26cf4b53d9c12238479d4b2068d3037cb1940a39 commit 26cf4b53d9c12238479d4b2068d3037cb1940a39 Author: Gleb Smirnoff AuthorDate: 2021-08-06 20:12:13 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-10 18:26:59 +0000 netgraph: pass return value from callout_stop() unmodified to callers of ng_uncallout. Most of them do not check it anyway, so very little node changes are required. Reviewed by: mjg, markj Differential Revision: https://reviews.freebsd.org/D31476 --- sys/netgraph/bluetooth/hci/ng_hci_misc.c | 4 ++-- sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c | 6 +++--- sys/netgraph/ng_base.c | 6 +----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c index 707af8c84d06..4dc328850fb1 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c @@ -391,7 +391,7 @@ ng_hci_command_untimeout(ng_hci_unit_p unit) panic( "%s: %s - No command timeout!\n", __func__, NG_NODE_NAME(unit->node)); - if (ng_uncallout(&unit->cmd_timo, unit->node) == 0) + if (ng_uncallout(&unit->cmd_timo, unit->node) < 1) return (ETIMEDOUT); unit->state &= ~NG_HCI_UNIT_COMMAND_PENDING; @@ -432,7 +432,7 @@ ng_hci_con_untimeout(ng_hci_unit_con_p con) panic( "%s: %s - No connection timeout!\n", __func__, NG_NODE_NAME(con->unit->node)); - if (ng_uncallout(&con->con_timo, con->unit->node) == 0) + if (ng_uncallout(&con->con_timo, con->unit->node) < 1) return (ETIMEDOUT); con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c index 7a3daf75ead4..0b925cb14b42 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c @@ -235,7 +235,7 @@ ng_l2cap_discon_untimeout(ng_l2cap_con_p con) __func__, NG_NODE_NAME(con->l2cap->node), con->state, con->flags); - if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0) + if (ng_uncallout(&con->con_timo, con->l2cap->node) < 1) return (ETIMEDOUT); con->flags &= ~NG_L2CAP_CON_AUTO_DISCON_TIMO; @@ -534,7 +534,7 @@ ng_l2cap_lp_untimeout(ng_l2cap_con_p con) __func__, NG_NODE_NAME(con->l2cap->node), con->state, con->flags); - if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0) + if (ng_uncallout(&con->con_timo, con->l2cap->node) < 1) return (ETIMEDOUT); con->flags &= ~NG_L2CAP_CON_LP_TIMO; @@ -579,7 +579,7 @@ ng_l2cap_command_untimeout(ng_l2cap_cmd_p cmd) __func__, NG_NODE_NAME(cmd->con->l2cap->node), cmd->code, cmd->flags); - if (ng_uncallout(&cmd->timo, cmd->con->l2cap->node) == 0) + if (ng_uncallout(&cmd->timo, cmd->con->l2cap->node) < 1) return (ETIMEDOUT); cmd->flags &= ~NG_L2CAP_CMD_PENDING; diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index ba60acb53502..e0832e794089 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3840,11 +3840,7 @@ ng_uncallout(struct callout *c, node_p node) } c->c_arg = NULL; - /* - * Callers only want to know if the callout was cancelled and - * not draining or stopped. - */ - return (rval > 0); + return (rval); } /* From owner-dev-commits-src-main@freebsd.org Fri Sep 10 18:28:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7E326609B2; Fri, 10 Sep 2021 18:28:00 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5krc4HFLz4l7l; Fri, 10 Sep 2021 18:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7312611BBE; Fri, 10 Sep 2021 18:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AIS00Y077247; Fri, 10 Sep 2021 18:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AIS0W5077246; Fri, 10 Sep 2021 18:28:00 GMT (envelope-from git) Date: Fri, 10 Sep 2021 18:28:00 GMT Message-Id: <202109101828.18AIS0W5077246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 0a76c63dd498 - main - ng_l2tp: improve seq structure locking. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a76c63dd4987d8f7af37fe93569ce8a020cf43e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 18:28:00 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0a76c63dd4987d8f7af37fe93569ce8a020cf43e commit 0a76c63dd4987d8f7af37fe93569ce8a020cf43e Author: Gleb Smirnoff AuthorDate: 2021-08-06 22:49:51 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-10 18:27:13 +0000 ng_l2tp: improve seq structure locking. Cover few cases of access to seq without lock missed in 702f98951d5. There are no known bugs fixed with this change, however. With INVARIANTS embed ng_l2tp_seq_check() into lock/unlock macros. Slightly reduce number of locks/unlocks per packet keeping the lock between functions. Reviewed by: mjg, markj Differential Revision: https://reviews.freebsd.org/D31476 --- sys/netgraph/ng_l2tp.c | 147 ++++++++++++++++++++----------------------------- 1 file changed, 61 insertions(+), 86 deletions(-) diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c index 9b6f19f9f0ad..c62bde0c54f7 100644 --- a/sys/netgraph/ng_l2tp.c +++ b/sys/netgraph/ng_l2tp.c @@ -188,10 +188,6 @@ static void ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, static hookpriv_p ng_l2tp_find_session(priv_p privp, u_int16_t sid); static ng_fn_eachhook ng_l2tp_reset_session; -#ifdef INVARIANTS -static void ng_l2tp_seq_check(struct l2tp_seq *seq); -#endif - /* Parse type for struct ng_l2tp_seq_config. */ static const struct ng_parse_struct_field ng_l2tp_seq_config_fields[] = NG_L2TP_SEQ_CONFIG_TYPE_INFO; @@ -335,12 +331,22 @@ static struct ng_type ng_l2tp_typestruct = { }; NETGRAPH_INIT(l2tp, &ng_l2tp_typestruct); -/* Sequence number state sanity checking */ +/* Sequence number state locking & sanity checking */ #ifdef INVARIANTS -#define L2TP_SEQ_CHECK(seq) ng_l2tp_seq_check(seq) +static void ng_l2tp_seq_check(struct l2tp_seq *seq); +#define SEQ_LOCK(seq) do { \ + mtx_lock(&(seq)->mtx); \ + ng_l2tp_seq_check(seq); \ +} while (0) +#define SEQ_UNLOCK(seq) do { \ + ng_l2tp_seq_check(seq); \ + mtx_unlock(&(seq)->mtx); \ +} while (0) #else -#define L2TP_SEQ_CHECK(x) do { } while (0) +#define SEQ_LOCK(seq) mtx_lock(&(seq)->mtx) +#define SEQ_UNLOCK(seq) mtx_unlock(&(seq)->mtx) #endif +#define SEQ_LOCK_ASSERT(seq) mtx_assert(&(seq)->mtx, MA_OWNED) /* Whether to use m_copypacket() or m_dup() */ #define L2TP_COPY_MBUF m_copypacket @@ -650,11 +656,10 @@ ng_l2tp_shutdown(node_p node) const priv_p priv = NG_NODE_PRIVATE(node); struct l2tp_seq *const seq = &priv->seq; - /* Sanity check */ - L2TP_SEQ_CHECK(seq); - /* Reset sequence number state */ + SEQ_LOCK(seq); ng_l2tp_seq_reset(priv); + SEQ_UNLOCK(seq); /* Free private data if neither timer is running */ ng_uncallout(&seq->rack_timer, node); @@ -757,9 +762,6 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) int error; int len, plen; - /* Sanity check */ - L2TP_SEQ_CHECK(&priv->seq); - /* If not configured, reject */ if (!priv->conf.enabled) { NG_FREE_ITEM(item); @@ -899,18 +901,20 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) if ((hdr & L2TP_HDR_CTRL) != 0) { struct l2tp_seq *const seq = &priv->seq; + SEQ_LOCK(seq); + /* Handle receive ack sequence number Nr */ ng_l2tp_seq_recv_nr(priv, nr); /* Discard ZLB packets */ if (m->m_pkthdr.len == 0) { + SEQ_UNLOCK(seq); priv->stats.recvZLBs++; NG_FREE_ITEM(item); NG_FREE_M(m); ERROUT(0); } - mtx_lock(&seq->mtx); /* * If not what we expect or we are busy, drop packet and * send an immediate ZLB ack. @@ -920,23 +924,16 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) priv->stats.recvDuplicates++; else priv->stats.recvOutOfOrder++; - mtx_unlock(&seq->mtx); ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); NG_FREE_ITEM(item); NG_FREE_M(m); ERROUT(0); } - /* - * Until we deliver this packet we can't receive next one as - * we have no information for sending ack. - */ - seq->inproc = 1; - mtx_unlock(&seq->mtx); /* Prepend session ID to packet. */ M_PREPEND(m, 2, M_NOWAIT); if (m == NULL) { - seq->inproc = 0; + SEQ_UNLOCK(seq); priv->stats.memoryFailures++; NG_FREE_ITEM(item); ERROUT(ENOBUFS); @@ -944,10 +941,17 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) mtod(m, u_int8_t *)[0] = sid >> 8; mtod(m, u_int8_t *)[1] = sid & 0xff; + /* + * Until we deliver this packet we can't receive next one as + * we have no information for sending ack. + */ + seq->inproc = 1; + SEQ_UNLOCK(seq); + /* Deliver packet to upper layers */ NG_FWD_NEW_DATA(error, item, priv->ctrl, m); - mtx_lock(&seq->mtx); + SEQ_LOCK(seq); /* Ready to process next packet. */ seq->inproc = 0; @@ -962,7 +966,7 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) NULL, 0); } } - mtx_unlock(&seq->mtx); + SEQ_UNLOCK(seq); ERROUT(error); } @@ -997,8 +1001,6 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) /* Deliver data */ NG_FWD_NEW_DATA(error, item, hook, m); done: - /* Done */ - L2TP_SEQ_CHECK(&priv->seq); return (error); } @@ -1016,9 +1018,6 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) int i; u_int16_t ns; - /* Sanity check */ - L2TP_SEQ_CHECK(&priv->seq); - /* If not configured, reject */ if (!priv->conf.enabled) { NG_FREE_ITEM(item); @@ -1043,12 +1042,12 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) ERROUT(EOVERFLOW); } - mtx_lock(&seq->mtx); + SEQ_LOCK(seq); /* Find next empty slot in transmit queue */ for (i = 0; i < L2TP_MAX_XWIN && seq->xwin[i] != NULL; i++); if (i == L2TP_MAX_XWIN) { - mtx_unlock(&seq->mtx); + SEQ_UNLOCK(seq); priv->stats.xmitDrops++; m_freem(m); ERROUT(ENOBUFS); @@ -1057,7 +1056,7 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) /* If peer's receive window is already full, nothing else to do */ if (i >= seq->cwnd) { - mtx_unlock(&seq->mtx); + SEQ_UNLOCK(seq); ERROUT(0); } @@ -1068,10 +1067,9 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) ns = seq->ns++; - mtx_unlock(&seq->mtx); - /* Copy packet */ if ((m = L2TP_COPY_MBUF(m, M_NOWAIT)) == NULL) { + SEQ_UNLOCK(seq); priv->stats.memoryFailures++; ERROUT(ENOBUFS); } @@ -1079,8 +1077,6 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) /* Send packet and increment xmit sequence number */ error = ng_l2tp_xmit_ctrl(priv, m, ns); done: - /* Done */ - L2TP_SEQ_CHECK(&priv->seq); return (error); } @@ -1098,9 +1094,6 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) int error; int i = 2; - /* Sanity check */ - L2TP_SEQ_CHECK(&priv->seq); - /* If not configured, reject */ if (!priv->conf.enabled) { NG_FREE_ITEM(item); @@ -1161,8 +1154,6 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) /* Send packet */ NG_FWD_NEW_DATA(error, item, priv->lower, m); done: - /* Done */ - L2TP_SEQ_CHECK(&priv->seq); return (error); } @@ -1204,7 +1195,6 @@ ng_l2tp_seq_init(priv_p priv) ng_callout_init(&seq->rack_timer); ng_callout_init(&seq->xack_timer); mtx_init(&seq->mtx, "ng_l2tp", NULL, MTX_DEF); - L2TP_SEQ_CHECK(seq); } /* @@ -1240,10 +1230,13 @@ ng_l2tp_seq_adjust(priv_p priv, const struct ng_l2tp_config *conf) { struct l2tp_seq *const seq = &priv->seq; u_int16_t new_wmax; + int error = 0; + SEQ_LOCK(seq); /* If disabling node, reset state sequence number */ if (!conf->enabled) { ng_l2tp_seq_reset(priv); + SEQ_UNLOCK(seq); return (0); } @@ -1252,13 +1245,14 @@ ng_l2tp_seq_adjust(priv_p priv, const struct ng_l2tp_config *conf) if (new_wmax > L2TP_MAX_XWIN) new_wmax = L2TP_MAX_XWIN; if (new_wmax == 0) - return (EINVAL); + ERROUT(EINVAL); if (new_wmax < seq->wmax) - return (EBUSY); + ERROUT(EBUSY); seq->wmax = new_wmax; - /* Done */ - return (0); +done: + SEQ_UNLOCK(seq); + return (error); } /* @@ -1271,8 +1265,7 @@ ng_l2tp_seq_reset(priv_p priv) hook_p hook; int i; - /* Sanity check */ - L2TP_SEQ_CHECK(seq); + SEQ_LOCK_ASSERT(seq); /* Stop timers */ ng_uncallout(&seq->rack_timer, priv->node); @@ -1299,9 +1292,6 @@ ng_l2tp_seq_reset(priv_p priv) seq->acks = 0; seq->rexmits = 0; bzero(seq->xwin, sizeof(seq->xwin)); - - /* Done */ - L2TP_SEQ_CHECK(seq); } /* @@ -1316,15 +1306,12 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) int i, j; uint16_t ns; - mtx_lock(&seq->mtx); + SEQ_LOCK_ASSERT(seq); /* Verify peer's ACK is in range */ - if ((nack = L2TP_SEQ_DIFF(nr, seq->rack)) <= 0) { - mtx_unlock(&seq->mtx); + if ((nack = L2TP_SEQ_DIFF(nr, seq->rack)) <= 0) return; /* duplicate ack */ - } if (L2TP_SEQ_DIFF(nr, seq->ns) > 0) { - mtx_unlock(&seq->mtx); priv->stats.recvBadAcks++; /* ack for packet not sent */ return; } @@ -1375,10 +1362,8 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) ng_uncallout(&seq->rack_timer, priv->node); /* If transmit queue is empty, we're done for now */ - if (seq->xwin[0] == NULL) { - mtx_unlock(&seq->mtx); + if (seq->xwin[0] == NULL) return; - } /* Start restransmit timer again */ ng_callout(&seq->rack_timer, priv->node, NULL, @@ -1396,8 +1381,6 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) seq->ns++; } - mtx_unlock(&seq->mtx); - /* * Send prepared. * If there is a memory error, pretend packet was sent, as it @@ -1407,8 +1390,10 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) struct mbuf *m; if ((m = L2TP_COPY_MBUF(xwin[i], M_NOWAIT)) == NULL) priv->stats.memoryFailures++; - else + else { ng_l2tp_xmit_ctrl(priv, m, ns); + SEQ_LOCK(seq); + } ns++; } } @@ -1428,17 +1413,13 @@ ng_l2tp_seq_xack_timeout(node_p node, hook_p hook, void *arg1, int arg2) (!callout_active(&seq->xack_timer))) return; - /* Sanity check */ - L2TP_SEQ_CHECK(seq); + SEQ_LOCK(seq); /* Send a ZLB */ ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); /* callout_deactivate() is not needed here as ng_uncallout() was called by ng_l2tp_xmit_ctrl() */ - - /* Sanity check */ - L2TP_SEQ_CHECK(seq); } /* @@ -1453,14 +1434,12 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) struct mbuf *m; u_int delay; - /* Sanity check */ - L2TP_SEQ_CHECK(seq); + SEQ_LOCK(seq); - mtx_lock(&seq->mtx); /* Make sure callout is still active before doing anything */ if (callout_pending(&seq->rack_timer) || !callout_active(&seq->rack_timer)) { - mtx_unlock(&seq->mtx); + SEQ_UNLOCK(seq); return; } @@ -1485,41 +1464,39 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) /* Retransmit oldest unack'd packet */ m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT); - mtx_unlock(&seq->mtx); - if (m == NULL) + if (m == NULL) { + SEQ_UNLOCK(seq); priv->stats.memoryFailures++; - else + } else ng_l2tp_xmit_ctrl(priv, m, seq->ns++); /* callout_deactivate() is not needed here as ng_callout() is getting called each time */ - - /* Sanity check */ - L2TP_SEQ_CHECK(seq); } /* * Transmit a control stream packet, payload optional. * The transmit sequence number is not incremented. + * Requires seq lock, returns unlocked. */ static int ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) { struct l2tp_seq *const seq = &priv->seq; uint8_t *p; - u_int16_t session_id = 0; + uint16_t nr, session_id = 0; int error; - mtx_lock(&seq->mtx); + SEQ_LOCK_ASSERT(seq); /* Stop ack timer: we're sending an ack with this packet. Doing this before to keep state predictable after error. */ if (callout_active(&seq->xack_timer)) ng_uncallout(&seq->xack_timer, priv->node); - seq->xack = seq->nr; + nr = seq->xack = seq->nr; - mtx_unlock(&seq->mtx); + SEQ_UNLOCK(seq); /* If no mbuf passed, send an empty packet (ZLB) */ if (m == NULL) { @@ -1570,8 +1547,8 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) p[7] = session_id & 0xff; p[8] = ns >> 8; p[9] = ns & 0xff; - p[10] = seq->nr >> 8; - p[11] = seq->nr & 0xff; + p[10] = nr >> 8; + p[11] = nr & 0xff; /* Update sequence number info and stats */ priv->stats.xmitPackets++; @@ -1594,7 +1571,7 @@ ng_l2tp_seq_check(struct l2tp_seq *seq) #define CHECK(p) KASSERT((p), ("%s: not: %s", __func__, #p)) - mtx_lock(&seq->mtx); + SEQ_LOCK_ASSERT(seq); self_unack = L2TP_SEQ_DIFF(seq->nr, seq->xack); peer_unack = L2TP_SEQ_DIFF(seq->ns, seq->rack); @@ -1617,8 +1594,6 @@ ng_l2tp_seq_check(struct l2tp_seq *seq) for ( ; i < seq->cwnd; i++) /* verify peer's recv window full */ CHECK(seq->xwin[i] == NULL); - mtx_unlock(&seq->mtx); - #undef CHECK } #endif /* INVARIANTS */ From owner-dev-commits-src-main@freebsd.org Fri Sep 10 18:28:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF7F3660970; Fri, 10 Sep 2021 18:28:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5krd5x86z4lGb; Fri, 10 Sep 2021 18:28:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0C2511CBB; Fri, 10 Sep 2021 18:28:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AIS15p077271; Fri, 10 Sep 2021 18:28:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AIS13U077270; Fri, 10 Sep 2021 18:28:01 GMT (envelope-from git) Date: Fri, 10 Sep 2021 18:28:01 GMT Message-Id: <202109101828.18AIS13U077270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 89042ff77668 - main - ng_l2tp: improve callout locking. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89042ff77668555e77c88549e6ba697088ee72f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 18:28:02 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=89042ff77668555e77c88549e6ba697088ee72f9 commit 89042ff77668555e77c88549e6ba697088ee72f9 Author: Gleb Smirnoff AuthorDate: 2021-08-06 23:04:31 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-10 18:27:19 +0000 ng_l2tp: improve callout locking. Apparently e62e4b85942 wasn't enough to close the race between a queue being flushed by a packet and callout executing, because the callouts used without a lock aren't 100% bulletproof. To close the race use callout_init_mtx() for L2TP timers, and make sure that all calls to ng_callout()/ng_uncallout() are done under the seq lock. If used properly, a locked callout can be used transparently with old netgraph KPI of ng_callout/ng_uncallout which predates locked callouts. While here, utilize ng_uncallout_drain() instead of ng_uncallout() on the node shutdown. PR: 241133 Reviewed by: mjg, markj Differential Revision: https://reviews.freebsd.org/D31476 --- sys/netgraph/ng_l2tp.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c index c62bde0c54f7..916f5db6c2ec 100644 --- a/sys/netgraph/ng_l2tp.c +++ b/sys/netgraph/ng_l2tp.c @@ -662,8 +662,8 @@ ng_l2tp_shutdown(node_p node) SEQ_UNLOCK(seq); /* Free private data if neither timer is running */ - ng_uncallout(&seq->rack_timer, node); - ng_uncallout(&seq->xack_timer, node); + ng_uncallout_drain(&seq->rack_timer, node); + ng_uncallout_drain(&seq->xack_timer, node); mtx_destroy(&seq->mtx); @@ -1192,9 +1192,9 @@ ng_l2tp_seq_init(priv_p priv) if (seq->wmax > L2TP_MAX_XWIN) seq->wmax = L2TP_MAX_XWIN; seq->ssth = seq->wmax; - ng_callout_init(&seq->rack_timer); - ng_callout_init(&seq->xack_timer); mtx_init(&seq->mtx, "ng_l2tp", NULL, MTX_DEF); + callout_init_mtx(&seq->rack_timer, &seq->mtx, CALLOUT_RETURNUNLOCKED); + callout_init_mtx(&seq->xack_timer, &seq->mtx, CALLOUT_RETURNUNLOCKED); } /* @@ -1408,12 +1408,9 @@ ng_l2tp_seq_xack_timeout(node_p node, hook_p hook, void *arg1, int arg2) const priv_p priv = NG_NODE_PRIVATE(node); struct l2tp_seq *const seq = &priv->seq; - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->xack_timer) || - (!callout_active(&seq->xack_timer))) - return; - - SEQ_LOCK(seq); + SEQ_LOCK_ASSERT(seq); + MPASS(!callout_pending(&seq->xack_timer)); + MPASS(callout_active(&seq->xack_timer)); /* Send a ZLB */ ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); @@ -1434,14 +1431,10 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) struct mbuf *m; u_int delay; - SEQ_LOCK(seq); - - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->rack_timer) || - !callout_active(&seq->rack_timer)) { - SEQ_UNLOCK(seq); - return; - } + SEQ_LOCK_ASSERT(seq); + MPASS(seq->xwin[0]); + MPASS(!callout_pending(&seq->rack_timer)); + MPASS(callout_active(&seq->rack_timer)); priv->stats.xmitRetransmits++; From owner-dev-commits-src-main@freebsd.org Fri Sep 10 18:32:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2546E661034; Fri, 10 Sep 2021 18:32:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5kyF3yptz4mW9; Fri, 10 Sep 2021 18:32:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 18AIWpPr001637 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 10 Sep 2021 11:32:51 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 18AIWpDS001636; Fri, 10 Sep 2021 11:32:51 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 10 Sep 2021 11:32:51 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: kp@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test Message-ID: References: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4H5kyF3yptz4mW9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 18:32:54 -0000 Mateusz, On Fri, Sep 10, 2021 at 09:43:06AM +0200, Mateusz Guzik wrote: M> > M> diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c M> > M> index e2dd3eb7c0de..add76c7b98d4 100644 M> > M> --- a/sys/netpfil/pf/pf.c M> > M> +++ b/sys/netpfil/pf/pf.c M> > M> @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, M> > struct mbuf **m0, struct inpcb * M> > M> M> > M> PF_RULES_RLOCK(); M> > M> M> > M> - if (ip_divert_ptr != NULL && M> > M> + if (__predict_false(ip_divert_ptr != NULL) && M> > M> > This is an optimization for a setup without divert(4) at cost of M> > pessimization M> > for a setup with divert(4). IMHO, __predict_false() predicate should guard M> > against error paths and other unusual events, not favor one setup over M> > other. M> > M> M> divert is non-standard and comes with tons of overhead, so I think M> this is justified. pf is also non-standard and comes with tons of overhead, so what about such change to ip_input(), and similar to ip_output(): diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 465c00e4dac..e6feb837114 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -605,7 +605,7 @@ ip_input(struct mbuf *m) */ /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED_IN(V_inet_pfil_head)) + if (__predict_true(!PFIL_HOOKED_IN(V_inet_pfil_head))) goto passin; odst = ip->ip_dst; I hope that brings my point. M> The real fix would be to either implement hot patchable branches or M> otherwise generate pf_test always (or never) doing divert without M> having to check for it, but that's far in the future. That would be great, but before we have such tools, I believe optimization for one particular setup at cost of pessimization of other setups is not a way to go. -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Sep 10 19:23:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92D39661D85; Fri, 10 Sep 2021 19:23:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5m4b1Dtrz3LRg; Fri, 10 Sep 2021 19:23:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 18AJNPGk001867 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 10 Sep 2021 12:23:25 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 18AJNPSo001866; Fri, 10 Sep 2021 12:23:25 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 10 Sep 2021 12:23:25 -0700 From: Gleb Smirnoff To: Kristof Provost , donner@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2e5ff01d0a1f - main - if_vlan: add the ALTQ support to if_vlan. Message-ID: References: <202108250804.17P84SCM025164@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108250804.17P84SCM025164@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4H5m4b1Dtrz3LRg X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 19:23:27 -0000 Kristof, On Wed, Aug 25, 2021 at 08:04:28AM +0000, Kristof Provost wrote: K> commit 2e5ff01d0a1fabc757252f9c28ad5cddc98a652d K> Author: Luiz Otavio O Souza K> AuthorDate: 2021-08-21 09:41:03 +0000 K> Commit: Kristof Provost K> CommitDate: 2021-08-25 06:56:45 +0000 K> K> if_vlan: add the ALTQ support to if_vlan. K> K> Inspired by the iflib implementation, allow ALTQ to be used with if_vlan K> interfaces. K> K> Reviewed by: donner K> Obtained from: pfsense K> MFC after: 1 week K> Sponsored by: Rubicon Communications, LLC ("Netgate") K> Differential Revision: https://reviews.freebsd.org/D31647 This was the last virtual interface standing without ALTQ. ng_iface(4), tun(4) fell much earlier. I found it fundumentally wrong to add queueing to a virtual interface. A virtual interface may classify traffic, but actual queueing should happen only at the point of physical bottlneck - the NIC. Anyway, if somebody builds useful setups with such hack, let it live. Same rationale was used when adding ALTQ to other virtual interfaces. Just grumbling. -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Sep 10 20:11:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96A4D6626B7; Fri, 10 Sep 2021 20:11:54 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5n8V3l3Mz3sDR; Fri, 10 Sep 2021 20:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6058A136FA; Fri, 10 Sep 2021 20:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AKBsev022350; Fri, 10 Sep 2021 20:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AKBsb3022349; Fri, 10 Sep 2021 20:11:54 GMT (envelope-from git) Date: Fri, 10 Sep 2021 20:11:54 GMT Message-Id: <202109102011.18AKBsb3022349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 3b96abbab033 - main - make: fix MAKE_JOB_ERROR_TOKEN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b96abbab03327176b1e4ee02a6742bf9807dd75 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 20:11:54 -0000 The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3b96abbab03327176b1e4ee02a6742bf9807dd75 commit 3b96abbab03327176b1e4ee02a6742bf9807dd75 Author: Simon J. Gerraty AuthorDate: 2021-09-10 20:11:28 +0000 Commit: Simon J. Gerraty CommitDate: 2021-09-10 20:11:28 +0000 make: fix MAKE_JOB_ERROR_TOKEN The rework of GetBooleanVar to GetBooleanExpr requires we add "${" and ":U}" around the expression so it can be directly evaluated. Reported by: mjg MFC after: 1 week # # 72 columns --| # # Uncomment and complete these metadata fields, as appropriate: # # PR: # Reported by: # Reviewed by: # Approved by: # Obtained from: # MFC after: # MFH: # Relnotes: # Security: # Sponsored by: # Pull Request: /pull/###> # Differential Revision: # # "Pull Request" and "Differential Revision" require the *full* GitHub or # Phabricator URL. The commit author should be set appropriately, using # `git commit --author` if someone besides the committer sent in the change. # # Uncomment and complete these metadata fields, as appropriate: # # PR: # Reported by: # Reviewed by: # Approved by: # Obtained from: # MFC after: # MFH: # Relnotes: # Security: # Sponsored by: # Pull Request: /pull/###> # Differential Revision: # # "Pull Request" and "Differential Revision" require the *full* GitHub or # Phabricator URL. The commit author should be set appropriately, using # `git commit --author` if someone besides the committer sent in the change. # --- contrib/bmake/job.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c index ba2e5c827b0c..e4b77477e816 100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@ -261,7 +261,7 @@ typedef struct ShellWriter { * pass jobs queue to sub-makes. * Use .MAKE.ALWAYS_PASS_JOB_QUEUE=no to disable. */ -#define MAKE_ALWAYS_PASS_JOB_QUEUE ".MAKE.ALWAYS_PASS_JOB_QUEUE" +#define MAKE_ALWAYS_PASS_JOB_QUEUE "${.MAKE.ALWAYS_PASS_JOB_QUEUE:U}" static bool Always_pass_job_queue = true; /* * FreeBSD: aborting entire parallel make isn't always @@ -269,7 +269,7 @@ static bool Always_pass_job_queue = true; * one architecture should not stop all. * We still want to bail on interrupt though. */ -#define MAKE_JOB_ERROR_TOKEN "MAKE_JOB_ERROR_TOKEN" +#define MAKE_JOB_ERROR_TOKEN "${MAKE_JOB_ERROR_TOKEN:U}" static bool Job_error_token = true; /* From owner-dev-commits-src-main@freebsd.org Fri Sep 10 21:27:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CAB0664DDC; Fri, 10 Sep 2021 21:27:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5prG2s2gz4k4X; Fri, 10 Sep 2021 21:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AEC614783; Fri, 10 Sep 2021 21:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ALRwOH020666; Fri, 10 Sep 2021 21:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ALRwOV020665; Fri, 10 Sep 2021 21:27:58 GMT (envelope-from git) Date: Fri, 10 Sep 2021 21:27:58 GMT Message-Id: <202109102127.18ALRwOV020665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 74a68313b503 - main - socket: Add macros to lock socket buffers using socket references MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74a68313b503940158a2e8e8f02626d7cdbdaff9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 21:27:58 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=74a68313b503940158a2e8e8f02626d7cdbdaff9 commit 74a68313b503940158a2e8e8f02626d7cdbdaff9 Author: Mark Johnston AuthorDate: 2021-09-10 21:20:39 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 21:20:39 +0000 socket: Add macros to lock socket buffers using socket references Since commit c67f3b8b78e50c6df7c057d6cf108e4d6b4312d0 the sockbuf mutexes belong to the containing socket. Sockbufs contain a pointer to a mutex, which by default is initialized to the corresponding mutexes in the socket. The SOCKBUF_LOCK() etc. macros operate on this pointer. However, the pointer is clobbered by listen(2) so it's not safe to use them unless one is sure that the socket is not a listening socket. This change introduces a new set of macros which lock socket buffers through the socket. This is a bit cheaper since it removes the pointer indirection, and allows one to safely lock socket buffers and then check for a listening socket. For MFC, these macros should be reimplemented in terms of the existing socket buffer layout. Reviewed by: tuexen, gallatin, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31900 --- sys/sys/sockbuf.h | 7 +++++-- sys/sys/socketvar.h | 30 ++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 3b345870bd5f..3fc9b10cd240 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -118,8 +118,11 @@ struct sockbuf { #ifdef _KERNEL /* - * Per-socket buffer mutex used to protect most fields in the socket - * buffer. + * Per-socket buffer mutex used to protect most fields in the socket buffer. + * These make use of the mutex pointer embedded in struct sockbuf, which + * currently just references mutexes in the containing socket. The + * SOCK_SENDBUF_LOCK() etc. macros can be used instead of or in combination with + * these locking macros. */ #define SOCKBUF_MTX(_sb) ((_sb)->sb_mtx) #define SOCKBUF_LOCK_INIT(_sb, _name) \ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 69dd1706e366..57913f7bbd65 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -77,8 +77,8 @@ enum socket_qstate { * Locking key to struct socket: * (a) constant after allocation, no locking required. * (b) locked by SOCK_LOCK(so). - * (cr) locked by SOCKBUF_LOCK(&so->so_rcv). - * (cs) locked by SOCKBUF_LOCK(&so->so_snd). + * (cr) locked by SOCK_RECVBUF_LOCK(so)/SOCKBUF_LOCK(&so->so_rcv). + * (cs) locked by SOCK_SENDBUF_LOCK(so)/SOCKBUF_LOCK(&so->so_snd). * (e) locked by SOLISTEN_LOCK() of corresponding listening socket. * (f) not locked since integer reads/writes are atomic. * (g) used only as a sleep/wakeup address, no value. @@ -255,6 +255,32 @@ struct socket { ("%s: %p not listening", __func__, (sol))); \ } while (0) +/* + * Socket buffer locks. These manipulate the same mutexes as SOCKBUF_LOCK() + * and related macros. + */ +#define SOCK_RECVBUF_MTX(so) \ + (&(so)->so_rcv_mtx) +#define SOCK_RECVBUF_LOCK(so) \ + mtx_lock(SOCK_RECVBUF_MTX(so)) +#define SOCK_RECVBUF_UNLOCK(so) \ + mtx_unlock(SOCK_RECVBUF_MTX(so)) +#define SOCK_RECVBUF_LOCK_ASSERT(so) \ + mtx_assert(SOCK_RECVBUF_MTX(so), MA_OWNED) +#define SOCK_RECVBUF_UNLOCK_ASSERT(so) \ + mtx_assert(SOCK_RECVBUF_MTX(so), MA_NOTOWNED) + +#define SOCK_SENDBUF_MTX(so) \ + (&(so)->so_snd_mtx) +#define SOCK_SENDBUF_LOCK(so) \ + mtx_lock(SOCK_SENDBUF_MTX(so)) +#define SOCK_SENDBUF_UNLOCK(so) \ + mtx_unlock(SOCK_SENDBUF_MTX(so)) +#define SOCK_SENDBUF_LOCK_ASSERT(so) \ + mtx_assert(SOCK_SENDBUF_MTX(so), MA_OWNED) +#define SOCK_SENDBUF_UNLOCK_ASSERT(so) \ + mtx_assert(SOCK_SENDBUF_MTX(so), MA_NOTOWNED) + /* * Macros for sockets and socket buffering. */ From owner-dev-commits-src-main@freebsd.org Fri Sep 10 21:27:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A20E1664FD9; Fri, 10 Sep 2021 21:27:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5prH3Gckz4k2S; Fri, 10 Sep 2021 21:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA5D1468D; Fri, 10 Sep 2021 21:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ALRxPt020690; Fri, 10 Sep 2021 21:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ALRx1g020689; Fri, 10 Sep 2021 21:27:59 GMT (envelope-from git) Date: Fri, 10 Sep 2021 21:27:59 GMT Message-Id: <202109102127.18ALRx1g020689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 141fe2dceeae - main - aio: Interlock with listen(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 141fe2dceeaeefaaffc2242c8652345a081e825a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 21:27:59 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=141fe2dceeaeefaaffc2242c8652345a081e825a commit 141fe2dceeaeefaaffc2242c8652345a081e825a Author: Mark Johnston AuthorDate: 2021-09-10 21:21:11 +0000 Commit: Mark Johnston CommitDate: 2021-09-10 21:21:11 +0000 aio: Interlock with listen(2) soo_aio_queue() did not handle the possibility that the provided socket is a listening socket. Up until recently, to fix this one would have to acquire the socket lock first and check, since the socket buffer locks were destroyed by listen(2). Now that the socket buffer locks belong to the socket, simply check SOLISTENING(so) after acquiring them, and make listen(2) return an error if any AIO jobs are enqueued on the socket. Add a couple of simple regression test cases. Note that this fixes things only for the default AIO implementation; cxgbe(4)'s TCP offload has a separate pru_aio_queue implementation which requires its own solution. Reported by: syzbot+c8aa122fa2c6a4e2a28b@syzkaller.appspotmail.com Reported by: syzbot+39af117d43d4f0faf512@syzkaller.appspotmail.com Reported by: syzbot+60cceb9569145a0b993b@syzkaller.appspotmail.com Reported by: syzbot+2d522c5db87710277ca5@syzkaller.appspotmail.com Reviewed by: tuexen, gallatin, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31901 --- sys/kern/sys_socket.c | 12 +++++++- sys/kern/uipc_socket.c | 7 +++++ tests/sys/aio/aio_test.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index e53b0367960b..83dc1cb2622b 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -808,18 +808,28 @@ soo_aio_queue(struct file *fp, struct kaiocb *job) if (error == 0) return (0); + /* Lock through the socket, since this may be a listening socket. */ switch (job->uaiocb.aio_lio_opcode & (LIO_WRITE | LIO_READ)) { case LIO_READ: sb = &so->so_rcv; + SOCK_RECVBUF_LOCK(so); break; case LIO_WRITE: sb = &so->so_snd; + SOCK_SENDBUF_LOCK(so); break; default: return (EINVAL); } - SOCKBUF_LOCK(sb); + if (SOLISTENING(so)) { + if (sb == &so->so_rcv) + SOCK_RECVBUF_UNLOCK(so); + else + SOCK_SENDBUF_UNLOCK(so); + return (EINVAL); + } + if (!aio_set_cancel_function(job, soo_aio_cancel)) panic("new job was cancelled"); TAILQ_INSERT_TAIL(&sb->sb_aiojobq, job, list); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index a502b06ce00e..cbddd80e0546 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -928,6 +928,13 @@ solisten_proto_check(struct socket *so) } mtx_lock(&so->so_snd_mtx); mtx_lock(&so->so_rcv_mtx); + + /* Interlock with soo_aio_queue(). */ + if ((so->so_snd.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0 || + (so->so_rcv.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0) { + solisten_proto_abort(so); + return (EINVAL); + } return (0); } diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index 1c694ad0c18b..a81cb906e38a 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -40,11 +40,12 @@ */ #include +#include #include #include #include #include -#include +#include #include #include @@ -1177,6 +1178,79 @@ ATF_TC_BODY(aio_socket_blocking_short_write_vectored, tc) aio_socket_blocking_short_write_test(true); } +/* + * Verify that AIO requests fail when applied to a listening socket. + */ +ATF_TC_WITHOUT_HEAD(aio_socket_listen_fail); +ATF_TC_BODY(aio_socket_listen_fail, tc) +{ + struct aiocb iocb; + struct sockaddr_un sun; + char buf[16]; + int s; + + s = socket(AF_LOCAL, SOCK_STREAM, 0); + ATF_REQUIRE(s != -1); + + memset(&sun, 0, sizeof(sun)); + snprintf(sun.sun_path, sizeof(sun.sun_path), "%s", "listen.XXXXXX"); + mktemp(sun.sun_path); + sun.sun_family = AF_LOCAL; + sun.sun_len = SUN_LEN(&sun); + + ATF_REQUIRE(bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) == 0); + ATF_REQUIRE(listen(s, 5) == 0); + + memset(buf, 0, sizeof(buf)); + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s; + iocb.aio_buf = buf; + iocb.aio_nbytes = sizeof(buf); + + ATF_REQUIRE_ERRNO(EINVAL, aio_read(&iocb) == -1); + ATF_REQUIRE_ERRNO(EINVAL, aio_write(&iocb) == -1); + + ATF_REQUIRE(unlink(sun.sun_path) == 0); + close(s); +} + +/* + * Verify that listen(2) fails if a socket has pending AIO requests. + */ +ATF_TC_WITHOUT_HEAD(aio_socket_listen_pending); +ATF_TC_BODY(aio_socket_listen_pending, tc) +{ + struct aiocb iocb; + struct sockaddr_un sun; + char buf[16]; + int s; + + s = socket(AF_LOCAL, SOCK_STREAM, 0); + ATF_REQUIRE(s != -1); + + memset(&sun, 0, sizeof(sun)); + snprintf(sun.sun_path, sizeof(sun.sun_path), "%s", "listen.XXXXXX"); + mktemp(sun.sun_path); + sun.sun_family = AF_LOCAL; + sun.sun_len = SUN_LEN(&sun); + + ATF_REQUIRE(bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) == 0); + + memset(buf, 0, sizeof(buf)); + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s; + iocb.aio_buf = buf; + iocb.aio_nbytes = sizeof(buf); + ATF_REQUIRE(aio_read(&iocb) == 0); + + ATF_REQUIRE_ERRNO(EINVAL, listen(s, 5) == -1); + + ATF_REQUIRE(aio_cancel(s, &iocb) != -1); + + ATF_REQUIRE(unlink(sun.sun_path) == 0); + close(s); +} + /* * This test verifies that cancelling a partially completed socket write * returns a short write rather than ECANCELED. @@ -1808,6 +1882,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_socket_two_reads); ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write); ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write_vectored); + ATF_TP_ADD_TC(tp, aio_socket_listen_fail); + ATF_TP_ADD_TC(tp, aio_socket_listen_pending); ATF_TP_ADD_TC(tp, aio_socket_short_write_cancel); ATF_TP_ADD_TC(tp, aio_writev_dos_iov_len); ATF_TP_ADD_TC(tp, aio_writev_dos_iovcnt); From owner-dev-commits-src-main@freebsd.org Fri Sep 10 21:55:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D8C366532C; Fri, 10 Sep 2021 21:55:15 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5qRk6hDNz4rDg; Fri, 10 Sep 2021 21:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2EB214B79; Fri, 10 Sep 2021 21:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ALtEZa059972; Fri, 10 Sep 2021 21:55:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ALtEq3059971; Fri, 10 Sep 2021 21:55:14 GMT (envelope-from git) Date: Fri, 10 Sep 2021 21:55:14 GMT Message-Id: <202109102155.18ALtEq3059971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c96b4d87ba33 - main - pkg: fix regression that breaks bootstrap from not a current directory. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c96b4d87ba3336e6d4bea04c49d6abde158b7aae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 21:55:15 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c96b4d87ba3336e6d4bea04c49d6abde158b7aae commit c96b4d87ba3336e6d4bea04c49d6abde158b7aae Author: Gleb Smirnoff AuthorDate: 2021-09-10 21:49:17 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-10 21:49:17 +0000 pkg: fix regression that breaks bootstrap from not a current directory. Fixes: 40b9f924b18 Reviewed by: kevans --- usr.sbin/pkg/pkg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 1196c78e5cc9..292f4a68b824 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -1063,9 +1063,13 @@ cleanup: static bool pkg_is_pkg_pkg(const char *pkg) { - char *vstart; + char *vstart, *basename; size_t namelen; + /* Strip path. */ + if ((basename = strrchr(pkg, '/')) != NULL) + pkg = basename + 1; + /* * Chop off the final "-" (version delimiter) and check the name that * precedes it. If we didn't have a version delimiter, it must be the From owner-dev-commits-src-main@freebsd.org Fri Sep 10 22:11:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66848665BFD; Fri, 10 Sep 2021 22:11:13 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5qp91wvsz4vHX; Fri, 10 Sep 2021 22:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2204514EA6; Fri, 10 Sep 2021 22:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18AMBDjX083025; Fri, 10 Sep 2021 22:11:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18AMBDOE083024; Fri, 10 Sep 2021 22:11:13 GMT (envelope-from git) Date: Fri, 10 Sep 2021 22:11:13 GMT Message-Id: <202109102211.18AMBDOE083024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4d4cf62e29b0 - main - cxgbei: Handle errors in PDUs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d4cf62e29b06a763dfa8b218de38c8d2cf051bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 22:11:13 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d4cf62e29b06a763dfa8b218de38c8d2cf051bb commit 4d4cf62e29b06a763dfa8b218de38c8d2cf051bb Author: John Baldwin AuthorDate: 2021-09-10 22:10:00 +0000 Commit: John Baldwin CommitDate: 2021-09-10 22:10:00 +0000 cxgbei: Handle errors in PDUs. When a PDU with an error (bad padding, header digest, or data digest) is received, log the error via ICL_WARN() and then reset the connection via the ic_error callback. While here, add per-rxq counters for errors. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 3 ++ sys/dev/cxgbe/cxgbei/cxgbei.c | 67 ++++++++++++++++++++++++++++++++++--------- sys/dev/cxgbe/cxgbei/cxgbei.h | 3 -- sys/dev/cxgbe/t4_sge.c | 9 ++++++ 4 files changed, 65 insertions(+), 17 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 14bc6cd9c36a..6b25dff7081a 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -674,6 +674,9 @@ struct sge_ofld_rxq { uint64_t rx_iscsi_ddp_octets; uint64_t rx_iscsi_fl_pdus; uint64_t rx_iscsi_fl_octets; + uint64_t rx_iscsi_padding_errors; + uint64_t rx_iscsi_header_digest_errors; + uint64_t rx_iscsi_data_digest_errors; u_long rx_toe_tls_records; u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 2fa38f941b91..bd34e6a2a149 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -335,12 +335,21 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) icp->icp_flags |= ICPF_RX_STATUS; ip = &icp->ip; - if (val & F_DDP_PADDING_ERR) - icp->icp_flags |= ICPF_PAD_ERR; - if (val & F_DDP_HDRCRC_ERR) - icp->icp_flags |= ICPF_HCRC_ERR; - if (val & F_DDP_DATACRC_ERR) - icp->icp_flags |= ICPF_DCRC_ERR; + if (val & F_DDP_PADDING_ERR) { + ICL_WARN("received PDU 0x%02x with invalid padding", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_padding_errors++; + } + if (val & F_DDP_HDRCRC_ERR) { + ICL_WARN("received PDU 0x%02x with invalid header digest", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_header_digest_errors++; + } + if (val & F_DDP_DATACRC_ERR) { + ICL_WARN("received PDU 0x%02x with invalid data digest", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_data_digest_errors++; + } if (val & F_DDP_PDU && ip->ip_data_mbuf == NULL) { MPASS((icp->icp_flags & ICPF_RX_FLBUF) == 0); MPASS(ip->ip_data_len > 0); @@ -400,6 +409,16 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) } MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); ic = &icc->ic; + if ((val & (F_DDP_PADDING_ERR | F_DDP_HDRCRC_ERR | + F_DDP_DATACRC_ERR)) != 0) { + SOCKBUF_UNLOCK(sb); + INP_WUNLOCK(inp); + + icl_cxgbei_conn_pdu_free(NULL, ip); + toep->ulpcb2 = NULL; + ic->ic_error(ic); + return (0); + } icl_cxgbei_new_pdu_set_conn(ip, ic); MPASS(m == NULL); /* was unused, we'll use it now. */ @@ -514,12 +533,21 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) icp->icp_flags |= ICPF_RX_HDR; icp->icp_flags |= ICPF_RX_STATUS; - if (val & F_DDP_PADDING_ERR) - icp->icp_flags |= ICPF_PAD_ERR; - if (val & F_DDP_HDRCRC_ERR) - icp->icp_flags |= ICPF_HCRC_ERR; - if (val & F_DDP_DATACRC_ERR) - icp->icp_flags |= ICPF_DCRC_ERR; + if (val & F_DDP_PADDING_ERR) { + ICL_WARN("received PDU 0x%02x with invalid padding", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_padding_errors++; + } + if (val & F_DDP_HDRCRC_ERR) { + ICL_WARN("received PDU 0x%02x with invalid header digest", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_header_digest_errors++; + } + if (val & F_DDP_DATACRC_ERR) { + ICL_WARN("received PDU 0x%02x with invalid data digest", + ip->ip_bhs->bhs_opcode); + toep->ofld_rxq->rx_iscsi_data_digest_errors++; + } INP_WLOCK(inp); if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT))) { @@ -557,6 +585,19 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) return (0); } + MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); + ic = &icc->ic; + if ((val & (F_DDP_PADDING_ERR | F_DDP_HDRCRC_ERR | + F_DDP_DATACRC_ERR)) != 0) { + INP_WUNLOCK(inp); + + icl_cxgbei_conn_pdu_free(NULL, ip); + toep->ulpcb2 = NULL; + m_freem(m); + ic->ic_error(ic); + return (0); + } + data_digest_len = (icc->ulp_submode & ULP_CRC_DATA) ? ISCSI_DATA_DIGEST_SIZE : 0; hdr_digest_len = (icc->ulp_submode & ULP_CRC_HEADER) ? @@ -658,8 +699,6 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) m_freem(m); return (0); } - MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); - ic = &icc->ic; icl_cxgbei_new_pdu_set_conn(ip, ic); /* Enqueue the PDU to the received pdus queue. */ diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 09d556988091..58a5dac6d63b 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -96,9 +96,6 @@ enum { ICPF_RX_FLBUF = 1 << 1, /* PDU payload received in a freelist. */ ICPF_RX_DDP = 1 << 2, /* PDU payload DDP'd. */ ICPF_RX_STATUS = 1 << 3, /* Rx status received. */ - ICPF_HCRC_ERR = 1 << 4, /* Header digest error. */ - ICPF_DCRC_ERR = 1 << 5, /* Data digest error. */ - ICPF_PAD_ERR = 1 << 6, /* Padding error. */ CXGBEI_PDU_SIGNATURE = 0x12344321 }; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 5093c84516bc..d927d34b616b 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4163,6 +4163,15 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_U64(ctx, children, OID_AUTO, "fl_pdus", CTLFLAG_RD, &ofld_rxq->rx_iscsi_fl_pdus, 0, "# of PDUs with data delivered in freelist"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "padding_errors", + CTLFLAG_RD, &ofld_rxq->rx_iscsi_padding_errors, 0, + "# of PDUs with invalid padding"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "header_digest_errors", + CTLFLAG_RD, &ofld_rxq->rx_iscsi_header_digest_errors, 0, + "# of PDUs with invalid header digests"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "data_digest_errors", + CTLFLAG_RD, &ofld_rxq->rx_iscsi_data_digest_errors, 0, + "# of PDUs with invalid data digests"); } #endif From owner-dev-commits-src-main@freebsd.org Sat Sep 11 01:05:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79EF8668387; Sat, 11 Sep 2021 01:05:15 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5vfz2rsmz4h8P; Sat, 11 Sep 2021 01:05:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DAAA1705B; Sat, 11 Sep 2021 01:05:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18B15Fq2015544; Sat, 11 Sep 2021 01:05:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18B15FOd015543; Sat, 11 Sep 2021 01:05:15 GMT (envelope-from git) Date: Sat, 11 Sep 2021 01:05:15 GMT Message-Id: <202109110105.18B15FOd015543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 71a1ae7cebd3 - main - Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71a1ae7cebd3791d4d18ac9620a7a4ce8cf15819 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 01:05:15 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=71a1ae7cebd3791d4d18ac9620a7a4ce8cf15819 commit 71a1ae7cebd3791d4d18ac9620a7a4ce8cf15819 Merge: 4d4cf62e29b0 cd355e3667c6 Author: Alan Somers AuthorDate: 2021-09-10 23:08:42 +0000 Commit: Alan Somers CommitDate: 2021-09-10 23:08:42 +0000 Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542 The main improvement is the ability to skip a test that is expected to fail. contrib/atf/atf-c/atf-c.3 | 27 ++++++++++++++++++++++----- contrib/atf/atf-c/macros.h | 19 +++++++++++++++++++ contrib/atf/atf-c/tc.c | 12 +++--------- contrib/atf/atf-sh/atf-check.cpp | 4 ++-- contrib/atf/atf-sh/atf-sh.3 | 12 ++++++------ 5 files changed, 52 insertions(+), 22 deletions(-) From owner-dev-commits-src-main@freebsd.org Sat Sep 11 12:05:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CB96671103; Sat, 11 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6BJN2TqZz3wJq; Sat, 11 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 356DD2012B; Sat, 11 Sep 2021 12:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BC58Sx097259; Sat, 11 Sep 2021 12:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BC58ls097258; Sat, 11 Sep 2021 12:05:08 GMT (envelope-from git) Date: Sat, 11 Sep 2021 12:05:08 GMT Message-Id: <202109111205.18BC58ls097258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 3703c1888334 - main - md: Add MD_MUSTDEALLOC support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3703c18883341f3ff09c42d7f3b36ab80e4a071b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 12:05:08 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=3703c18883341f3ff09c42d7f3b36ab80e4a071b commit 3703c18883341f3ff09c42d7f3b36ab80e4a071b Author: Ka Ho Ng AuthorDate: 2021-09-11 12:03:38 +0000 Commit: Ka Ho Ng CommitDate: 2021-09-11 12:04:52 +0000 md: Add MD_MUSTDEALLOC support This adds an option to detect if hole-punching is implemented by the underlying file system. If this flag is set, and if the underlying file system does not support hole-punching, md(4) fails BIO_DELETE requests with EOPNOTSUPP. Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31883 --- sbin/mdconfig/mdconfig.8 | 35 +++++++++++++++++++++++++++++++++-- sbin/mdconfig/mdconfig.c | 7 ++++++- sys/dev/md/md.c | 18 ++++++++++++++++-- sys/sys/mdioctl.h | 1 + 4 files changed, 56 insertions(+), 5 deletions(-) diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8 index 6d9da8159723..775823fd0bc7 100644 --- a/sbin/mdconfig/mdconfig.8 +++ b/sbin/mdconfig/mdconfig.8 @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2020 +.Dd August 27, 2021 .Dt MDCONFIG 8 .Os .Sh NAME @@ -246,6 +246,34 @@ This can be used with the flag to forcibly destroy an .Xr md 4 disk that is still in use. +.It Oo Cm no Oc Ns Cm mustdealloc +For +.Cm vnode +backed devices: detect whether hole-punching is supported by the underlying file +system. +If the file system supports hole-punching, then to handle a +.Dv BIO_DELETE +request, some or all of the request's operation range may be turned into a hole +in the file used for backing store. +Any parts which are not turned into holes are zero-filled in +the file. +If the file system does not support +hole-punching, +.Dv BIO_DELETE +requests to the device are not handled and will fail with +.Er EOPNOTSUPP . +.Pp +When +.Cm mustdealloc +is not specified or +.Oo Cm no Oc Ns Cm mustdealloc +is specified, for a +.Dv BIO_DELETE +request, if the file system supports hole-punching, some or all of the request's +operation range may be turned into a hole in the file used for backing store. +Any parts which are not turned into holes are zero-filled in the file. +If the file system of the vnode type memory disk does not support hole-punching, +the request's operation range is zero-filled in the file. .It Oo Cm no Oc Ns Cm readonly Enable/disable readonly mode. .It Oo Cm no Oc Ns Cm verify @@ -339,12 +367,15 @@ gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO +.Xr fpathconf 2 , +.Xr fspacectl 2 , .Xr open 2 , .Xr md 4 , .Xr ffs 7 , .Xr gpart 8 , .Xr mdmfs 8 , -.Xr malloc 9 +.Xr malloc 9 , +.Xr vn_deallocate 9 .Sh HISTORY The .Nm diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 0f76ca6149f1..9f4f3fc3a392 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -89,7 +89,8 @@ usage(void) " mdconfig file\n"); fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); fprintf(stderr, "\t\toption = {cache, cluster, compress, force,\n"); - fprintf(stderr, "\t\t readonly, reserve, ro, verify}\n"); + fprintf(stderr, "\t\t mustdealloc, readonly, reserve, ro,\n"); + fprintf(stderr, "\t\t 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"); @@ -194,6 +195,10 @@ main(int argc, char **argv) mdio.md_options |= MD_FORCE; else if (!strcmp(optarg, "noforce")) mdio.md_options &= ~MD_FORCE; + else if (!strcmp(optarg, "mustdealloc")) + mdio.md_options |= MD_MUSTDEALLOC; + else if (!strcmp(optarg, "nomustdealloc")) + mdio.md_options &= ~MD_MUSTDEALLOC; else if (!strcmp(optarg, "readonly")) mdio.md_options |= MD_READONLY; else if (!strcmp(optarg, "noreadonly")) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 08fb4b0c6574..92d93f0f0f1d 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -90,6 +90,7 @@ #include #include #include +#include #include #include @@ -259,6 +260,7 @@ struct md_s { struct g_provider *pp; int (*start)(struct md_s *sc, struct bio *bp); struct devstat *devstat; + bool candelete; /* MD_MALLOC related fields */ struct indir *indir; @@ -885,9 +887,12 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) case BIO_WRITE: auio.uio_rw = UIO_WRITE; break; - case BIO_DELETE: case BIO_FLUSH: break; + case BIO_DELETE: + if (sc->candelete) + break; + /* FALLTHROUGH */ default: return (EOPNOTSUPP); } @@ -1176,7 +1181,7 @@ md_handleattr(struct md_s *sc, struct bio *bp) (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) != 0 || g_handleattr_int(bp, "GEOM::fwheads", sc->fwheads) != 0)) return; - if (g_handleattr_int(bp, "GEOM::candelete", 1) != 0) + if (g_handleattr_int(bp, "GEOM::candelete", sc->candelete) != 0) return; if (sc->ident[0] != '\0' && g_handleattr_str(bp, "GEOM::ident", sc->ident) != 0) @@ -1405,6 +1410,7 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td) struct nameidata nd; char *fname; int error, flags; + long v; fname = mdr->md_file; if (mdr->md_file_seg == UIO_USERSPACE) { @@ -1434,6 +1440,13 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td) error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred); if (error != 0) goto bad; + if ((mdr->md_options & MD_MUSTDEALLOC) != 0) { + error = VOP_PATHCONF(nd.ni_vp, _PC_DEALLOC_PRESENT, &v); + if (error != 0) + goto bad; + if (v == 0) + sc->candelete = false; + } if (VOP_ISLOCKED(nd.ni_vp) != LK_EXCLUSIVE) { vn_lock(nd.ni_vp, LK_UPGRADE | LK_RETRY); if (VN_IS_DOOMED(nd.ni_vp)) { @@ -1690,6 +1703,7 @@ kern_mdattach_locked(struct thread *td, struct md_req *mdr) mdr->md_unit = sc->unit; sc->mediasize = mdr->md_mediasize; sc->sectorsize = sectsize; + sc->candelete = true; error = EDOOFUS; switch (sc->type) { case MD_MALLOC: diff --git a/sys/sys/mdioctl.h b/sys/sys/mdioctl.h index 9e0b0c995341..97464c11149b 100644 --- a/sys/sys/mdioctl.h +++ b/sys/sys/mdioctl.h @@ -92,5 +92,6 @@ struct md_ioctl { #define MD_ASYNC 0x40 /* Asynchronous mode */ #define MD_VERIFY 0x80 /* Open file with O_VERIFY (vnode only) */ #define MD_CACHE 0x100 /* Cache vnode data */ +#define MD_MUSTDEALLOC 0x200 /* BIO_DELETE only if dealloc is available */ #endif /* _SYS_MDIOCTL_H_*/ From owner-dev-commits-src-main@freebsd.org Sat Sep 11 12:27:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFFF26716B9; Sat, 11 Sep 2021 12:27:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6Bp75XCmz4Vls; Sat, 11 Sep 2021 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E76520706; Sat, 11 Sep 2021 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BCRReH024586; Sat, 11 Sep 2021 12:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BCRRvW024585; Sat, 11 Sep 2021 12:27:27 GMT (envelope-from git) Date: Sat, 11 Sep 2021 12:27:27 GMT Message-Id: <202109111227.18BCRRvW024585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: 895545d0e666 - main - Fix spelling of BUILDENV_SHELL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 895545d0e6664ad05fefe63ce46eb670be7e4957 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 12:27:27 -0000 The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=895545d0e6664ad05fefe63ce46eb670be7e4957 commit 895545d0e6664ad05fefe63ce46eb670be7e4957 Author: Doug Rabson AuthorDate: 2021-09-11 12:03:52 +0000 Commit: Doug Rabson CommitDate: 2021-09-11 12:27:11 +0000 Fix spelling of BUILDENV_SHELL --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 478824675382..8134bb93df03 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1219,7 +1219,7 @@ BUILDENV_DIR?= ${.CURDIR} # Note: make will report any errors the shell reports. This can # be odd if the last command in an interactive shell generates an # error or is terminated by SIGINT. These reported errors look bad, -# but are harmless. Allowing them also allows BUIDLENV_SHELL to +# but are harmless. Allowing them also allows BUILDENV_SHELL to # be a complex command whose status will be returned to the caller. # Some scripts in tools rely on this behavior to report build errors. # From owner-dev-commits-src-main@freebsd.org Sat Sep 11 14:16:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D41A672C9E; Sat, 11 Sep 2021 14:16:21 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6FCn2f9xz3HQm; Sat, 11 Sep 2021 14:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BBF421BCD; Sat, 11 Sep 2021 14:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BEGLtX071533; Sat, 11 Sep 2021 14:16:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BEGLqm071532; Sat, 11 Sep 2021 14:16:21 GMT (envelope-from git) Date: Sat, 11 Sep 2021 14:16:21 GMT Message-Id: <202109111416.18BEGLqm071532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2d5c48eccd9f - main - sctp: Tighten up locking around sctp_aloc_assoc() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d5c48eccd9f29b9df8020bb1c3a8ffda38df37b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 14:16:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2d5c48eccd9f29b9df8020bb1c3a8ffda38df37b commit 2d5c48eccd9f29b9df8020bb1c3a8ffda38df37b Author: Mark Johnston AuthorDate: 2021-09-11 14:15:21 +0000 Commit: Mark Johnston CommitDate: 2021-09-11 14:15:21 +0000 sctp: Tighten up locking around sctp_aloc_assoc() All callers of sctp_aloc_assoc() mark the PCB as connected after a successful call (for one-to-one-style sockets). In all cases this is done without the PCB lock, so the PCB's flags can be corrupted. We also do not atomically check whether a one-to-one-style socket is a listening socket, which violates various assumptions in solisten_proto(). We need to hold the PCB lock across all of sctp_aloc_assoc() to fix this. In order to do that without introducing lock order reversals, we have to hold the global info lock as well. So: - Convert sctp_aloc_assoc() so that the inp and info locks are consistently held. It returns with the association lock held, as before. - Fix an apparent bug where we failed to remove an association from a global hash if sctp_add_remote_addr() fails. - sctp_select_a_tag() is called when initializing an association, and it acquires the global info lock. To avoid lock recursion, push locking into its callers. - Introduce sctp_aloc_assoc_connected(), which atomically checks for a listening socket and sets SCTP_PCB_FLAGS_CONNECTED. There is still one edge case in sctp_process_cookie_new() where we do not update PCB/socket state correctly. Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31908 --- sys/netinet/sctp_input.c | 4 ++ sys/netinet/sctp_output.c | 14 +++---- sys/netinet/sctp_pcb.c | 96 +++++++++++++++++++++++++++++---------------- sys/netinet/sctp_pcb.h | 4 ++ sys/netinet/sctp_usrreq.c | 14 +------ sys/netinet6/sctp6_usrreq.c | 7 +--- 6 files changed, 78 insertions(+), 61 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 34f30799ec79..9e194d5fda78 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -679,7 +679,9 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { + SCTP_INP_INFO_RLOCK(); new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); + SCTP_INP_INFO_RLOCK(); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); @@ -2183,6 +2185,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, * INIT/INIT-ACK/COOKIE arrived. But of course then it * should have went to the other code.. not here.. oh well.. * a bit of protection is worth having.. + * + * XXXMJ unlocked */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; soisconnected(stcb->sctp_socket); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 6ae35ae2deba..35a834438895 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5817,7 +5817,9 @@ do_a_abort: atomic_add_int(&asoc->refcnt, 1); SCTP_TCB_UNLOCK(stcb); new_tag: + SCTP_INP_INFO_RLOCK(); vtag = sctp_select_a_tag(inp, inp->sctp_lport, sh->src_port, 1); + SCTP_INP_INFO_RUNLOCK(); if ((asoc->peer_supports_nat) && (vtag == asoc->my_vtag)) { /* * Got a duplicate vtag on some guy behind a @@ -5834,7 +5836,9 @@ do_a_abort: } else { SCTP_INP_INCR_REF(inp); SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_RLOCK(); vtag = sctp_select_a_tag(inp, inp->sctp_lport, sh->src_port, 1); + SCTP_INP_INFO_RUNLOCK(); initack->init.initiate_tag = htonl(vtag); /* get a TSN to use too */ initack->init.initial_tsn = htonl(sctp_select_initial_TSN(&inp->sctp_ep)); @@ -12722,7 +12726,7 @@ sctp_lower_sosend(struct socket *so, panic("Error, should hold create lock and I don't?"); } #endif - stcb = sctp_aloc_assoc(inp, addr, &error, 0, 0, vrf_id, + stcb = sctp_aloc_assoc_connected(inp, addr, &error, 0, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, p, @@ -12731,14 +12735,6 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* - * Set the connected flag so we can queue - * data - */ - soisconnecting(so); - } hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 6ccd4ddf96b7..a33acce4380b 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -1546,10 +1546,6 @@ sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int struct sctp_tcb *stcb; uint32_t id; - if (inp == NULL) { - SCTP_PRINTF("TSNH ep_associd\n"); - return (NULL); - } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { SCTP_PRINTF("TSNH ep_associd0\n"); return (NULL); @@ -4151,8 +4147,8 @@ try_again: * careful to add all additional addresses once they are know right away or * else the assoc will be may experience a blackout scenario. */ -struct sctp_tcb * -sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, +static struct sctp_tcb * +sctp_aloc_assoc_locked(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_streams, uint16_t port, struct thread *p, @@ -4166,6 +4162,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, uint16_t rport; int err; + SCTP_INP_INFO_WLOCK_ASSERT(); + SCTP_INP_WLOCK_ASSERT(inp); + /* * Assumption made here: Caller has done a * sctp_findassociation_ep_addr(ep, addr's); to make sure the @@ -4182,7 +4181,11 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, *error = EINVAL; return (NULL); } - SCTP_INP_RLOCK(inp); + if (inp->sctp_flags & (SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); + *error = EINVAL; + return (NULL); + } if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) && ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE)) || (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED))) { @@ -4192,7 +4195,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, * sctp_aloc_assoc.. or the one-2-many socket. If a peeled * off, or connected one does this.. its an error. */ - SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); *error = EINVAL; return (NULL); @@ -4201,7 +4203,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) || (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED)) { - SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); *error = EINVAL; return (NULL); @@ -4245,7 +4246,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) != 0) && (SCTP_IPV6_V6ONLY(inp) != 0))) { /* Invalid address */ - SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); *error = EINVAL; return (NULL); @@ -4265,7 +4265,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) || ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)) { /* Invalid address */ - SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); *error = EINVAL; return (NULL); @@ -4276,18 +4275,16 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, #endif default: /* not supported family type */ - SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); *error = EINVAL; return (NULL); } - SCTP_INP_RUNLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { /* * If you have not performed a bind, then we need to do the * ephemeral bind for you. */ - if ((err = sctp_inpcb_bind(inp->sctp_socket, NULL, NULL, p))) { + if ((err = sctp_inpcb_bind_locked(inp, NULL, NULL, p))) { /* bind error, probably perm */ *error = err; return (NULL); @@ -4320,21 +4317,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, *error = err; return (NULL); } - /* and the port */ - SCTP_INP_INFO_WLOCK(); - SCTP_INP_WLOCK(inp); - if (inp->sctp_flags & (SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { - /* inpcb freed while alloc going on */ - SCTP_TCB_LOCK_DESTROY(stcb); - SCTP_TCB_SEND_LOCK_DESTROY(stcb); - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); - SCTP_INP_WUNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_DECR_ASOC_COUNT(); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - *error = EINVAL; - return (NULL); - } SCTP_TCB_LOCK(stcb); asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); @@ -4342,7 +4324,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* put it in the bucket in the vtag hash of assoc's for the system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - SCTP_INP_INFO_WUNLOCK(); if (sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC)) { /* failure.. memory error? */ @@ -4362,6 +4343,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, SCTP_TCB_UNLOCK(stcb); SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); + LIST_REMOVE(stcb, sctp_asocs); LIST_REMOVE(stcb, sctp_tcbasocidhash); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); SCTP_INP_WUNLOCK(inp); @@ -4387,11 +4369,57 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, if (initialize_auth_params == SCTP_INITIALIZE_AUTH_PARAMS) { sctp_initialize_auth_params(inp, stcb); } - SCTP_INP_WUNLOCK(inp); SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); return (stcb); } +struct sctp_tcb * +sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, + int *error, uint32_t override_tag, uint32_t initial_tsn, + uint32_t vrf_id, uint16_t o_streams, uint16_t port, + struct thread *p, + int initialize_auth_params) +{ + struct sctp_tcb *stcb; + + SCTP_INP_INFO_WLOCK(); + SCTP_INP_WLOCK(inp); + stcb = sctp_aloc_assoc_locked(inp, firstaddr, error, override_tag, + initial_tsn, vrf_id, o_streams, port, p, initialize_auth_params); + SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_WUNLOCK(inp); + return (stcb); +} + +struct sctp_tcb * +sctp_aloc_assoc_connected(struct sctp_inpcb *inp, struct sockaddr *firstaddr, + int *error, uint32_t override_tag, uint32_t initial_tsn, + uint32_t vrf_id, uint16_t o_streams, uint16_t port, + struct thread *p, + int initialize_auth_params) +{ + struct sctp_tcb *stcb; + + SCTP_INP_INFO_WLOCK(); + SCTP_INP_WLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && + SCTP_IS_LISTENING(inp)) { + SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_WUNLOCK(inp); + *error = EINVAL; + return (NULL); + } + stcb = sctp_aloc_assoc_locked(inp, firstaddr, error, override_tag, + initial_tsn, vrf_id, o_streams, port, p, initialize_auth_params); + SCTP_INP_INFO_WUNLOCK(); + if (stcb != NULL && (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)) { + inp->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; + soisconnecting(inp->sctp_socket); + } + SCTP_INP_WUNLOCK(inp); + return (stcb); +} + void sctp_remove_net(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -4505,7 +4533,7 @@ sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) struct sctp_tagblock *twait_block; int i; - SCTP_INP_INFO_RLOCK_ASSERT(); + SCTP_INP_INFO_LOCK_ASSERT(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { @@ -6672,7 +6700,8 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * struct sctp_tcb *stcb; bool result; - SCTP_INP_INFO_RLOCK(); + SCTP_INP_INFO_LOCK_ASSERT(); + head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(tag, SCTP_BASE_INFO(hashasocmark))]; LIST_FOREACH(stcb, head, sctp_asocs) { /* @@ -6699,7 +6728,6 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * } result = !sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec); out: - SCTP_INP_INFO_RUNLOCK(); return (result); } diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index a3d0b489eb82..adbecf9bd00f 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -577,6 +577,10 @@ struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, int *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *, int); +struct sctp_tcb * +sctp_aloc_assoc_connected(struct sctp_inpcb *, struct sockaddr *, + int *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, + struct thread *, int); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 309cce10fe9b..690cdf3a3978 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -1416,7 +1416,7 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval, vrf_id = inp->def_vrf_id; /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, sa, &error, 0, 0, vrf_id, + stcb = sctp_aloc_assoc_connected(inp, sa, &error, 0, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, (struct thread *)p, @@ -1425,11 +1425,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval, /* Gak! no memory */ goto out_now; } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* Set the connected flag so we can queue data */ - soisconnecting(so); - } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); /* move to second address */ switch (sa->sa_family) { @@ -7067,7 +7062,7 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p) vrf_id = inp->def_vrf_id; /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, 0, vrf_id, + stcb = sctp_aloc_assoc_connected(inp, addr, &error, 0, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, p, SCTP_INITIALIZE_AUTH_PARAMS); @@ -7075,11 +7070,6 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p) /* Gak! no memory */ goto out_now; } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* Set the connected flag so we can queue data */ - soisconnecting(so); - } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index fcbb566b53d3..516107caf408 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -945,7 +945,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p) return (EALREADY); } /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, 0, vrf_id, + stcb = sctp_aloc_assoc_connected(inp, addr, &error, 0, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, p, SCTP_INITIALIZE_AUTH_PARAMS); @@ -954,11 +954,6 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p) /* Gak! no memory */ return (error); } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* Set the connected flag so we can queue data */ - soisconnecting(so); - } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); NET_EPOCH_ENTER(et); From owner-dev-commits-src-main@freebsd.org Sat Sep 11 14:43:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 336C1673062 for ; Sat, 11 Sep 2021 14:43:48 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6FqR1mQwz3jBR for ; Sat, 11 Sep 2021 14:43:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qv1-xf2c.google.com with SMTP id gf5so3202152qvb.9 for ; Sat, 11 Sep 2021 07:43:47 -0700 (PDT) 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; bh=ILiNpWxQxHSU3+oVgXGh8LqFlPNC52Ghza6glcxLcu8=; b=If5wUvZcVgylGBcUOHkIZfeNbjOvHDkfh19B3p7vnec3sLf00rAyPjbqxn5Rb4JuEb ailWaYJLuZTcycyXBYclOI4RREYQHBxQseIDVtORo5yjyt4eYYgMvDX3eBhSPw+KydjB v9bQ92IZD7Z1A7vszCVHH02Ws24d+AUN9UJal402UqxrqYza0Jn/kYkB3AeZu6gA/22d cBDXab/Wz9PfSqI1s+GQAesqYoF7Ezu/0/523FdO6UjOi4SAh4c57gK1MOH4osJTL8wk nlDn6e+oBVieCeuytUJTTSG7IMLh664n8dUDhOzTkdv87FfLk68GXW4yY2m10+T2XqdD gP2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ILiNpWxQxHSU3+oVgXGh8LqFlPNC52Ghza6glcxLcu8=; b=zAC0DMkf5tTeBt2ux92kWAMqi0l/MjXPTOcPiCDUtphtoH2ijUKg41A4MKfT1NoCEY YdkZE9b/cPSJcGikoHuE9nn5AHNGpI5Fb1lkbsbNk1+7M2Df455xooKJXQe23eYcojxA OHFkB6cBP8g9HMITJ2Pl9VDk1lAJIFuqIa16O3UioHa42MjNHPPdmGyWVjK2XPiMZI77 JTVgb8/n5udDA/F4xXu0cu8iTz8qIx2HvYQFnt8gi26ruYltQcJIzFXkCrTDO89fkZhl MG1qbZTc9sE/QfJwgC3Z4+wCLTgKdmHkaVUn+icMRSPpLI5FIG2rFcU5TFQv8eSjaSU6 CgJA== X-Gm-Message-State: AOAM533ud89Wf5FnRHDblwCfC2Fjk43MXyKF4k+enTuCFg3WGtPTBokA qVuZdIIrnXBYN+6Us0Vca2lvB55i9CN3Ww== X-Google-Smtp-Source: ABdhPJwDXy3NBeTz2gbe9XNaeRR+/YN/KlnaKgKACgrC8VAHbTPASbAOK3cqZFm6juc/WZSDZcryCA== X-Received: by 2002:a0c:8e83:: with SMTP id x3mr2478656qvb.40.1631371421136; Sat, 11 Sep 2021 07:43:41 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id l126sm1325807qke.96.2021.09.11.07.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 07:43:40 -0700 (PDT) Date: Sat, 11 Sep 2021 10:43:40 -0400 From: Shawn Webb To: Alex Richardson Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 021385aba562 - main - Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain Message-ID: <20210911144340.pmpxca7obksc7v5g@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oonxqctudmjayiat" Content-Disposition: inline In-Reply-To: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4H6FqR1mQwz3jBR X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=If5wUvZc; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::f2c as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2c:from]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.224.136:received] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 14:43:48 -0000 --oonxqctudmjayiat Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 06, 2021 at 09:24:02AM +0000, Alex Richardson wrote: > The branch main has been updated by arichardson: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D021385aba56279febcfdcc64d2= 3673a0106ae45d >=20 > commit 021385aba56279febcfdcc64d23673a0106ae45d > Author: Alex Richardson > AuthorDate: 2021-09-06 08:49:49 +0000 > Commit: Alex Richardson > CommitDate: 2021-09-06 08:49:49 +0000 >=20 > Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolcha= in > =20 > When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as > ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones. > Having the LLVM binutils instead of the elftoolchain ones allows us t= o use > features such as LTO that depend on binutils that understand LLVM IR. > Another benefit will be an improved user-experience when compiling wi= th > AddressSanitizer, since ASAN does not symbolize backtraces correctly = if > addr2line is elftoolchain addr2line instead of llvm-symbolizer. > See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/00= 0062.html > for more details. > =20 > This is currently off by default but will be turned on by default at = some > point in the near future. Hey Alex, It appears when MK_LLVM_BINUTILS is set, a strip binary/link doesn't get installed. So /usr/bin/strip doesn't exist. This causes a problem when building packages since even ports-mgmt/pkg relies on strip. I'm working on a candidate patch to fix this right now. But if you beat me to the punch, all the better. ;-) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --oonxqctudmjayiat Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmE8wJkACgkQ/y5nonf4 4fphpA/8CIm0S2DGg5Hau2eKSPGLsgpbhmkj9kwpB4zXPdMm6Go7YqQFSlTXHvaI nyzP2X+QZgt4z794fUiiFzX/y0P2elW02WQZG60fJKLZ0RetG32SLT/IUG6tM6at Ngwwed5UEOMRfocdT5oSW7lt8kyZk7XRgWqx3zresEg/mNKsCj7LecLbX3J0UQeV naoDAmrTCAJVBqPka3dIW6VycTbbUiEI8ysZbnu5BHe/N4/uLXGUIiT0xvPozJNS pljHZc8Y4Sahf52AGEUa7b0EVZprGH1DwI2d1oi7iW8YinZ4Kw5TvwYgw3Zvglt1 A3pt0vIOBEfskCtxrQlDdhPqnVSs2v2jGAWhpupH3V5+em8cPvvpDl7Js2cZ3Leg 7X4nvWPTewM9PgnX7ToCZeKrGr02+hMLe77KQri6ymnVy5duFxD6+bjB9yugOeRO ADGnKRFxTq9J5KOuOa2wguJQ/q4DtVj+5N50gb9v/UWWGF174TPpL+nQ5UGTJB/f kIKnYCu+b9uHXXUHtLzdpCVCPklOsG8yquPdrN94N5276FkxRS2a5hmPn8GEy5fS YR30eXMQoc1gq5s+Q7Kqw89+lLPPmskmZ62Kmx/ib7boXL/cr/dWFfQEkRNmxoJM gvynHP+U68pEkoHyiSaMJ49yuqY+IfTSvYUWazDrSsy+/xMA0cQ= =EqXr -----END PGP SIGNATURE----- --oonxqctudmjayiat-- From owner-dev-commits-src-main@freebsd.org Sat Sep 11 14:55:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 239986734FE for ; Sat, 11 Sep 2021 14:55:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6G4W6q5Mz3lZD for ; Sat, 11 Sep 2021 14:55:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f45.google.com with SMTP id t18so7219244wrb.0 for ; Sat, 11 Sep 2021 07:55:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5g8m7BNdiIgszIoLWGBjAlsGpa5CxMm60TBiWYsemqw=; b=sqZgJuRbIEeeBa4PEmsfx29986E9b1G/o45HukOKAJftQzXh+Nd0eLH1Q2pFes++0K Boqui6F/otndxtXOCNGI+NTzpKnvAx/Spnpvse1dZ82uEu1TjOU/hJcIGOOgVvZ2lLHE c11iVdvcykGhbaW7CNhCT12jkVF2XrvXe2DytmEFENJTPq2DoMwWl7BKotazuBRnrI9D clqe9cjmmm6QF3bmKLE3p9mFXoTk6nYN0JAhKSHH0xS6dNiR6QAun7G5VZ9g7D0Zn5/g PBAjk5F8QylEn0UOLGaDaQqcr+FPAArJSUDU9U7bnCtOCKlkCwoEUoDSW6ELIdvd8AJe hZbA== X-Gm-Message-State: AOAM5310UDFX0QcPEUKPjKGMqnHzf5wC7X2ThVE/E0stsOhbuqqMX6TG 16lbKmdS24L4N+DSivOVNJdhYA== X-Google-Smtp-Source: ABdhPJye1bYEiHf4Gfa8ZN6VPbbZ0VWWPn6uAL2aN9E2hjV7bSZ17zsDoHRAX0EwCNVwEFtEED/GWw== X-Received: by 2002:adf:ec02:: with SMTP id x2mr3444851wrn.407.1631372100866; Sat, 11 Sep 2021 07:55:00 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id l15sm1031300wme.42.2021.09.11.07.55.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Sep 2021 07:55:00 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 021385aba562 - main - Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain From: Jessica Clarke In-Reply-To: <20210911144340.pmpxca7obksc7v5g@mutt-hbsd> Date: Sat, 11 Sep 2021 15:54:59 +0100 Cc: Alex Richardson , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <712AB9FB-E2D8-490F-B9C8-CA9A7A654856@freebsd.org> References: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> <20210911144340.pmpxca7obksc7v5g@mutt-hbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H6G4W6q5Mz3lZD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 14:55:08 -0000 On 11 Sep 2021, at 15:43, Shawn Webb wrote: >=20 > On Mon, Sep 06, 2021 at 09:24:02AM +0000, Alex Richardson wrote: >> The branch main has been updated by arichardson: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D021385aba56279febcfdcc64d23673a0= 106ae45d >>=20 >> commit 021385aba56279febcfdcc64d23673a0106ae45d >> Author: Alex Richardson >> AuthorDate: 2021-09-06 08:49:49 +0000 >> Commit: Alex Richardson >> CommitDate: 2021-09-06 08:49:49 +0000 >>=20 >> Add WITH_LLVM_BINUTILS to install LLVM binutils instead of = Elftoolchain >>=20 >> When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils = as >> ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones. >> Having the LLVM binutils instead of the elftoolchain ones allows = us to use >> features such as LTO that depend on binutils that understand LLVM = IR. >> Another benefit will be an improved user-experience when compiling = with >> AddressSanitizer, since ASAN does not symbolize backtraces = correctly if >> addr2line is elftoolchain addr2line instead of llvm-symbolizer. >> See = https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html= >> for more details. >>=20 >> This is currently off by default but will be turned on by default = at some >> point in the near future. >=20 > Hey Alex, >=20 > It appears when MK_LLVM_BINUTILS is set, a strip binary/link doesn't > get installed. So /usr/bin/strip doesn't exist. This causes a problem > when building packages since even ports-mgmt/pkg relies on strip. >=20 > I'm working on a candidate patch to fix this right now. But if you > beat me to the punch, all the better. ;-) I guess this: diff --git a/usr.bin/clang/llvm-objcopy/Makefile = b/usr.bin/clang/llvm-objcopy/Makefile index 2e6fc8aba356..afd03b848b19 100644 --- a/usr.bin/clang/llvm-objcopy/Makefile +++ b/usr.bin/clang/llvm-objcopy/Makefile @@ -44,8 +44,11 @@ CLEANFILES+=3D ${TGHDRS} ${TGHDRS:C/$/.d/} =20 LIBADD+=3D z =20 +LINKS=3D ${BINDIR}/llvm-objcopy ${BINDIR}/llvm-strip + .if ${MK_LLVM_BINUTILS} !=3D "no" -LINKS=3D ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy +LINKS+=3D ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy \ + ${BINDIR}/llvm-strip ${BINDIR}/strip MLINKS=3D llvm-objcopy.1 objcopy.1 .endif =20 Can=E2=80=99t do MLINKS yet as there=E2=80=99s no generated manpage for = llvm-strip; not sure what the process is to generate them from the upstream .rst files other than =E2=80=9Cask dim@ nicely=E2=80=9D. Jess From owner-dev-commits-src-main@freebsd.org Sat Sep 11 15:53:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C9B0674321; Sat, 11 Sep 2021 15:53:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6HMg41WVz4VWH; Sat, 11 Sep 2021 15:53:19 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f43.google.com with SMTP id a22so6299603iok.12; Sat, 11 Sep 2021 08:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AaHZ4AGED/q8RylqImiB1m/Kce1gmlzob6uZbYqM9Bs=; b=JakYegg/40Y3nJ9rRg48nSYM0piaewIj6EbrUrpWkb/IjZS1lCgdy/9sECSXHyzCl+ 9IIRj77RHD4fo0JDqnEbtjsMf1dIJJWgukjkixqZfU0e/S+tUZCWlvgyHSLLOT14s2KY +K9XdV6WIw6hHpf1ml75ZB2RF61X7Gcr3P7vKz3xzH/WDRIE5Yf3w6D/Dnr58owcbRK6 MTfoBNb0Dw1G0TMiBOl136W95rZ616vXeFKNcGerVJtoY327ZvfAI74zNheKsfSjwSX2 grn32A2ElhNaKBuylJ6dVPbzsg95RdqoDCJQRiT4wXH4gz7/kuPYbWA83HECRdEB7WAE YVcA== X-Gm-Message-State: AOAM532gv6+pbC8RQsplE6HPIUzYgr5lYwz2h3ggg1mJz93TpFCUz3T6 oS1cx9doG2n5MBbDnNwouK50VOE6VriTZC1+4l25rAVh X-Google-Smtp-Source: ABdhPJzvW8+ZJkKhJrkbiYrcT1l8hsRgBWRxVtqEgiHxUyXPZ8R8s+y2cUt2qAWzXvRE23J8XTQvMaMQpQTiqfIY3jU= X-Received: by 2002:a05:6638:5aa:: with SMTP id b10mr2617124jar.76.1631375592202; Sat, 11 Sep 2021 08:53:12 -0700 (PDT) MIME-Version: 1.0 References: <202107272124.16RLOv5Z046970@gitrepo.freebsd.org> <202107281339.16SDdaqc023009@gndrsh.dnsmgr.net> In-Reply-To: <202107281339.16SDdaqc023009@gndrsh.dnsmgr.net> From: Ed Maste Date: Sat, 11 Sep 2021 11:52:37 -0400 Message-ID: Subject: Re: git: 5f946c76c0cc - main - Update WITHOUT_KERNEL_SYMBOLS description To: "Rodney W. Grimes" Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H6HMg41WVz4VWH X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.43:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.43:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 15:53:20 -0000 On Wed, 28 Jul 2021 at 09:39, Rodney W. Grimes wrote: > > This option is recommended for those people who have small /usr partitions. That doesn't seem particularly valuable; there is so much else in /usr. There are other options that have a much larger impact on the installed size in /usr. From owner-dev-commits-src-main@freebsd.org Sat Sep 11 16:18:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67BD567443D for ; Sat, 11 Sep 2021 16:18:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6HwR1vN4z4dPW for ; Sat, 11 Sep 2021 16:18:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x72c.google.com with SMTP id b64so5685808qkg.0 for ; Sat, 11 Sep 2021 09:18:15 -0700 (PDT) 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; bh=yb9k3h4t0SMUat3R7IRbluujl4qB4TcGFdSDBbY7AZw=; b=aD+1fDWsN1geArCkwW5vc2nvj9PjC+1QRUHzVWc2BDxqNmbjTGTZZsSgZG10TM31DL FzIkYiAj2Umd3ns/friN8kvQ0Xk2rIsTNW4Yh9gIIRZlZVlcU/n6qRB1oxnKMuUUmMrF fuBp3tN1ocCXsegwLpOsFpmkVJUCnv/5lp+FLFzuE/BytYrGmz2mC8uAsf70FOcwsH9u mrLVU8G9hnLSdc/gLMp0gVBU9KjlZRAdPe9gXrR4hIHpjf71crloto9TRChm+sCU1+bg STOyiwRTDSHV2ddZ8o5SpmvREd9FmY/OJu1zI3ABzxrpLbZ/E/guE0gGLQ1Tm41HZ+4A GZlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yb9k3h4t0SMUat3R7IRbluujl4qB4TcGFdSDBbY7AZw=; b=SK6svA0mljQsZ9+hUdo67uF4V4yk3QFq317X/48Wm7TGgnyo14goVIzAMluMoBrCZB XgRQ19PFrvMpZ870x1w7m8+j1DGOsTZhp0dM0QEMD9X0JprK+YsCfx77nbJVFOqm1jG1 01PnCZ+hMTrCxmQtu7ms83AocyPzu30QLbu8RUCpwJI5Msh/R+H30/AbiOC/C7JYp0uO vXFPM2BEvxp8snMsdDkXPC0Sai3spnKR8zxso7o4x4EJm3bk7PSY6Dyj9Bt7CFIM6NeH c7NQeSeC7n/yxwItzgxmDkJlbTxpiKA/OKpyGoY7iB5iKscVF2JLdHT/X5bac5pCqidz KbUw== X-Gm-Message-State: AOAM532WKQZv0PAb7eMDH4tL98kz7lzpj/zLBw6og5V7KuwUPokw3Ipe hMj6k+UOz0Rd7Yq/aEUGpINiRQ== X-Google-Smtp-Source: ABdhPJzgX28mUSxxurnOGF+HkPooOqtgfcsx6O+kU1XKaniqtbTK3XLkPsQnHQxyjkbHSkJSU8J37A== X-Received: by 2002:a37:2e81:: with SMTP id u123mr2633926qkh.156.1631377089401; Sat, 11 Sep 2021 09:18:09 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id p187sm1484763qkd.101.2021.09.11.09.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 09:18:09 -0700 (PDT) Date: Sat, 11 Sep 2021 12:18:08 -0400 From: Shawn Webb To: Jessica Clarke Cc: Alex Richardson , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 021385aba562 - main - Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain Message-ID: <20210911161808.yui4ltlsaih3ajq5@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> <20210911144340.pmpxca7obksc7v5g@mutt-hbsd> <712AB9FB-E2D8-490F-B9C8-CA9A7A654856@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p6s6tueerglebyg6" Content-Disposition: inline In-Reply-To: <712AB9FB-E2D8-490F-B9C8-CA9A7A654856@freebsd.org> X-Rspamd-Queue-Id: 4H6HwR1vN4z4dPW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 16:18:15 -0000 --p6s6tueerglebyg6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 11, 2021 at 03:54:59PM +0100, Jessica Clarke wrote: > On 11 Sep 2021, at 15:43, Shawn Webb wrote: > >=20 > > On Mon, Sep 06, 2021 at 09:24:02AM +0000, Alex Richardson wrote: > >> The branch main has been updated by arichardson: > >>=20 > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D021385aba56279febcfdcc6= 4d23673a0106ae45d > >>=20 > >> commit 021385aba56279febcfdcc64d23673a0106ae45d > >> Author: Alex Richardson > >> AuthorDate: 2021-09-06 08:49:49 +0000 > >> Commit: Alex Richardson > >> CommitDate: 2021-09-06 08:49:49 +0000 > >>=20 > >> Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolc= hain > >>=20 > >> When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as > >> ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones. > >> Having the LLVM binutils instead of the elftoolchain ones allows us= to use > >> features such as LTO that depend on binutils that understand LLVM I= R. > >> Another benefit will be an improved user-experience when compiling = with > >> AddressSanitizer, since ASAN does not symbolize backtraces correctl= y if > >> addr2line is elftoolchain addr2line instead of llvm-symbolizer. > >> See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/= 000062.html > >> for more details. > >>=20 > >> This is currently off by default but will be turned on by default a= t some > >> point in the near future. > >=20 > > Hey Alex, > >=20 > > It appears when MK_LLVM_BINUTILS is set, a strip binary/link doesn't > > get installed. So /usr/bin/strip doesn't exist. This causes a problem > > when building packages since even ports-mgmt/pkg relies on strip. > >=20 > > I'm working on a candidate patch to fix this right now. But if you > > beat me to the punch, all the better. ;-) >=20 > I guess this: >=20 > diff --git a/usr.bin/clang/llvm-objcopy/Makefile b/usr.bin/clang/llvm-obj= copy/Makefile > index 2e6fc8aba356..afd03b848b19 100644 > --- a/usr.bin/clang/llvm-objcopy/Makefile > +++ b/usr.bin/clang/llvm-objcopy/Makefile > @@ -44,8 +44,11 @@ CLEANFILES+=3D ${TGHDRS} ${TGHDRS:C/$/.d/} > =20 > LIBADD+=3D z > =20 > +LINKS=3D ${BINDIR}/llvm-objcopy ${BINDIR}/llvm-strip > + > .if ${MK_LLVM_BINUTILS} !=3D "no" > -LINKS=3D ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy > +LINKS+=3D ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy \ > + ${BINDIR}/llvm-strip ${BINDIR}/strip > MLINKS=3D llvm-objcopy.1 objcopy.1 > .endif > =20 > Can=E2=80=99t do MLINKS yet as there=E2=80=99s no generated manpage for l= lvm-strip; not > sure what the process is to generate them from the upstream .rst files > other than =E2=80=9Cask dim@ nicely=E2=80=9D. A patch I wrote, nearly exactly similar to yours works. I'd say just take yours. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --p6s6tueerglebyg6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmE81r0ACgkQ/y5nonf4 4fqC+g//RkOVOer8A/cw69Pzwt5x8U53e0CFXDy5vVuqMBEXX+nQcQg3RwaPLuGZ j3b+Cu+nI24RM4mK36/Ey6WkaU7aYImGqjKNC7IMuw9rPXNH5vXs5Zc/G+rnK6L1 MTdNbxpn9CA2+PsjB346RTv07TRWdlf/RSYwolkwjL/kSyU3H+9nfhOKjsXaa2Kf ccW4WO8/9s8oIOn6fbzsNGjaPbJvRs7NXHg7qHPkQod5yn+G7m9lIsTxdv3EUM9w fy2uLsjiJjWFko6P3DeUP2qnvVTdRt1drzBvO3HIrO9O2UNfdJUzmc3Piuj04+M5 IMjSZ6Ttq8m69uI1tkUJTDx5dsWnlWIoHBYQNgfwf4pHw/HeR/grMiISpeSbDGLE 8ZbJwOiECOG6JSnKDna6PVHUgQC8yGofBoij8jXVjNCpWYnXNsA+ZRmFCraTgn+R 4/abmwtgg1UiBzZ++jBLNFujeczcQsBd3Fvdj5XXC8/CYHeac5FZFXnBTh8UW8RY Gg+8fH9TdTHtadgIFcGnyyMY7XhrRlxeKEL4SsQiFCB1/5RTGr5kj0TsWiL3fBfZ 73P94Qbq4Q2LxCd4wke9JExZa/2UIS506P14JGa6IMeL0xqcSO777bgokVuq4/Zz 3fH26pMdjv0eOtoeLdrDes2L/Z0QVi820aq+7j0rx8VfJYGCETo= =4u6K -----END PGP SIGNATURE----- --p6s6tueerglebyg6-- From owner-dev-commits-src-main@freebsd.org Sat Sep 11 17:04:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC6CC674EAD; Sat, 11 Sep 2021 17:04:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6JxF5Bxmz4sPk; Sat, 11 Sep 2021 17:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9393D23F44; Sat, 11 Sep 2021 17:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BH41Vx096222; Sat, 11 Sep 2021 17:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BH41RO096221; Sat, 11 Sep 2021 17:04:01 GMT (envelope-from git) Date: Sat, 11 Sep 2021 17:04:01 GMT Message-Id: <202109111704.18BH41RO096221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2884918c7338 - main - aio: Fix up the opcode in aiocb32_copyin() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2884918c73389bebfc8025bfb267adae086ee0bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 17:04:01 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2884918c73389bebfc8025bfb267adae086ee0bd commit 2884918c73389bebfc8025bfb267adae086ee0bd Author: Mark Johnston AuthorDate: 2021-09-11 16:55:32 +0000 Commit: Mark Johnston CommitDate: 2021-09-11 16:58:41 +0000 aio: Fix up the opcode in aiocb32_copyin() With lio_listio(2), the opcode is specified by userspace rather than being hard-coded by the system call (e.g., aio_readv() -> LIO_READV). kern_lio_listio() calls aio_aqueue() with an opcode of LIO_NOP, which gets fixed up when the aiocb is copied in. When copying in a job request for vectored I/O, we need to dynamically allocate a uio to wrap an iovec. So aiocb_copyin() needs to get the opcode from the aiocb and then decide whether an allocation is required. We failed to do this in the COMPAT_FREEBSD32 case. Fix it. Reported by: syzbot+27eab6f2c2162f2885ee@syzkaller.appspotmail.com Reviewed by: kib, asomers Fixes: f30a1ae8d529 ("lio_listio(2): Allow LIO_READV and LIO_WRITEV.") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31914 --- sys/kern/vfs_aio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 602c91b542de..2da1a81d41bc 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2826,6 +2826,8 @@ aiocb32_copyin(struct aiocb *ujob, struct kaiocb *kjob, int type) CP(job32, *kcb, aio_fildes); CP(job32, *kcb, aio_offset); CP(job32, *kcb, aio_lio_opcode); + if (type == LIO_NOP) + type = kcb->aio_lio_opcode; if (type & LIO_VECTORED) { iov32 = PTRIN(job32.aio_iov); CP(job32, *kcb, aio_iovcnt); From owner-dev-commits-src-main@freebsd.org Sat Sep 11 17:04:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CD8A6750C6; Sat, 11 Sep 2021 17:04:03 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6JxH1My2z4sVT; Sat, 11 Sep 2021 17:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF610239D4; Sat, 11 Sep 2021 17:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BH42Bj096246; Sat, 11 Sep 2021 17:04:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BH42aT096245; Sat, 11 Sep 2021 17:04:02 GMT (envelope-from git) Date: Sat, 11 Sep 2021 17:04:02 GMT Message-Id: <202109111704.18BH42aT096245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3a0976dea380 - main - lio_test: Specify a mode with O_CREAT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a0976dea38004fe497ff4f69ad329a6faa5bf93 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 17:04:03 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3a0976dea38004fe497ff4f69ad329a6faa5bf93 commit 3a0976dea38004fe497ff4f69ad329a6faa5bf93 Author: Mark Johnston AuthorDate: 2021-09-11 16:56:07 +0000 Commit: Mark Johnston CommitDate: 2021-09-11 16:59:10 +0000 lio_test: Specify a mode with O_CREAT Sponsored by: The FreeBSD Foundation --- tests/sys/aio/lio_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/aio/lio_test.c b/tests/sys/aio/lio_test.c index 720fcc1fa94f..82d0384f6f76 100644 --- a/tests/sys/aio/lio_test.c +++ b/tests/sys/aio/lio_test.c @@ -223,7 +223,7 @@ ATF_TC_BODY(lio_listio_opcodes, tc) char buffer[6]; int fd; - fd = open("testfile", O_CREAT | O_RDWR); + fd = open("testfile", O_CREAT | O_RDWR, 0666); ATF_REQUIRE_MSG(fd >= 0, "open: %s", strerror(errno)); /* We start with numbers in a file and letters in memory... */ @@ -302,7 +302,7 @@ ATF_TC_BODY(lio_listio_invalid_opcode, tc) struct aiocb *list[] = {&sync_cb, &mlock_cb}; int fd; - fd = open("testfile", O_CREAT | O_RDWR); + fd = open("testfile", O_CREAT | O_RDWR, 0666); ATF_REQUIRE_MSG(fd >= 0, "open: %s", strerror(errno)); bzero(&sync_cb, sizeof(sync_cb)); From owner-dev-commits-src-main@freebsd.org Sat Sep 11 20:18:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E7CB676EE6; Sat, 11 Sep 2021 20:18:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6PFn05lsz4qxh; Sat, 11 Sep 2021 20:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D73E22683F; Sat, 11 Sep 2021 20:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BKIats050838; Sat, 11 Sep 2021 20:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BKIaRO050837; Sat, 11 Sep 2021 20:18:36 GMT (envelope-from git) Date: Sat, 11 Sep 2021 20:18:36 GMT Message-Id: <202109112018.18BKIaRO050837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b9485d76e3ad - main - Add EPOCH_TRACE to NOTES to get LINT coverage. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9485d76e3ad4924032a23c82b8a30a0dce31918 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 20:18:37 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b9485d76e3ad4924032a23c82b8a30a0dce31918 commit b9485d76e3ad4924032a23c82b8a30a0dce31918 Author: John Baldwin AuthorDate: 2021-09-11 20:05:44 +0000 Commit: John Baldwin CommitDate: 2021-09-11 20:05:44 +0000 Add EPOCH_TRACE to NOTES to get LINT coverage. Sponsored by: The FreeBSD Foundation --- sys/conf/NOTES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 54e6dc45ac49..39446fba06b3 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -329,6 +329,8 @@ options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING options UMTX_PROFILING +# Debugging traces for epoch(9) misuse +options EPOCH_TRACE ##################################################################### # COMPATIBILITY OPTIONS From owner-dev-commits-src-main@freebsd.org Sat Sep 11 22:39:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C92AA678D1D; Sat, 11 Sep 2021 22:39:40 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6SNX54TWz3wJc; Sat, 11 Sep 2021 22:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E8487D; Sat, 11 Sep 2021 22:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BMdem0036462; Sat, 11 Sep 2021 22:39:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BMdeYa036461; Sat, 11 Sep 2021 22:39:40 GMT (envelope-from git) Date: Sat, 11 Sep 2021 22:39:40 GMT Message-Id: <202109112239.18BMdeYa036461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 55089ef4f8bb - main - nfscl: Make vfs.nfs.maxcopyrange larger by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55089ef4f8bb7c4d18ee964b4214024e35ae4b0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 22:39:40 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=55089ef4f8bb7c4d18ee964b4214024e35ae4b0e commit 55089ef4f8bb7c4d18ee964b4214024e35ae4b0e Author: Rick Macklem AuthorDate: 2021-09-11 22:36:32 +0000 Commit: Rick Macklem CommitDate: 2021-09-11 22:36:32 +0000 nfscl: Make vfs.nfs.maxcopyrange larger by default As of commit 103b207536f9, the NFSv4.2 server will limit the size of a Copy operation based upon a 1 second timeout. The Linux 5.2 kernel server also limits Copy operation size to 4Mbytes. As such, the NFSv4.2 client can attempt a large Copy without resulting in a long RPC RTT for these servers. This patch changes vfs.nfs.maxcopyrange to 64bits and sets the default to the maximum possible size of SSIZE_MAX, since a larger size makes the Copy operation more efficient and allows for copying to complete with fewer RPCs. The sysctl may be need to be made smaller for other non-FreeBSD NFSv4.2 servers. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 4 ---- sys/fs/nfsclient/nfs_clrpcops.c | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 20f5618c202c..73ce2afefd20 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -95,10 +95,6 @@ int nfsrv_maxpnfsmirror = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, &nfsrv_maxpnfsmirror, 0, "Mirror level for pNFS service"); -int nfs_maxcopyrange = 10 * 1024 * 1024; -SYSCTL_INT(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, - &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); - /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index f9636bc28365..0a3826ed8dc1 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -62,6 +62,10 @@ static int nfscl_dssameconn = 0; SYSCTL_INT(_vfs_nfs, OID_AUTO, dssameconn, CTLFLAG_RW, &nfscl_dssameconn, 0, "Use same TCP connection to multiple DSs"); +static uint64_t nfs_maxcopyrange = SSIZE_MAX; +SYSCTL_U64(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, + &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); + /* * Global variables */ @@ -75,7 +79,6 @@ extern char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; extern int nfscl_debuglevel; extern int nfs_pnfsiothreads; extern u_long sb_max_adj; -extern int nfs_maxcopyrange; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; From owner-dev-commits-src-main@freebsd.org Sat Sep 11 22:47:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DEB56789EE; Sat, 11 Sep 2021 22:47:56 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6SZ422S5z4RxS; Sat, 11 Sep 2021 22:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 262B62E0; Sat, 11 Sep 2021 22:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18BMluUW049289; Sat, 11 Sep 2021 22:47:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18BMluHQ049288; Sat, 11 Sep 2021 22:47:56 GMT (envelope-from git) Date: Sat, 11 Sep 2021 22:47:56 GMT Message-Id: <202109112247.18BMluHQ049288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: ae87a08c410d - main - UPDATING: Add entry for commit 55089ef4f8bb MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae87a08c410d9e8a1a906dfd23a8cc732d1c5ff5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 22:47:56 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ae87a08c410d9e8a1a906dfd23a8cc732d1c5ff5 commit ae87a08c410d9e8a1a906dfd23a8cc732d1c5ff5 Author: Rick Macklem AuthorDate: 2021-09-11 22:44:52 +0000 Commit: Rick Macklem CommitDate: 2021-09-11 22:44:52 +0000 UPDATING: Add entry for commit 55089ef4f8bb --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index 7293a336c99c..3993b4a681bb 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210911: + As of commit 55089ef4f8bb, the global variable nfs_maxcopyrange has + been deleted from the nfscommon.ko. As such, nfsd.ko must be built + from up to date sources to avoid an undefined reference when + being loaded. + 20210817: As of commit 62ca9fc1ad56 OpenSSL no longer enables kernel TLS by default. Users can enable kernel TLS via the "KTLS" SSL From owner-dev-commits-src-main@freebsd.org Sun Sep 12 15:57:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF25266835B; Sun, 12 Sep 2021 15:57:34 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 4H6vQ54tz2z3N8g; Sun, 12 Sep 2021 15:57:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 18CFvPLJ009903; Sun, 12 Sep 2021 08:57:25 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 18CFvPgj009902; Sun, 12 Sep 2021 08:57:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202109121557.18CFvPgj009902@gndrsh.dnsmgr.net> Subject: Re: git: 5f946c76c0cc - main - Update WITHOUT_KERNEL_SYMBOLS description In-Reply-To: To: Ed Maste Date: Sun, 12 Sep 2021 08:57:24 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@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: 4H6vQ54tz2z3N8g X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-2.09 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.99)[-0.992]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 15:57:34 -0000 > On Wed, 28 Jul 2021 at 09:39, Rodney W. Grimes > wrote: > > > > This option is recommended for those people who have small /usr partitions. > > That doesn't seem particularly valuable; there is so much else in > /usr. There are other options that have a much larger impact on the > installed size in /usr. The single largest thing that goes into a default install in the /usrodata set IS the kernel debug symbols. Isn't that what this is controlling? Note that these symbols are nearly 50% the size of the whole base system: -rw-r--r-- 1 root wheel 188782444 Apr 9 07:23 base.txz -rw-r--r-- 1 root wheel 90131212 Apr 9 07:23 kernel-dbg.txz -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-main@freebsd.org Sun Sep 12 17:27:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6084F66A983; Sun, 12 Sep 2021 17:27:39 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6xQ323zDz4WKw; Sun, 12 Sep 2021 17:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2834D176E6; Sun, 12 Sep 2021 17:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18CHRdwI040819; Sun, 12 Sep 2021 17:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18CHRd7v040818; Sun, 12 Sep 2021 17:27:39 GMT (envelope-from git) Date: Sun, 12 Sep 2021 17:27:39 GMT Message-Id: <202109121727.18CHRd7v040818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4181fa2a209e - main - sctp: minor cleanup, no functional change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4181fa2a209e0709939ac2f9fb86884522855600 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 17:27:39 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4181fa2a209e0709939ac2f9fb86884522855600 commit 4181fa2a209e0709939ac2f9fb86884522855600 Author: Michael Tuexen AuthorDate: 2021-09-12 17:21:15 +0000 Commit: Michael Tuexen CommitDate: 2021-09-12 17:21:15 +0000 sctp: minor cleanup, no functional change MFC after: 1 week --- sys/netinet/sctp_pcb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index a33acce4380b..fabe19c1444d 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -6698,7 +6698,6 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * { struct sctpasochead *head; struct sctp_tcb *stcb; - bool result; SCTP_INP_INFO_LOCK_ASSERT(); @@ -6722,13 +6721,10 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * continue; } /* The tag is currently used, so don't use it. */ - result = false; - goto out; + return (false); } } - result = !sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec); -out: - return (result); + return (!sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec)); } static void From owner-dev-commits-src-main@freebsd.org Sun Sep 12 19:13:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED3AC66BCE7; Sun, 12 Sep 2021 19:13:23 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6zm352SGz3Fqq; Sun, 12 Sep 2021 19:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D56A1948A; Sun, 12 Sep 2021 19:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18CJDNHt087228; Sun, 12 Sep 2021 19:13:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18CJDNw1087227; Sun, 12 Sep 2021 19:13:23 GMT (envelope-from git) Date: Sun, 12 Sep 2021 19:13:23 GMT Message-Id: <202109121913.18CJDNw1087227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 29545986bdf6 - main - sctp: avoid LOR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29545986bdf6c949671e61fc46ee3f2440b1535b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 19:13:24 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=29545986bdf6c949671e61fc46ee3f2440b1535b commit 29545986bdf6c949671e61fc46ee3f2440b1535b Author: Michael Tuexen AuthorDate: 2021-09-12 19:11:14 +0000 Commit: Michael Tuexen CommitDate: 2021-09-12 19:11:14 +0000 sctp: avoid LOR Don't lock the inp-info lock while holding an stcb lock. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31921 --- sys/netinet/sctp_input.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 9e194d5fda78..6c4bb529fbb8 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -679,9 +679,6 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { - SCTP_INP_INFO_RLOCK(); - new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); - SCTP_INP_INFO_RLOCK(); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); @@ -690,6 +687,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) } else { return (0); } + new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); From owner-dev-commits-src-main@freebsd.org Sun Sep 12 20:35:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFE8266D8DD; Sun, 12 Sep 2021 20:35:16 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H71ZX5yWPz3tYk; Sun, 12 Sep 2021 20:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD0111A351; Sun, 12 Sep 2021 20:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18CKZGwK094116; Sun, 12 Sep 2021 20:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18CKZGet094115; Sun, 12 Sep 2021 20:35:16 GMT (envelope-from git) Date: Sun, 12 Sep 2021 20:35:16 GMT Message-Id: <202109122035.18CKZGet094115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: e31cc1d526dc - main - bhyve: Fix pci device node key in bhyve_config.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e31cc1d526dcdfcbe5666deb8b11decc5126a871 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 20:35:16 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=e31cc1d526dcdfcbe5666deb8b11decc5126a871 commit e31cc1d526dcdfcbe5666deb8b11decc5126a871 Author: Ka Ho Ng AuthorDate: 2021-09-12 20:31:19 +0000 Commit: Ka Ho Ng CommitDate: 2021-09-12 20:35:03 +0000 bhyve: Fix pci device node key in bhyve_config.5 PCI device node key in the manual page is wrong. It should be pci.bus.slot.function. MFC after: 3 days --- usr.sbin/bhyve/bhyve_config.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index a2221d5bc4bf..a6f621048c1a 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -180,7 +180,7 @@ Device settings are stored under a device node. The device node's name is set by the parent bus of the device. .Ss PCI Device Settings PCI devices are described by a device node named -.Dq pci Ns Ar bus . Ns Ar slot . Ns Ar function +.Dq pci . Ns Ar bus . Ns Ar slot . Ns Ar function where each of .Ar bus , .Ar slot , From owner-dev-commits-src-main@freebsd.org Sun Sep 12 20:39:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1576866D9DF; Sun, 12 Sep 2021 20:39:52 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H71gq72fjz3w1Z; Sun, 12 Sep 2021 20:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D237A1A353; Sun, 12 Sep 2021 20:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18CKdp5q094532; Sun, 12 Sep 2021 20:39:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18CKdpwW094531; Sun, 12 Sep 2021 20:39:51 GMT (envelope-from git) Date: Sun, 12 Sep 2021 20:39:51 GMT Message-Id: <202109122039.18CKdpwW094531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b864b67a0d19 - main - socket: Do not include control messages in FIONREAD return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b864b67a0d197f59ecf6698940600956ceee2cae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 20:39:52 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b864b67a0d197f59ecf6698940600956ceee2cae commit b864b67a0d197f59ecf6698940600956ceee2cae Author: Mark Johnston AuthorDate: 2021-09-12 20:05:49 +0000 Commit: Mark Johnston CommitDate: 2021-09-12 20:39:44 +0000 socket: Do not include control messages in FIONREAD return value Some system software expects to be able to read at least the number of bytes returned by FIONREAD. When control messages are counted in this return value, this assumption is violated. Follow Linux and OpenBSD here (as well as our own kevent(EVFILT_READ)) and only return the number of data bytes available. Reported by: avg MFC after: 2 weeks --- sys/kern/sys_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 83dc1cb2622b..8cf703ab8ebd 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -206,12 +206,13 @@ soo_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, break; case FIONREAD: - /* Unlocked read. */ + SOCK_RECVBUF_LOCK(so); if (SOLISTENING(so)) { error = EINVAL; } else { - *(int *)data = sbavail(&so->so_rcv); + *(int *)data = sbavail(&so->so_rcv) - so->so_rcv.sb_ctl; } + SOCK_RECVBUF_UNLOCK(so); break; case FIONWRITE: