From nobody Mon Jan 8 04:10:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7gZk0qF5z56pc1; Mon, 8 Jan 2024 04:10: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 4T7gZj6cPXz43H2; Mon, 8 Jan 2024 04:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDlEIxSL4UH396JxVUuPW8j5b8pokBu6QufTkHLJKKs=; b=yrw267F51E142ZgxZ0MKm9InATCvRQNpGFKtSZbW/634SFlCyoK5pQzBNqc0tZNlvfDyh/ 8uzT8+Q8SrHnGin+DxZhyKQeRtXhIPTJNARthwtcVPkvB23iTU7Y+UoG4N6NtGTs9RjOIz g1rr1w3AUdHIyXSC469W2Vly1LMsrCqPSvwnb5LO6hHHq6ZR3anO3/yn/FnabkKE9Ijiem eptrVri75hCEtTcYHbUsbEVoemtV8hVj8MCFkvepgqm0/ap3yFY2RQbI8gynm6Se1nJySQ 6j0wyK9sn78woHifZ8Q3TxxIcSV6LPTyM7Uu4htQrrv2aK33zONyx7sKPgPttg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDlEIxSL4UH396JxVUuPW8j5b8pokBu6QufTkHLJKKs=; b=SRCknwkdMBZ306zYPTz0tUBsWsvo5LKRb/UaWqrpcg/dzYwOxxsgfk9DPFvQRVNTo69yRN CG3GCbTQ0OsolGfY06AgWl8RHmXHP3gM9f4N4kvBZ8My9Gwa9taAQnccH1fRZk9EpC95Zu hjKqZIO2h0y4PqEVR2B0dlPnxYqUEI/NB/JE4NizytfR0tPV12uRiu2W8BuoTcaU1D+Gmt 8IMyvxPvkzlbPSDm1bEMWKJMEm9E/R942HAcRvBS96Dw7nltWw0nwAFLP6C8Rul49RecOw z9TobMGR9JO2c6zB+XCra1mrl53Qz+s/iISrDG3G3stegkMewBqO8soBUCB2Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704687021; a=rsa-sha256; cv=none; b=jmm+r2kFB3ZJx99sycE/lNDQfsyEy0YwvZCC6b6N7ylvzph3N38XdSkGVuVq8RrNOAPB7e P2YNuMSsZvXQTAMlXkRmpRE+YR8Rar8qGn4M0uzuzA8japBaJpODruV6Ja81fuDkFKHkFF zfmbBPo41f8FVAZPggp22cBFbXOSOHHuGAqPQhOnWg59uXECX9B2RcbJ4Zw9fQUuGOc6xG XBbmuDfvCAp6dKdHXZd8ezJZv6KB+ufpQD2I3klZ+VWBkP4eTJOT5Km9+X4NPQT0PZ8IvJ p6VX53YMN6WGa/8bLibk3bsD8ViCImMdH4v+W71+HXMrpXATa3y9AOrLdYq+RQ== 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 4T7gZj5fgFzrty; Mon, 8 Jan 2024 04:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4084ALO8066358; Mon, 8 Jan 2024 04:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4084ALhK066356; Mon, 8 Jan 2024 04:10:21 GMT (envelope-from git) Date: Mon, 8 Jan 2024 04:10:21 GMT Message-Id: <202401080410.4084ALhK066356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f26eafdfafb0 - stable/13 - ssh: Update to OpenSSH 9.4p1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f26eafdfafb0fbd378b2f0c1e9af1dd807d852ca Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f26eafdfafb0fbd378b2f0c1e9af1dd807d852ca commit f26eafdfafb0fbd378b2f0c1e9af1dd807d852ca Author: Ed Maste AuthorDate: 2023-08-11 03:10:18 +0000 Commit: Ed Maste CommitDate: 2024-01-08 00:49:07 +0000 ssh: Update to OpenSSH 9.4p1 Excerpts from the release notes: * ssh-agent(1): PKCS#11 modules must now be specified by their full paths. Previously dlopen(3) could search for them in system library directories. * ssh(1): allow forwarding Unix Domain sockets via ssh -W. * ssh(1): add support for configuration tags to ssh(1). This adds a ssh_config(5) "Tag" directive and corresponding "Match tag" predicate that may be used to select blocks of configuration similar to the pf.conf(5) keywords of the same name. * ssh(1): add a "match localnetwork" predicate. This allows matching on the addresses of available network interfaces and may be used to vary the effective client configuration based on network location. * ssh-agent(1): improve isolation between loaded PKCS#11 modules by running separate ssh-pkcs11-helpers for each loaded provider. * ssh-agent(1), ssh(1): improve defences against invalid PKCS#11 modules being loaded by checking that the requested module contains the required symbol before loading it. * ssh(1): don't incorrectly disable hostname canonicalization when CanonicalizeHostname=yes and ProxyJump was expicitly set to "none". bz3567 Full release notes at https://www.openssh.com/txt/release-9.4 Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit 535af610a4fdace6d50960c0ad9be0597eea7a1b) (cherry picked from commit 33a23ef2878fe525700983fb754f6f9f9f8fc4b7) --- crypto/openssh/.github/ci-status.md | 6 +- crypto/openssh/.github/configs | 45 +- crypto/openssh/.github/setup_ci.sh | 17 +- crypto/openssh/.github/workflows/c-cpp.yml | 26 +- crypto/openssh/.github/workflows/selfhosted.yml | 2 +- crypto/openssh/ChangeLog | 13191 ++++++++++--------- crypto/openssh/INSTALL | 8 +- crypto/openssh/PROTOCOL.agent | 4 +- crypto/openssh/PROTOCOL.krl | 55 +- crypto/openssh/README | 2 +- crypto/openssh/addr.c | 4 +- crypto/openssh/auth-options.c | 29 +- crypto/openssh/auth-pam.c | 4 +- crypto/openssh/auth2-gss.c | 12 +- crypto/openssh/auth2-pubkey.c | 35 +- crypto/openssh/canohost.c | 4 +- crypto/openssh/chacha.c | 3 +- crypto/openssh/channels.c | 19 +- crypto/openssh/channels.h | 8 +- crypto/openssh/cipher-aes.c | 2 +- crypto/openssh/cipher-chachapoly-libcrypto.c | 3 +- crypto/openssh/cipher-chachapoly.c | 3 +- crypto/openssh/clientloop.c | 14 +- crypto/openssh/config.h | 94 +- crypto/openssh/configure.ac | 107 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/ssh-copy-id | 75 +- crypto/openssh/contrib/ssh-copy-id.1 | 79 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/gss-serv.c | 2 +- crypto/openssh/kexgexs.c | 4 +- crypto/openssh/krl.c | 280 +- crypto/openssh/krl.h | 10 +- crypto/openssh/match.c | 5 +- crypto/openssh/misc.c | 95 +- crypto/openssh/misc.h | 3 +- crypto/openssh/moduli | 868 +- crypto/openssh/monitor.c | 5 +- crypto/openssh/monitor_wrap.c | 6 +- crypto/openssh/mux.c | 76 +- crypto/openssh/openbsd-compat/bsd-getentropy.c | 6 +- crypto/openssh/openbsd-compat/bsd-snprintf.c | 31 +- .../openssh/openbsd-compat/libressl-api-compat.c | 556 +- crypto/openssh/openbsd-compat/openssl-compat.c | 20 +- crypto/openssh/openbsd-compat/openssl-compat.h | 158 +- crypto/openssh/openbsd-compat/port-linux.c | 39 +- .../openbsd-compat/regress/opensslvertest.c | 29 +- .../openssh/openbsd-compat/regress/snprintftest.c | 6 +- .../openssh/openbsd-compat/regress/strtonumtest.c | 2 +- crypto/openssh/packet.c | 4 +- crypto/openssh/poly1305.c | 3 +- crypto/openssh/progressmeter.c | 3 +- crypto/openssh/readconf.c | 108 +- crypto/openssh/readconf.h | 3 +- crypto/openssh/regress/Makefile | 10 +- crypto/openssh/regress/agent-ptrace.sh | 2 +- crypto/openssh/regress/forcecommand.sh | 8 +- crypto/openssh/regress/forward-control.sh | 6 +- crypto/openssh/regress/misc/sk-dummy/sk-dummy.c | 27 +- crypto/openssh/regress/percent.sh | 5 +- crypto/openssh/regress/sftp-chroot.sh | 23 +- .../openssh/regress/unittests/misc/test_ptimeout.c | 4 +- .../openssh/regress/unittests/sshkey/test_file.c | 2 + crypto/openssh/regress/unittests/sshsig/tests.c | 2 +- .../regress/unittests/test_helper/test_helper.c | 2 +- crypto/openssh/scp.c | 23 +- crypto/openssh/servconf.c | 20 +- crypto/openssh/sftp-client.c | 54 +- crypto/openssh/sftp-common.c | 4 +- crypto/openssh/sftp-server.c | 4 +- crypto/openssh/sftp.c | 12 +- crypto/openssh/sk-usbhid.c | 14 +- crypto/openssh/ssh-add.c | 6 +- crypto/openssh/ssh-agent.1 | 14 +- crypto/openssh/ssh-agent.c | 8 +- crypto/openssh/ssh-keygen.1 | 6 +- crypto/openssh/ssh-keygen.c | 16 +- crypto/openssh/ssh-keyscan.c | 28 +- crypto/openssh/ssh-pkcs11-client.c | 389 +- crypto/openssh/ssh-pkcs11.c | 43 +- crypto/openssh/ssh-sk.c | 8 +- crypto/openssh/ssh-xmss.c | 4 +- crypto/openssh/ssh.1 | 19 +- crypto/openssh/ssh.c | 59 +- crypto/openssh/ssh_config | 2 +- crypto/openssh/ssh_config.5 | 39 +- crypto/openssh/ssh_namespace.h | 3 + crypto/openssh/sshconnect2.c | 12 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 14 +- crypto/openssh/sshkey.c | 18 +- crypto/openssh/sshkey.h | 4 +- crypto/openssh/sshsig.c | 11 +- crypto/openssh/version.h | 8 +- 94 files changed, 8883 insertions(+), 8229 deletions(-) diff --git a/crypto/openssh/.github/ci-status.md b/crypto/openssh/.github/ci-status.md index c57c3d83d11a..f3e088fd6043 100644 --- a/crypto/openssh/.github/ci-status.md +++ b/crypto/openssh/.github/ci-status.md @@ -6,6 +6,6 @@ master : [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) [![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable) -9.2 : -[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_2) -[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_2) +9.3 : +[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_3) +[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_3) diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index 8f21fc54a268..e054eb3196b5 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -81,7 +81,8 @@ case "$config" in CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer" LDFLAGS="-fsanitize=memory" CPPFLAGS='-Dchroot=chdir -Dexplicit_bzero=bzero -DMSAN_OPTIONS=\"log_path='$SANLOGS'/msan.log\"' - CONFIGFLAGS="--without-openssl --without-zlib --without-shadow" + CONFIGFLAGS="--without-zlib --without-shadow" + LIBCRYPTOFLAGS="--without-openssl" TEST_TARGET="t-exec" ;; *-sanitize-undefined) @@ -139,6 +140,10 @@ case "$config" in CONFIGFLAGS="--with-pam" SSHD_CONFOPTS="UsePam yes" ;; + boringssl) + CONFIGFLAGS="--disable-pkcs11" + LIBCRYPTOFLAGS="--with-ssl-dir=/opt/boringssl --with-rpath=-Wl,-rpath," + ;; libressl-*) LIBCRYPTOFLAGS="--with-ssl-dir=/opt/libressl --with-rpath=-Wl,-rpath," ;; @@ -209,13 +214,15 @@ esac # The Solaris 64bit targets are special since they need a non-flag arg. case "$config" in sol64*) - CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}" - LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64" + CONFIGFLAGS="--target=x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}" + LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64 --with-rpath=-Wl,-rpath," ;; esac case "${TARGET_HOST}" in aix*) + CONFIGFLAGS="--disable-security-key" + LIBCRYPTOFLAGS="--without-openssl" # These are slow real or virtual machines so skip the slowest tests # (which tend to be thw ones that transfer lots of data) so that the # test run does not time out. @@ -240,7 +247,8 @@ case "${TARGET_HOST}" in SKIP_LTESTS="forwarding multiplex proxy-connect hostkey-agent agent-ptrace" ;; minix3) - LIBCRYPTOFLAGS="--without-openssl --disable-security-key" + CONFIGFLAGS="${CONFIGFLAGS} --disable-security-key" + LIBCRYPTOFLAGS="--without-openssl" # Minix does not have a loopback interface so we have to skip any # test that relies on one. # Also, Minix seems to be very limited in the number of select() @@ -264,7 +272,8 @@ case "${TARGET_HOST}" in CONFIGFLAGS="${CONFIGFLAGS} --without-hardening --disable-security-key" ;; openwrt-*) - CONFIGFLAGS="${CONFIGFLAGS} --without-openssl --without-zlib" + CONFIGFLAGS="${CONFIGFLAGS} --without-zlib" + LIBCRYPTOFLAGS="--without-openssl" TEST_TARGET="t-exec" ;; sol10|sol11) @@ -278,7 +287,8 @@ case "${TARGET_HOST}" in ;; esac -case "`./config.guess`" in +host=`./config.guess` +case "$host" in *cygwin) SUDO="" # Don't run compat tests on cygwin as they don't currently compile. @@ -289,17 +299,34 @@ case "`./config.guess`" in # modern versions don't ship with libcrypto. LIBCRYPTOFLAGS="--without-openssl" TEST_TARGET=t-exec + case "$host" in + *-darwin22.*) + # sudo -S nobody doesn't work on macos 13 for some reason. + SKIP_LTESTS="agent-getpeereid" ;; + esac ;; esac -# If we have a local openssl/libressl, use that. +# Unless specifically configured, search for a suitable version of OpenSSL, +# otherwise build without it. if [ -z "${LIBCRYPTOFLAGS}" ]; then + LIBCRYPTOFLAGS="--without-openssl" # last-match - for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do + for i in /usr /usr/local /usr/local/ssl /usr/local/opt/openssl; do + ver="none" if [ -x ${i}/bin/openssl ]; then - LIBCRYPTOFLAGS="--with-ssl-dir=${i}" + ver="$(${i}/bin/openssl version)" fi + case "$ver" in + none) ;; + "OpenSSL 0."*|"OpenSSL 1.0."*|"OpenSSL 1.1.0"*) ;; + "LibreSSL 2."*|"LibreSSL 3.0."*) ;; + *) LIBCRYPTOFLAGS="--with-ssl-dir=${i}" ;; + esac done + if [ "${LIBCRYPTOFLAGS}" = "--without-openssl" ]; then + TEST_TARGET="t-exec" + fi fi CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}" diff --git a/crypto/openssh/.github/setup_ci.sh b/crypto/openssh/.github/setup_ci.sh index 691c70dd7ed6..154f51bdc205 100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh @@ -4,7 +4,9 @@ PACKAGES="" . .github/configs $@ -case "`./config.guess`" in +host=`./config.guess` +echo "config.guess: $host" +case "$host" in *cygwin) PACKAGER=setup echo Setting CYGWIN system environment variable. @@ -124,6 +126,10 @@ for TARGET in $TARGETS; do esac PACKAGES="${PACKAGES} putty-tools" ;; + boringssl) + INSTALL_BORINGSSL=1 + PACKAGES="${PACKAGES} cmake ninja-build" + ;; valgrind*) PACKAGES="$PACKAGES valgrind" ;; @@ -199,3 +205,12 @@ if [ ! -z "${INSTALL_LIBRESSL}" ]; then ./configure --prefix=/opt/libressl && make -j2 && sudo make install) fi fi + +if [ ! -z "${INSTALL_BORINGSSL}" ]; then + (cd ${HOME} && git clone https://boringssl.googlesource.com/boringssl && + cd ${HOME}/boringssl && mkdir build && cd build && + cmake -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && ninja && + mkdir -p /opt/boringssl/lib && + cp ${HOME}/boringssl/build/crypto/libcrypto.a /opt/boringssl/lib && + cp -r ${HOME}/boringssl/include /opt/boringssl) +fi diff --git a/crypto/openssh/.github/workflows/c-cpp.yml b/crypto/openssh/.github/workflows/c-cpp.yml index f3163884a037..e4e2a64e05d2 100644 --- a/crypto/openssh/.github/workflows/c-cpp.yml +++ b/crypto/openssh/.github/workflows/c-cpp.yml @@ -13,7 +13,14 @@ jobs: fail-fast: false matrix: # First we test all OSes in the default configuration. - target: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022] + target: + - ubuntu-20.04 + - ubuntu-22.04 + - macos-11 + - macos-12 + - macos-13 + - windows-2019 + - windows-2022 config: [default] # Then we include any extra configs we want to test for specific VMs. # Valgrind slows things down quite a bit, so start them first. @@ -43,33 +50,27 @@ jobs: - { target: ubuntu-20.04, config: gcc-11-Werror } - { target: ubuntu-20.04, config: pam } - { target: ubuntu-20.04, config: kitchensink } - - { target: ubuntu-20.04, config: hardenedmalloc } + - { target: ubuntu-22.04, config: hardenedmalloc } - { target: ubuntu-20.04, config: tcmalloc } - { target: ubuntu-20.04, config: musl } + - { target: ubuntu-latest, config: boringssl } - { target: ubuntu-latest, config: libressl-master } - - { target: ubuntu-latest, config: libressl-2.2.9 } - - { target: ubuntu-latest, config: libressl-2.8.3 } - - { target: ubuntu-latest, config: libressl-3.0.2 } - { target: ubuntu-latest, config: libressl-3.2.6 } - { target: ubuntu-latest, config: libressl-3.3.6 } - { target: ubuntu-latest, config: libressl-3.4.3 } - { target: ubuntu-latest, config: libressl-3.5.3 } - { target: ubuntu-latest, config: libressl-3.6.1 } - - { target: ubuntu-latest, config: libressl-3.7.0 } + - { target: ubuntu-latest, config: libressl-3.7.2 } - { target: ubuntu-latest, config: openssl-master } - { target: ubuntu-latest, config: openssl-noec } - - { target: ubuntu-latest, config: openssl-1.0.1 } - - { target: ubuntu-latest, config: openssl-1.0.1u } - - { target: ubuntu-latest, config: openssl-1.0.2u } - - { target: ubuntu-latest, config: openssl-1.1.0h } - { target: ubuntu-latest, config: openssl-1.1.1 } - { target: ubuntu-latest, config: openssl-1.1.1k } - { target: ubuntu-latest, config: openssl-1.1.1n } - { target: ubuntu-latest, config: openssl-1.1.1q } - - { target: ubuntu-latest, config: openssl-1.1.1s } + - { target: ubuntu-latest, config: openssl-1.1.1t } - { target: ubuntu-latest, config: openssl-3.0.0 } - - { target: ubuntu-latest, config: openssl-3.0.5 } - { target: ubuntu-latest, config: openssl-3.0.7 } + - { target: ubuntu-latest, config: openssl-3.1.0 } - { target: ubuntu-latest, config: openssl-1.1.1_stable } - { target: ubuntu-latest, config: openssl-3.0 } # stable branch - { target: ubuntu-22.04, config: pam } @@ -82,6 +83,7 @@ jobs: - { target: ubuntu-22.04, config: without-openssl } - { target: macos-11, config: pam } - { target: macos-12, config: pam } + - { target: macos-13, config: pam } runs-on: ${{ matrix.target }} steps: - name: set cygwin git params diff --git a/crypto/openssh/.github/workflows/selfhosted.yml b/crypto/openssh/.github/workflows/selfhosted.yml index d38cba520500..e84db699ea31 100644 --- a/crypto/openssh/.github/workflows/selfhosted.yml +++ b/crypto/openssh/.github/workflows/selfhosted.yml @@ -25,9 +25,9 @@ jobs: - debian-i386 - dfly30 - dfly48 - - dfly58 - dfly60 - dfly62 + - dfly64 - fbsd10 - fbsd12 - fbsd13 diff --git a/crypto/openssh/ChangeLog b/crypto/openssh/ChangeLog index 40ca976a61b3..3e16fbfd346d 100644 --- a/crypto/openssh/ChangeLog +++ b/crypto/openssh/ChangeLog @@ -1,9437 +1,10174 @@ -commit 9795c4016ae35162072144df032c8b262433b462 +commit daa5b2d869ee5a16f3ef9035aa0ad3c70cf4028e Author: Damien Miller -Date: Wed Jul 19 16:27:12 2023 +1000 +Date: Thu Aug 10 11:10:22 2023 +1000 - OpenSSH 9.3p2 + depend -commit bde3635f3c9324bad132cf9ed917813d6abb599e +commit 41bfb63f5101fbacde9d8d2ada863f9ee16df194 Author: Damien Miller -Date: Wed Jul 19 16:31:09 2023 +1000 +Date: Thu Aug 10 11:05:42 2023 +1000 - update version in README + update versions in RPM specs -commit f673f2f3e5f67099018fc281a6b5fb918142472e +commit e598b92b1eecedac21667edf1fe92078eaf8f2b1 Author: Damien Miller -Date: Wed Jul 19 16:31:00 2023 +1000 +Date: Thu Aug 10 11:05:14 2023 +1000 - update RPM spec versions + update version in README -commit d7790cdce72a1b6982795baa2b4d6f0bdbb0100d -Author: Damien Miller -Date: Fri Jul 7 13:30:15 2023 +1000 +commit e797e5ffa74377c8696e3b0559a258d836479239 +Author: djm@openbsd.org +Date: Thu Aug 10 01:01:07 2023 +0000 - disallow remote addition of FIDO/PKCS11 keys + upstream: openssh-9.4 - Depends on the local client performing the session-bind@openssh.com - operation, so non-OpenSSH local client may circumvent this. + OpenBSD-Commit-ID: 71fc1e01a4c4ea061b252bd399cda7be757e6e35 -commit b23fe83f06ee7e721033769cfa03ae840476d280 +commit 3961ed02dc578517a9d2535128cff5c3a5460d28 Author: Damien Miller -Date: Thu Jul 13 12:09:34 2023 +1000 +Date: Thu Aug 10 09:08:49 2023 +1000 - terminate pkcs11 process for bad libraries + wrap poll.h include in HAVE_POLL_H -commit cb30fbdbee869f1ce11f06aa97e1cb8717a0b645 -Author: Damien Miller -Date: Thu Mar 16 08:28:19 2023 +1100 +commit e535fbe2af893046c28adfcd787c1fdbae36a24a +Author: dtucker@openbsd.org +Date: Fri Aug 4 06:32:40 2023 +0000 - depend + upstream: Apply ConnectTimeout to multiplexing local socket + + connections. If the multiplex socket exists but the connection times out, + ssh will fall back to a direct connection the same way it would if the socket + did not exist at all. ok djm@ + + OpenBSD-Commit-ID: 2fbe1a36d4a24b98531b2d298a6557c8285dc1b4 -commit 1dba63eb10c40b6fda9f5012ed6ae87e2d3d028e -Author: Damien Miller -Date: Thu Mar 16 08:27:54 2023 +1100 +commit 9d92e7b24848fcc605945f7c2e3460c7c31832ce +Author: Darren Tucker +Date: Thu Aug 3 19:35:33 2023 +1000 - crank version + Fix RNG seeding for OpenSSL w/out self seeding. + + When sshd is built with an OpenSSL that does not self-seed, it would + fail in the preauth privsep process while handling a new connection. + Sanity checked by djm@ -commit ba7532d0dac9aaf0ad7270664c43837fc9f64a5f +commit f70010d9b0b3e7e95de8aa0b961e1d74362cfb5d Author: djm@openbsd.org -Date: Wed Mar 15 21:19:57 2023 +0000 +Date: Wed Aug 2 23:04:38 2023 +0000 - upstream: openssh-9.3 + upstream: CheckHostIP has defaulted to 'no' for a while; make the - OpenBSD-Commit-ID: 8011495f2449c1029bb316bd015eab2e00509848 + commented- out config option match. From Ed Maste + + OpenBSD-Commit-ID: e66e934c45a9077cb1d51fc4f8d3df4505db58d9 -commit 6fd4daafb949b66bf555f3100f715a9ec64c3390 +commit c88a8788f9865d02b986d00405b9f0be65ad0b5a Author: dtucker@openbsd.org -Date: Tue Mar 14 07:28:47 2023 +0000 +Date: Tue Aug 1 08:15:04 2023 +0000 - upstream: Free KRL ptr in addition to its contents. + upstream: remove unnecessary if statement. - From Coverity CID 291841, ok djm@ + github PR#422 from eyalasulin999, ok djm@ - OpenBSD-Commit-ID: f146ba08b1b43af4e0d7ad8c4dae3748b4fa31b6 + OpenBSD-Commit-ID: 2b6b0dde4407e039f58f86c8d2ff584a8205ea55 -commit 1d270bd303afaf6d94e9098cbbf18e5e539e2088 -Author: dtucker@openbsd.org -Date: Tue Mar 14 07:26:25 2023 +0000 +commit 77b8b865cd5a8c79a47605c0c5b2bacf4692c4d5 +Author: jmc@openbsd.org +Date: Fri Jul 28 05:42:36 2023 +0000 - upstream: Check pointer for NULL before deref. + upstream: %C is a callable macro in mdoc(7) - None of the existing callers seem to do that, but it's worth checking. - From Coverity CID 291834, ok djm@ + so, as we do for %D, escape it; - OpenBSD-Commit-ID: a0a97113f192a7cb1a2c97b932f677f573cda7a4 + OpenBSD-Commit-ID: 538cfcddbbb59dc3a8739604319491dcb8e0c0c9 -commit d95af508e78c0cd3dce56b83853baaa59ae295cf -Author: dtucker@openbsd.org -Date: Sun Mar 12 10:40:39 2023 +0000 +commit e0f91aa9c2fbfc951e9ced7e1305455fc614d3f2 +Author: djm@openbsd.org +Date: Fri Jul 28 05:33:15 2023 +0000 - upstream: Limit number of entries in SSH2_MSG_EXT_INFO + upstream: don't need to start a command here; use ssh -N instead. - request. This is already constrained by the maximum SSH packet size but this - makes it explicit. Prompted by Coverity CID 291868, ok djm@ markus@ + Fixes failure on cygwin spotted by Darren - OpenBSD-Commit-ID: aea023819aa44a2dcb9dd0fbec10561896fc3a09 + OpenBSD-Regress-ID: ff678a8cc69160a3b862733d935ec4a383f93cfb -commit 8f287ba60d342b3e2f750e7332d2131e3ec7ecd0 -Author: dtucker@openbsd.org -Date: Sun Mar 12 09:41:18 2023 +0000 +commit f446a44f30bc680e0d026a4204844b02646c1c2d +Author: djm@openbsd.org +Date: Wed May 17 05:52:01 2023 +0000 - upstream: calloc can return NULL but xcalloc can't. + upstream: add LTESTS_FROM variable to allow skipping of tests up to - From Coverity CID 291881, ok djm@ + a specific point. e.g. "make LTESTS_FROM=t-sftp" will only run the sftp.sh + test and subsequent ones. ok dtucker@ - OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b + OpenBSD-Regress-ID: 07f653de731def074b29293db946042706fcead3 -commit 83a56a49fd50f4acf900f934279482e4ef329715 -Author: dtucker@openbsd.org -Date: Fri Mar 10 07:17:08 2023 +0000 +commit 8eb8899d612440a9b608bee7f916081d3d0b7812 +Author: djm@openbsd.org +Date: Fri May 12 06:37:42 2023 +0000 - upstream: Explicitly ignore return from fcntl + upstream: test ChrootDirectory in Match block - (... FD_CLOEXEC) here too. Coverity CID 291853. + OpenBSD-Regress-ID: a6150262f39065939f025e546af2a346ffe674c1 + +commit e43f43d3f19516222e9a143468ea0dc1b3ab67b6 +Author: djm@openbsd.org +Date: Fri May 12 06:36:27 2023 +0000 + + upstream: better error messages - OpenBSD-Commit-ID: 99d8b3da9d0be1d07ca8dd8e98800a890349e9b5 + OpenBSD-Regress-ID: 55e4186604e80259496d841e690ea2090981bc7a -commit 0fda9d704d3bbf54a5e64ce02a6fecb11fe7f047 -Author: Damien Miller -Date: Fri Mar 10 15:59:46 2023 +1100 +commit 6958f00acf3b9e0b3730f7287e69996bcf3ceda4 +Author: djm@openbsd.org +Date: Thu Jul 27 22:26:49 2023 +0000 - bounds checking for getrrsetbyname() replacement; + upstream: don't incorrectly truncate logged strings retrieved from - Spotted by Coverity in CID 405033; ok millert@ + PKCS#11 modules; based on GHPR406 by Jakub Jelen; ok markus + + OpenBSD-Commit-ID: 7ed1082f23a13b38c373008f856fd301d50012f9 -commit 89b8df518f21677045599df0ad3e5dd0f39909b5 -Author: dtucker@openbsd.org -Date: Fri Mar 10 04:06:21 2023 +0000 +commit d1ffde6b55170cd4b9a72bfd9a3f17508e6cf714 +Author: djm@openbsd.org +Date: Thu Jul 27 22:25:17 2023 +0000 - upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@. + upstream: make sshd_config AuthorizedPrincipalsCommand and - OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac + AuthorizedKeysCommand accept the %D (routing domain) and a new %C (connection + address/port 4-tuple) as expansion sequences; ok markus + + OpenBSD-Commit-ID: ee9a48bf1a74c4ace71b69de69cfdaa2a7388565 -commit bf4dae0ad192c3e2f03f7223834b00d88ace3d3e -Author: Darren Tucker -Date: Fri Mar 10 14:46:57 2023 +1100 +commit 999a2886ca1844a7a74b905e5f2c8c701f9838cd +Author: djm@openbsd.org +Date: Thu Jul 27 22:23:05 2023 +0000 - Add prototypes for mkstemp replacements. + upstream: increase default KDF work-factor for OpenSSH format - Should prevent warnings due to our wrapper function. + private keys from 16 to 24; { feedback ok } x { deraadt markus } + + OpenBSD-Commit-ID: a3afb1383f8ff0a49613d449f02395d9e8d4a9ec -commit 4e04d68d6a33cdc73b831fd4b5e6124175555d3d -Author: dtucker@openbsd.org -Date: Fri Mar 10 03:01:51 2023 +0000 +commit 0fa803a1dd1c7b546c166000e23a869cf6c4ec10 +Author: Darren Tucker +Date: Thu Jul 27 02:25:09 2023 +1000 - upstream: Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since + Prefer OpenSSL's SHA256 in sk-dummy.so - there's not much we can do anyway. From Coverity CID 291857, ok djm@ + Previously sk-dummy.so used libc's (or compat's) SHA256 since it may be + built without OpenSSL. In many cases, however, including both libc's + and OpenSSL's headers together caused conflicting definitions. - OpenBSD-Commit-ID: 051429dd07af8db3fec10d82cdc78d90bb051729 + We tried working around this (on OpenSSL <1.1 you could define + OPENSSL_NO_SHA, NetBSD had USE_LIBC_SHA2, various #define hacks) with + varying levels of success. Since OpenSSL >=1.1 removed OPENSSL_NO_SHA + and including most OpenSSL headers would bring sha.h in, even if it + wasn't used directly this was a constant hassle. + + Admit defeat and use OpenSSL's SHA256 unless we aren't using OpenSSL at + all. ok djm@ -commit d6d38fd77cbe091c59e1bb720c3a494df4990640 +commit 36cdb5dbf55c99c0faad06066f56a7c341258c1f +Author: Darren Tucker +Date: Thu Jul 27 10:29:44 2023 +1000 + + Retire dfly58 test VM. Add dfly64. + +commit 2d34205dab08ede9b0676efa57647fc49e6decbe Author: djm@openbsd.org -Date: Fri Mar 10 02:32:04 2023 +0000 +Date: Wed Jul 26 23:06:00 2023 +0000 - upstream: Like sshd_config, some ssh_config options are not + upstream: make ssh -f (fork after authentication) work properly in - first-match-wins. sshd_config.5 was fixed in r1.348, this is the same for - this file + multiplexed cases (inc. ControlPersist). bz3589 bz3589 Based on patches by + Peter Chubb; ok dtucker@ - OpenBSD-Commit-ID: 7be55b9351cde449b136afcc52d07aa4113b215e + OpenBSD-Commit-ID: a7a2976a54b93e6767dc846b85647e6ec26969ac -commit 7187d3f86bf8f2066cc9941f217d23b0cacae25e -Author: dtucker@openbsd.org -Date: Fri Mar 10 02:24:56 2023 +0000 +commit 076aeda86a7ee9be8fd2f0181ec7b9729a6ceb37 +Author: naddy@openbsd.org +Date: Sun Jul 23 20:04:45 2023 +0000 - upstream: Remove no-op (int) > INT_MAX checks + upstream: man page typos; ok jmc@ - since they can never be true. From Coverity CID 405031, ok djm@ + OpenBSD-Commit-ID: e6ddfef94b0eb867ad88abe07cedc8ed581c07f0 + +commit 135e7d5fe31f700e6dfc61ce914970c5ee7175ba +Author: jmc@openbsd.org +Date: Thu Jul 20 05:43:39 2023 +0000 + + upstream: tweak the allow-remote-pkcs11 text; - OpenBSD-Commit-ID: 9df3783b181e056595e2bb9edf7ed41d61cf8e84 + OpenBSD-Commit-ID: bc965460a89edf76865b7279b45cf9cbdebd558a -commit 77adde4305542ebe3005dd456122624fe2347b01 +commit 5f83342b61d1f76c141de608ed2bd293990416bd Author: Darren Tucker -Date: Fri Mar 10 13:27:29 2023 +1100 +Date: Tue Jul 25 13:00:22 2023 +1000 - Wrap mkstemp calls with umask set/restore. + Handle a couple more OpenSSL no-ecc cases. - glibc versions 2.06 and earlier did not set a umask on files created by - mkstemp created the world-writable. Wrap mkstemp to set and restore - the umask. From Coverity (CIDs 291826 291886 291891), ok djm@ + ok djm@ -commit 633d3dc2a1e9e2a013d019a0576a0771c8423713 -Author: jcs@openbsd.org -Date: Thu Mar 9 21:06:24 2023 +0000 +commit edc2ef4e418e514c99701451fae4428ec04ce538 +Author: Damien Miller +Date: Thu Jul 20 12:53:44 2023 +1000 - upstream: modify parentheses in conditionals to make it clearer what is + depend + +commit 51fda734e0d3c2df256fc03e8b060c4305be6e59 +Author: Damien Miller +Date: Thu Jul 20 12:53:21 2023 +1000 + + Bring back OPENSSL_HAS_ECC to ssh-pkcs11-client + +commit 099cdf59ce1e72f55d421c8445bf6321b3004755 +Author: djm@openbsd.org +Date: Wed Jul 19 14:03:45 2023 +0000 + + upstream: Separate ssh-pkcs11-helpers for each p11 module - being assigned and what is being checked + Make ssh-pkcs11-client start an independent helper for each provider, + providing better isolation between modules and reliability if a single + module misbehaves. - ok djm dtucker + This also implements reference counting of PKCS#11-hosted keys, + allowing ssh-pkcs11-helper subprocesses to be automatically reaped + when no remaining keys reference them. This fixes some bugs we have + that make PKCS11 keys unusable after they have been deleted, e.g. + https://bugzilla.mindrot.org/show_bug.cgi?id=3125 - OpenBSD-Commit-ID: 19c10baa46ae559474409f75a5cb3d0eade7a9b8 + ok markus@ + + OpenBSD-Commit-ID: 0ce188b14fe271ab0568f4500070d96c5657244e -commit 733030840c4772f858de95d5940ec0c37663e8b0 -Author: dtucker@openbsd.org -Date: Thu Mar 9 07:11:05 2023 +0000 +commit 29ef8a04866ca14688d5b7fed7b8b9deab851f77 +Author: djm@openbsd.org +Date: Wed Jul 19 14:02:27 2023 +0000 - upstream: Re-split the merge of the reorder-hostkeys test. + upstream: Ensure FIDO/PKCS11 libraries contain expected symbols - In the kex_proposal_populate_entries change I merged the the check for - reordering hostkeys with the actual reordering, but kex_assemble_names - mutates options.hostkeyalgorithms which renders the check ineffective. - Put the check back where it was. Spotted and tested by jsg@, ok djm@ + This checks via nlist(3) that candidate provider libraries contain one + of the symbols that we will require prior to dlopen(), which can cause + a number of side effects, including execution of constructors. - OpenBSD-Commit-ID: a7469f25a738db5567395d1881e32479a7ffc9de + Feedback deraadt; ok markus + + OpenBSD-Commit-ID: 1508a5fbd74e329e69a55b56c453c292029aefbe -commit 54ac4ab2b53ce9fcb66b8250dee91c070e4167ed +commit 1f2731f5d7a8f8a8385c6031667ed29072c0d92a Author: djm@openbsd.org -Date: Thu Mar 9 06:58:26 2023 +0000 +Date: Wed Jul 19 13:56:33 2023 +0000 - upstream: include destination constraints for smartcard keys too. + upstream: Disallow remote addition of FIDO/PKCS11 provider - Spotted by Luci Stanescu; ok deraadt@ markus@ + libraries to ssh-agent by default. - OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f + The old behaviour of allowing remote clients from loading providers + can be restored using `ssh-agent -O allow-remote-pkcs11`. + + Detection of local/remote clients requires a ssh(1) that supports + the `session-bind@openssh.com` extension. Forwarding access to a + ssh-agent socket using non-OpenSSH tools may circumvent this control. + + ok markus@ + + OpenBSD-Commit-ID: 4c2bdf79b214ae7e60cc8c39a45501344fa7bd7c -commit bfd1ad01d974a316b60622759ad17537fa2d92b4 -Author: Darren Tucker -Date: Thu Mar 9 18:24:54 2023 +1100 +commit 892506b13654301f69f9545f48213fc210e5c5cc +Author: djm@openbsd.org +Date: Wed Jul 19 13:55:53 2023 +0000 - Limit the number of PAM environment variables. + upstream: terminate process if requested to load a PKCS#11 provider - xcalloc has its own limits, but these are specific to PAM. From - Coverity CID 405198, ok djm@ + that isn't a PKCS#11 provider; from / ok markus@ + + OpenBSD-Commit-ID: 39532cf18b115881bb4cfaee32084497aadfa05c -commit a231414970e01a35f45a295d5f93698fa1249b28 -Author: Darren Tucker -Date: Thu Mar 9 18:19:44 2023 +1100 +commit f3f56df8ec476b2de6cbdbdfdb77a2a61087829d +Author: Damien Miller +Date: Wed Jul 19 12:07:18 2023 +1000 - Limit the number of PAM environment variables. + agent_fuzz doesn't want stdint.h conditionalised + +commit 750911fd31d307a767cc86e3bfa90bbbb77b1a25 +Author: Damien Miller +Date: Tue Jul 18 15:41:12 2023 +1000 + + conditionalise stdint.h inclusion on HAVE_STDINT_H - From Coverity CID 405194, tweaks and ok djm@ + fixes build on AIX5 at least -commit 36c6c3eff5e4a669ff414b9daf85f919666e8e03 -Author: dtucker@openbsd.org -Date: Wed Mar 8 06:21:32 2023 +0000 +commit ff047504fa6e008c4092f8929881816b8993bea0 +Author: Damien Miller +Date: Tue Jul 18 15:30:45 2023 +1000 - upstream: Plug mem leak. Coverity CID 405196, ok djm@ + conditionalise match localnetwork on ifaddrs.h - OpenBSD-Commit-ID: 175f09349387c292f626da68f65f334faaa085f2 + Fixes build breakage on platforms that lack getifaddrs() -commit dfb9b736e1ccf9e6b03eea21cd961f4fd0634c98 -Author: tb@openbsd.org -Date: Wed Mar 8 05:33:53 2023 +0000 +commit b87b03282e466ca2927954ce93f5dbf0bfdc68f6 +Author: djm@openbsd.org +Date: Mon Jul 17 06:16:33 2023 +0000 - upstream: ssh-pkcs11: synchronize error messages with errors + upstream: missing match localnetwork negation check - A handful of error messages contained incorrect function names or - otherwise inaccurate descriptions. Fix them to match reality. + OpenBSD-Commit-ID: 9a08ed8dae27d3f38cf280f1b28d4e0ff41a737a + +commit 6d6e185ba29ef4274164b77eab4dc763907f8821 +Author: jmc@openbsd.org +Date: Mon Jul 17 05:41:53 2023 +0000 + + upstream: - add -P to usage() - sync the arg name to -J in usage() - input/ok djm + with that in ssh.1 - reformat usage() to match what "man ssh" does on 80width - OpenBSD-Commit-ID: 165a15db52f75b31e1804b043480c36af09f3411 + OpenBSD-Commit-ID: 5235dd7aa42e5bf90ae54579d519f92fc107036e -commit 51875897b81b5c21b80c256a29597916edbde454 -Author: guenther@openbsd.org -Date: Wed Mar 8 04:43:12 2023 +0000 +commit f1a9898283a0638667b587ee4a950afd61ab51b0 +Author: jmc@openbsd.org +Date: Mon Jul 17 05:38:10 2023 +0000 - upstream: Delete obsolete /* ARGSUSED */ lint comments. - - ok miod@ millert@ + upstream: -P before -p in SYNOPSIS; - OpenBSD-Commit-ID: 7be168a570264d59e96a7d2d22e927d45fee0e4c + OpenBSD-Commit-ID: 535f5257c779e26c6a662a038d241b017f8cab7c -commit a76085bda883c2104afb33ab0334eca190927362 -Author: Darren Tucker -Date: Wed Mar 8 17:25:37 2023 +1100 +commit eef4d7e873568e1c84c36bb4034e2c3378250a61 +Author: jsg@openbsd.org +Date: Mon Jul 17 05:36:14 2023 +0000 - Extra brackets to prevent warning. + upstream: configuation -> configuration + + OpenBSD-Commit-ID: 4776ced33b780f1db0b2902faec99312f26a726b -commit 147ae57d4dfa0508109f93b78a7d8b92819e1f83 +commit dc1dbe94cf6532bd546a3373ad436404f8850e5f Author: djm@openbsd.org -Date: Wed Mar 8 00:05:58 2023 +0000 +Date: Mon Jul 17 05:26:38 2023 +0000 - upstream: use RSA/SHA256 when testing usability of private key in + upstream: move other RCSIDs to before their respective license blocks - agent; with/ok dtucker + too no code change - OpenBSD-Commit-ID: fe1382e2fdf23fcae631308e72342bad56066a56 + OpenBSD-Commit-ID: ef5bf46b57726e4260a63b032b0b5ac3b4fe9cd4 -commit 27fd251bc906a763e70ce0f27c8abdf8bbd1e416 +commit ebe11044681caff78834ca6b78311ad19c1860b8 Author: djm@openbsd.org -Date: Wed Mar 8 00:05:37 2023 +0000 +Date: Mon Jul 17 05:22:30 2023 +0000 - upstream: use RSA/SHA256 when testing usability of private key; + upstream: Move RCSID to before license block and away from #includes, - based on fix in bz3546 by Dmitry Belyavskiy; with/ok dtucker + where it caused merge conflict in -portable for each commit :( - OpenBSD-Commit-ID: 0ef414cc363a832f9fab92a5da0234448bce2eba + OpenBSD-Commit-ID: 756ebac963df3245258b962e88150ebab9d5fc20 -commit eee9f3fc3d52ae7d2106929bb06b7f291fb0b81a +commit 05c08e5f628de3ecf6f7ea20947735bcfa3201e0 Author: djm@openbsd.org -Date: Tue Mar 7 21:47:42 2023 +0000 +Date: Mon Jul 17 05:20:15 2023 +0000 - upstream: refactor to be more readable top to bottom. Prompted by + upstream: return SSH_ERR_KRL_BAD_MAGIC when a KRL doesn't contain a - Coverity CID 405048 which was a false-positive fd leak; ok dtucker@ + valid magic number and not SSH_ERR_MESSAGE_INCOMPLETE; the former is needed + to fall back to text revocation lists in some cases; fixes t-cert-hostkey. - OpenBSD-Commit-ID: fc55ec2af622a017defb9b768bf26faefc792c00 + OpenBSD-Commit-ID: 5c670a6c0f027e99b7774ef29f18ba088549c7e1 -commit 42a06b29a4c99272bf690f9b3be520b08b448dc5 -Author: Darren Tucker -Date: Tue Mar 7 18:34:41 2023 +1100 +commit c6fad2c3d19b74f0bd0af1ef040fc74f3a1d9ebb +Author: Damien Miller +Date: Mon Jul 17 14:56:14 2023 +1000 - Add header changes missed in previous. + avoid AF_LINK on platforms that don't define it -commit 4710077096edff2e6926dd5b15bf586491d317db -Author: dtucker@openbsd.org -Date: Tue Mar 7 06:09:14 2023 +0000 +commit 919bc3d3b712c920de1ae6be5ac6561c98886d7e +Author: djm@openbsd.org +Date: Mon Jul 17 04:08:31 2023 +0000 - upstream: Fix mem leak in environment setup. + upstream: Add support for configuration tags to ssh(1). - From jjelen at redhat.com via bz#2687, ok djm@ + This adds a ssh_config(5) "Tag" directive and corresponding + "Match tag" predicate that may be used to select blocks of + configuration similar to the pf.conf(5) keywords of the same + name. - OpenBSD-Commit-ID: 9f9e4ba3cac003e6f81da3bcebd1b9ec43e7f353 + ok markus + + OpenBSD-Commit-ID: dc08358e70e702b59ac3e591827e5a96141b06a3 -commit 03acc50d0ccb78fc91d1570de1cd0fdfea646028 -Author: dtucker@openbsd.org -Date: Mon Mar 6 12:15:47 2023 +0000 +commit 3071d85a47061c1bdaf11a0ac233b501ecba862c +Author: djm@openbsd.org +Date: Mon Jul 17 04:04:36 2023 +0000 - upstream: Unit test for kex_proposal_populate_entries. + upstream: add a "match localnetwork" predicate. - OpenBSD-Regress-ID: bdb211d80d572a08bf14b49fe2a58b9ff265c006 + This allows matching on the addresses of available network interfaces + and may be used to vary the effective client configuration based on + network location (e.g. to use a ProxyJump when not on a particular *** 22641 LINES SKIPPED *** From nobody Mon Jan 8 04:10:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7gZl2gkdz56q1f; Mon, 8 Jan 2024 04:10: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 4T7gZl1GHkz4345; Mon, 8 Jan 2024 04:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rtEN8WgjTtR8Ogtthf7ggtwmSQXaRWNh2KVgMzjPuc=; b=IUID4rncuNIZmUUw9kxFOSleen0r5B660vIquvVGxvyWMbCccPfaec++X2VlADeq3Tc1Ub qs/LhFrSsQcaba3ltO0f1+Tj6tsRBHW3mpbvCnzFAE7R2HcxRbWXZXfbPxZAinMKQUXu+x cbcHOVoIYAJqM8U5JKe/gMvUHw2YhURUddYIazthfPsJJ+HoNMV0/B+Yex0DXAujP8z+3c Q+eiKD+ypbyD+X3QZdvEUlxoR38M9qpHrTbGCTlMNh9ReHUWayeA0MPkO1/AXHO/WhPQE1 HWb717X6jBKieHWuanC85n4FBk4yPf6ZAnFZqPpAV++K8A0VEfGoj95Q11mw0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rtEN8WgjTtR8Ogtthf7ggtwmSQXaRWNh2KVgMzjPuc=; b=wkYI8WaDGysljhFuwJVeQB/wQcWd3qrkUlsI3QsC6qd5eoTH7FwSHS5NsPyO3PInQIOTgW 2Twv8WV0HvXChgHGqbpa7mVQgVK8Ebg9aLxF3XautwFOTi/GhcI0fr0eMrJxBAX+y9XbUD FvZAj42VGCWeiuj3G0nW2JPYaqRLUYPNhLdhFq/Djd8YHjQA1IAVZJVpF4LE9W9mAEZJqC AjEXOS0kxkB8BFrwUnkQXn+IMXKvbJzlZYv/VRyBMCDBH9hG9/0L35ohsjtXclMsrFIjhQ nVb1oIfUT0+CARJ8PUlxqBvGogXgUrE5W45IU7TlzEhcjfd1u7GZ/Rd/kSUb1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704687023; a=rsa-sha256; cv=none; b=pH8fuCWWIa84nqOrFeOV2t3wHDRpqj/1S1kd4pvrXLOAYM+ZBk4d2JFadr1IXh3M6gmvmm /KW3c4ZTkH9WGj5VsrzW7daIlVuSecW561H6dApYox9Eb11UDqwLRC5wHqBPeRv3lYQtqY IwHXnOGaTfPJUlF+7Hna4qvdE5cgOmCXDSa/OolDdFAX3pK3nFJlXIOlp7L4MBTBifFBW/ Ap0gyRjW+WhB+d+mz6AxfKw+xW0UwV8+A4Pe1MylJQdvglWqeYEkE0W+WVfHN/5Bqc5yVv sloMrMN2GfaiQ8dClX9C7llx1nkZN4Gc5IOB3m0Irh1n13eNeXm9ybcep/egHg== 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 4T7gZk6Z25zsMj; Mon, 8 Jan 2024 04:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4084AMN3066411; Mon, 8 Jan 2024 04:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4084AMJs066408; Mon, 8 Jan 2024 04:10:22 GMT (envelope-from git) Date: Mon, 8 Jan 2024 04:10:22 GMT Message-Id: <202401080410.4084AMJs066408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a4439dc6c872 - stable/13 - ssh: fix OpenSSH 9.4 regression with multiplexed sessions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a4439dc6c87259c0b82ee8ad9d756452abb671fa Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a4439dc6c87259c0b82ee8ad9d756452abb671fa commit a4439dc6c87259c0b82ee8ad9d756452abb671fa Author: Ed Maste AuthorDate: 2023-08-20 19:16:54 +0000 Commit: Ed Maste CommitDate: 2024-01-08 00:49:07 +0000 ssh: fix OpenSSH 9.4 regression with multiplexed sessions Upstream commit message: upstream: fix regression in OpenSSH 9.4 (mux.c r1.99) that caused multiplexed sessions to ignore SIGINT under some circumstances. Reported by / feedback naddy@, ok dtucker@ OpenBSD-Commit-ID: 4d5c6c894664f50149153fd4764f21f43e7d7e5a Fixes: 535af610a4fd ("ssh: Update to OpenSSH 9.4p1") Obtained from: OpenSSH 803e22eabd3b Sponsored by: The FreeBSD Foundation (cherry picked from commit 1b91d634a58c45d7b33dee044034260f747c80d9) --- crypto/openssh/kex.c | 4 ++-- crypto/openssh/misc.c | 42 ++++++++++++++++++++++++++++++------------ crypto/openssh/misc.h | 5 +++-- crypto/openssh/mux.c | 6 ++++-- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index 251cff7af530..7c47c84ba5e6 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.c,v 1.178 2023/03/12 10:40:39 dtucker Exp $ */ +/* $OpenBSD: kex.c,v 1.179 2023/08/18 01:37:41 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * @@ -1362,7 +1362,7 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms, for (;;) { if (timeout_ms > 0) { r = waitrfd(ssh_packet_get_connection_in(ssh), - &timeout_ms); + &timeout_ms, NULL); if (r == -1 && errno == ETIMEDOUT) { send_error(ssh, "Timed out waiting " "for SSH identification string."); diff --git a/crypto/openssh/misc.c b/crypto/openssh/misc.c index 4b87c4090804..956587035517 100644 --- a/crypto/openssh/misc.c +++ b/crypto/openssh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.185 2023/08/04 06:32:40 dtucker Exp $ */ +/* $OpenBSD: misc.c,v 1.186 2023/08/18 01:37:41 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005-2020 Damien Miller. All rights reserved. @@ -313,20 +313,38 @@ set_sock_tos(int fd, int tos) * Returns 0 if fd ready or -1 on timeout or error (see errno). */ static int -waitfd(int fd, int *timeoutp, short events) +waitfd(int fd, int *timeoutp, short events, volatile sig_atomic_t *stop) { struct pollfd pfd; - struct timeval t_start; - int oerrno, r, have_timeout = (*timeoutp >= 0); + struct timespec timeout; + int oerrno, r; + sigset_t nsigset, osigset; + if (timeoutp && *timeoutp == -1) + timeoutp = NULL; pfd.fd = fd; pfd.events = events; - for (; !have_timeout || *timeoutp >= 0;) { - monotime_tv(&t_start); - r = poll(&pfd, 1, *timeoutp); + ptimeout_init(&timeout); + if (timeoutp != NULL) + ptimeout_deadline_ms(&timeout, *timeoutp); + if (stop != NULL) + sigfillset(&nsigset); + for (; timeoutp == NULL || *timeoutp >= 0;) { + if (stop != NULL) { + sigprocmask(SIG_BLOCK, &nsigset, &osigset); + if (*stop) { + sigprocmask(SIG_SETMASK, &osigset, NULL); + errno = EINTR; + return -1; + } + } + r = ppoll(&pfd, 1, ptimeout_get_tsp(&timeout), + stop != NULL ? &osigset : NULL); oerrno = errno; - if (have_timeout) - ms_subtract_diff(&t_start, timeoutp); + if (stop != NULL) + sigprocmask(SIG_SETMASK, &osigset, NULL); + if (timeoutp) + *timeoutp = ptimeout_get_ms(&timeout); errno = oerrno; if (r > 0) return 0; @@ -346,8 +364,8 @@ waitfd(int fd, int *timeoutp, short events) * Returns 0 if fd ready or -1 on timeout or error (see errno). */ int -waitrfd(int fd, int *timeoutp) { - return waitfd(fd, timeoutp, POLLIN); +waitrfd(int fd, int *timeoutp, volatile sig_atomic_t *stop) { + return waitfd(fd, timeoutp, POLLIN, stop); } /* @@ -381,7 +399,7 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr, break; } - if (waitfd(sockfd, timeoutp, POLLIN | POLLOUT) == -1) + if (waitfd(sockfd, timeoutp, POLLIN | POLLOUT, NULL) == -1) return -1; /* Completed or failed */ diff --git a/crypto/openssh/misc.h b/crypto/openssh/misc.h index fd77a7fd7273..f9bdc6eb51bd 100644 --- a/crypto/openssh/misc.h +++ b/crypto/openssh/misc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.h,v 1.103 2023/07/19 14:02:27 djm Exp $ */ +/* $OpenBSD: misc.h,v 1.104 2023/08/18 01:37:41 djm Exp $ */ /* * Author: Tatu Ylonen @@ -19,6 +19,7 @@ #include #include #include +#include /* Data structure for representing a forwarding request. */ struct Forward { @@ -57,7 +58,7 @@ char *get_rdomain(int); int set_rdomain(int, const char *); int get_sock_af(int); void set_sock_tos(int, int); -int waitrfd(int, int *); +int waitrfd(int, int *, volatile sig_atomic_t *); int timeout_connect(int, const struct sockaddr *, socklen_t, int *); int a2port(const char *); int a2tun(const char *, int *); diff --git a/crypto/openssh/mux.c b/crypto/openssh/mux.c index 3a0f87674b95..d9d5e7d994ca 100644 --- a/crypto/openssh/mux.c +++ b/crypto/openssh/mux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.99 2023/08/04 06:32:40 dtucker Exp $ */ +/* $OpenBSD: mux.c,v 1.100 2023/08/18 01:37:41 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -1480,7 +1480,9 @@ mux_client_read(int fd, struct sshbuf *b, size_t need, int timeout_ms) case EWOULDBLOCK: #endif case EAGAIN: - if (waitrfd(fd, &timeout_ms) == -1) + if (waitrfd(fd, &timeout_ms, + &muxclient_terminate) == -1 && + errno != EINTR) return -1; /* timeout */ /* FALLTHROUGH */ case EINTR: From nobody Mon Jan 8 04:25:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7gvf4001z56rV7; Mon, 8 Jan 2024 04:25: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 4T7gvf3Sdhz462L; Mon, 8 Jan 2024 04:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jWDOS25x1yZjo5n9YTlk8YMKNj9tp/inNLeU788B3AE=; b=jtJCRAEEIWhdT/bstqQ13DqSm7Phnly1nO3YGOSVssgxiQTdYM05KgMOkuY+LINTxoFHyF sXXnTL1tXzxATm0LsBlpB1VITEqYJqON3XA2IqsDkavgIc2WH1+THG1cl2GCH2OHaxkJk7 3/gdpmu8g3p/dx2MUuMSRLgp74+dPa+vF/I88xpCR5r4AEDqp146KM5bx5lNDanxqFV4JH t8iPihoguLcwPFYkLbZmVOlzPvqXbGzQD0UCSrBZLm6jyP/F5b/M6SzJvWDAwDkfZL+0S1 okcM6SImhNIgYTTpcrJ7ktBV685HD2HC30H9ue269QpIYMQyyHC3pwmCpG0M/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jWDOS25x1yZjo5n9YTlk8YMKNj9tp/inNLeU788B3AE=; b=Pr6yDDDJWGMrzeye3bl9+GxDUi9IsWoi2SG9dQ9SZhKUu3NWqeRl/YuQNcGoq453qUg7Ys YD69L+XuqkhPYKQiroVjV6VIWon6AE70k2O9VQWecX2O22cbeK7HdKI9apJBgZAw7gmTaf gNZpV7ng7SFv6xumXdgpmQxRjcVLCclKUsw+9meOS41x0u+VRWRZzCnT4I/VrjjbDl7jqa x9Y1Cqvglpp9pFkv9TCr7o9MStlv5DVc6KF3cLF3tSokXPugVChad0hjquDgzrTOLZpPDs sp5ocvIDAVYg78prbDutGfa6dDDcCHP9wpvIAojOMOKb1RvKgrzSK0yqZ61a2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704687902; a=rsa-sha256; cv=none; b=aK+eA7pvBsX6CXuzDSxx2GonYb8OQMvSM90+SLdb/4OXMAr6IolzYKzK9gsD9BMXmMxwrA JkGnIzVis3xiK3O0YKQ0i+8mOVALPUswL8gMtbyZEBkOEq1/8poGnFr75dQBXTRBp2zZ0R 5UE8kBMZv1ray93Kg6UU3Ibh9VIUKabKXay3wBOL2bamh+K5qOPZCQb1/MgPcopyIwZnHA NtgmOIyX5GXam6q1HKOBQxOu1mHr/ZN5r9vXcLawGhx9nrduI7BBhUChACozWgH8+Z/ZOn DmBMG8nIftfEKi2DRzPQMKgKnMUZUSezShXzB9Xg6idn+dvSuUbgQH3IPVP0Gg== 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 4T7gvf2WG1zsxs; Mon, 8 Jan 2024 04:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4084P2uf090608; Mon, 8 Jan 2024 04:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4084P2Zr090605; Mon, 8 Jan 2024 04:25:02 GMT (envelope-from git) Date: Mon, 8 Jan 2024 04:25:02 GMT Message-Id: <202401080425.4084P2Zr090605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e4166d1934ab - stable/13 - ssh: regen config.h for stable/13 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e4166d1934abc91619b89e21681a6e8305d3cdac Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e4166d1934abc91619b89e21681a6e8305d3cdac commit e4166d1934abc91619b89e21681a6e8305d3cdac Author: Ed Maste AuthorDate: 2024-01-08 04:16:28 +0000 Commit: Ed Maste CommitDate: 2024-01-08 04:16:57 +0000 ssh: regen config.h for stable/13 Sponsored by: The FreeBSD Foundation --- crypto/openssh/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 44ae53f6c354..e36e53c3a781 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -493,7 +493,7 @@ /* #undef HAVE_EVP_CIPHER_CTX_GET_IV */ /* Define to 1 if you have the `EVP_CIPHER_CTX_get_updated_iv' function. */ -#define HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV 1 +/* #undef HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV */ /* Define to 1 if you have the `EVP_CIPHER_CTX_iv' function. */ #define HAVE_EVP_CIPHER_CTX_IV 1 @@ -1414,7 +1414,7 @@ #define HAVE_SYS_CDEFS_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_DIR_H 1 +/* #undef HAVE_SYS_DIR_H */ /* Define if your system defines sys_errlist[] */ #define HAVE_SYS_ERRLIST 1 From nobody Mon Jan 8 04:25:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7gw45qRFz56rJQ; Mon, 8 Jan 2024 04:25: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 4T7gw45Y2vz466X; Mon, 8 Jan 2024 04:25:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MdOE/L7D46ZBISPazAgFyDurEoYIid97+mM9TtxdeiQ=; b=qff2WNgWJ+AMe/rQr0CBeLyCCzQymewpkk2f9xzfM4/4SMPRPNiwktekEy1618o3MVMO5C GozRu2NHQHzr0up0QAMuFxx5cYRHFQnRa6p6sD5cKTjz4uKK13D8aAOj6tavpBRmWwFkWz Z8SJ0E1kfcTgUPvDgnq/3Okybo2tmU3GAet+idYVbLRkTFwJ0bx1PTTzPjFkpzllb5RvnB w4B5TFCNvjIoZugcIAWKrLitFd/sKTYr+nzd6SR35R3T1yHe8g1RY90MIe6OFx2yc2L/Sa NA6F1/M/CCHPmpQl0CqDFw8D9xjBN2BzefH4LrGxh2WqVu/SIBoPdn8xSF5hkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MdOE/L7D46ZBISPazAgFyDurEoYIid97+mM9TtxdeiQ=; b=y22QgP4e9umkeaKofMYWEiy02tuTbvEByJ0AkaCTUWQhPyFGCIYG4vKA7wNHKxXkv0ew6k 9JnXGQ/YWU0Us9geSHKZLNMNbAg3qUxqUlqZgkywAs9s8vFqaRSw7hI1F+wMGv0QdkpMVQ Ai41iQPUBhHaiEULFefOxPfkAQhQxgNhYczhTDhinLJFBJzp9KysQIitv8FWYhMhtBSmeB 5JjLvDyhjd5EzhfOLVdhBxArE2EflYqMye4Q4rc+5MnAkK/AtRXNBnx2eKibxN37fnOkrF unfmqti+pJn7uRctEPZbVz6Pg9vQpZIRd2iJ1uo+eQkzZ7vfHpw8bJZ+zyQsAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704687924; a=rsa-sha256; cv=none; b=WHxiXhaM/BrYfeVZqvrtoOc+hgyyAVXvex/LIcTTasdGDnvcLHfSPGyyEsJFKseDs/Cf1j gD0cnosIlvlUhb6c4h1uP4rHtfq6bxiU/aIHh6qgtxdEhH9xPhQ3iajvMZRB47xm1tND/n qKyfLHJRU/zrAkXSgJdm8rfJlqCNfexFTj9bUVwysKii0p73K1dZe9ag4ApZ0iB4MsmBOD yjgyW0pVuI4znJ4NorRtkCHs2dwwmAWXU1AwjC7xBGcWgegKwR3iLpvoOKMiVhdnZd/+NJ WTX5r5gwMF9qhqwVV3fT2Vn8+CuW46Ql/EYlJ40c6dI0McmXtPwbuir8348zKQ== 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 4T7gw44b68zsdT; Mon, 8 Jan 2024 04:25:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4084PODn090782; Mon, 8 Jan 2024 04:25:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4084POwE090779; Mon, 8 Jan 2024 04:25:24 GMT (envelope-from git) Date: Mon, 8 Jan 2024 04:25:24 GMT Message-Id: <202401080425.4084POwE090779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 221a6bc397ad - stable/13 - ssh: Update to OpenSSH 9.5p1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 221a6bc397ad8a8400c3b4cb6e020cba56f0d68f Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=221a6bc397ad8a8400c3b4cb6e020cba56f0d68f commit 221a6bc397ad8a8400c3b4cb6e020cba56f0d68f Author: Ed Maste AuthorDate: 2023-10-09 17:28:17 +0000 Commit: Ed Maste CommitDate: 2024-01-08 04:21:51 +0000 ssh: Update to OpenSSH 9.5p1 Excerpts from the release notes: Potentially incompatible changes -------------------------------- * ssh-keygen(1): generate Ed25519 keys by default. [NOTE: This change was already merged into FreeBSD.] * sshd(8): the Subsystem directive now accurately preserves quoting of subsystem commands and arguments. New features ------------ * ssh(1): add keystroke timing obfuscation to the client. * ssh(1), sshd(8): Introduce a transport-level ping facility. * sshd(8): allow override of Sybsystem directives in sshd Match blocks. Full release notes at https://www.openssh.com/txt/release-9.5 Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit edf8578117e8844e02c0121147f45e4609b30680) (cherry picked from commit b24ca3caa7524e650550d8a2ee1637e6efcb87f1) --- crypto/openssh/.github/ci-status.md | 4 + crypto/openssh/.github/configs | 11 + crypto/openssh/.github/setup_ci.sh | 8 + crypto/openssh/.github/workflows/c-cpp.yml | 1 + crypto/openssh/.github/workflows/selfhosted.yml | 3 + crypto/openssh/ChangeLog | 1611 +++++++---------------- crypto/openssh/PROTOCOL | 37 +- crypto/openssh/PROTOCOL.agent | 4 +- crypto/openssh/README | 2 +- crypto/openssh/auth2.c | 11 +- crypto/openssh/channels.c | 35 +- crypto/openssh/channels.h | 4 +- crypto/openssh/clientloop.c | 189 ++- crypto/openssh/configure.ac | 12 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/kex.c | 55 +- crypto/openssh/kex.h | 3 +- crypto/openssh/misc.c | 29 +- crypto/openssh/misc.h | 3 +- crypto/openssh/monitor.c | 7 +- crypto/openssh/openbsd-compat/bsd-closefrom.c | 1 - crypto/openssh/packet.c | 35 +- crypto/openssh/packet.h | 3 +- crypto/openssh/readconf.c | 64 +- crypto/openssh/readconf.h | 8 +- crypto/openssh/regress/Makefile | 5 +- crypto/openssh/regress/match-subsystem.sh | 90 ++ crypto/openssh/regress/scp.sh | 24 +- crypto/openssh/regress/scp3.sh | 19 +- crypto/openssh/scp.c | 50 +- crypto/openssh/servconf.c | 107 +- crypto/openssh/servconf.h | 14 +- crypto/openssh/serverloop.c | 4 +- crypto/openssh/session.c | 15 +- crypto/openssh/sftp-client.c | 409 +++--- crypto/openssh/sftp-client.h | 76 +- crypto/openssh/sftp-glob.c | 28 +- crypto/openssh/sftp-usergroup.c | 8 +- crypto/openssh/sftp.c | 138 +- crypto/openssh/ssh-agent.1 | 8 +- crypto/openssh/ssh.c | 11 +- crypto/openssh/ssh2.h | 7 +- crypto/openssh/ssh_config.5 | 33 +- crypto/openssh/ssh_namespace.h | 3 + crypto/openssh/sshd.8 | 6 +- crypto/openssh/sshd.c | 2 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/sshkey.c | 3 +- crypto/openssh/sshsig.c | 27 +- crypto/openssh/version.h | 6 +- 52 files changed, 1640 insertions(+), 1601 deletions(-) diff --git a/crypto/openssh/.github/ci-status.md b/crypto/openssh/.github/ci-status.md index f3e088fd6043..8d4cea10dba4 100644 --- a/crypto/openssh/.github/ci-status.md +++ b/crypto/openssh/.github/ci-status.md @@ -6,6 +6,10 @@ master : [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) [![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable) +9.4 : +[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_4)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_4) +[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_4)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_4) + 9.3 : [![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_3) [![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_3) diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index e054eb3196b5..c7d6a55ab962 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -30,6 +30,13 @@ case "$config" in default|sol64) ;; c89) + # If we don't have LLONG_MAX, configure will figure out that it can + # get it by setting -std=gnu99, at which point we won't be testing + # C89 any more. To avoid this, feed it in via CFLAGS. + llong_max=`gcc -E -dM - +Date: Wed Oct 4 15:34:10 2023 +1100 + + crank version numbers + +commit f65f187b105d9b5c12fd750a211397d08c17c6d4 +Author: djm@openbsd.org +Date: Wed Oct 4 04:04:09 2023 +0000 + + upstream: openssh-9.5 + + OpenBSD-Commit-ID: 5e0af680480bd3b6f5560cf840ad032d48fd6b16 + +commit ffe27e54a4bb18d5d3bbd3f4cc93a41b8d94dfd2 +Author: djm@openbsd.org +Date: Wed Oct 4 04:03:50 2023 +0000 + + upstream: add some cautionary text about % token expansion and + + shell metacharacters; based on report from vinci AT protonmail.ch + + OpenBSD-Commit-ID: aa1450a54fcee2f153ef70368d90edb1e7019113 + +commit 60ec3d54fd1ebfe2dda75893fa1e870b8dffbb0d +Author: djm@openbsd.org +Date: Tue Oct 3 23:56:10 2023 +0000 + + upstream: fix link to agent draft; spotted by Jann Horn + + OpenBSD-Commit-ID: ff5bda21a83ec013db683e282256a85201d2dc4b + +commit 12e2d4b13f6f63ce2de13cbfcc9e4d0d4b4ab231 +Author: Damien Miller +Date: Wed Oct 4 10:54:04 2023 +1100 + + use portable provider allowlist path in manpage + + spotted by Jann Horn + +commit 6c2c6ffde75df95fd838039850d3dd3d84956d87 +Author: deraadt@openbsd.org +Date: Tue Sep 19 20:37:07 2023 +0000 + + upstream: typo; from Jim Spath + + OpenBSD-Commit-ID: 2f5fba917b5d4fcf93d9e0b0756c7f63189e228e + +commit b6b49130a0089b297245ee39e769231d7c763014 +Author: djm@openbsd.org +Date: Sun Sep 10 23:12:32 2023 +0000 + + upstream: rename remote_glob() -> sftp_glob() to match other API + + OpenBSD-Commit-ID: d9dfb3708d824ec02970a84d96cf5937e0887229 + +commit 21b79af6c8d2357c822c84cef3fbdb8001ed263b +Author: djm@openbsd.org +Date: Sun Sep 10 03:51:55 2023 +0000 + + upstream: typo in comment + + OpenBSD-Commit-ID: 69285e0ce962a7c6b0ab5f17a293c60a0a360a18 + +commit 41232d25532b4d2ef6c5db62efc0cf50a79d26ca +Author: Darren Tucker +Date: Sun Sep 10 15:45:38 2023 +1000 + + Use zero-call-used-regs=used with Apple compilers. + + Apple's versions of clang have version numbers that do not match the + corresponding upstream clang versions. Unfortunately, they do still + have the clang-15 zero-call-used-regs=all bug, so for now use the value + that doesn't result in segfaults. We could allowlist future versions + that are known to work. bz#3584 (and probably also our github CI + failures). + +commit 90ccc5918ea505bf156c31148b6b59a1bf5d6dc6 +Author: djm@openbsd.org +Date: Sun Sep 10 03:25:53 2023 +0000 + + upstream: randomise keystroke obfuscation intervals and average + + interval rate. ok dtucker@ + + OpenBSD-Commit-ID: 05f61d051ab418fcfc4857ff306e420037502382 + +commit bd1b9e52f5fa94d87223c90905c5fdc1a7c32aa6 +Author: djm@openbsd.org +Date: Fri Sep 8 06:34:24 2023 +0000 + + upstream: fix sizeof(*ptr) instead sizeof(ptr) in realloc (pointer here + + is char**, so harmless); spotted in CID 416964 + + OpenBSD-Commit-ID: c61caa4a5a667ee20bb1042098861e6c72c69002 + +commit c4f966482983e18601eec70a1563115de836616f +Author: djm@openbsd.org +Date: Fri Sep 8 06:10:57 2023 +0000 + + upstream: regress test recursive remote-remote directories copies where + + the directory contains a symlink to another directory. + + also remove errant `set -x` that snuck in at some point + + OpenBSD-Regress-ID: 1c94a48bdbd633ef2285954ee257725cd7bc456f + +commit 5e1dfe5014ebc194641678303e22ab3bba15f4e5 +Author: djm@openbsd.org +Date: Fri Sep 8 06:10:02 2023 +0000 + + upstream: fix recursive remote-remote copies of directories that + + contain symlinks to other directories (similar to bz3611) + + OpenBSD-Commit-ID: 7e19d2ae09b4f941bf8eecc3955c9120171da37f + +commit 7c0ce2bf98b303b6ad91493ee3247d96c18ba1f6 +Author: djm@openbsd.org +Date: Fri Sep 8 05:50:57 2023 +0000 + + upstream: regress test for recursive copies of directories containing + + symlinks to other directories. bz3611, ok dtucker@ + + OpenBSD-Regress-ID: eaa4c29cc5cddff4e72a16bcce14aeb1ecfc94b9 + +commit 2de990142a83bf60ef694378b8598706bc654b08 +Author: djm@openbsd.org +Date: Fri Sep 8 05:56:13 2023 +0000 + + upstream: the sftp code was one of my first contributions to + + OpenSSH and it shows - the function names are terrible. + + Rename do_blah() to sftp_blah() to make them less so. + + Completely mechanical except for sftp_stat() and sftp_lstat() which + change from returning a pointer to a static variable (error-prone) to + taking a pointer to a caller-provided receiver. + + OpenBSD-Commit-ID: eb54d6a72d0bbba4d623e2175cf5cc4c75dc2ba4 + +commit 249d8bd0472b53e3a2a0e138b4c030a31e83346a +Author: djm@openbsd.org +Date: Fri Sep 8 05:50:12 2023 +0000 + + upstream: fix scp in SFTP mode recursive upload and download of + + directories that contain symlinks to other directories. In scp mode, the + links would be followed, but in SFTP mode they were not. bz3611, ok dtucker@ + + OpenBSD-Commit-ID: 9760fda668eaa94a992250d7670dfbc62a45197c + +commit 0e1f4401c466fa4fdaea81b6dadc8dd1fc4cf0af +Author: djm@openbsd.org +Date: Wed Sep 6 23:36:09 2023 +0000 + + upstream: regression test for override of subsystem in match blocks + + OpenBSD-Regress-ID: 5f8135da3bfda71067084c048d717b0e8793e87c + +commit 8a1450c62035e834d8a79a5d0d1c904236f9dcfe +Author: djm@openbsd.org +Date: Wed Sep 6 23:35:35 2023 +0000 + + upstream: allow override of Sybsystem directives in sshd Match + + blocks + + OpenBSD-Commit-ID: 3911d18a826a2d2fe7e4519075cf3e57af439722 + +commit 6e52826e2a74d077147a82ead8d4fbd5b54f4e3b +Author: djm@openbsd.org +Date: Wed Sep 6 23:26:37 2023 +0000 + + upstream: allocate the subsystems array as necessary and remove the + + fixed limit of subsystems. Saves a few kb of memory in the server and makes + it more like the other options. + + OpenBSD-Commit-ID: e683dfca6bdcbc3cc339bb6c6517c0c4736a547f + +commit e19069c9fac4c111d6496b19c7f7db43b4f07b4f +Author: djm@openbsd.org +Date: Wed Sep 6 23:23:53 2023 +0000 + + upstream: preserve quoting of Subsystem commands and arguments. + + This may change behaviour of exotic configurations, but the most common + subsystem configuration (sftp-server) is unlikely to be affected. + + OpenBSD-Commit-ID: 8ffa296aeca981de5b0945242ce75aa6dee479bf + +commit 52dfe3c72d98503d8b7c6f64fc7e19d685636c0b +Author: djm@openbsd.org +Date: Wed Sep 6 23:21:36 2023 +0000 + + upstream: downgrade duplicate Subsystem directives from being a + + fatal error to being a debug message to match behaviour with just about all + other directives. + + OpenBSD-Commit-ID: fc90ed2cc0c18d4eb8e33d2c5e98d25f282588ce + +commit 1ee0a16e07b6f0847ff463d7b5221c4bf1876e25 +Author: djm@openbsd.org +Date: Wed Sep 6 23:18:15 2023 +0000 + + upstream: handle cr+lf (instead of just cr) in sshsig signature + + files + + OpenBSD-Commit-ID: 647460a212b916540016d066568816507375fd7f + +commit e1c284d60a928bcdd60bc575c6f9604663502770 +Author: job@openbsd.org +Date: Mon Sep 4 10:29:58 2023 +0000 + + upstream: Generate Ed25519 keys when invoked without arguments + + Ed25519 public keys are very convenient due to their small size. + OpenSSH has supported Ed25519 since version 6.5 (January 2014). + + OK djm@ markus@ sthen@ deraadt@ + + OpenBSD-Commit-ID: f498beaad19c8cdcc357381a60df4a9c69858b3f + +commit 694150ad92765574ff82a18f4e86322bd3231e68 +Author: djm@openbsd.org +Date: Mon Sep 4 00:08:14 2023 +0000 + + upstream: trigger keystroke timing obfucation only if the channels + + layer enqueud some data in the last poll() cycle; this avoids triggering the + obfuscatior for non-channels data like ClientAlive probes and also fixes a + related problem were the obfucations would be triggered on fully quiescent + connections. + + Based on / tested by naddy@ + + OpenBSD-Commit-ID: d98f32dc62d7663ff4660e4556e184032a0db123 + +commit b5fd97896b59a3a46245cf438cc8b16c795d9f74 +Author: djm@openbsd.org +Date: Mon Sep 4 00:04:02 2023 +0000 + + upstream: avoid bogus "obfuscate_keystroke_timing: stopping ..." + + debug messages when keystroke timing obfuscation was never started; spotted + by naddy@ + + OpenBSD-Commit-ID: 5c270d35f7d2974db5c1646e9c64188f9393be31 + +commit ccf7d913db34e49b7a6db1b8331bd402004c840d +Author: djm@openbsd.org +Date: Mon Sep 4 00:01:46 2023 +0000 + + upstream: make channel_output_poll() return a flag indicating + + whether channel data was enqueued. Will be used to improve keystroke timing + obfuscation. Problem spotted by / tested by naddy@ + + OpenBSD-Commit-ID: f9776c7b0065ba7c3bbe50431fd3b629f44314d0 + +commit 43254b326ac6e2131dbd750f9464dc62c14bd5a7 +Author: djm@openbsd.org +Date: Sun Sep 3 23:59:32 2023 +0000 + + upstream: set interactive mode for ControlPersist sessions if they + + originally requested a tty; enables keystroke timing obfuscation for most + ControlPersist sessions. Spotted by naddy@ + + OpenBSD-Commit-ID: 72783a26254202e2f3f41a2818a19956fe49a772 + +commit ff3eda68ceb2e2bb8f48e3faceb96076c3e85c20 +Author: Darren Tucker +Date: Thu Aug 31 23:02:35 2023 +1000 + + Set LLONG_MAX for C89 test. + + If we don't have LLONG_MAX, configure will figure out that it can get it + by setting -std=gnu99, at which point we won't be testing C89 any more. + To avoid this, feed it in via CFLAGS. + +commit f98031773db361424d59e3301aa92aacf423d920 +Author: djm@openbsd.org +Date: Tue Aug 29 02:50:10 2023 +0000 + + upstream: make PerSourceMaxStartups first-match-wins; ok dtucker@ + + OpenBSD-Commit-ID: dac0c24cb709e3c595b8b4f422a0355dc5a3b4e7 + +commit cfa66857db90cd908de131e0041a50ffc17c7df8 +Author: djm@openbsd.org +Date: Mon Aug 28 09:52:09 2023 +0000 + + upstream: descriptive text shouldn't be under .Cm + + OpenBSD-Commit-ID: b1afaeb456a52bc8a58f4f9f8b2f9fa8f6bf651b + +commit 01dbf3d46651b7d6ddf5e45d233839bbfffaeaec +Author: djm@openbsd.org +Date: Mon Aug 28 09:48:11 2023 +0000 + + upstream: limit artificial login delay to a reasonable maximum (5s) + + and don't delay at all for the "none" authentication mechanism. Patch by + Dmitry Belyavskiy in bz3602 with polish/ok dtucker@ + + OpenBSD-Commit-ID: 85b364676dd84cf1de0e98fc2fbdcb1a844ce515 + +commit 528da5b9d7c5da01ed7a73ff21c722e1b5326006 +Author: jmc@openbsd.org +Date: Mon Aug 28 05:32:28 2023 +0000 + + upstream: add spacing for punctuation when macro args; + + OpenBSD-Commit-ID: e80343c16ce0420b2aec98701527cf90371bd0db + +commit 3867361ca691d0956ef7d5fb8181cf554a91d84a +Author: djm@openbsd.org +Date: Mon Aug 28 04:06:52 2023 +0000 + + upstream: explicit long long type in timing calculations (doesn't + + matter, since the range is pre-clamped) + + OpenBSD-Commit-ID: f786ed902d04a5b8ecc581d068fea1a79aa772de + +commit 7603ba71264e7fa938325c37eca993e2fa61272f +Author: djm@openbsd.org +Date: Mon Aug 28 03:31:16 2023 +0000 + + upstream: Add keystroke timing obfuscation to the client. + + This attempts to hide inter-keystroke timings by sending interactive + traffic at fixed intervals (default: every 20ms) when there is only a + small amount of data being sent. It also sends fake "chaff" keystrokes + for a random interval after the last real keystroke. These are + controlled by a new ssh_config ObscureKeystrokeTiming keyword/ + + feedback/ok markus@ + + OpenBSD-Commit-ID: 02231ddd4f442212820976068c34a36e3c1b15be + +commit dce6d80d2ed3cad2c516082682d5f6ca877ef714 +Author: djm@openbsd.org +Date: Mon Aug 28 03:28:43 2023 +0000 + + upstream: Introduce a transport-level ping facility + + This adds a pair of SSH transport protocol messages SSH2_MSG_PING/PONG + to implement a ping capability. These messages use numbers in the "local + extensions" number space and are advertised using a "ping@openssh.com" + ext-info message with a string version number of "0". + + ok markus@ + + OpenBSD-Commit-ID: b6b3c4cb2084c62f85a8dc67cf74954015eb547f + +commit d2d247938b38b928f8a6e1a47a330c5584d3a358 +Author: tobhe@openbsd.org +Date: Mon Aug 21 21:16:18 2023 +0000 + + upstream: Log errors in kex_exchange_identification() with level + + verbose instead of error to reduce preauth log spam. All of those get logged + with a more generic error message by sshpkt_fatal(). + + feedback from sthen@ + ok djm@ + + OpenBSD-Commit-ID: bd47dab4695b134a44c379f0e9a39eed33047809 + +commit 9d7193a8359639801193ad661a59d1ae4dc3d302 +Author: djm@openbsd.org +Date: Mon Aug 21 04:59:54 2023 +0000 + + upstream: correct math for ClientAliveInterval that caused the + + probes to be sent less frequently than configured; from Dawid Majchrzak + + OpenBSD-Commit-ID: 641153e7c05117436ddfc58267aa267ca8b80038 + +commit 3c6ab63b383b0b7630da175941e01de9db32a256 +Author: Darren Tucker +Date: Fri Aug 25 14:48:02 2023 +1000 + + Include Portable version in sshd version string. + + bz#3608, ok djm@ + +commit 17fa6cd10a26e193bb6f65d21264d2fe553bcd87 +Author: Darren Tucker +Date: Mon Aug 21 19:47:58 2023 +1000 + + obsd-arm64 host is real hardware... + + so put in the correct config location. + +commit 598ca75c85acaaacee5ef954251e489cc20d7be9 +Author: Darren Tucker +Date: Mon Aug 21 18:38:36 2023 +1000 + + Add OpenBSD ARM64 test host. + +commit 1acac79bfbe207e8db639e8043524962037c8feb +Author: Darren Tucker +Date: Mon Aug 21 18:05:26 2023 +1000 + + Add test for zlib development branch. + +commit 84efebf352fc700e9040c8065707c63caedd36a3 +Author: djm@openbsd.org +Date: Mon Aug 21 04:36:46 2023 +0000 + + upstream: want stdlib.h for free(3) + + OpenBSD-Commit-ID: 743af3c6e3ce5e6cecd051668f0327a01f44af29 + +commit cb4ed12ffc332d1f72d054ed92655b5f1c38f621 +Author: Darren Tucker +Date: Sat Aug 19 07:39:08 2023 +1000 + + Fix zlib version check for 1.3 and future version. + + bz#3604. + +commit 25b75e21f16bccdaa472ea1889b293c9bd51a87b +Author: Darren Tucker +Date: Mon Aug 14 11:10:08 2023 +1000 + + Add 9.4 branch to CI status page. + +commit 803e22eabd3ba75485eedd8b7b44d6ace79f2052 +Author: djm@openbsd.org +Date: Fri Aug 18 01:37:41 2023 +0000 + + upstream: fix regression in OpenSSH 9.4 (mux.c r1.99) that caused + + multiplexed sessions to ignore SIGINT under some circumstances. Reported by / + feedback naddy@, ok dtucker@ + + OpenBSD-Commit-ID: 4d5c6c894664f50149153fd4764f21f43e7d7e5a + +commit e706bca324a70f68dadfd0ec69edfdd486eed23a +Author: djm@openbsd.org +Date: Wed Aug 16 16:14:11 2023 +0000 + + upstream: defence-in-depth MaxAuthTries check in monitor; ok markus + + OpenBSD-Commit-ID: 65a4225dc708e2dae71315adf93677edace46c21 + +commit d1ab7eb90474df656d5e9935bae6df0bd000d343 +Author: djm@openbsd.org +Date: Mon Aug 14 03:37:00 2023 +0000 + + upstream: add message number of SSH2_MSG_NEWCOMPRESS defined in RFC8308 + + OpenBSD-Commit-ID: 6c984171c96ed67effd7b5092f3d3975d55d6028 + +commit fa8da52934cb7dff6f660a143276bdb28bb9bbe1 +Author: Darren Tucker +Date: Sun Aug 13 15:01:27 2023 +1000 + + Add obsd72 and obsd73 test targets. + +commit f9f18006678d2eac8b0c5a5dddf17ab7c50d1e9f +Author: djm@openbsd.org +Date: Thu Aug 10 23:05:48 2023 +0000 + + upstream: better debug logging of sessions' exit status + + OpenBSD-Commit-ID: 82237567fcd4098797cbdd17efa6ade08e1a36b0 + +commit a8c57bcb077f0cfdffcf9f23866bf73bb93e185c +Author: naddy@openbsd.org +Date: Thu Aug 10 14:37:32 2023 +0000 + + upstream: drop a wayward comma, ok jmc@ + + OpenBSD-Commit-ID: 5c11fbb9592a29b37bbf36f66df50db9d38182c6 + +commit e962f9b318a238db1becc53c2bf79dd3a49095b4 Author: Damien Miller Date: Thu Aug 10 11:10:22 2023 +1000 depend -commit 41bfb63f5101fbacde9d8d2ada863f9ee16df194 +commit 0fcb60bf83130dfa428bc4422b3a3ac20fb528af Author: Damien Miller Date: Thu Aug 10 11:05:42 2023 +1000 update versions in RPM specs -commit e598b92b1eecedac21667edf1fe92078eaf8f2b1 +commit d0cee4298491314f09afa1c4383a66d913150b26 Author: Damien Miller Date: Thu Aug 10 11:05:14 2023 +1000 update version in README -commit e797e5ffa74377c8696e3b0559a258d836479239 +commit 78b4dc6684f4d35943b46b24ee645edfdb9974f5 Author: djm@openbsd.org Date: Thu Aug 10 01:01:07 2023 +0000 @@ -24,6 +511,12 @@ Date: Thu Aug 10 01:01:07 2023 +0000 OpenBSD-Commit-ID: 71fc1e01a4c4ea061b252bd399cda7be757e6e35 +commit 58ca4f0aa8c4306ac0a629c9a85fb1efaf4ff092 +Author: Darren Tucker +Date: Thu Aug 10 11:30:24 2023 +1000 + + Only include unistd.h once. + commit 3961ed02dc578517a9d2535128cff5c3a5460d28 Author: Damien Miller Date: Thu Aug 10 09:08:49 2023 +1000 @@ -9062,1113 +9555,3 @@ Date: Wed Oct 6 13:16:21 2021 +1100 fix broken OPENSSL_HAS_ECC test spotted by dtucker - -commit 16a25414f303cd6790eb967aeb962040e32c9c7a -Author: Damien Miller -Date: Fri Oct 1 22:40:06 2021 +1000 - - make sk-dummy.so work without libcrypto installed - -commit dee22129bbc61e25b1003adfa2bc584c5406ef2d -Author: Damien Miller -Date: Fri Oct 1 16:35:49 2021 +1000 - - make OPENSSL_HAS_ECC checks more thorough - - ok dtucker - -commit 872595572b6c9a584ed754165e8b7c4c9e7e1d61 -Author: Damien Miller -Date: Fri Oct 1 16:35:05 2021 +1000 - - fix FIDO key support for !OPENSSL_HAS_ECC case - - ok dtucker - -commit 489741dc68366940d369ac670b210b4834a6c272 -Author: Damien Miller -Date: Fri Oct 1 14:51:37 2021 +1000 - - enable security key support for --without-openssl - -commit c978565c8589acfe4ea37ab5099d39c84158c713 -Author: Damien Miller -Date: Fri Oct 1 13:27:50 2021 +1000 - - need stdlib.h for free(3) - -commit 76a398edfb51951b2d65d522d7b02c72304db300 -Author: dtucker@openbsd.org -Date: Thu Sep 30 05:26:26 2021 +0000 - - upstream: Fix up whitespace left by previous - - change removing privsep. No other changes. - - OpenBSD-Regress-ID: 87adec225d8afaee4d6a91b2b71203f52bf14b15 - -commit ddcb53b7a7b29be65d57562302b2d5f41733e8dd -Author: dtucker@openbsd.org -Date: Thu Sep 30 05:20:08 2021 +0000 - - upstream: Remove references to privsep. - - This removes several do..while loops but does not change the - indentation of the now-shallower loops, which will be done in a separate - whitespace-only commit to keep changes of style and substance separate. - - OpenBSD-Regress-ID: 4bed1a0249df7b4a87c965066ce689e79472a8f7 - -commit ece2fbe486164860de8df3f8b943cccca3085eff -Author: dtucker@openbsd.org -Date: Thu Sep 30 04:22:50 2021 +0000 - - upstream: Use "skip" instead of "fatal" - - if SUDO isn't set for the *-command tests. This means running "make tests" - without SUDO set will perform all of the tests that it can instead of - failing on the ones it cannot run. - - OpenBSD-Regress-ID: bd4dbbb02f34b2e8c890558ad4a696248def763a - -commit bb754b470c360e787a99fb4e88e2668198e97b41 -Author: djm@openbsd.org -Date: Fri Oct 1 04:50:36 2021 +0000 - - upstream: unbreak FIDO sk-ed25519 key enrollment for OPENSSL=no builds; - - ok dtucker@ - - OpenBSD-Commit-ID: 6323a5241728626cbb2bf0452cf6a5bcbd7ff709 - -commit 207648d7a6415dc915260ca75850404dbf9f0a0b -Author: Darren Tucker -Date: Wed Sep 29 20:03:58 2021 +1000 - - Include stdlib.h for arc4random_uniform prototype. - -commit 696aadc854582c164d5fc04933d2f3e212dc0e06 -Author: Darren Tucker -Date: Wed Sep 29 20:00:30 2021 +1000 - - Look for clang after cc and gcc. - -commit a3c6375555026d85dbf811fab566b9f76f196144 -Author: Darren Tucker -Date: Wed Sep 29 19:30:59 2021 +1000 - - Use backticks instead of $(..) for portability. - - Older shells (eg /bin/sh on Solaris 10) don't support $() syntax. - -commit 958aaa0387133d51f84fe9c8f30bca03025f2867 -Author: Darren Tucker -Date: Wed Sep 29 18:53:32 2021 +1000 - - Skip file-based tests by default on Mac OS. - - The file-based tests need OpenSSL so skip them. - -commit 55c8bdf6e9afb0f9fa8e4f10c25c7f0081b48fd0 -Author: Darren Tucker -Date: Wed Sep 29 18:42:47 2021 +1000 - - Build without OpenSSL on Mac OS. - - Modern versions don't ship enough libcrypto to build against. - -commit c9172193ea975415facf0afb356d87df21535f88 -Author: Darren Tucker -Date: Wed Sep 29 18:33:38 2021 +1000 - - Remove TEST_SSH_ECC. - - Convert the only remaining user of it to runtime detection using ssh -Q. - -commit 5e6d28b7874b0deae95d2c68947c45212d32e599 -Author: Darren Tucker -Date: Wed Sep 29 17:48:09 2021 +1000 - - Split c89 test openssl setting out. - -commit c4ac7f98e230e83c015678dc958b1ffe828564ad -Author: Darren Tucker -Date: Wed Sep 29 17:40:50 2021 +1000 - - Expand TEST_SHELL consistently with other vars. - -commit cfe5f7b0eb7621bfb0a756222de0431315c2ab8b -Author: Darren Tucker -Date: Wed Sep 29 17:26:50 2021 +1000 - - Replace `pwd` with make variable in regress cmd. - -commit 899be59da5fbc3372444bd0fbe74af48313bed33 -Author: Darren Tucker -Date: Wed Sep 29 17:14:33 2021 +1000 - - Get BUILDDIR from autoconf. - - Use this to replace `pwd`s in regress test command line. - -commit c8d92d3d4f7d560146f2f936156ec4dac3fc5811 -Author: Darren Tucker -Date: Wed Sep 29 13:28:56 2021 +1000 - - Add make clean step to tests. - -commit 360fb41ef8359619ab90b0d131c914494e55d3dd -Author: Darren Tucker -Date: Wed Sep 29 11:36:13 2021 +1000 - - Test all available clang and gcc versions. - -commit 4fb49899d7da22952d35a4bc4c9bdb2311087893 -Author: djm@openbsd.org -Date: Wed Sep 29 01:32:21 2021 +0000 - - upstream: Test certificate hostkeys held in ssh-agent too. Would have - - caught regression fixed in sshd r1.575 - - ok markus@ - - OpenBSD-Regress-ID: 1f164d7bd89f83762db823eec4ddf2d2556145ed - -commit ce4854e12e749a05646e5775e9deb8cfaf49a755 -Author: djm@openbsd.org -Date: Wed Sep 29 01:33:32 2021 +0000 - - upstream: add some debug output showing how many key file/command lines - - were processed. Useful to see whether a file or command actually has keys - present - - OpenBSD-Commit-ID: 0bd9ff94e84e03a22df8e6c12f6074a95d27f23c - -commit 15abdd523501c349b703d9a27e2bb4252ad921ef -Author: dtucker@openbsd.org -Date: Tue Sep 28 11:14:50 2021 +0000 - - upstream: Make prototype for rijndaelEncrypt match function - - including the bounds. Fixes error in portable where GCC>=11 takes notice of - the bounds. ok deraadt@ - - OpenBSD-Commit-ID: cdd2f05fd1549e1786a70871e513cf9e9cf099a6 - -commit d1d29ea1d1ef1a1a54b209f062ec1dcc8399cf03 -Author: dtucker@openbsd.org -Date: Tue Sep 28 11:10:05 2021 +0000 - - upstream: Import regenerated moduli. - - OpenBSD-Commit-ID: 4bec5db13b736b64b06a0fca704cbecc2874c8e1 - -commit 39f2111b1d5f00206446257377dcce58cc72369f -Author: Darren Tucker -Date: Wed Sep 29 10:53:55 2021 +1000 - - Add new compiler hardening flags. - - Add -fzero-call-used-regs and -ftrivial-auto-var-init to the list of - compiler hardening flags that configure checks for. These are supported - by clang and gcc, and make ROP gadgets less useful and mitigate - stack-based infoleaks respectively. ok djm@ - -commit bf944e3794eff5413f2df1ef37cddf96918c6bde -Author: Damien Miller -Date: Mon Sep 27 00:03:19 2021 +1000 - - initgroups needs grp.h - -commit 8c5b5655149bd76ea21026d7fe73ab387dbc3bc7 -Author: djm@openbsd.org -Date: Sun Sep 26 14:01:11 2021 +0000 - - upstream: openssh-8.8 - - OpenBSD-Commit-ID: 12357794602ac979eb7312a1fb190c453f492ec4 - -commit f3cbe43e28fe71427d41cfe3a17125b972710455 -Author: djm@openbsd.org -Date: Sun Sep 26 14:01:03 2021 +0000 - - upstream: need initgroups() before setresgid(); reported by anton@, - - ok deraadt@ - - OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce - -commit 8acaff41f7518be40774c626334157b1b1c5583c -Author: Damien Miller -Date: Sun Sep 26 22:16:36 2021 +1000 - - update version numbers for release - -commit d39039ddc0010baa91c70a0fa0753a2699bbf435 -Author: kn@openbsd.org -Date: Sat Sep 25 09:40:33 2021 +0000 - - upstream: RSA/SHA-1 is not used by default anymore - - OK dtucker deraadt djm - - OpenBSD-Commit-ID: 055c51a221c3f099dd75c95362f902da1b8678c6 - -commit 9b2ee74e3aa8c461eb5552a6ebf260449bb06f7e -Author: Darren Tucker -Date: Fri Sep 24 11:08:03 2021 +1000 *** 4738 LINES SKIPPED *** From nobody Mon Jan 8 04:25:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7gw60gPhz56rDC; Mon, 8 Jan 2024 04:25:26 +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 4T7gw56X21z46Gg; Mon, 8 Jan 2024 04:25:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICZpXTxjXa3Gj7fo8Ygn1y2AyWE/nxZbhTMjUBr6uc4=; b=SmitTZSOmpgZ2fXzCjQPiIFm5eJ1pBWgU4hbXBKK/c7TRwcJOp6Cf7cR2x+hqT/mnWMvge dhobGWIYqWeKQAmQhFMjZNxkacDnUN/wWP/oNonCg+5nEXMmUfbc5C/Fdzx48i99CghpzZ BTTeA4un+wovWsJZyQ0MPUN2frDKLukz3myTb/LgSvWnk9pyuUuJf5GlUgWMh4qCUrhnTJ gu3y9zxs/dSUMJ30a4vXVBqVkazCrec0MK7ZxnL1RN7N3kVe7cwQfDQlinTTpmByMBZOSv Ct7SqC3UzVi3WiI8ZI7Kh09IEQ7oUJHrwlAseIPrylSgVcOL2ig2UYaHumwvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704687925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICZpXTxjXa3Gj7fo8Ygn1y2AyWE/nxZbhTMjUBr6uc4=; b=TkZ7/DZUQ3w9iva0pZVCosAdtOsMbiNzlJ1v1/QmqbkNYCfyBccHHUYkSiKgRMB8e61fLH jFt+FuAMb6vb6ekzhUqOT0ncONimQ2u43IlUk9fOtAPGhp35Vc9cGcTU9qTCRbfPci1y4W mw32M7k20C4HJTBLAlD6OaM9qnCX1ShSXhgWI0H3KLx1Igs3mCCi/7/Dq3sKprnepgniMD BRbcGQs9bYAo+iT2n4mYdEIZ14OaMtbwEtDdA57xzk9DvW8PCfdW55j7DfCHBY2h/EQ4Ay pJ69xpRJcekz16PLbXTL9cZG4DxJHcvVqrFEl/kGQPKu0OMgrdPQrc7pO/56Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704687925; a=rsa-sha256; cv=none; b=v7K1PJHBojqmEhwnmyW0afPP3g3TvPgvo1gih0IZbbKbAtwJ5Ktp2iZoKhL7G+gSdRJCmX zlJAS2D1SmlLD59mZZxiNbE7QYqf3ncK+nT0+88a8eAokUuCUE4XVu28aarT1+vApnjQh1 iQFPlIkS/UBcCKSwfpmRSUK0Si+iHruCaHEsK1QDdwHRJfYAACwTYUT9B1aWFLHuKv3QrT 0wvyytYa87dUrb/NySIlNowIAwJuvcAWFTT+FR2trFfp7ZEeZvDCsuVot0ei1IzU+u3lnU kRQwhX1RNijYmPiZk3s02wMuRaTtuR2LGIOEoKFC36xECpPP0nElWrgEUED4MA== 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 4T7gw55bpbzsdV; Mon, 8 Jan 2024 04:25:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4084PPqp090833; Mon, 8 Jan 2024 04:25:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4084PPZg090830; Mon, 8 Jan 2024 04:25:25 GMT (envelope-from git) Date: Mon, 8 Jan 2024 04:25:25 GMT Message-Id: <202401080425.4084PPZg090830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b8d5f0482d43 - stable/13 - ssh: ban user/hostnames with most shell metacharacters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b8d5f0482d43a6a5dca6eb07a98c806d476e8cd9 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b8d5f0482d43a6a5dca6eb07a98c806d476e8cd9 commit b8d5f0482d43a6a5dca6eb07a98c806d476e8cd9 Author: Ed Maste AuthorDate: 2024-01-05 18:12:09 +0000 Commit: Ed Maste CommitDate: 2024-01-08 04:21:51 +0000 ssh: ban user/hostnames with most shell metacharacters Cherry-picked from OpenSSH commit 7ef3787c84b6: This makes ssh(1) refuse user or host names provided on the commandline that contain most shell metacharacters. Some programs that invoke ssh(1) using untrusted data do not filter metacharacters in arguments they supply. This could create interactions with user-specified ProxyCommand and other directives that allow shell injection attacks to occur. It's a mistake to invoke ssh(1) with arbitrary untrusted arguments, but getting this stuff right can be tricky, so this should prevent most obvious ways of creating risky situations. It however is not and cannot be perfect: ssh(1) has no practical way of interpreting what shell quoting rules are in use and how they interact with the user's specified ProxyCommand. To allow configurations that use strange user or hostnames to continue to work, this strictness is applied only to names coming from the commandline. Names specified using User or Hostname directives in ssh_config(5) are not affected. feedback/ok millert@ markus@ dtucker@ deraadt@ OpenBSD-Commit-ID: 3b487348b5964f3e77b6b4d3da4c3b439e94b2d9 (cherry picked from commit c39254c8f23379709b8e2a68dc64477d2885f1d4) --- crypto/openssh/ssh.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 8469f8edbb48..55a28f0ea1ff 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.594 2023/09/03 23:59:32 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.599 2023/12/18 14:47:44 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -624,6 +624,41 @@ ssh_conn_info_free(struct ssh_conn_info *cinfo) free(cinfo); } +static int +valid_hostname(const char *s) +{ + size_t i; + + if (*s == '-') + return 0; + for (i = 0; s[i] != 0; i++) { + if (strchr("'`\"$\\;&<>|(){}", s[i]) != NULL || + isspace((u_char)s[i]) || iscntrl((u_char)s[i])) + return 0; + } + return 1; +} + +static int +valid_ruser(const char *s) +{ + size_t i; + + if (*s == '-') + return 0; + for (i = 0; s[i] != 0; i++) { + if (strchr("'`\";&<>|(){}", s[i]) != NULL) + return 0; + /* Disallow '-' after whitespace */ + if (isspace((u_char)s[i]) && s[i + 1] == '-') + return 0; + /* Disallow \ in last position */ + if (s[i] == '\\' && s[i + 1] == '\0') + return 0; + } + return 1; +} + /* * Main program for the ssh client. */ @@ -1122,6 +1157,10 @@ main(int ac, char **av) if (!host) usage(); + if (!valid_hostname(host)) + fatal("hostname contains invalid characters"); + if (options.user != NULL && !valid_ruser(options.user)) + fatal("remote username contains invalid characters"); options.host_arg = xstrdup(host); /* Initialize the command to execute on remote host. */ From nobody Mon Jan 8 13:56:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7wZq2H6jz55mqp; Mon, 8 Jan 2024 13:56: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 4T7wZq21Pxz44lW; Mon, 8 Jan 2024 13:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704722179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WESTmiLZxq7aSDT5//w+j5REmNlRUlgmv+GgFVekYFA=; b=tpfrrsIUMUILMAKmfJ03hk+wWR/B0RK5cztUBvBP8TRC88WiYxlGpGngQlK+X8itlORKl5 /FNWwvRGvNfTdZB7d2R2UfhnYADWTfZTsuaUsDYoRxwJfc6fvtAv23Y56QdJUbYPyoQ5u1 AfSqaViKZhllBYdpxpquFDGbHbjn57GxixD/4HbWb/MkkreEgVX/LtE0vuT32mKsKHPtTm hvPLTiqwXH4R/t1prqW3A0Lius4W1H8xWS8DQ8HpVlSsooMfK2osYPMBA0trkGjZJT21Lw oc9LkaPWuHA4Pcrqe0gf3JGZVqudxB7zGOIEJcZUEkiscpMCAX7kePInw6TYYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704722179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WESTmiLZxq7aSDT5//w+j5REmNlRUlgmv+GgFVekYFA=; b=X0N0EHdp6twvRXWcbvNOeY9tkN47Pa3K7t+yqW60Gtd1hWMoH9YLscf1o0SVoTwoPolJo2 s7tVUv2LaYxEa8gZuThpXccvCWFlx8OJjFYGqpr6z1Uw0+H6KY9nJ1pURCccEnedBMMKhn 2QpOGj9ikqvBgM/QyO3bCd+YeTfAhA9ICZ/kW8RBqjsJuCHAg0AFAbLOg7pcus9tFc/7Pv utzxonU7tYE58/enxxwaLJVYOKuVXWPwodktjRWJRjWfBGUTAkaxWdujdA4fbGHvWaDF5R dV6dmljqpkeTevnUCfMANvdsTEr8Tq7fDPr8del2SvQPwFAwY62E+b9Ou0muAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704722179; a=rsa-sha256; cv=none; b=l/Z0QTAhQzplKffiM7r7SDRFmA/VUhahdNBqIolrR4TOqm8LRp1BtocP3GbI+IVuW2hhou Inu5aZ0bU78E+eLQVmBjdlYHdTgmVVgiL7KB6N6TMzr4jOGYsjEh8CVEOkBM9+BvWrB5Tr 7WW28wDUf08pRD+AtZVpXV8GQCAUkvM3mlaWXRWsc0VyOqmsCC8eeAX1cUtYd3nnbBUdJ5 BVN04dM046YFTJRKPnNDkA35l1Iu0tteobkKZ/IuqVTlH/urnU7aNr/Oytq5qKdnlMyfsC 4iaVwS7b68Cywh8ffq0RcMHQPC9/e2ud2EGfGmDC7TlMVnJAmCudThuOtI4O3w== 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 4T7wZq13fvz18kK; Mon, 8 Jan 2024 13:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408DuJC7049906; Mon, 8 Jan 2024 13:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408DuI2g049903; Mon, 8 Jan 2024 13:56:18 GMT (envelope-from git) Date: Mon, 8 Jan 2024 13:56:18 GMT Message-Id: <202401081356.408DuI2g049903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a25789646d71 - stable/14 - ssh: Update to OpenSSH 9.6p1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a25789646d7130f5be166cac63d5c8b2b07c4706 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a25789646d7130f5be166cac63d5c8b2b07c4706 commit a25789646d7130f5be166cac63d5c8b2b07c4706 Author: Ed Maste AuthorDate: 2024-01-05 03:16:30 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:31:11 +0000 ssh: Update to OpenSSH 9.6p1 From the release notes, > This release contains a number of security fixes, some small features > and bugfixes. The most significant change in 9.6p1 is a set of fixes for a newly- discovered weakness in the SSH transport protocol. The fix was already merged into FreeBSD and released as FreeBSD-SA-23:19.openssh. Full release notes at https://www.openssh.com/txt/release-9.6 Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit 069ac18495ad8fde2748bc94b0f80a50250bb01d) --- crypto/openssh/.depend | 3 +- crypto/openssh/.github/configs | 14 +- crypto/openssh/.github/setup_ci.sh | 53 +- crypto/openssh/.github/workflows/c-cpp.yml | 15 +- crypto/openssh/.github/workflows/selfhosted.yml | 21 +- crypto/openssh/ChangeLog | 12792 +++++++++++----------- crypto/openssh/Makefile.in | 14 +- crypto/openssh/PROTOCOL | 23 +- crypto/openssh/PROTOCOL.agent | 33 +- crypto/openssh/README | 2 +- crypto/openssh/auth2.c | 8 +- crypto/openssh/authfd.c | 40 +- crypto/openssh/authfd.h | 5 +- crypto/openssh/channels.c | 36 +- crypto/openssh/channels.h | 4 +- crypto/openssh/cipher.c | 23 +- crypto/openssh/cipher.h | 3 +- crypto/openssh/clientloop.c | 34 +- crypto/openssh/config.h | 9 + crypto/openssh/configure.ac | 49 +- crypto/openssh/contrib/redhat/openssh.spec | 34 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/kex.c | 235 +- crypto/openssh/kex.h | 7 +- crypto/openssh/log.c | 6 +- crypto/openssh/m4/openssh.m4 | 116 +- crypto/openssh/misc.c | 41 +- crypto/openssh/misc.h | 3 +- crypto/openssh/moduli | 898 +- crypto/openssh/monitor_wrap.c | 4 +- crypto/openssh/mux.c | 4 +- crypto/openssh/openbsd-compat/port-solaris.c | 24 +- crypto/openssh/readconf.c | 57 +- crypto/openssh/readconf.h | 7 +- crypto/openssh/regress/Makefile | 10 +- crypto/openssh/regress/agent-pkcs11-cert.sh | 92 + crypto/openssh/regress/agent-pkcs11-restrict.sh | 193 + crypto/openssh/regress/agent-pkcs11.sh | 82 +- crypto/openssh/regress/conch-ciphers.sh | 11 +- crypto/openssh/regress/dropbear-ciphers.sh | 33 + crypto/openssh/regress/dropbear-kex.sh | 31 + crypto/openssh/regress/forcecommand.sh | 56 +- crypto/openssh/regress/sshsig.sh | 72 +- crypto/openssh/regress/test-exec.sh | 169 +- crypto/openssh/regress/unittests/Makefile | 3 +- crypto/openssh/regress/unittests/Makefile.inc | 4 +- crypto/openssh/scp.c | 12 +- crypto/openssh/servconf.c | 40 +- crypto/openssh/sftp-client.c | 4 +- crypto/openssh/ssh-add.1 | 14 +- crypto/openssh/ssh-add.c | 92 +- crypto/openssh/ssh-agent.c | 241 +- crypto/openssh/ssh-pkcs11-client.c | 56 +- crypto/openssh/ssh-pkcs11.h | 5 +- crypto/openssh/ssh.1 | 7 +- crypto/openssh/ssh.c | 26 +- crypto/openssh/ssh2.h | 3 +- crypto/openssh/ssh_config.5 | 83 +- crypto/openssh/ssh_namespace.h | 7 +- crypto/openssh/sshconnect.c | 10 +- crypto/openssh/sshconnect.h | 6 +- crypto/openssh/sshconnect2.c | 63 +- crypto/openssh/sshd.c | 4 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/sshkey.c | 40 +- crypto/openssh/sshsig.c | 7 +- crypto/openssh/version.h | 6 +- secure/usr.bin/ssh-agent/Makefile | 2 +- 69 files changed, 8732 insertions(+), 7375 deletions(-) diff --git a/crypto/openssh/.depend b/crypto/openssh/.depend index 259bf3b2f136..4897698ab74a 100644 --- a/crypto/openssh/.depend +++ b/crypto/openssh/.depend @@ -28,7 +28,8 @@ auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd- auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h kex .h +auth2.o: mac.h crypto_api.h authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h log.h ssherr.h atomicio.h misc.h authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index c7d6a55ab962..df82faf5046b 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -108,9 +108,19 @@ case "$config" in SKIP_LTESTS=sftp-chroot ;; gcc-11-Werror) - CC="gcc" + CC="gcc-11" + # -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled + # -Wunused-result ignores (void) so is not useful. See + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + CFLAGS="-O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter -Wno-unused-result" + CONFIGFLAGS="--with-pam --with-Werror" + ;; + gcc-12-Werror) + CC="gcc-12" # -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled - CFLAGS="-Wall -Wextra -O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter" + # -Wunused-result ignores (void) so is not useful. See + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + CFLAGS="-O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter -Wno-unused-result" CONFIGFLAGS="--with-pam --with-Werror" ;; clang*|gcc*) diff --git a/crypto/openssh/.github/setup_ci.sh b/crypto/openssh/.github/setup_ci.sh index 010a333a6642..d0ba7b4724e9 100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh @@ -18,8 +18,7 @@ case "$host" in ;; *-darwin*) PACKAGER=brew - brew install automake - exit 0 + PACKAGES="automake" ;; *) PACKAGER=apt @@ -30,20 +29,30 @@ TARGETS=$@ INSTALL_FIDO_PPA="no" export DEBIAN_FRONTEND=noninteractive -#echo "Setting up for '$TARGETS'" - -set -ex +set -e if [ -x "`which lsb_release 2>&1`" ]; then lsb_release -a fi -# Ubuntu 22.04 defaults to private home dirs which prevent the -# agent-getpeerid test from running ssh-add as nobody. See -# https://github.com/actions/runner-images/issues/6106 -if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then - echo ~ is not executable by nobody, adding perms. - chmod go+x ~ +if [ ! -z "$SUDO" ]; then + # Ubuntu 22.04 defaults to private home dirs which prevent the + # agent-getpeerid test from running ssh-add as nobody. See + # https://github.com/actions/runner-images/issues/6106 + if ! "$SUDO" -u nobody test -x ~; then + echo ~ is not executable by nobody, adding perms. + chmod go+x ~ + fi + # Some of the Mac OS X runners don't have a nopasswd sudo rule. Regular + # sudo still works, but sudo -u doesn't. Restore the sudo rule. + if ! "$SUDO" grep -E 'runner.*NOPASSWD' /etc/passwd >/dev/null; then + echo "Restoring runner nopasswd rule to sudoers." + echo 'runner ALL=(ALL) NOPASSWD: ALL' |$SUDO tee -a /etc/sudoers + fi + if ! "$SUDO" -u nobody -S test -x ~ -Date: Wed Oct 4 15:34:10 2023 +1100 +Date: Tue Dec 19 01:59:50 2023 +1100 - crank version numbers + crank versions -commit f65f187b105d9b5c12fd750a211397d08c17c6d4 -Author: djm@openbsd.org -Date: Wed Oct 4 04:04:09 2023 +0000 +commit 2f2c65cb5f1518a9c556d3e8efa27ea0ca305c6b +Author: Damien Miller +Date: Tue Dec 19 01:59:06 2023 +1100 - upstream: openssh-9.5 - - OpenBSD-Commit-ID: 5e0af680480bd3b6f5560cf840ad032d48fd6b16 + depend -commit ffe27e54a4bb18d5d3bbd3f4cc93a41b8d94dfd2 +commit e48cdee8e19059203b1aeeabec2350b8375fa61f Author: djm@openbsd.org -Date: Wed Oct 4 04:03:50 2023 +0000 +Date: Mon Dec 18 14:50:08 2023 +0000 - upstream: add some cautionary text about % token expansion and - - shell metacharacters; based on report from vinci AT protonmail.ch + upstream: regress test for agent PKCS#11-backed certificates - OpenBSD-Commit-ID: aa1450a54fcee2f153ef70368d90edb1e7019113 + OpenBSD-Regress-ID: 38f681777cb944a8cc3bf9d0ad62959a16764df9 -commit 60ec3d54fd1ebfe2dda75893fa1e870b8dffbb0d +commit 2f512f862df1d5f456f82a0334c9e8cc7208a2a1 Author: djm@openbsd.org -Date: Tue Oct 3 23:56:10 2023 +0000 +Date: Mon Dec 18 14:49:39 2023 +0000 - upstream: fix link to agent draft; spotted by Jann Horn + upstream: regress test for constrained PKCS#11 keys - OpenBSD-Commit-ID: ff5bda21a83ec013db683e282256a85201d2dc4b + OpenBSD-Regress-ID: b2f26ae95d609d12257b43aef7cd7714c82618ff -commit 12e2d4b13f6f63ce2de13cbfcc9e4d0d4b4ab231 -Author: Damien Miller -Date: Wed Oct 4 10:54:04 2023 +1100 +commit cdddd66412ca5920ed4d3ebbfa6ace12dbd9b82f +Author: djm@openbsd.org +Date: Mon Dec 18 14:48:44 2023 +0000 - use portable provider allowlist path in manpage + upstream: openssh-9.6 - spotted by Jann Horn + OpenBSD-Commit-ID: 21759837cf0e0092d9a2079f8fb562071c11016b -commit 6c2c6ffde75df95fd838039850d3dd3d84956d87 -Author: deraadt@openbsd.org -Date: Tue Sep 19 20:37:07 2023 +0000 +commit 6d51feab157cedf1e7ef5b3f8781ca8ff9c4ab1b +Author: djm@openbsd.org +Date: Mon Dec 18 14:48:08 2023 +0000 - upstream: typo; from Jim Spath + upstream: ssh-agent: record failed session-bind attempts - OpenBSD-Commit-ID: 2f5fba917b5d4fcf93d9e0b0756c7f63189e228e + Record failed attempts to session-bind a connection and refuse signing + operations on that connection henceforth. + + Prevents a future situation where we add a new hostkey type that is not + recognised by an older ssh-agent, that consequently causes session-bind + to fail (this situation is only likely to arise when people mix ssh(1) + and ssh-agent(1) of different versions on the same host). Previously, + after such a failure the agent socket would be considered unbound and + not subject to restriction. + + Spotted by Jann Horn + + OpenBSD-Commit-ID: b0fdd023e920aa4831413f640de4c5307b53552e -commit b6b49130a0089b297245ee39e769231d7c763014 +commit 7ef3787c84b6b524501211b11a26c742f829af1a Author: djm@openbsd.org -Date: Sun Sep 10 23:12:32 2023 +0000 +Date: Mon Dec 18 14:47:44 2023 +0000 - upstream: rename remote_glob() -> sftp_glob() to match other API + upstream: ban user/hostnames with most shell metacharacters - OpenBSD-Commit-ID: d9dfb3708d824ec02970a84d96cf5937e0887229 + This makes ssh(1) refuse user or host names provided on the + commandline that contain most shell metacharacters. + + Some programs that invoke ssh(1) using untrusted data do not filter + metacharacters in arguments they supply. This could create + interactions with user-specified ProxyCommand and other directives + that allow shell injection attacks to occur. + + It's a mistake to invoke ssh(1) with arbitrary untrusted arguments, + but getting this stuff right can be tricky, so this should prevent + most obvious ways of creating risky situations. It however is not + and cannot be perfect: ssh(1) has no practical way of interpreting + what shell quoting rules are in use and how they interact with the + user's specified ProxyCommand. + + To allow configurations that use strange user or hostnames to + continue to work, this strictness is applied only to names coming + from the commandline. Names specified using User or Hostname + directives in ssh_config(5) are not affected. + + feedback/ok millert@ markus@ dtucker@ deraadt@ + + OpenBSD-Commit-ID: 3b487348b5964f3e77b6b4d3da4c3b439e94b2d9 -commit 21b79af6c8d2357c822c84cef3fbdb8001ed263b +commit 0cb50eefdd29f0fec31d0e71cc4b004a5f704e67 Author: djm@openbsd.org -Date: Sun Sep 10 03:51:55 2023 +0000 +Date: Mon Dec 18 14:47:20 2023 +0000 - upstream: typo in comment + upstream: stricter handling of channel window limits - OpenBSD-Commit-ID: 69285e0ce962a7c6b0ab5f17a293c60a0a360a18 - -commit 41232d25532b4d2ef6c5db62efc0cf50a79d26ca -Author: Darren Tucker -Date: Sun Sep 10 15:45:38 2023 +1000 - - Use zero-call-used-regs=used with Apple compilers. + This makes ssh/sshd more strict in handling non-compliant peers that + send more data than the advertised channel window allows. Previously + the additional data would be silently discarded. This change will + cause ssh/sshd to terminate the connection if the channel window is + exceeded by more than a small grace allowance. - Apple's versions of clang have version numbers that do not match the - corresponding upstream clang versions. Unfortunately, they do still - have the clang-15 zero-call-used-regs=all bug, so for now use the value - that doesn't result in segfaults. We could allowlist future versions - that are known to work. bz#3584 (and probably also our github CI - failures). + ok markus@ + + OpenBSD-Commit-ID: 811e21b41831eba3dd7f67b3d409a438f20d3037 -commit 90ccc5918ea505bf156c31148b6b59a1bf5d6dc6 +commit 4448a2938abc76e6bd33ba09b2ec17a216dfb491 Author: djm@openbsd.org -Date: Sun Sep 10 03:25:53 2023 +0000 +Date: Mon Dec 18 14:46:56 2023 +0000 - upstream: randomise keystroke obfuscation intervals and average + upstream: Make it possible to load certs from PKCS#11 tokens - interval rate. ok dtucker@ + Adds a protocol extension to allow grafting certificates supplied by + ssh-add to keys loaded from PKCS#11 tokens in the agent. - OpenBSD-Commit-ID: 05f61d051ab418fcfc4857ff306e420037502382 + feedback/ok markus@ + + OpenBSD-Commit-ID: bb5433cd28ede2bc910996eb3c0b53e20f86037f -commit bd1b9e52f5fa94d87223c90905c5fdc1a7c32aa6 +commit 881d9c6af9da4257c69c327c4e2f1508b2fa754b Author: djm@openbsd.org -Date: Fri Sep 8 06:34:24 2023 +0000 +Date: Mon Dec 18 14:46:12 2023 +0000 - upstream: fix sizeof(*ptr) instead sizeof(ptr) in realloc (pointer here + upstream: apply destination constraints to all p11 keys - is char**, so harmless); spotted in CID 416964 + Previously applied only to the first key returned from each token. - OpenBSD-Commit-ID: c61caa4a5a667ee20bb1042098861e6c72c69002 + ok markus@ + + OpenBSD-Commit-ID: 36df3afb8eb94eec6b2541f063d0d164ef8b488d -commit c4f966482983e18601eec70a1563115de836616f +commit a7ed931caeb68947d30af8a795f4108b6efad761 Author: djm@openbsd.org -Date: Fri Sep 8 06:10:57 2023 +0000 +Date: Mon Dec 18 14:45:49 2023 +0000 - upstream: regress test recursive remote-remote directories copies where + upstream: add "ext-info-in-auth@openssh.com" extension - the directory contains a symlink to another directory. + This adds another transport protocol extension to allow a sshd to send + SSH2_MSG_EXT_INFO during user authentication, after the server has + learned the username that is being logged in to. - also remove errant `set -x` that snuck in at some point + This lets sshd to update the acceptable signature algoritms for public + key authentication, and allows these to be varied via sshd_config(5) + "Match" directives, which are evaluated after the server learns the + username being authenticated. - OpenBSD-Regress-ID: 1c94a48bdbd633ef2285954ee257725cd7bc456f + Full details in the PROTOCOL file + + OpenBSD-Commit-ID: 1de7da7f2b6c32a46043d75fcd49b0cbb7db7779 -commit 5e1dfe5014ebc194641678303e22ab3bba15f4e5 +commit 1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Author: djm@openbsd.org -Date: Fri Sep 8 06:10:02 2023 +0000 +Date: Mon Dec 18 14:45:17 2023 +0000 - upstream: fix recursive remote-remote copies of directories that + upstream: implement "strict key exchange" in ssh and sshd - contain symlinks to other directories (similar to bz3611) + This adds a protocol extension to improve the integrity of the SSH + transport protocol, particular in and around the initial key exchange + (KEX) phase. - OpenBSD-Commit-ID: 7e19d2ae09b4f941bf8eecc3955c9120171da37f + Full details of the extension are in the PROTOCOL file. + + with markus@ + + OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 -commit 7c0ce2bf98b303b6ad91493ee3247d96c18ba1f6 -Author: djm@openbsd.org -Date: Fri Sep 8 05:50:57 2023 +0000 +commit 59d691b886c79e70b1d1c4ab744e81fd176222fd +Author: Damien Miller +Date: Mon Dec 18 14:49:11 2023 +1100 - upstream: regress test for recursive copies of directories containing + better detection of broken -fzero-call-used-regs - symlinks to other directories. bz3611, ok dtucker@ + Use OSSH_CHECK_CFLAG_LINK() for detection of these flags and extend + test program to exercise varargs, which seems to catch more stuff. - OpenBSD-Regress-ID: eaa4c29cc5cddff4e72a16bcce14aeb1ecfc94b9 + ok dtucker@ -commit 2de990142a83bf60ef694378b8598706bc654b08 +commit aa7b21708511a6d4aed3839fc9f6e82e849dd4a1 Author: djm@openbsd.org -Date: Fri Sep 8 05:56:13 2023 +0000 +Date: Wed Dec 13 03:28:19 2023 +0000 - upstream: the sftp code was one of my first contributions to + upstream: when invoking KnownHostsCommand to determine the order of - OpenSSH and it shows - the function names are terrible. + host key algorithms to request, ensure that the hostname passed to the + command is decorated with the port number for ports other than 22. - Rename do_blah() to sftp_blah() to make them less so. + This matches the behaviour of KnownHostsCommand when invoked to look + up the actual host key. - Completely mechanical except for sftp_stat() and sftp_lstat() which - change from returning a pointer to a static variable (error-prone) to - taking a pointer to a caller-provided receiver. + bz3643, ok dtucker@ - OpenBSD-Commit-ID: eb54d6a72d0bbba4d623e2175cf5cc4c75dc2ba4 + OpenBSD-Commit-ID: 5cfabc0b7c6c7ab473666df314f377b1f15420b1 -commit 249d8bd0472b53e3a2a0e138b4c030a31e83346a -Author: djm@openbsd.org -Date: Fri Sep 8 05:50:12 2023 +0000 +commit 4086bd6652c0badccc020218a62190a7798fb72c +Author: markus@openbsd.org +Date: Fri Dec 8 09:18:39 2023 +0000 - upstream: fix scp in SFTP mode recursive upload and download of - - directories that contain symlinks to other directories. In scp mode, the - links would be followed, but in SFTP mode they were not. bz3611, ok dtucker@ + upstream: prevent leak in sshsig_match_principals; ok djm@ - OpenBSD-Commit-ID: 9760fda668eaa94a992250d7670dfbc62a45197c + OpenBSD-Commit-ID: 594f61ad4819ff5c72dfe99ba666a17f0e1030ae -commit 0e1f4401c466fa4fdaea81b6dadc8dd1fc4cf0af +commit 19d3ee2f3adf7d9a606ff015c1e153744702c4c9 Author: djm@openbsd.org -Date: Wed Sep 6 23:36:09 2023 +0000 +Date: Wed Dec 6 21:06:48 2023 +0000 - upstream: regression test for override of subsystem in match blocks + upstream: short circuit debug log processing early if we're not going - OpenBSD-Regress-ID: 5f8135da3bfda71067084c048d717b0e8793e87c + to log anything. From Kobe Housen + + OpenBSD-Commit-ID: 2bcddd695872a1bef137cfff7823044dcded90ea -commit 8a1450c62035e834d8a79a5d0d1c904236f9dcfe -Author: djm@openbsd.org -Date: Wed Sep 6 23:35:35 2023 +0000 +commit 947affad4831df015c498c00c6351ea6f13895d5 +Author: Darren Tucker +Date: Mon Nov 27 09:37:28 2023 +1100 - upstream: allow override of Sybsystem directives in sshd Match - - blocks + Add tests for OpenSSL 3.2.0 and 3.2 stable branch. + +commit 747dce36206675ca6b885010a835733df469351b +Author: Darren Tucker +Date: Sat Nov 25 09:03:38 2023 +1100 + + Use non-zero arg in compiler test program. - OpenBSD-Commit-ID: 3911d18a826a2d2fe7e4519075cf3e57af439722 + Now that we're running the test program, passing zero to the test function + can cause divide-by-zero exceptions which might show up in logs. -commit 6e52826e2a74d077147a82ead8d4fbd5b54f4e3b -Author: djm@openbsd.org -Date: Wed Sep 6 23:26:37 2023 +0000 +commit 3d44a5c56585d1c351dbc006240a591b6da502b1 +Author: dtucker@openbsd.org +Date: Fri Nov 24 00:31:30 2023 +0000 - upstream: allocate the subsystems array as necessary and remove the + upstream: Plug mem leak of msg when processing a quit message. - fixed limit of subsystems. Saves a few kb of memory in the server and makes - it more like the other options. + Coverity CID#427852, ok djm@ - OpenBSD-Commit-ID: e683dfca6bdcbc3cc339bb6c6517c0c4736a547f + OpenBSD-Commit-ID: bf85362addbe2134c3d8c4b80f16601fbff823b7 -commit e19069c9fac4c111d6496b19c7f7db43b4f07b4f -Author: djm@openbsd.org -Date: Wed Sep 6 23:23:53 2023 +0000 +commit 1d7f9b6e297877bd00973e6dc5c0642dbefc3b5f +Author: dtucker@openbsd.org +Date: Thu Nov 23 03:37:05 2023 +0000 - upstream: preserve quoting of Subsystem commands and arguments. + upstream: Include existing mux path in debug message. - This may change behaviour of exotic configurations, but the most common - subsystem configuration (sftp-server) is unlikely to be affected. + OpenBSD-Commit-ID: 1c3641be10c2f4fbad2a1b088a441d072e18bf16 + +commit f29934066bd0e561a2e516b7e584fb92d2eedee0 +Author: Darren Tucker +Date: Thu Nov 23 19:41:27 2023 +1100 + + Add an Ubuntu 22.04 test VM. - OpenBSD-Commit-ID: 8ffa296aeca981de5b0945242ce75aa6dee479bf + This is the same version as Github's runners so most of the testing on + it is over there, but having a local VM makes debugging much easier. -commit 52dfe3c72d98503d8b7c6f64fc7e19d685636c0b -Author: djm@openbsd.org -Date: Wed Sep 6 23:21:36 2023 +0000 +commit a93284a780cd3972afe5f89086b75d564ba157f3 +Author: Darren Tucker +Date: Thu Nov 23 19:36:22 2023 +1100 - upstream: downgrade duplicate Subsystem directives from being a + Add gcc-12 -Werror test on Ubuntu 22.04. - fatal error to being a debug message to match behaviour with just about all - other directives. + Explictly specify gcc-11 on Ubuntu 22.04 (it's the system compiler). + +commit 670f5a647e98b6fd95ad64f789f87ee3274b481b +Author: Darren Tucker +Date: Thu Nov 23 19:34:57 2023 +1100 + + Check return value from write to prevent warning. - OpenBSD-Commit-ID: fc90ed2cc0c18d4eb8e33d2c5e98d25f282588ce + ... and since we're testing for flags with -Werror, this caused + configure to mis-detect compiler flags. -commit 1ee0a16e07b6f0847ff463d7b5221c4bf1876e25 -Author: djm@openbsd.org -Date: Wed Sep 6 23:18:15 2023 +0000 +commit cea007d691cfedfa07a5b8599f97ce0511f53fc9 +Author: Darren Tucker +Date: Wed Nov 22 21:18:55 2023 +1100 - upstream: handle cr+lf (instead of just cr) in sshsig signature + Run compiler test program when compiling natively. - files + ok djm@ + +commit ee0d305828f13536c0a416bbf9c3e81039d9ea55 +Author: Darren Tucker +Date: Wed Nov 22 21:18:07 2023 +1100 + + Factor out compiler test program into a macro. - OpenBSD-Commit-ID: 647460a212b916540016d066568816507375fd7f + ok djm@ -commit e1c284d60a928bcdd60bc575c6f9604663502770 -Author: job@openbsd.org -Date: Mon Sep 4 10:29:58 2023 +0000 +commit de304c76316b029df460673725a9104224b9959b +Author: Darren Tucker +Date: Wed Nov 22 08:55:36 2023 +1100 - upstream: Generate Ed25519 keys when invoked without arguments + Add fbsd14 VM to test pool. + +commit 99a2df5e1994cdcb44ba2187b5f34d0e9190be91 +Author: Darren Tucker +Date: Tue Nov 21 16:19:29 2023 +1100 + + Expand -fzero-call-used-regs test to cover gcc 11. - Ed25519 public keys are very convenient due to their small size. - OpenSSH has supported Ed25519 since version 6.5 (January 2014). + It turns out that gcc also has some problems with -fzero-call-used-regs, + at least v11 on mips. Previously the test in OSSH_CHECK_CFLAG_COMPILE + was sufficient to catch it with "=all", but not sufficient for "=used". + Expand the testcase and include it in the other tests for good measure. + See bz#3629. ok djm@. + +commit ff220d4010717f7bfbbc02a2400666fb9d24f250 +Author: Darren Tucker +Date: Tue Nov 21 14:04:34 2023 +1100 + + Stop using -fzero-call-used-regs=all - OK djm@ markus@ sthen@ deraadt@ + ... since it seems to be problematic with several different versions of + clang. Only use -fzero-call-used-regs=used which is less + problematic, except with Apple's clang where we don't use it at all. + bz#3629, ok djm@ + +commit 2a19e02f36b16f0f6cc915f7d1e60ead5e36303b +Author: Darren Tucker +Date: Tue Nov 21 14:02:18 2023 +1100 + + Allow for vendor prefix on clang version numbers. - OpenBSD-Commit-ID: f498beaad19c8cdcc357381a60df4a9c69858b3f + Correctly detects the version of OpenBSD's native clang, as well as + Apple's. Spotted tb@, ok djm@. -commit 694150ad92765574ff82a18f4e86322bd3231e68 +commit c52db0114826d73eff6cdbf205e9c1fa4f7ca6c6 Author: djm@openbsd.org -Date: Mon Sep 4 00:08:14 2023 +0000 +Date: Mon Nov 20 02:50:00 2023 +0000 - upstream: trigger keystroke timing obfucation only if the channels - - layer enqueud some data in the last poll() cycle; this avoids triggering the - obfuscatior for non-channels data like ClientAlive probes and also fixes a - related problem were the obfucations would be triggered on fully quiescent - connections. + upstream: set errno=EAFNOSUPPORT when filtering addresses that don't - Based on / tested by naddy@ + match AddressFamily; yields slightly better error message if no address + matches. bz#3526 - OpenBSD-Commit-ID: d98f32dc62d7663ff4660e4556e184032a0db123 + OpenBSD-Commit-ID: 29cea900ddd8b04a4d1968da5c4a893be2ebd9e6 -commit b5fd97896b59a3a46245cf438cc8b16c795d9f74 +commit 26f3f3bbc69196d908cad6558c8c7dc5beb8d74a Author: djm@openbsd.org -Date: Mon Sep 4 00:04:02 2023 +0000 +Date: Wed Nov 15 23:03:38 2023 +0000 - upstream: avoid bogus "obfuscate_keystroke_timing: stopping ..." + upstream: when connecting via socket (the default case), filter - debug messages when keystroke timing obfuscation was never started; spotted - by naddy@ + addresses by AddressFamily if one was specified. Fixes the case where, if + CanonicalizeHostname is enabled, ssh may ignore AddressFamily. bz5326; ok + dtucker - OpenBSD-Commit-ID: 5c270d35f7d2974db5c1646e9c64188f9393be31 + OpenBSD-Commit-ID: 6c7d7751f6cd055126b2b268a7b64dcafa447439 -commit ccf7d913db34e49b7a6db1b8331bd402004c840d +commit 050c335c8da43741ed0df2570ebfbd5d1dfd0a31 Author: djm@openbsd.org -Date: Mon Sep 4 00:01:46 2023 +0000 +Date: Wed Nov 15 22:51:49 2023 +0000 - upstream: make channel_output_poll() return a flag indicating + upstream: when deciding whether to enable keystroke timing - whether channel data was enqueued. Will be used to improve keystroke timing - obfuscation. Problem spotted by / tested by naddy@ + obfuscation, only consider enabling it when a channel with a tty is open. - OpenBSD-Commit-ID: f9776c7b0065ba7c3bbe50431fd3b629f44314d0 + Avoids turning on the obfucation when X11 forwarding only is in use, + which slows it right down. Reported by Roger Marsh + + OpenBSD-Commit-ID: c292f738db410f729190f92de100c39ec931a4f1 -commit 43254b326ac6e2131dbd750f9464dc62c14bd5a7 -Author: djm@openbsd.org -Date: Sun Sep 3 23:59:32 2023 +0000 +commit 676377ce67807a24e08a54cd60ec832946cc6cae +Author: tobhe@openbsd.org +Date: Mon Nov 13 09:18:19 2023 +0000 - upstream: set interactive mode for ControlPersist sessions if they + upstream: Make sure sftp_get_limits() only returns 0 if 'limits' - originally requested a tty; enables keystroke timing obfuscation for most - ControlPersist sessions. Spotted by naddy@ + was initialized. This fixes a potential uninitialized use of 'limits' in + sftp_init() if sftp_get_limits() returned early because of an unexpected + message type. - OpenBSD-Commit-ID: 72783a26254202e2f3f41a2818a19956fe49a772 + ok djm@ + + OpenBSD-Commit-ID: 1c177d7c3becc1d71bc8763eecf61873a1d3884c -commit ff3eda68ceb2e2bb8f48e3faceb96076c3e85c20 +commit 64e0600f23c6dec36c3875392ac95b8a9100c2d6 Author: Darren Tucker -Date: Thu Aug 31 23:02:35 2023 +1000 +Date: Mon Nov 13 20:03:31 2023 +1100 - Set LLONG_MAX for C89 test. + Test current releases of LibreSSL and OpenSSL. - If we don't have LLONG_MAX, configure will figure out that it can get it - by setting -std=gnu99, at which point we won't be testing C89 any more. - To avoid this, feed it in via CFLAGS. + Retire some of the older releases. -commit f98031773db361424d59e3301aa92aacf423d920 -Author: djm@openbsd.org -Date: Tue Aug 29 02:50:10 2023 +0000 +commit c8ed7cc545879ac15f6ce428be4b29c35598bb2a +Author: dtucker@openbsd.org +Date: Wed Nov 1 02:08:38 2023 +0000 - upstream: make PerSourceMaxStartups first-match-wins; ok dtucker@ + upstream: Specify ssh binary to use - OpenBSD-Commit-ID: dac0c24cb709e3c595b8b4f422a0355dc5a3b4e7 + ... instead of relying on installed one. Fixes test failures in -portable + when running tests prior to installation. + + OpenBSD-Regress-ID: b6d6ba71c23209c616efc805a60d9a445d53a685 -commit cfa66857db90cd908de131e0041a50ffc17c7df8 -Author: djm@openbsd.org -Date: Mon Aug 28 09:52:09 2023 +0000 +commit e9fc2c48121cada1b4dcc5dadea5d447fe0093c3 +Author: Darren Tucker +Date: Wed Nov 1 13:11:31 2023 +1100 - upstream: descriptive text shouldn't be under .Cm + Put long-running test targets on hipri runners. - OpenBSD-Commit-ID: b1afaeb456a52bc8a58f4f9f8b2f9fa8f6bf651b + Some of the selfhosted test targets take a long time to run for various + reasons, so label them for "libvirt-hipri" runners so that they can + start immediately. This should reduce the time to complete all tests. -commit 01dbf3d46651b7d6ddf5e45d233839bbfffaeaec +commit 7ddf27668f0e21233f08c0ab2fe9ee3fdd6ab1e2 Author: djm@openbsd.org -Date: Mon Aug 28 09:48:11 2023 +0000 +Date: Wed Nov 1 00:29:46 2023 +0000 - upstream: limit artificial login delay to a reasonable maximum (5s) + upstream: add some tests of forced commands overriding Subsystem - and don't delay at all for the "none" authentication mechanism. Patch by - Dmitry Belyavskiy in bz3602 with polish/ok dtucker@ + directives - OpenBSD-Commit-ID: 85b364676dd84cf1de0e98fc2fbdcb1a844ce515 + OpenBSD-Regress-ID: eb48610282f6371672bdf2a8b5d2aa33cfbd322b -commit 528da5b9d7c5da01ed7a73ff21c722e1b5326006 -Author: jmc@openbsd.org -Date: Mon Aug 28 05:32:28 2023 +0000 +commit fb06f9b5a065dfbbef5916fc4accc03c0bf026dd +Author: dtucker@openbsd.org *** 20745 LINES SKIPPED *** From nobody Mon Jan 8 14:04:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7wmC5HgQz55pJN; Mon, 8 Jan 2024 14:04: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 4T7wmC4kdcz45tv; Mon, 8 Jan 2024 14:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704722667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AYr5C/T5/33V64Zr5gOv7ZD6DSISKP0dTGMK+F7yvzo=; b=PIeBmpjh3xnX8OtKVnkhFHefxZSNywl6FNg480ZtvFE2NkeSGs7tSLOOqNC8AMMpLPl+WW kU8IXOz845pO8DRmi+msvqBiVsBLXpdpqxdBSk8bOyT4AsytXYhntc9d5qQU+cVTKUlCKU Z58mxHUYmkGabtTUI3Vxe/tUAcMDbt6dfvYNNuPsDmo2WhGN3kX827N8/VZVDwzfyyFocG MCaFK7XewNScemfTUHRful+6bg184GND2PY9hY4oobfLLedSJvdEdktXk4q+FXNBmQQWia 6S0940fOrWnh1al0FP1umRjjbCzfhuY1+Y9skqsqzdbgccnqSczZMfRvNUJWzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704722667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AYr5C/T5/33V64Zr5gOv7ZD6DSISKP0dTGMK+F7yvzo=; b=uYx5SF5PxHJOhb9gDhanvD0xSfeEX+8E2DJ+eT0Y2kLRsITQ3sQwsbJu8v72P/1AvAdzZG GySQXI0aumI92jgi9soci8apW1ESNcjbAPBHlY42p8HjY4F/VpwoSubZVbsQ1JNesK3CmU m5xGv1W8WmffgVFRtk83oIP24zvgl6viUEPQ1S4zfGfkhLXiRpfNkDTDwpZjfhg6F2a9zN AGGKX1XuNqRRX/oGhgFojQKJphHF5deZqmD57FrXu4lyCLhOIcA/6J7J1VgXpO4OzV0MCv ewyR46fEHwfv3dQMwYNGRgAhLCP1Gfjqwney9KZad+HmG3/D6KyIqRtMGDXdTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704722667; a=rsa-sha256; cv=none; b=olieWBRkXCHfaIavnNn7rGuYu+TairUt3XxPS8DgwY2sH3NOB10ePYpTbF7PLqvw/rG1/d WLZmCrEqDGXe91OCaaxEWFICtZqBcirLXPOpoiG0yPg4k8cK9Dzebt6eQ7/LR0BoxUZUif LcfmI1A8y3VI+xmCANtFsjBudqD4dERehYUY6Ep2mBygmiPBU1FsCleYMBhYn6YgtfLJjd tR91nexicvzSYM+mKU9sI0tUiEsJZ6csHmCyf3nG7oK5SfYqLoyDnku9+jEejoXH3frMuZ 5/T/fqQID9hXj2/H5Yt5USdyLziAMcJlGsw3ilTRg6XHI2BrgCosjPCmAgXvVw== 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 4T7wmC2gcCz18Df; Mon, 8 Jan 2024 14:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408E4Ri6067462; Mon, 8 Jan 2024 14:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408E4QF8067459; Mon, 8 Jan 2024 14:04:26 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:04:26 GMT Message-Id: <202401081404.408E4QF8067459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2cd20d9bc807 - stable/13 - ssh: Update to OpenSSH 9.6p1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cd20d9bc80743d6562cb6165dc07b8391dddc27 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd20d9bc80743d6562cb6165dc07b8391dddc27 commit 2cd20d9bc80743d6562cb6165dc07b8391dddc27 Author: Ed Maste AuthorDate: 2024-01-05 03:16:30 +0000 Commit: Ed Maste CommitDate: 2024-01-08 13:57:12 +0000 ssh: Update to OpenSSH 9.6p1 From the release notes, > This release contains a number of security fixes, some small features > and bugfixes. The most significant change in 9.6p1 is a set of fixes for a newly- discovered weakness in the SSH transport protocol. The fix was already merged into FreeBSD and released as FreeBSD-SA-23:19.openssh. Full release notes at https://www.openssh.com/txt/release-9.6 Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit 069ac18495ad8fde2748bc94b0f80a50250bb01d) (cherry picked from commit a25789646d7130f5be166cac63d5c8b2b07c4706) --- crypto/openssh/.depend | 3 +- crypto/openssh/.github/configs | 14 +- crypto/openssh/.github/setup_ci.sh | 53 +- crypto/openssh/.github/workflows/c-cpp.yml | 15 +- crypto/openssh/.github/workflows/selfhosted.yml | 21 +- crypto/openssh/ChangeLog | 12792 +++++++++++----------- crypto/openssh/Makefile.in | 14 +- crypto/openssh/PROTOCOL | 21 +- crypto/openssh/PROTOCOL.agent | 33 +- crypto/openssh/README | 2 +- crypto/openssh/auth2.c | 8 +- crypto/openssh/authfd.c | 40 +- crypto/openssh/authfd.h | 5 +- crypto/openssh/channels.c | 36 +- crypto/openssh/channels.h | 4 +- crypto/openssh/cipher.c | 23 +- crypto/openssh/cipher.h | 3 +- crypto/openssh/clientloop.c | 34 +- crypto/openssh/config.h | 9 + crypto/openssh/configure.ac | 49 +- crypto/openssh/contrib/redhat/openssh.spec | 34 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/kex.c | 235 +- crypto/openssh/kex.h | 7 +- crypto/openssh/log.c | 6 +- crypto/openssh/m4/openssh.m4 | 116 +- crypto/openssh/misc.c | 41 +- crypto/openssh/misc.h | 3 +- crypto/openssh/moduli | 898 +- crypto/openssh/monitor_wrap.c | 4 +- crypto/openssh/mux.c | 4 +- crypto/openssh/openbsd-compat/port-solaris.c | 24 +- crypto/openssh/readconf.c | 57 +- crypto/openssh/readconf.h | 7 +- crypto/openssh/regress/Makefile | 10 +- crypto/openssh/regress/agent-pkcs11-cert.sh | 92 + crypto/openssh/regress/agent-pkcs11-restrict.sh | 193 + crypto/openssh/regress/agent-pkcs11.sh | 82 +- crypto/openssh/regress/conch-ciphers.sh | 11 +- crypto/openssh/regress/dropbear-ciphers.sh | 33 + crypto/openssh/regress/dropbear-kex.sh | 31 + crypto/openssh/regress/forcecommand.sh | 56 +- crypto/openssh/regress/sshsig.sh | 72 +- crypto/openssh/regress/test-exec.sh | 169 +- crypto/openssh/regress/unittests/Makefile | 3 +- crypto/openssh/regress/unittests/Makefile.inc | 4 +- crypto/openssh/scp.c | 12 +- crypto/openssh/servconf.c | 40 +- crypto/openssh/sftp-client.c | 4 +- crypto/openssh/ssh-add.1 | 14 +- crypto/openssh/ssh-add.c | 92 +- crypto/openssh/ssh-agent.c | 241 +- crypto/openssh/ssh-pkcs11-client.c | 56 +- crypto/openssh/ssh-pkcs11.h | 5 +- crypto/openssh/ssh.1 | 7 +- crypto/openssh/ssh.c | 26 +- crypto/openssh/ssh2.h | 3 +- crypto/openssh/ssh_config.5 | 83 +- crypto/openssh/ssh_namespace.h | 7 +- crypto/openssh/sshconnect.c | 10 +- crypto/openssh/sshconnect.h | 6 +- crypto/openssh/sshconnect2.c | 63 +- crypto/openssh/sshd.c | 4 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/sshkey.c | 40 +- crypto/openssh/sshsig.c | 7 +- crypto/openssh/version.h | 6 +- secure/usr.bin/ssh-agent/Makefile | 2 +- 69 files changed, 8731 insertions(+), 7374 deletions(-) diff --git a/crypto/openssh/.depend b/crypto/openssh/.depend index 259bf3b2f136..4897698ab74a 100644 --- a/crypto/openssh/.depend +++ b/crypto/openssh/.depend @@ -28,7 +28,8 @@ auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd- auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h kex .h +auth2.o: mac.h crypto_api.h authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h log.h ssherr.h atomicio.h misc.h authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index c7d6a55ab962..df82faf5046b 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -108,9 +108,19 @@ case "$config" in SKIP_LTESTS=sftp-chroot ;; gcc-11-Werror) - CC="gcc" + CC="gcc-11" + # -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled + # -Wunused-result ignores (void) so is not useful. See + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + CFLAGS="-O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter -Wno-unused-result" + CONFIGFLAGS="--with-pam --with-Werror" + ;; + gcc-12-Werror) + CC="gcc-12" # -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled - CFLAGS="-Wall -Wextra -O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter" + # -Wunused-result ignores (void) so is not useful. See + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + CFLAGS="-O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter -Wno-unused-result" CONFIGFLAGS="--with-pam --with-Werror" ;; clang*|gcc*) diff --git a/crypto/openssh/.github/setup_ci.sh b/crypto/openssh/.github/setup_ci.sh index 010a333a6642..d0ba7b4724e9 100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh @@ -18,8 +18,7 @@ case "$host" in ;; *-darwin*) PACKAGER=brew - brew install automake - exit 0 + PACKAGES="automake" ;; *) PACKAGER=apt @@ -30,20 +29,30 @@ TARGETS=$@ INSTALL_FIDO_PPA="no" export DEBIAN_FRONTEND=noninteractive -#echo "Setting up for '$TARGETS'" - -set -ex +set -e if [ -x "`which lsb_release 2>&1`" ]; then lsb_release -a fi -# Ubuntu 22.04 defaults to private home dirs which prevent the -# agent-getpeerid test from running ssh-add as nobody. See -# https://github.com/actions/runner-images/issues/6106 -if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then - echo ~ is not executable by nobody, adding perms. - chmod go+x ~ +if [ ! -z "$SUDO" ]; then + # Ubuntu 22.04 defaults to private home dirs which prevent the + # agent-getpeerid test from running ssh-add as nobody. See + # https://github.com/actions/runner-images/issues/6106 + if ! "$SUDO" -u nobody test -x ~; then + echo ~ is not executable by nobody, adding perms. + chmod go+x ~ + fi + # Some of the Mac OS X runners don't have a nopasswd sudo rule. Regular + # sudo still works, but sudo -u doesn't. Restore the sudo rule. + if ! "$SUDO" grep -E 'runner.*NOPASSWD' /etc/passwd >/dev/null; then + echo "Restoring runner nopasswd rule to sudoers." + echo 'runner ALL=(ALL) NOPASSWD: ALL' |$SUDO tee -a /etc/sudoers + fi + if ! "$SUDO" -u nobody -S test -x ~ -Date: Wed Oct 4 15:34:10 2023 +1100 +Date: Tue Dec 19 01:59:50 2023 +1100 - crank version numbers + crank versions -commit f65f187b105d9b5c12fd750a211397d08c17c6d4 -Author: djm@openbsd.org -Date: Wed Oct 4 04:04:09 2023 +0000 +commit 2f2c65cb5f1518a9c556d3e8efa27ea0ca305c6b +Author: Damien Miller +Date: Tue Dec 19 01:59:06 2023 +1100 - upstream: openssh-9.5 - - OpenBSD-Commit-ID: 5e0af680480bd3b6f5560cf840ad032d48fd6b16 + depend -commit ffe27e54a4bb18d5d3bbd3f4cc93a41b8d94dfd2 +commit e48cdee8e19059203b1aeeabec2350b8375fa61f Author: djm@openbsd.org -Date: Wed Oct 4 04:03:50 2023 +0000 +Date: Mon Dec 18 14:50:08 2023 +0000 - upstream: add some cautionary text about % token expansion and - - shell metacharacters; based on report from vinci AT protonmail.ch + upstream: regress test for agent PKCS#11-backed certificates - OpenBSD-Commit-ID: aa1450a54fcee2f153ef70368d90edb1e7019113 + OpenBSD-Regress-ID: 38f681777cb944a8cc3bf9d0ad62959a16764df9 -commit 60ec3d54fd1ebfe2dda75893fa1e870b8dffbb0d +commit 2f512f862df1d5f456f82a0334c9e8cc7208a2a1 Author: djm@openbsd.org -Date: Tue Oct 3 23:56:10 2023 +0000 +Date: Mon Dec 18 14:49:39 2023 +0000 - upstream: fix link to agent draft; spotted by Jann Horn + upstream: regress test for constrained PKCS#11 keys - OpenBSD-Commit-ID: ff5bda21a83ec013db683e282256a85201d2dc4b + OpenBSD-Regress-ID: b2f26ae95d609d12257b43aef7cd7714c82618ff -commit 12e2d4b13f6f63ce2de13cbfcc9e4d0d4b4ab231 -Author: Damien Miller -Date: Wed Oct 4 10:54:04 2023 +1100 +commit cdddd66412ca5920ed4d3ebbfa6ace12dbd9b82f +Author: djm@openbsd.org +Date: Mon Dec 18 14:48:44 2023 +0000 - use portable provider allowlist path in manpage + upstream: openssh-9.6 - spotted by Jann Horn + OpenBSD-Commit-ID: 21759837cf0e0092d9a2079f8fb562071c11016b -commit 6c2c6ffde75df95fd838039850d3dd3d84956d87 -Author: deraadt@openbsd.org -Date: Tue Sep 19 20:37:07 2023 +0000 +commit 6d51feab157cedf1e7ef5b3f8781ca8ff9c4ab1b +Author: djm@openbsd.org +Date: Mon Dec 18 14:48:08 2023 +0000 - upstream: typo; from Jim Spath + upstream: ssh-agent: record failed session-bind attempts - OpenBSD-Commit-ID: 2f5fba917b5d4fcf93d9e0b0756c7f63189e228e + Record failed attempts to session-bind a connection and refuse signing + operations on that connection henceforth. + + Prevents a future situation where we add a new hostkey type that is not + recognised by an older ssh-agent, that consequently causes session-bind + to fail (this situation is only likely to arise when people mix ssh(1) + and ssh-agent(1) of different versions on the same host). Previously, + after such a failure the agent socket would be considered unbound and + not subject to restriction. + + Spotted by Jann Horn + + OpenBSD-Commit-ID: b0fdd023e920aa4831413f640de4c5307b53552e -commit b6b49130a0089b297245ee39e769231d7c763014 +commit 7ef3787c84b6b524501211b11a26c742f829af1a Author: djm@openbsd.org -Date: Sun Sep 10 23:12:32 2023 +0000 +Date: Mon Dec 18 14:47:44 2023 +0000 - upstream: rename remote_glob() -> sftp_glob() to match other API + upstream: ban user/hostnames with most shell metacharacters - OpenBSD-Commit-ID: d9dfb3708d824ec02970a84d96cf5937e0887229 + This makes ssh(1) refuse user or host names provided on the + commandline that contain most shell metacharacters. + + Some programs that invoke ssh(1) using untrusted data do not filter + metacharacters in arguments they supply. This could create + interactions with user-specified ProxyCommand and other directives + that allow shell injection attacks to occur. + + It's a mistake to invoke ssh(1) with arbitrary untrusted arguments, + but getting this stuff right can be tricky, so this should prevent + most obvious ways of creating risky situations. It however is not + and cannot be perfect: ssh(1) has no practical way of interpreting + what shell quoting rules are in use and how they interact with the + user's specified ProxyCommand. + + To allow configurations that use strange user or hostnames to + continue to work, this strictness is applied only to names coming + from the commandline. Names specified using User or Hostname + directives in ssh_config(5) are not affected. + + feedback/ok millert@ markus@ dtucker@ deraadt@ + + OpenBSD-Commit-ID: 3b487348b5964f3e77b6b4d3da4c3b439e94b2d9 -commit 21b79af6c8d2357c822c84cef3fbdb8001ed263b +commit 0cb50eefdd29f0fec31d0e71cc4b004a5f704e67 Author: djm@openbsd.org -Date: Sun Sep 10 03:51:55 2023 +0000 +Date: Mon Dec 18 14:47:20 2023 +0000 - upstream: typo in comment + upstream: stricter handling of channel window limits - OpenBSD-Commit-ID: 69285e0ce962a7c6b0ab5f17a293c60a0a360a18 - -commit 41232d25532b4d2ef6c5db62efc0cf50a79d26ca -Author: Darren Tucker -Date: Sun Sep 10 15:45:38 2023 +1000 - - Use zero-call-used-regs=used with Apple compilers. + This makes ssh/sshd more strict in handling non-compliant peers that + send more data than the advertised channel window allows. Previously + the additional data would be silently discarded. This change will + cause ssh/sshd to terminate the connection if the channel window is + exceeded by more than a small grace allowance. - Apple's versions of clang have version numbers that do not match the - corresponding upstream clang versions. Unfortunately, they do still - have the clang-15 zero-call-used-regs=all bug, so for now use the value - that doesn't result in segfaults. We could allowlist future versions - that are known to work. bz#3584 (and probably also our github CI - failures). + ok markus@ + + OpenBSD-Commit-ID: 811e21b41831eba3dd7f67b3d409a438f20d3037 -commit 90ccc5918ea505bf156c31148b6b59a1bf5d6dc6 +commit 4448a2938abc76e6bd33ba09b2ec17a216dfb491 Author: djm@openbsd.org -Date: Sun Sep 10 03:25:53 2023 +0000 +Date: Mon Dec 18 14:46:56 2023 +0000 - upstream: randomise keystroke obfuscation intervals and average + upstream: Make it possible to load certs from PKCS#11 tokens - interval rate. ok dtucker@ + Adds a protocol extension to allow grafting certificates supplied by + ssh-add to keys loaded from PKCS#11 tokens in the agent. - OpenBSD-Commit-ID: 05f61d051ab418fcfc4857ff306e420037502382 + feedback/ok markus@ + + OpenBSD-Commit-ID: bb5433cd28ede2bc910996eb3c0b53e20f86037f -commit bd1b9e52f5fa94d87223c90905c5fdc1a7c32aa6 +commit 881d9c6af9da4257c69c327c4e2f1508b2fa754b Author: djm@openbsd.org -Date: Fri Sep 8 06:34:24 2023 +0000 +Date: Mon Dec 18 14:46:12 2023 +0000 - upstream: fix sizeof(*ptr) instead sizeof(ptr) in realloc (pointer here + upstream: apply destination constraints to all p11 keys - is char**, so harmless); spotted in CID 416964 + Previously applied only to the first key returned from each token. - OpenBSD-Commit-ID: c61caa4a5a667ee20bb1042098861e6c72c69002 + ok markus@ + + OpenBSD-Commit-ID: 36df3afb8eb94eec6b2541f063d0d164ef8b488d -commit c4f966482983e18601eec70a1563115de836616f +commit a7ed931caeb68947d30af8a795f4108b6efad761 Author: djm@openbsd.org -Date: Fri Sep 8 06:10:57 2023 +0000 +Date: Mon Dec 18 14:45:49 2023 +0000 - upstream: regress test recursive remote-remote directories copies where + upstream: add "ext-info-in-auth@openssh.com" extension - the directory contains a symlink to another directory. + This adds another transport protocol extension to allow a sshd to send + SSH2_MSG_EXT_INFO during user authentication, after the server has + learned the username that is being logged in to. - also remove errant `set -x` that snuck in at some point + This lets sshd to update the acceptable signature algoritms for public + key authentication, and allows these to be varied via sshd_config(5) + "Match" directives, which are evaluated after the server learns the + username being authenticated. - OpenBSD-Regress-ID: 1c94a48bdbd633ef2285954ee257725cd7bc456f + Full details in the PROTOCOL file + + OpenBSD-Commit-ID: 1de7da7f2b6c32a46043d75fcd49b0cbb7db7779 -commit 5e1dfe5014ebc194641678303e22ab3bba15f4e5 +commit 1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Author: djm@openbsd.org -Date: Fri Sep 8 06:10:02 2023 +0000 +Date: Mon Dec 18 14:45:17 2023 +0000 - upstream: fix recursive remote-remote copies of directories that + upstream: implement "strict key exchange" in ssh and sshd - contain symlinks to other directories (similar to bz3611) + This adds a protocol extension to improve the integrity of the SSH + transport protocol, particular in and around the initial key exchange + (KEX) phase. - OpenBSD-Commit-ID: 7e19d2ae09b4f941bf8eecc3955c9120171da37f + Full details of the extension are in the PROTOCOL file. + + with markus@ + + OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 -commit 7c0ce2bf98b303b6ad91493ee3247d96c18ba1f6 -Author: djm@openbsd.org -Date: Fri Sep 8 05:50:57 2023 +0000 +commit 59d691b886c79e70b1d1c4ab744e81fd176222fd +Author: Damien Miller +Date: Mon Dec 18 14:49:11 2023 +1100 - upstream: regress test for recursive copies of directories containing + better detection of broken -fzero-call-used-regs - symlinks to other directories. bz3611, ok dtucker@ + Use OSSH_CHECK_CFLAG_LINK() for detection of these flags and extend + test program to exercise varargs, which seems to catch more stuff. - OpenBSD-Regress-ID: eaa4c29cc5cddff4e72a16bcce14aeb1ecfc94b9 + ok dtucker@ -commit 2de990142a83bf60ef694378b8598706bc654b08 +commit aa7b21708511a6d4aed3839fc9f6e82e849dd4a1 Author: djm@openbsd.org -Date: Fri Sep 8 05:56:13 2023 +0000 +Date: Wed Dec 13 03:28:19 2023 +0000 - upstream: the sftp code was one of my first contributions to + upstream: when invoking KnownHostsCommand to determine the order of - OpenSSH and it shows - the function names are terrible. + host key algorithms to request, ensure that the hostname passed to the + command is decorated with the port number for ports other than 22. - Rename do_blah() to sftp_blah() to make them less so. + This matches the behaviour of KnownHostsCommand when invoked to look + up the actual host key. - Completely mechanical except for sftp_stat() and sftp_lstat() which - change from returning a pointer to a static variable (error-prone) to - taking a pointer to a caller-provided receiver. + bz3643, ok dtucker@ - OpenBSD-Commit-ID: eb54d6a72d0bbba4d623e2175cf5cc4c75dc2ba4 + OpenBSD-Commit-ID: 5cfabc0b7c6c7ab473666df314f377b1f15420b1 -commit 249d8bd0472b53e3a2a0e138b4c030a31e83346a -Author: djm@openbsd.org -Date: Fri Sep 8 05:50:12 2023 +0000 +commit 4086bd6652c0badccc020218a62190a7798fb72c +Author: markus@openbsd.org +Date: Fri Dec 8 09:18:39 2023 +0000 - upstream: fix scp in SFTP mode recursive upload and download of - - directories that contain symlinks to other directories. In scp mode, the - links would be followed, but in SFTP mode they were not. bz3611, ok dtucker@ + upstream: prevent leak in sshsig_match_principals; ok djm@ - OpenBSD-Commit-ID: 9760fda668eaa94a992250d7670dfbc62a45197c + OpenBSD-Commit-ID: 594f61ad4819ff5c72dfe99ba666a17f0e1030ae -commit 0e1f4401c466fa4fdaea81b6dadc8dd1fc4cf0af +commit 19d3ee2f3adf7d9a606ff015c1e153744702c4c9 Author: djm@openbsd.org -Date: Wed Sep 6 23:36:09 2023 +0000 +Date: Wed Dec 6 21:06:48 2023 +0000 - upstream: regression test for override of subsystem in match blocks + upstream: short circuit debug log processing early if we're not going - OpenBSD-Regress-ID: 5f8135da3bfda71067084c048d717b0e8793e87c + to log anything. From Kobe Housen + + OpenBSD-Commit-ID: 2bcddd695872a1bef137cfff7823044dcded90ea -commit 8a1450c62035e834d8a79a5d0d1c904236f9dcfe -Author: djm@openbsd.org -Date: Wed Sep 6 23:35:35 2023 +0000 +commit 947affad4831df015c498c00c6351ea6f13895d5 +Author: Darren Tucker +Date: Mon Nov 27 09:37:28 2023 +1100 - upstream: allow override of Sybsystem directives in sshd Match - - blocks + Add tests for OpenSSL 3.2.0 and 3.2 stable branch. + +commit 747dce36206675ca6b885010a835733df469351b +Author: Darren Tucker +Date: Sat Nov 25 09:03:38 2023 +1100 + + Use non-zero arg in compiler test program. - OpenBSD-Commit-ID: 3911d18a826a2d2fe7e4519075cf3e57af439722 + Now that we're running the test program, passing zero to the test function + can cause divide-by-zero exceptions which might show up in logs. -commit 6e52826e2a74d077147a82ead8d4fbd5b54f4e3b -Author: djm@openbsd.org -Date: Wed Sep 6 23:26:37 2023 +0000 +commit 3d44a5c56585d1c351dbc006240a591b6da502b1 +Author: dtucker@openbsd.org +Date: Fri Nov 24 00:31:30 2023 +0000 - upstream: allocate the subsystems array as necessary and remove the + upstream: Plug mem leak of msg when processing a quit message. - fixed limit of subsystems. Saves a few kb of memory in the server and makes - it more like the other options. + Coverity CID#427852, ok djm@ - OpenBSD-Commit-ID: e683dfca6bdcbc3cc339bb6c6517c0c4736a547f + OpenBSD-Commit-ID: bf85362addbe2134c3d8c4b80f16601fbff823b7 -commit e19069c9fac4c111d6496b19c7f7db43b4f07b4f -Author: djm@openbsd.org -Date: Wed Sep 6 23:23:53 2023 +0000 +commit 1d7f9b6e297877bd00973e6dc5c0642dbefc3b5f +Author: dtucker@openbsd.org +Date: Thu Nov 23 03:37:05 2023 +0000 - upstream: preserve quoting of Subsystem commands and arguments. + upstream: Include existing mux path in debug message. - This may change behaviour of exotic configurations, but the most common - subsystem configuration (sftp-server) is unlikely to be affected. + OpenBSD-Commit-ID: 1c3641be10c2f4fbad2a1b088a441d072e18bf16 + +commit f29934066bd0e561a2e516b7e584fb92d2eedee0 +Author: Darren Tucker +Date: Thu Nov 23 19:41:27 2023 +1100 + + Add an Ubuntu 22.04 test VM. - OpenBSD-Commit-ID: 8ffa296aeca981de5b0945242ce75aa6dee479bf + This is the same version as Github's runners so most of the testing on + it is over there, but having a local VM makes debugging much easier. -commit 52dfe3c72d98503d8b7c6f64fc7e19d685636c0b -Author: djm@openbsd.org -Date: Wed Sep 6 23:21:36 2023 +0000 +commit a93284a780cd3972afe5f89086b75d564ba157f3 +Author: Darren Tucker +Date: Thu Nov 23 19:36:22 2023 +1100 - upstream: downgrade duplicate Subsystem directives from being a + Add gcc-12 -Werror test on Ubuntu 22.04. - fatal error to being a debug message to match behaviour with just about all - other directives. + Explictly specify gcc-11 on Ubuntu 22.04 (it's the system compiler). + +commit 670f5a647e98b6fd95ad64f789f87ee3274b481b +Author: Darren Tucker +Date: Thu Nov 23 19:34:57 2023 +1100 + + Check return value from write to prevent warning. - OpenBSD-Commit-ID: fc90ed2cc0c18d4eb8e33d2c5e98d25f282588ce + ... and since we're testing for flags with -Werror, this caused + configure to mis-detect compiler flags. -commit 1ee0a16e07b6f0847ff463d7b5221c4bf1876e25 -Author: djm@openbsd.org -Date: Wed Sep 6 23:18:15 2023 +0000 +commit cea007d691cfedfa07a5b8599f97ce0511f53fc9 +Author: Darren Tucker +Date: Wed Nov 22 21:18:55 2023 +1100 - upstream: handle cr+lf (instead of just cr) in sshsig signature + Run compiler test program when compiling natively. - files + ok djm@ + +commit ee0d305828f13536c0a416bbf9c3e81039d9ea55 +Author: Darren Tucker +Date: Wed Nov 22 21:18:07 2023 +1100 + + Factor out compiler test program into a macro. - OpenBSD-Commit-ID: 647460a212b916540016d066568816507375fd7f + ok djm@ -commit e1c284d60a928bcdd60bc575c6f9604663502770 -Author: job@openbsd.org -Date: Mon Sep 4 10:29:58 2023 +0000 +commit de304c76316b029df460673725a9104224b9959b +Author: Darren Tucker +Date: Wed Nov 22 08:55:36 2023 +1100 - upstream: Generate Ed25519 keys when invoked without arguments + Add fbsd14 VM to test pool. + +commit 99a2df5e1994cdcb44ba2187b5f34d0e9190be91 +Author: Darren Tucker +Date: Tue Nov 21 16:19:29 2023 +1100 + + Expand -fzero-call-used-regs test to cover gcc 11. - Ed25519 public keys are very convenient due to their small size. - OpenSSH has supported Ed25519 since version 6.5 (January 2014). + It turns out that gcc also has some problems with -fzero-call-used-regs, + at least v11 on mips. Previously the test in OSSH_CHECK_CFLAG_COMPILE + was sufficient to catch it with "=all", but not sufficient for "=used". + Expand the testcase and include it in the other tests for good measure. + See bz#3629. ok djm@. + +commit ff220d4010717f7bfbbc02a2400666fb9d24f250 +Author: Darren Tucker +Date: Tue Nov 21 14:04:34 2023 +1100 + + Stop using -fzero-call-used-regs=all - OK djm@ markus@ sthen@ deraadt@ + ... since it seems to be problematic with several different versions of + clang. Only use -fzero-call-used-regs=used which is less + problematic, except with Apple's clang where we don't use it at all. + bz#3629, ok djm@ + +commit 2a19e02f36b16f0f6cc915f7d1e60ead5e36303b +Author: Darren Tucker +Date: Tue Nov 21 14:02:18 2023 +1100 + + Allow for vendor prefix on clang version numbers. - OpenBSD-Commit-ID: f498beaad19c8cdcc357381a60df4a9c69858b3f + Correctly detects the version of OpenBSD's native clang, as well as + Apple's. Spotted tb@, ok djm@. -commit 694150ad92765574ff82a18f4e86322bd3231e68 +commit c52db0114826d73eff6cdbf205e9c1fa4f7ca6c6 Author: djm@openbsd.org -Date: Mon Sep 4 00:08:14 2023 +0000 +Date: Mon Nov 20 02:50:00 2023 +0000 - upstream: trigger keystroke timing obfucation only if the channels - - layer enqueud some data in the last poll() cycle; this avoids triggering the - obfuscatior for non-channels data like ClientAlive probes and also fixes a - related problem were the obfucations would be triggered on fully quiescent - connections. + upstream: set errno=EAFNOSUPPORT when filtering addresses that don't - Based on / tested by naddy@ + match AddressFamily; yields slightly better error message if no address + matches. bz#3526 - OpenBSD-Commit-ID: d98f32dc62d7663ff4660e4556e184032a0db123 + OpenBSD-Commit-ID: 29cea900ddd8b04a4d1968da5c4a893be2ebd9e6 -commit b5fd97896b59a3a46245cf438cc8b16c795d9f74 +commit 26f3f3bbc69196d908cad6558c8c7dc5beb8d74a Author: djm@openbsd.org -Date: Mon Sep 4 00:04:02 2023 +0000 +Date: Wed Nov 15 23:03:38 2023 +0000 - upstream: avoid bogus "obfuscate_keystroke_timing: stopping ..." + upstream: when connecting via socket (the default case), filter - debug messages when keystroke timing obfuscation was never started; spotted - by naddy@ + addresses by AddressFamily if one was specified. Fixes the case where, if + CanonicalizeHostname is enabled, ssh may ignore AddressFamily. bz5326; ok + dtucker - OpenBSD-Commit-ID: 5c270d35f7d2974db5c1646e9c64188f9393be31 + OpenBSD-Commit-ID: 6c7d7751f6cd055126b2b268a7b64dcafa447439 -commit ccf7d913db34e49b7a6db1b8331bd402004c840d +commit 050c335c8da43741ed0df2570ebfbd5d1dfd0a31 Author: djm@openbsd.org -Date: Mon Sep 4 00:01:46 2023 +0000 +Date: Wed Nov 15 22:51:49 2023 +0000 - upstream: make channel_output_poll() return a flag indicating + upstream: when deciding whether to enable keystroke timing - whether channel data was enqueued. Will be used to improve keystroke timing - obfuscation. Problem spotted by / tested by naddy@ + obfuscation, only consider enabling it when a channel with a tty is open. - OpenBSD-Commit-ID: f9776c7b0065ba7c3bbe50431fd3b629f44314d0 + Avoids turning on the obfucation when X11 forwarding only is in use, + which slows it right down. Reported by Roger Marsh + + OpenBSD-Commit-ID: c292f738db410f729190f92de100c39ec931a4f1 -commit 43254b326ac6e2131dbd750f9464dc62c14bd5a7 -Author: djm@openbsd.org -Date: Sun Sep 3 23:59:32 2023 +0000 +commit 676377ce67807a24e08a54cd60ec832946cc6cae +Author: tobhe@openbsd.org +Date: Mon Nov 13 09:18:19 2023 +0000 - upstream: set interactive mode for ControlPersist sessions if they + upstream: Make sure sftp_get_limits() only returns 0 if 'limits' - originally requested a tty; enables keystroke timing obfuscation for most - ControlPersist sessions. Spotted by naddy@ + was initialized. This fixes a potential uninitialized use of 'limits' in + sftp_init() if sftp_get_limits() returned early because of an unexpected + message type. - OpenBSD-Commit-ID: 72783a26254202e2f3f41a2818a19956fe49a772 + ok djm@ + + OpenBSD-Commit-ID: 1c177d7c3becc1d71bc8763eecf61873a1d3884c -commit ff3eda68ceb2e2bb8f48e3faceb96076c3e85c20 +commit 64e0600f23c6dec36c3875392ac95b8a9100c2d6 Author: Darren Tucker -Date: Thu Aug 31 23:02:35 2023 +1000 +Date: Mon Nov 13 20:03:31 2023 +1100 - Set LLONG_MAX for C89 test. + Test current releases of LibreSSL and OpenSSL. - If we don't have LLONG_MAX, configure will figure out that it can get it - by setting -std=gnu99, at which point we won't be testing C89 any more. - To avoid this, feed it in via CFLAGS. + Retire some of the older releases. -commit f98031773db361424d59e3301aa92aacf423d920 -Author: djm@openbsd.org -Date: Tue Aug 29 02:50:10 2023 +0000 +commit c8ed7cc545879ac15f6ce428be4b29c35598bb2a +Author: dtucker@openbsd.org +Date: Wed Nov 1 02:08:38 2023 +0000 - upstream: make PerSourceMaxStartups first-match-wins; ok dtucker@ + upstream: Specify ssh binary to use - OpenBSD-Commit-ID: dac0c24cb709e3c595b8b4f422a0355dc5a3b4e7 + ... instead of relying on installed one. Fixes test failures in -portable + when running tests prior to installation. + + OpenBSD-Regress-ID: b6d6ba71c23209c616efc805a60d9a445d53a685 -commit cfa66857db90cd908de131e0041a50ffc17c7df8 -Author: djm@openbsd.org -Date: Mon Aug 28 09:52:09 2023 +0000 +commit e9fc2c48121cada1b4dcc5dadea5d447fe0093c3 +Author: Darren Tucker +Date: Wed Nov 1 13:11:31 2023 +1100 - upstream: descriptive text shouldn't be under .Cm + Put long-running test targets on hipri runners. - OpenBSD-Commit-ID: b1afaeb456a52bc8a58f4f9f8b2f9fa8f6bf651b + Some of the selfhosted test targets take a long time to run for various + reasons, so label them for "libvirt-hipri" runners so that they can + start immediately. This should reduce the time to complete all tests. -commit 01dbf3d46651b7d6ddf5e45d233839bbfffaeaec +commit 7ddf27668f0e21233f08c0ab2fe9ee3fdd6ab1e2 Author: djm@openbsd.org -Date: Mon Aug 28 09:48:11 2023 +0000 +Date: Wed Nov 1 00:29:46 2023 +0000 - upstream: limit artificial login delay to a reasonable maximum (5s) + upstream: add some tests of forced commands overriding Subsystem - and don't delay at all for the "none" authentication mechanism. Patch by - Dmitry Belyavskiy in bz3602 with polish/ok dtucker@ + directives - OpenBSD-Commit-ID: 85b364676dd84cf1de0e98fc2fbdcb1a844ce515 + OpenBSD-Regress-ID: eb48610282f6371672bdf2a8b5d2aa33cfbd322b -commit 528da5b9d7c5da01ed7a73ff21c722e1b5326006 -Author: jmc@openbsd.org -Date: Mon Aug 28 05:32:28 2023 +0000 +commit fb06f9b5a065dfbbef5916fc4accc03c0bf026dd *** 20737 LINES SKIPPED *** From nobody Mon Jan 8 14:46:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xhN549lz55wNb; Mon, 8 Jan 2024 14: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 4T7xhN4Xfsz4D7c; Mon, 8 Jan 2024 14:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMHF4bFSsCnZswS3BFXXLKBvlzbt8dZRQkzgVOUaK/k=; b=XFNScpyBA989s+CZzYGS5U9JuAxFCr3FBJWxCB43Ba3EhC4KN4jTUW+wQWFS0P2bV+bMnM dKAnekvEAQAFa+r/Kk0j0SM/3CKmBjXcclmPZRV3UnvsED1+gZsQCz11aGE6Zh+VxuXQwh jnAfo1IqDmeN0NEl0OY6zVCXqxUjxX4dkWE9/QT8jOBOWe3qfixinpdlAn5TLNZF4mwXsk q6ztdwnETikwivjPonPU9vfRM4WCIruqvBQYpiA3r8KfdtYdGnKxbKsnK2XEhTcoLyJIsZ bnrnj4tnQgkqK3s575kNMAXPqvRlPbLJBvxzTNops4yNeRNFEdr5ulHfKWkTRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMHF4bFSsCnZswS3BFXXLKBvlzbt8dZRQkzgVOUaK/k=; b=W454ooNN5V97SyOVTvIxIrwp+6k+pxHYbdH+vqYqKiQbid3oP1G+haxeVyJPB2SvmLh7sG db5hp+TLejkNVIDFx6t1RLHDjlcuBxiKFUzsg5c47d8urHZJtuir33slO9DifNT/glsL0U u2p+g9j1jcxyx5P14a6GE1m5tqcVSYyDOAOxzoPIajJdZei1yk9MLnNrpXFfn84riD4sgr Ts7PrZ+oUuWimFFMZj/TuZ3YuSo72pJdbV6g1G6raU2jaRIlcOXaSe032M6AmUcx06ntsU gpUAn4eD56vwKZrMQagfmULSdc/mpgwjyUcJvQgIEkzBUYt2wum+/TcvfMX4kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704725172; a=rsa-sha256; cv=none; b=e8lH+/CrA9NKN/LeqbgCS+fmfP89KXqtKEHgz6GX3KIf4Vp0Ge8Qn12JQvTwk8/tzCNH1j cGWGbUIkrDRubmdWYoVv0R13/ufg0wjXF5hsS3hUeENija6XQCZnODnkJmxyFWXw2zZ4+j 968eIl9gBk4YM7YhmLUW0N0gwnKBm8wo0qgRpL9Hy7t5P/P4oPqv6vjJI8HEYSbGS/RAb/ qnzy4NbVdDkkwwMEPy38kY2UaJj5vc9KLIn0SxSGgXWua0d/F53J9bhk5TARXnr/OlNjpk Zz+hgaKv+VWcdRjuM/gZXW44Q17mZUXmH6PBCYynwOd+XjjDFDlDkZTBWxXe5w== 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 4T7xhN3W81z19mx; Mon, 8 Jan 2024 14:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408EkCsH034346; Mon, 8 Jan 2024 14:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408EkCCh034343; Mon, 8 Jan 2024 14:46:12 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:46:12 GMT Message-Id: <202401081446.408EkCCh034343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5669eb94fdfd - stable/14 - sound: remove Legacy Hardware section from man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5669eb94fdfd03d89256c9ef58e5f57a151acc88 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5669eb94fdfd03d89256c9ef58e5f57a151acc88 commit 5669eb94fdfd03d89256c9ef58e5f57a151acc88 Author: Ed Maste AuthorDate: 2023-12-02 21:10:16 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:31:11 +0000 sound: remove Legacy Hardware section from man page Support for "old legacy ISA cards" was removed in 9054e296819f and preceeding commits. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 06c083f79dd74ba2fcadccbc1b338b8db7f35ef8) --- share/man/man4/pcm.4 | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 95ac7f71688f..1803eaca42eb 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 26, 2020 +.Dd December 2, 2023 .Dt SOUND 4 .Os .Sh NAME @@ -124,33 +124,6 @@ The following bridge device drivers are available: .Pp Refer to the manual page for each bridge device driver for driver specific settings and information. -.Ss Legacy Hardware -For old legacy -.Tn ISA -cards, the driver looks for -.Tn MSS -cards at addresses -.Dv 0x530 -and -.Dv 0x604 . -These values can be overridden in -.Pa /boot/device.hints . -Non-PnP sound cards require the following lines in -.Xr device.hints 5 : -.Bd -literal -offset indent -hint.pcm.0.at="isa" -hint.pcm.0.irq="5" -hint.pcm.0.drq="1" -hint.pcm.0.flags="0x0" -.Ed -.Pp -Apart from the usual parameters, the flags field is used to specify -the secondary -.Tn DMA -channel (generally used for capture in full duplex cards). -Flags are set to 0 for cards not using a secondary -.Tn DMA -channel, or to 0x10 + C to specify channel C. .Ss Boot Variables In general, the module .Pa snd_foo From nobody Mon Jan 8 14:46:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xhP6v93z55wnB; Mon, 8 Jan 2024 14:46: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 4T7xhP581Rz4DD8; Mon, 8 Jan 2024 14:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4gdkqbkNu2fqUmMgKb9g9qzgVZKowRQkaZbexIBCbw=; b=Qm7wrum3YSuzUE1kpN0W6s7HLl8ZcJ9UzhunMyErKRBMQALttYYMNLqLP+bDGdOnUOnUHP VuPYoZCdW0U4fquIP2sThE3Xlb0/Gya7eQX4M5PJ+wnLkELEFvpjUiLZFC1YJRV2u4Vbef EIaAkBeO5i4OsUWyz5bqolH2OjFB09CaJy0Mt3GFbvblOoF911/VNJssEguGvgZu8ZC2Fk D9TUH6oDp+X5aAROqyfQvbasvHcVq/b+LGsnPYkDp/OUVXnPygctV8/W6XCJEuZ1C9M8Pj 4yOgzb2BwXOjfEMbGMB4UVGV9w71IGKbglFhLG176fGt3B1QBf+qiMPA9bRGlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4gdkqbkNu2fqUmMgKb9g9qzgVZKowRQkaZbexIBCbw=; b=oQhexjhRhIs/ISw015yZGU+y/S7dC1GHeiQ0PbJdGzAhWDSKkitnGuWL80/p3VZoMDUhue tOr0vVBfVBRmYwtRc0NhB8xuqDOt6OIhpfjcHjyxkl/knGt2YI58VyTEKIiY/gqh9p9JHb h6n+yDbTVyFJzAA2cn9UXhOiK5Xr7DWQ0lBB59JH5THlc6PQS89qXZ/MDDTVSm40Q534Tt 3ZWhqIazHMC4EXNEQVahjqI6gbl2HVa3SLNNqvpB5Qdc4bo0+NlvxQzubjNBAe6+xSkC7g mBRXGoScCevQ6OX7Fv/o0ePVcQ08K/Bgfe9/xZCLVvzvk63IMEjwcZwE4CjGng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704725173; a=rsa-sha256; cv=none; b=FQj81/ok5lRPBxMEM9l/DyQZlunr7ZiIvuWbGEIVJNTannpICknLB2dNZfJ8n7hxW8i3Oe 7moiRIdXwE/uUQjKiBvkrWWgOBnosOPOL+SUyDxp4AOibXujlrEo7tmP9EBYtpa/RxM/3s ovJSHlxgzcVSO2ToJN2tWWyqW4X5lJVlhbMXGAm9SpMbeiMfQ/z4ZVweyHDld+TyAVkYlw wPVL1M+z1lE58JSO2KThZuy3dWOculyb+eBamxHx4l2ibJlPZRqHO5MI1B9Ge1pcXqx3Oz 5RGLyex9G5RMflMDzy56IuTq/058GeCnYYMIBkXh2RhkPvmq8jjnW+uojqiq0Q== 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 4T7xhP4DnBz1B3Z; Mon, 8 Jan 2024 14:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408EkDld034394; Mon, 8 Jan 2024 14:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408EkDUL034391; Mon, 8 Jan 2024 14:46:13 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:46:13 GMT Message-Id: <202401081446.408EkDUL034391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a13066579c6f - stable/14 - libsecureboot: be more verbose about validation failures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a13066579c6f0b80786472505f115cadbf301c25 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a13066579c6f0b80786472505f115cadbf301c25 commit a13066579c6f0b80786472505f115cadbf301c25 Author: Stéphane Rochoy AuthorDate: 2023-12-04 09:57:43 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:39:17 +0000 libsecureboot: be more verbose about validation failures Reviewed by: imp, sjg Pull Request: https://github.com/freebsd/freebsd-src/pull/916 (cherry picked from commit 4b9d605768acabc460aa6dcfe8a1f8db35b16794) --- lib/libbearssl/Makefile.inc | 1 + lib/libbearssl/Makefile.libsa.inc | 3 +++ lib/libsecureboot/vets.c | 14 +++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/libbearssl/Makefile.inc b/lib/libbearssl/Makefile.inc index 764984de9067..453630d038cd 100644 --- a/lib/libbearssl/Makefile.inc +++ b/lib/libbearssl/Makefile.inc @@ -1,6 +1,7 @@ BEARSSL?= ${SRCTOP}/contrib/bearssl BEARSSL_SRC= ${BEARSSL}/src +BEARSSL_TOOLS= ${BEARSSL}/tools CFLAGS+= -I${BEARSSL}/inc CFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} diff --git a/lib/libbearssl/Makefile.libsa.inc b/lib/libbearssl/Makefile.libsa.inc index c31d3f85975a..c171e141f0db 100644 --- a/lib/libbearssl/Makefile.libsa.inc +++ b/lib/libbearssl/Makefile.libsa.inc @@ -83,3 +83,6 @@ SRCS+= \ x509/x509_decoder.c \ x509/x509_minimal.c \ +# We want find_error_name(). +SRCS+= \ + ${BEARSSL_TOOLS}/errors.c \ diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c index 4a2aba433191..c86b198c45c5 100644 --- a/lib/libsecureboot/vets.c +++ b/lib/libsecureboot/vets.c @@ -568,9 +568,17 @@ verify_signer_xcs(br_x509_certificate *xcs, ve_error_set("Validation failed, certificate not valid as of %s", gdate(date, sizeof(date), ve_utc)); break; - default: - ve_error_set("Validation failed, err = %d", err); - break; + default: { + const char *err_desc = NULL; + const char *err_name = find_error_name(err, &err_desc); + + if (err_name == NULL) + ve_error_set("Validation failed, err = %d", + err); + else + ve_error_set("Validation failed, %s (%s)", + err_desc, err_name); + break; } } } else { tpk = mc.vtable->get_pkey(&mc.vtable, &usages); From nobody Mon Jan 8 14:46:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xhQ6vnbz55wnD; Mon, 8 Jan 2024 14: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 4T7xhQ61GKz4DDC; Mon, 8 Jan 2024 14:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=en3BppLEqu3C+yGmvBL/PuCUigMlzpz2Q4rBYDHRDyg=; b=UVy1kZgmGvjFlhSyEbhxWbzALyAofeSSMCshERgsgfPn4KYoeEuIuOL0Tx7d3Gv9FGXlbw F4HD86n7gxOXGu9yCAtwD5YRVooWPY45O1iDZeSNCf5Ic6vDqhfplBjRcJOQrCNGMFlLbd bgSlyojdFCKQqoEJHiOP9ZuWqntFIHcnI1qjGb6O9ELTka6mlo3nYH2ke+RG5oHSmwg2R9 73KZcHhYaSLOQWcP9f0NJjK1XiCO6GM4u7WsTL/277LBmEZKtq66wxRMEUMeTRwamxL9da RjlTc9UhhoWOmaAhlhW0UebFNO0nl7HSGurPEolyCz8qy6ffFwqAf2Uyw8ySCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=en3BppLEqu3C+yGmvBL/PuCUigMlzpz2Q4rBYDHRDyg=; b=uR1eZOgBw0Wo2pAToVnj+mt4Jkd80ZDsdjGMO5a0aR3rnCetlUZOCEWk0+VgQzSXwh5wlj 1Ntiz7XWQDqvzJgRx9/DWjlG9sA7DGDXdfFQFinYXG71zA6K+8BxFLvTqD30pHMHh/FuS9 XV9ob+8TPttDNo74JaUZZWBb2/zDUV1ToppIosXzUE95e4wx3RFXkRLI1ZCpXnoL+fIqLA GCO8K9JHxXiPyZUv88E2Mifn0OX3cSfErbQTEzSOHMkrHPofrPzVhe9jECyM69gIWxxW7J M8LO5pR/w2VJiz38NyIOR/s0vyX/zsfUQAl785ErkRLOPCEVyBG3W5lb4LZ+cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704725174; a=rsa-sha256; cv=none; b=E4B93f5dapAVUlaGr6K96z13eVKdlifavIWqf+d5cSEvnot79zbG7lfPithgF1OoBL2D+w wmrTAwdITJ8Kv8Ljzt1HrecaGxpsq9SJICsDoalBbGxlOM/HaPWK8lxO5ow2cGQD9vfJTQ 1TicL99mFQPf7KojgsluoT/LLtmZH2/uX6Eqj9cFKD5I1iunMfQKthSgNQ4EJI3jD/Uj6y kbdGDAw+CJRnjdispDNF+ReUFGrEA8LknaBXRLxfnUMNQBpC0th74iD5R5faIXdyPPd8UK UOGxyMEi/cvY+7P4U9BABM1f/ZpkzQb/UUxn7zzMH0HjHkg2qpjopAN6huwQCw== 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 4T7xhQ56v6z1B47; Mon, 8 Jan 2024 14:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408EkEes034440; Mon, 8 Jan 2024 14:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408EkEiJ034437; Mon, 8 Jan 2024 14:46:14 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:46:14 GMT Message-Id: <202401081446.408EkEiJ034437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 4e1deb61eab2 - stable/14 - endian.h: Remove duplicate words List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e1deb61eab2037ab53cebf7d5dd688626d6f094 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4e1deb61eab2037ab53cebf7d5dd688626d6f094 commit 4e1deb61eab2037ab53cebf7d5dd688626d6f094 Author: Jose Luis Duran AuthorDate: 2023-12-10 16:35:56 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:39:25 +0000 endian.h: Remove duplicate words Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/920 (cherry picked from commit dff3a80f6dfe88c52326ceb2c154668f132fdb52) --- include/endian.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/endian.h b/include/endian.h index c7b78217cedd..eb25cedf0bef 100644 --- a/include/endian.h +++ b/include/endian.h @@ -35,9 +35,9 @@ /* * We don't define BIG_ENDI, LITTLE_ENDI, HIGH_HALF and LOW_HALF macros that - * glibc's endian.h defines since those appear to be internal to internal to - * glibc. We also don't try to emulate the various helper macros that glibc - * uses to limit namespace visibility. + * glibc's endian.h defines since those appear to be internal to glibc. + * We also don't try to emulate the various helper macros that glibc uses to + * limit namespace visibility. */ #endif /* _ENDIAN_H_ */ From nobody Mon Jan 8 14:46:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xhS2xp6z55wlQ; Mon, 8 Jan 2024 14: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 4T7xhR72Q6z4DDN; Mon, 8 Jan 2024 14:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dHh1BIUJ+Ccq3gcmavL/SBgR98U1VeOa871HeDAP774=; b=dXv8rpnhYehk+aNMBrBl4hHfVsmc6TjmDGOW68BL8UcyKsZLSdw7DGzCjN6TNZkW3Ih7xh gt7LobaO86sRnmqRnneN9+zidThsaq0s51/olctfCp8Pcv4q7CaW84hClH114gp6vF45+/ F8LNfq1PAlgUwnYNatL0kkvHEuMqTXVbORlsQ4WbCCWxBEbzA6OZjfvBF0GN/XhHL687yi O4tTJ9WIViQpjD2xNLWOlhGpqBtBjrW17i6GFWARYLF1zmk8UUpyHZ8LeeUs/qgmyzwNAJ +5Ljcfr/yb0J3leCQMq1iCYUSSJd4NTRdoAbEC6LwHZXtq15dQkThes9IcgrAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dHh1BIUJ+Ccq3gcmavL/SBgR98U1VeOa871HeDAP774=; b=Q1cQpEbq/E/guvq78R1l8LPAZg3EzyaPgdApPsafmRhmNeAWdSAgfBsZbsHhII7xPh4g+Z PYGuF4VDt8bntRc0rFPGMEdDLXo6laX0KHVbEuoh7dYlK7msD+NqycaE5CA62bm12nR/PG BYzsjLLBid6H6KNbVbyNhwHw2W3wyWZaL2EVvTKRAzxP1iOcoVXn6ICSXZq5cFlqk4ZykE E9PuGeCgJm/cV3KRcGS1pmfDJZebALqHgCzz2PY1thwYKX0Z/ubqQomfxPHkUXYxgiHJ/6 DEFpLVbrVOEpncFaigXDlomQ+ywJc8WQ4TipqlJw/NXKJEYHfUFd52rWHUqGVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704725176; a=rsa-sha256; cv=none; b=nslx7pyr8XJmpAPmwm99k0k4SwZRHdi7jqeafeGAerVRb/WMGE1inOGaSMvf/NKMjShYJH 113gaJrUAC9eA5O5UUYRw0JtY0VB4YOmPNphIWxAvgGsC40ncwgLZUTNdFfIII98N8rqJV Qp70bqZY4LFJl7xN12nDy0BMr6uW0fLtufGAhqPLx6wKqbzNLYVlrBu4jaENxpUa23P0rl ds7GQs6aHK5k/VWirgbcYZ595T8Y4xKjY4JhJLbaxlZAwBZN0hlD9u5J+eStg6ct6LbXLS 5WBnGHFCGK/WIUIkAhSdwcHq/fyMIUrc7w0h80Wa8MGhEip+TN8WGpuKQUG/Nw== 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 4T7xhR67N1z19lB; Mon, 8 Jan 2024 14:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408EkFkb034482; Mon, 8 Jan 2024 14:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408EkF8Q034479; Mon, 8 Jan 2024 14:46:15 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:46:15 GMT Message-Id: <202401081446.408EkF8Q034479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f8f15d7436a5 - stable/14 - crashinfo: remove unused /usr/bin/gdb support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: f8f15d7436a5b771d7e5426a41750beb947e5c46 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f8f15d7436a5b771d7e5426a41750beb947e5c46 commit f8f15d7436a5b771d7e5426a41750beb947e5c46 Author: Ed Maste AuthorDate: 2022-03-08 14:32:24 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:39:57 +0000 crashinfo: remove unused /usr/bin/gdb support We have not had gdb 6.1 in the base system for some time; there is no need to check for it. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34478 (cherry picked from commit 13a974574670cc85a7db60bae6620631ad756f2a) --- usr.sbin/crashinfo/crashinfo.sh | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh index 92c843a86144..9a3d26020654 100755 --- a/usr.sbin/crashinfo/crashinfo.sh +++ b/usr.sbin/crashinfo/crashinfo.sh @@ -44,19 +44,6 @@ cleanup() [ -e $VMCORE ] && rm -f $VMCORE } -# Find a gdb binary to use and save the value in GDB. -find_gdb() -{ - local binary - - for binary in /usr/local/bin/gdb /usr/libexec/gdb; do - if [ -x ${binary} ]; then - GDB=${binary} - return - fi - done -} - # Run a single gdb command against a kernel file in batch mode. # The kernel file is specified as the first argument and the command # is given in the remaining arguments. @@ -66,11 +53,7 @@ gdb_command() k=$1 ; shift - if [ ${GDB} = /usr/local/bin/gdb ]; then - ${GDB} -batch -ex "$@" $k - else - echo -e "$@" | ${GDB} -x /dev/stdin -batch $k - fi + ${GDB} -batch -ex "$@" $k } find_kernel() @@ -173,8 +156,8 @@ if $BATCH; then exec > $FILE 2>&1 fi -find_gdb -if [ -z "$GDB" ]; then +GDB=/usr/local/bin/gdb +if [ ! -x "$GDB" ]; then echo "Unable to find a kernel debugger." echo "Please install the devel/gdb port or gdb package." exit 1 From nobody Mon Jan 8 14:46:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xhT43NHz55wgf; Mon, 8 Jan 2024 14: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 4T7xhT0zW6z4Cy0; Mon, 8 Jan 2024 14:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=23f8qd1SXI4Hzw7bgHBTh+Y3OrsQdbovT4MeBlOCcoo=; b=piuRoPe8EZOe3xj7YuhGjqiWpip8nZop1LBuTDHT4e47VXysmxVgSh9MnECe6RxJ4Gtqq3 WfjbCcQjysJjR3iPRTYR6dytYINQX5TCJ3GMOrS134v9AlHeP3RyyXhF3HeJGurJaBAC0m 0Xdt1Pfazo1GiLHyAnv9F8EB+rYA+yaGojJBnVFSrWNIGMKhf4+1Wl5jyXh6a+kLFVchTk Cs5qpFuPmnhoHGNVpwzsbtrju62VMdIg8PMU1nbKH23IByA3optbRifSDL5Z34ne9FjVTj rZSMdyokqhSULVwqJue3r8bLmxW7mmoZR/pPQo+nvuu0sZolC0JsSt5mb1nMkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704725177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=23f8qd1SXI4Hzw7bgHBTh+Y3OrsQdbovT4MeBlOCcoo=; b=ScKMYhxSQhc+J67X0qwu+deqwm4968JZ3nIH8WWgZ6uLcA1qpYtP7VC2ZwNyr9y/GUft58 w85Lg8KdmMcr0IeTDd9mTRYyBZD2YUR7yoTEPT4wdGt7OzucyHSt8PM1O5kOw3x5WowQ6V 9qA4qcXicGbZDC9YIRShxECzip1PhExCe8BPrEO1kUEd9wFM77aDTNF5+L7IEnGhjGXONB x0hxSVKK6i6XTsTtAQKFFSuTEJv108YkOH7Oii7PaTPMJ8k/f8m3Kr8A7KhRXZu8vsH8Ht ViBUrFXBmRzE4CoVpSSlz4mPI2wvR1x6C9zBcUrzEafs+gFvF9v5V9tpv4AKug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704725177; a=rsa-sha256; cv=none; b=weDQ2JUXxHsI/K2BTzc6+BrqHhS2hxL9jGc4TU881RGGW90kWCcI+Wm6entJvwFDc1svca 2+eenf7WotNfDlTPDXqdssrfjDiZ62EYaGlo9k2EjKStvZrPZp+g5hyotw7cqtuMzkQ2F+ lhsxz2ekpZDI/w+2BsHrZZHX3neHeJfQmdyslS3RrfdTIjuUG4VSKZuk06LW5l2d/qLel6 FJt/mSHdAuFxxIOPv4vxicUOInSERJSj9vQvdLHCIpDYZyUZlBu/Jv7P4T3CsEuiln+nh0 tarhBJTHX/uwiH123wpsqN8cN58DWwE8BKXPmtAxxZsPpJFfVhto2tfrdGCWnQ== 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 4T7xhT031Qz19Fv; Mon, 8 Jan 2024 14:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408EkGvJ034530; Mon, 8 Jan 2024 14:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408EkGtx034527; Mon, 8 Jan 2024 14:46:16 GMT (envelope-from git) Date: Mon, 8 Jan 2024 14:46:16 GMT Message-Id: <202401081446.408EkGtx034527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2b79df0ad999 - stable/14 - freebsd-update: for rollback, first create directories List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b79df0ad999df4bc22ed0e1eff446efa4055359 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2b79df0ad999df4bc22ed0e1eff446efa4055359 commit 2b79df0ad999df4bc22ed0e1eff446efa4055359 Author: Ed Maste AuthorDate: 2023-09-29 15:28:35 +0000 Commit: Ed Maste CommitDate: 2024-01-07 19:40:06 +0000 freebsd-update: for rollback, first create directories rollback_files() tried to install files before creating the directories for those files. In some cases this is due to special handling to install certain classes of files earlier than others. Just create all directories up front when performing rollback. PR: 273950 Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42020 (cherry picked from commit 6b27e1f2eaab9360a796c943da9d206515e1742b) --- usr.sbin/freebsd-update/freebsd-update.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 7408ef1c6721..551d40418240 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3196,6 +3196,11 @@ rollback_setup_rollback () { # Install old files, delete new files, and update linker.hints rollback_files () { + # Create directories first. They may be needed by files we will + # install in subsequent steps (PR273950). + awk -F \| '{if ($2 == "d") print }' $1/INDEX-OLD > INDEX-OLD + install_from_index INDEX-OLD || return 1 + # Install old shared library files which don't have the same path as # a new shared library file. grep -vE '^/boot/' $1/INDEX-NEW | From nobody Tue Jan 9 00:30:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8Bf31Vvxz55Lyf; Tue, 9 Jan 2024 00:30: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 4T8Bf30ydmz4BnQ; Tue, 9 Jan 2024 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QjvL+7JicxroIag1T4qI9giG7LK89c3pRx7377YmfkQ=; b=r7FYDgfIpRL2qp9NIopeomRusaf1goFqQkN7O2ZStDlfxKOWEs0sfY4LMnUh0UA3i16geF yzD+1ljOoRyaI7t+QBPkf74EJI9O4QNMMwvWhekus0PwYj/iWG78QD5Xp7yIry29I/d7kg aX8Sx+rdI1YMJ07d2HaY2lA9lo6UCBR1gQI744GAX4YHHx9hmYqnPA9xqJM8bDsPKNYVO8 i4PHbH7ryex8dgwria4J6n5QlE4UL7liXCYQFgFpmd9rtN7KrmwY7XQ0No6pn/kjnt2qbV WEjKmfkmB8NPEZ7hifANOdCYmv+bUa2p/XYFpohLFeOesJ1voTdBZQ7ExM/kJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QjvL+7JicxroIag1T4qI9giG7LK89c3pRx7377YmfkQ=; b=FRZY92PZkAYkDtvK3kzRXFhwit7sH5usXBh2ukEQ1L422/N+AH9XB7i5qy3B3ooQlbjRmr cS1HjPBeETllgM/NuGG9rohJLd/BpIrCRslOs+mY0opxDTMZs+tJDo3T/e338/ZUK2/dCI Y0ctPIuVA4orB5fZdfwxcQcW79udtRolzl0hcd9Ff30YT8f6xyZxeFGq7StBVCA7Lpm1RZ HBaNTTAc6xbe2czCcya5hMxe/2vT5beQ0G92wxX3N2sBovjjTIiNyos8PQKpf09rpqNxVz uZXJCzhyZrpXOsFCY6+ohzG/Z7UIUVgypyvDBSt6AKH42fAiu+aen4yCuADayQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704760203; a=rsa-sha256; cv=none; b=f/zdEtAW0RoMVk2MCSIv/s/1tlEHH4L6PiNCUqMcrYQM8CuYLRh6ibyoKlHJw3/RpRlj9T 9yzf76ML+Lq70Jjb0uzkRMRYEWry1xRcAegbcIatHEsGugXDvnm07DhtzduxPH59WlnPIO 7djWIoL98gTAgobymq6Q8qS1/41+G140nwWoFN+MSEWJvCGe/VDCgwe8pd0Iql2guRm8/Q R6sTLlp59XRKZNEY7c0IDR9uhn4nA9Rg4km7L9t7ltDtyYMumlgoeIpjwGrKg1X4BlTKgt Lq8s2qWZrniaVw4avttwF3GMqOBNXVYlNghtjEvQ5LoaErrxnQHFLK7w8y4i4Q== 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 4T8Bf3038lzTcK; Tue, 9 Jan 2024 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4090U2Vp013996; Tue, 9 Jan 2024 00:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4090U2hx013991; Tue, 9 Jan 2024 00:30:02 GMT (envelope-from git) Date: Tue, 9 Jan 2024 00:30:02 GMT Message-Id: <202401090030.4090U2hx013991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: ac84975e4a1f - stable/14 - unix/dgram: bump maximum datagram size limit to 8k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: ac84975e4a1f89a608a3c6ba8f8322b19a83421e Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ac84975e4a1f89a608a3c6ba8f8322b19a83421e commit ac84975e4a1f89a608a3c6ba8f8322b19a83421e Author: Gleb Smirnoff AuthorDate: 2023-12-01 23:37:29 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-09 00:26:38 +0000 unix/dgram: bump maximum datagram size limit to 8k This is important for wpa_supplicant operation on a crowded network. Note: we actually need an API to increase maximum datagram size on a socket. Previously SO_SNDBUF magically acted like that, but that was an undocumented "feature". Also move the comment to the proper line. Previously it was the receive buffer that imposed the limit. Now notion of buffer size and maximum datagram are separate. Reviewed by: bz, tuexen, karels Differential Revision: https://reviews.freebsd.org/D42830 PR: 274990 (cherry picked from commit be7c095ac99ad29fd72b780c7d58949a38656c66) --- sys/kern/uipc_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index f12693f3982a..5d39e5ea91c1 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -153,8 +153,8 @@ static struct task unp_defer_task; #endif static u_long unpst_sendspace = PIPSIZ; static u_long unpst_recvspace = PIPSIZ; -static u_long unpdg_maxdgram = 2*1024; -static u_long unpdg_recvspace = 16*1024; /* support 8KB syslog msgs */ +static u_long unpdg_maxdgram = 8*1024; /* support 8KB syslog msgs */ +static u_long unpdg_recvspace = 16*1024; static u_long unpsp_sendspace = PIPSIZ; /* really max datagram size */ static u_long unpsp_recvspace = PIPSIZ; From nobody Tue Jan 9 00:30:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8Bf42sDwz55M6S; Tue, 9 Jan 2024 00:30: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 4T8Bf41X3Xz4BH4; Tue, 9 Jan 2024 00:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1S3Y4tLy/kOEG9KZsFf3hNX2BdL4wWuAB1YQ4ChlTwc=; b=xKdYtcwPYAuJNTKFWGk+kdVBeuoh0D1XpyucKB5zyjENmy2DCIIOlz2ItVX/FOuUKJmZhI /gA0FRDRniJb+hvnE0F0oetUMG7ndOPwuDNZvv6tMOBZW4De2yOUInxKZiLu7AI6/1G9hx obCR/kUrQw4g35iQn+ewHkJF3wmLqoTUBhJKVhGjtRWdGpbPNhIHyoL9+QwVsNjrSDCdkW erj0XIsfzu4ZzFaf8TX5y1iEgbJ8N/F260B7guQWloRF7JoDuW7YBnq2QthkkRLUDh3aAv y2MGY/sX6t2JZe5PMRlFiEaFf7GDSMHLA3/7aY5l2CuNu2YK0OowoBtxIIn5aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1S3Y4tLy/kOEG9KZsFf3hNX2BdL4wWuAB1YQ4ChlTwc=; b=h0pu+ljxq7xOWXMNjGptjbJbIyvu5UQf/UMjsfSL71+4i5mpmuJ1d8WjZPWWFNOqZz9wIC 4wvJMq5OlYjaIxUxMETQr2RW4xBGHiQpL9raf+VGJkS2i91KIOhb1/Al2K/Y4UjL9Uf0JE PaM3Glxg78R3FIdZl8v2nZMvWfMSvP6Cos2m4/fhbWozREwbgdC2kEcTGpYuOd32+8e2F1 CwYbXRCdMDHEafJ7rd43NLjP5SsMUG49xQt/icVl25cEa2rGnD0g15TBFj4yOMTVU5Bn+b hMd4Bo9MCsoNtbS3mcstfuHQE04SK82jHxNPZNYnh5JIktWDFBx/2Z0RjlQQ2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704760204; a=rsa-sha256; cv=none; b=CZ+z7NJxRwepSepQPBxp4FwDMvgXQm6ECPt0Osoruzu05K20FTFWZjmNtFHWrDReHxVXZl 5WUBiq9xhZONkjm9fXGo8Cfw15u8DcSVrCBCBjpWSGBMjheXbKLMQYD+jQG5u0esXojAf7 JEiZ10b5t20vXpU00hocknfbgAaLt7NEq/TlyW0p6DTjxqiLZz0eZqV59HD9jbte2DhGay DIzWPNuYLdIzrMnFtLbO8k3VntR51ajZ78vPBtHl++I4ziH9flIXmoBWwXV7QjIhmB6wED oRdHdWXIc+aPSx07occsnsE4j8E5NUv7VPu2b69ECaNU9nLDNuxIX0eWDMb7+Q== 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 4T8Bf40bBDzSst; Tue, 9 Jan 2024 00:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4090U37h014281; Tue, 9 Jan 2024 00:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4090U3hi014277; Tue, 9 Jan 2024 00:30:03 GMT (envelope-from git) Date: Tue, 9 Jan 2024 00:30:03 GMT Message-Id: <202401090030.4090U3hi014277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 7cfc847aba13 - stable/14 - pfil: don't leak pfil_head_t on interface detach List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7cfc847aba1356c34ea12d73f6ac72793056fcde Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=7cfc847aba1356c34ea12d73f6ac72793056fcde commit 7cfc847aba1356c34ea12d73f6ac72793056fcde Author: Gleb Smirnoff AuthorDate: 2023-12-21 18:53:49 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-09 00:29:05 +0000 pfil: don't leak pfil_head_t on interface detach PR: 256714 Submitted by: jcaplan@blackberry.com (cherry picked from commit c1c55da49fd55c01771f8cf1f7255a37b79735d7) --- sys/net/pfil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/pfil.c b/sys/net/pfil.c index 4b4eeca362c1..3ceffcefb758 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -295,6 +295,7 @@ pfil_head_unregister(pfil_head_t ph) free(link, M_PFIL); } PFIL_UNLOCK(); + free(ph, M_PFIL); } pfil_hook_t From nobody Tue Jan 9 00:30:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8Bf556GSz55M6W; Tue, 9 Jan 2024 00:30: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 4T8Bf51tMKz4BNZ; Tue, 9 Jan 2024 00:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7Se/8tYWqcsiT2kunfeUPSnVEqIzYeHb+APY/W+Tmk=; b=H7Om2GXqn1UP5rCCF7XeLqtA0SxfV6+ur/2hpKfJjGrXakD64vTBkK1J+AM1PVsq6mV60v 2ZT0MR/sOHEgzudEKDM9jfQb2L7FiS3p3vLYdUrPt0NalpOPXR/ecR0f+BN93cox03nD4A xecEomk/isUTyyrCMHNXz63Lid8tFI6n3kF6RbwaUpTHDjSuULX7ia2le6QIO4wJZNEymK 9CRLcRXHxZRpAFzDm3YyMTAfLC0fclZDVyMxh5DdjYA1wp8s51BEvg3k3bd/r21F4B/qZp RMVdoQL/x7dhJxW957oSOfyH/jjNQDlL7528mXcuT9bAXCOcp2k4C2XhfLJpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7Se/8tYWqcsiT2kunfeUPSnVEqIzYeHb+APY/W+Tmk=; b=gT0xBaWUpUvmLdMMCFUZpFWQD/lIDQNtnvAu4YIrYPCphDPCQ8fxQ/2/x7JZRnuYUeMqXX GMtLS6UTaLB5das0dkTFXMZ2NXkKZbRA5Ie0ZaYjyACpy1l1Vfwa+qV8kW1RjhRmosba/J HzC2MfzWJL07AbBGdTfLNwOXPcjbYPftSIDUMrlq8aZOyubhjsEn3aXx8RIeJJEkLvwkjZ puGg9cYu+SxbXsOtw6jCrK78Li+u5Yh5F/orsosrasRAS2a1H6VIaEhPHqBoSQ37d6oBdE PPk2OwtL4ha7Oj3Nuw5CcEHbgWR9rD78hdGrs0pmVeDOx0xqbQczmYtFp1bwEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704760205; a=rsa-sha256; cv=none; b=Xdp9KBE4ofC9dbfBFLugsvIc2ts2zai9b5oMR/DxW9IZMiST2PYOm5059rQrSobgIpIPXo gYWQVD9vDQmvtCYYw+GdwH3lmYtHEgQdn5fPXOFUk9CSQqkeQ6xALaM/+8RbRFDGOY/eC6 umwl7zOeM6edjVAx1Qn/FfFNAN+LhVY9ANXJcjspNuHfhwcIuuCx6O1UdPiMXy0zNJJpmC v2PNMH1FNeZiQUB3P8/94rvts0KHUZeBIAC4OJh0kLhBM4t70coqx+Z8DurYHP3jtKzGdY L4ASh+Q7j1+YcX+evOI3QYZx+I+1e4UdfSt7bEi4LHOS3L/txa9WrzT+s8LdEw== 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 4T8Bf50ygBzSsv; Tue, 9 Jan 2024 00:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4090U5rW014561; Tue, 9 Jan 2024 00:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4090U5Q6014554; Tue, 9 Jan 2024 00:30:05 GMT (envelope-from git) Date: Tue, 9 Jan 2024 00:30:05 GMT Message-Id: <202401090030.4090U5Q6014554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 2bfe735277b8 - stable/14 - inpcb: reoder inpcb destruction List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2bfe735277b8858dd7ad937e0bf2286bdfb45182 Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2bfe735277b8858dd7ad937e0bf2286bdfb45182 commit 2bfe735277b8858dd7ad937e0bf2286bdfb45182 Author: Gleb Smirnoff AuthorDate: 2023-12-27 16:34:37 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-09 00:29:38 +0000 inpcb: reoder inpcb destruction First, merge in_pcbdetach() with in_pcbfree(). The comment for in_pcbdetach() was no longer correct. Then, make sure we remove the inpcb from the hash before we commit any destructive actions on it. There are couple functions that rely on the hash lock skipping SMR + inpcb lock to lookup an inpcb. Although there are no known functions that similarly rely on the global inpcb list lock, also do list removal before destructive actions. PR: 273890 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43122 (cherry picked from commit a13039e2709277b1c3b159e694cc909a5e044151) --- sys/netinet/in_pcb.c | 39 +++++++++++++++------------------------ sys/netinet/in_pcb.h | 1 - sys/netinet/raw_ip.c | 1 - sys/netinet/tcp_syncache.c | 2 -- sys/netinet/tcp_usrreq.c | 2 -- sys/netinet/udp_usrreq.c | 1 - sys/netinet6/raw_ip6.c | 1 - sys/netinet6/udp6_usrreq.c | 1 - 8 files changed, 15 insertions(+), 33 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 2586c107ceaf..a54b93812c55 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1405,26 +1405,6 @@ in_pcbdisconnect(struct inpcb *inp) } #endif /* INET */ -/* - * in_pcbdetach() is responsibe for disassociating a socket from an inpcb. - * For most protocols, this will be invoked immediately prior to calling - * in_pcbfree(). However, with TCP the inpcb may significantly outlive the - * socket, in which case in_pcbfree() is deferred. - */ -void -in_pcbdetach(struct inpcb *inp) -{ - - KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); - -#ifdef RATELIMIT - if (inp->inp_snd_tag != NULL) - in_pcbdetach_txrtlmt(inp); -#endif - inp->inp_socket->so_pcb = NULL; - inp->inp_socket = NULL; -} - /* * inpcb hash lookups are protected by SMR section. * @@ -1735,19 +1715,30 @@ in_pcbfree(struct inpcb *inp) #endif INP_WLOCK_ASSERT(inp); - KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); KASSERT((inp->inp_flags & INP_FREED) == 0, ("%s: called twice for pcb %p", __func__, inp)); - inp->inp_flags |= INP_FREED; + /* + * in_pcblookup_local() and in6_pcblookup_local() may return an inpcb + * from the hash without acquiring inpcb lock, they rely on the hash + * lock, thus in_pcbremhash() should be the first action. + */ + if (inp->inp_flags & INP_INHASHLIST) + in_pcbremhash(inp); INP_INFO_WLOCK(pcbinfo); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; pcbinfo->ipi_count--; CK_LIST_REMOVE(inp, inp_list); INP_INFO_WUNLOCK(pcbinfo); - if (inp->inp_flags & INP_INHASHLIST) - in_pcbremhash(inp); +#ifdef RATELIMIT + if (inp->inp_snd_tag != NULL) + in_pcbdetach_txrtlmt(inp); +#endif + inp->inp_flags |= INP_FREED; + inp->inp_socket->so_pcb = NULL; + inp->inp_socket = NULL; RO_INVALIDATE_CACHE(&inp->inp_route); #ifdef MAC diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 19d281937b52..4844bbee3b54 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -672,7 +672,6 @@ int in_pcbconnect(struct inpcb *, struct sockaddr_in *, struct ucred *, bool); int in_pcbconnect_setup(struct inpcb *, struct sockaddr_in *, in_addr_t *, u_short *, in_addr_t *, u_short *, struct ucred *); -void in_pcbdetach(struct inpcb *); void in_pcbdisconnect(struct inpcb *); void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index e6e8b7a56680..04b12b6587dd 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -862,7 +862,6 @@ rip_detach(struct socket *so) ip_rsvp_force_done(so); if (so == V_ip_rsvpd) ip_rsvp_done(); - in_pcbdetach(inp); in_pcbfree(inp); } diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 2c381ef600d6..20c77930556e 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -803,7 +803,6 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) } inp = sotoinpcb(so); if ((tp = tcp_newtcpcb(inp)) == NULL) { - in_pcbdetach(inp); in_pcbfree(inp); sodealloc(so); goto allocfail; @@ -1051,7 +1050,6 @@ allocfail: return (NULL); abort: - in_pcbdetach(inp); in_pcbfree(inp); sodealloc(so); if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 8b0b3c296c62..767045480abf 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -177,7 +177,6 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) tp = tcp_newtcpcb(inp); if (tp == NULL) { error = ENOBUFS; - in_pcbdetach(inp); in_pcbfree(inp); goto out; } @@ -215,7 +214,6 @@ tcp_usr_detach(struct socket *so) ("%s: inp %p not dropped or embryonic", __func__, inp)); tcp_discardcb(tp); - in_pcbdetach(inp); in_pcbfree(inp); } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index cbda7f536262..708a4e6b730d 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1634,7 +1634,6 @@ udp_detach(struct socket *so) KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, ("udp_detach: not disconnected")); INP_WLOCK(inp); - in_pcbdetach(inp); in_pcbfree(inp); } diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index d790a397f551..66fe0afbe918 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -689,7 +689,6 @@ rip6_detach(struct socket *so) /* xxx: RSVP */ INP_WLOCK(inp); free(inp->in6p_icmp6filt, M_PCB); - in_pcbdetach(inp); in_pcbfree(inp); } diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 4e69608b71de..35d68e164145 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1203,7 +1203,6 @@ udp6_detach(struct socket *so) KASSERT(inp != NULL, ("udp6_detach: inp == NULL")); INP_WLOCK(inp); - in_pcbdetach(inp); in_pcbfree(inp); } From nobody Tue Jan 9 00:32:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8Bhy2d8gz55MKZ; Tue, 9 Jan 2024 00: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 4T8Bhy1nXyz4Dvr; Tue, 9 Jan 2024 00:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEBNb+0tS1AAfsALh5nA2zNSdsDQfdj6nylp7y3YpqI=; b=DbnL6gMKlaqmYqmvg+awyG1HVsCbfV+Vl6i7KtTGir+oYL0BTxMPt6E9/VqZ3fXNQxZCu0 8QPC6V+xNkhir4EHzPrvXXOqzCthlXhQhi/NDbcLax8ErnoFue6Pk9UB/+E6WSKBbI4vhE L4m0M5tGQf8zIK1kV2cprSCpHD8vgJnpQVmAagDXOaMH/WmkA47oO4Y7+0hFii/u3R7m1L y/VLjmm4ff9U4TZ+k2m2BAa7J/DhQq0o3UTJ8+A60a2GzkyoH0VFyYUnLLSNHXOar7pVgh aeYK6Ti7FrCSVVPk2M6138NWKNBIJPYXmLbA+7tMHmKwzMfFmF92f0IndPWNqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704760354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEBNb+0tS1AAfsALh5nA2zNSdsDQfdj6nylp7y3YpqI=; b=vFCFRkYArMfq81/SYByeYfhwDaj0/+PrqTBMCHYbAMJh0/unsj5nP6FbvwXXqRG2CBB+61 Pa+GzEjRIOkAozBJZAtW7w/KbG3H+hytOSlMqd1U3Y78AEmDqQujPE3/5KmcvpMryvNI4m KSEQVqtTiCILbWPqvqajWJ8CIHdfNVM/sxo6jjzRoVoeSAmD3mmEL6XgaXXfCAxKjslH+w DvNa7KxHMVbKn7hiM/v+iPjKeH695rwoBgWAHeibiDwF2ualloEEEyiDrnZhSvwVZrebJf kSwSB0s2dD/E764PwEn/HFrkccTGYqbt0K+AgiDG1IdesIXo++ieUr7bPSMUoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704760354; a=rsa-sha256; cv=none; b=AH8qOVpx6orom3+N5qdA+2E2wfCx71JERdPQcCBDs9AKk6VxiM5BtwA/TnHugCTDYUilVm yBF3DqFyPkdK6IzEZ3I4tAfAzuVlfXdzWg5ataRxVh/QPsol5Qv8wMzAY93ijiqce47pll GNAK9pJAkflyFKQ/oQV1CwMbWo3Qf2+zvsU7QC/LI0nD7k2Cc+WLCFZUp/BBc3ZbdoT3pS 2WFWV9BqFppR8h0OQGILRHJmh+wjzrylJLIeVNXN/d0q0++d4ppDfA5XRm2Nvi3oCr8NBM GwRVWwApvQ8HiNty4d3vj1DV3hOh3hZHHJWAfQm3oWkJFGTMq/fjNsCJhVHwqg== 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 4T8Bhy0rYszV3t; Tue, 9 Jan 2024 00:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4090WY8d027331; Tue, 9 Jan 2024 00:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4090WYPK027328; Tue, 9 Jan 2024 00:32:34 GMT (envelope-from git) Date: Tue, 9 Jan 2024 00:32:34 GMT Message-Id: <202401090032.4090WYPK027328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: f7459ca1e768 - stable/13 - pfil: don't leak pfil_head_t on interface detach List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f7459ca1e768d76f6abe640f7dbcdc8f1aac0edb Auto-Submitted: auto-generated The branch stable/13 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f7459ca1e768d76f6abe640f7dbcdc8f1aac0edb commit f7459ca1e768d76f6abe640f7dbcdc8f1aac0edb Author: Gleb Smirnoff AuthorDate: 2023-12-21 18:53:49 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-09 00:31:38 +0000 pfil: don't leak pfil_head_t on interface detach PR: 256714 Submitted by: jcaplan@blackberry.com (cherry picked from commit c1c55da49fd55c01771f8cf1f7255a37b79735d7) --- sys/net/pfil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/pfil.c b/sys/net/pfil.c index 33b6be9fdade..f23702d2d905 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -251,6 +251,7 @@ pfil_head_unregister(pfil_head_t ph) free(link, M_PFIL); } PFIL_UNLOCK(); + free(ph, M_PFIL); } pfil_hook_t From nobody Tue Jan 9 01:00:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CJy092vz55RNW; Tue, 9 Jan 2024 01:00:18 +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 4T8CJx6kNMz4JZj; Tue, 9 Jan 2024 01:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJUgVFEDL2oq32HvF1J/nA8ewY+JBWIOTbr+iWKlwDI=; b=reStRTaNJe5tMwc9qp/8qAyR5HfjyiNNSPdPmt0C01IcMQUgh2HfYtDykEarVX6qaZ1JO7 g7pT2taLtm7IlBZ9tz2I66O93/omv5QBXLK1fzKJN8CQmlpd0AESry6tpuiUDxU5YPh1MG jF04OlhLZsnd7HzsvMuJnZa//EjlMWqwZscmlOgylS5KUDF4RVFZTNypvt6qB7bAGYaYNR JXnQ65SHd5r9Nw2tW9JU9Hpaq65rwUOPCAhEQSYiEzStdR7sp0qGb2vpzmFSL/XT3qS3rY 8AiTVQji2MD7pyYH0RQVju+JFQsaZuY3hg7IDXojOX4nkvmEBEfiKLKRzbnV9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJUgVFEDL2oq32HvF1J/nA8ewY+JBWIOTbr+iWKlwDI=; b=wt6PQdxqdDNQnbliyZZq3g00oMjqb8/r1KrVsxzvzJCKAFDSlFdmUfe3mmpQZDGnjIHPRz 3dv2jlWQDuaJNm8R3OGpJB9fi1XhI4TmwWkRP60v20QgelK69s7F5TwWgko8ehpMV7V37P vIlGViFRgJbU5dX+1551llBqu6QjB5tIJMGJr+avMtR5lwJOFUw36Fa+3AUbaVNIhkt2jU o1ixdBH/HLZY6shJlGfhQdrF+ZHrUmiJ9QR1rPlemVnoEKLUDTIoJRrHim1+UjU/MA6YlR 8e6N9ZuWm4jqQUVI1Y2ZxmbPFrHpODv3q78CjmLUjuSE9xnGCZ4bDfu2YDSAUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762017; a=rsa-sha256; cv=none; b=vIBMuY/e2veFa743Y9r0jxmRE6nVMcgfI22s1xNDjgSQbc3RMfvukmK9/txAuiyb7E92VC gp785piG9G83/tX5Pl5+cBuUlpaAjh7uGieWm39py1C6bWKJoN9p3umSkocL+Yo0F7hF2C l0Z3Iqb05C0agiVgXmSfYIiHOzj+Xt9xKae1rcdCCc7yAqh4sc/OV2CVqiUi7i84bzt/dd uF97wIh0y+NKNJ3ZRCm0e6lBmuvZhdcDlIkwOaKlZ2oy0PqTogW8QLGlns2IMat/rIelC8 OLBhvdZAxGdP/qq2jLLtVVbLiy9VcP9sTMahvrx05j5cO8/dVk6d9w2AZ464tQ== 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 4T8CJx5njtzVP7; Tue, 9 Jan 2024 01:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40910HOx071750; Tue, 9 Jan 2024 01:00:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40910HeR071742; Tue, 9 Jan 2024 01:00:17 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:00:17 GMT Message-Id: <202401090100.40910HeR071742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 775958df04c4 - stable/14 - libdtrace: Fix TCP data offset handling in the tcpinfo_t translator List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 775958df04c4c94c69a37e25715efbd97138be0b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=775958df04c4c94c69a37e25715efbd97138be0b commit 775958df04c4c94c69a37e25715efbd97138be0b Author: Mark Johnston AuthorDate: 2024-01-01 21:33:30 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 00:56:57 +0000 libdtrace: Fix TCP data offset handling in the tcpinfo_t translator The header gives an offset in 32-bit words, and the translator is supposed to convert that to a byte count. But, the conversion was incorrect. Reviewed by: tuexen, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43264 (cherry picked from commit c3268c23de45b75b44102a02e96f44b0ff2f6ba7) --- cddl/lib/libdtrace/tcp.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d index ea3a553ebf53..4e1061e6c7c1 100644 --- a/cddl/lib/libdtrace/tcp.d +++ b/cddl/lib/libdtrace/tcp.d @@ -263,7 +263,7 @@ translator tcpinfo_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : ntohl(p->th_seq); tcp_ack = p == NULL ? -1 : ntohl(p->th_ack); - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); + tcp_offset = p == NULL ? -1 : (p->th_off << 2); tcp_flags = p == NULL ? 0 : p->th_flags; tcp_window = p == NULL ? 0 : ntohs(p->th_win); tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); @@ -282,7 +282,7 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : p->th_seq; tcp_ack = p == NULL ? -1 : p->th_ack; - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); + tcp_offset = p == NULL ? -1 : (p->th_off << 2); tcp_flags = p == NULL ? 0 : p->th_flags; tcp_window = p == NULL ? 0 : p->th_win; tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); From nobody Tue Jan 9 01:00:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CJz1j4Mz55RR0; Tue, 9 Jan 2024 01:00: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 4T8CJz0XgRz4Jj4; Tue, 9 Jan 2024 01:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R9c0eRvLP4BPIlIN6fzIIw9PqDnX8alhW5NLsDNhEsY=; b=p0SyOF9b11HGHY+VV+BOkOgp8vRasi2oEVW3y/kjUC2NqzeK5ZncphrJOVU7IPCSpJZ9Jg qg95V4MONUpbhmuU+1/rGNoWX8xy2NSMRclocSxtrorgKikMkpgRcW24H/CmxWBfO3k7qm a6eV97e0/dfUKW9Wqd4/pttZ/n/XI103uWH0dI5eTfktNHjEwGZG5a7kKIYxZR1sxZWDgr 5GSXIDYSi0yUIhpM04oNi5tb65MM0WJYyhFYWKdYngCYNp8j2B2O5PiivdecEkf2BQeweY pXS/e2MzJ01cR4In+CJ677LNWWDJn5CVIXO9HwYzuEv1Kw693g49WxdxzWDBtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R9c0eRvLP4BPIlIN6fzIIw9PqDnX8alhW5NLsDNhEsY=; b=xadq9SvZcEbmySFUzNr3ZMpmAOtDAHotbw0NP3KdjxMcyT/5OkgUEGO5XmC6jf35LPqFe2 C/ZmnEZXlbnY9p0wlFyXjmxyCa4641KHXxwq1VmyKb2YF/nOALFdlRCJ0y6soLnGmsCJ2i zAWSC/63T+gxE3Vu2xECjGR9+xvM4cvNlBaTJi3SdJbrP1Y5lK06mVXrcVHFv8CkHhjX7X YMsdGEEU+/zJvWknyHrotwPMgy1RzA3DszwfZE30zGPm9Buxy0YtQ9Gd0c3liPKhTWry8P mxYz/2XLFId5c0LtLquxSyAeisMj/ubZizk0L++krwIqwx+me7FaQpIZrhc9Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762019; a=rsa-sha256; cv=none; b=M+DnwcNM/cBvM4R3HHeVYbzrTO0W94lZ4iIiS64uJBnCft4zXY2MHDGedMMSf0h/DIWBR4 33m0w8qT/By6li3oh6M04KBmxmNAEPW2tYCwaVtINi/znqE2YG9L0stPkiKGfKKyJGfwn7 r4Fp+2Ij9RmypldEn5LkLM5zmlcglYyOh+USdeaol1djAPwiPW25gtoBEE/RfED7AV5Y0i UKJaZZP2ILmn0zvqZvaW4Sop0nRbEGOhGFW3YQahecUC+M60yP/qqqmEH/0aOHB3f5a8yY W+yMB+8VAdNzG3zaZr0qYFOgwG2ElGgjd7a0Br0X/c8QsBJhz+HVjkAjo2sx7Q== 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 4T8CJy6mTHzW0x; Tue, 9 Jan 2024 01:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40910ImT072181; Tue, 9 Jan 2024 01:00:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40910I1x072178; Tue, 9 Jan 2024 01:00:18 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:00:18 GMT Message-Id: <202401090100.40910I1x072178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4cbf6ad75e3e - stable/14 - makefs: Fix ZFS cross-reference sections List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4cbf6ad75e3e2232018aee73d2b7bb0b8f48658b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4cbf6ad75e3e2232018aee73d2b7bb0b8f48658b commit 4cbf6ad75e3e2232018aee73d2b7bb0b8f48658b Author: Jose Luis Duran AuthorDate: 2024-01-02 13:30:29 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 00:58:59 +0000 makefs: Fix ZFS cross-reference sections MFC after: 1 week Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Pull Request: https://github.com/freebsd/freebsd-src/pull/979 (cherry picked from commit 518a1fd7d3492b8caa8a97d2027c3e7b17abbb0c) --- usr.sbin/makefs/makefs.8 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index 5c3d88b4ac1b..a5e15a045ec6 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -33,7 +33,8 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 5, 2022 +.Dd January 2, 2024 + .Dt MAKEFS 8 .Os .Sh NAME @@ -571,7 +572,7 @@ The root of the staged directory tree is mapped to .Va rootpath . .Pp Dataset properties, as described in -.Xr zfsprops 8 , +.Xr zfsprops 7 , may be specified following the dataset name. The following properties may be set for a dataset: .Pp @@ -585,11 +586,11 @@ The following properties may be set for a dataset: .El .Sh SEE ALSO .Xr mtree 5 , +.Xr zfsconcepts 7 , +.Xr zfsprops 7 , +.Xr zpoolprops 7 , .Xr mtree 8 , -.Xr newfs 8 , -.Xr zfsconcepts 8 , -.Xr zfsprops 8 , -.Xr zpoolprops 8 +.Xr newfs 8 .Sh HISTORY The .Nm From nobody Tue Jan 9 01:00:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CK04pG7z55RXh; Tue, 9 Jan 2024 01:00: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 4T8CK01Z2Mz4JlT; Tue, 9 Jan 2024 01:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=er3xOyhJXZe9vsZk1tqG7TuUULDuS02ye8ftJQQ0aMk=; b=RZbLwTRHg8UWR6INdepP2/Txo/SK4xkVU0ypIiWFxGCpCJ5cSpWsk8z2zgM6tQ6BdlmUz6 Ivrl1D/32lDpQggqj4XFq+XJM9N34XEYYDNVF/pO6nCxyRUNgjYn9S61AmF4r7Vg56znI2 xbQ3lLtBWKCzg2hMZyPKbvFA6rCJvz/FoafQPcnE/UrJXSStjl0l3VyV0pOi0zA3jAs8IR T8dJ88eRxTwiF1EkVsiIFic+hQbsoQ42UTV9ORI9jz+giTXLo/LsMrV8ql+RcOeIC+cgzv OID0VN5J3wTI05tkP+M4sA9Gh6lW83Ne/PzQDI4iTIfu6ljAsrtHdqQR+JKjUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=er3xOyhJXZe9vsZk1tqG7TuUULDuS02ye8ftJQQ0aMk=; b=wmnZrLrpDCPPiMbaeFOxjdwbOBnyFSUGf7YJJXvFDIbvUscMrNpfF/kxeqyTygSp1SaVLu 4JLMzbBCOfkcgZ4OYQDTq5FPBl75v1UXuma4pb5LQlISwFQMWELgHfNI9ycj7jLncGAJpT +F5j5jHybhnh1J5jYdmwzbJfAlMMLYf4XVEMmYJdwvNH/gFHSzKN+jDVrvGcSmy7zQ/9Yj qBoZx1Olu3s2J9W0umDkNyisGvN9Rd26X4EZ/QMa1fSbLn8/36ujxCkZ5FZV99P4YbmU+9 CKARWDC39wYpvGCAWB3zFPfLkDySd6RBqKkIhAyBdQaQ5bYf4f744spJ52WJPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762020; a=rsa-sha256; cv=none; b=d2FTEoXYlP8pTM6k+GcShL+GHzxigkp+u8cFi6g9j9QObriqL8yR57WpfCwXuiGK6d2UeO DkRq40uNLR0JB2Fcg3rwDnipunZJpqZ7FsV1P/12vR189htSVNiw6xCNWmuv3XDf/+gWHU IdUWTDOyd80CCu0wFOvXXpUhtXAadZrYoKDdceDcoMmXkXqJSszAl17pAO0nKS3x3f6lwj 6s7noaTCuvF+ZhIt6czV/BNlA3zXC37KyMoekwE0inahcSsZQTPW93jAWhKQ8V9IfZ4YD9 uXIQpAnOfmpSRwaXanbiRcCTAblPVzZwU9gIw7Hi/6GPK6UvYos3iPfwbMI9QA== 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 4T8CK00bbVzVmy; Tue, 9 Jan 2024 01:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40910J7K072226; Tue, 9 Jan 2024 01:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40910Jcf072223; Tue, 9 Jan 2024 01:00:19 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:00:19 GMT Message-Id: <202401090100.40910Jcf072223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3aa8b74da97c - stable/14 - release: Add missing /var/crash ZFS dataset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3aa8b74da97c439c9fe71c31a2aff59825e10e2b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3aa8b74da97c439c9fe71c31a2aff59825e10e2b commit 3aa8b74da97c439c9fe71c31a2aff59825e10e2b Author: Jose Luis Duran AuthorDate: 2024-01-02 17:38:55 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 00:59:11 +0000 release: Add missing /var/crash ZFS dataset This matches the layout from bsdinstall. MFC after: 1 week Fixes: 89585511cc05 ("release: Add support for creating ZFS-based VM images") Pull Request: https://github.com/freebsd/freebsd-src/pull/981 (cherry picked from commit adc215de9cabadb89eb4a1c99e047906eacaa58a) --- release/tools/vmimage.subr | 1 + 1 file changed, 1 insertion(+) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index f8b132875cdc..6eaf17b07948 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -200,6 +200,7 @@ buildfs() { -o fs=zroot/usr/obj \ -o fs=zroot/var\;mountpoint=/var\;canmount=off \ -o fs=zroot/var/audit\;setuid=off\;exec=off \ + -o fs=zroot/var/crash\;setuid=off\;exec=off \ -o fs=zroot/var/log\;setuid=off\;exec=off \ -o fs=zroot/var/mail\;atime=on \ -o fs=zroot/var/tmp\;setuid=off \ From nobody Tue Jan 9 01:00:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CK14ylfz55RNZ; Tue, 9 Jan 2024 01:00: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 4T8CK129VXz4JgV; Tue, 9 Jan 2024 01:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha65tsMzhQ3jnc+EFV0fDCKpOwNxvI3f3taLGMRI5Xo=; b=PGI/AYSDp/YSzJQ5QhvCK8GICrg4vV3hz7HF5XCQCF8BeNVJ9iP2sS9+b6cr0XeymEigW9 bsTuzz17/oyTbpUCAh6zIY9qjInW284GA4rdDDFeZHDi9USVPtDgbcw0PDSL+C0wrlu90h 5y8+fq/O+BwV/J/2RH6CKs6AHIF/d+A8sWi7CrIeZagSVppV6Ok4b9Ttq+JB6yE88mlZS3 F8fGu73eI5X4hTqhxD75REPTNAA7ffjcGBT82UH7cK7P4ExutGntWzODTszQc9CpPnZbPf 2qrS9hIvY9OtAwN6UzBbwItJ9YZypzWeAiZxmnqrwi72OkS7gwsWGSyig+fLkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha65tsMzhQ3jnc+EFV0fDCKpOwNxvI3f3taLGMRI5Xo=; b=Q17jNAosFiA8NfLr+NZldsankqsL/smROkhLD+/UePRpCca5ffL7kWXd/A6Wf+y4RF3R+K 0pFcbJFMhh7NJWLB/8PgcYB0pgDgX+GY5NlGIELvzQ5mbnFrbnyIFUodpYzkOUWd9+DUHh tL5LFyG82ZJiFygAoHyP1kkfPrU9zd/YnCiLsBflSh3i3BJKC/jwjZKiod/caQs0pmRCUr gQbL81LXXhh1yUEJ0EJfYEF6iC7nP3HYebo5S7ocBToRmipuQktm4ZfBCgpEZStIl1yMEQ 2KU/Vt5Xzd3KTzcM21Qw/CAbCGlUamYEjAUB8gbFPgav+qL0pUnL0kS18Fk+Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762021; a=rsa-sha256; cv=none; b=e3cyC+Negspyo3/uaWFoTx12lR1Xk2l1mIkb22J1ALX0PpjYj5uguEpDld3WK0uwcNPGVS bKuOVaEDaKZRYpRG3V3XRdjXD6PQ1EBgTiTn9HcutdK+uP5TgyVmSKzpSjvqSqgzMN55XI pQUZfH8y9KiFopKuhXkGttYzu//1rhRSmbZusTHpF97GLjD0B9I41/zrCp4pNBth/O2/Zu Y+vioF9nlzwjzhnwszWeh2lEf1R8A9LzfFc7/GNEqZdAz0v1Jj6gf4MzHtNUVi2gzNMrTZ kSvaUWiB6QYzZ0Nb0NE942VOhx8qQwrnNtVauA74SazvRT0hEI2eftg49v3rAw== 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 4T8CK11Gn3zVn0; Tue, 9 Jan 2024 01:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40910Lno072262; Tue, 9 Jan 2024 01:00:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40910L45072259; Tue, 9 Jan 2024 01:00:21 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:00:21 GMT Message-Id: <202401090100.40910L45072259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 009c8a3d2d76 - stable/14 - ctfconvert: Handle DW_AT_data_bit_offset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 009c8a3d2d76ed8bedc5ea0316979f18f9ae2791 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=009c8a3d2d76ed8bedc5ea0316979f18f9ae2791 commit 009c8a3d2d76ed8bedc5ea0316979f18f9ae2791 Author: Mark Johnston AuthorDate: 2024-01-02 04:12:29 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 00:59:54 +0000 ctfconvert: Handle DW_AT_data_bit_offset This attribute is new in DWARF 4 and supersedes DW_AT_bit_offset. PR: 276059 Reported by: rscheff Tested by: rscheff MFC after: 1 week (cherry picked from commit 78cd75393ec79565c63927bf200f06f839a1dc05) --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index ec5a3c58856d..42faaad65db5 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -1004,7 +1004,9 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, else ml->ml_size = tdesc_bitsize(ml->ml_type); - if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { + if (die_unsigned(dw, mem, DW_AT_data_bit_offset, &bitoff, 0)) { + ml->ml_offset += bitoff; + } else if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { #if BYTE_ORDER == _BIG_ENDIAN ml->ml_offset += bitoff; #else From nobody Tue Jan 9 01:01:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CKy1fyBz55RbD; Tue, 9 Jan 2024 01:01: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 4T8CKx6hksz4KrK; Tue, 9 Jan 2024 01:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7XnGkB1osFqOmT4SbGs9OgrO9ue2AzlsNAgVEmBMHXQ=; b=ItkWZciY3uSVym3TYGnyLX3jBXodQTrNcM8ivjXae34UKSYgqJ9nO+JVXdXb6nogvLteCb YY0b7FvQ8ZbAgT+GKQb2yALftIgE7vDi3teX4N4xAOdXS/wHOZfiyLQ8cAkcX+i1y09nJL y92apfRq1QTerRSLTDr7x6M9cKzOXrIZbuUAxUBD/w56Oc4uZmHGGtvc8JXXeUZ+/oReKB +bz4hrc7XW1rPY28lvElVsrYKdez6Kh4oAIAcqn1C62BZFcApgtKtuUQ139QofSQT/QcEH 2VPyt0MSAhIwgdKY1vYy/JYdegk/5MWs0srbqDdRnzXI+tla6vH7JXyWrovR7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7XnGkB1osFqOmT4SbGs9OgrO9ue2AzlsNAgVEmBMHXQ=; b=cDpUg5fpSnFkPybROBidcnbl4n7VPFast7rIWaEexUOP7TIuYyrrAZP1rjlfUquUP3t6Zp beQZ5vi9zKuWtiaoHv1jhLXynf7Cy9VQFDKXnJRJ6a5PGAHhtr6mxG5CQ+F5ryrWagXyTe EO1FgRVQp517ZU92xeLBTBoxcKh8DDHud26xKZX55G29ukoSfsdDb6qKGPElge8XQwi+u8 0G69n4IDwru2WLRfpbujhqdEvyPEos2d98XKTM7RqIi30Qf4RsyTfiUYPggSBX6To3P1hn nEABxN1gYXjEX40sAGwQkLyr4ju/R+uxKpm0P+wSlNQv7NuhaqV/TW95/0I8LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762069; a=rsa-sha256; cv=none; b=GpPQKhk/xdm1A0o2QGMdNYJak/IDrI+POjLejTighv74Z7OoGjsk8V78mXYlLI+CcPaPQO ThODHbgKY20IVrD6RRRAza1438oQqUj+0vzel3KcYuEAMglOqYc9e5Fd5sKwiO3VFJIH35 H2Ec+nDpwqLMd5wvqJC+g0BP19UFBMr3eYw9+DzH0xN2h/4PhMEyukOuUSqyZcADNlyiax H7CzmkaqGk/pP7aXiae13cMe48V9rgMEXpjBC9JY3xtiHYIF29Fmb4kMaowquqih/+pB9F cafWe5hfrYZ5c2YPHhYiN5fsP7Pb6SkgYt9MS7AnBn2O8bu61jhADAFde4SWAw== 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 4T8CKx5n7KzVkh; Tue, 9 Jan 2024 01:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409119A7075095; Tue, 9 Jan 2024 01:01:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409119Yf075092; Tue, 9 Jan 2024 01:01:09 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:01:09 GMT Message-Id: <202401090101.409119Yf075092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cc8af47b6d4c - stable/13 - libdtrace: Fix TCP data offset handling in the tcpinfo_t translator List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cc8af47b6d4ce9c40ed03ace7c130409fe0962a0 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cc8af47b6d4ce9c40ed03ace7c130409fe0962a0 commit cc8af47b6d4ce9c40ed03ace7c130409fe0962a0 Author: Mark Johnston AuthorDate: 2024-01-01 21:33:30 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 01:00:30 +0000 libdtrace: Fix TCP data offset handling in the tcpinfo_t translator The header gives an offset in 32-bit words, and the translator is supposed to convert that to a byte count. But, the conversion was incorrect. Reviewed by: tuexen, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43264 (cherry picked from commit c3268c23de45b75b44102a02e96f44b0ff2f6ba7) --- cddl/lib/libdtrace/tcp.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d index 2ccbd574055d..32a1afce9ae2 100644 --- a/cddl/lib/libdtrace/tcp.d +++ b/cddl/lib/libdtrace/tcp.d @@ -263,7 +263,7 @@ translator tcpinfo_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : ntohl(p->th_seq); tcp_ack = p == NULL ? -1 : ntohl(p->th_ack); - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); + tcp_offset = p == NULL ? -1 : (p->th_off << 2); tcp_flags = p == NULL ? 0 : p->th_flags; tcp_window = p == NULL ? 0 : ntohs(p->th_win); tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); @@ -282,7 +282,7 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : p->th_seq; tcp_ack = p == NULL ? -1 : p->th_ack; - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); + tcp_offset = p == NULL ? -1 : (p->th_off << 2); tcp_flags = p == NULL ? 0 : p->th_flags; tcp_window = p == NULL ? 0 : p->th_win; tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); From nobody Tue Jan 9 01:01:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8CKz3GJ4z55RhB; Tue, 9 Jan 2024 01:01: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 4T8CKz0ZFRz4Kjl; Tue, 9 Jan 2024 01:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QtCh//DrZEJJH7vzpFUp5NNhW5LIf4MFVfJ1r6Rb72Q=; b=ie1yQQd8CJQpF9Gf06+O161ZGOjXT22RoJpLIHFwTw41Qnuq5eDxodgva0d0GcFGJj4T12 AI3icjIPY+LZx47sWdfn6Nob/K7V7hyMJL9zyN7tegGID9OvrsHGxa1e/UGd9K5AaxMggI UsXNmoXB+KNmPg28zqghsdtcdKw54ZtHcJNJok4g7abOkbf9cECEIPRPmghktbbp+zFZjG U3rVqtHmUN/sk6e+HGWcBLwylziY8neR5HRS1XWy+fASUhVB72ua5foc6qIGk8+3pZtiN+ hG5NLf0nlKYCI3M/+cR9F1Xki/EGe6z8dtn4KW0XGcm6R3q9o8u1uSZBH5ASxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704762071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QtCh//DrZEJJH7vzpFUp5NNhW5LIf4MFVfJ1r6Rb72Q=; b=nZ8Hrs/P/rsgbZbmc8OK2Wynjd++zKA8anU2pGBw0kuLxEaPRPqjhfJaNR6YsA8NbrN6XP 2w1KaZlgDEyTAZoei38c/Znjn/7h1ZCkxsNFDYA/KPBFNkIUKECsV7W2pOVG1e4NUrlotS LkckUU8Z+TKcuPY6F/P1ghz7U8nqUxcn/XRr3rE4evt4GnWFNfETmZLH0wUElYhIGXqzU8 GaL93jEJXSNUG//bTJVlpu3fYn3vkfMGc+BsRviWPovDDLO2tYEEsAnC53KRBge+bCWTuN /o5A+DB/BE8M5Ju1fD/PMZVps/tUg6QiPVQCijzumQR9cEpKqBQpX54kK5Sxag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704762071; a=rsa-sha256; cv=none; b=YL9CJC+jID0+Ey0tt9q+/39xgsVIkEDTCIxMLefubyfODfoXmUr2+36/t2l8CW7lxaipLu Xlp3q64aSg4CTy7Y1ETiq3kXn9ehUNOuBQrImtb5IILTR6z7fWWHWRjNIWwX+bM4nSb3lH GruZzus1aD8DiOBS4nF3I7nwt036eb35tpVD4Xt3Lnd9H5T+pc5Sx10t1zP0o1AeUEEuB5 /LX89LXWl/f26y6JpHae8hUQRDf0ZiZPLKj7Z+/pG6iULbuOiKb8dm3d+P5wJWS7uiDYEM Xs6p0HifMe58Nyh4/3nnM3/Dc5VLXQpcwNWK2o2oUxxd4yATdk4UgFKTK/9jYw== 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 4T8CKy6lvKzVkj; Tue, 9 Jan 2024 01:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40911A32075135; Tue, 9 Jan 2024 01:01:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40911AOS075132; Tue, 9 Jan 2024 01:01:10 GMT (envelope-from git) Date: Tue, 9 Jan 2024 01:01:10 GMT Message-Id: <202401090101.40911AOS075132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 693dbc0070f9 - stable/13 - ctfconvert: Handle DW_AT_data_bit_offset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 693dbc0070f97cc6744796d40eeab63e3305492e Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=693dbc0070f97cc6744796d40eeab63e3305492e commit 693dbc0070f97cc6744796d40eeab63e3305492e Author: Mark Johnston AuthorDate: 2024-01-02 04:12:29 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 01:00:31 +0000 ctfconvert: Handle DW_AT_data_bit_offset This attribute is new in DWARF 4 and supersedes DW_AT_bit_offset. PR: 276059 Reported by: rscheff Tested by: rscheff MFC after: 1 week (cherry picked from commit 78cd75393ec79565c63927bf200f06f839a1dc05) --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 861fda0931af..1de5741ae207 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -1004,7 +1004,9 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, else ml->ml_size = tdesc_bitsize(ml->ml_type); - if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { + if (die_unsigned(dw, mem, DW_AT_data_bit_offset, &bitoff, 0)) { + ml->ml_offset += bitoff; + } else if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { #if BYTE_ORDER == _BIG_ENDIAN ml->ml_offset += bitoff; #else From nobody Tue Jan 9 12:57:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8WDg1THnz57PMV; Tue, 9 Jan 2024 12:57: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 4T8WDg10fPz4wrc; Tue, 9 Jan 2024 12:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704805059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVruVdWr85vIM9DYTyZ0X9ZSMaeHSGu8EkAnFS6OjQU=; b=WmmGHGeOpukFhctTC1oR0YvZwn4fC3EEacsYu0BuO9Rh/1ZPDRo1zn5p79Kha99Vkx8pTL 14Np0qjY7CH/nVTm2qYcXyrb8aPY8IZoAlV2ihWEUtRinf4rZ8c0r26yRcDpzExYbjfWyF Ywbw3x2K9qEIUaNgl+JfAKAVKRJIr9ncpe7NlFegj8HQfl1v8qHTG98n6A2HKdtEz1QXCn Mv8I71fhnsm3rooT4h2FueZ0G5ZIsxJ/m+FPLTiCkkpC/fTAUamBSIIlmbTdGXgRTvrOz4 E/FYVOWxM2EYy+nxe9czx/tsBh/r7kAmFjHbLwLsjE2hxxri8NhvvV3Df5pLDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704805059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVruVdWr85vIM9DYTyZ0X9ZSMaeHSGu8EkAnFS6OjQU=; b=gW67XxzXXs2Bs/2v5GVlBAniyCmKkH3UH0yX3bQC6MWKy9umC4TLLRlXXqv7hXvdTAiGfy qbxDefpP9RdbXMjyFJYa5CkxdjGjo5SQYYTw1F0xgsdumqtNTDnVJtaAHIheIyXCvtiNqG srF6Mx/3pd7SqXUle299Kpax3GIMLacZGclDP4GEzeewoar3gX22+BopXT6LIIhqj8K0Dy /9gLh0ct8TF/7kt792zKM1Nl5gzTplSZXcAvmVL21n/0O9AUDNVJJLTCNaPf3pRvq3ue7q YkXdU7CrxJsQ6blvseOJLx3qJcTQmnmvYyDOq8ee/1+MKHkGP5gHh+Fskka0lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704805059; a=rsa-sha256; cv=none; b=Hzu4mO9sw3KCBoijOZkV9m0779XwG7VOkBjbutUP5pfmxsZz1m13bqhyTeR+JDWtO2tvS3 4D92KxE7JrbXM/PI0TsR9EPXYwvSRUoiaFvsz8uTFAMOMeqwlYGlUrfx3RmeF5qT4ZJ+f0 a4g0imTNcPR3nTnJIbtwfnErmSmVflqfbMx0X/MLzm/2NMD2I6d10P+vBjQmpiFbSRDTg+ KvClRjHvTGwl1UiLazudMIq1Jr/fhjQHgazdU4u2uCGCm5y4I0wz4lWbROC8dPKgfbSkN3 wjtr7DIjTbCBsa0DBKPjjP7DudDct5VzFi8hUyYpz6Lvn1azS3nqcywSj0+/Dw== 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 4T8WDg03nXzrhY; Tue, 9 Jan 2024 12:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409Cvcb8075888; Tue, 9 Jan 2024 12:57:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409Cvctt075885; Tue, 9 Jan 2024 12:57:38 GMT (envelope-from git) Date: Tue, 9 Jan 2024 12:57:38 GMT Message-Id: <202401091257.409Cvctt075885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 541d89067add - stable/14 - tcp: Make use of enum for sack_changed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 541d89067addcc7fec96214225c82e43d2ce037e Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=541d89067addcc7fec96214225c82e43d2ce037e commit 541d89067addcc7fec96214225c82e43d2ce037e Author: Richard Scheffenegger AuthorDate: 2024-01-06 19:07:39 +0000 Commit: Richard Scheffenegger CommitDate: 2024-01-09 12:54:48 +0000 tcp: Make use of enum for sack_changed No functional change. Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43346 (cherry picked from commit 893ed42eca32f7b5e3a5b8cef3f364be0d9cf3ef) --- sys/netinet/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 512da877846a..2d7a6fa11b4e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2506,7 +2506,8 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, goto dropafterack; } if (tcp_is_sack_recovery(tp, &to)) { - if (((sack_changed = tcp_sack_doack(tp, &to, th->th_ack)) != 0) && + sack_changed = tcp_sack_doack(tp, &to, th->th_ack); + if ((sack_changed != SACK_NOCHANGE) && (tp->t_flags & TF_LRD)) { tcp_sack_lost_retransmission(tp, th); } From nobody Tue Jan 9 16:45:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8cHR2ddMz55qtc; Tue, 9 Jan 2024 16:45: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 4T8cHR23qqz4Bq9; Tue, 9 Jan 2024 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3n1XOXAo9QVurvzuHm2ePc0LeaZuWyYOuytZzq/TZpc=; b=tAHipj922sV5SkIc+fO3CC0L9D93q04kdai9IfYqq/corYneq/8xp8OoyGxTIDl1qmAvU3 lgbi3eYXuLcug/eRGGxUSiJBYZ2yJ9xQt/QV/xFC12g5Y4HUZNiz1sFvp6g2AYivEdqjL0 Gp1onylWWPZShLUMc58SH5/XY+/fFK4yX5AFsLH/6jAatv1nxEIsnCF/Nb3uz+Pt1sfMx0 F9yY9iD7atcJgyNHNmqGhHyIlJyUaO1NLQv1FOk9rMj19btOiwIiua3gjUHB0STIsdqnhB UnFPb3sDCFoO1R7attjsd2jSJWFxKiOsCHvlSRuoCZgPm6yGHApWgMAMzSL+HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3n1XOXAo9QVurvzuHm2ePc0LeaZuWyYOuytZzq/TZpc=; b=XPrjR41ZA0tVxxogxPZ5jNXpfymw7XUMy1TAjTVUKtyBEUpPd3MQLErXD63+WYphYVmJaO 1TrXuLjSUurtxm1btvWfLfQhH9NqEqv0SY9aauKGrbwki39Hv1ODHITBqrLN2LzJHibZJY 6YAiNaw6Ocs1yA97sY+8AiX8Rz/6ygfI89Frup6ARIAlKLlLg6pSkV9q/5y+hf9pvCYXbk 7vfiYM2z+LXmTAt83qbr9b8WGk3vgUO6neeeDULat5iORlbcifD00yenzhCI5SEDyKRE94 65LmSiIFELzw0hMkFGN8luJQOq+u+q/CCE/DXvhpdYKJxeeupFvYuWpgSefPJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704818723; a=rsa-sha256; cv=none; b=sYpdbDzPhU7piZuTrnhSYSG4uuuQUrfX2w/GjoY+732YttXH5mLYufWwKuzlRl5eu4N/dQ Cbhpe3MgCad4e0mB08t3z4v7T1JUQ5ADKDjAJc7zsq0vMCy4L3RoErJ5aCA2AY4eJSXCaj ejNja1I8ROXClyCCk/7ZdW0X/WNA7CxhZs8ljzgfImC/TUTO8AiBoXKuiQhz4lUs7+2akK 9quGJtWApow3jiB1KRyqOYiKeBE89Xl5suyyh9+8fcP0jYF4Y/60BgcT0OGzQ3GQ5fOknr kLZx6+sWA4tQYVfupUbmc5MIUlROIrmmxMtkg1Onyh/9Cb8vf/b5gAjmSOIdsA== 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 4T8cHR16bMzyXk; Tue, 9 Jan 2024 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409GjNhP061266; Tue, 9 Jan 2024 16:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409GjNvW061263; Tue, 9 Jan 2024 16:45:23 GMT (envelope-from git) Date: Tue, 9 Jan 2024 16:45:23 GMT Message-Id: <202401091645.409GjNvW061263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ec1d620c778f - stable/14 - vmrun.sh: add missing options in usage message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec1d620c778f59814020db228d69f66c76389ade Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ec1d620c778f59814020db228d69f66c76389ade commit ec1d620c778f59814020db228d69f66c76389ade Author: Christos Margiolis AuthorDate: 2024-01-02 18:20:08 +0000 Commit: Christos Margiolis CommitDate: 2024-01-09 16:44:47 +0000 vmrun.sh: add missing options in usage message Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43269 (cherry picked from commit 029b10b16a4f1823b2546aa51e8f200ab23e929f) --- share/examples/bhyve/vmrun.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh index ff568b1da71c..d2cc371e472f 100755 --- a/share/examples/bhyve/vmrun.sh +++ b/share/examples/bhyve/vmrun.sh @@ -53,7 +53,7 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ]" \ + echo "Usage: vmrun.sh [-aAEhiTuvw] [-c ] [-C ]" \ "[-d ]" echo " [-e ] [-f ]" \ "[-F ]" @@ -62,6 +62,7 @@ usage() { echo " [-L ]" echo " [-m ]" \ "[-n ]" + echo " [-p ]" echo " [-P ] [-t ] " echo "" echo " -h: display this help message" From nobody Tue Jan 9 16:45:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8cHS3b06z55qnm; Tue, 9 Jan 2024 16:45: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 4T8cHS32Rpz4C6n; Tue, 9 Jan 2024 16:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVE2rVSiAjq2+PSEwhLk44+01Y3RtBh9rbGIRR08qwA=; b=AVCoeqCWm5YJ+m7E/k+fAPaEwU1ERicTsHfeRlXveivvXfyRjuh14QuKmv/flQZsyKo9IH kB42Bm83Tshzjg4oYLP2MwRlIraDnstuMVJ/ViRSYPDPgb4vx61FrcQ9dJ8cZNPCiiqIya q83HzaQ4pAkz4FvgNnyC51J3AKJcFr7rHJnu5TEC1fCCtGA5O5Oa1big7D2HMBctM3aWFf oBrwNYQoi/BLilfOFDn9/PhMDvBuqz84Y2O/xEO6Qqk2ZToHpFo1fR5NJ/DvalgWga4sp/ b1FdafdJxhOKK9kuxm/1JEHaWd46vEFcyG8/hYE1A+02IygICT4fPECHj5yPww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVE2rVSiAjq2+PSEwhLk44+01Y3RtBh9rbGIRR08qwA=; b=Aar9b1W0kKrRLWZ0Ep3h5FobXBtf52k6wq3DloM+/eqAlyMsdLQLHbabaSlf8/uVd8IdVT ZC/R2n513zTn1vMSBMF95gc/Nv26jxEwAwMfAS03DeQNg42YA4uetpN6hVeou914VcO6V7 g7y8SRGt7Jnidh8yO+ZTCCrSao9zxN5ZdwXzEVoUsh6AAaMUG5FYv5IBAL5z3VK50cTseI sDSX7jWV7LUPhYDyU5EfuUWhA6UlDbf4D+mHU1FDP3aG7o9OYKg1jXoIe3/wlUn4+oyDkA rKcGKN0iRdc6J0nWpTrIat7g960ygzY+xtMEG/zUUYzQJDOgY6EBPtJt+NB+XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704818724; a=rsa-sha256; cv=none; b=ATVJt0Ju9xYPmcdJLgys9pSXPnFd6Ty6jqpsx2x+VntTltbAIPNh8czIjbjvoCtzld+vQ5 qgnUQ+7K4SOqecboPHRcZD7zQxbiGyBdfNfsMpEfLG554F2+vO4IGi5UaxUqjfCl9qgRCi 4FV9TPadJcZs+OzqXD2P9Dy8rLDLibpem6byzTsMtqyCY3PCRh2D9GMdIhbxv6g2N7sEji eJY4Bs1zgeLGQXliSkFadhjAFuUw2hHbJ/QitsjiPrM6pvEDZnmXx9mD1sO1s6Tzqysz8d IRAl1k2CGdsKQn+59GVc7sOxhKIa89yv3oGCacNNJwpNGSKmQ1M7EG4AQnkp5Q== 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 4T8cHS26N7zym7; Tue, 9 Jan 2024 16:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409GjOEm061324; Tue, 9 Jan 2024 16:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409GjOjJ061321; Tue, 9 Jan 2024 16:45:24 GMT (envelope-from git) Date: Tue, 9 Jan 2024 16:45:24 GMT Message-Id: <202401091645.409GjOjJ061321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 644327466048 - stable/14 - vmrun.sh: allow device name arguments in pci-passthru option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 644327466048248c848e1f598496692ec741de33 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=644327466048248c848e1f598496692ec741de33 commit 644327466048248c848e1f598496692ec741de33 Author: Christos Margiolis AuthorDate: 2024-01-02 18:20:42 +0000 Commit: Christos Margiolis CommitDate: 2024-01-09 16:45:05 +0000 vmrun.sh: allow device name arguments in pci-passthru option This is more intuitive than having to run `pciconf -l` and figure out the bus/slot/func entry manually. Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43270 (cherry picked from commit 2ee77056d2d4f9d43bd316ce6dc91bf5e4b0848b) --- share/examples/bhyve/vmrun.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh index d2cc371e472f..323d8e22a041 100755 --- a/share/examples/bhyve/vmrun.sh +++ b/share/examples/bhyve/vmrun.sh @@ -62,7 +62,7 @@ usage() { echo " [-L ]" echo " [-m ]" \ "[-n ]" - echo " [-p ]" + echo " [-p ]" echo " [-P ] [-t ] " echo "" echo " -h: display this help message" @@ -87,8 +87,8 @@ usage() { echo " -m: memory size (default: ${DEFAULT_MEMSIZE})" echo " -n: network adapter emulation type" \ "(default: ${DEFAULT_NIC})" - echo " -p: pass-through a host PCI device at bus/slot/func" \ - "(e.g. 10/0/0)" + echo " -p: pass-through a host PCI device (e.g ppt0 or" \ + "bus/slot/func)" echo " -P: UEFI GOP VNC port (default: ${DEFAULT_VNCPORT})" echo " -t: tap device for virtio-net (default: $DEFAULT_TAPDEV)" echo " -T: Enable tablet device (for UEFI GOP)" @@ -351,10 +351,21 @@ while [ 1 ]; do i=0 while [ $i -lt $pass_total ] ; do - eval "pass=\$pass_dev${i}" - devargs="$devargs -s $nextslot:0,passthru,${pass} " - nextslot=$(($nextslot + 1)) - i=$(($i + 1)) + eval "pass=\$pass_dev${i}" + bsfform="$(echo "${pass}" | grep "^[0-9]\+/[0-9]\+/[0-9]\+$")" + if [ -z "${bsfform}" ]; then + bsf="$(pciconf -l "${pass}" 2>/dev/null)" + if [ $? -ne 0 ]; then + errmsg "${pass} is not a host PCI device" + exit 1 + fi + bsf="$(echo "${bsf}" | awk -F: '{print $2"/"$3"/"$4}')" + else + bsf="${pass}" + fi + devargs="$devargs -s $nextslot:0,passthru,${bsf} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) done efiargs="" From nobody Tue Jan 9 16:47:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8cL723WXz55rg1; Tue, 9 Jan 2024 16:47: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 4T8cL71YX6z4Ccm; Tue, 9 Jan 2024 16:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uU/Ql+LUYMko18miyuxYL2zr+CgT4cEPkqS+ZSVlNY=; b=ZW9xMWniFFD3O1xfLbXeXmNIuKP00iUlMW4AAV8jkkGsAhUnhRE7rBPT5+j/V/N3Et7UC8 bCk1X3+KX5Ek3Ef9hCavjcx3B68BUoXpFx2RaS+mXgVLhMztT4YqSHJ4B2Xwl0ju7MWvKx rp3pk4u0P3PZvP+h5o5LjIdj+28B0LkAhvAWhk6iwLbUYyw14f8cSgtQFcH60Ixbm/Ri0z vwxcfXUj1JtvvZnFjfywnI+65I4Udml5TXP7JbmR/IsShPoxGt8L0Pq06vosuBhrudv7nh UYoo6lSLhvVfC8d94UEs5AVxqi5hAFn/irTxDL1CMvoa1b9JpPuhHQGI2R/CzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uU/Ql+LUYMko18miyuxYL2zr+CgT4cEPkqS+ZSVlNY=; b=CgAEE9oVs5rhwPmc//MNgAvznvdY3HCm989dHHJ2Y+xVMp7NNGRIhN2q8uV64GNp5SBK9i 3sENgJfgYVQW042eRVOF33dWHZPUbqCyunqFME7tSSpw4BrgBrvm7qQEfgT2N1SJ2038pt 0sp3sC0FMQZdjuJjyhUUB2rJeeAx87B5Z2jlFIYicB9TDQKUkFUvrkgOZVtC8yMG+TNZj4 oi4KU9CxrJQdyFoS2A9DZFT/hcUGnK3WJIWurMAC6jkPzwsSgLNt1+uvd5RnDiPV8k75zF O7J4RnA3ip05pWrFh+xws6L45lpiXmxUw8lqfLpMAkhxut1EUuzW9VhbnrdFqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704818863; a=rsa-sha256; cv=none; b=nKEZCQsFpffVRNh8QM1AYrSRFgWlIIKAVrVvhApxapvzzpFjTvnDL5NekfwjOQ3fVXlCzt SS9C8S1hKcrobHoqaujEjh/Ge/dqeIZQD5VpPxb4WSk1tQtStlKVDnncMOGLPMAxpoURyc foj6aWFqey/YQ+7L7zy6D34MpwdM69gr2sEvl4YPDaOs19hEu94hr8CYVaxfYPO+stbkIn fut+2qK7YMFn8T2fCjMyvZuJtkzzuw2uISUgxQDeoUQlPng/CCsWByvpq4zZrNTHUwOBCZ VChIGHbhfPwhbB3fbhz9ytSy2fiiQsc5yh7C8Q3sLstSep4amU33BYogAoPoqQ== 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 4T8cL70bmRzycq; Tue, 9 Jan 2024 16:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409Glg8b061820; Tue, 9 Jan 2024 16:47:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409GlgVt061817; Tue, 9 Jan 2024 16:47:42 GMT (envelope-from git) Date: Tue, 9 Jan 2024 16:47:42 GMT Message-Id: <202401091647.409GlgVt061817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4566bff5c90e - stable/13 - vmrun.sh: add missing options in usage message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4566bff5c90e99c872ed2f6e00e46b1bac0caba6 Auto-Submitted: auto-generated The branch stable/13 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4566bff5c90e99c872ed2f6e00e46b1bac0caba6 commit 4566bff5c90e99c872ed2f6e00e46b1bac0caba6 Author: Christos Margiolis AuthorDate: 2024-01-02 18:20:08 +0000 Commit: Christos Margiolis CommitDate: 2024-01-09 16:47:28 +0000 vmrun.sh: add missing options in usage message Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43269 (cherry picked from commit 029b10b16a4f1823b2546aa51e8f200ab23e929f) --- share/examples/bhyve/vmrun.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh index ff568b1da71c..d2cc371e472f 100755 --- a/share/examples/bhyve/vmrun.sh +++ b/share/examples/bhyve/vmrun.sh @@ -53,7 +53,7 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ]" \ + echo "Usage: vmrun.sh [-aAEhiTuvw] [-c ] [-C ]" \ "[-d ]" echo " [-e ] [-f ]" \ "[-F ]" @@ -62,6 +62,7 @@ usage() { echo " [-L ]" echo " [-m ]" \ "[-n ]" + echo " [-p ]" echo " [-P ] [-t ] " echo "" echo " -h: display this help message" From nobody Tue Jan 9 16:47:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8cL83Cqqz55rxF; Tue, 9 Jan 2024 16:47: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 4T8cL82VQ5z4Ccs; Tue, 9 Jan 2024 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t9x56yqE3Zp7BDGnUTLmIXZydxf+uLeoIeUSL6ni5Y=; b=ibEogFFtViXnwesAq11D/S81s7ljSD4P/BqAYYed4i/9Us56UhFkugM+aq5AN/fElAE6rD mw+gLFW2Kd8Mtb4viB0MopUrzoor904fwYvhnZqqyNN1C99FsDyYtpQXVqTkb9juZZB21Y gouXh3puh3P9iH03b9H9K95jx7fw8gcFYPG57N0MdSBek0VZvVyGVVwLL4mVr/+VgTUEBV TBQ9MT7t8puOSgAFfPh/Xc47fYShLTFcHN1JxRRlZha1UbTY9q935chmp+PgNv3FZtSBlW 6wtE6bzBniUcizaJq7PBB8y5AuQFxsrhPaPTY+io245Deq8u6nBRiiztwxD9WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704818864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t9x56yqE3Zp7BDGnUTLmIXZydxf+uLeoIeUSL6ni5Y=; b=imYpkVDN0KfarrGJ303NQFkWCuVYiItJretzvupuY+Ih55aUdqER9RB32hF6zKOKUipw7Y jfEBqc0eulq8tgof9/QE3nTSL/9QgghNpk3K5/jp0A4KPgWK7KHE/jDAIO+V+fokf61cSD 2v/8t4z+V9OJ36XMYJ21nrEO1+x8697gJjGJqwL4U4hhivITApxEBQrCnbiPW7BOEF58kk 8JcPDxRlDrd74OFFycl5vagHGl3rRx0ASsqDSj3sNYgQgPdGZldG5oIE8no7iqesbf6Jt7 g0EX5RmE/HKNOJkj8ec5NyevAbcXswgaKYta3DYEPGKQN/B68zoCXpNafC1qNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704818864; a=rsa-sha256; cv=none; b=qlaDsDITaTUSGlWYyTyBFxYnXYWGFMN2I+LO87hOh6bnsP9Btf/a2JE2GKJitpkCAvzRhN zaH3LdOrDdSsN37W79uZx1WvLJa1VdlO7UlkdO14dH3560Zau1BQwl0fKEIa/agfJbzAH6 f1DHiorTOC6hx0ft71+QZmwWz55F9Xe/F3jPpf+kbVaIjDU4JdBdq5kNCZ4rdU4yp3GSFW sO2WOLyW3A1uleY2NqaX3AObHSGlXszz/NENQKRJOBwa3+8m4vK0OT7ZWPTbUsNuDRczax P89xYb/CINIX/rNBX1+4AQeTQIcXPtUU3vcCopMk9YdpDTIXxc5DRi+KXtvC1Q== 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 4T8cL81Zvjzxyg; Tue, 9 Jan 2024 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409Gli9D061872; Tue, 9 Jan 2024 16:47:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409GliOi061869; Tue, 9 Jan 2024 16:47:44 GMT (envelope-from git) Date: Tue, 9 Jan 2024 16:47:44 GMT Message-Id: <202401091647.409GliOi061869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a00a507e2d5f - stable/13 - vmrun.sh: allow device name arguments in pci-passthru option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a00a507e2d5f4f5de7e7bbafc6df419a1565da24 Auto-Submitted: auto-generated The branch stable/13 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a00a507e2d5f4f5de7e7bbafc6df419a1565da24 commit a00a507e2d5f4f5de7e7bbafc6df419a1565da24 Author: Christos Margiolis AuthorDate: 2024-01-02 18:20:42 +0000 Commit: Christos Margiolis CommitDate: 2024-01-09 16:47:36 +0000 vmrun.sh: allow device name arguments in pci-passthru option This is more intuitive than having to run `pciconf -l` and figure out the bus/slot/func entry manually. Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43270 (cherry picked from commit 2ee77056d2d4f9d43bd316ce6dc91bf5e4b0848b) --- share/examples/bhyve/vmrun.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh index d2cc371e472f..323d8e22a041 100755 --- a/share/examples/bhyve/vmrun.sh +++ b/share/examples/bhyve/vmrun.sh @@ -62,7 +62,7 @@ usage() { echo " [-L ]" echo " [-m ]" \ "[-n ]" - echo " [-p ]" + echo " [-p ]" echo " [-P ] [-t ] " echo "" echo " -h: display this help message" @@ -87,8 +87,8 @@ usage() { echo " -m: memory size (default: ${DEFAULT_MEMSIZE})" echo " -n: network adapter emulation type" \ "(default: ${DEFAULT_NIC})" - echo " -p: pass-through a host PCI device at bus/slot/func" \ - "(e.g. 10/0/0)" + echo " -p: pass-through a host PCI device (e.g ppt0 or" \ + "bus/slot/func)" echo " -P: UEFI GOP VNC port (default: ${DEFAULT_VNCPORT})" echo " -t: tap device for virtio-net (default: $DEFAULT_TAPDEV)" echo " -T: Enable tablet device (for UEFI GOP)" @@ -351,10 +351,21 @@ while [ 1 ]; do i=0 while [ $i -lt $pass_total ] ; do - eval "pass=\$pass_dev${i}" - devargs="$devargs -s $nextslot:0,passthru,${pass} " - nextslot=$(($nextslot + 1)) - i=$(($i + 1)) + eval "pass=\$pass_dev${i}" + bsfform="$(echo "${pass}" | grep "^[0-9]\+/[0-9]\+/[0-9]\+$")" + if [ -z "${bsfform}" ]; then + bsf="$(pciconf -l "${pass}" 2>/dev/null)" + if [ $? -ne 0 ]; then + errmsg "${pass} is not a host PCI device" + exit 1 + fi + bsf="$(echo "${bsf}" | awk -F: '{print $2"/"$3"/"$4}')" + else + bsf="${pass}" + fi + devargs="$devargs -s $nextslot:0,passthru,${bsf} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) done efiargs="" From nobody Tue Jan 9 18:00:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8dxY1tBgz5656m; Tue, 9 Jan 2024 18:00: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 4T8dxY0xxlz4PjC; Tue, 9 Jan 2024 18:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704823201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tHgE46vjHa/Q+mDcVEBVY/AjqcjQZOyDqdK40mw1hHE=; b=gaq0VfCNWBolYogbMgLWjl+PG7SKcWFpp31XLim4vO25GPSbKxA11+EhSJ9uPZ5p0ZcBzh RG6YaBS/n78A9peNl11k4P27v4AjzRajp52mQ5JIROiVuKA/84QNC8xArJD8+OuHeLc9Pm tN46lE0FZn7rm5Nebz5+SUoe3d/FcGhxK84gClkxOT8F+rghvo2NhtL71iFp4QgzbZvdMf rCeiZemfRVTLkIU56WsdYDeHOs8w5YgoZifxTgZ+TteiqHl/HeUnl09BOFQje/q646WKwG XOk0R2NOKj3hJS4cEWlJyPqpeGKtX1pPIGf5RIID2HggXTb71E2QnPTGZcMfSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704823201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tHgE46vjHa/Q+mDcVEBVY/AjqcjQZOyDqdK40mw1hHE=; b=eQtyQF5yBMsKndDXDtjY8aWYKyAGOrZacoU1zClSPhqZQSjU5qyQc5+S0WoHUXXic8BCIE sEUMBvZV4z0IT3N2iHrsVmmPNOsTssZw7QNrZDesM3EozZgiYU700I/P4ddLXsbkZsF1VD PZGhEMrR6cCC1jOrBfJ7sVxFdM8KJStWkJsQ4bhYS99u90Q6NoyDkGmemzwZW2eBlrovoQ XlwGnrTP/FedHea6b4mPuwxzB562Qg34eZBV+iFvxMxbXxbFSv+DmrjEFcUQDe0VWZIDGv VM6iVGrqyb/sBdnSRda34DCq1NrOkCs/iN/tcGiBcpIBlOY3XU6/YNB5yXBU1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704823201; a=rsa-sha256; cv=none; b=SHUhjzPY99AJ/ay/sxVQ1vhfpthMDDNJ2LRQimGMZE3Mw5VqNi9lUZ1iqv3VXV00ITKRaE 1tS4gfWkEQdalMe8MDmDrF/51KR3o+P/V8ObXje+pFgwW7zDTCgaEWJrwKM10IxFURUOhQ pootctciSKpUc3dsPXXAMyyeR21kvl1ej9jWuKE1xiVo988TYDn0haxF/GyKj9YttUR24+ YzHTIMutr1jVAlkbMABDLEBmexx4UdLV+QaJ3SrbtXQun64Ls2j1fWVyqWUOvO8X5P25oP gly2GnFYvCq6QlJqSg40gS+0iPSDZC8KLPfvMLofVIkBUsc2OkahLAeSqdIEZw== 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 4T8dxY03rqz10yT; Tue, 9 Jan 2024 18:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409I00HY082190; Tue, 9 Jan 2024 18:00:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409I00Dm082169; Tue, 9 Jan 2024 18:00:00 GMT (envelope-from git) Date: Tue, 9 Jan 2024 18:00:00 GMT Message-Id: <202401091800.409I00Dm082169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6cba7aec21bc - stable/13 - linuxkpi: Handle direct-mapped addresses in linux_free_kmem() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cba7aec21bcd957478a987f9391fd33a4babdac Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6cba7aec21bcd957478a987f9391fd33a4babdac commit 6cba7aec21bcd957478a987f9391fd33a4babdac Author: Mark Johnston AuthorDate: 2023-10-17 14:26:18 +0000 Commit: Mark Johnston CommitDate: 2024-01-09 17:59:49 +0000 linuxkpi: Handle direct-mapped addresses in linux_free_kmem() See the analysis in PR 271333. It is possible for driver code to allocate a page, store its address as returned by page_address(), then call free_page() on that address. On most systems that'll result in the LinuxKPI calling kmem_free() with a direct-mapped address, which is not legal. Fix the problem by making linux_free_kmem() check the address to see whether it's direct-mapped or not, and handling it appropriately. PR: 271333, 274515 Reviewed by: hselasky, bz Tested by: trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40028 (cherry picked from commit 6223d0b67af923f53d962a9bf594dc37004dffe8) --- sys/compat/linuxkpi/common/src/linux_page.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index d59435ba934f..e732d6ff5047 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -145,6 +145,14 @@ linux_alloc_pages(gfp_t flags, unsigned int order) return (page); } +static void +_linux_free_kmem(vm_offset_t addr, unsigned int order) +{ + size_t size = ((size_t)PAGE_SIZE) << order; + + kmem_free(addr, size); +} + void linux_free_pages(struct page *page, unsigned int order) { @@ -163,7 +171,7 @@ linux_free_pages(struct page *page, unsigned int order) vaddr = (vm_offset_t)page_address(page); - linux_free_kmem(vaddr, order); + _linux_free_kmem(vaddr, order); } } @@ -185,9 +193,17 @@ linux_alloc_kmem(gfp_t flags, unsigned int order) void linux_free_kmem(vm_offset_t addr, unsigned int order) { - size_t size = ((size_t)PAGE_SIZE) << order; + KASSERT((addr & PAGE_MASK) == 0, + ("%s: addr %p is not page aligned", __func__, (void *)addr)); - kmem_free(addr, size); + if (addr >= VM_MIN_KERNEL_ADDRESS && addr < VM_MAX_KERNEL_ADDRESS) { + _linux_free_kmem(addr, order); + } else { + vm_page_t page; + + page = PHYS_TO_VM_PAGE(DMAP_TO_PHYS(addr)); + linux_free_pages(page, order); + } } static int From nobody Wed Jan 10 03:07:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8t5m07YSz55R6C; Wed, 10 Jan 2024 03:07: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 4T8t5l71dkz4vN1; Wed, 10 Jan 2024 03:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704856075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1gt3bcNQNS1RbOagrsdIgJdHuAVfiGXxSRs22GQKOE=; b=AB5dJxCTZcrpmOMhY0/Hv3ibqSjNWZf1dVerfrz7EjAuPyHvN9eYrLERYKM/P2ePswKx6P 4oBx+28Bu5Uqbd2l/JAredp/rK0tpnnx5cZxEcH/o0AtozvYQ9ej6mKpwQoPikffvFX0I5 EcnIrw9n7zB25eBTRymaa8AkPmu4AgaEsXn+HMrGbRCvdNjXOHz43zfv2MgNazPjFHuiFJ isYkSKUlIrZDyTwR0kJQQu4RznJJSzeIqqnNHT9lJ68ZuOeL5AVr/TsmJId82E6/vlhZiP C7DpEBxAZIyqZ+nMdMxytaI9cR0IJGx1Ybjd3BuSl+4JUqcTGvTQf6myUEBpBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704856075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1gt3bcNQNS1RbOagrsdIgJdHuAVfiGXxSRs22GQKOE=; b=PaJb7COoXuVskGKscVhgrkziz5aMApVzDiNGpja3s1Ghw8sIDxKHSOn2Gw6lm6MrM9cqC1 y4QtxAj4XPCMipHrE8wuCYQZDTT2lBjcNoWKmRFoMEISe9CNVBBim2Wvb3CMuWY+UJF2WL jAIG5Zt/xG3A3GPSUkawT7eH6WABd7EF/a/AuFfg9KYRX55xhrIOhIE6ImpELK+odQpPIo iDop0g/JG/teBaD3xmEk6uTLVD1lhzKCAr1SaDa7qNOzNowxUJl+pWxmZnr9NqOEr99uFc k9T/PmrDrqWeaO1XI4HQT2SaPSpTJ9fYxmdBgUr7OX/ZPVlFKH1mGymfNX/w7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704856075; a=rsa-sha256; cv=none; b=XDLhUdbVrQFAeW8tklGpwP9WwCvFEUFO/kY+v5hu+n5SC4d9qogUybQHUDXx1LbUDEBa7U y5R1l9z8jBqrq/KIZnmyVHRLU/v+LlGZztbIHNmLUHRDwVSSu/Vkc/yJpb0IyldiHE/Dwa 13wYd2CUf4+rq+tipceZGAIeTkuA9XoaeJlxnX69rzJLU3MR7mXYCd9OzynUwCyICAfReR YJpmrRFKCvYkn7bZftO4bHaGGKAwSWZDjr71UHavoKs9ET8vgx3VcJrjpw6UzDyqwYbVT9 LaXBXFdATO9cjQNwYv8ud7v1vE8MBxTuvHu4ZqdPQniRAqeQBSJRKlK8y8B00g== 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 4T8t5l652XzJ5R; Wed, 10 Jan 2024 03:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40A37tnX007888; Wed, 10 Jan 2024 03:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40A37tjG007885; Wed, 10 Jan 2024 03:07:55 GMT (envelope-from git) Date: Wed, 10 Jan 2024 03:07:55 GMT Message-Id: <202401100307.40A37tjG007885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 677a7402cea4 - stable/13 - sys/*/conf/*, docs: fix links to handbook List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 677a7402cea46eb253a241b443471ab072e2b6a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=677a7402cea46eb253a241b443471ab072e2b6a7 commit 677a7402cea46eb253a241b443471ab072e2b6a7 Author: Ceri Davies AuthorDate: 2021-05-20 08:26:02 +0000 Commit: Ed Maste CommitDate: 2024-01-10 03:07:46 +0000 sys/*/conf/*, docs: fix links to handbook While here, fix all links to older en_US.ISO8859-1 documentation in the src/ tree. PR: 255026 Reported by: Michael Büker Reviewed by: dbaio Differential Revision: https://reviews.freebsd.org/D30265 (cherry picked from commit c1a148873d6488f1dac1cfb207a5927cef89888e) --- bin/timeout/timeout.1 | 4 ++-- release/Makefile | 1 - share/man/man4/mac.4 | 2 +- share/man/man7/release.7 | 4 ++-- share/man/man9/mac.9 | 4 ++-- share/man/man9/pci.9 | 4 ++-- sys/amd64/conf/GENERIC | 2 +- sys/amd64/conf/GENERIC-KCSAN | 2 +- sys/amd64/conf/MINIMAL | 2 +- sys/arm/conf/ALPINE | 2 +- sys/arm/conf/APALIS-IMX6 | 2 +- sys/arm/conf/ARMADAXP | 2 +- sys/arm/conf/COLIBRI-VF50 | 2 +- sys/arm/conf/COSMIC | 2 +- sys/arm/conf/EFIKA_MX | 2 +- sys/arm/conf/GENERIC | 2 +- sys/arm/conf/IMX53 | 2 +- sys/arm/conf/IMX6 | 2 +- sys/arm/conf/JETSON-TK1 | 2 +- sys/arm/conf/QUARTZ | 2 +- sys/arm/conf/RPI-B | 2 +- sys/arm/conf/SOCDK | 2 +- sys/arm/conf/SOCFPGA | 2 +- sys/arm/conf/SOCKIT | 2 +- sys/arm/conf/SOCKIT-BERI | 2 +- sys/arm/conf/TEGRA124 | 2 +- sys/arm/conf/VERSATILEPB | 2 +- sys/arm/conf/VYBRID | 2 +- sys/arm/conf/ZEDBOARD | 2 +- sys/arm64/conf/GENERIC | 2 +- sys/arm64/conf/GENERIC-UP | 2 +- sys/contrib/zstd/FREEBSD-upgrade | 2 +- sys/i386/conf/GENERIC | 2 +- sys/i386/conf/MINIMAL | 2 +- sys/mips/conf/ERL | 2 +- sys/mips/conf/OCTEON1 | 2 +- sys/mips/conf/XLP64 | 2 +- sys/mips/conf/XLPN32 | 2 +- sys/powerpc/conf/GENERIC | 2 +- sys/powerpc/conf/GENERIC64 | 2 +- sys/powerpc/conf/GENERIC64LE | 2 +- sys/riscv/conf/GENERIC | 2 +- usr.bin/fortune/datfiles/freebsd-tips | 3 +-- usr.sbin/lpr/lpd/printcap | 2 +- usr.sbin/mergemaster/mergemaster.8 | 5 ++--- usr.sbin/ppp/ppp.8 | 8 +++----- 46 files changed, 52 insertions(+), 57 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index e3be41f884dc..921fe1160023 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -178,7 +178,7 @@ $ echo $? .Pp Try to .Xr fetch 1 -the single page version of the +the PDF version of the .Fx Handbook. Send a @@ -188,7 +188,7 @@ signal after 1 minute and send a signal 5 seconds later if the process refuses to stop: .Bd -literal -offset indent $ timeout -k 5s 1m fetch \\ -> https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html +> https://download.freebsd.org/ftp/doc/en/books/handbook/book.pdf .Ed .Sh SEE ALSO .Xr kill 1 , diff --git a/release/Makefile b/release/Makefile index 212d32623fb3..7e6bc566961c 100644 --- a/release/Makefile +++ b/release/Makefile @@ -35,7 +35,6 @@ WORLDDIR?= ${.CURDIR}/.. PORTSDIR?= /usr/ports -RELNOTES_LANG?= en_US.ISO8859-1 .if !defined(TARGET) || empty(TARGET) TARGET= ${MACHINE} diff --git a/share/man/man4/mac.4 b/share/man/man4/mac.4 index fe19b36a8306..4a4081d899f0 100644 --- a/share/man/man4/mac.4 +++ b/share/man/man4/mac.4 @@ -221,7 +221,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U https://docs.FreeBSD.org/en/books/handbook/mac/ .Re .Sh HISTORY The diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 548ba540f6c0..78cac0dde34e 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -719,11 +719,11 @@ variable in .Xr sysctl 8 .Rs .%T "FreeBSD Release Engineering" -.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/freebsd-releng/ +.%U https://docs.freebsd.org/en/articles/freebsd-releng/ .Re .Rs .%T "FreeBSD Developers' Handbook" -.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ +.%U https://docs.freebsd.org/en/books/developers-handbook/ .Re .Sh HISTORY .Fx diff --git a/share/man/man9/mac.9 b/share/man/man9/mac.9 index d5be03949e9b..661c46569bc0 100644 --- a/share/man/man9/mac.9 +++ b/share/man/man9/mac.9 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 25, 2015 +.Dd May 20, 2021 .Dt MAC 9 .Os .Sh NAME @@ -155,7 +155,7 @@ for information on the MAC Framework APIs. .Xr VFS 9 .Rs .%T "The FreeBSD Architecture Handbook" -.%U "https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/arch-handbook/" +.%U "https://docs.freebsd.org/en/books/arch-handbook/" .Re .Sh HISTORY The diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9 index da7981cc00a5..3c3e54bf8760 100644 --- a/share/man/man9/pci.9 +++ b/share/man/man9/pci.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 15, 2017 +.Dd May 20, 2021 .Dt PCI 9 .Os .Sh NAME @@ -1102,7 +1102,7 @@ is unattached but with valid instance variables. .Rs .%B FreeBSD Developers' Handbook .%T NewBus -.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ +.%U https://docs.freebsd.org/en/books/developers-handbook/ .Re .Rs .%A Shanley diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 57254059ca1c..28d2f29a7876 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/amd64/conf/GENERIC-KCSAN b/sys/amd64/conf/GENERIC-KCSAN index f38d695c5aaf..a0970f2a46a4 100644 --- a/sys/amd64/conf/GENERIC-KCSAN +++ b/sys/amd64/conf/GENERIC-KCSAN @@ -12,7 +12,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index b5b821e1f5c6..9af1b14f5733 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -14,7 +14,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/ALPINE b/sys/arm/conf/ALPINE index 7cc93f994813..6937a790a8c6 100644 --- a/sys/arm/conf/ALPINE +++ b/sys/arm/conf/ALPINE @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/APALIS-IMX6 b/sys/arm/conf/APALIS-IMX6 index fa215f0c0660..5507699f80cd 100644 --- a/sys/arm/conf/APALIS-IMX6 +++ b/sys/arm/conf/APALIS-IMX6 @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/ARMADAXP b/sys/arm/conf/ARMADAXP index e74fb588df12..e198651e69b3 100644 --- a/sys/arm/conf/ARMADAXP +++ b/sys/arm/conf/ARMADAXP @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/COLIBRI-VF50 b/sys/arm/conf/COLIBRI-VF50 index 3b55affb0ff5..6f3d4b3259c2 100644 --- a/sys/arm/conf/COLIBRI-VF50 +++ b/sys/arm/conf/COLIBRI-VF50 @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/COSMIC b/sys/arm/conf/COSMIC index efb17ccfe539..047e112fcb58 100644 --- a/sys/arm/conf/COSMIC +++ b/sys/arm/conf/COSMIC @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX index c81bed74a4f6..b7180da50314 100644 --- a/sys/arm/conf/EFIKA_MX +++ b/sys/arm/conf/EFIKA_MX @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index d21a45d77c33..be9ebe344d62 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/IMX53 b/sys/arm/conf/IMX53 index 420478e42a17..b482e561226e 100644 --- a/sys/arm/conf/IMX53 +++ b/sys/arm/conf/IMX53 @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/IMX6 b/sys/arm/conf/IMX6 index 5ef7149bc72a..6fe75f75b1ec 100644 --- a/sys/arm/conf/IMX6 +++ b/sys/arm/conf/IMX6 @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/JETSON-TK1 b/sys/arm/conf/JETSON-TK1 index 06f753850e2a..bc57d67e59ad 100644 --- a/sys/arm/conf/JETSON-TK1 +++ b/sys/arm/conf/JETSON-TK1 @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/QUARTZ b/sys/arm/conf/QUARTZ index 85dcf42ad968..2b247be5defa 100644 --- a/sys/arm/conf/QUARTZ +++ b/sys/arm/conf/QUARTZ @@ -3,7 +3,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index a03f7af6c6ef..3f2b9eba510b 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/SOCDK b/sys/arm/conf/SOCDK index 40776eb0b807..c0804a2c13e5 100644 --- a/sys/arm/conf/SOCDK +++ b/sys/arm/conf/SOCDK @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/SOCFPGA b/sys/arm/conf/SOCFPGA index 7c7229a461a4..9fbd21b6e6ef 100644 --- a/sys/arm/conf/SOCFPGA +++ b/sys/arm/conf/SOCFPGA @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/SOCKIT b/sys/arm/conf/SOCKIT index 423e633a724b..0dc59480aff5 100644 --- a/sys/arm/conf/SOCKIT +++ b/sys/arm/conf/SOCKIT @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/SOCKIT-BERI b/sys/arm/conf/SOCKIT-BERI index 776f9cb4b32d..e85d1b13e817 100644 --- a/sys/arm/conf/SOCKIT-BERI +++ b/sys/arm/conf/SOCKIT-BERI @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index c800746fb45c..dc733facc39b 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/VERSATILEPB b/sys/arm/conf/VERSATILEPB index c51e7768c2fb..0e24b2472583 100644 --- a/sys/arm/conf/VERSATILEPB +++ b/sys/arm/conf/VERSATILEPB @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/VYBRID b/sys/arm/conf/VYBRID index 026600440247..bee77fcb6559 100644 --- a/sys/arm/conf/VYBRID +++ b/sys/arm/conf/VYBRID @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm/conf/ZEDBOARD b/sys/arm/conf/ZEDBOARD index de3a55909694..29f28a0cbf35 100644 --- a/sys/arm/conf/ZEDBOARD +++ b/sys/arm/conf/ZEDBOARD @@ -5,7 +5,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index a1fa345d4918..41f9ee5ae311 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/arm64/conf/GENERIC-UP b/sys/arm64/conf/GENERIC-UP index 76d73fae89c0..f99a4ce4ddc9 100644 --- a/sys/arm64/conf/GENERIC-UP +++ b/sys/arm64/conf/GENERIC-UP @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/contrib/zstd/FREEBSD-upgrade b/sys/contrib/zstd/FREEBSD-upgrade index dfcad88572b2..fb46da059004 100644 --- a/sys/contrib/zstd/FREEBSD-upgrade +++ b/sys/contrib/zstd/FREEBSD-upgrade @@ -11,4 +11,4 @@ we don't want. Please find instructions for importing new releases and merging to HEAD here: -https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html#idp45937784 +https://docs.freebsd.org/en/articles/committers-guide/#vendor-import-git diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index d8ebd111cd1d..5f3824a9b611 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index ff41e634b048..a5103dcf559b 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -18,7 +18,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/mips/conf/ERL b/sys/mips/conf/ERL index 28db1ea23326..fa468ae1a1ac 100644 --- a/sys/mips/conf/ERL +++ b/sys/mips/conf/ERL @@ -5,7 +5,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/mips/conf/OCTEON1 b/sys/mips/conf/OCTEON1 index e7a5ee3552d6..8ef8c7ac613b 100644 --- a/sys/mips/conf/OCTEON1 +++ b/sys/mips/conf/OCTEON1 @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/mips/conf/XLP64 b/sys/mips/conf/XLP64 index 883f2856dc54..140faaae647b 100644 --- a/sys/mips/conf/XLP64 +++ b/sys/mips/conf/XLP64 @@ -3,7 +3,7 @@ # For more information on this file, please read the handbook section on # Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/mips/conf/XLPN32 b/sys/mips/conf/XLPN32 index c8380df242d1..58eabe500ba8 100644 --- a/sys/mips/conf/XLPN32 +++ b/sys/mips/conf/XLPN32 @@ -3,7 +3,7 @@ # For more information on this file, please read the handbook section on # Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index bf7423488bc2..95fdc72571a3 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the handbook section on # Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 672aa92b4cc0..0bce690358a8 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -4,7 +4,7 @@ # For more information on this file, please read the handbook section on # Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index c43e644594ea..34751066f356 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -4,7 +4,7 @@ # For more information on this file, please read the handbook section on # Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index a4824ae3a02f..db6ae4b5b1a3 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -4,7 +4,7 @@ # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index d1edb8688f23..489926778233 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -64,8 +64,7 @@ If you need a reminder to leave your terminal, type "leave +hhmm" where % If you need to ask a question on the FreeBSD-questions mailing list then - https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/\ - freebsd-questions/index.html + https://docs.freebsd.org/en/articles/freebsd-questions contains lots of useful advice to help you get the best results. % diff --git a/usr.sbin/lpr/lpd/printcap b/usr.sbin/lpr/lpd/printcap index 96eb0fccff0e..193f872763ab 100644 --- a/usr.sbin/lpr/lpd/printcap +++ b/usr.sbin/lpr/lpd/printcap @@ -21,7 +21,7 @@ # # Do also refer to the "printing" section of the handbook. # -# https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing.html +# https://docs.freebsd.org/en/books/handbook/printing/ # # A local copy can be found under # diff --git a/usr.sbin/mergemaster/mergemaster.8 b/usr.sbin/mergemaster/mergemaster.8 index 203fdf474518..695f1bba3474 100644 --- a/usr.sbin/mergemaster/mergemaster.8 +++ b/usr.sbin/mergemaster/mergemaster.8 @@ -467,9 +467,8 @@ comparison, use: .Pp .Pa /usr/src/etc/Makefile .Rs -.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html -.%T The Cutting Edge (using make world) -.%A Nik Clayton +.%U https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld +.%T The FreeBSD Handbook .Re .Sh HISTORY The diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8 index 9c7a7bc69519..ff7d0d3dea7b 100644 --- a/usr.sbin/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 11, 2020 +.Dd May 20, 2021 .Dt PPP 8 .Os .Sh NAME @@ -5958,12 +5958,10 @@ and .Dq show ?\& to get online information about what is available. .It -The following URLs contain useful information: +The following URL contains useful information: .Bl -bullet -compact .It -https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/faq/ppp.html -.It -https://www.FreeBSD.org/doc/handbook/userppp.html +https://docs.freebsd.org/en/books/handbook/ppp-and-slip/ .El .El .Sh FILES From nobody Wed Jan 10 14:20:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T991x3WdDz573xj; Wed, 10 Jan 2024 14:20: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 4T991x33yXz4q51; Wed, 10 Jan 2024 14:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704896437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IrFvxwzz1RL8phAsoMV08/53CnzCcGYjdgM9Vb8HcHc=; b=p59wHFG+3JfRObubGnbIDrQNAD0bFJD5LQ7KAVkzP4h5JAaJo5dlRMaAEdBu7bMXtJ3Gkv 0wnKz6TGWwdb7Hj8Nd01ifv8VjaGU4Udjug6Faz+a25MSCCiHJksMAS4deKxnGXRooX++g LAn9b9e89dY/3trOctlxEqAcMK2VLQyH5FiRzpu3LY6G7FjMIG8sSjVT7flm/OQislfOBn QKJnLSUBjrUbXQICUfjYxgJqjMwh5Y1anMQmgXw9zLnaJrzWjVUUDzKW6oAmmsSnu2fkoL ibyjR62P7hSrLM4Q8evNvopWFw26Xfu7Av2kGHkl3MIS8zRWejCkyR9bX6C6Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704896437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IrFvxwzz1RL8phAsoMV08/53CnzCcGYjdgM9Vb8HcHc=; b=xjlu7XQ9dAWsfB7w/Mbm8t+TmJX5xCqIlLiSAmbMzirDDe+de1nWZTd81sdkdlJJt/YLiR 1Cskoq+Q9V6ycUdc2A0V33GC0/pxdOA3LNM4M6IlKDuhWrzylR0R0hlVdpUNamfUPv7qAJ Yj+c87eb+EWnDrM2ODtLV/coqJz3IFcaZCnDsLlohgnc8hZFr7rC3z4ii6icb7X1V1kM96 kOHRT4vsV4/1fYM0Ps/NgBI4HauKEczm0S1zqhbp+8X1/f4sjBB/OQNB4D4QWCRF0Q6huJ yJYvf607dZuDkjXAWvBrFgUIfVBpvKm0S+mlUDVHdbuVjLQjJO860eNnlnPfmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704896437; a=rsa-sha256; cv=none; b=bdC+YP3oZR+jdWBDm+ZpH0dNfPwxIY9MgBZXbOEzu43GTK44IXk8rQrjZPsaSAVIm5gEej 9y1h8z5RGIPvb9rpMe63M+UbNt5Cptab9/NL77xNweTZODSxdaOcZRM8KyzQ2ZB56ci6P+ gFdmMVh2nnHNn01PO8HPIsKer/nj1OJA/m6gjuMn1seFPN01StbgEADmCHXcVJB5W2ItBZ DeOJxn4hlcqLUOBYIHucwcnIoUqFvGBDQ60d7/3wcLgVjE3A9s579npBhkei1EmHep6wg9 fwH45/3gG7yzrlOYFWAXxcnKgcdvUDfhxxVf9b+shxE14QIbulXA1PDzHjsqTQ== 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 4T991x27nvzfDF; Wed, 10 Jan 2024 14:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40AEKbRD041711; Wed, 10 Jan 2024 14:20:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40AEKbmc041708; Wed, 10 Jan 2024 14:20:37 GMT (envelope-from git) Date: Wed, 10 Jan 2024 14:20:37 GMT Message-Id: <202401101420.40AEKbmc041708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1165116ada35 - stable/13 - IPv6: fix problem with duplicate port assignment with v4-mapped addrs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1165116ada353364e1d1570d1d23bb3d18d28394 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1165116ada353364e1d1570d1d23bb3d18d28394 commit 1165116ada353364e1d1570d1d23bb3d18d28394 Author: Mike Karels AuthorDate: 2022-07-29 14:23:23 +0000 Commit: Ed Maste CommitDate: 2024-01-10 13:50:55 +0000 IPv6: fix problem with duplicate port assignment with v4-mapped addrs In in_pcb_lport_dest(), if an IPv6 socket does not match any other IPv6 socket using in6_pcblookup_local(), and if the socket can also connect to IPv4 (the INP_IPV4 vflag is set), check for IPv4 matches as well. Otherwise, we can allocate a port that is used by an IPv4 socket (possibly one created from IPv6 via the same procedure), and then connect() can fail with EADDRINUSE, when it could have succeeded if the bound port was not in use. PR: 265064 Submitted by: firk at cantconnect.ru (with modifications) Reviewed by: bz, melifaro Differential Revision: https://reviews.freebsd.org/D36012 (cherry picked from commit 637f317c6d9c0c689677f499fc78ac545b192071) --- sys/netinet/in_pcb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 4c4f4050595a..61079db56bdb 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -758,7 +758,7 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, } #ifdef INET - laddr.s_addr = INADDR_ANY; + laddr.s_addr = INADDR_ANY; /* used by INET6+INET below too */ if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { if (lsa != NULL) laddr = ((struct sockaddr_in *)lsa)->sin_addr; @@ -809,9 +809,16 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, #endif } else { #ifdef INET6 - if ((inp->inp_vflag & INP_IPV6) != 0) + if ((inp->inp_vflag & INP_IPV6) != 0) { tmpinp = in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, lport, lookupflags, cred); +#ifdef INET + if (tmpinp == NULL && + (inp->inp_vflag & INP_IPV4)) + tmpinp = in_pcblookup_local(pcbinfo, + laddr, lport, lookupflags, cred); +#endif + } #endif #if defined(INET) && defined(INET6) else From nobody Wed Jan 10 18:44:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9GtZ1gDRz55ckw; Wed, 10 Jan 2024 18:44: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 4T9GtZ15KBz4NPk; Wed, 10 Jan 2024 18:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704912278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+FTdJaAIp8lcgQDof/17jumRgOh9ZglPDie4vMzO2kw=; b=gnnl5QyjtFtrpjiU1FE9dzJ9I2Z6ygjH4J6s9u+TOMfAhh2BcqszqDctJ1Io/HYnFJoQ5c FpyiHKWPYmlxOqMMEpz81RqbDAVUXxL9fu/GLFOA3vy0QTVUjmOEn8Z/i4UbQ4Qo4ArSse LUK9nALF5glrdrxFGUZLiLUxdiqitq0h2xLypgUkI3zfv9h3cTXi9hOPQISdhf8tOuAnTz hAwPAjggzshyvOlKw51uGo+byEKWx9gtmb1xFdB4GGGOx8lg++DDJEHCBnvexhO4P5rFoe MVTHNCYTBAfseWes4iGcuk687f16PEZrpvXDK5KRgpkOlxlKwntvZpiwcTYESw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704912278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+FTdJaAIp8lcgQDof/17jumRgOh9ZglPDie4vMzO2kw=; b=l1skBrvg7N7Rw0trMyQw6mfJHQLPACyAQZbgDijuDIBE2xQEo6s2XmxtrJOYCf69CWb0BS FxB1iTZEURF+FhR7XuK9cK8c3Krb2BNAjhpnrADzbdpQeAUJQyB63dkQTPM8GNroCSuGg5 qDGsW3xvlLkB5ugQcnrXqDKVTxn5IIrd6J7n57+dYRtzXXgKgk9caan6RE0I0pJqT00+2/ OQHXZvBSBMvCkQzDcbKx4oJU0g8kf0AJYtmlERPjgG25Jbg05+1lcUMO2X3MLqGX9jQgyY xdAPz862khjbfkbapBdcRIJr2XIREIFEqto2APp4LDTkSPYYohyGcb5O3WJ89A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704912278; a=rsa-sha256; cv=none; b=ZC6H2v3cpXLx4rSO8sbWY5vRvTpAFOafzKXoE7Tfk1236RbCvp7ipCMEeoEhYJODK3dAvC vtmy3fzu+x5WOGcDYxVjrGuwRHm2LvdkoccxyPzlPcY5ypavvtmLiHBwhMpf4qItZDE9pa nIvgDrVOQFVt7tQ63VG4+rYJMhQ/hvUrgU1blx4vkCYTZ9TMh3rPXoBeD4YHu5QDm3+qfs wzO9UJH66WdiFRaveyRqgbgHsOuGweWk/NsvmN8nQhiff53xSDz8jctP5KQxRcNLtw1dvl FqI6EsFJ1vM0QF0lNX+Qr7h6dAeFNLrA4S8o6mRjpp64pFWtXrGv+arXpNRYmA== 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 4T9GtZ05SWzmtW; Wed, 10 Jan 2024 18:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40AIib3s093673; Wed, 10 Jan 2024 18:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40AIibCk093670; Wed, 10 Jan 2024 18:44:37 GMT (envelope-from git) Date: Wed, 10 Jan 2024 18:44:37 GMT Message-Id: <202401101844.40AIibCk093670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3159e314f194 - stable/14 - Fix udp IPv4-mapped address List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3159e314f194bd8db98dd4516f46350b2fbe44f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3159e314f194bd8db98dd4516f46350b2fbe44f0 commit 3159e314f194bd8db98dd4516f46350b2fbe44f0 Author: Richard Kümmel AuthorDate: 2023-12-15 11:49:45 +0000 Commit: Ed Maste CommitDate: 2024-01-10 16:37:44 +0000 Fix udp IPv4-mapped address Do not use the cached route if the destination isn't the same. This fix a problem where an UDP packet will be sent via the wrong route and interface if a previous one was sent via them. PR: 275774 Reviewed by: glebius, tuexen Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 7df9da47e8f04267330e1baa751f07c0c4aaf2ac) --- sys/netinet/udp_usrreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 708a4e6b730d..75dec9d5f5aa 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1055,6 +1055,7 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, uint16_t cscov = 0; uint32_t flowid = 0; uint8_t flowtype = M_HASHTYPE_NONE; + bool use_cached_route; inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_send: inp == NULL")); @@ -1091,9 +1092,8 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, * We will need network epoch in either case, to safely lookup into * pcb hash. */ - if (sin == NULL || - (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) || - (flags & PRUS_IPV6) != 0) + use_cached_route = sin == NULL || (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0); + if (use_cached_route || (flags & PRUS_IPV6) != 0) INP_WLOCK(inp); else INP_RLOCK(inp); @@ -1443,7 +1443,7 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, else UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); error = ip_output(m, inp->inp_options, - INP_WLOCKED(inp) ? &inp->inp_route : NULL, ipflags, + use_cached_route ? &inp->inp_route : NULL, ipflags, inp->inp_moptions, inp); INP_UNLOCK(inp); NET_EPOCH_EXIT(et); From nobody Wed Jan 10 18:51:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9H2y0P0fz55dPK; Wed, 10 Jan 2024 18:51: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 4T9H2y06Pfz4PhT; Wed, 10 Jan 2024 18:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704912714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kySqlvO/+KKFSYAWLysr8qPWNYW7rqZofFVH0mToQOw=; b=kWEjJ9zu/x19wQMyalox5Alt52zc/tV/NuP9PlOcKhdmnH5fPfUaMadOd1LG1TrYVLHQRJ BBEUqtxxtOQfSjooBgVu/IOx0WqujN/Za4SZnXm0CQhCpaauHY8bKxb48bVcwokHoT2Ajv WXIZGYUXdbAWwzU4df/FuvyXjHo1h0VcJzJTqmcBUfCGz9wnDOyJN/YEJB4ATBjI2cpDea bOfbLo2p3FzykYE/HfHFenX1+VcPYSwYMZNydqNdpN2xpa7PZYj/NVH/sWRlLJgYg7I/kP pJmBEP7LM8rjIymQKP66SQuzKogsJNuEtBClcVcRpGlGZr8iXttIL+Bjvmkn5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704912714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kySqlvO/+KKFSYAWLysr8qPWNYW7rqZofFVH0mToQOw=; b=Pqx77iYIKvPKYY8MmKpuLQ/Mu1MhcYVR6vgRckjbbxgb0ssR7hJfJRiy04PyzC+CqoaZx0 p6imUo8a3htnQU7knam8qoJpugVtdkhw8kKjylEg6JYRLBfJJSxl0VvkKGlO3WvR+YsdRx lLlstpL1se/BXYpA9a3N0BWVNYA95J/nr/4/6rXWNqw0+hwzRAOqfpPgMF9bpSeinBnuy2 h1pXGD6Z2H/lkX4wv3NfpVKJhPSBTHlYk7GWDvOyoKw0Hw7Pgf3QK/anHZwUTkoxAAXFYz nP0dvMyFldahz13eGjCS/MIQjj8pCwsjD2PAlfD6EgYMe9626cjaaL+k7K6Z/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704912714; a=rsa-sha256; cv=none; b=pj1k8H9n22Y5C33xbtLD67pGSN6irQGNw1f35CZTeMSLqVWMSvvH5h+MrGhNmtjSzrPx3x 9nxWcMCHFjGVFzIxhaJ/L4EWhtsijHBIjN8Vv/2JpTfbJUmMrIz7b8VaTR5gL/FbrS4eS0 MLsFi7QLhspr12+VuXJdCWlzg6OniuMusmod5ysL5UOx1AII8gsHIVnQEhPC50EKKOiCb+ m5TApYlm11xkg1BPIgKEmySqAKvQNzXMSjopeABRVjVP5yG77GMzTN1E+ZRVvV8jJDgY8/ 0mFd3esgiLXx9NSWjVf+TJBIUYXbCiCfkHIDdZY+R8+iefkX3AhOwBZVA4dERQ== 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 4T9H2x6Dz6zmrJ; Wed, 10 Jan 2024 18:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40AIprp8010118; Wed, 10 Jan 2024 18:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40AIprr2010115; Wed, 10 Jan 2024 18:51:53 GMT (envelope-from git) Date: Wed, 10 Jan 2024 18:51:53 GMT Message-Id: <202401101851.40AIprr2010115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 38fe4bc08264 - stable/14 - dtc: Sync with upstream commit 26a0fe5 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 38fe4bc08264652cd33964ba6042bd4c0faf6b76 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=38fe4bc08264652cd33964ba6042bd4c0faf6b76 commit 38fe4bc08264652cd33964ba6042bd4c0faf6b76 Author: Jose Luis Duran AuthorDate: 2023-09-26 16:37:52 +0000 Commit: Ed Maste CommitDate: 2024-01-10 18:50:53 +0000 dtc: Sync with upstream commit 26a0fe5 - 0206c0f ("Handle top-level /delete-node/ directives.") - d612a9e ("Remove C++11 standard constrain") - Remove extra white lines after the $FreeBSD$ tag removal Reviewed by: kevans (earlier), theraven, emaste Differential Revision: https://reviews.freebsd.org/D41482 (cherry picked from commit 29a55fd09b0a3cc4c888f7a630fde41694699343) (cherry picked from commit f147cf0ee2b2642c0a133a71c8a5dc018518d923) --- usr.bin/dtc/HACKING | 1 - usr.bin/dtc/Makefile | 3 +- usr.bin/dtc/fdt.cc | 134 ++++++++++++++++++++++++++++++++++++++++----------- usr.bin/dtc/fdt.hh | 24 ++++++--- 4 files changed, 122 insertions(+), 40 deletions(-) diff --git a/usr.bin/dtc/HACKING b/usr.bin/dtc/HACKING index 9447c4f6ebf9..ef858c8885c0 100644 --- a/usr.bin/dtc/HACKING +++ b/usr.bin/dtc/HACKING @@ -1,4 +1,3 @@ - Notes for people hacking on dtc =============================== diff --git a/usr.bin/dtc/Makefile b/usr.bin/dtc/Makefile index d242ed80e8b1..9b1aff13511f 100644 --- a/usr.bin/dtc/Makefile +++ b/usr.bin/dtc/Makefile @@ -1,4 +1,3 @@ - PROG_CXX=dtc SRCS= dtc.cc input_buffer.cc string.cc dtb.cc fdt.cc checking.cc MAN= dtc.1 @@ -7,7 +6,7 @@ WARNS?= 3 CXXFLAGS+= -fno-rtti -fno-exceptions -CXXSTD= c++11 +CXXSTD= c++17 NO_SHARED?=NO diff --git a/usr.bin/dtc/fdt.cc b/usr.bin/dtc/fdt.cc index 5ab9ba10d2f0..f0b98cfe720c 100644 --- a/usr.bin/dtc/fdt.cc +++ b/usr.bin/dtc/fdt.cc @@ -861,7 +861,15 @@ node::node(const string &n, node_ptr node::create_special_node(const string &name, const std::vector &props) { - node_ptr n(new node(name, props)); + // Work around for the fact that we can't call make_shared on something + // with a private constructor. Instead create a subclass with a public + // constructor that is visible only in this function and construct that + // instead. + struct constructable_node : public node + { + constructable_node(const string &n, const std::vector &p) : node(n, p) {} + }; + node_ptr n{std::make_shared(name, props)}; return n; } @@ -1035,12 +1043,31 @@ node::parse(text_input_buffer &input, string &&address, define_map *defines) { - node_ptr n(new node(input, - tree, - std::move(name), - std::move(label), - std::move(address), - defines)); + // Work around for the fact that we can't call make_shared on something + // with a private constructor. Instead create a subclass with a public + // constructor that is visible only in this function and construct that + // instead. + struct constructable_node : public node + { + constructable_node(text_input_buffer &input, + device_tree &tree, + std::string &&n, + std::unordered_set &&l, + std::string &&a, + define_map*m) : node(input, + tree, + std::move(n), + std::move(l), + std::move(a), + m) + {} + }; + node_ptr n{std::make_shared(input, + tree, + std::move(name), + std::move(label), + std::move(address), + defines)}; if (!n->valid) { n = 0; @@ -1208,7 +1235,7 @@ node::write_dts(FILE *file, int indent) } void -device_tree::collect_names_recursive(node_ptr &n, node_path &path) +device_tree::collect_names_recursive(node_ptr parent, node_ptr n, node_path &path) { path.push_back(std::make_pair(n->name, n->unit_address)); for (const string &name : n->labels) @@ -1218,9 +1245,13 @@ device_tree::collect_names_recursive(node_ptr &n, node_path &path) auto iter = node_names.find(name); if (iter == node_names.end()) { - node_names.insert(std::make_pair(name, n.get())); + node_names.insert(std::make_pair(name, n)); node_paths.insert(std::make_pair(name, path)); ordered_node_paths.push_back({name, path}); + if (parent) + { + node_name_parents.insert({name, parent}); + } } else { @@ -1236,7 +1267,7 @@ device_tree::collect_names_recursive(node_ptr &n, node_path &path) } for (auto &c : n->child_nodes()) { - collect_names_recursive(c, path); + collect_names_recursive(n, c, path); } // Now we collect the phandles and properties that reference // other nodes. @@ -1264,7 +1295,7 @@ device_tree::collect_names_recursive(node_ptr &n, node_path &path) else { uint32_t phandle = p->begin()->get_as_uint32(); - used_phandles.insert(std::make_pair(phandle, n.get())); + used_phandles.insert(std::make_pair(phandle, n)); } } } @@ -1280,11 +1311,11 @@ device_tree::collect_names() ordered_node_paths.clear(); cross_references.clear(); fixups.clear(); - collect_names_recursive(root, p); + collect_names_recursive(nullptr, root, p); } property_ptr -device_tree::assign_phandle(node *n, uint32_t &phandle) +device_tree::assign_phandle(node_ptr n, uint32_t &phandle) { // If there is an existing phandle, use it property_ptr p = n->get_property("phandle"); @@ -1329,11 +1360,11 @@ device_tree::assign_phandle(node *n, uint32_t &phandle) } void -device_tree::assign_phandles(node_ptr &n, uint32_t &next) +device_tree::assign_phandles(node_ptr n, uint32_t &next) { if (!n->labels.empty()) { - assign_phandle(n.get(), next); + assign_phandle(n, next); } for (auto &c : n->child_nodes()) @@ -1391,14 +1422,14 @@ device_tree::resolve_cross_references(uint32_t &phandle) for (auto &i : sorted_phandles) { string target_name = i.get().val.string_data; - node *target = nullptr; + node_ptr target; string possible; // If the node name is a path, then look it up by following the path, // otherwise jump directly to the named node. if (target_name[0] == '/') { string path; - target = root.get(); + target = root; std::istringstream ss(target_name); string path_element; // Read the leading / @@ -1412,14 +1443,14 @@ device_tree::resolve_cross_references(uint32_t &phandle) string node_name, node_address; std::getline(nss, node_name, '@'); std::getline(nss, node_address, '@'); - node *next = nullptr; + node_ptr next; for (auto &c : target->child_nodes()) { if (c->name == node_name) { if (c->unit_address == node_address) { - next = c.get(); + next = c; break; } else @@ -1478,8 +1509,8 @@ device_tree::resolve_cross_references(uint32_t &phandle) bool device_tree::garbage_collect_marked_nodes() { - std::unordered_set previously_referenced_nodes; - std::unordered_set newly_referenced_nodes; + std::unordered_set previously_referenced_nodes; + std::unordered_set newly_referenced_nodes; auto mark_referenced_nodes_used = [&](node &n) { @@ -1489,7 +1520,7 @@ device_tree::garbage_collect_marked_nodes() { if (v.is_phandle()) { - node *nx = node_names[v.string_data]; + node_ptr nx = node_names[v.string_data]; if (nx == nullptr) { // Try it again, but as a path @@ -1534,8 +1565,9 @@ device_tree::garbage_collect_marked_nodes() while (!newly_referenced_nodes.empty()) { - previously_referenced_nodes = std::move(newly_referenced_nodes); - for (auto *n : previously_referenced_nodes) + previously_referenced_nodes = newly_referenced_nodes; + newly_referenced_nodes.clear(); + for (auto &n : previously_referenced_nodes) { mark_referenced_nodes_used(*n); } @@ -1617,7 +1649,38 @@ device_tree::parse_file(text_input_buffer &input, while (valid && !input.finished()) { node_ptr n; - if (input.consume('/')) + if (input.consume("/delete-node/")) + { + // Top-level /delete-node/ directives refer to references that must + // be deleted later. + input.next_token(); + auto expect = [&](auto token, const char *msg) + { + if (!input.consume(token)) + { + input.parse_error(msg); + valid = false; + } + input.next_token(); + return valid; + }; + if (expect('&', "Expected reference after top-level /delete-node/.")) + { + string ref = input.parse_node_name(); + if (ref == string()) + { + input.parse_error("Expected label name for top-level /delete-node/."); + valid = false; + } + else + { + deletions.push_back(std::move(ref)); + } + expect(';', "Missing semicolon."); + } + continue; + } + else if (input.consume('/')) { input.next_token(); n = node::parse(input, *this, string(), string_set(), string(), &defines); @@ -1732,7 +1795,7 @@ device_tree::write(int fd) strings_writer.write_to_file(fd); } -node* +node_ptr device_tree::referenced_node(property_value &v) { if (v.is_phandle()) @@ -2032,6 +2095,19 @@ device_tree::parse_dts(const string &fn, FILE *depfile) } } collect_names(); + for (auto &ref : deletions) + { + auto parent = node_name_parents[ref]; + auto node = node_names[ref]; + if (!parent) + { + fprintf(stderr, "Top-level /delete-node/ directive refers to label %s, which is not found.\n", ref.c_str()); + } + else + { + parent->delete_children_if([&](node_ptr &child) { return child == node; }); + } + } // Return value indicates whether we've dirtied the tree or not and need to // recollect names if (garbage_collect && garbage_collect_marked_nodes()) @@ -2127,7 +2203,7 @@ device_tree::parse_dts(const string &fn, FILE *depfile) { continue; } - node *n = local_fixups.get(); + node_ptr n = local_fixups; for (auto &p : i.path) { // Skip the implicit root @@ -2142,7 +2218,7 @@ device_tree::parse_dts(const string &fn, FILE *depfile) { if (c->unit_address == p.second) { - n = c.get(); + n = c; found = true; break; } @@ -2157,7 +2233,7 @@ device_tree::parse_dts(const string &fn, FILE *depfile) path += p.second; } n->add_child(node::create_special_node(path, symbols)); - n = (--n->child_end())->get(); + n = *(--(n->child_end())); } } assert(n); diff --git a/usr.bin/dtc/fdt.hh b/usr.bin/dtc/fdt.hh index 86c9ff153b80..fad9609d40bb 100644 --- a/usr.bin/dtc/fdt.hh +++ b/usr.bin/dtc/fdt.hh @@ -71,7 +71,7 @@ typedef std::shared_ptr property_ptr; /** * Owning pointer to a node. */ -typedef std::unique_ptr node_ptr; +typedef std::shared_ptr node_ptr; /** * Map from macros to property pointers. */ @@ -663,7 +663,7 @@ class node /** * Deletes any children from this node. */ - inline void delete_children_if(bool (*predicate)(node_ptr &)) + inline void delete_children_if(std::function predicate) { children.erase(std::remove_if(children.begin(), children.end(), predicate), children.end()); } @@ -761,7 +761,11 @@ class device_tree * Mapping from names to nodes. Only unambiguous names are recorded, * duplicate names are stored as (node*)-1. */ - std::unordered_map node_names; + std::unordered_map node_names; + /** + * Mapping from names to the nodes that contain them. + */ + std::unordered_map node_name_parents; /** * A map from labels to node paths. When resolving cross references, * we look up referenced nodes in this and replace the cross reference @@ -779,6 +783,10 @@ class device_tree * These should be expanded to the full path of their targets. */ std::vector cross_references; + /** + * Labels collected from top-level /delete-node/ directives. + */ + std::vector deletions; /** * The location of something requiring a fixup entry. */ @@ -827,7 +835,7 @@ class device_tree * find phandles that were provided by the user explicitly when we are * doing checking. */ - std::unordered_map used_phandles; + std::unordered_map used_phandles; /** * Paths to search for include files. This contains a set of * nul-terminated strings, which are not owned by this class and so @@ -864,19 +872,19 @@ class device_tree * used in resolving cross references. Also collects phandle * properties that have been explicitly added. */ - void collect_names_recursive(node_ptr &n, node_path &path); + void collect_names_recursive(node_ptr parent, node_ptr n, node_path &path); /** * Assign a phandle property to a single node. The next parameter * holds the phandle to be assigned, and will be incremented upon * assignment. */ - property_ptr assign_phandle(node *n, uint32_t &next); + property_ptr assign_phandle(node_ptr n, uint32_t &next); /** * Assign phandle properties to all nodes that have been referenced and * require one. This method will recursively visit the tree starting at * the node that it is passed. */ - void assign_phandles(node_ptr &n, uint32_t &next); + void assign_phandles(node_ptr n, uint32_t &next); /** * Calls the recursive version of this method on every root node. */ @@ -925,7 +933,7 @@ class device_tree * is in source form, then we have a string that we can use to index * the cross_references array and so we can just look that up. */ - node *referenced_node(property_value &v); + node_ptr referenced_node(property_value &v); /** * Writes this FDT as a DTB to the specified output. */ From nobody Thu Jan 11 00:41:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9QpJ1hH8z56bvS; Thu, 11 Jan 2024 00:41:28 +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 4T9QpH5v15z4JLv; Thu, 11 Jan 2024 00:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C1SBthQKoX3KQkncNs3ffTUt3Tu0nmzAhP3Jsteb+6Y=; b=Kl88IZsI+0wh+IPzTaCG61LEy3wkC+uX7OCunW2QEfC+MJs2x3vcupEkKLcucJGoM7TB8G 0JmZ2MyhAUTaJwyCNN1Yp2l9wT7yxNuJXecRAiJFc932YVOfyJ7jC1emh2jRXsDZE0IebU sRyaR6czkpUSD0JRjyB/cuMm1iW35+wrXESyhsWpWrRrXVqxqnfXwA6/l/HY/yYFfX7IgI BPFsHe+foxfSWIcoInPS1Bv2McZD/3wLZXGEwlgmRJr6p3TQ9F5A8PCE0TI5XxdqoRBxgl izhupKRH0migufWmgbbKWQmMOo3A9TnYIJMSDCoxjAcGX4UxdVAkzXtliZZ0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C1SBthQKoX3KQkncNs3ffTUt3Tu0nmzAhP3Jsteb+6Y=; b=p1ubTFK4D1NikqJG98gl7c8GEbBd7LMF0m7ITB8WNM2m0SA1wDHK1GJwjS/Jbr767SNoJ/ 8ypaC976203o/AS4h8Jxwjk6gufbP6ZePmoslZJAYsE9TABmLYB4exDBfUytr18MyETfNa 3niMXUpF1Q0fZAJy+iHMGrnthhB71j4QxPWj6oUJp3G/f4xtNcZtEsB1fcoP47QtRrQjmh YkhMkbtbaFL7EBKG4RiHzpv+RFUC37US+QJAdOEFqkkouWJgaBI9+bN0hnc0ZLD31Iypzt xKDZGnlW5lkw/WFB+JC/S9g/dBwfLnFJKhDQXtQVt/qt+kD/HNt5r+sTX5i3gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704933687; a=rsa-sha256; cv=none; b=nOJsk9ffEoOjxgey/swU2KdSyiiOcanJLhjsbNBvlblj599rmFAiDIFpugVY6g3YYpbvKE BBLvNxYUPIGAQOVZzq+tj0xuYfTLZeyjhLzU0hvQkBhIJmlIV7p7kOCZwVcc/u8ctoomYp woDBfPujMyEycvFbGt5EIK9XDvXL7XBI2qNcuSIvM8bFROeaQeS1MHglM5wj4eHUFzN5iR AR4LVI62oqDbanwPuY0nd2xVkGK5r8phGkwugLDaYrGWrADp+rqq0yvmDGuz1vpnlulZcc KCzkJ0FseGfA3ZbYfrkRuIJlXHhxTrD57yQY7EWAWnh7E2BbnmvelfLscLM1rA== 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 4T9QpH4zz5zxBg; Thu, 11 Jan 2024 00:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B0fR9w013173; Thu, 11 Jan 2024 00:41:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B0fRTx013170; Thu, 11 Jan 2024 00:41:27 GMT (envelope-from git) Date: Thu, 11 Jan 2024 00:41:27 GMT Message-Id: <202401110041.40B0fRTx013170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: d730ffcd6ad3 - stable/13 - tcp: Undo the consumption of sequence space by FIN in case of a transient error. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d730ffcd6ad3da47d9a1af00a534a78861280f54 Auto-Submitted: auto-generated The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=d730ffcd6ad3da47d9a1af00a534a78861280f54 commit d730ffcd6ad3da47d9a1af00a534a78861280f54 Author: Richard Scheffenegger AuthorDate: 2022-07-14 00:49:10 +0000 Commit: Richard Scheffenegger CommitDate: 2024-01-11 00:38:36 +0000 tcp: Undo the consumption of sequence space by FIN in case of a transient error. If an error occurs while processing a TCP segment with some data and the FIN flag, the back out of the sequence number advance does not take into account the increase by 1 due to the FIN flag. Reviewed By: jch, gnn, #transport, tuexen Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D2970 (cherry picked from commit 66605ff791b12a2c3bb4570379db0e14d29fca4c) --- sys/netinet/tcp_output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 3ed4d34fd061..3e1a2320f331 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1684,8 +1684,13 @@ timer: tp->sackhint.sack_bytes_rexmit -= len; KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, ("sackhint bytes rtx >= 0")); - } else + KASSERT((flags & TH_FIN) == 0, + ("error while FIN with SACK rxmit")); + } else { tp->snd_nxt -= len; + if (flags & TH_FIN) + tp->snd_nxt--; + } } SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) { From nobody Thu Jan 11 00:41:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9QpK4TtGz56bXX; Thu, 11 Jan 2024 00: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 4T9QpJ70xFz4JJd; Thu, 11 Jan 2024 00:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eka27TyUNzvK8ogwuXBBq1FK6M55vnZZ2MUYPmEyrE0=; b=T/6S/Y5S+xxwIbWrakG18kMpLavyympZeKxxq461Ob0QVLihY7KISVfU3THe3QLE6JxgxX zxqsX2kLiCRc5+TYNnUpSjIGGXrBOejl6nyMQpt+mZiNoilw3khmYx/UsOviZj95lcJ4uA do5uvoU5t7Wn8B3Fu4hPFqXaPkIqjDcjNkw4k+6xe8lApTRy2yH21q25Y9LvieeXOxN2zO 0MdjqvTuhj6rHQv74PcJ6ezexoxPi80Uhy5djQL29xzIkfLWZlnP+S4itXhBRlJHlrSEa0 uTG+JTdrZd//QpZ/EpbzJ2NzrELGutr1rJHiqW+24ggExoFrB8FvtuwC+fabkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eka27TyUNzvK8ogwuXBBq1FK6M55vnZZ2MUYPmEyrE0=; b=dUdVP366bdfPk7dK+2Qeku4BP6C6ZprePqCJ3i6y0HBxYKZWUW/ccsObCGfuk08/diSHhK AuFQl8DKPh4D268+dZ39ggOD9o0FjwDj91G6EIzw9hpWnRkWzW7IDWGQRV56uky5U1psd3 cTyv+AOTD003zehel4Ujl/l3RRAHWdNrWeeizPptQLBTj7L7QV6/VNnd3JPClC6KYPTY4H nsHwRd+EcilxO95zvEcAC/9qejU1di55ImBxZB49z0YpqTgA9mDKBFkaW6xKhl0x8nv8XA SFYjP+pG+HO17MgJwUnuxnvkWr3TCDcYu2l6dxyZ04ry5yHoTqy0f65lfxCdOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704933689; a=rsa-sha256; cv=none; b=JD6kDhgUN+GUGVZ+xGyAD+Fbkim1stG2FWWvOZKTo6KRBnKgLVG+gN8NP52mr4k+n3FG6W w80IR7V7U5v45VndGFNXC2xBXGZdiYl2MkjsyNQ/JImZ//D4kbXZLYz63TcrETt20kOk1d FY2v9htqtmOclX6en54h+JyWF6qtKqtNbqcCcqcP34dNcNv51KMyeOuhEa1SJtVgMrKK5a TEy4qLFDrxlXMZKYcsP+TAlwU4LeRiK01gTTpHGZTdgwpLkNkqQjT5fiG8WYn+MAq8Hq3K iYe+iK5PAhXVOpvV6/eyZm5BNVBQqvYxhTWktEYnARsTnY2PXcWrJWGJ5zvb2Q== 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 4T9QpJ5qqYzxby; Thu, 11 Jan 2024 00:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B0fSTw013224; Thu, 11 Jan 2024 00:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B0fS1k013221; Thu, 11 Jan 2024 00:41:28 GMT (envelope-from git) Date: Thu, 11 Jan 2024 00:41:28 GMT Message-Id: <202401110041.40B0fS1k013221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 8923d34c6cbf - stable/13 - tcp: clean PRR state after ECN congestion recovery. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8923d34c6cbf68d506abd9fcf8a790a77eb952ad Auto-Submitted: auto-generated The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=8923d34c6cbf68d506abd9fcf8a790a77eb952ad commit 8923d34c6cbf68d506abd9fcf8a790a77eb952ad Author: Richard Scheffenegger AuthorDate: 2024-01-08 08:28:01 +0000 Commit: Richard Scheffenegger CommitDate: 2024-01-11 00:40:14 +0000 tcp: clean PRR state after ECN congestion recovery. PRR state was not properly reset on subsequent ECN CE events. Clean up after local transmission failures too. Reviewed by: tuexen, cc, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43170 (cherry picked from commit 429f14f83ae1f6357a9455d4f075522420b01b03) --- sys/netinet/tcp_input.c | 1 + sys/netinet/tcp_output.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9a5b9b05f210..262e95d08071 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -529,6 +529,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; tp->sackhint.delivered_data = 0; + tp->sackhint.prr_delivered = 0; tp->sackhint.prr_out = 0; } diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 3e1a2320f331..834bce35f5ba 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1691,6 +1691,8 @@ timer: if (flags & TH_FIN) tp->snd_nxt--; } + if (IN_RECOVERY(tp->t_flags)) + tp->sackhint.prr_out -= len; } SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) { From nobody Thu Jan 11 00:42:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9QqR24tpz56cTN; Thu, 11 Jan 2024 00:42: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 4T9QqR1fzBz4JmQ; Thu, 11 Jan 2024 00:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=prvkYTjgGPnmi0LKOzzjxve1fNeGgKhWYYaVDKjQ1NM=; b=RVWRBijBJUw0Id7iramjKgYcGi2iNZVgEaYE20cfPc2JPvO5q/piw9+7cxOOzE4tJPPsfb uIX60lrruD1d9KWmaTcxe9MMNzxV9wNRoO2k7h6ohdPLJxrrCdkhY40ZRlDIDYJ1VGguXs H3eWiF2AMVPuxqeTeAKx+6uzQkW35DDWx3ee2EoH9uWMhnFuUp5wzotdo2gogTxRUzi/0H 6f9nVOiNxAHZoMaRiZJmrrQNBXrGmdYhEm3858EDANjmg5esJ7fqIBTuNteX5ea5rdpFx+ PnRF6hD7qrfcsGoTag/drQbhk8ViQatJNWl8vifb6OdoOLhkbn5b07pkj6LVeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704933747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=prvkYTjgGPnmi0LKOzzjxve1fNeGgKhWYYaVDKjQ1NM=; b=K7w/IBYN6ajS+7ZWheQnsO3ltMKufsoT9onvA1OXKYDzz63HBfbZbI3XGcfnw8zVwsOVUR AvUQMiNX0q0KzGkIfj9FP9gcTn5U4tEGfYUO8KqAuL8fPhWm7kTnqhyoNjSutIi1C9pHYp RcnvA7pfxwSKqnV0fWyoDucGYjI243q2GHvINrOLSU4hpSi7iAwQgrEk47aSOD11A4R8s7 O2zpEYkVXJi87YlgV7TZXOlrudw2cxL8GUzc1VnZ8IF/4YXaIqy3+Fj3F4o1CJ/ZWIhRi3 eP5aFt5lpePn6+CjDB4HSzZfUoApw+W0yxDYyX07crCrTFZoFN7x1wZ2/yFVog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704933747; a=rsa-sha256; cv=none; b=XuAZsnRrqXNoKUpEBN22yAWrmVJcDdLk5H4tBv0/r1fjDirB1ITuTGV94uCk993V184/Jt pGGsnvcOR77gQnuGZ67VSVAIQVF2JX8ezgI9s+1bI+fMPmhO2WgMRw7qt9g0ng8xvVCdZi 7nqYU/VANi7yXSAmVNX8T964QFCNIHCJxzUwdi0stzSvdA5jMDSpSuoXDKfWD3Rf5BCgCZ TRsTnjCEE0kMhvUcXRA6r7DD3iWqYeIXeuYUsyEciCjbpMFcpoUjCqDKvhTejM5mU6oOpB jaMNYgEf4sg33nCNQVK9Hfm1x49jZQV0lNe0gXhRcqRW1EGgwKf+AaTP4G+7cA== 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 4T9QqR0kW1zxSf; Thu, 11 Jan 2024 00:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B0gR5D020272; Thu, 11 Jan 2024 00:42:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B0gRJX020269; Thu, 11 Jan 2024 00:42:27 GMT (envelope-from git) Date: Thu, 11 Jan 2024 00:42:27 GMT Message-Id: <202401110042.40B0gRJX020269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 407054ed4891 - stable/14 - tcp: clean PRR state after ECN congestion recovery. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 407054ed48916e8d19d0b8d0cb9f5df16a27c69c Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=407054ed48916e8d19d0b8d0cb9f5df16a27c69c commit 407054ed48916e8d19d0b8d0cb9f5df16a27c69c Author: Richard Scheffenegger AuthorDate: 2024-01-08 08:28:01 +0000 Commit: Richard Scheffenegger CommitDate: 2024-01-11 00:33:53 +0000 tcp: clean PRR state after ECN congestion recovery. PRR state was not properly reset on subsequent ECN CE events. Clean up after local transmission failures too. Reviewed by: tuexen, cc, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43170 (cherry picked from commit 429f14f83ae1f6357a9455d4f075522420b01b03) --- sys/netinet/tcp_input.c | 1 + sys/netinet/tcp_output.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2d7a6fa11b4e..9eefef3ea81e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -487,6 +487,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; tp->sackhint.delivered_data = 0; + tp->sackhint.prr_delivered = 0; tp->sackhint.prr_out = 0; } diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 8efea91e116f..549218badcec 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1665,6 +1665,8 @@ timer: if (flags & TH_FIN) tp->snd_nxt--; } + if (IN_RECOVERY(tp->t_flags)) + tp->sackhint.prr_out -= len; } SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) { From nobody Thu Jan 11 01:14:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RXN4r8mz56gGl; Thu, 11 Jan 2024 01:14:28 +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 4T9RXN4H71z4QHp; Thu, 11 Jan 2024 01:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704935668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzfcxPEzdxNZbTrlWHYnljKm9Mj6tGE2dO0rj5m5g8c=; b=bkK5VArlHv9+IE/152SbvZ4FLmbp6LM5mSPiqzT2rj/CgVY4/KIpFaY4fjtjjughTeGcIe LB+BDjlbtrtV9spQoOIZ+KyqSD8YV6lnLL2qRWWheEr60u0Oh9fGtxwAdqHlg8nogdJ3dK EG2Cf6amzt4m9MixPEde2FfMNZSHOjg8nQM85tAclSw2eMTnSdJX6Gg1N/YO64saFwFwGk LEC1+faPBGhKbP8W6XKn0bnf4GruJ89+KsH1D9W1GvJ94DIM3NsGSL+i1VDUoPJZ9tcB/w 0oY3sXWf7pdqw6b9hqWzbvNFHAJGrG7kqgD2t3M69rOIzqlwBXe+7TH81m+rdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704935668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzfcxPEzdxNZbTrlWHYnljKm9Mj6tGE2dO0rj5m5g8c=; b=fqMvXWe80tQ1K7IoO3jeyzhItz24xX7YG3AnPC20aOyM3jnnxIg1UK6wXnUXtX9KR/F6sF QBVkXlTIDYNl6z4ZVbBbsleYSITk9UsBAGUrix7eY/Wxi40m7RdvytWw4rpHy4Q2Ixshap DA+O34nHTbEZa67ktnFVjIaMa5mw/Eiy9D9OrFEDWtaT/caY5B2Ys/urKH+8PqRkK//bRX LViVFHturnof0HAf+PHRKvo8ttMdcsEGdPkb0nyspQ7rrESXMgWB3CdjiIp4DXb/oPj/9r cD/YdDFBZQEHXEDNdujDmJPoq3BUzchuuBhKBXuEHjiC4EZDrEa0uxl1b+QNDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704935668; a=rsa-sha256; cv=none; b=TVneXdlj09T5TNhMO7HflYI4fGxl6dLkVwkOt56t5QDDJNis6k+JIeCzKolYm3BUCCSrLG z+Vil++NXeUEvDGIx41C3pJZYAIi8w5y+3qtLCHzaiPP1/ECVMmhV+m2/8FyRX/LyPOoh1 puwHrLOu2ZsIWhtVLmUJspPlXXAfPYTa5iJB7l5LqzKCpufKFK+qIf8XE2PRe3UCDR7+4o iIcOxvJU8QWNnBZUBuAvnWhiiFDFElq1/dXQzsSKKAZN72RAngIWT1ckceYazUwT6mJZRU FhJuICrOtKoKFyL29GXeS7H+EEt8QgrXAmpzN68VUX/zZtCqjDH3W9CGN/VzqQ== 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 4T9RXN3Lrbzy8w; Thu, 11 Jan 2024 01:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1ESBQ072273; Thu, 11 Jan 2024 01:14:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1ESoV072270; Thu, 11 Jan 2024 01:14:28 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:14:28 GMT Message-Id: <202401110114.40B1ESoV072270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 5c4da68ad785 - stable/14 - copy_file_range.2: Clarify that only regular files work List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5c4da68ad785e955976e7b73c281213abb85c23a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4da68ad785e955976e7b73c281213abb85c23a commit 5c4da68ad785e955976e7b73c281213abb85c23a Author: Rick Macklem AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem CommitDate: 2024-01-11 01:13:23 +0000 copy_file_range.2: Clarify that only regular files work PR#273962 reported that copy_file_range(2) did not work on shared memory objects and returned EINVAL. Although the reporter felt this was incorrect, it is what the Linux copy_file_range(2) syscall does. Since there was no collective agreement that the FreeBSD semantics should be changed to no longer be Linux compatible, copy_file_range(2) still works on regular files only. This man page update clarifies that. If, someday, copy_file_range(2) is changed to support non-regular files, then the man page will need to be updated to reflect that. PR: 273962 (cherry picked from commit 84b4342c0d7ac8a3187309a978d41e6765154cc1) --- lib/libc/sys/copy_file_range.2 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/copy_file_range.2 b/lib/libc/sys/copy_file_range.2 index c9fa593b7f4c..bcd9170842d5 100644 --- a/lib/libc/sys/copy_file_range.2 +++ b/lib/libc/sys/copy_file_range.2 @@ -23,13 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2021 +.Dd December 28, 2023 .Dt COPY_FILE_RANGE 2 .Os .Sh NAME .Nm copy_file_range -.Nd kernel copy of a byte range from one file to another -or within one file +.Nd kernel copy of a byte range from one regular file to another +or within one regular file .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -178,9 +178,17 @@ are reset to the initial values for the system call. .Fa infd and .Fa outfd -refer to the same file and the byte ranges overlap or +refer to the same file and the byte ranges overlap. +.It Bq Er EINVAL +The .Fa flags -is not zero. +argument is not zero. +.It Bq Er EINVAL +Either +.Fa infd +or +.Fa outfd +refers to a file object that is not a regular file. .It Bq Er EIO An I/O error occurred while reading/writing the files. .It Bq Er EINTEGRITY From nobody Thu Jan 11 01:21:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RhL2nYDz56h6C; Thu, 11 Jan 2024 01:21: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 4T9RhL2LP2z4RNQ; Thu, 11 Jan 2024 01:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0A7caeh/KeVSPgLSvb3noVkmrdRJOnv89dF6BTOjhU=; b=Z7ylAbusq7mXpI5TfTYXTAbQQxpVBFBERDRN36BOnGYQKwNAfO6a2nwRjgEhll1fKcFMeg VRKijohSm264+2o4YOL1DexrKi88YbXmCL3RV5kHrurXw8AwuzBb5UMauGGdZvkyTzL1gT c/Vt7AbizEpk46eWpmsbNgxrm5l7GU1dWriNGO4uOMX4VjsIXdvLCN0UGl3w2w8f2nAuyr X7cpNT47nKpSUJFhnxXgG1smUunzGtR8YBwMGDG+n618ZxQix9HuVdTLOjvVEn1olxUYbE 3r5KpMCaLxUgG5GymRGqiwY1+NWd2LurM/7qcw1PUa2a1390EUzwmqKanLOyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0A7caeh/KeVSPgLSvb3noVkmrdRJOnv89dF6BTOjhU=; b=dsdZK8Uv8TqyB05a+xFgnolbzxSP9NsqpQkKX2BuyXJEgqaCuJJWif41XxIxsUX2u38R0I Zh/eeM7yMVGMFfRLL0VjW0JAYefTZGB+exzmVimsASoW4HNviHVbsVEk4GVmiyU7Zyt9n1 Wi7CxUSrgWtAVXsvsEjzbVQapwM+WaRhKgClfpvN+GD73I6gDedWe8UH2YzTYaOfTF1r4O f6JYRJFBLFli6RunmCI7ecO0Yc2dQQHMPTySMxCtsFUi7kz+miNQuXiR5N+0WjSMVKDtn0 kk/vrFrt2mESL9AzWKekwgP2rOrz3gu8KkQ53MNzOY/iX1zQepZEBFqWdxdc3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936082; a=rsa-sha256; cv=none; b=mDYKmhDizvkOg/6v5fmKhpxtAmqKFdM1G1PYgNQzsgMqjN/XLiVgRDVYHMXSxIr2G/r0C0 53RxuBL0l6Q0R3jCkbeAZxnAe+uUC/nMbNxjx9SnWd2tkdu+O6yN/9LSsN2tU/m13dlXFj gv5ho49tbJk54LME0liSCGO6b14KVfeA5qHxM0b/G40NTMx3MKNAps+xLn1zg+lrh/vr5x 11+sazefL3gMNoM99acHZG7Obj5R/Jc1zit6yGFGKFMIzGXVeJuxkHaz9UooX2Ew2yQKci aPlp5+AdOpYpaH/P5T12TmwgH2KLRLg7n+6FmojU3Z1t77NwPQHp1t/oD992/A== 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 4T9RhL1QFczyX5; Thu, 11 Jan 2024 01:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1LMHI085145; Thu, 11 Jan 2024 01:21:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1LMln085142; Thu, 11 Jan 2024 01:21:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:21:22 GMT Message-Id: <202401110121.40B1LMln085142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6561a7141b56 - stable/13 - copy_file_range.2: Clarify that only regular files work List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6561a7141b5603235d18538f6c66322ed7fc67d3 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6561a7141b5603235d18538f6c66322ed7fc67d3 commit 6561a7141b5603235d18538f6c66322ed7fc67d3 Author: Rick Macklem AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem CommitDate: 2024-01-11 01:20:35 +0000 copy_file_range.2: Clarify that only regular files work PR#273962 reported that copy_file_range(2) did not work on shared memory objects and returned EINVAL. Although the reporter felt this was incorrect, it is what the Linux copy_file_range(2) syscall does. Since there was no collective agreement that the FreeBSD semantics should be changed to no longer be Linux compatible, copy_file_range(2) still works on regular files only. This man page update clarifies that. If, someday, copy_file_range(2) is changed to support non-regular files, then the man page will need to be updated to reflect that. PR: 273962 (cherry picked from commit 84b4342c0d7ac8a3187309a978d41e6765154cc1) --- lib/libc/sys/copy_file_range.2 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/copy_file_range.2 b/lib/libc/sys/copy_file_range.2 index c9fa593b7f4c..bcd9170842d5 100644 --- a/lib/libc/sys/copy_file_range.2 +++ b/lib/libc/sys/copy_file_range.2 @@ -23,13 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2021 +.Dd December 28, 2023 .Dt COPY_FILE_RANGE 2 .Os .Sh NAME .Nm copy_file_range -.Nd kernel copy of a byte range from one file to another -or within one file +.Nd kernel copy of a byte range from one regular file to another +or within one regular file .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -178,9 +178,17 @@ are reset to the initial values for the system call. .Fa infd and .Fa outfd -refer to the same file and the byte ranges overlap or +refer to the same file and the byte ranges overlap. +.It Bq Er EINVAL +The .Fa flags -is not zero. +argument is not zero. +.It Bq Er EINVAL +Either +.Fa infd +or +.Fa outfd +refers to a file object that is not a regular file. .It Bq Er EIO An I/O error occurred while reading/writing the files. .It Bq Er EINTEGRITY From nobody Thu Jan 11 01:23:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RkR3K6lz56gLJ; Thu, 11 Jan 2024 01:23: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 4T9RkR2jRSz4SkL; Thu, 11 Jan 2024 01:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TGOuRl9fxyNWKJCX61gld5pg5WzgGw7MRp7alcnMKDI=; b=NPsJgkMW7XYuI+5T1KHoIk5fQY4+0qL2A/kzpXV8ToVzlsFwRsolkQVLTicOo62t0UdlCq 3zyofl3IPNSSrAumzj/T3B4QrQORt/TgV5wBUDhgA0L7HBKVaftK9P/3bVWg8A3PJl8AC5 bHC6TiiXYcgduzFX7TYksoktdIGWr2aGk/2Wsx2TpSsYokQprvBGvYc4JakvX01tNFEGuK W99KTM1v74Dv9Y1QsjdAR5okox3c2CEPrw55i4Do+SnexpxLvvvycz3da0KpnG/sX0wRyb Dr+DnAUPZ0fYRFvk81pgx9Gcdqd6sw9hCLPbBZICGCHKARcLpV4/4uTwIKxdbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TGOuRl9fxyNWKJCX61gld5pg5WzgGw7MRp7alcnMKDI=; b=XZzK3cKjY7IfnRZtQr1m6xAr1RVk7Ne3zkgy2yjLFaev4e9WUaIZSqsTCzin0ZF52r14/l LqTu8cns8EVoMaL0TtUg5cTP+Y3qUXFZZ+Uhc+6O9SIxPe3zQ2zJh63YnZ9X90G1cFy2CL AKubhOhfYDVEK2u0mk5hm8HnmKDRhPAgldWMga7izRBGt3Ofnz2XNA8sS2uPzjcI4J9au5 MTHnSYPHrKrbwo3qibpOOM58ObGZnZRrE4gqrMJ78Q8wZX1lnqB/kxshT0yhgZbe037dsX HEdp0chMpGWLg9ahIeLTu9UylxX1VcT0Zt3bn0+b9AkhUaxZFXG3vlMXrjb8kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936191; a=rsa-sha256; cv=none; b=gE4mG8zpAaxaQcNM1NOIa7vFsNJqF+bQhGeL/94TRLsDhqiz9sXf4WgAdjbbX3tUiBm2Y3 XDhEkR9LYJ1BnX/ZUe+sES1r6hZEtfqp8h9ChSDdAYwVCuoQWSGPhy9wQhhMCct4AV3BWV A8jYtXelXs67zwvicqMujdTnu5yowUrAY2GPVYUKS2kdDHvMxovFB3WzpHacRXmXB8pOZY 7CciZFjqNcfYYuIb3x+A1bCwzk+gI14f4zhcZpboAvioGVhdInZrV+VFdn1dTW2FbYO2mJ a4j1EpZlU06uF+j4dgHoNLcSg3GqO1VDDqDFdHc5iOwIQkkmqSwzGfSr6AaY/A== 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 4T9RkR1lxBzywP; Thu, 11 Jan 2024 01:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1NB0x088857; Thu, 11 Jan 2024 01:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1NBlr088854; Thu, 11 Jan 2024 01:23:11 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:23:11 GMT Message-Id: <202401110123.40B1NBlr088854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3a89a5d54daa - stable/14 - udplite: fix checksum computation on the sender side List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a89a5d54daa4d044b3f2b36c44f72c3333e3284 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3a89a5d54daa4d044b3f2b36c44f72c3333e3284 commit 3a89a5d54daa4d044b3f2b36c44f72c3333e3284 Author: Michael Tuexen AuthorDate: 2023-11-01 09:24:56 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:22:52 +0000 udplite: fix checksum computation on the sender side Don't fill the fields of the UDP/IP header not used for the checksum computation before performing the checksum computation. Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42275 (cherry picked from commit aa64a8f5c35c13b1c325f1a4597c987a37bec5da) --- sys/netinet/udp_usrreq.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 75dec9d5f5aa..4ea0efad3491 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1330,8 +1330,12 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, * into network format. */ ui = mtod(m, struct udpiphdr *); - bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ - ui->ui_v = IPVERSION << 4; + /* + * Filling only those fields of udpiphdr that participate in the + * checksum calculation. The rest must be zeroed and will be filled + * later. + */ + bzero(ui->ui_x1, sizeof(ui->ui_x1)); ui->ui_pr = pr; ui->ui_src = laddr; ui->ui_dst = faddr; @@ -1356,16 +1360,6 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, cscov_partial = (cscov == 0) ? 0 : 1; } - /* - * Set the Don't Fragment bit in the IP header. - */ - if (inp->inp_flags & INP_DONTFRAG) { - struct ip *ip; - - ip = (struct ip *)&ui->ui_i; - ip->ip_off |= htons(IP_DF); - } - if (inp->inp_socket->so_options & SO_DONTROUTE) ipflags |= IP_ROUTETOIF; if (inp->inp_socket->so_options & SO_BROADCAST) @@ -1399,9 +1393,16 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); } + /* + * After finishing the checksum computation, fill the remaining fields + * of udpiphdr. + */ + ((struct ip *)ui)->ip_v = IPVERSION; + ((struct ip *)ui)->ip_tos = tos; ((struct ip *)ui)->ip_len = htons(sizeof(struct udpiphdr) + len); - ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ - ((struct ip *)ui)->ip_tos = tos; /* XXX */ + if (inp->inp_flags & INP_DONTFRAG) + ((struct ip *)ui)->ip_off |= htons(IP_DF); + ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; UDPSTAT_INC(udps_opackets); /* From nobody Thu Jan 11 01:23:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RkS4SHbz56hL5; Thu, 11 Jan 2024 01:23: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 4T9RkS3wTRz4Sh0; Thu, 11 Jan 2024 01:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBUq6wHRy8TZjRisIVgj8Ri3P/eBB4UJKEiFg6Up3S4=; b=iZ5YK+pwTdpmsbhVn4vqjLQXnWuHALRsZZP09nZqt47jf2n3Svo9mRwsqRqHH9ZK4c5M/J kjQEDg673EBIjqexmWpLSwgF2qry70Wigunbfa0nxDfpGj+1Fyfu9zBPTjbuguYmqz02qW TwDuSAoytHqFjeL3JI3L4yIa1vYg0yAEQBxEQTj0TnbLqmIp33mr9kAyk+1nX3GvASbRPP MdBDxiAb027UUufOVOzp7GsMc/fFHeY9SWRx8dByvwPGH27HFYGGFeKN4khwE0HaFWnX6G EJT498yVS8Ov7G+Bh/P6xLg35qNz+E5ABffOfwWG0n3zcozvJngsnmmfDIawCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBUq6wHRy8TZjRisIVgj8Ri3P/eBB4UJKEiFg6Up3S4=; b=G8728ji1nXU02b+d5GK+xnWa79OjexotsRpZGQopo/ssf3JUTnv1sDlT/bpNmB6cbcGDXw PVx/dkVdXxQ1sWS709t7SW0niMXUuLh6chK8nVF4zdVwKs59qCsXbr24lYRHb6sQmpLFHB 7OY+5ToJ+ArQY/56HLcT02m0ex896haBFSaBE871tQUZf67A5WCvXjBgSipTkBOCh2H0wo uwynbMXL42pZKV7NSsnplC6CiQAoD29mOoTgJdyX5NIdonfgys3X+pmqFj5FJqTJZ3+Z+r hBy/7fKD0K+uiVg+OvyIDZFAnbEemQXmzMDxcBQuA7FXXogZMK+gIe1OTX2GpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936192; a=rsa-sha256; cv=none; b=w8dddyOKy7/fA6/+EzkawVG0Rp0BZ94bN3Hb4SftgswphmrVKUrGcGOieHnhCXd8naim4N 59Z4ElEY8aaTekTHGlCfhJMM+BIqy9JvvpnfLdZHLkt2qmVtyQ9k5fy2dQRseXgMiwwX/4 uzIe8F4zDh0lvhishV5QDPe2tdAdg0I/+doXYQ7yJK89fuHCKvkDA8BKkB2/+/awDdrJkw fUpexdTIVKHuwwWHUWJbMMRcPXUpmgqv+YNxEkiAC1rqP5muUmQj8c83PzRKKP3gGd8es9 cntW3CU3NUpRenMJg84dkNx1OegH6rEfgP/11ylMhcmZ7q2k8LeclqPhcRndGA== 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 4T9RkS31c3zyk3; Thu, 11 Jan 2024 01:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1NCVo088905; Thu, 11 Jan 2024 01:23:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1NCQj088902; Thu, 11 Jan 2024 01:23:12 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:23:12 GMT Message-Id: <202401110123.40B1NCQj088902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a4925f0f8cf7 - stable/14 - udplite: make socketoption available on IPv6 sockets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a4925f0f8cf76c32140d7c2077aa9628de20630f Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a4925f0f8cf76c32140d7c2077aa9628de20630f commit a4925f0f8cf76c32140d7c2077aa9628de20630f Author: Michael Tuexen AuthorDate: 2023-11-05 14:28:54 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:22:52 +0000 udplite: make socketoption available on IPv6 sockets This patch allows the IPPROTO_UDPLITE-level socket options UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on AF_INET6 sockets in addition to AF_INET sockets. Reviewed by: ae, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42430 (cherry picked from commit 03c3a70abe5e9fa259b954de78ae69229fa9c99f) --- sys/netinet/udp_usrreq.c | 8 ++++++++ sys/netinet6/udp6_usrreq.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 4ea0efad3491..7329600ecc79 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -897,6 +897,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); @@ -944,6 +948,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 35d68e164145..c8b38c24d193 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1243,7 +1243,7 @@ udp6_disconnect(struct socket *so) #define UDP6_PROTOSW \ .pr_type = SOCK_DGRAM, \ .pr_flags = PR_ATOMIC|PR_ADDR|PR_CAPATTACH, \ - .pr_ctloutput = ip6_ctloutput, \ + .pr_ctloutput = udp_ctloutput, \ .pr_abort = udp6_abort, \ .pr_attach = udp6_attach, \ .pr_bind = udp6_bind, \ From nobody Thu Jan 11 01:25:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RmX2c6Pz56hW6; Thu, 11 Jan 2024 01:25: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 4T9RmX1nG3z4T6c; Thu, 11 Jan 2024 01:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nZ6PYsSVVdSwaZLSNJEbsJPx4GYvzVv0MDuHkcuW+k0=; b=rnMAzBTa6JgJqjy7jhIUJMYcbdpMFaJVhLKZm7Gb19wdQI3QfKZy1+HPO1W6RBKDWQDBbN lIiOc1SRlfCbV09+OPP4KmgMOysJS2ZGIYqfHOyIHwfQV1TvgpsEQowBEOM0ggAMYf40qn Krh9oaqqIUeV+1z5ymnj/Qhx4npEDLwO8H/GQRvFPjeNu42+5SYsOqgLM+8ClpY6K/oRBm r423nI7C5Y54w1vtIDw8FTogFbrdFK9Mt7Nol91LCTTjBUbKXM0edmpUtOS7xuHpsSoXPa NqPuhjvOCILVM4qdWuhVVCSg4FqXmHovC0VOGXeYmbpN/P3TpvM5BBXOHVthWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nZ6PYsSVVdSwaZLSNJEbsJPx4GYvzVv0MDuHkcuW+k0=; b=FSH57zQl6Vr6JVoPHevZd7mglRRUq6+T97cLcmbUhoLLIfoI5yzVcgj1m6Pr4fDUl36cl3 rHamrW9bEONcIXUC5TI3ShiygIHOWF6f0TTcN38sUF+z1P8aPMvzcgK2oHrgkn0Kry1Mzj fCjFDw1ZzOf3uQQv9YbqYl5zh78oVgbpyPVrLiI8M1Lqv7BYn5vyn99DjsJmJ9vCrqNcMt MnkRIEpKV7PVZys8In6pXaksmZMt0MWr3SJBYN6jx95f/bGvm72HY321VTlDo1oikcFilI xe/o4lvAi+Uk8KjEPISuQmM1kfPurcEcqXS6sF+I0c44aWnIi/EpN04OD50T3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936300; a=rsa-sha256; cv=none; b=wHi/Wtbk7A+Pc01F607M3GIL/ftAC3ox4uo24PotyS+g+6a8vHlaMya690Zzo5+Mmkz7r8 gJZ5DhXmfiuedycts6g/AuNNEXEQK3am5UOvB3UUjyWEHM/4Uas6nryWcMV/1ZRNmVepXa Cw+rIpxdg7wlJtAVqJ67Nt/113XibwV3UwkQDknWHnCeLBV2wMT4iDl9KsiyCsgFpabfTz Sd4ToucgPKsBESvjePvDur6yzAp20IC1YIa+V2lSNUhxZJlWqcRgz7kRpILg6XTfmBKN3/ zpt/sfgEmagzLP2K66lHi5diefYkyQt7MFfD77tyjA3RTN2O9y6xxf7v6esPzw== 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 4T9RmX0qZhzyRj; Thu, 11 Jan 2024 01:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1P0T5089238; Thu, 11 Jan 2024 01:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1P083089235; Thu, 11 Jan 2024 01:25:00 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:25:00 GMT Message-Id: <202401110125.40B1P083089235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 01641167c966 - stable/14 - efibootmgr: provide explicit error message if run as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 01641167c9660e98122c3f6174878d534a83b57e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=01641167c9660e98122c3f6174878d534a83b57e commit 01641167c9660e98122c3f6174878d534a83b57e Author: Ed Maste AuthorDate: 2023-10-15 17:21:52 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:23:56 +0000 efibootmgr: provide explicit error message if run as non-root This should be less confusing for new users. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42213 (cherry picked from commit c08ba4a588d517e3c5fe00cee0927294d2490993) --- usr.sbin/efibootmgr/efibootmgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index b0d023e3539c..8dcf9876486d 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1101,8 +1101,11 @@ main(int argc, char *argv[]) /* * find_dev can operate without any efi variables */ - if (!efi_variables_supported() && !opts.find_dev) - errx(1, "efi variables not supported on this system. root? kldload efirt?"); + if (!efi_variables_supported() && !opts.find_dev) { + if (errno == EACCES && geteuid() != 0) + errx(1, "must be run as root"); + errx(1, "efi variables not supported on this system. kldload efirt?"); + } read_vars(); From nobody Thu Jan 11 01:25:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RmY3X4Cz56hCt; Thu, 11 Jan 2024 01:25: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 4T9RmY2kp5z4TBP; Thu, 11 Jan 2024 01:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ncvc1W1H0e4qVKLPA+HNHci+LZqH0g/ihXRCmaF4R8I=; b=SiQd5i41j8BlsCwjP275ffUqmJPHJHhGObfxGg4DTOSdGIY7yg8SnHQFpHj1a8VPf2mlrB 0+HhIpC8oMu/eqyueXQpxVIkJ+g053TSNsv/hwn/ycWoHOqWT0ONqBXbPo5GfQ9Xjjxsq7 U6MMjer06Zkov0FmV/Ttzg1Kb9PahG7bc9lL5jxoEj+k85FbfxXcCd4igimU2PmSJp08gM zOTluPGMpWDus7NBLs+CGj67pRLTI9zFqBqUYFynir1Bur3lzy4JlP9TXC40sWpJFysnfR ONU+letZKjwYseJ/vIquBHfG7fW1IeP/9NlZJsLWGEVmZ5JtCpWqXwjEN7RCuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ncvc1W1H0e4qVKLPA+HNHci+LZqH0g/ihXRCmaF4R8I=; b=oFTSiBCK/v+JNEUAG9yhON3HTUcbkyNtKEyxofytvMNhptO97t6X/UoKvDrZtJYxxRIPUo +I+WYX9jtL+m47H/NghbNkpPTrkHlmXQhXnE5dvjWcH4DqmTnUYeh3VKYaW103wCfbE9iM z5nfaKLktLDpMNCy6LBnwUKGeOpmggyAMBNJLwuUnSDrxvvcTmePmcm8GfmbDC6eI/QXsE zbvjQA9VXCqId2SA4uRDEkFWwEBRdr0sqd7YIBb8b7XzGqqwjeqiXDGzvqapp9RVo87ywd pzoxdyrVaR0PAIM2XhdXTFactb8dq3P1hvPJT43oX3O1mJFSIGyOV6L/Mpf2FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936301; a=rsa-sha256; cv=none; b=p+fz6A+mvwYvhKDkfqi0FgTbYxk4CTcS7vKfRgVZmPBkzOWwqjKvFXuMBv1yi4Zkhpi/RE tYA88jW4zhvjL6n4f07AgJPA+TewZeXQWa6khNsFw5AmZQwb7jtTQhKVyaQY45Dmq6jHOL 8+QSa7YHjoTmqW/KOADAaS0aP8LqOXf5UDj6M6m/kO+fIhG8XcT+b2y8P22D2dlR6Ohoyw 7/nb0Feskqh+TRxciQ0rHzG0NZfdq89gUvy+cJIZI/+z+oDkoEoVkl4rp4aT/hM/mEWUQ1 /nim6AYI06xhnYXkS/dR/U+69XJ/xgviM0XyKSXDkWt1YcxEMdBxqJV5uY3FPQ== 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 4T9RmY1qx8zywR; Thu, 11 Jan 2024 01:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1P1io089287; Thu, 11 Jan 2024 01:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1P1KN089284; Thu, 11 Jan 2024 01:25:01 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:25:01 GMT Message-Id: <202401110125.40B1P1KN089284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b4d11915c73f - stable/14 - intrng: switch from MAXCPU to mp_ncpus List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b4d11915c73f199501672b278be86e1f63790036 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b4d11915c73f199501672b278be86e1f63790036 commit b4d11915c73f199501672b278be86e1f63790036 Author: Elliott Mitchell AuthorDate: 2023-09-26 17:06:04 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:23:56 +0000 intrng: switch from MAXCPU to mp_ncpus MAXCPU could be on the large side, while the hardware may not have many processors at all. As such only allocate counters for processors which actually exist, rather than always allocating for the maximum potentially allowed number. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D41462 (cherry picked from commit 2f0b059eeafc545a4ab1835d6a5290e1e2ebb47f) --- sys/kern/subr_intr.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 6535c42f2404..49fe20cdc890 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) /* * - 2 counters for each I/O interrupt. - * - MAXCPU counters for each IPI counters for SMP. + * - mp_maxid + 1 counters for each IPI counters for SMP. */ nintrcnt = intr_nirq * 2; #ifdef SMP - nintrcnt += INTR_IPI_COUNT * MAXCPU; + nintrcnt += INTR_IPI_COUNT * (mp_maxid + 1); #endif intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) mtx_lock(&isrc_table_lock); /* - * We should never have a problem finding MAXCPU contiguous counters, - * in practice. Interrupts will be allocated sequentially during boot, - * so the array should fill from low to high index. Once reserved, the - * IPI counters will never be released. Similarly, we will not need to - * allocate more IPIs once the system is running. + * We should never have a problem finding mp_maxid + 1 contiguous + * counters, in practice. Interrupts will be allocated sequentially + * during boot, so the array should fill from low to high index. Once + * reserved, the IPI counters will never be released. Similarly, we + * will not need to allocate more IPIs once the system is running. */ - bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); + bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); if (index == -1) panic("Failed to allocate %d counters. Array exhausted?", - MAXCPU); - bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); - for (i = 0; i < MAXCPU; i++) { + mp_maxid + 1); + bit_nset(intrcnt_bitmap, index, index + mp_maxid); + for (i = 0; i < mp_maxid + 1; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } From nobody Thu Jan 11 01:28:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9Rrg2Tr4z56hYM; Thu, 11 Jan 2024 01:28: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 4T9Rrg1j7dz4Tpv; Thu, 11 Jan 2024 01:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+n95o/CxJTweVosF04FW2kFAWVau1WHO2UbTmvGuzM=; b=WrPglSiMOpGrbekizd04WUvR6m3ROOl167/jhEQat3vuJRSGA7mqhyhGWajNrHjJkDer0G YsvZEiBztL60BV/xUincYhdELT33grYxdotQ9gcMWQk6cEGMaQpM8YJldqIRsvlp+NrCAO BciPqCLNpL50RgFcZPOyNUcSxdBl2ZJwdm/LuAaziWiha/hseF1PpIBmEaTV3gtUZ0o0TY uD1GtGqon81MiLu0UIBhHxD5sx7SeBtQjjcXftSnmXformZNNESZpXqOejLFj31kvW5gqP zDlEA/txnAkwKnNbRuSCYtwkvxOcTISYRu3oLh0/PU35+8a+9wMtca4I5RCW7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+n95o/CxJTweVosF04FW2kFAWVau1WHO2UbTmvGuzM=; b=Vrcv0z2w7VNj+zghx0vrdt3UsLvklGe4NAvF6QdfURUg/3jrRhFTqnOLWNKGkslQ7iIBJs RgpzxOWLBhHq9ayI7GCqgadG00wjT+EcjH7iQ9M483M4aqBUuGw87FQ+b65/EBgJlPFlGu GIAfGSQ/825pyv6GJiTPdrKXVyUCMJ0bW/y3AxZAjz0lMtimCubgHh6V1AEy/s3qDuKb4v OPFi6KtMb4kNrt5nFUP7sY6W6MYkeuChFB3jVGRfATkE2VHXdmb+ohO2+yfcplxmEeOzTi BCAl3N64XpCvfpM7QXQgu//7fDGaiIhyePQpEkUbGXyIY7eujr7IR6Z+scnTgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936515; a=rsa-sha256; cv=none; b=el3p5U3RM2xngPko6cLpqE1fObztCPbmtgvRjmhXvhestTIRGKkw3XaVjtId4GR91GnbQ7 9U73YeE+L9nOGgiMgNRqMWK9ypJ+L4nBRP6CePmcf/leKd7xzYmJfn7c9VU1NS5lwX2BuQ LOrP2HM5IjNH/O38nwgmXyVFOJWJc1DIbqreyiGSOjXAh6VJLDfxdTjAL8U8cd9zZxWgO6 ukWH/bX+zSqr8YFDbfF6RmeSU+t7iImy8B8vQqGBjgveqAlWu9yBW97EvS2ARKPk4WjAw6 qaz0X1IihLi9Dplpjy85qoEkrFoWyOjEGPxuyPErHcludqbIqx17KKaSwdU7Rg== 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 4T9Rrg0mLjzymT; Thu, 11 Jan 2024 01:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1SZfc089894; Thu, 11 Jan 2024 01:28:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1SZoM089891; Thu, 11 Jan 2024 01:28:35 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:28:35 GMT Message-Id: <202401110128.40B1SZoM089891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 47c22dcb5e2c - stable/13 - efibootmgr: add missing break for 'u' case List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 47c22dcb5e2cf6b4888517287f97ba81ecbbb29c Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=47c22dcb5e2cf6b4888517287f97ba81ecbbb29c commit 47c22dcb5e2cf6b4888517287f97ba81ecbbb29c Author: Ed Maste AuthorDate: 2023-02-23 14:52:14 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:28:27 +0000 efibootmgr: add missing break for 'u' case Reviewed by: imp, zlei Reported by: Coverity CID: 1505695 Fixes: 9a7915299484 ("efibootmgr: Add --efidev (-u) to dis...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38747 (cherry picked from commit 17a5a290032ef75ed4aa8a2aa68b3a7e08935c1c) --- usr.sbin/efibootmgr/efibootmgr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index b779d7572070..b0d023e3539c 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -287,6 +287,7 @@ parse_args(int argc, char *argv[]) case 'u': opts.find_dev = true; opts.dev = strdup(optarg); + break; case 'v': opts.verbose = true; break; From nobody Thu Jan 11 01:28:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9Rrh2stJz56hkL; Thu, 11 Jan 2024 01:28: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 4T9Rrh2SL1z4TsL; Thu, 11 Jan 2024 01:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k36IPm8tX540YWbqnsBsXDcynC+fPmoqES2HbU1CWSk=; b=vleTbp6Z9Kpy6RhB0BEJG7GKtpGKt8OVXRYesubvcxzFXuqUqywZtBxR7x/MSkgLTEiqnz 0llJIieuEs3fHjcBKwLlFT//Obwkz05ZssaGAk/TB3nk0kt8hXLc/JKch/qGmw5b59Chyn C+AhkkTJL72HrVziA5pI2tSt4y7uPYfQopSuJ3mr+l+phQKTAOyLyMIxxqqxpji6jvWMH1 n3YweDnDIzSMDAWjY76qSdyJRF6p/reJ8YRVpqNRSbQ+ySOEkjbzBe1EahxGb1eu2H0cgl Tf8HKBuqsEVBLn8K3ch8k/NlooYmtTgc3MwGUNtwIIr9oJ6EVrtamFnV4QmSTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k36IPm8tX540YWbqnsBsXDcynC+fPmoqES2HbU1CWSk=; b=sudSZDYDZoILd11YJaFSpYHOFbNf4MBlxLt2uNhrS+GX/1LcjEegvJPR4ego5QcLisrgjg xGb9CwrfdRU2jED0y8wMfeRZ8yBe3DsC7DTRHIgbQVAAUWRw0DDqkQsdH6j7xocxotvM1V K54GckZ5EJLQx1Q29foxHUKZ1vP7NlcQEFLRZ9iCOxdi5WB/egJV/6iZOgyOtsdiFHuBj8 Gf/TYxXcLQtVpYlDnr5j5fuzUKVRCsN7ls/JuIE3pwACiCHtH3HcDpK9bJB5hpu3euYsKi dNixxICZ0nhQnClG1oUDHiyYENrzWjEQ7mazi2MyONqkJ/+pYbHinKvykLJAmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936516; a=rsa-sha256; cv=none; b=dufdMKX5Xbm/3vCF8RzA4DwTp0Z7fpdY/o7Fqt/SrUsiKH90HWjpN7gNUjygO0Fj4EDpQT UIpMxWweGZeejuKjPpolWSlT+acX94omFmMtpw79fGfPLly4oDn/a8fuTiademO7OS3MoP xVsPMjTBdMXZV8IWVlibRIyPKzyOG0ySs8mwDnysnZoiY5OxwxiQ1z9MxQ/mAkl5SQxtxe 9JFYkxjEDzqFKjLGeV4B2PesKyWoclh9EE5FBfbyzMVbsSAImKmRhLWXY2imXbhK6huf6J uEt/N7wiE/WGbm1BF+3Vpzn4TB0yANRdI1nilIjleK4dhzCPvYNtvNJfArOReA== 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 4T9Rrh1YwkzywV; Thu, 11 Jan 2024 01:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1Sara089951; Thu, 11 Jan 2024 01:28:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1SaqN089948; Thu, 11 Jan 2024 01:28:36 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:28:36 GMT Message-Id: <202401110128.40B1SaqN089948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0b0e479d052e - stable/13 - efibootmgr: provide explicit error message if run as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b0e479d052e4018a90b1ca98f7bcffb8ffd817d Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0b0e479d052e4018a90b1ca98f7bcffb8ffd817d commit 0b0e479d052e4018a90b1ca98f7bcffb8ffd817d Author: Ed Maste AuthorDate: 2023-10-15 17:21:52 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:28:27 +0000 efibootmgr: provide explicit error message if run as non-root This should be less confusing for new users. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42213 (cherry picked from commit c08ba4a588d517e3c5fe00cee0927294d2490993) (cherry picked from commit 01641167c9660e98122c3f6174878d534a83b57e) --- usr.sbin/efibootmgr/efibootmgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index b0d023e3539c..8dcf9876486d 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1101,8 +1101,11 @@ main(int argc, char *argv[]) /* * find_dev can operate without any efi variables */ - if (!efi_variables_supported() && !opts.find_dev) - errx(1, "efi variables not supported on this system. root? kldload efirt?"); + if (!efi_variables_supported() && !opts.find_dev) { + if (errno == EACCES && geteuid() != 0) + errx(1, "must be run as root"); + errx(1, "efi variables not supported on this system. kldload efirt?"); + } read_vars(); From nobody Thu Jan 11 05:33:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YHS3915z56VSB; Thu, 11 Jan 2024 05:33: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 4T9YHS2bTdz45s7; Thu, 11 Jan 2024 05:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpMIfhMSNQ3e7kvim8Z6DWiRNJ/9t1fyVspI0XtKsRA=; b=lgOmLgNDIDw0chgyup/C4hdd68C4jM8cRTRr9S6E0gsBJFKq0g2LZ+n04NMZ/VgZmvBdak 9ZbUvztazng1FLtXqM5rqzfPKWhPG/yS6WJuky9nGDHsduzOlGDQcc6foVcRldqeydXloJ Z0tS75RgG3NEWzB3D+jjLfRMn56/RsDkb1HjEhkFS5IOlDrfmbgEwxMsUQDW5aLT9aURDA tGpA4yT4Wwfi82LRYHtJmPRHe1X2vCXyxpZRvd5C/lSOFTwZSLV5xUR+sfTaB2lD+7aGa+ xLtAGP+NM1LP6rEs+JEOG+uwW1nQkjqcWBiD81CmABQq+jN82YtmywoaDfjn8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpMIfhMSNQ3e7kvim8Z6DWiRNJ/9t1fyVspI0XtKsRA=; b=FiOSHuMRSbShN6nMWVtNGvntYJLhC98kJwjdFC1FOeff4IfjZXIZdUSNDWlJbsIVPc9vqc Kp8nHls/W6H9Uilj14C0D2BrR7YadfaBjPgvMsZAuEjEqY9qtGdhRahHHkZjaum+r0BJX8 lqCu/5lKfqhHbV9ajaYwThmBbHOSmcBhlxBY+Xpco5RLAX7s8/y9eyL46eRyiWIMqK/fqT 34uHbh8Jz03xZhJxDM16XE/Q/9Iw/Fx1nK4rCLopGFeS2QeoGDMvWXZF+hQyekobu5CBJg McupvcskAe8MWQHXTt6dcLSD3sJemXoymlnJmmCUOekbIx0Dmnv3fcUF0Azqag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951220; a=rsa-sha256; cv=none; b=mayiIJBqEXGSP4zGB0FamdhbntplNjZxE0djep7QkGn/950QdxKysl+0iwNRpVeKQamWAu cUHPj7aZ2HhhCObf/2/O+hiWs33FA0fLoVrgRr7X0pGk8FwGJkPmBecp8txEmG3jbuXWgp mdQk+puBI8Q5/QuihXcsqBdSqt3h4QuaAl852+JOcUsvbO9PHasy+opRnbU0djmIQq0TnA UZbnPxMbYhphNkiFXwjRQw7Xk3anqtum+7vmBgLl+RCCKXuxxHxHOevi1vuGMX4UPqJ/0O 7JrSmzqzWnBRQrtzLNSNlQl1JGN8kTpQ2dqpvhS026tX8wZ0ue7A9gg/gg+wUg== 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 4T9YHS1hKJz15W3; Thu, 11 Jan 2024 05:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Xe6P009230; Thu, 11 Jan 2024 05:33:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5Xeom009227; Thu, 11 Jan 2024 05:33:40 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:40 GMT Message-Id: <202401110533.40B5Xeom009227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 2a2aec721fff - stable/14 - cxgbe(4): Destroy the tick mutex during VI detach. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2a2aec721fff347d9603987a839b58040c67cab2 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2a2aec721fff347d9603987a839b58040c67cab2 commit 2a2aec721fff347d9603987a839b58040c67cab2 Author: Navdeep Parhar AuthorDate: 2023-12-27 21:00:29 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:30 +0000 cxgbe(4): Destroy the tick mutex during VI detach. This avoids a mutex reinitialization when the VI is detached and reattached. Fixes: 516fe911a6b7 cxgbe(4): Always use the per-VI callout to read interface stats. Sponsored by: Chelsio Communications (cherry picked from commit 8b144c015c9cce0bc99a7fbdc43f22f51a946d2c) --- sys/dev/cxgbe/t4_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index a32cd9a3f2df..570208e2c562 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2733,6 +2733,7 @@ cxgbe_vi_detach(struct vi_info *vi) #endif cxgbe_uninit_synchronized(vi); callout_drain(&vi->tick); + mtx_destroy(&vi->tick_mtx); sysctl_ctx_free(&vi->ctx); vi_full_uninit(vi); From nobody Thu Jan 11 05:33:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YHT47fRz56VXR; Thu, 11 Jan 2024 05:33: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 4T9YHT3jqFz46BG; Thu, 11 Jan 2024 05:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cE/b3WwNLlDkEx75nErSz5qusbhVUVzHECJmeYmawU=; b=hFEdwAHU4MjJkzPNL7m7fUOcJLG9yRu/AIH7eZ8UPKdrQNlKD3mvK/2T7WJFJYCP0iR+QL 6lDVvoZQHBtGENEz+gHHLHr02Ii+yOkCaLesOT6Yw4FIPRuDhgRX4eJHzhjjBTTfzJ6Djl XE7lNKcgipUlSrXgi40XWIe/9WrI/j7SCn/kUGWstSIkxDlPa7mOUo64iJl3/Udh+oxU7m w8UcMbxQhu8O/u9GppVqeZ7sP7s1kp4NzWkO19ER/AbNiVKT5sVxdIzKcjrfunGQr9Gtco RijuViMdDdLm9h5SF9b+pe0V/Aue1FT9ICfCBZmRXN3yqzXVPD3Is3xN22w2aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cE/b3WwNLlDkEx75nErSz5qusbhVUVzHECJmeYmawU=; b=nxxIpHSTPQsFYaJehLd2kp6OAE2EUtbxDL3cPjSWpjtmxEvluOTdZOjjxeF1JlSKGsLs8d HMtzpwsKyY9KcJkef8khPD5aRQFDW+3EaRGDlNlGC7rj19XoL+hp4ILXrklGD39QURja7R p3NDFzvDn6QzTekAX7BnNoGuzctIg6xFsq7WT6rIFZpxnxprbJU9iwt6sXkUYEBKNljLxm mvLLmJBV3orsivMQg6T9UvHV4SJs6YUXWpA+HAiKwmQ13fL/nRiw8EWonlX+cxM1EqafIZ uqM4hW+rdFD4WGeCOf+CvcIsrvbMuomuPCjdmp6ro+fCTX7hr2EciJrw/dMYHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951221; a=rsa-sha256; cv=none; b=pDPj/2eQyDJzigU5fdrK8ZOwO63W/UT4fN/h8/KC3PdO59tnJokM4Cm6UsDSaXPFO1lZdP TRB4BKAwLPHI1vxnmTdUU5+1glNLWNBjxaLPOXo5EPDcnCmcXvPWWroCsSTvcWzUIVGnKn eSGGXYc9eVtdNVofAKjKeYGRW5ylXBLrePXrZRDsUlLjJyzsMP+rfJh9i/C8S2yIoMqHY6 1xbZqQFOFyG4lFkEZtaS2X6AFe/DAB4RRTum+L5CZW9EGtQQhDGueueHtF9+eVzbv7TRUs AsU8uu+HQcBaHA9qDs6ju9ofhVxkn8wvtX+LYkiO9+WGL71/aaY85GWYX3d4hw== 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 4T9YHT2p8Xz15yw; Thu, 11 Jan 2024 05:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Xf0e009272; Thu, 11 Jan 2024 05:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5XfsZ009269; Thu, 11 Jan 2024 05:33:41 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:41 GMT Message-Id: <202401110533.40B5XfsZ009269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 7d98a455a3ea - stable/14 - cxgbe(4): Fix virtual interface reattach. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d98a455a3ea91eadbd3c84c6cd85314f5e29529 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=7d98a455a3ea91eadbd3c84c6cd85314f5e29529 commit 7d98a455a3ea91eadbd3c84c6cd85314f5e29529 Author: Navdeep Parhar AuthorDate: 2024-01-02 21:20:45 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:31 +0000 cxgbe(4): Fix virtual interface reattach. Replace the DOOMED flag with a transient DETACHING flag that is cleared when VI is detached. This fixes VI reattach when only the VI and not the parent nexus is detached. The old flag was never cleared and prevented subsequent synch op's related to the VI. PR: 275260 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D43287 Sponsored by: Chelsio Communications (cherry picked from commit 0201eb29dde9dccbf796f81fbf18f3b21798183d) --- sys/dev/cxgbe/adapter.h | 10 ++++++---- sys/dev/cxgbe/t4_main.c | 33 +++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index ddb8621a2300..c3105ecacffd 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -170,7 +170,7 @@ enum { FIXED_IFMEDIA = (1 << 4), /* ifmedia list doesn't change. */ /* VI flags */ - DOOMED = (1 << 0), + VI_DETACHING = (1 << 0), VI_INIT_DONE = (1 << 1), /* 1 << 2 is unused, was VI_SYSCTL_CTX */ TX_USES_VM_WR = (1 << 3), @@ -184,8 +184,9 @@ enum { DF_VERBOSE_SLOWINTR = (1 << 4), /* Chatty slow intr handler */ }; -#define IS_DOOMED(vi) ((vi)->flags & DOOMED) -#define SET_DOOMED(vi) do {(vi)->flags |= DOOMED;} while (0) +#define IS_DETACHING(vi) ((vi)->flags & VI_DETACHING) +#define SET_DETACHING(vi) do {(vi)->flags |= VI_DETACHING;} while (0) +#define CLR_DETACHING(vi) do {(vi)->flags &= ~VI_DETACHING;} while (0) #define IS_BUSY(sc) ((sc)->flags & CXGBE_BUSY) #define SET_BUSY(sc) do {(sc)->flags |= CXGBE_BUSY;} while (0) #define CLR_BUSY(sc) do {(sc)->flags &= ~CXGBE_BUSY;} while (0) @@ -1355,8 +1356,9 @@ int t4_map_bar_2(struct adapter *); int t4_setup_intr_handlers(struct adapter *); void t4_sysctls(struct adapter *); int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); -void doom_vi(struct adapter *, struct vi_info *); void end_synchronized_op(struct adapter *, int); +void begin_vi_detach(struct adapter *, struct vi_info *); +void end_vi_detach(struct adapter *, struct vi_info *); int update_mac_settings(if_t, int); int adapter_init(struct adapter *); int vi_init(struct vi_info *); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 570208e2c562..3b6cb7285e64 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2755,17 +2755,14 @@ cxgbe_detach(device_t dev) device_delete_children(dev); sysctl_ctx_free(&pi->ctx); - doom_vi(sc, &pi->vi[0]); - + begin_vi_detach(sc, &pi->vi[0]); if (pi->flags & HAS_TRACEQ) { sc->traceq = -1; /* cloner should not create ifnet */ t4_tracer_port_detach(sc); } - cxgbe_vi_detach(&pi->vi[0]); ifmedia_removeall(&pi->media); - - end_synchronized_op(sc, 0); + end_vi_detach(sc, &pi->vi[0]); return (0); } @@ -3595,12 +3592,10 @@ vcxgbe_detach(device_t dev) vi = device_get_softc(dev); sc = vi->adapter; - doom_vi(sc, vi); - + begin_vi_detach(sc, vi); cxgbe_vi_detach(vi); t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid); - - end_synchronized_op(sc, 0); + end_vi_detach(sc, vi); return (0); } @@ -6245,7 +6240,7 @@ begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags, ADAPTER_LOCK(sc); for (;;) { - if (vi && IS_DOOMED(vi)) { + if (vi && IS_DETACHING(vi)) { rc = ENXIO; goto done; } @@ -6284,14 +6279,13 @@ done: /* * Tell if_ioctl and if_init that the VI is going away. This is * special variant of begin_synchronized_op and must be paired with a - * call to end_synchronized_op. + * call to end_vi_detach. */ void -doom_vi(struct adapter *sc, struct vi_info *vi) +begin_vi_detach(struct adapter *sc, struct vi_info *vi) { - ADAPTER_LOCK(sc); - SET_DOOMED(vi); + SET_DETACHING(vi); wakeup(&sc->flags); while (IS_BUSY(sc)) mtx_sleep(&sc->flags, &sc->sc_lock, 0, "t4detach", 0); @@ -6304,6 +6298,17 @@ doom_vi(struct adapter *sc, struct vi_info *vi) ADAPTER_UNLOCK(sc); } +void +end_vi_detach(struct adapter *sc, struct vi_info *vi) +{ + ADAPTER_LOCK(sc); + KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); + CLR_BUSY(sc); + CLR_DETACHING(vi); + wakeup(&sc->flags); + ADAPTER_UNLOCK(sc); +} + /* * {begin|end}_synchronized_op must be called from the same thread. */ From nobody Thu Jan 11 05:33:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YHV6c8tz56Vdd; Thu, 11 Jan 2024 05:33: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 4T9YHV5nFQz46Yd; Thu, 11 Jan 2024 05:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nDccLs+Zkdm7MlK08wVhNUBwGotLwclhPVVpoh9pkJA=; b=AMWPJWIqmbfyxBYzoqAcspqHZqZSf5/sBfMSVIf8f4gP/VVtGroCE2AbeFKZVEmIxT3q89 2ph7iah29FSBOPGrHws8sxAxH+DePxqjVxhjGZWi8ngMTWdHgiM6P1zRaNnRkZUTtlGjQF yZHWwd68y/egevrHs2Q8HRoB7YpbEIYurAthKWgOYnO6bmqQxL8vgZAZ8fQU0MBLi1J49z GZySw6DxHnxo3T3I1QwxnyMElhxzIpwK4pnyrxeejSuLUMQP7z4Vib/m7vQXttFfgH59vO HaA6ZSZg81XEnY1pE96QAgMeecPqPzKGrvWP9JmVQfkK9oP+6bj5Kfbbiw+zoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nDccLs+Zkdm7MlK08wVhNUBwGotLwclhPVVpoh9pkJA=; b=HSCCvJPViT/nQlLyTgBXB+Vc6/Mrk68FzadcCHOIDbz6LOZn8fLCCFfqxX8gAk6riGudXs Z8ToJYzV46Io3Wvo73gdA+lwYQptwpWgzkY2hP6Me5BJKtskM5S8VbbTbhXQloqtiBvfcq OD/2sVF9De3K/lB/XE4dlT/Hs9yMF9/E6EiLw6aNihH1uX8S0SdOCl/hFgIzmpMvIJTL1u 8p3TLVRRkC47pPARNIionM4Ta0MBjYMVgTrpalZocnQhv4Tf9MHy6yaAxjcyq8zPxN80oy Kzrqr4wbcKJuBPh4pu/tc0JwJLiq8lugV/Sy/KsVDic2TTCn7Spc7istSbwAKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951222; a=rsa-sha256; cv=none; b=Ge3HgzTZoQhpLeR6qHmA9FQErsrqK2xRp/HMFGtB4CV/ryU+3IlSAkl5cNpStM2yKCgnld f+2y2Twa/v8gQKN/qE2SI8mQ69WU+PZCsHH9lvGecovOxwrtMQ6bCpFNcavPX0rbq3ykt9 xUmYCOW48j57LD7PFAM48+swdfMiecj0yaUJ+TnM+h3SELoOOHF30ftkLfsDvo4wkpTkgJ 0imgqvge9fg9Kgcnru/jErNHGBIYetTVbj2qEKFqJypgbC2y6UL4qK7Bo58xPUAZoL74mK uaOCavL7+si/xpU3f9sr7I1Bimstgi2Ku9Ske9Goq7eU7Fz3gUhwUDEdmofojw== 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 4T9YHV4q2hz15Z7; Thu, 11 Jan 2024 05:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5XgN9009323; Thu, 11 Jan 2024 05:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5Xg49009316; Thu, 11 Jan 2024 05:33:42 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:42 GMT Message-Id: <202401110533.40B5Xg49009316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c2628605787d - stable/14 - cxgbe(4): Update firmwares to 1.27.5.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c2628605787d3436d61503babb6aeb5f53751ea2 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c2628605787d3436d61503babb6aeb5f53751ea2 commit c2628605787d3436d61503babb6aeb5f53751ea2 Author: Navdeep Parhar AuthorDate: 2024-01-04 19:37:21 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:31 +0000 cxgbe(4): Update firmwares to 1.27.5.0 Version : 1.27.5.0 Date : 10/10/2023 ===================== Fixes ----- BASE: - Fixed handling the Remote Fault with AN, causing the link failure. ===================== Obtained from: Chelsio Communications Sponsored by: Chelsio Communications (cherry picked from commit b1e82d33193b83d86d46483b4ddfe295becd80c4) --- sys/conf/files | 6 +++--- .../{t4fw-1.27.4.0.bin => t4fw-1.27.5.0.bin} | Bin 570880 -> 570880 bytes sys/dev/cxgbe/firmware/t4fw_interface.h | 6 +++--- .../{t5fw-1.27.4.0.bin => t5fw-1.27.5.0.bin} | Bin 678912 -> 678912 bytes .../{t6fw-1.27.4.0.bin => t6fw-1.27.5.0.bin} | Bin 730624 -> 730624 bytes sys/modules/cxgbe/t4_firmware/Makefile | 2 +- sys/modules/cxgbe/t5_firmware/Makefile | 2 +- sys/modules/cxgbe/t6_firmware/Makefile | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index a8c1893b1341..39b68a79e20f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1455,7 +1455,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1489,7 +1489,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1523,7 +1523,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" diff --git a/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin similarity index 99% rename from sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin index 9addb9e25422..0c7842564913 100644 Binary files a/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t4fw_interface.h b/sys/dev/cxgbe/firmware/t4fw_interface.h index 0ebc404bb72e..686bb55d658b 100644 --- a/sys/dev/cxgbe/firmware/t4fw_interface.h +++ b/sys/dev/cxgbe/firmware/t4fw_interface.h @@ -10001,17 +10001,17 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 27, - T4FW_VERSION_MICRO = 4, + T4FW_VERSION_MICRO = 5, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 27, - T5FW_VERSION_MICRO = 4, + T5FW_VERSION_MICRO = 5, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 27, - T6FW_VERSION_MICRO = 4, + T6FW_VERSION_MICRO = 5, T6FW_VERSION_BUILD = 0, }; diff --git a/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin similarity index 59% rename from sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin index b32f270b1866..875f421c7523 100644 Binary files a/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin similarity index 76% rename from sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin index a47f287848f1..f951578d642b 100644 Binary files a/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin differ diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile index fb8eeb0d6c8e..15928bdb0207 100644 --- a/sys/modules/cxgbe/t4_firmware/Makefile +++ b/sys/modules/cxgbe/t4_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.27.4.0 +T4FW_VER= 1.27.5.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile index 2876d1a6b041..cf2c3e9006bd 100644 --- a/sys/modules/cxgbe/t5_firmware/Makefile +++ b/sys/modules/cxgbe/t5_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.27.4.0 +T5FW_VER= 1.27.5.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile index 7ac481c4bdb9..5bc7c8e8e0b6 100644 --- a/sys/modules/cxgbe/t6_firmware/Makefile +++ b/sys/modules/cxgbe/t6_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.27.4.0 +T6FW_VER= 1.27.5.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From nobody Thu Jan 11 05:33:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YHX1N2Pz56VZk; Thu, 11 Jan 2024 05:33: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 4T9YHW6gwxz468V; Thu, 11 Jan 2024 05:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uYY/V4YmXhg8tjUN9lmyYZjzAOtko+bGC5Exeos3kM=; b=Bwo048jOlJK5h+eEDFpKXQyHl+nZuWS/WzPr0zL5AXQh6wytF1Y45mZmegvxO+PBV9qYum OaKwHgA8sW6jrN5u19fEZy38LnSRWRPPSMSFhdxg0zHGHB5UAYNTs5ywf62pEKF1KyQwF7 lK5woJU0w0u5x5PDMcmfQVNxZWfsdui+Rtb3B6qic50bW939xGViQVUjpfJRGKqq0uBbKV Y68IClUBsEGGbDheJLezmdnd0oUiAB0Q+ELC7STg3jpP7ZAftDG/mEcNicqJDzrGHtQBUa QDJgA/dZf1txPhBJe8M1dj89l9JWOS4Bkn7s9tQwhvQDIuohUihdqFooz8efNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uYY/V4YmXhg8tjUN9lmyYZjzAOtko+bGC5Exeos3kM=; b=iG0iJ844rNxFO1Tlsk0nwoV8T+L+9w9mYUSu0yf2w94fqtzPpEdRGnUmOqm7P6J2J3VGtB BCZnkZ2m7+HjZSQCfQL6cWJtSm6iNP8waxjSpxytoCe9wXj5FzsPPH5FY/ZuNa8hbFSDco bAWJESqZ1HmH+NBIDPOF7SyaXiK/gSxPs1y+IzASfupsP453I0KcPsv/AoSChtD7q+pIUk HOPdysD+L01Y1btB5iGNuDBjV++oEzXwm6n4j0WfxFQRjpfAiRgBtldWVpRKny6nakc1Wo uh9bwMhy6RBZ/KLWA4U8p3KDraMJLcQxJ3j7aNBk7DHKMC8JehUjX8EVshQYwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951223; a=rsa-sha256; cv=none; b=U3Nu3prVzxSl0uQlLJdfdtWf7UmIJaWkvGmX0FJmk95ltDE/VDe8R64tlzNO2VGNqLTNtV b/YMcG+us6Y8c/tsIQfxgQuXeEr8t/brGM17ADwPmIDwBnxLmhV2+iTxpZlOWKBowaABYC p6Gb3lRPsSfNzdWjo+fJzTI5BCZcUHpxpuIgqGypH6A6WlVwQIF3NSa4MJ1GF9ePVaahtu vu05u20X+v6oaSyXLhmps6+BpJnZmakUr2vwXVPkABALhrv9HObOtNtZK3m/lzQobJwGvI V+Njvul3UPdE8mjAF+on+utDDz4QA/GIJ6zy+dEgepPMeWXGP93Y8rSiSqXJdQ== 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 4T9YHW5lsDz15yx; Thu, 11 Jan 2024 05:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Xhlg009369; Thu, 11 Jan 2024 05:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5Xheb009366; Thu, 11 Jan 2024 05:33:43 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:43 GMT Message-Id: <202401110533.40B5Xheb009366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c4bac077581e - stable/14 - cxgbe(4): Add support for netmap offsets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c4bac077581ee38a3c64cd3a76cb9dd974dd749b Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c4bac077581ee38a3c64cd3a76cb9dd974dd749b commit c4bac077581ee38a3c64cd3a76cb9dd974dd749b Author: Navdeep Parhar AuthorDate: 2024-01-05 01:39:31 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:31 +0000 cxgbe(4): Add support for netmap offsets. PR: 253069 Sponsored by: Chelsio Communications (cherry picked from commit df8a58b17a1907ed3b4597475d1cb8eacc9636de) --- sys/dev/cxgbe/t4_netmap.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 64fba4410364..0377f65acc3e 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -1003,7 +1003,7 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_txq, usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | V_ULPTX_NSGE(1)); usgl->len0 = htobe32(slot->len); - usgl->addr0 = htobe64(ba); + usgl->addr0 = htobe64(ba + nm_get_offset(kring, slot)); slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); cpl = (void *)(usgl + 1); @@ -1269,7 +1269,7 @@ cxgbe_nm_attach(struct vi_info *vi) bzero(&na, sizeof(na)); na.ifp = vi->ifp; - na.na_flags = NAF_BDG_MAYSLEEP; + na.na_flags = NAF_BDG_MAYSLEEP | NAF_OFFSETS; /* Netmap doesn't know about the space reserved for the status page. */ na.num_tx_desc = vi->qsize_txq - sc->params.sge.spg_len / EQ_ESIZE; @@ -1286,7 +1286,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - na.rx_buf_maxsize = MAX_MTU; + na.rx_buf_maxsize = MAX_MTU + sc->params.sge.fl_pktshift; netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ } @@ -1368,6 +1368,14 @@ service_nm_rxq(struct sge_nm_rxq *nm_rxq) handle_nm_sge_egr_update(sc, ifp, cpl); break; case CPL_RX_PKT: + /* + * Note that the application must have netmap + * offsets (NETMAP_REQ_OPT_OFFSETS) enabled on + * the ring or its rx will not work correctly + * when fl_pktshift > 0. + */ + nm_write_offset(kring, &ring->slot[fl_cidx], + sc->params.sge.fl_pktshift); ring->slot[fl_cidx].len = G_RSPD_LEN(lq) - sc->params.sge.fl_pktshift; ring->slot[fl_cidx].flags = 0; From nobody Thu Jan 11 05:33:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YHY35ZFz56VXT; Thu, 11 Jan 2024 05:33: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 4T9YHY19j1z46Tb; Thu, 11 Jan 2024 05:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rWnGoXc0s8pjboCHvLNxizV6DdvECthyps2jbXtP5sw=; b=Lkse7w0ruEd0K9FaDf1K/Q8feAZnjxFrsf7BMrpTgNqOlJq2jzF/Dewm8+StzF7+htPeNt RyX13tD7+CiVSiRs4boLlQET/Lnp9HDWVenwnKsLEEVQUSFVzItmMNtlxZs5OtgFw0Ehds W/aRU2qCEqjC7aZsQ6PArc3qNo6brcTiN6Lq9QrXgPqRG5pOEKGDlwJcg++AlIKTuVy+0s aYKeDbIS90X7dO1EWxl7k8YoQo6E3w62VgdzUy6S1hIB8+YAh8MEEx3ZlVRqbUAtuG0Ud/ tErUwzOcJFqJdiBWWjAr//9aQEGe+NEGAYODSA0BgC2MFLQngh/JXoWaY1w+8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rWnGoXc0s8pjboCHvLNxizV6DdvECthyps2jbXtP5sw=; b=DaYK1Gshha+0BAzaWEdyIHC4O0PI+j6QBOQjA4AZO0kBpbbjLqVJnCR00r/HSevGpiU1zK TvGccom5jxB4obI52ZqhCNiDCeDKCPILb9VUuReUpzXH/BcH3sSrrD7oAaAgOgEen7AM0H oiA8+Xkji/pe2Q5FOw7xPGle+BF7pS5ErZBFRznw9nesPQx9ENBqlYplB4f5sMQc7zgFwI dDJa5OHxGg2zF6g93ETZQ3L9urgQdk6nSe35ipODyUmncHDD+20XsUWg4dOXKMZqbq72Jg tsFlh6B1FnYNWvbg00H/AqzmKP8UIHwMqCr/DYShbH2ut3TToO/idxBcw8Fbyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951225; a=rsa-sha256; cv=none; b=TsN1pu1brJKz6Rkusj76MZJAwpawon0emJq9bPAOXJT9XdtPdWeT49+CHL5SK+rFIomv1U 5jHye1d2GFW3SA3FB54PZegmYwTsnk33tloEtqQJk06kSkwHYEqAm/mnzPbal+sRe+nYkN HHfO3rXmmvogoYSc79me9OLfIAnEJEwDSNHXWKrm0+E8xnubgIvQjgRpfW+Z2tfael6IAQ TIMjDFXw1mNn463rRfKEbpgJEvv7S25tmyv5rZqJE0zgrn9OhsmuQQbLm8tWZKPSRmGJ5X Gn9JkFGFYB1kQoTjBpwXA9OiarMt2oK1IVoVU3Y/AKxscg4sBJy01cN/N2zb2g== 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 4T9YHY09wxz15yy; Thu, 11 Jan 2024 05:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Xirr009437; Thu, 11 Jan 2024 05:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5Xisd009434; Thu, 11 Jan 2024 05:33:44 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:44 GMT Message-Id: <202401110533.40B5Xisd009434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: d7623fdcf0f0 - stable/14 - cxgbe(4): Use the correct size for the CIM LA on the T6. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: d7623fdcf0f028773afae1b8e1d54c4cd7eccf40 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d7623fdcf0f028773afae1b8e1d54c4cd7eccf40 commit d7623fdcf0f028773afae1b8e1d54c4cd7eccf40 Author: Navdeep Parhar AuthorDate: 2024-01-09 21:22:16 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:31 +0000 cxgbe(4): Use the correct size for the CIM LA on the T6. The logic analyzer in the T6 CIM block has a different capture size than previous chips. Sponsored by: Chelsio Communications (cherry picked from commit 9ea86c8f67a65ca00f79f3cd83aa977b38589f39) --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 7 +++++-- sys/dev/cxgbe/common/t4_hw.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index cd1e648f8e59..0861e3df4bee 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -313,6 +313,7 @@ struct chip_params { u32 sge_fl_db; u16 mps_tcam_size; u16 rss_nentries; + u16 cim_la_size; }; /* VF-only parameters. */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 41063d5c7d76..c18243e4b681 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -9303,6 +9303,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = F_DBPRIO, .mps_tcam_size = NUM_MPS_CLS_SRAM_L_INSTANCES, .rss_nentries = RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE, }, { /* T5 */ @@ -9317,6 +9318,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = F_DBPRIO | F_DBTYPE, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, .rss_nentries = RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE, }, { /* T6 */ @@ -9331,6 +9333,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = 0, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, .rss_nentries = T6_RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE_T6, }, }; @@ -9386,11 +9389,11 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf) /* Cards with real ASICs have the chipid in the PCIe device id */ t4_os_pci_read_cfg2(adapter, PCI_DEVICE_ID, &device_id); if (device_id >> 12 == chip_id(adapter)) - adapter->params.cim_la_size = CIMLA_SIZE; + adapter->params.cim_la_size = adapter->chip_params->cim_la_size; else { /* FPGA */ adapter->params.fpga = 1; - adapter->params.cim_la_size = 2 * CIMLA_SIZE; + adapter->params.cim_la_size = 2 * adapter->chip_params->cim_la_size; } ret = get_vpd_params(adapter, &adapter->params.vpd, device_id, buf); diff --git a/sys/dev/cxgbe/common/t4_hw.h b/sys/dev/cxgbe/common/t4_hw.h index e943acb8dec9..79ec690cd5e6 100644 --- a/sys/dev/cxgbe/common/t4_hw.h +++ b/sys/dev/cxgbe/common/t4_hw.h @@ -66,7 +66,8 @@ enum { CIM_NUM_IBQ = 6, /* # of CIM IBQs */ CIM_NUM_OBQ = 6, /* # of CIM OBQs */ CIM_NUM_OBQ_T5 = 8, /* # of CIM OBQs for T5 adapter */ - CIMLA_SIZE = 2048, /* # of 32-bit words in CIM LA */ + CIMLA_SIZE = 256 * 8, /* 256 rows * ceil(235/32) 32-bit words */ + CIMLA_SIZE_T6 = 256 * 10, /* 256 rows * ceil(311/32) 32-bit words */ CIM_PIFLA_SIZE = 64, /* # of 192-bit words in CIM PIF LA */ CIM_MALA_SIZE = 64, /* # of 160-bit words in CIM MA LA */ CIM_IBQ_SIZE = 128, /* # of 128-bit words in a CIM IBQ */ From nobody Thu Jan 11 05:34:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJL0sLnz56Vgr; Thu, 11 Jan 2024 05:34:26 +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 4T9YJK62SXz47gp; Thu, 11 Jan 2024 05:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmJAy/+0Y+JH6sCFb4deoqMcgG1UQ7iUg4C8DzBtNBM=; b=lcVdJftNUlM8JI0ZsYpkolGIEMDMbQPeaBvU7Hhxu7wfXYLPEDDeIvgKo4h95pOxVVwOqW W6OKCv+VjN76BFBD28HBDWrvauF1UbSPrTKlCjUor3q5aphXuoL8ZPgBd0ShuqOFg+DWcJ lRv9neXHfHNPwe0wVzVzVrZjSkkzCbwQ8ay0iEdIN7sNIYACE+GRGBuENz+cNZXSAWfzqA grHChAU63Ri6Kx70x8ralIKS31ipUW+ew/1TG8mLt2xQvjEibKOaqZHE1iU3htAKtrjUnN q8bVPDz+AKN5+RLt1IKpmsVn+FC/QNDYdX9yqDpOS9E3+1I0Sn9qGkYKCHI5KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmJAy/+0Y+JH6sCFb4deoqMcgG1UQ7iUg4C8DzBtNBM=; b=h0jhDSvhVjK3OanMSv6WBvYnYebjkdIhX7oOGtNdx+/VA6pmIfQZEtq6TtuWx7RXsTa1oZ Yf5mfHKfFPTnb3ckJrH9fKFvbu+NHcevarqWB+zswdR+zrrNAFefY3NUT9f3yZQ/F7yAWE KWjM/wnrmabpmTxnId9nhgQlbOr4C7hzEfocRQZPdfGriD09uDsGd2MyRmwVMCUTNA4TuO vkdIWktzKMneDn/LuiEAZn6MUALGL/QeQNWB5kvxeUhWQSWRhnMYpTqNvwjHZjgVVuqlOk r6uPfjNH89vu9e8Zl+bBDtp8n/TTIRu/dY/L2ISck5o1fETJ+JXHP1y3aJSI1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951265; a=rsa-sha256; cv=none; b=s1LkBrR+AAjUP/fWPObIxo0ug9th7wqT/bZUTpErSDUot1885vNt9rxOS1/NNiRTkajsbT uK7l4ctZPjbdEzNPSYOWrumCV05xW9vD1la9xkf1Lpd/DAZylbG73TooFgU21eV6N0aBBm PaN6LXzcar9HVMrlju/z+6v/fOePZwbhq/SSQE0BQ8qdF3uCcNMV7jwG9wvBw61kESF1v0 Bvq1i7K2j3UJQqHu0h9Mq126H53L+H7WOaTwnTp9AR3Nh8i77k0gDBnsX6AX7oMvtihfGk fFZvCUB7KhT1xSiGbCK9oyT9cH5HZtfWel97r05yr1bOJYXLRncgsFDRM4qY5g== 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 4T9YJK4w3zz15DM; Thu, 11 Jan 2024 05:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YPjH009717; Thu, 11 Jan 2024 05:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YPF9009714; Thu, 11 Jan 2024 05:34:25 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:25 GMT Message-Id: <202401110534.40B5YPF9009714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 3368fcf147a7 - stable/13 - cxgbe(4): Remove dead code. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3368fcf147a7190018eb342dae90490915d9d219 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3368fcf147a7190018eb342dae90490915d9d219 commit 3368fcf147a7190018eb342dae90490915d9d219 Author: Navdeep Parhar AuthorDate: 2023-03-30 18:43:43 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:58 +0000 cxgbe(4): Remove dead code. Fixes: e7e084442227 cxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish. Sponsored by: Chelsio Communications (cherry picked from commit 21b778fbeb93d4b6a1e426cceb3b4d2c7e6e3dac) --- sys/dev/cxgbe/t4_sge.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 40fb54b4eecf..3e15e1507f68 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -78,11 +78,7 @@ #include "t4_l2t.h" #include "t4_mp_ring.h" -#ifdef T4_PKT_TIMESTAMP -#define RX_COPY_THRESHOLD (MINCLSIZE - 8) -#else #define RX_COPY_THRESHOLD MINCLSIZE -#endif /* Internal mbuf flags stored in PH_loc.eight[1]. */ #define MC_NOMAP 0x01 From nobody Thu Jan 11 05:34:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJM21d3z56VSr; Thu, 11 Jan 2024 05:34: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 4T9YJL6pdZz47dW; Thu, 11 Jan 2024 05:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0NZbHd34HDH3uEAZth6+WyQ7Ov/NOkKcmnbw4qLfw0=; b=RiXiKrIWGXthL0sbpaIwgE1MFpjc9lg0votZvBdQ4wX8Rf1FxOd++ZRSaFCbv0ERn9c+ja R+ZUuUeaf9pidG9OWsGQ2pR7EQG9PtGXrLiwkRVpaStWcAl0KfKIxfljhLsWBCcgGHDlIt yEt4err2UA9i/9LMHLAepLEbq07Z/dG/w6zuHUCZ/cciTSd+N7E1Uzf0FB25QDRwYZ/3pe 4KrFjU96pzlXYTICS2FgIcWzciPs0UEE6Ht4a5iNySOaZyHwuEJttaYQAjWxC0qLFJB0T9 6GVRYPfmzmLcavtgVpJ5mE0YzOH8tfepq72FEimD0ePj5Ko3/L5mH6/vxqEK6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0NZbHd34HDH3uEAZth6+WyQ7Ov/NOkKcmnbw4qLfw0=; b=GFrP2NRQ0Avg/katyB4vV6z/N0J4CRZRNy+lwDZjwQ9RN4HelJDwfGfl1cbqk7YYexBFYP lKsM810FaX/EtcCpa8qkm8r75+dyD4RUgHY2VRR+phORdiUz3pj5iicTFKL/bM/lpoUUI7 z84I2TaDAj8F7YsBjz+WL+lCxKeS4L94qevGys3b2lTXwWnUGLVpknOf9Sfa6/M7ceiDL7 /HB6ITq+WzWXqN0AQlisMDg1t1MQZnuxjc053IC3CvZC98sfBPdr0BGrEOdpHxsWiXNqLv Ttu+Bd0C6FGBEIxyy0i8gHVNBX0Morv+RfVvSvxL8QwhOGPHEaU3HsDRICp7oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951267; a=rsa-sha256; cv=none; b=iKUZnSmConCeQ6kge7TWTZ24eduirMI+DTKdOt/yQxgna7xNQTawUbiCZFSlTggK9IeL0T 9exUgoxEt+gMtsiXKUtnhnC5hKCm9GdW7sXfv9EbgMwEyeG5QI9ru7GHZmaFUIOxyjwekL PI98+4yuItYlhtPdwLraQxAfqiyPvflDTtdAz0kRUwXi5jhMwyLU0K9KetOtvI/SH9VERm Y14lhZHr+99JI05ZTQlBg0xdG6bGbne09YrTHzGVqpYuVpR0JIPeYU0mx7AFVCRLuT76zB 9H+/JqxKK2SgbkHWhrqZY/DmHJT5PkRAPXX1k0I5OIhvIByr+emRNkvyuL45XA== 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 4T9YJL5w1fz1601; Thu, 11 Jan 2024 05:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YQGa009765; Thu, 11 Jan 2024 05:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YQxb009762; Thu, 11 Jan 2024 05:34:26 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:26 GMT Message-Id: <202401110534.40B5YQxb009762@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 0e3fce67f1e5 - stable/13 - cxgbe(4): Allow tracing filters on loopback ports. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e3fce67f1e5899be93f334022803ce9a52e7a13 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=0e3fce67f1e5899be93f334022803ce9a52e7a13 commit 0e3fce67f1e5899be93f334022803ce9a52e7a13 Author: Navdeep Parhar AuthorDate: 2023-04-02 00:16:02 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:58 +0000 cxgbe(4): Allow tracing filters on loopback ports. Each physical port has an associated loopback tx channel and anything transmitted over that channel by the driver is looped back internally by the hardware as if received on that physical port. This change allows tracing filters to be installed in this loopback path. Sponsored by: Chelsio Communications (cherry picked from commit 9f354cd3d0170f0deba2a548e7894d48aa67ee23) --- sys/dev/cxgbe/t4_tracer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_tracer.c b/sys/dev/cxgbe/t4_tracer.c index db5b1d27becb..adb6d89b6362 100644 --- a/sys/dev/cxgbe/t4_tracer.c +++ b/sys/dev/cxgbe/t4_tracer.c @@ -387,7 +387,8 @@ t4_set_tracer(struct adapter *sc, struct t4_tracer *t) goto done; } tp.port = sc->port[t->tp.port - 4]->tx_chan + 4; - } + } else + tp.port = t->tp.port; tpp = &tp; done: if (rc == 0) { From nobody Thu Jan 11 05:34:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJN2mG0z56VXj; Thu, 11 Jan 2024 05:34:28 +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 4T9YJN13wVz47ws; Thu, 11 Jan 2024 05:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcdhsvNIsYS+oEc2yD5oQHxuuCcOCXe/oj6oh8PkKkk=; b=CTFcK85eh9QbieOqZ2GVlbPjQNfhuCz2+rZ1Lqu7W1r/Y5rIvyUPIU5cISp/vQZbl+rHJK a9JZ2nhQ1keJFEL7lnvCrcAistF2jXDp040hli1pJqubYUn/8FSpTsdzf02CYKsCvDwZVf xfV1xcOvx44/WCB1nBNLQpMQeFCHCr2AK3+NsNAC+hXDQuPBQcP6R2k2F5WSzs2iO3+elR auNcrZrxg+qZf3t2jpM4oEwGmazIqEs0ygroHAjKh1yYhMAc8NvR+9VSybDh2vq5mmAfht dPwJYDZ3/BluxR/xzQocZv9Axw5Qvcv7VP34XjddrQ0F0MuvTzcP5DDGLJa/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcdhsvNIsYS+oEc2yD5oQHxuuCcOCXe/oj6oh8PkKkk=; b=JWd07UJmJSTZX8V3O6SM1Qy2qwNPieq+Djzp2L4cUsD5QxLgXe+/N8+2uasGV3GzrJeVNX 7wbW5PM6mcUEWoM/P1YN7dVNg9rETRbmASeGint23lveNVekK9SzC19ZQYD+tkr5EKskAt T/v4IWPutnvnk99ns31qrJURSxA1dy3Hv5als4QoszTzbMYRnLWXHjJUcyVJm29cscA0S1 iXKI729MzEL3P4oewBU8e8ar3MXJjxnxuA3eVCjsjHlbmCUey4DsHiDn7HDkoQMfHw6A2+ 29qxWb8S4VwuoDxj0nMjsGJ0ycI7KoU3znW14G49WyI0rwZ0ncD2zsUZx9z3wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951268; a=rsa-sha256; cv=none; b=lhRJiBZEdZZe7yY3mcpq3jAbFmA4Nc4gUjkT5NxZ+U30czByGXwCE5rNPwPBVRCSAIsQhq 6pVvA7zC3fsYz5F1iV8axKFhNbgt5Q51T2b8YOCyo3iIMNsutFigxkQLntdnrXDRAFg2cC P6GRdFDvqvuLJcU1fDHwKe5HkzpWlvFI8VM2fOkMn76omVWum7UNue43+PUkJ0pIO3GNhA 7I1QfAi7vdnL9k064O8WRGbkj9/UlArM19BPWNOU7+1u2+4NpCqblDD0iWPnxJCHClLKPu +EmwWLzIPxNpNXqHGPWmRybwtmF/iLEMNePyFJKPsYCqac715xlfALVRxAGrog== 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 4T9YJM73qKz15S7; Thu, 11 Jan 2024 05:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YRLa009834; Thu, 11 Jan 2024 05:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YRuq009829; Thu, 11 Jan 2024 05:34:27 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:27 GMT Message-Id: <202401110534.40B5YRuq009829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: f0eedbcd8039 - stable/13 - cxgbetool(8): Add support for tracing loopback traffic for a port. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f0eedbcd80395190ff120b37beb59097827a1892 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f0eedbcd80395190ff120b37beb59097827a1892 commit f0eedbcd80395190ff120b37beb59097827a1892 Author: Navdeep Parhar AuthorDate: 2023-04-02 00:43:20 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:58 +0000 cxgbetool(8): Add support for tracing loopback traffic for a port. Use lo to tap the loopback for port . Sponsored by: Chelsio Communications (cherry picked from commit 4913a24e7910edf5a3f52536b780d1b1d4bb73a4) --- usr.sbin/cxgbetool/cxgbetool.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/usr.sbin/cxgbetool/cxgbetool.c b/usr.sbin/cxgbetool/cxgbetool.c index 6f9031240515..c02bc7fdc054 100644 --- a/usr.sbin/cxgbetool/cxgbetool.c +++ b/usr.sbin/cxgbetool/cxgbetool.c @@ -122,7 +122,7 @@ usage(FILE *fp) "\tsched-queue bind NIC queues to TX Scheduling class\n" "\tstdio interactive mode\n" "\ttcb read TCB\n" - "\ttracer tx|rx set and enable a tracer\n" + "\ttracer tx|rx|lo set and enable a tracer\n" "\ttracer disable|enable disable or enable a tracer\n" "\ttracer list list all tracers\n" ); @@ -2476,17 +2476,24 @@ set_tracer(uint8_t idx, int argc, const char *argv[]) t.valid = 1; if (argc != 1) { - warnx("must specify tx or rx."); + warnx("must specify one of tx/rx/lo"); return (EINVAL); } len = strlen(argv[0]); if (len != 3) { - warnx("argument must be 3 characters (tx or rx)"); + warnx("argument must be 3 characters (tx/rx/lo). eg. tx0"); return (EINVAL); } - if (strncmp(argv[0], "tx", 2) == 0) { + if (strncmp(argv[0], "lo", 2) == 0) { + port = argv[0][2] - '0'; + if (port < 0 || port > 3) { + warnx("'%c' in %s is invalid", argv[0][2], argv[0]); + return (EINVAL); + } + port += 8; + } else if (strncmp(argv[0], "tx", 2) == 0) { port = argv[0][2] - '0'; if (port < 0 || port > 3) { warnx("'%c' in %s is invalid", argv[0][2], argv[0]); From nobody Thu Jan 11 05:34:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJP3mclz56VfH; Thu, 11 Jan 2024 05:34: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 4T9YJP1c3Mz47pF; Thu, 11 Jan 2024 05:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FVlkx0hXvihMja/WYDThAl5vS6ut7kxMs9R9r4zAuRo=; b=H7XgtTreu8zFnJ5EAjIbed7reiEGRSZzPTu0w36KiXmF0sYTm8pNFKcyEZMfC9QazPFmiV Mqs+e4F8tD5kSudQZfA5LCGwc/hSmvKIw/Ul9Kryo1vhWABtqzwa5UUUxfbYZyF1zK3EHK L3gsWK7LHzBVTFQSDo8ddiMBZC17TBgGMDcf4uQltB7nut0UEQMx6fxSayYXjqRfd24YT9 lvzRAmqVX1H8VPqrsZIJYhvxCxbe3UKG816dvZy5waBYK3PSBR16Ux6HR0EDWVcbhWRryT wUdt5vlR137T0pxVVbc1HQQjiULcMuSAjA6av2gk+uZLkw1tHMNU6jrr2jetyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FVlkx0hXvihMja/WYDThAl5vS6ut7kxMs9R9r4zAuRo=; b=QYEbGKoMstWktNlmrjpWgwLVsmMYCuqZRbt4dlrLhs0sN2mcVX+2YfuMZqQ2mcyRMUuIfu D7jgl1JR69WyhbAtfCejsbDthLLzlbi61nP324xIQkHgbl5MdlmU31wc+14luL477jw0if Rm8jDdRGkdpqKK90AvC/XgYMN5krIFHWjXSjDBZLMJ+6GoUPHF4O9ITvLnjMXAJ1Mfl1oI oShB0+o4be2czf7ZEp9QC2tXjiymDIcX143zIrcWhDAjxhpIWBksdjiD8XmLMt5WXd0UIR M7jm8L5+1oxBNp66o8XX2fQYOSDBEEIhIJHiU3naNBKAlPHF/OUyc9qaTXigzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951269; a=rsa-sha256; cv=none; b=oIPFhh/dz79P+wJEt5YKjJ9D1b5UZubkvu5vFU7tnEOh/KRKxp0whpRWNipSx++l8AUwDa hblFU9D+w04tRs/PhDoZUDeONKHzBWptdni9s8CTr6TIiyaCN730J/l/iFXlL3MgvdBVTa gsPSVmLejpnRo5xIm/EXw9OvTpPgCNfJNSD2ZMotwWtZdlbDTsteENdqtBUry4gcAzf4nX ffCX4pqjra9kAzmt0npuApOuTLgkV0cVoVVt9j+rYXzFtZuf1fUjv7/W6tGIlYPiipj3mz qsNA9/9jqbiwEGbPnJ9rS4Q7/mmNwJrSIqN+dKtF/qT0KFa18y68fISuTXiQxQ== 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 4T9YJP0jFxz15S8; Thu, 11 Jan 2024 05:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YT48009892; Thu, 11 Jan 2024 05:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YTtV009889; Thu, 11 Jan 2024 05:34:29 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:29 GMT Message-Id: <202401110534.40B5YTtV009889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 8b7e008183c9 - stable/13 - cxgbe/iw_cxgbe: debug routines to dump STAG (steering tag) entries. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b7e008183c94f8763c18390a9dc95c75b5f55b3 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=8b7e008183c94f8763c18390a9dc95c75b5f55b3 commit 8b7e008183c94f8763c18390a9dc95c75b5f55b3 Author: Navdeep Parhar AuthorDate: 2023-04-06 17:52:15 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:58 +0000 cxgbe/iw_cxgbe: debug routines to dump STAG (steering tag) entries. t4_dump_stag to dump hw state for a known STAG. t4_dump_all_stag to dump hw state for all valid STAGs. This routine walks the entire STAG region looking for valid entries and this can take a while for some configurations. Sponsored by: Chelsio Communications (cherry picked from commit 7adf138ba9b90db5ed0f1e8cd68e787fb63fa760) --- sys/dev/cxgbe/iw_cxgbe/ev.c | 82 ++++++++++++++++++++++++++++++++++++--- sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h | 2 + 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/ev.c b/sys/dev/cxgbe/iw_cxgbe/ev.c index f163fb27ed44..7185bda1e2ed 100644 --- a/sys/dev/cxgbe/iw_cxgbe/ev.c +++ b/sys/dev/cxgbe/iw_cxgbe/ev.c @@ -39,6 +39,82 @@ #include "iw_cxgbe.h" +static void print_tpte(struct adapter *sc, const u32 stag, + const struct fw_ri_tpte *tpte) +{ + const __be64 *p = (const void *)tpte; + + CH_ERR(sc, "stag idx 0x%x valid %d key 0x%x state %d pdid %d " + "perm 0x%x ps %d len 0x%016llx va 0x%016llx\n", + stag & 0xffffff00, + G_FW_RI_TPTE_VALID(ntohl(tpte->valid_to_pdid)), + G_FW_RI_TPTE_STAGKEY(ntohl(tpte->valid_to_pdid)), + G_FW_RI_TPTE_STAGSTATE(ntohl(tpte->valid_to_pdid)), + G_FW_RI_TPTE_PDID(ntohl(tpte->valid_to_pdid)), + G_FW_RI_TPTE_PERM(ntohl(tpte->locread_to_qpid)), + G_FW_RI_TPTE_PS(ntohl(tpte->locread_to_qpid)), + (long long)(((u64)ntohl(tpte->len_hi) << 32) | ntohl(tpte->len_lo)), + (long long)(((u64)ntohl(tpte->va_hi) << 32) | ntohl(tpte->va_lo_fbo))); + CH_ERR(sc, "stag idx 0x%x: %016llx %016llx %016llx %016llx\n", + stag & 0xffffff00, + (long long)be64_to_cpu(p[0]), (long long)be64_to_cpu(p[1]), + (long long)be64_to_cpu(p[2]), (long long)be64_to_cpu(p[3])); +} + +void t4_dump_stag(struct adapter *sc, const u32 stag) +{ + struct fw_ri_tpte tpte __aligned(sizeof(__be64)) = {0}; + const u32 offset = sc->vres.stag.start + ((stag >> 8) * 32); + + if (offset > sc->vres.stag.start + sc->vres.stag.size - 32) { + CH_ERR(sc, "stag 0x%x is invalid for current configuration.\n", + stag); + return; + } + read_via_memwin(sc, 0, offset, (u32 *)&tpte, 32); + print_tpte(sc, stag, &tpte); +} + +void t4_dump_all_stag(struct adapter *sc) +{ + struct fw_ri_tpte tpte __aligned(sizeof(__be64)) = {0}; + const u32 first = sc->vres.stag.start; + const u32 last = first + sc->vres.stag.size - 32; + u32 offset, i; + + for (i = 0, offset = first; offset <= last; i++, offset += 32) { + tpte.valid_to_pdid = 0; + read_via_memwin(sc, 0, offset, (u32 *)&tpte, 4); + if (tpte.valid_to_pdid != 0) { + read_via_memwin(sc, 0, offset, (u32 *)&tpte, 32); + print_tpte(sc, i << 8, &tpte); + } + } +} + +static void dump_err_cqe(struct c4iw_dev *dev, struct t4_cqe *err_cqe) +{ + struct adapter *sc = dev->rdev.adap; + __be64 *p = (void *)err_cqe; + + CH_ERR(sc, "AE qpid 0x%x opcode %d status 0x%x " + "type %d wrid.hi 0x%x wrid.lo 0x%x\n", + CQE_QPID(err_cqe), CQE_OPCODE(err_cqe), + CQE_STATUS(err_cqe), CQE_TYPE(err_cqe), + CQE_WRID_HI(err_cqe), CQE_WRID_LOW(err_cqe)); + CH_ERR(sc, "%016llx %016llx %016llx %016llx\n", + (long long)be64_to_cpu(p[0]), (long long)be64_to_cpu(p[1]), + (long long)be64_to_cpu(p[2]), (long long)be64_to_cpu(p[3])); + + /* + * Ingress WRITE and READ_RESP errors provide + * the offending stag, so parse and log it. + */ + if (RQ_TYPE(err_cqe) && (CQE_OPCODE(err_cqe) == FW_RI_RDMA_WRITE || + CQE_OPCODE(err_cqe) == FW_RI_READ_RESP)) + t4_dump_stag(sc, CQE_WRID_STAG(err_cqe)); +} + static void post_qp_event(struct c4iw_dev *dev, struct c4iw_cq *chp, struct c4iw_qp *qhp, struct t4_cqe *err_cqe, @@ -56,11 +132,7 @@ static void post_qp_event(struct c4iw_dev *dev, struct c4iw_cq *chp, return; } - printf("AE qpid 0x%x opcode %d status 0x%x " - "type %d wrid.hi 0x%x wrid.lo 0x%x\n", - CQE_QPID(err_cqe), CQE_OPCODE(err_cqe), - CQE_STATUS(err_cqe), CQE_TYPE(err_cqe), - CQE_WRID_HI(err_cqe), CQE_WRID_LOW(err_cqe)); + dump_err_cqe(dev, err_cqe); if (qhp->attr.state == C4IW_QP_STATE_RTS) { attrs.next_state = C4IW_QP_STATE_TERMINATE; diff --git a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h index 89b05fd0a2e3..2e6abf6171c0 100644 --- a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h +++ b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h @@ -984,4 +984,6 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx); void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid, struct c4iw_dev_ucontext *uctx); void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe); +void t4_dump_stag(struct adapter *sc, const u32 stag); +void t4_dump_all_stag(struct adapter *sc); #endif From nobody Thu Jan 11 05:34:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJQ4whtz56Vmj; Thu, 11 Jan 2024 05:34:30 +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 4T9YJQ2Xsbz47th; Thu, 11 Jan 2024 05:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPHiN71a+5mnry5zAWzYFP7teUUY54q1+qQ5HH3A7fc=; b=JcMwFbLhb0aZ5NevSzchk8R80A8/BHWF78fJRUGz8k2LI/yh5AidJSEL6ChfpWSi+NlE2g VOZ1pGp+sb4w1ddJtdTKGrUAY3SZVBkfB+1Kb7dm906eeWkmSNEfPx3Medc7rk6D000PMN m7njuP7hHDMWZTHUnxeLA6Eb6PFCiAyPkC8q+onF938LFdG4kIagd9Pm1g7Wny9/VQt+vg SiRZRGwQ1l/utSdQVOl2YukOS48EzSUrQiKwKJQy549Lys7zUtvLXDzNlrcIjVCctyEMay 7Gh2M1MibL75NELWBUWiyVE67tyXA6sBoBckIWas7QvRZtawDRog3LMU7pm3Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPHiN71a+5mnry5zAWzYFP7teUUY54q1+qQ5HH3A7fc=; b=K12kCxyhcTsjWwfr7gc5n7RguHFen5ff5jcUIZ7yHC1XMHc/25JEC6zuARMVdJ/czNrPUw iYaFR7G9nl2k0Z/iQ9JEVLqfxSbbIuUyjkjZQou69e9cGXoHmFTEsF7sZoMWy3x2uHAtb3 YJ8rPFZBi93hfsTQHr3YCk3etKAnbcKCSt+n0glQF/G/P49yMTo9bJI5oG6HjcRQxTKkUg RKO8KgQLuJgT89fZ9Zm3xfyYGxLkCEjBlgP5z6hwVwrhcfKiIBvSCePYrn3DAQquK1V9Re 99RjhqkP7qcmcliy1iwPTV7iIesA5aBUnzg1SKpCUPgcth+SEjbF0XRA8ahWlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951270; a=rsa-sha256; cv=none; b=m1FCYqYIO3IzGxq3AbnJKWKEYNyIGCjcmNvS2RTIKwac5I/orCDMOnb+NmHQx5zA615r2C IQiyOgri+fBf2I6Usk4i4hPx+mWS4M+/yxkGGF5Cx4afNiTNR76r3xD9GXNKXdl/wEiPTm 0CQX3z43XHU9M69wNhCF0jXKWBjEqEEAyEaqmnhUc3Try1r0tcUfrMJXI36IpPUis2ZmT6 iachbM1hvIypL7iPAFdwZP+sDVaFl/jb3TWOMeoePcBzGM2QPrWsQTMA5Ct9kQkt7YRZLi 52qZmTCgRYGNsGtgguCZYimVwExnH0x8z8RI31gcbV4FdOPqa8cGb98ZMqdl1A== 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 4T9YJQ1VNXz15QX; Thu, 11 Jan 2024 05:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YUiN009955; Thu, 11 Jan 2024 05:34:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YUA1009953; Thu, 11 Jan 2024 05:34:30 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:30 GMT Message-Id: <202401110534.40B5YUA1009953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: b9ead2c2e71c - stable/13 - cxgbe(4): Dump the firmware log before falling back to a minimal config. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b9ead2c2e71c732e488e9f358ec36e1d4417e0d2 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ead2c2e71c732e488e9f358ec36e1d4417e0d2 commit b9ead2c2e71c732e488e9f358ec36e1d4417e0d2 Author: Navdeep Parhar AuthorDate: 2023-04-20 19:43:45 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Dump the firmware log before falling back to a minimal config. It might have errors that explain why the attempted configuration failed. Sponsored by: Chelsio Communications (cherry picked from commit 27913351047b2f49c49c5f3dfc3bcbe3672eea36) --- sys/dev/cxgbe/t4_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index ebc341419946..8a4b31209501 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5161,6 +5161,7 @@ partition_resources(struct adapter *sc) retry: rc = apply_cfg_and_initialize(sc, cfg_file, &caps_allowed); if (rc != 0 && fallback) { + dump_devlog(sc); device_printf(sc->dev, "failed (%d) to configure card with \"%s\" profile, " "will fall back to a basic configuration and retry.\n", From nobody Thu Jan 11 05:34:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJS23Srz56VkF; Thu, 11 Jan 2024 05:34: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 4T9YJR5YHJz47xJ; Thu, 11 Jan 2024 05:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4KkthGv9/l8ZIp6hAXExZuh8kmDP8cBu1A7DHc4MedY=; b=wIFpkggfVDhBNLx5cxCwHqwyx9n4wDUqAL0Jya1TyLSX769IcMGnUK4pqT7f3cOQ+tdoeR 8A/fuEQhwb+O70iH2uTnpg2eXMJyySINQafr3HeWlithGQDNf1QPWQT0RZpXaKGqcoPjoB 6pncwPrXYXLGBv0qSnaOU8pLSginaitsvCgqxdqgEppZjfN4AtXk66RGrBSR1adSLMsndz LVLSKEyh71Q3gwbYL0N20sqOXawXAkiD4Evkeju99gXcEcAPq0D3b2XBIcbtY/BcFI7P2T ghr8yyV9L4XJ7aXr1TE8BxMEMtWt6Gtz6l8oUvW2p8E48V6QR2uz7p9poBI9SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4KkthGv9/l8ZIp6hAXExZuh8kmDP8cBu1A7DHc4MedY=; b=ATF27Sm8ot6Fo2VSJW6Y7cYQIXjbI+z8O7N/8jZ0+ECjUkzuMqy+Ai6wfpSlT94wjAnBb+ 3CKQOLbPA7ySckim/FKifVrtj06fA4nEcPH+ybYSBZ/RAxqc85z+sIS2rp+9PGd4OkntEF xDtC62BN+CTCeHhbu83KdCpFG9LoOIkggPGgoI4gS3dIoIs7fuCl26wWotCSmKbf6N6iMs rOuLdB8Rv32vOXn7WtPHTvAIBRCR+i4imBECteD7v7SYzWIyrCmQOb7BQzTiYvQbj4FA5p Q2TCoWIKpYWD+kve9gmEjR/1i43DbYwN0a/WicSNXcvylYcQOHu15hdonA3ZDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951271; a=rsa-sha256; cv=none; b=xDaNAij9KVHB1uNIKxQEzgaCHQ6yPuVz48BZDS9HaurdsHJOxsruEINmWIbBuLo1EhfSBO Fcxob/ZM56TsUF2QJFGHXJ6+mzb5meV8H800K0vFqAYfI6fwCHkdSMEtbICE10yzIuBWQ4 JXTSluBoIVVm4QzKsHbwD1oA3MA0SoL/DfDLLyL/5+l29p+bKMq9BEBLn5DfTdgfiw8CUR aWphL0SYIG4Amg5nugQDKhoPp6qD0kW2GNYX8EIUO1wEOF+cC9Ag6MxgmjM/j5e+aTIiQE G2mJghxc/cAB04S8/JvfpHYHlrMJpr/8nsnhV9DPLPrKbQW7RHUd/DKLzUvf+A== 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 4T9YJR3ljvz15S9; Thu, 11 Jan 2024 05:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YVeN010000; Thu, 11 Jan 2024 05:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YVkG009997; Thu, 11 Jan 2024 05:34:31 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:31 GMT Message-Id: <202401110534.40B5YVkG009997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 5f884ac086ed - stable/13 - cxgbe(4): Update firmwares to version 1.27.3.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f884ac086ed52121fc878efaabd0e2ff0f97d77 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=5f884ac086ed52121fc878efaabd0e2ff0f97d77 commit 5f884ac086ed52121fc878efaabd0e2ff0f97d77 Author: Navdeep Parhar AuthorDate: 2023-04-21 01:24:57 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Update firmwares to version 1.27.3.0 These are the changes since the last update (copy-pasted from the release notes for Chelsio Unified Wire v3.18.0.0): ==================== Version : 1.27.3.0 Date : 04/07/2023 Fixes ----- BASE: - Fixed a hang if module eeprom reads gives invalid data. - KR backlplane no-fec link problem fixed. OFLD: - iscsi ddp errors fixed. - iwarp connection abort in rare cases causing NIC traffic hang fixed. ENHANCEMENTS ------------ BASE: - Cisco GLC-TE 1G modules support added. ==================== Version : 1.27.1.0 Date : 12/02/2022 Fixes ----- BASE: - memwrite dsgl cannot be used for T5. OFLD: - Enabled FCoE in SO adapters. - TOE-TLS crash fixed. - iscsi hang fixed. Sponsored by: Chelsio Communications (cherry picked from commit ca5391bd8579fd404dc31880b4d8744f43d22adb) --- sys/conf/files | 6 +++--- .../{t4fw-1.27.0.0.bin => t4fw-1.27.3.0.bin} | Bin 570880 -> 570880 bytes sys/dev/cxgbe/firmware/t4fw_interface.h | 6 +++--- sys/dev/cxgbe/firmware/t5fw-1.27.0.0.bin | Bin 677376 -> 0 bytes sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin | Bin 0 -> 678912 bytes sys/dev/cxgbe/firmware/t6fw-1.27.0.0.bin | Bin 729600 -> 0 bytes sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin | Bin 0 -> 730624 bytes sys/modules/cxgbe/t4_firmware/Makefile | 2 +- sys/modules/cxgbe/t5_firmware/Makefile | 2 +- sys/modules/cxgbe/t6_firmware/Makefile | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 4b624a71c772..b6a0503c087f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1528,7 +1528,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.27.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.27.3.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1562,7 +1562,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.27.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.27.3.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1596,7 +1596,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.27.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.27.3.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" diff --git a/sys/dev/cxgbe/firmware/t4fw-1.27.0.0.bin b/sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin similarity index 60% rename from sys/dev/cxgbe/firmware/t4fw-1.27.0.0.bin rename to sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin index dcae4d1b8a2b..e1576783a65c 100644 Binary files a/sys/dev/cxgbe/firmware/t4fw-1.27.0.0.bin and b/sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t4fw_interface.h b/sys/dev/cxgbe/firmware/t4fw_interface.h index 39ab58428304..1c12f60b0fe4 100644 --- a/sys/dev/cxgbe/firmware/t4fw_interface.h +++ b/sys/dev/cxgbe/firmware/t4fw_interface.h @@ -10001,17 +10001,17 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 27, - T4FW_VERSION_MICRO = 0, + T4FW_VERSION_MICRO = 3, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 27, - T5FW_VERSION_MICRO = 0, + T5FW_VERSION_MICRO = 3, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 27, - T6FW_VERSION_MICRO = 0, + T6FW_VERSION_MICRO = 3, T6FW_VERSION_BUILD = 0, }; diff --git a/sys/dev/cxgbe/firmware/t5fw-1.27.0.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.27.0.0.bin deleted file mode 100644 index 1158b9567336..000000000000 Binary files a/sys/dev/cxgbe/firmware/t5fw-1.27.0.0.bin and /dev/null differ diff --git a/sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin new file mode 100644 index 000000000000..fcae45a4df35 Binary files /dev/null and b/sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.27.0.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.27.0.0.bin deleted file mode 100644 index 0652ae751b82..000000000000 Binary files a/sys/dev/cxgbe/firmware/t6fw-1.27.0.0.bin and /dev/null differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin new file mode 100644 index 000000000000..31bd7019e51e Binary files /dev/null and b/sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin differ diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile index 08476a462ba0..8bb9afa2e8a6 100644 --- a/sys/modules/cxgbe/t4_firmware/Makefile +++ b/sys/modules/cxgbe/t4_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.27.0.0 +T4FW_VER= 1.27.3.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile index 292bb93a9475..273710ecf7d8 100644 --- a/sys/modules/cxgbe/t5_firmware/Makefile +++ b/sys/modules/cxgbe/t5_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.27.0.0 +T5FW_VER= 1.27.3.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile index 771142b55d0d..c2acdd6dc72a 100644 --- a/sys/modules/cxgbe/t6_firmware/Makefile +++ b/sys/modules/cxgbe/t6_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.27.0.0 +T6FW_VER= 1.27.3.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From nobody Thu Jan 11 05:34:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJT0frGz56VY3; Thu, 11 Jan 2024 05:34: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 4T9YJS6BNqz47s4; Thu, 11 Jan 2024 05:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p+bSSpnaTIfsIsG9iyaz7oerrAWiqIf/Watvcb90G/0=; b=q+GK+F3g5NrCqHKQhtvEH39ogF6TtZ7gtAzmy+LW7wmCYjWH/svLomxMnesvpEnt6JQpJ1 Kz/ZESFjBh3U8FBOG28BM/78jzIbY5w14hevP+DRHveozVdme5OQ6dBIj7H4g7R0XnxwFq OytvH/GBlpcPuSmZlc6m07ub3wyfgN/sAmsJXCcs3enhw7hEufnCSgQrg/XdgP8rab+DK9 XbiH4bXMpVJceZ/nRBvikIbyx6Ipp1JD5qDDj3kubJ31lbPjBN02oE5bWKrQTbNBMI+9yj qXFR9cWXyXQnxQKLV2AgSBsPnkFqpBE6o4LNoiTIF7y7s20fEEJdoyoLF+xrQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p+bSSpnaTIfsIsG9iyaz7oerrAWiqIf/Watvcb90G/0=; b=c+7ddYxbtaoZuw4H497OKtAz5G0+w0ZsQ4g/vtC3SwVSAuV86y28xFq8xPfpOmJQ+3TjeH 3VPslkshMLs69yokuo+WCFpMQjpOEU4TdDaN+Cs/iJBKGPeAsDz56Hm8n+pCFS9ssHn3oZ s1vsBrHXkKZyUmgf/ICnTnyqCmPBPkvmOOuRdoDlotKakh2inNBXy8ti/H8POSWXUMsSD6 J69/A+7QdLT271yDingTrs0bZbpIFYNcYOANtulb6CyAA3hvO2NYgCR9bLME3JwSlhuoKb i5CdOq6G0Q1ZgJCaQXXQOGwaAtqX8ebLns8N17rnWaIQ6FMKQ+2iLVb99tfiEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951272; a=rsa-sha256; cv=none; b=iSMqYSqK5y08U9K/VzHmkoG6i6N+vQWrvLPz099gEHXdwVlDkfnEsNfV4HkIF8L65P2ouT SkF895bYVH55pfw6n0eBbVUhGptrM6RnOZvRsRFzgHAsefU0alfD3eIbRtzRfuqAlyciM2 FZJ+Zx9Q7lXsQJNsNdkPgYyAbTVS+2q4iK3bYD3OKJkbYWigibcxaOlox5yttoFLhPD8t2 U3v1e1/ellkGID1qW9YuBrAecfl5jh7k4nGa89BlZT0iTjYgc6IzNtucDASkmVVWDoJ+sD +jzv223ZUOyntnGNoctnZhbqXbg/WTtRCy/RbE4bYIsuY8dmy4b8UhDJ09lKGg== 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 4T9YJS51nsz168Q; Thu, 11 Jan 2024 05:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YWGp010042; Thu, 11 Jan 2024 05:34:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YWqK010039; Thu, 11 Jan 2024 05:34:32 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:32 GMT Message-Id: <202401110534.40B5YWqK010039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: fe77cfce0180 - stable/13 - cxgbe(4): Update firmwares to 1.27.4.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fe77cfce018023df294f97ffbc3bc903cf1a78fa Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=fe77cfce018023df294f97ffbc3bc903cf1a78fa commit fe77cfce018023df294f97ffbc3bc903cf1a78fa Author: Navdeep Parhar AuthorDate: 2023-08-16 12:42:00 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Update firmwares to 1.27.4.0 This is the list of changes since last release, taken from the release notes of Chelsio Unified Wire 3.18.0.1. Version : 1.27.4.0 Date : 07/05/2023 ======================================= Fixes ----- BASE: - Handle 40G to 100G cable change. - Avoid unnecessary i2c read. ======================================= Obtained from: Chelsio Communications Sponsored by: Chelsio Communications (cherry picked from commit 8a2e880ab07f3cd04a0f458809fba5d4eacf75f1) --- sys/conf/files | 6 +++--- .../{t4fw-1.27.3.0.bin => t4fw-1.27.4.0.bin} | Bin 570880 -> 570880 bytes sys/dev/cxgbe/firmware/t4fw_interface.h | 6 +++--- .../{t5fw-1.27.3.0.bin => t5fw-1.27.4.0.bin} | Bin 678912 -> 678912 bytes .../{t6fw-1.27.3.0.bin => t6fw-1.27.4.0.bin} | Bin 730624 -> 730624 bytes sys/modules/cxgbe/t4_firmware/Makefile | 2 +- sys/modules/cxgbe/t5_firmware/Makefile | 2 +- sys/modules/cxgbe/t6_firmware/Makefile | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index b6a0503c087f..bfe53409263a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1528,7 +1528,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.27.3.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.27.4.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1562,7 +1562,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.27.3.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.27.4.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1596,7 +1596,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.27.3.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.27.4.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" diff --git a/sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin b/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin similarity index 99% rename from sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin rename to sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin index e1576783a65c..9addb9e25422 100644 Binary files a/sys/dev/cxgbe/firmware/t4fw-1.27.3.0.bin and b/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t4fw_interface.h b/sys/dev/cxgbe/firmware/t4fw_interface.h index 1c12f60b0fe4..0ebc404bb72e 100644 --- a/sys/dev/cxgbe/firmware/t4fw_interface.h +++ b/sys/dev/cxgbe/firmware/t4fw_interface.h @@ -10001,17 +10001,17 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 27, - T4FW_VERSION_MICRO = 3, + T4FW_VERSION_MICRO = 4, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 27, - T5FW_VERSION_MICRO = 3, + T5FW_VERSION_MICRO = 4, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 27, - T6FW_VERSION_MICRO = 3, + T6FW_VERSION_MICRO = 4, T6FW_VERSION_BUILD = 0, }; diff --git a/sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin similarity index 60% rename from sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin rename to sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin index fcae45a4df35..b32f270b1866 100644 Binary files a/sys/dev/cxgbe/firmware/t5fw-1.27.3.0.bin and b/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin similarity index 76% rename from sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin rename to sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin index 31bd7019e51e..a47f287848f1 100644 Binary files a/sys/dev/cxgbe/firmware/t6fw-1.27.3.0.bin and b/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin differ diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile index 8bb9afa2e8a6..fb8eeb0d6c8e 100644 --- a/sys/modules/cxgbe/t4_firmware/Makefile +++ b/sys/modules/cxgbe/t4_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.27.3.0 +T4FW_VER= 1.27.4.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile index 273710ecf7d8..2876d1a6b041 100644 --- a/sys/modules/cxgbe/t5_firmware/Makefile +++ b/sys/modules/cxgbe/t5_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.27.3.0 +T5FW_VER= 1.27.4.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile index c2acdd6dc72a..7ac481c4bdb9 100644 --- a/sys/modules/cxgbe/t6_firmware/Makefile +++ b/sys/modules/cxgbe/t6_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.27.3.0 +T6FW_VER= 1.27.4.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From nobody Thu Jan 11 05:34:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJV3zlkz56Vmm; Thu, 11 Jan 2024 05:34: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 4T9YJV0PqFz483T; Thu, 11 Jan 2024 05:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pS7FklCcfjkouG62f0tV5Pz9WcvS5wu4EqDekQM+ICQ=; b=tphgPWRZDNQmvakrn7jMOWSciShWdQfvjT7Bx4/zKM/yhup1JLmD7MVR2F/N6sLdc8xbGa mfXCJIOrjVsAwbgaUmjrIxjGLW1yi6ISZF1fWnlPEpvBBxgtxa2zpxbtaLqvssKNQ6yHQ6 V55/mDkOCBgAcq3ka3LtLMPfSfVGSdBwPfSdgPoHHdcm2yAhyqV2sgCuxE/G/3VSo52/WV JfCzI6YLXgOqpNQ3oOQkoPXerondMeONGerGLEsCKj+nU3Y+J4gLLVxtaL1DnUhvqx+bK9 hNMFYUEi+taZK677VQQUpwb9G1zYxoS6C6jVO00ULfDNX5lra7VCX1oSzf0qpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pS7FklCcfjkouG62f0tV5Pz9WcvS5wu4EqDekQM+ICQ=; b=u6XNeDARc0RJJ7pq5Km6mWIolrr8gUkDf2fLWBBLczum5P6C+yaBcEmw1cNI5sUpc+qw1h 3Kp0FxoH/7AHg7fmFww85kGtbzd5YIR01ll7mDZ3DTFziZuEPRhJFmFdIbVu/k56rZ1kO4 bHAjWweQORqXXjx42hp582II50Fq2pV1Vdme/RvmGzRGDuv03E5ais3V952stxeI3MG53W /q7P8CqdfyujgN+AXaAppCBIwsAhsBoha1hk/HhbR3pUeVGyaq5C+QU3q4+MCLDPb2R/a9 umZLTCiU841c//RLHJll0EmJvEfcV1wWdjPbowG55671YjISYkh/nAm/Mbduqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951274; a=rsa-sha256; cv=none; b=OdLtDUd8wSOD41npHNNOS21HzGCmZiS8OXtLdWtYRfTOeM+I2WNK6bQQ2qB8JsD7sBpPef Oo+c2V+PEM7W9M9qTrdMhAHn+n/3rGew5QKkfSNdiwqrh6mLGWUahtUkStme2OLnV8STiU f0pLmPG0oLRy1GmFwpfTQS4iV2GK4rNC60sTpTREukQ4QXCDvM3BUEUHhMFfsQN/rqF8s8 vhvmh/EPOCvO5ALgchJSYsQPsFPCpJvZBROoAz+iV15arFiyAKjnWr8bBJ5uhgjyTWqxzd UuKFx7cqlVIchwLn2nIZf+fdm4yYyWALLFPrLS8TVWvWDUTIzIrYH71W3QbV/g== 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 4T9YJT64rRz15cG; Thu, 11 Jan 2024 05:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YXD9010100; Thu, 11 Jan 2024 05:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YXN8010097; Thu, 11 Jan 2024 05:34:33 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:33 GMT Message-Id: <202401110534.40B5YXN8010097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 86ad0ace9c05 - stable/13 - cxgbe(4): Destroy the tick mutex during VI detach. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 86ad0ace9c057173a3f935e48115782ac5516ecf Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=86ad0ace9c057173a3f935e48115782ac5516ecf commit 86ad0ace9c057173a3f935e48115782ac5516ecf Author: Navdeep Parhar AuthorDate: 2023-12-27 21:00:29 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Destroy the tick mutex during VI detach. This avoids a mutex reinitialization when the VI is detached and reattached. Fixes: 516fe911a6b7 cxgbe(4): Always use the per-VI callout to read interface stats. Sponsored by: Chelsio Communications (cherry picked from commit 8b144c015c9cce0bc99a7fbdc43f22f51a946d2c) --- sys/dev/cxgbe/t4_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 8a4b31209501..afe3c42b48b2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2750,6 +2750,7 @@ cxgbe_vi_detach(struct vi_info *vi) #endif cxgbe_uninit_synchronized(vi); callout_drain(&vi->tick); + mtx_destroy(&vi->tick_mtx); sysctl_ctx_free(&vi->ctx); vi_full_uninit(vi); From nobody Thu Jan 11 05:34:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJW2fHMz56VhT; Thu, 11 Jan 2024 05:34: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 4T9YJW0g3fz47vc; Thu, 11 Jan 2024 05:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDmMFrRs+I5bHNfcNjaA8HiQVCKjvqPsdt2M8Gk+jTo=; b=kbgGjClQrjUumN3L+099LUggBFtyI9xhgj6oUtTPpfRGCzfrHQBjqSRByX7dUfaZHcgwau m89UB1i4RGnTgCR/LrETkN2srXuIRLp5dGYmpWGOdjcHr+Q6tJWVOLX9R8gLC2eyrqzYpz Pet5Hnf7wiCs/Z+D/nqThT3stx+BeNkDRCJCTzqQUB/q4oUI/kq+nZ0svrQ4KW3kxk5n0H d0DfXOP1l7/kX249FeQqDotYNPd5rXCV1TLZZ9jBWb5xcDji5/SGR2xWYPbNNUsKhujjvv l6K1zXj5COaZEN67vmr0xFfV6VnKCEVDC1NaXW7sznqoNY+AFEM/foyR5EtfvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDmMFrRs+I5bHNfcNjaA8HiQVCKjvqPsdt2M8Gk+jTo=; b=BrKWWmJFSnNUBfFeiZVrEDJciSa0etYXYoalxIXSlfKSqi8pQr09JcMS5LEBVIV3HlCKdg zH/obtzLzuglVD/+CPlxuqWROsnSUl3ifEr+7PhI7WDX0fZanjlHDjXp9qwX1Wt2PHFeXB dDl8tyBDSwI6YQMi9jYn+30UxvJ4GThAn6KzC4FMOlfhQ7F7bv7/YQy4EYLbcGAlFp6xIT lisc6BB2c4YgBr/o2783pLAl+sBTTEAwAlJsiXUIAL/VhUR5L93/px7GAumojYVp/z3DHQ bJD+STtDqNKx/emqXZ0KKrrdqlnVcrTmfm+v5oTrHhg0mIZoqO6nK203Aarh3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951275; a=rsa-sha256; cv=none; b=GMhQEZ160odfyW9h03XHq7pkiJJDM2QPFF5qYg5kl7VmhImXHpDR3uXd7X6oYvQm6j/ixR ulvq4G9Hkk6J51/BcUnyGRddBc/FI+MccyPmP7nycZm/qoFXNUXz+gqr6IYPMcn8J6Wedz wYLnT1s7CE0j4cVW9dHLopENmp6liNJzI2l9b50QYGMGR1L5/M1AKTsHo6XIFsfS0VYnss k+/59al6sjXK5DeiHRhBXIIrQtsYBfDA7N4N5NxuJoBHczWsYD6EqnOXrhbH2zcuD8j51F iL7e1+9w42FxKK9H6iEfvySpNt94hC3Cp+jZ66rmxP44mxvADntWYCUzGjQFjg== 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 4T9YJV6tfbz15cH; Thu, 11 Jan 2024 05:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YYUx010143; Thu, 11 Jan 2024 05:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YYo1010140; Thu, 11 Jan 2024 05:34:34 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:34 GMT Message-Id: <202401110534.40B5YYo1010140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 3a507508e365 - stable/13 - cxgbe(4): Fix virtual interface reattach. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a507508e3657b4946ee401638a043f2f073da81 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3a507508e3657b4946ee401638a043f2f073da81 commit 3a507508e3657b4946ee401638a043f2f073da81 Author: Navdeep Parhar AuthorDate: 2024-01-02 21:20:45 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Fix virtual interface reattach. Replace the DOOMED flag with a transient DETACHING flag that is cleared when VI is detached. This fixes VI reattach when only the VI and not the parent nexus is detached. The old flag was never cleared and prevented subsequent synch op's related to the VI. PR: 275260 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D43287 Sponsored by: Chelsio Communications (cherry picked from commit 0201eb29dde9dccbf796f81fbf18f3b21798183d) --- sys/dev/cxgbe/adapter.h | 10 ++++++---- sys/dev/cxgbe/t4_main.c | 33 +++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 58ea1eb3f29a..1896596df737 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -174,7 +174,7 @@ enum { FIXED_IFMEDIA = (1 << 4), /* ifmedia list doesn't change. */ /* VI flags */ - DOOMED = (1 << 0), + VI_DETACHING = (1 << 0), VI_INIT_DONE = (1 << 1), /* 1 << 2 is unused, was VI_SYSCTL_CTX */ TX_USES_VM_WR = (1 << 3), @@ -188,8 +188,9 @@ enum { DF_VERBOSE_SLOWINTR = (1 << 4), /* Chatty slow intr handler */ }; -#define IS_DOOMED(vi) ((vi)->flags & DOOMED) -#define SET_DOOMED(vi) do {(vi)->flags |= DOOMED;} while (0) +#define IS_DETACHING(vi) ((vi)->flags & VI_DETACHING) +#define SET_DETACHING(vi) do {(vi)->flags |= VI_DETACHING;} while (0) +#define CLR_DETACHING(vi) do {(vi)->flags &= ~VI_DETACHING;} while (0) #define IS_BUSY(sc) ((sc)->flags & CXGBE_BUSY) #define SET_BUSY(sc) do {(sc)->flags |= CXGBE_BUSY;} while (0) #define CLR_BUSY(sc) do {(sc)->flags &= ~CXGBE_BUSY;} while (0) @@ -1301,8 +1302,9 @@ int t4_map_bar_2(struct adapter *); int t4_setup_intr_handlers(struct adapter *); void t4_sysctls(struct adapter *); int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); -void doom_vi(struct adapter *, struct vi_info *); void end_synchronized_op(struct adapter *, int); +void begin_vi_detach(struct adapter *, struct vi_info *); +void end_vi_detach(struct adapter *, struct vi_info *); int update_mac_settings(struct ifnet *, int); int adapter_init(struct adapter *); int vi_init(struct vi_info *); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index afe3c42b48b2..cbf15b5270ff 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2772,17 +2772,14 @@ cxgbe_detach(device_t dev) device_delete_children(dev); sysctl_ctx_free(&pi->ctx); - doom_vi(sc, &pi->vi[0]); - + begin_vi_detach(sc, &pi->vi[0]); if (pi->flags & HAS_TRACEQ) { sc->traceq = -1; /* cloner should not create ifnet */ t4_tracer_port_detach(sc); } - cxgbe_vi_detach(&pi->vi[0]); ifmedia_removeall(&pi->media); - - end_synchronized_op(sc, 0); + end_vi_detach(sc, &pi->vi[0]); return (0); } @@ -3662,12 +3659,10 @@ vcxgbe_detach(device_t dev) vi = device_get_softc(dev); sc = vi->adapter; - doom_vi(sc, vi); - + begin_vi_detach(sc, vi); cxgbe_vi_detach(vi); t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid); - - end_synchronized_op(sc, 0); + end_vi_detach(sc, vi); return (0); } @@ -6313,7 +6308,7 @@ begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags, ADAPTER_LOCK(sc); for (;;) { - if (vi && IS_DOOMED(vi)) { + if (vi && IS_DETACHING(vi)) { rc = ENXIO; goto done; } @@ -6352,14 +6347,13 @@ done: /* * Tell if_ioctl and if_init that the VI is going away. This is * special variant of begin_synchronized_op and must be paired with a - * call to end_synchronized_op. + * call to end_vi_detach. */ void -doom_vi(struct adapter *sc, struct vi_info *vi) +begin_vi_detach(struct adapter *sc, struct vi_info *vi) { - ADAPTER_LOCK(sc); - SET_DOOMED(vi); + SET_DETACHING(vi); wakeup(&sc->flags); while (IS_BUSY(sc)) mtx_sleep(&sc->flags, &sc->sc_lock, 0, "t4detach", 0); @@ -6372,6 +6366,17 @@ doom_vi(struct adapter *sc, struct vi_info *vi) ADAPTER_UNLOCK(sc); } +void +end_vi_detach(struct adapter *sc, struct vi_info *vi) +{ + ADAPTER_LOCK(sc); + KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); + CLR_BUSY(sc); + CLR_DETACHING(vi); + wakeup(&sc->flags); + ADAPTER_UNLOCK(sc); +} + /* * {begin|end}_synchronized_op must be called from the same thread. */ From nobody Thu Jan 11 05:34:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJX5yhYz56Vsq; Thu, 11 Jan 2024 05:34: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 4T9YJX2KnSz481b; Thu, 11 Jan 2024 05:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7UiIIXwT02BXriqmQ7WE+B/yKyjALxWd20dxQsMr9mE=; b=ZwWF2gEYMCbLlZ2kSCLAKBq4YIuUpfKDhFFzWYwXVlL7hf3oMrZwjhFVvqU079brdh3mbx VdA1c6iExHGtNBBslQOU4lebHNIptP5KxZsmxlNkSMxE+thtEGm9Ad7oWYCxCkNXvXoJvL 1+c5fTWJLJ/gQKzx95K2BjQH1jtuJ8/NfLtObNaATbYdpMFAFTyXDyNFEY3+E11805kX9I pfyfcjWE5LncuAqILjYQdRV1sR1QNWJQ++adkUBk6SQdaXcE0bKr2FHEH3DJ+yJdjNvShc +OEDX07tcGhm/z0D6SgJg5lF/qRPpKJmZiBUMgwJu7xvUW4xTWYtkQOLXlmQpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7UiIIXwT02BXriqmQ7WE+B/yKyjALxWd20dxQsMr9mE=; b=F8/oMMWzrfoHFnSxmlOjLA+DP7VvWSbpvBVkhG7T16huFBdtUJ3sVQH5d6X4EZ3DJNTHKZ Kw50JkAbKAPQDh6MsLfWLdVYkE6lta2dwrIkqqBAjpZpJfJp0oOq2Z7+0rokCfdlZicAeB CoKxvVrDYdDIFwULNPCH/kj7DA4QFQPo5b2/eDM7AQOSfwGpByq5iz8Zf7+cwVM4Ck1RZa +arjSki1G1ibSyHBaRMdmc0rjxaEFJiFQqal+V/dcxQyYcPkaQT2017097l8M8SMyQIDz9 jfEwS5hSvJrcI1MDt+gi8DXBEmIyOrGqcc/25Fhfqqi27EScpU/00fMBk9zf2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951276; a=rsa-sha256; cv=none; b=w/7V0MfT1yxVys0Y1m3zgfKbvszmT7WDyea1ztb2bihpbz15pCvMOFPOd+jEZyXNF8Tu7P Cc7En4yl3lAtJKm/tuSUnDEVbLTHDP2uFkdI6OuEE47o+PG4ybG479v1pjJPYIkTdHKpcc Zs8ZqZRHwCVzTjYry10dXzDoy7sVWyismUkHIYr3w+2FmMqik6y/791mxQd+fvnmq1jcHE ZFatYG91ljY3kFgztM0IVGfaSksw/VUTpucsWIsJEgpsN2vEM+CUgEVJJcVZ0TPHc3FlQt y3UtI5jJzPyIsV8akgcvV9kFa/IlhIrtpFtq4LejbDbygh0mnF/rC+T//KH9Aw== 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 4T9YJX1Khkz1602; Thu, 11 Jan 2024 05:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Yawe010190; Thu, 11 Jan 2024 05:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YaqI010186; Thu, 11 Jan 2024 05:34:36 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:36 GMT Message-Id: <202401110534.40B5YaqI010186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 1c336d39156c - stable/13 - cxgbe(4): Update firmwares to 1.27.5.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1c336d39156c53b38fe82632bf1b626e2e82cb96 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1c336d39156c53b38fe82632bf1b626e2e82cb96 commit 1c336d39156c53b38fe82632bf1b626e2e82cb96 Author: Navdeep Parhar AuthorDate: 2024-01-04 19:37:21 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:59 +0000 cxgbe(4): Update firmwares to 1.27.5.0 Version : 1.27.5.0 Date : 10/10/2023 ===================== Fixes ----- BASE: - Fixed handling the Remote Fault with AN, causing the link failure. ===================== Obtained from: Chelsio Communications Sponsored by: Chelsio Communications (cherry picked from commit b1e82d33193b83d86d46483b4ddfe295becd80c4) --- sys/conf/files | 6 +++--- .../{t4fw-1.27.4.0.bin => t4fw-1.27.5.0.bin} | Bin 570880 -> 570880 bytes sys/dev/cxgbe/firmware/t4fw_interface.h | 6 +++--- .../{t5fw-1.27.4.0.bin => t5fw-1.27.5.0.bin} | Bin 678912 -> 678912 bytes .../{t6fw-1.27.4.0.bin => t6fw-1.27.5.0.bin} | Bin 730624 -> 730624 bytes sys/modules/cxgbe/t4_firmware/Makefile | 2 +- sys/modules/cxgbe/t5_firmware/Makefile | 2 +- sys/modules/cxgbe/t6_firmware/Makefile | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index bfe53409263a..ac6c3ed6376a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1528,7 +1528,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1562,7 +1562,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1596,7 +1596,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.27.4.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.27.5.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" diff --git a/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin similarity index 99% rename from sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin index 9addb9e25422..0c7842564913 100644 Binary files a/sys/dev/cxgbe/firmware/t4fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t4fw-1.27.5.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t4fw_interface.h b/sys/dev/cxgbe/firmware/t4fw_interface.h index 0ebc404bb72e..686bb55d658b 100644 --- a/sys/dev/cxgbe/firmware/t4fw_interface.h +++ b/sys/dev/cxgbe/firmware/t4fw_interface.h @@ -10001,17 +10001,17 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 27, - T4FW_VERSION_MICRO = 4, + T4FW_VERSION_MICRO = 5, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 27, - T5FW_VERSION_MICRO = 4, + T5FW_VERSION_MICRO = 5, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 27, - T6FW_VERSION_MICRO = 4, + T6FW_VERSION_MICRO = 5, T6FW_VERSION_BUILD = 0, }; diff --git a/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin similarity index 59% rename from sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin index b32f270b1866..875f421c7523 100644 Binary files a/sys/dev/cxgbe/firmware/t5fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t5fw-1.27.5.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin similarity index 76% rename from sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin rename to sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin index a47f287848f1..f951578d642b 100644 Binary files a/sys/dev/cxgbe/firmware/t6fw-1.27.4.0.bin and b/sys/dev/cxgbe/firmware/t6fw-1.27.5.0.bin differ diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile index fb8eeb0d6c8e..15928bdb0207 100644 --- a/sys/modules/cxgbe/t4_firmware/Makefile +++ b/sys/modules/cxgbe/t4_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.27.4.0 +T4FW_VER= 1.27.5.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile index 2876d1a6b041..cf2c3e9006bd 100644 --- a/sys/modules/cxgbe/t5_firmware/Makefile +++ b/sys/modules/cxgbe/t5_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.27.4.0 +T5FW_VER= 1.27.5.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile index 7ac481c4bdb9..5bc7c8e8e0b6 100644 --- a/sys/modules/cxgbe/t6_firmware/Makefile +++ b/sys/modules/cxgbe/t6_firmware/Makefile @@ -16,7 +16,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.27.4.0 +T6FW_VER= 1.27.5.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From nobody Thu Jan 11 05:34:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9YJY68bYz56VhY; Thu, 11 Jan 2024 05:34: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 4T9YJY3lCHz485x; Thu, 11 Jan 2024 05:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LRhHrInUTDLChiS64WsDRBo7g64h3uwiZIOXpDtkons=; b=p0CbvBO1s56PDOHvn6CxCGoiPCMCWBk11Q86mATZAcvb8BfBLstdUe8SM+YJ+aobNyA/TW ju4SYCKe7xgsTknI5VtMdqwmPOn0vdm0nGoTrl8jD3rYqYS4+8tB2f8UjafN/XQO7oTaZo djd3Irzu8LGPTzwpQaPWN4P0F5cvM3JzEK/k4NWPOM7FWZ8nr1hP8KeNPeqHDcxfsS8MKC GPmrXp9cA2XJ4Hm37wDA9u0C1EPt11eRuw/5ADSY8amO4CslNy655YfKgwiX5E9hrK3S2V HlUgOq/IalbnM+Ev/5Eg00ZB0312WOWEnmX5jaXIWiK4hU9SGvtghvEDoVpqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LRhHrInUTDLChiS64WsDRBo7g64h3uwiZIOXpDtkons=; b=a53qFko7L406HKo11pNZsU2377RUfQQQfhgH3cW9eC8kxGdSbt/za+zMqzpkm/Ww9cR2fH rArvs/wZfVJ1NU0esclwj1xAUcD41sZ32PPk/i9yrcOh8KYJrsV3bV33lmQTF/Pq5KmFF8 aM9P135QyKPMQFaAdxpqp3VKWmApkWhKgzqjwSUN0t3N1RvXzvz7EcI9XqyQDzZM2Ykxqi xHtr1aKe8s7bict9z4obSAwHe8Mt2pTO6k6/zxhLhl9Id1HDPN/f0PRCRXb9YWnGA2z1Gz gQFJqRrIf98VSztbp7sqcjUmkBw2TDZQJNqc4Al1HSxlBrMZVE2fzKjdq0gC3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951277; a=rsa-sha256; cv=none; b=py8r0d2txctNL6a94y2v0g60ajT6tiO8ACLak6piL1nxT/L/y1E+a7duYS8X6VJuVTTxLq Oh4iBVdbU0rkFk6t01dB7cg22OUYXAlW/awmzWoHd96kHkYY2LI37Ul/Ui/z3enN9iRY5e Spz09zrE5l2q3LM7mTJaY74I+3Q9aMshpKNaKaH3TFx54TNlJZsj7/7S3yFaLm+1N04tPm fIISjWuzctyHkT3Mc2qHB2BJos0TSfmNHCnglQNRo2tJ/oVBTGYdkB7kPKHjPOFgGY13UO GmjwAPR6B+yeRZWdLJ5jVvOi+lcF1+c7H8QX7WOuoPG0iNSNFWGB6+gH56tNsw== 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 4T9YJY2Mwdz15W4; Thu, 11 Jan 2024 05:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YbCb010253; Thu, 11 Jan 2024 05:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YblG010250; Thu, 11 Jan 2024 05:34:37 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:37 GMT Message-Id: <202401110534.40B5YblG010250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 2cca64fbe579 - stable/13 - cxgbe(4): Use the correct size for the CIM LA on the T6. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cca64fbe579dea06103cc954e28c1148d366744 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2cca64fbe579dea06103cc954e28c1148d366744 commit 2cca64fbe579dea06103cc954e28c1148d366744 Author: Navdeep Parhar AuthorDate: 2024-01-09 21:22:16 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:09:16 +0000 cxgbe(4): Use the correct size for the CIM LA on the T6. The logic analyzer in the T6 CIM block has a different capture size than previous chips. Sponsored by: Chelsio Communications (cherry picked from commit 9ea86c8f67a65ca00f79f3cd83aa977b38589f39) --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 7 +++++-- sys/dev/cxgbe/common/t4_hw.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index cd1e648f8e59..0861e3df4bee 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -313,6 +313,7 @@ struct chip_params { u32 sge_fl_db; u16 mps_tcam_size; u16 rss_nentries; + u16 cim_la_size; }; /* VF-only parameters. */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 41063d5c7d76..c18243e4b681 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -9303,6 +9303,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = F_DBPRIO, .mps_tcam_size = NUM_MPS_CLS_SRAM_L_INSTANCES, .rss_nentries = RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE, }, { /* T5 */ @@ -9317,6 +9318,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = F_DBPRIO | F_DBTYPE, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, .rss_nentries = RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE, }, { /* T6 */ @@ -9331,6 +9333,7 @@ const struct chip_params *t4_get_chip_params(int chipid) .sge_fl_db = 0, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, .rss_nentries = T6_RSS_NENTRIES, + .cim_la_size = CIMLA_SIZE_T6, }, }; @@ -9386,11 +9389,11 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf) /* Cards with real ASICs have the chipid in the PCIe device id */ t4_os_pci_read_cfg2(adapter, PCI_DEVICE_ID, &device_id); if (device_id >> 12 == chip_id(adapter)) - adapter->params.cim_la_size = CIMLA_SIZE; + adapter->params.cim_la_size = adapter->chip_params->cim_la_size; else { /* FPGA */ adapter->params.fpga = 1; - adapter->params.cim_la_size = 2 * CIMLA_SIZE; + adapter->params.cim_la_size = 2 * adapter->chip_params->cim_la_size; } ret = get_vpd_params(adapter, &adapter->params.vpd, device_id, buf); diff --git a/sys/dev/cxgbe/common/t4_hw.h b/sys/dev/cxgbe/common/t4_hw.h index e943acb8dec9..79ec690cd5e6 100644 --- a/sys/dev/cxgbe/common/t4_hw.h +++ b/sys/dev/cxgbe/common/t4_hw.h @@ -66,7 +66,8 @@ enum { CIM_NUM_IBQ = 6, /* # of CIM IBQs */ CIM_NUM_OBQ = 6, /* # of CIM OBQs */ CIM_NUM_OBQ_T5 = 8, /* # of CIM OBQs for T5 adapter */ - CIMLA_SIZE = 2048, /* # of 32-bit words in CIM LA */ + CIMLA_SIZE = 256 * 8, /* 256 rows * ceil(235/32) 32-bit words */ + CIMLA_SIZE_T6 = 256 * 10, /* 256 rows * ceil(311/32) 32-bit words */ CIM_PIFLA_SIZE = 64, /* # of 192-bit words in CIM PIF LA */ CIM_MALA_SIZE = 64, /* # of 160-bit words in CIM MA LA */ CIM_IBQ_SIZE = 128, /* # of 128-bit words in a CIM IBQ */ From nobody Thu Jan 11 08:51:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9dg957vjz56v9k; Thu, 11 Jan 2024 08:51: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 4T9dg93hlQz4YHw; Thu, 11 Jan 2024 08:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2C6JUJsrQCSdx8dsQX1u+6Oi+nbfiwJK0NYHjQgezgQ=; b=hr9dQXSVMjgPUNXUtUAg3ZfsLOKn2wFxuu4xiB2lxtVn9HUY8na1iKEkViY8ie37OWKeCc 518zXpjMxMJUNESBeajsTkdAWlPxuQgz+JAyLSNGIbMIgBUSjZOMHGkMBcGYqVI32lqNap shwr1PNvwyfBxyJJcbhK2brJJBctxVHkFWJVdCPPi1pOfYB2+2vlipd/IT1tM+cgS756aC PYyvdouAgSnfcAdItJ9kaCmCsZsV49inm9kSyZu6Yk0qS5kBDU6Nl+vbWfT2q1fVrBnX8x CCn/5bTjlTbvLax/VTxNVmFYoX7w8t2Is+k4tqfy3/Uztwq+tLFWQEa4JuY17Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2C6JUJsrQCSdx8dsQX1u+6Oi+nbfiwJK0NYHjQgezgQ=; b=F1SOKmPrjFINtoqZYBfjaXuD93gWISB/uvWJvxmxSbkTJQBkNm8XIoOl/N0xUkeo+ndWZv vNHmwmGEy1EKyyv+Gre/g1Y/Yxf3VWd6fPChvYCBvZCz8FpzOXwWk7ipDqUDDLmLG9E68N 1doSnu4EsNrgGUGvkWS/5R8PRL5outkGkHipW5843MKusmfU31kiis1+7skmdYlHUwxxk3 5niDFWGwnQTrhCceVSRa95aBWqKXIUGDk7kBiAMNm541hm3YTirqkgdl3TfcMH+uO5yjlN hfb9eOfIyq5sfOEt1cgw6mWTr1sqmmKV0+c8PLn12EonH7b0eE2OSJB82oMBgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704963061; a=rsa-sha256; cv=none; b=c7qKkWkF4H3JmbdfRw5b7ylClr/t2Zi+GxB7WQTJsStNcxUdjX3TJ9Osj10XdkR5dTp4R1 1w8NSDWDxCYmF81xE4X3eL6ypCczaPpYbMuPp/UKmF2eksCzeVEH2k/kXnXRIKLBPskgZx Wl5o0rpAOVZWL2ikkGrySqHVs+JBVEMJu5SBdTasVg1BOo1rl5oocpwhEQLBON/per7Z9Y g2krVcNw/PBcubJ+sZXzUWbsXx1NqvnNx9xl8WSfNJRh1Ba9Au1GuBUHiqezUaHMjVxETF kFNP9JjHD+GzcjMjDKJAzjd2DiQqB0vJXhrl3z1Ybb2/3i2FzTc7fk5Mmr883Q== 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 4T9dg92nPHz1BZM; Thu, 11 Jan 2024 08:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B8p1T3040430; Thu, 11 Jan 2024 08:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B8p1OE040427; Thu, 11 Jan 2024 08:51:01 GMT (envelope-from git) Date: Thu, 11 Jan 2024 08:51:01 GMT Message-Id: <202401110851.40B8p1OE040427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 327e9727c627 - stable/13 - man: improve man pages for dtrace_sctp and dtrace_tcp List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 327e9727c6277bdc0c404ae43c1d281b133f95e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=327e9727c6277bdc0c404ae43c1d281b133f95e7 commit 327e9727c6277bdc0c404ae43c1d281b133f95e7 Author: Michael Tuexen AuthorDate: 2023-06-29 12:53:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 08:50:28 +0000 man: improve man pages for dtrace_sctp and dtrace_tcp Reviewed by: manpages Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40796 (cherry picked from commit 81b4bf08955a86e51cbc7ff878e95ff5e86e5eee) --- share/man/man4/dtrace_sctp.4 | 14 +++++++------- share/man/man4/dtrace_tcp.4 | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/share/man/man4/dtrace_sctp.4 b/share/man/man4/dtrace_sctp.4 index 628641d8309c..6e2f1ed31969 100644 --- a/share/man/man4/dtrace_sctp.4 +++ b/share/man/man4/dtrace_sctp.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 22, 2018 +.Dd June 29, 2023 .Dt DTRACE_SCTP 4 .Os .Sh NAME @@ -148,20 +148,20 @@ A script that logs SCTP packets in real time: dtrace:::BEGIN { - printf(" %3s %15s:%-5s %15s:%-5s\n", "CPU", + printf(" %3s %15s:%-5s %15s:%-5s\\n", "CPU", "LADDR", "LPORT", "RADDR", "RPORT"); } sctp:::send { - printf(" %3d %16s:%-5d -> %16s:%-5d\n", cpu, + printf(" %3d %16s:%-5d -> %16s:%-5d\\n", cpu, args[2]->ip_saddr, args[4]->sctp_sport, args[2]->ip_daddr, args[4]->sctp_dport); } sctp:::receive { - printf(" %3d %16s:%-5d <- %16s:%-5d\n", cpu, + printf(" %3d %16s:%-5d <- %16s:%-5d\\n", cpu, args[2]->ip_daddr, args[4]->sctp_dport, args[2]->ip_saddr, args[4]->sctp_sport); } @@ -175,7 +175,7 @@ int last[int]; dtrace:::BEGIN { - printf(" %3s %12s %-25s %-25s\n", + printf(" %3s %12s %-25s %-25s\\n", "CPU", "DELTA(us)", "OLD", "NEW"); } @@ -183,7 +183,7 @@ sctp:::state-change / last[args[1]->cs_cid] / { this->elapsed = (timestamp - last[args[1]->cs_cid]) / 1000; - printf(" %3d %12d %-25s -> %-25s\n", cpu, this->elapsed, + printf(" %3d %12d %-25s -> %-25s\\n", cpu, this->elapsed, sctp_state_string[args[5]->sctps_state], sctp_state_string[args[3]->sctps_state]); last[args[1]->cs_cid] = timestamp; @@ -192,7 +192,7 @@ sctp:::state-change sctp:::state-change / last[args[1]->cs_cid] == 0 / { - printf(" %3d %12s %-25s -> %-25s\n", cpu, "-", + printf(" %3d %12s %-25s -> %-25s\\n", cpu, "-", sctp_state_string[args[5]->sctps_state], sctp_state_string[args[3]->sctps_state]); last[args[1]->cs_cid] = timestamp; diff --git a/share/man/man4/dtrace_tcp.4 b/share/man/man4/dtrace_tcp.4 index fda957e530c7..7d300d0f8068 100644 --- a/share/man/man4/dtrace_tcp.4 +++ b/share/man/man4/dtrace_tcp.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 1, 2018 +.Dd June 29, 2023 .Dt DTRACE_TCP 4 .Os .Sh NAME @@ -315,7 +315,7 @@ tcp:::send printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); - printf("\b)\\n"); + printf("\\b)\\n"); } tcp:::receive @@ -331,7 +331,7 @@ tcp:::receive printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); - printf("\b)\\n"); + printf("\\b)\\n"); } .Ed The following script logs TCP connection state changes as they occur: From nobody Thu Jan 11 08:57:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9dqC1T8Pz56wFn; Thu, 11 Jan 2024 08:57: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 4T9dqC05M0z4bHl; Thu, 11 Jan 2024 08:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jppla7vHI58ZPUsPks50LLKb6w6VLGtJpKjY6otvdZo=; b=WUGhE8JpJk8bfkwv6zNaWgKv7k0Ywi4EZUewIQhjS+VeZXHfgEJek6vcCVL77SCE47r7ZY quBYc8v+V0IQd//1DJuyWFAraK4lTKMM11BrgD84v8e/T8yI5+/cYB3TMtCJkuD4BBcHnh /BnLjbep77wc0mNHX2y3RsiToMPi1RjnCPVIUhuMu0DfmqQaYOkKrS1j8zpR8queEP5lzd Duo8kO2K3/g4ZtHYxd2V1NZhuUKI9BcSky5nAxN9GKnrGm+3orZucLFJ1OlpOvJeDKS3yp VrZqxSjMGVSj1farJ3PjB+1EPF0DPvN94pDvxoH/xl7D3QQbDyt16WRAdkGWEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jppla7vHI58ZPUsPks50LLKb6w6VLGtJpKjY6otvdZo=; b=CPmi7Nic8xw5a2ibzdLH8cESAoiHv8oN4kObGzOtQ6ySja5zXbL0T4VUJlhvc/5v38xaZz lWSalkwh7wA4wuv9zUAph8LbkQ3IlLuCRDTPdyvt2Q2JAWI9Cl1WvUsZpn7uqdNGZcSTW5 LYC6qAuAAba0Z3OftKHJsHnOyPDYtpdC0Bve9+rL4U4Xk3Bj/aq3ef1PRgM9G4DuTrw+2D yJZljsPbjsLY2CtvzrYBwFFLpPBwJrcvAlD4Gs2QyCS0QtEvtLt9lrckHZbJBaI1+KQg5A QA2iFLoaMlFvuklCW/KVqKCCRvYnUfj42DfQ8jLHKQ1DWJN6BuW34kyw+lzjgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704963479; a=rsa-sha256; cv=none; b=rVWSzL5gmIp+jz4RVtbe3jHi9WWHCU94+98zohxLIhqaGK6dE+7dnfcLk+Q91ReE+nbZuU L+1k7yowN9+IkcHEBZopjEZzCnvtUf1cW31QdjUqXCgL2jNaHK+B6jN7nEBaEeixcIwR71 7A5oVXB8J0ER/PiTCk5FyjMRXMjA6nxVIP9rIMsA7JH4oiOJHb1AMp13gqPgJHuqiAq8Xr r5GcQz8J+eVeuxGlt2QnW2h8Th2+YhHI5FHmvOdyJpO/DIUESPoTIQBA3q4KYfSfLcCpa0 uafm2PYbg2GYnhsG1oRlqH/rbF5QNlmfEGw9GrDaMgFSL3YTo2ixy+NEiW7kjg== 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 4T9dqB69C2z1ByY; Thu, 11 Jan 2024 08:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B8vwil046062; Thu, 11 Jan 2024 08:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B8vw94046059; Thu, 11 Jan 2024 08:57:58 GMT (envelope-from git) Date: Thu, 11 Jan 2024 08:57:58 GMT Message-Id: <202401110857.40B8vw94046059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: d5ffa4b1a459 - stable/13 - siftr: provide dtrace with the correct pointer to data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d5ffa4b1a45943ca55740bc51df1f0912c953c22 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ffa4b1a45943ca55740bc51df1f0912c953c22 commit d5ffa4b1a45943ca55740bc51df1f0912c953c22 Author: Michael Tuexen AuthorDate: 2023-06-30 20:03:04 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 08:57:38 +0000 siftr: provide dtrace with the correct pointer to data This fixes a bug which was introduced in the commit https://svnweb.freebsd.org/changeset/base/282276 Reviewed by: cc, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40806 (cherry picked from commit dc2d26df43cb69c9c4d8802220af2da929bc1dce) --- sys/netinet/siftr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 643c484b07ff..7ec19ecc875a 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -812,7 +812,7 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb *inp, struct tcpcb *tp, * maximum pps throughput processing when SIFTR is loaded and enabled. */ microtime(&pn->tval); - TCP_PROBE1(siftr, &pn); + TCP_PROBE1(siftr, pn); } From nobody Thu Jan 11 09:00:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9dtZ1J2Pz56wR2; Thu, 11 Jan 2024 09:00: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 4T9dtZ0WCbz4c11; Thu, 11 Jan 2024 09:00:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/IaeaYxhK4Stemqj9CtjFJ3lynyKFbvPXJp2ErYs+FM=; b=M2Bybcayehkg30HaLsXvYPquFeXmE68QSgkpy+n7GOg20yWsn1Ce5Th9uWivNpaxa5vGSj w8VK675of74sCXeMXWMssmOaiftSOTbwq+hfCzToDtA89/er8yrqAzAEq+mlmMhsxL5Trs Xctlrp09ls9EUt71wGCKEAzGPdzBfgKE4AlHdfKF8sidV4qMNiYiY8exJOMHbJlfR8FsoN mziUWrKjo11knlvpl8oWu63FkJlBwCPQEGQXRJS69RtQs81I3WuQ26NWO/IKWruw8NLhMg bVNdG0F+dsWMw6xvQAPAE3Mll7/m66JJSwK/bIj3TfB8AKR4oyuCAkIp7Dv5yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704963654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/IaeaYxhK4Stemqj9CtjFJ3lynyKFbvPXJp2ErYs+FM=; b=a32zZ/AEFfS8hZhb+cA8t6LZm4nxuRPRO9VdGGiNo+MVadjf5A8mmQ6NDPKCZmT/CKhaBQ D2PrJzhRI7Ctc5xFb0L2ib+ZcUDHiZlh5QT3FS/3uGSu/pbDPDw2AffC/KyPVy6AJDdTo9 8P0sZny9iFjT3YlK970D1OKJvKuZ2Bqm/fAE+vpzwzzOdh8b8+KGr9jmbr73xwAxdgVaEJ IkOSuMlXNh0FayKjPlvgM+Rwje2iBonueegEAkn7k0q7rrt3gVCAZAp+A/v9v8DaIB/3xv ObwN182jbm3ETDjqLcU4VzhZXI9T5DttU1Q2bWhH7NBxO87JwsbgKLO6bthTJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704963654; a=rsa-sha256; cv=none; b=SAQvTF4FRwJeLuwQPDMEMdlmjGBCHW151OlBmA2ltpXKQgbn6Sr8W68GnothcoZSe6z64J n0G+4F9lWSUJY+GkRDwcv6YKkyYZfKhF61i+As7fwR65aSv8hcF4nA5zLK1xGQDdZECXw9 9c+StiES6BqeWCadoFaZZJasK9/TQ0fr+wjOe42e70fldB2H7mAWMITKFsQwqzJt3/LDil 05+AHLZE5FlRUABwvTrM96gQPCarSIcJ7q+h2JW3A8HPBb+bWhWujYNx46MdLXY47I75xV 6IvznT/GBxPfrN/GwVr0EN3RhrfkhEDz//xhh7X85kbMxtWx9Y2L+G4a++L5Rg== 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 4T9dtY6k7Tz1BNf; Thu, 11 Jan 2024 09:00:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B90rGW057398; Thu, 11 Jan 2024 09:00:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B90r3C057395; Thu, 11 Jan 2024 09:00:53 GMT (envelope-from git) Date: Thu, 11 Jan 2024 09:00:53 GMT Message-Id: <202401110900.40B90r3C057395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: dc2408133b6d - stable/13 - dtrace: fix constants used by the siftr probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dc2408133b6dfba0c080805f4a137cadece33fa9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=dc2408133b6dfba0c080805f4a137cadece33fa9 commit dc2408133b6dfba0c080805f4a137cadece33fa9 Author: Michael Tuexen AuthorDate: 2023-06-30 20:15:47 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 09:00:33 +0000 dtrace: fix constants used by the siftr probe The constants used in the C code were changed in https://svnweb.freebsd.org/changeset/base/343646 but changing them also in the dtrace translator was missed. Reviewed by: cc, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40805 (cherry picked from commit f5541b85a592da9e1e1723b190f1e08afd7d5b18) --- cddl/lib/libdtrace/siftr.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cddl/lib/libdtrace/siftr.d b/cddl/lib/libdtrace/siftr.d index 05b95ee15a72..1830c0406e1c 100644 --- a/cddl/lib/libdtrace/siftr.d +++ b/cddl/lib/libdtrace/siftr.d @@ -27,9 +27,9 @@ * Convert a SIFTR direction value to a string */ #pragma D binding "1.12.1" SIFTR_IN -inline int SIFTR_IN = 1; +inline int SIFTR_IN = 0; #pragma D binding "1.12.1" SIFTR_OUT -inline int SIFTR_OUT = 2; +inline int SIFTR_OUT = 1; /* SIFTR direction strings. */ #pragma D binding "1.12.1" siftr_dir_string From nobody Thu Jan 11 11:32:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9jFN22X6z57DMX; Thu, 11 Jan 2024 11:32: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 4T9jFM6rbKz4tZ1; Thu, 11 Jan 2024 11:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704972744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGYO0WC3FFqkc4YEit2g1IbFKQo+K5lpruDwklxD0b8=; b=ce6rzBlhXbFTbGJ01ICif/gWOBFi6ZruB4HEVYgk8YsNN5ZFKiCYuRNkco0+X8fNF4cOGu Pf3omKCOKucf49o6LVeGbv9+9h0qTmiF9q3hXdIfRJbygyAiv7TQjof+ttrJ+5JOYrFEjs iZFqYxidjHtx7ZbCvGIZNr151mT1owVAdJrEgIxEVpbaOWO+fO0j1xMG+9bzPN19HyyR88 yRGv83aM7WxgOAZo7HFDPfmJ8lRS40NrmU8k5NSBgEJaJX9L0RidUmjru2YtcOLaf3vJjb Dza0pTQY9noKlYBX9hhu1v+KqzVh0a8J1aeqCmXDSh/VjNZGsx9T71rx1yNFCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704972744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGYO0WC3FFqkc4YEit2g1IbFKQo+K5lpruDwklxD0b8=; b=ZurUvtiAFD48p5Kfsh8L4wj6+wpC+dkAF8DUQ4TTLk9vP6gD+Hd0JIV1B/Ff8yBckBNksv sEhdZzh9Qa6pYD11sdJZbvebsl6Vn4zl8NFVtBGsTTpm8civHeKzJUu07WzDPHt2HNe8gc unFxcawbvf7IvRetQHcYM7xGjVI1bc6r/qsDAuBwMlF9GdSJ0id5pSru3r5T/auKuDl57u i8KUCTZ6LGx3KkfDEY9vNewNePYjCLdX4PY3/K2O7j5BWmj8xzz+bQTmOirh4nGx/EQ7hP RjrFn+k0MvNjeaXGV3IJF2GeAQB20L7aB2bIJ0yeMFUstGVttfMZDw39x5SyUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704972744; a=rsa-sha256; cv=none; b=s1gRw8ZdRgi/I8MwQCkzBUuGEDIV+RugyX7lQsr/dBAqQH/x8v81wjZUV9kKDYZAPHwYEe 0GIEZjY0DNOTDo3JCxtLwCOCljELKQX25F2Jr/XXBr9pCwNJNknAyt/kmZjVXzvKzxIiwA upnaCl6P5Pm9P/z2R7HqXA6Y+Qp3iz0u1NShp1UY0KKd96l1erTpldI6YAtmO9RRsvmCIr SZZDK8KaAxoIDL1jXxtmMW+JNbCvYaniAYi4wySNdqGpKMqqKtOv7P4IB5Z2WbQTxwduUJ STayIvTnEG1gvTvH2n+pbes7YaYJBa9D0F+IQCsdcI4czWLELUXhu7dclCAlDg== 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 4T9jFM5wKBzHJp; Thu, 11 Jan 2024 11:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BBWNf6013763; Thu, 11 Jan 2024 11:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BBWNjK013760; Thu, 11 Jan 2024 11:32:23 GMT (envelope-from git) Date: Thu, 11 Jan 2024 11:32:23 GMT Message-Id: <202401111132.40BBWNjK013760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ce581fb02fc1 - stable/13 - siftr: document siftr probe to man page of the tcp provider List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ce581fb02fc158b9edd749eadd80f957599020e3 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ce581fb02fc158b9edd749eadd80f957599020e3 commit ce581fb02fc158b9edd749eadd80f957599020e3 Author: Michael Tuexen AuthorDate: 2023-06-30 22:13:00 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 11:32:08 +0000 siftr: document siftr probe to man page of the tcp provider This man page documents what is currently implemented in siftr.d. It doesn't work right now in head, but in stable/13. Follow-up commits will fix it for head. Reviewed by: cc, pauamma_gundo.com Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40809 (cherry picked from commit 0631830a7a3c9625f1678b0b6ab8b525ba5e3873) --- share/man/man4/dtrace_tcp.4 | 138 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 2 deletions(-) diff --git a/share/man/man4/dtrace_tcp.4 b/share/man/man4/dtrace_tcp.4 index 7d300d0f8068..fa21cb981ed5 100644 --- a/share/man/man4/dtrace_tcp.4 +++ b/share/man/man4/dtrace_tcp.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 29, 2023 +.Dd July 1, 2023 .Dt DTRACE_TCP 4 .Os .Sh NAME @@ -47,6 +47,7 @@ protocol "tcpinfo_t *" .Fn tcp:::state-change "void *" "csinfo_t *" "void *" "tcpsinfo_t *" "void *" \ "tcplsinfo_t *" +.Fn tcp:::siftr "siftrinfo_t *" .Sh DESCRIPTION The DTrace .Nm tcp @@ -63,6 +64,8 @@ All .Nm tcp probes except for .Fn tcp:::state-change +and +.Fn tcp:::siftr have the same number and type of arguments. The last three arguments are used to describe a TCP segment: the .Vt ipinfo_t @@ -134,6 +137,15 @@ Its first, third and fifth arguments are currently always Its last argument describes the from-state in the transition, and the to-state can be obtained from .Dv args[3]->tcps_state . +.Pp +The +.Fn tcp:::siftr +probe fires when a TCP segment is sent or received by the host. +For a detailed description see +.Xr siftr 4 . +The +.Vt siftrinfo_t +argument provides the information about the TCP connection. .Sh ARGUMENTS The .Vt pktinfo_t @@ -283,10 +295,111 @@ The valid TCP state values are given by the constants prefixed with in .Pa /usr/lib/dtrace/tcp.d . .El +.Pp +The +.Vt siftrinfo_t +type is used by the +.Fn tcp:::siftr +probe to provide the state of the TCP connection. +Its fields are: +.Bl -tag -width "u_int sent_inflight_bytes" -offset indent +.It Vt uint8_t direction +Direction of packet that triggered the log message. +Either +.Qq 0 +for in, or +.Qq 1 +for out. +.It Vt uint8_t ipver +The version of the IP protocol being used. +Either +.Qq 1 +for IPv4, or +.Qq 2 +for IPv6. +.It Vt uint32_t hash +Hash of the packet that triggered the log message. +.It Vt uint16_t tcp_localport +The TCP port that the local host is communicating via. +.It Vt uint16_t tcp_foreignport +The TCP port that the foreign host is communicating via. +.It Vt uint64_t snd_cwnd +The current congestion window (CWND) for the flow, in bytes. +.It Vt u_long snd_wnd +The current sending window for the flow, in bytes. +The post scaled value is reported, except during the initial handshake (first +few packets), during which time the unscaled value is reported. +.It Vt u_long rcv_wnd +The current receive window for the flow, in bytes. +The post scaled value is always reported. +.It Vt u_long snd_bwnd +The current bandwidth-controlled window for the flow, in bytes. +This field is currently unused and reported as zero. +.It Vt u_long snd_ssthresh +The slow start threshold (SSTHRESH) for the flow, in bytes. +.It Vt int conn_state +A TCP state. +The valid TCP state values are given by the constants prefixed with +.Ql TCPS_ +in +.Pa /usr/lib/dtrace/tcp.d . +.It Vt u_int max_seg_size +The maximum segment size for the flow, in bytes. +.It Vt int smoothed_rtt +The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, +where TCP_RTT_SCALE is a define found in +.Pa /usr/include/netinet/tcp_var.h , +and HZ is the kernel's tick timer. +Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. +.It Vt u_char sack_enabled +SACK enabled indicator. 1 if SACK enabled, 0 otherwise. +.It Vt u_char snd_scale +The current window scaling factor for the sending window. +.It Vt u_char rcv_scale +The current window scaling factor for the receiving window. +.It Vt u_int flags +The current value of the t_flags for the flow. +.It Vt int rxt_length +The current retransmission timeout length for the flow, in units of HZ, where HZ +is the kernel's tick timer. +Divide by HZ to get the timeout length in seconds. +.It Vt u_int snd_buf_hiwater +The current size of the socket send buffer in bytes. +.It Vt u_int snd_buf_cc +The current number of bytes in the socket send buffer. +.It Vt u_int rcv_buf_hiwater +The current size of the socket receive buffer in bytes. +.It Vt u_int rcv_buf_cc +The current number of bytes in the socket receive buffer. +.It Vt u_int sent_inflight_bytes +The current number of unacknowledged bytes in-flight. +Bytes acknowledged via SACK are not excluded from this count. +.It Vt int t_segqlen +The current number of segments in the reassembly queue. +.It Vt u_int flowid +Flowid for the connection. +A caveat: Zero '0' either represents a valid flowid or a default value when +the flowid is not being set. +.It Vt u_int flowtype +Flow type for the connection. +Flowtype defines which protocol fields are hashed to produce the flowid. +A complete listing is available in +.Pa /usr/include/sys/mbuf.h +under +.Dv M_HASHTYPE_* . +.El .Sh FILES -.Bl -tag -width "/usr/lib/dtrace/tcp.d" -compact +.Bl -tag -width "/usr/lib/dtrace/siftr.d" -compact .It Pa /usr/lib/dtrace/tcp.d +DTrace type and translator definitions for all the probes of the +.Nm tcp +provider except the +.Nm siftr +probe. +.It Pa /usr/lib/dtrace/siftr.d DTrace type and translator definitions for the +.Nm siftr +probe of the .Nm tcp provider. .El @@ -365,6 +478,26 @@ tcp:::state-change last[args[1]->cs_cid] = timestamp; } .Ed +The following script uses the siftr probe to show the current value of CWND +and SSTHRESH when a packet is sent or received: +.Bd -literal -offset indent +#pragma D option quiet +#pragma D option switchrate=10hz + +dtrace:::BEGIN +{ + printf(" %3s %5s %5s %10s %10s\\n", + "DIR", "LPORT", "RPORT", "CWND", "SSTHRESH"); +} + +tcp:::siftr +{ + printf(" %3s %5d %5d %10d %10d\\n", + siftr_dir_string[args[0]->direction], + args[0]->tcp_localport, args[0]->tcp_foreignport, + args[0]->snd_cwnd, args[0]->snd_ssthresh); +} +.Ed .Sh COMPATIBILITY This provider is compatible with the .Nm tcp @@ -375,6 +508,7 @@ provider in Solaris. .Xr dtrace_sctp 4 , .Xr dtrace_udp 4 , .Xr dtrace_udplite 4 , +.Xr siftr 4 , .Xr tcp 4 , .Xr SDT 9 .Sh HISTORY From nobody Thu Jan 11 12:16:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kDJ46Dpz57JtD; Thu, 11 Jan 2024 12:16: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 4T9kDJ219Kz40db; Thu, 11 Jan 2024 12:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AEgBdo0QDKCjvf5yZs45nbIF/MBrsaHh5XlQRHtCoe4=; b=d7B8k7SA5hZKv5XJG2mlLSe5r16Luk/Y4gfrih1D0SewznPbV/u0s12kRcsfzoVoYbwUIT PxpFC+DKrQSqEkgrp9TohWaLoWEZDvt68cu1xRPlbQ/y0yfi78m9U/x7lZn4im0uQLDRfz g/Av93t0ZOGM6vWt9XBaUDsqiAuEXJPuezf+StbvDKUZILklJXPYOoX75JfDJW0XpP0aUj W+CD0K5i2cKngP//Wf2l+2vlecibwWaM6sguWk2hFgZDM/TBHVqmHroE3qNYrRSEE0W3sH ku7ZsCVeKuKSDv8p0Pjts0TdFM/6XILaLNRftXzzpruuKqTo6eih2GCEnErMnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AEgBdo0QDKCjvf5yZs45nbIF/MBrsaHh5XlQRHtCoe4=; b=tC6MxCsKwUix05g3aytyxie6KbanByEYxdk9QIaIUr4kzE1K1LzwM61LYW90IE4M7SXnY0 mhj5eMoocnQNnE6CNrnUQgDSV3d7kE+Uk4baVGu10LrW+WBPQ2lE/pIByOhNZww9Zhhjdr /qWCG4Sg/xjuEEtr6UUmNYs8lEoxA+CT1a9OANymoXsAt/lkNH7v/2rzllKJsM6GJt6G6A mn/JCwHfK/AH4ynO82tIG2YOGsSKsp2wKdq9zPMPD/0YzP8ZVTAh3mcuvfuCsfSIIfLJyR 7CEdFAI9XJa4PBDBt5A8pTlU5bJ9L8KujUuZt/639zKDsuU2bt7lpXnLecOLxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975392; a=rsa-sha256; cv=none; b=cAJs43oQtGO0rolnP29ARQ2tTbsYbYtJG+BsaN+1S6JYWHhCL90UPBF06IzNTcNKGUlj9g NMcIuOsrJD3Bq8rtthVYGgRMT3WdrFvv5T38UEV/XSNOdugRcDeINOhijMGMzRVDjzhpEi WVNLATv6qE/nheQaLfse13tu7l/DEpUAytqrjaEWabQ6p9QipXfhpAwNSRcvyiImLyQQgb HdZiJeE0zjiBQ8d8xvrFRcUW+0Ckbr7vpbqEC6uDaFC5W0AgcGGr5V/VwcbEoL52p17y1q IKFVgYBAAENbFPr90acnAcAmt5jPDsA6s6dSwTwoepz7uDhqXECXHg5zx6tmmg== 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 4T9kDJ15xlzJ1r; Thu, 11 Jan 2024 12:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCGWwg084660; Thu, 11 Jan 2024 12:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCGWtD084657; Thu, 11 Jan 2024 12:16:32 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:16:32 GMT Message-Id: <202401111216.40BCGWtD084657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b10ff555b2c5 - stable/13 - sctp: include sctp_module.c in kernel builds List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b10ff555b2c5179af64eaaea3da1cef285dbb2c5 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b10ff555b2c5179af64eaaea3da1cef285dbb2c5 commit b10ff555b2c5179af64eaaea3da1cef285dbb2c5 Author: Michael Tuexen AuthorDate: 2023-07-23 12:31:17 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 11:48:42 +0000 sctp: include sctp_module.c in kernel builds Allow kldload to detect that SCTP has been build into the kernel. (cherry picked from commit 058d1722b09eb62d3a86ea4ce4165c2bd61b854e) --- sys/conf/files | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/files b/sys/conf/files index ac6c3ed6376a..5feae02ddd82 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4434,6 +4434,7 @@ netinet/sctp_crc32.c optional inet | inet6 netinet/sctp_indata.c optional inet sctp | inet6 sctp netinet/sctp_input.c optional inet sctp | inet6 sctp netinet/sctp_kdtrace.c optional inet sctp | inet6 sctp +netinet/sctp_module.c optional inet sctp | inet6 sctp netinet/sctp_output.c optional inet sctp | inet6 sctp netinet/sctp_pcb.c optional inet sctp | inet6 sctp netinet/sctp_peeloff.c optional inet sctp | inet6 sctp From nobody Thu Jan 11 12:19:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kHb1Kj6z57JnP; Thu, 11 Jan 2024 12:19: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 4T9kHb0Tpbz40sT; Thu, 11 Jan 2024 12:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFY9bMAvdFJ1uxsaWduMDtL8AHkzbGuTpZHkvtyj5sQ=; b=la+7GKaakyIf4JDlZth/94I2JWNOoVJVH9jYcCOAuXxkmUtYGDyCmDxssvazGaccsQGiJf QA53bppwFQ4bGRRU6MGKC1yRQCLJi91rM1ngRSkCiJiZuD6JolnR3gtzzpHuMA259pnyX7 8ZsdmeQyCyOF7DdRzv37zOG3gs0NLB1u8iPUhDpg2i0QzxYccv+48Q0eX9rMFcl/RDeBXG AsSnmOHo6YWeyLPg3vLVIDabk24envhHXKDpVEy9wA3Vj3RHzsE9a/hqXOI39QBqZjd2n/ l6HqbOaapzyMa2ZPoCN9imG1+2R+BSaQx4ocOf4lUj6Qa9ltefWKmKALtbfC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFY9bMAvdFJ1uxsaWduMDtL8AHkzbGuTpZHkvtyj5sQ=; b=eJ0p4u/dIoGFTuQwEaOUcG56HjyiLO0YoZBvXT9S0XwPgd1c/J3Rp9plLOJhJyJHr/zqLt iXv8ze5IIeKjse2kPIsDejVvJhbhtrnhLAg/6qMsIO9p0bfA/dhkAInj+qKHDM5m/a2TxP mYaRp3BaywUMlH7BsIidUIgzOqGuioKkBrmzHgxR1WDaS2Nooysc+8k7LRfZuQI5y+GRl5 L0G27tKYr71sN6cIvm52eAhCLipPv1BqHWWQCgYCt4arANpO1DxykOqOA5xhCg6PFQBNBI +xXO5/H2Gz9ZRUkVxm/xkPTJpYUTF1xBTrmSmIokXOmAdhRQ0aQ7QBltno1QLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975563; a=rsa-sha256; cv=none; b=gUxzDp34QmKsEnB+etim7LrC7YLrujQe4aAobMVMRgqF6tXdZMOoLrVqsV6jXUJp7qZiLF pLwFBoI0ZHXFdX2EsuGpU0+OR/eGllQqWmmRA1OAAc6CtWDV+T9r1NJ0kAJn4ASekn07lC YZr6SpRZy+j0aWW0l46GODoi6E7CbYARpjP2TAFz9QpKFQJa/1mrCvrv5jmlH3wewmWpBa GHAatZNQtwK9OL+U9Dz3agv0G1OGWu3Jhqii3hKPwkZQsUmkeyElaSW21uCM/jRaUZbjxK QEQvicediijXYxJnekAwLfVOCeZQEG6Sa8m/9lcgNQp38hY11vFG7b80CvgcZQ== 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 4T9kHZ6XmmzJWq; Thu, 11 Jan 2024 12:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCJMKo085226; Thu, 11 Jan 2024 12:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCJMVQ085223; Thu, 11 Jan 2024 12:19:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:19:22 GMT Message-Id: <202401111219.40BCJMVQ085223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6c9b92e741f0 - stable/13 - sctp: improve consistency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c9b92e741f0f878deff8ad3553239155c517a7a Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9b92e741f0f878deff8ad3553239155c517a7a commit 6c9b92e741f0f878deff8ad3553239155c517a7a Author: Michael Tuexen AuthorDate: 2023-07-28 12:36:11 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:18:37 +0000 sctp: improve consistency This is simplifying a patch to address PR 260116. PR: 260116 (cherry picked from commit b279e84a47ddb59e55b5a3cec31c51cd41bf0dc3) --- sys/netinet/sctputil.c | 8 ++------ sys/netinet/sctputil.h | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index d9cfe12861d7..e34cadd27bc8 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5040,11 +5040,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, if ((stcb->sctp_socket != NULL) && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); - } else { - stcb->sctp_socket->so_snd.sb_cc = 0; - } + SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, tp1->book_size); } } @@ -6121,7 +6117,7 @@ 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, (int)cp_len); + SCTP_SAVE_ATOMIC_DECREMENT(&so->so_rcv.sb_cc, (int)cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 1f450a264939..9026fd09a0be 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -251,11 +251,7 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ - } else { \ - stcb->sctp_socket->so_snd.sb_cc = 0; \ - } \ + SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, sp->length); \ } \ } \ } while (0) From nobody Thu Jan 11 12:21:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kKT1G25z57KDV; Thu, 11 Jan 2024 12:21: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 4T9kKS571fz41PJ; Thu, 11 Jan 2024 12:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oqvZY+CryIcAHNvrEUhXTH5PtCq1QCvTxlvtzwR7AJ0=; b=tOgibMyldqlhTuaws4FvxZmKdt8r0PP3fyOo27UQV/DVajw/i60f8MYHuq79B/iPcMIFG5 py8LOOIy6vOGy6tTU7ofk6G0TVqo504Cn4bal4eTPG4hAPrTeizW3StZ95OhL0mzbZfB/j DXLpOzStcdJNWH1zt4jo8K2iZaL/WClzZPC2vajvZMklqCxSRXik0/bnFgSEdtn3ZpCu3k zy2obtkpS/T2UF1KB5/XVdA3bPC1FWTGKcghqXZpNtqZ0qu3xW8OoaLqprllAbqO+sobCH r1PO12ntoF1IjmU7ohHWHGbrHXbq5fB1XmJ2PnFYXQjFcfwy5DeZdQTLD5l18A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oqvZY+CryIcAHNvrEUhXTH5PtCq1QCvTxlvtzwR7AJ0=; b=cN7SZpVdebUENhkBDc2ns0zH2I+r4gg/2YTFM6HUs5IgguSyL8G4BvJYuVkEq6B4YLsmns KBwKJlUVVtZhDabyQCUeAM8ENyjfSzy7HxRLDBXeia/akhYnsIJvtoVOAEq+4xbORnwq1u C9eP1cP8ocOiHt8SzzDhqj0oti0T7f2B+45Awjx9oRn1qDmTg/q1/pIrjtKfoyJwhe/TDi E+OTv5Srcc7N57Uc4KMCOextUfxPC15IrSiWODkITX3+qiy4EYK+cbMvzyLoJdQUU+C3GB xEPYMQSYdcxkLZvaJ6/vqBTAK9a4ZoNz9/pQm2MpMSDpK0z/mW5UvpDBzdDbcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975660; a=rsa-sha256; cv=none; b=JRKnj5z33sShA2k+0byp3jkmmhP1bl2VAdZ59Wk94DV22LHMsObINAiOfDuwcRDXV5gwno dSUwprtC5Kvnm51dFxeycBIpXuAJW33/X1hDRWIuvUGFCClFvgG1QAvSFjicoN48tOgDWM 9Udkw4GUWeSelnQVaYtnXeDjwAZcZQPMQ0bs7Z4E26DH2Gp5E2S/bQt1Iy2NJLZjy8tYwV b7ARMrLOpsqE9RaYtuiqKQnlsh/t1qH1v+w+JIcgsyGQp5kXmJCnEN+D2Cest+Vh1BlUB2 kNSqhV9KrT2frwXNIXH4EqAfB0ZpCxFLRkH5mFP1oYlgWkNqq9b6JwzbGEgWYQ== 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 4T9kKS4CHJzJ4b; Thu, 11 Jan 2024 12:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCL0i6096946; Thu, 11 Jan 2024 12:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCL0Pc096943; Thu, 11 Jan 2024 12:21:00 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:21:00 GMT Message-Id: <202401111221.40BCL0Pc096943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f141ff9935fd - stable/13 - sctp: keep sb_acc and sb_ccc in sync List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f141ff9935fde0ab9790a7687605bf3e455d1300 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f141ff9935fde0ab9790a7687605bf3e455d1300 commit f141ff9935fde0ab9790a7687605bf3e455d1300 Author: Michael Tuexen AuthorDate: 2023-07-28 13:16:23 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:20:06 +0000 sctp: keep sb_acc and sb_ccc in sync PR: 260116 (cherry picked from commit c620788150d274c09a070ab486602c98407d73b0) --- sys/netinet/sctp_os_bsd.h | 18 ++++++++++++------ sys/netinet/sctp_output.c | 2 +- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_var.h | 4 ++-- sys/netinet/sctputil.c | 4 ++-- sys/netinet/sctputil.h | 4 ++-- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h index dfa7c906b6b9..01ab8f2823b8 100644 --- a/sys/netinet/sctp_os_bsd.h +++ b/sys/netinet/sctp_os_bsd.h @@ -370,11 +370,6 @@ typedef struct callout sctp_os_timer_t; #define SCTP_CLEAR_SO_NBIO(so) ((so)->so_state &= ~SS_NBIO) /* get the socket type */ #define SCTP_SO_TYPE(so) ((so)->so_type) -/* Use a macro for renaming sb_cc to sb_acc. - * Initially sb_ccc was used, but this broke select() when used - * with SCTP sockets. - */ -#define sb_cc sb_acc /* reserve sb space for a socket */ #define SCTP_SORESERVE(so, send, recv) soreserve(so, send, recv) /* wakeup a socket */ @@ -382,8 +377,19 @@ typedef struct callout sctp_os_timer_t; /* number of bytes ready to read */ #define SCTP_SBAVAIL(sb) sbavail(sb) /* clear the socket buffer state */ +#define SCTP_SB_INCR(sb, incr) \ +{ \ + atomic_add_int(&(sb)->sb_acc, incr); \ + atomic_add_int(&(sb)->sb_ccc, incr); \ +} +#define SCTP_SB_DECR(sb, decr) \ +{ \ + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_acc, decr); \ + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, decr); \ +} #define SCTP_SB_CLEAR(sb) \ - (sb).sb_cc = 0; \ + (sb).sb_acc = 0; \ + (sb).sb_ccc = 0; \ (sb).sb_mb = NULL; \ (sb).sb_mbcnt = 0; diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 91abe158c5a2..56de9cb860c6 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -7246,7 +7246,7 @@ one_more_time: if ((stcb->sctp_socket != NULL) && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); + SCTP_SB_DECR(&stcb->sctp_socket->so_snd, sp->length); } if (sp->data) { sctp_m_freem(sp->data); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b5c78bb67745..2cb3f6874df9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3609,7 +3609,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) TAILQ_REMOVE(&inp->read_queue, sq, next); sctp_free_remote_addr(sq->whoFrom); if (so) - so->so_rcv.sb_cc -= sq->length; + SCTP_SB_DECR(&so->so_rcv, sq->length); if (sq->data) { sctp_m_freem(sq->data); sq->data = NULL; diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index d9576709909c..144ab77c5dec 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -196,7 +196,7 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sbfree(ctl, stcb, sb, m) { \ - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ + SCTP_SB_DECR(sb, SCTP_BUF_LEN((m))); \ SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ @@ -208,7 +208,7 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sballoc(stcb, sb, m) { \ - atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ + SCTP_SB_INCR(sb, SCTP_BUF_LEN((m))); \ atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ if (stcb) { \ atomic_add_int(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index e34cadd27bc8..0f9c0af623b0 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5040,7 +5040,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, if ((stcb->sctp_socket != NULL) && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { - SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, tp1->book_size); + SCTP_SB_DECR(&stcb->sctp_socket->so_snd, tp1->book_size); } } @@ -6117,7 +6117,7 @@ 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); } - SCTP_SAVE_ATOMIC_DECREMENT(&so->so_rcv.sb_cc, (int)cp_len); + SCTP_SB_DECR(&so->so_rcv, (int)cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 9026fd09a0be..f0f6d6bccfc7 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -251,7 +251,7 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, sp->length); \ + SCTP_SB_DECR(&stcb->sctp_socket->so_snd, sp->length); \ } \ } \ } while (0) @@ -262,7 +262,7 @@ do { \ if ((stcb->sctp_socket != NULL) && \ ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ + SCTP_SB_INCR(&stcb->sctp_socket->so_snd, sz); \ } \ } while (0) From nobody Thu Jan 11 12:22:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kM307yGz57KHb; Thu, 11 Jan 2024 12:22: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 4T9kM26cRhz41Sy; Thu, 11 Jan 2024 12:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j83d29f/B+Gwyrg39/5EX0TdSTg1vUrD1htNfCbe8rw=; b=sc/5GtBy/Mzeyvssynm3dLwDZc7+PIkUyurGaFrKxe9Ay8ejmeQls90kQDKF508n5jcYju qAAHf2zoYSmMdXGUd7Dg6HELmGkQVhNgr/3DhfRy/cC4rxDDJOK9TO57dsKtMuC0SVv63b HQwJf5PHlA9/LINZEy3J2Uo1KyNUflt1Vda4RZeuC5qVow3X0P4TIsT5V4F1Hj3tLHAwZF xfIAXZF1QY+MaHrQFWwvibaa25OITTa0P7iSreJW1Y4KmIQiR6fyJ7dKGq/ynfqjTai94F aDpajewnyAlXgUEaFaqvBbit/GnYiRUsPjUt/Dkbxzoeem4rsMna4sq9lPU8kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j83d29f/B+Gwyrg39/5EX0TdSTg1vUrD1htNfCbe8rw=; b=hDMwHtL8HyQv+Nbbur+IRYachX+XE69QbTJ9uC+w/ufxcXp3FYpg0TiLgjqAg9aWVicU5w pA7fAuYHN3jWwGKeMA5UodyU4YT+y4AOki6/t+VwicfdYl0wcyxM5/4z28qHKcmQpioTdF DyAJKcT1dTsTBbbfFcm7yp1/MAoxXfwfS6Ig4lDH/0ox6nKagMkUHM/djSFu/PZVU/1B13 27gNy5u4cqYxHFTcutvGlwNw5STylzeSDWJ92X3LW7DqRSZnz56m93luqJnFO+x2yEHfmU nvHcRqye3AY6OEo3gc/1icmPdHNmaF9QE5Q3sZB19fzoBVXkluNPMYokZAbeFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975742; a=rsa-sha256; cv=none; b=Gn+wjfjTMJZum+kWcf2yyZfzAIwyZA2cVBEWUqoXE7nxgtMdHW+9JVuwaLDRxMOetNBM+m EiV1YIuxbjnNGwOiV/IwWNVxsXVRDwBCTSOxKQ8YdHRgvELuV4G9x1BMHEWGvroy2eg3t1 +/GtL1IulFjVNMa7UoioLEHHGFZButdppzQUl5WUGNFjTPp5pFHKrZeAO0KsVEmFhIy1zY dQI9QIjQE5kuExIA25mUHey2Tw9bRhXlol7qRVYuMJptF1+OyFJwbsTlFkUAG0zzyj9ZKI 2GYTncCpIy8vfkec91ww3atyjoy2b9PKVZi7LJljGjdMqQF36Jy4B9r8xfKgkQ== 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 4T9kM25hJZzJcP; Thu, 11 Jan 2024 12:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCMMVH099866; Thu, 11 Jan 2024 12:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCMMll099863; Thu, 11 Jan 2024 12:22:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:22:22 GMT Message-Id: <202401111222.40BCMMll099863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e47f243218bf - stable/13 - sctp: improve consistency of acc and ccc handling in snd buffer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e47f243218bf62ae2f3ad915d7b8d73893b4b4d6 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e47f243218bf62ae2f3ad915d7b8d73893b4b4d6 commit e47f243218bf62ae2f3ad915d7b8d73893b4b4d6 Author: Michael Tuexen AuthorDate: 2023-08-04 06:32:25 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:21:45 +0000 sctp: improve consistency of acc and ccc handling in snd buffer Don't clear the counters for the socket snd buffer when shutdown(..., SHUT_WR) or shutdown(..., SHUT_RDWR) is called. This was causing the system to panic() when SCTP pf tests were running. Reported by: dchagin, kp (cherry picked from commit efb04fb404b240a99c618e49174cd6260217edaa) --- sys/netinet/sctp_usrreq.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index bcfc496a132a..10af0c669f04 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -848,7 +848,6 @@ sctp_flush(struct socket *so, int how) SOCK_LOCK(so); KASSERT(!SOLISTENING(so), ("sctp_flush: called on listening socket %p", so)); - SCTP_SB_CLEAR(so->so_snd); SOCK_UNLOCK(so); } return (0); From nobody Thu Jan 11 12:23:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kMt6SdJz57KHm; Thu, 11 Jan 2024 12:23: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 4T9kMt5gJNz420m; Thu, 11 Jan 2024 12:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjpoRvYrBt1GvsMKhd9Crsni23GQcGZ3o7N1CNxn+W4=; b=hQyFlYzpRLEAOdtcln1Pe77av2ZnYHbozK8sgi/g0cmYa8upBW0CdLDudBvOkeejs8Ko7a Y2/os9bYGtmtFs/0Bkj+2TD2a8DgUvFVe/AN/zEXGg2W1kt27jFxW4CNs1x7PvdqdM2E9c OexR5SfbD6aircN+ueREqGwQQGEm3fMN5HAx5iAezrBSvX2RbHRLPY7DG/yBDmuBKbHRB7 8GNcl4MfSydWzedPjMZnxGhS0TgVfPcuvtj5SItrj7CuG6gF9yb+KwL0ZMM3sMA8K0hhpR 7fUV4abRFkK/5RZbxDFfLv/MvE6VuZab7lobp9KuYJz26041v62x3luMW0K2Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjpoRvYrBt1GvsMKhd9Crsni23GQcGZ3o7N1CNxn+W4=; b=UpGDHIjVFk4QHRktpzJCyPW3TGms5vNHul2CwMBYJU5kf6h9+RbM8h4uNkrZ/Omx5NrtEd Q6Xxj7pKsmUaOcLTARHT79EzM7xwp4CHF0rqBLnSOE8JW18/OTJ6IyvSzFtAzDhCf6r1Th e+S5w/jVqOpYBSvMju0pcPQTlT+rXp/VfhlauK+DPYwYVstZaHFpGkPj+L3i2xhI4z+SBd T8URyTLizPK7PRty1efstZKCz6AErljcnIroS5AaZ3gcQRzZHZLQkzyTGHhybKBvZBZD6F KSuRiAq9rFGtW19JpwZEwhjIOH/GxeA4Ooj3tDEiL/VWcwS71Llfnz2I6HrcwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975786; a=rsa-sha256; cv=none; b=weL9ypxnjNsIxqhkEJ/j19N6trZL27bOAsTUtBS2fDZEspmBef8PY+NhDc1lD4KwyJiBe1 +Aok+MKlvb70K2bGVkUw+7np9QIcPpBclSx6KxSxh6dyc99ZMNCvkCp+DvXR6qtyq99O1q F9av8c9gX0v7MzY0tmaMap+q4VpeQ8tNIHbAleha+lgo4uxMAYv66pCgir6uuW7EFQFOwR jxJZbbxrOmQjbJvKJ+5g5/Vh22v0wKvqT6byxtlX1WmI/IS0o8gbM9fAy4k/IsbK65OckJ pbldyym8paAD1i7yJjhh31SidAK+IU8ZQw4B7YhV4eeUnKXVfszBP8ifDwYVcg== 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 4T9kMt4jhnzHmc; Thu, 11 Jan 2024 12:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCN6Jp001024; Thu, 11 Jan 2024 12:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCN6mI001021; Thu, 11 Jan 2024 12:23:06 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:23:06 GMT Message-Id: <202401111223.40BCN6mI001021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b7b4790355b4 - stable/13 - sctp: remove redundant check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b7b4790355b415b99cdd066cf55e1510e4644da1 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b7b4790355b415b99cdd066cf55e1510e4644da1 commit b7b4790355b415b99cdd066cf55e1510e4644da1 Author: Michael Tuexen AuthorDate: 2023-08-05 09:26:45 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:22:43 +0000 sctp: remove redundant check This is already checked by the caller. (cherry picked from commit e3771cc03419b69c8ee851c1ffa85230d0fde1d5) --- sys/netinet/sctputil.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 0f9c0af623b0..0d08db080c46 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3651,9 +3651,6 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, /* event not enabled */ return; } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { - return; - } m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) From nobody Thu Jan 11 12:23:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kNk1P3Jz57K8M; Thu, 11 Jan 2024 12:23: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 4T9kNk0PmQz42N9; Thu, 11 Jan 2024 12:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XzZxsmCJkYr0qKQO+ImOzTGycZwvbAeVslkOQknQRJs=; b=fKkz2auIAjkqNx0LERX3KCwLjG9BUiFNPw0vlHzOxTOfB7qUvTI/Kzr8drtVcezazhSlkK jNOJ8tgK7ql+WhcMM5akdJ9ikL1MwmdueRGTc8DsuWKk5FE/vi6qEFG8vmPQnB7kWhw3+i mXNsBLuyu8hSW+++98uGgI3SFJi+tt4js5QEHUZXj3bDCVkUak8ZXHzny+dgnFOhf2niKs zhL5/mWUlYV99Qu/aozzYP6nUwDl5uEgUqqQX6d0ihUkchC6tv9VU9BOIJBs2qNJdL7pEI cqDx2wWK/zLYViNPrDTcXqqS9FxZp+hJoRoRMZysskxfSk+q47vCZJAsaQdX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XzZxsmCJkYr0qKQO+ImOzTGycZwvbAeVslkOQknQRJs=; b=aVxFf6wRh1JQ7P5QLAT2/9zA/ReNkQqvTp7AhGN8EavXdhdAl+FU6u2UAzXAA5QneqHkO6 CEMbLE5NrIEHkybxyRohLYM8Sc3EWPtfDRjH8vedns65lJcuYrgorvspQBuHqRbIk0t59t n5fWwN85OSaA/8RRqN6HeqlIscESJ6a/0RrUk9lFbfQkcXUgbHgqlKmQtxN0XRbeqMqKFV +x+FetagEOfqnnJjY5DAQqymbJW/CJ5zM+QNVRDaXSYXy7NLJ8Pin7iT7+4LnDsO5UMbi4 wZGbThghnBAcubcID/aFV4LqARLuxJR0L+YcdW2XA07mquDDPEbLx+pbOVbRyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975830; a=rsa-sha256; cv=none; b=YgQJ7mjXi1SSSFNyt/lfBd59yG1B1q3QCETK4FPWkDvSB6LcUSQQALh04QqbqfzQhqC+Fk w5lwC3VzjSpj9Ny3XjdWb3HPjMNQIuRJasV7vz0fWSL8wyQ7EUAbLjQQdNXYh2v3LxxzhP HDIKciIGsk5SvL+LNhh2FY3QuxlVQGxlvHiF33goIRGk/IlZCn3eMsGquVycozT2CkZodv XSrKbwkAZzNyfyxeChJb+5+w3yun+LYtf6KtGXK7/woW1elG6c48KQfvRcnbyeERVZwDUA fBTv9wBM36KYcJ7KyBGceuBcAih/XNAho5L7lUWXFnJEXINnxyVNIo+5uPmcjg== 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 4T9kNj6bKyzJpL; Thu, 11 Jan 2024 12:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCNnYo001238; Thu, 11 Jan 2024 12:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCNn1m001235; Thu, 11 Jan 2024 12:23:49 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:23:49 GMT Message-Id: <202401111223.40BCNn1m001235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 53b8d66ada00 - stable/13 - sctp: improve consistency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 53b8d66ada0096f529045726ad77bb04450369b8 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=53b8d66ada0096f529045726ad77bb04450369b8 commit 53b8d66ada0096f529045726ad77bb04450369b8 Author: Michael Tuexen AuthorDate: 2023-08-05 09:29:23 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:23:25 +0000 sctp: improve consistency (cherry picked from commit 10b2b30670d7c389b26533aa43e8d0c3aef55ff3) --- sys/netinet/sctputil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 0d08db080c46..72edf4dd66c9 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -6114,7 +6114,7 @@ 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); } - SCTP_SB_DECR(&so->so_rcv, (int)cp_len); + SCTP_SB_DECR(&so->so_rcv, cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); From nobody Thu Jan 11 12:28:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kTs2vrjz55bVr; Thu, 11 Jan 2024 12:28: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 4T9kTs2NjDz43ZP; Thu, 11 Jan 2024 12:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWtTpc2s3n6TcJt4HXgp/1rFE7cCnOI3xMuX0Y2Pqi0=; b=raGSpXEBi6rv4tAYsRC6uvBNkbpafOYZdnAP9wLNl5qHWdEwujxbg0AU26w9OAHxOSrC74 RRpc3rK2M1G99ZWUB2KTchlVuRskdX9tvsp4TW7owpX5UkOBh5QmI3+PYQs5R55U7K9Mt/ 4Wzo+imv/N9xk3v/EiS4ZMyvUEw2Lg45EL8Sz8Ajp3kNEpGOKsf0t+lCSYXA0m4kNidYwZ r3eD+DVwbqzZH7gLG/gXCPJquUEJJDJq2PHfGnQ7QuMjxJz5AhdLoRv/hr+RSD+IVED3ez eIFk/zB/8LWZ4U+NV/5OCXD3y9sLWv48spxPUimjjqrlDJjIGs50NOH3Vqm7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWtTpc2s3n6TcJt4HXgp/1rFE7cCnOI3xMuX0Y2Pqi0=; b=K2QkE+AauIoUDLeK6+PYRzVPtlBRNZQKJgRcgWKJSmiOWsY9+w90uAJIiLxDIFDAqMTSih rMrb5VzcLmeBbVja4MGLJdACQr3SDozMdlzjB8pPIB3z5ZqG/+V227/t8FYjlwj5aSjEsv Z1Iyd4MgefjrxfzSdrB7CRx4JzH3YGt8x3YGiOy0hy3RQF+MFUkGQgDcMZ4JT/uweJOWNx OMcXN4l1+RpNUkRYAhSyyo+hK0w9AdVKcUdlgDjdR6ZKEk5zhbaGeV5Cz5Ko2Vb+/kNzhQ xqRFXSkam0drQw1DR2rqw+y8R9A19NYUR/gg0EBV0YkG1VDwnp+33goKfLmH+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976097; a=rsa-sha256; cv=none; b=NPClEyAV0xQt+fdRogrroLvYzECJZ+XZaQh/mDgLafIZoB+6ZUp9IH2P+UTIg7U28r0MXH hB6PlDa8MYQPE2dSgN2vtfCd2GZc5q6t8XYCO0loIEvi0d4FivbiFq0MX/0+CQ5R5GQXQu Y5EfRhKEdTU99TxIP9srA+rH62+L7WrPrt8jsHZySAtQy5hMJa8qM0nOlZP/cik94o/gBX nfy9ClEoqC5+RqJ3LbI6MKZnQwE5IOgDvvneyOJviRqNUPUwYznluRwMCDdazFrv8Hvw+f +ytZDxLRC3qDs2j/GkyZyoXaW3N9wU0GDlCmT8SEK6WFhIvaFevw8BtuYA0vnQ== 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 4T9kTs1RNJzJXk; Thu, 11 Jan 2024 12:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCSHK1002010; Thu, 11 Jan 2024 12:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCSHdA002007; Thu, 11 Jan 2024 12:28:17 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:28:17 GMT Message-Id: <202401111228.40BCSHdA002007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 553e395b7601 - stable/13 - sctp: cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 553e395b760191aa6c2c162b7737a8cdd9c933d9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=553e395b760191aa6c2c162b7737a8cdd9c933d9 commit 553e395b760191aa6c2c162b7737a8cdd9c933d9 Author: Michael Tuexen AuthorDate: 2023-08-08 10:40:51 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:28:03 +0000 sctp: cleanup No functional change intended. (cherry picked from commit c7587f7a3f8ddcc8dd209c9cff7b9ec3bf353dec) --- sys/netinet6/sctp6_usrreq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 151e1a0b9479..aeebe712b1ce 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -658,13 +658,6 @@ sctp6_close(struct socket *so) /* This could be made common with sctp_detach() since they are identical */ -static -int -sctp6_disconnect(struct socket *so) -{ - return (sctp_disconnect(so)); -} - int sctp_sendm(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *p); @@ -1208,7 +1201,7 @@ struct pr_usrreqs sctp6_usrreqs = { .pru_detach = sctp6_close, .pru_sopoll = sopoll_generic, .pru_flush = sctp_flush, - .pru_disconnect = sctp6_disconnect, + .pru_disconnect = sctp_disconnect, .pru_listen = sctp_listen, .pru_peeraddr = sctp6_getpeeraddr, .pru_send = sctp6_send, From nobody Thu Jan 11 12:30:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kY018HBz55cJv; Thu, 11 Jan 2024 12:31: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 4T9kXz73g3z442P; Thu, 11 Jan 2024 12:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo8dq6UK3hfMUMSm9jQSTIYHcDcTQ3ZSj+Lv1kMKd1w=; b=CCh9DDTTPgCyNtlT7nHWf3j99GERw/7dTFp33nCyciqkpvouTDGXBBt4Y0evEoxWzMata+ hWkW7OMmgSLFJdjsGWiJdFywxd27tqqoZ+ImpaxowIMNtZLphdoEsv7T1nk7BKbY1bmblF qloIH+xhUhRHOW2Lv0LD9istc5nNN78Mj3ADo6Fc2/gO+D5IVuntOSXICeVbUR3XZRflog B4byRXN5+4REYOkvft8iDo9okfTZFqBisL4sfU4PDluSl52dolWO7yajeyReKETWo2NuA6 PhkW4yTgysRdw7CLKT6jmS0dtYbx1gBYXU6gbkkEKd4P3/wPo6TJ2zZgYF1vVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo8dq6UK3hfMUMSm9jQSTIYHcDcTQ3ZSj+Lv1kMKd1w=; b=e6bzx3tWB/z4hsb/g1RqrXIg1N7bnh+XapQX1rE07obcbvmCHgX0zjXWR/2Fzocdz4Z8rv mw5YvXPxhibc5ZlIJF1+IxaaKrOAY+yKsrMxrfJ4/acJcjhlmaKmFLsbVdxXvtEOI6WR98 tyDCqhF3LsZ7juMnS83hzqzAxf+Ic83LfCiPM07JNtROL3PX8oI/w7BcfPpLkDDEGAu6C+ Dlc0r8lyBM/0a2Tzn0qCcSvdtw72s+h+rdVhLX/grLLN269Foy5wXvoHKgPh9WgfCn3lfe Hyiwb9I+6yT64ib2l7mRkejpqjfl3QFuT+kuBc7XJ+piEjGYDkWzOkUkbLnSFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976260; a=rsa-sha256; cv=none; b=nwGTUizXRIQc8R/dbgWtmdkGyNUNTHIBOEsE62BlSMCshG/aAdDAOb++S8qVgZ/osjdS4A XVbNh20yQbRGRwh3XJbMI+uD+T1uCcDdDPoCtZlw46xguO6NcF8K9haYjN3qnrzHwjdTlH 5mzd25vWjzshQ8ugXLekCMB+NTm+JgBpyZcglvYvew/UDaot08y00ZsCscnr2mJ4t3tCQj BnZjDnKGqGl5CzvzBEocC0CyoSMRwgdrs4SCKRs6vxbflzB8Y/ZGz2Ee2D/lAoU08fSM7I XMDGWpUqo09g9jJQhWp9iK3fHghsZ5cOh2EYje1zEnGBErj1s8u7YpDYeB8sww== 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 4T9kXz5MG9zJXr; Thu, 11 Jan 2024 12:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCUxA9011291; Thu, 11 Jan 2024 12:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCUxWd011288; Thu, 11 Jan 2024 12:30:59 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:30:59 GMT Message-Id: <202401111230.40BCUxWd011288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 31acdb17668e - stable/13 - sctp: remove duplicate code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 31acdb17668ec28798fdace1f1f192d18ec50765 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=31acdb17668ec28798fdace1f1f192d18ec50765 commit 31acdb17668ec28798fdace1f1f192d18ec50765 Author: Michael Tuexen AuthorDate: 2023-08-08 11:05:39 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:30:20 +0000 sctp: remove duplicate code No functional change intended. (cherry picked from commit 9ade2745db8be213e9da2225795cafb8e7575e29) --- sys/netinet/sctp_usrreq.c | 4 ++-- sys/netinet/sctp_var.h | 1 + sys/netinet6/sctp6_usrreq.c | 48 +-------------------------------------------- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 10af0c669f04..4e43c8c72f40 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -424,8 +424,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, getcred, 0, 0, sctp_getcred, "S,ucred", "Get the ucred of a SCTP connection"); -#ifdef INET -static void +void sctp_abort(struct socket *so) { struct epoch_tracker et; @@ -463,6 +462,7 @@ sctp_abort(struct socket *so) NET_EPOCH_EXIT(et); } +#ifdef INET static int sctp_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUSED) { diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index 144ab77c5dec..0177dd5ac227 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -319,6 +319,7 @@ struct sctp_tcb; struct sctphdr; void sctp_close(struct socket *so); +void sctp_abort(struct socket *so); int sctp_disconnect(struct socket *so); void sctp_ctlinput(int, struct sockaddr *, void *); int sctp_ctloutput(struct socket *, struct sockopt *); diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index aeebe712b1ce..dca38401c02b 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -460,52 +460,6 @@ SYSCTL_PROC(_net_inet6_sctp6, OID_AUTO, getcred, 0, 0, sctp6_getcred, "S,ucred", "Get the ucred of a SCTP6 connection"); -/* This is the same as the sctp_abort() could be made common */ -static void -sctp6_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) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return; - } - 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)))) { -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 16); -#endif - sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, - SCTP_CALLED_AFTER_CMPSET_OFCLOSE); - SOCK_LOCK(so); - SCTP_SB_CLEAR(so->so_snd); - /* - * same for the rcv ones, they are only here for the - * accounting/select. - */ - SCTP_SB_CLEAR(so->so_rcv); - /* Now null out the reference, we are completely detached. */ - 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; - } - } - NET_EPOCH_EXIT(et); - return; -} - static int sctp6_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUSED) { @@ -1191,7 +1145,7 @@ sctp6_getpeeraddr(struct socket *so, struct sockaddr **nam) } struct pr_usrreqs sctp6_usrreqs = { - .pru_abort = sctp6_abort, + .pru_abort = sctp_abort, .pru_accept = sctp_accept, .pru_attach = sctp6_attach, .pru_bind = sctp6_bind, From nobody Thu Jan 11 12:31:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kYg3gCFz55cQl; Thu, 11 Jan 2024 12:31: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 4T9kYg38mkz44XV; Thu, 11 Jan 2024 12:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iARR14Z+g+gmiTE3xB2IUFtX6mIhqQJeriHVaI17/cs=; b=ftkiu7M7/x8gCcP0P1PS7oOgCcD10sP707fiqkUDSBQjIgZK8E4BbqZ8AciuokjJgDIqYX qh+QmQCkT4kh5/vxqKOfXEG0Di+WCDp8EMkfvUTZ8y4p2x2x3aeizQighduZRqfKAOEOFJ yFaN1flVPDzdjr47dQovb7u+WLDKB1utIsiGQQHDDcPSFrXtzLLUNm8XtKh49GtUFZadLb /HZBU4IZpB9kA6YGvlvK5uWYM3i5Kta1eTlH1lFcFAJjBRJcXOrRQWS4pUoR7vfZIczhXo uSgvFhbLf7ElpmlxOKWcVR6th3ovuf6vtYDlm6UODffHF0UoOCunk+GrHOebyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iARR14Z+g+gmiTE3xB2IUFtX6mIhqQJeriHVaI17/cs=; b=iqrHLmkDwlIAbCn34b9rzcrcVjwo6+iB/X0QqpuwNxdg8PMvpumQ1UiyMeOP7YlH2y6113 auzYvCeUmIZI5JH2T/P+nTxhPfQa1NImNuYb8o94ND7gEpKFZdwyDMIqa+qZL9lx5Yi+w0 zvZJ3lTfHXCcFB7bvcWMJqPI4sXY245jGUFtjEovO42iwZjW44RsFzWcOt7QRcZ8aH9tqQ u6fwEprcsbZnDAE5wHYeQrdpdNj2PLDir3izB7c0igJs9V/Jc38kxF/DfObpGeUMeWSCJ9 GmgEPYrpeOrvXnxqntB3qcwwAXPLTmkrwQCeidsXf4GeddfZHXI/QjZxh97X5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976295; a=rsa-sha256; cv=none; b=Xn1Ee87OfpmaDYsHmY2DKeaVMDsVv2U6gp8IUQbNHbTCYtX7qkVhs7pozXBjBza0L6nXbS cAOuC9D8w9h0aaPPmYmfBL72K9ncoit3OBumtYvssdlLYMOowFDLYgVi/DbUV8mSpWW9oG joMUTnTwUqM6m/F9aJpEvreqJAQyglq/gCwTQAH/4wg/CT8LnU8/8hSaBWNyU5jmIv8gVf 8h9F3CGvQ5HeSiI0shmh6xoMoOBauL/DmSguS+cP+FK7WFkBAG5xEGmWBCXrGBtvU+MrWr hbc8wSWehw8rRJw/O3oIvI5+378ujZtgr0uw6DeDzFPQqT942J/ad12T3zuGFw== 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 4T9kYg2D54zJb2; Thu, 11 Jan 2024 12:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCVZkk011490; Thu, 11 Jan 2024 12:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCVZlp011487; Thu, 11 Jan 2024 12:31:35 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:31:35 GMT Message-Id: <202401111231.40BCVZlp011487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a2f048084999 - stable/13 - sctp: another cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a2f048084999dca10f774412eb69839a0b0aea83 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a2f048084999dca10f774412eb69839a0b0aea83 commit a2f048084999dca10f774412eb69839a0b0aea83 Author: Michael Tuexen AuthorDate: 2023-08-09 02:17:52 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:31:09 +0000 sctp: another cleanup No functional change intended. (cherry picked from commit 85e5480df95e6bca38910f44f6e9b4d7773904ed) --- sys/netinet/sctp_usrreq.c | 226 ++++++++++++++++++++++------------------------ 1 file changed, 106 insertions(+), 120 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 4e43c8c72f40..b28bfc66af8d 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -663,7 +663,10 @@ connected_type: int sctp_disconnect(struct socket *so) { + struct epoch_tracker et; struct sctp_inpcb *inp; + struct sctp_association *asoc; + struct sctp_tcb *stcb; inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { @@ -671,134 +674,117 @@ sctp_disconnect(struct socket *so) return (ENOTCONN); } SCTP_INP_RLOCK(inp); - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - if (LIST_EMPTY(&inp->sctp_asoc_list)) { - /* No connection */ - SCTP_INP_RUNLOCK(inp); - return (0); - } else { - struct epoch_tracker et; - struct sctp_association *asoc; - struct sctp_tcb *stcb; - - stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb == NULL) { - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } - SCTP_TCB_LOCK(stcb); - asoc = &stcb->asoc; - if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { - /* We are about to be freed, out of here */ - SCTP_TCB_UNLOCK(stcb); - SCTP_INP_RUNLOCK(inp); - return (0); - } - NET_EPOCH_ENTER(et); - if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || - (SCTP_SBAVAIL(&so->so_rcv) > 0)) { - if (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT) { - /* Left with Data unread */ - struct mbuf *op_err; + KASSERT(inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE || + inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL, + ("Not a one-to-one style socket")); + stcb = LIST_FIRST(&inp->sctp_asoc_list); + if (stcb == NULL) { + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN); + return (ENOTCONN); + } + SCTP_TCB_LOCK(stcb); + asoc = &stcb->asoc; + if (asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) { + /* We are about to be freed, out of here */ + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + return (0); + } + NET_EPOCH_ENTER(et); + if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || + (SCTP_SBAVAIL(&so->so_rcv) > 0)) { + if (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT) { + /* Left with Data unread */ + struct mbuf *op_err; - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); - SCTP_STAT_INCR_COUNTER32(sctps_aborted); - } - SCTP_INP_RUNLOCK(inp); - if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_3); - /* No unlock tcb assoc is gone */ - NET_EPOCH_EXIT(et); - return (0); + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); + SCTP_STAT_INCR_COUNTER32(sctps_aborted); + } + SCTP_INP_RUNLOCK(inp); + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, + SCTP_FROM_SCTP_USRREQ + SCTP_LOC_3); + /* No unlock tcb assoc is gone */ + NET_EPOCH_EXIT(et); + return (0); + } + if (TAILQ_EMPTY(&asoc->send_queue) && + TAILQ_EMPTY(&asoc->sent_queue) && + (asoc->stream_queue_cnt == 0)) { + /* there is nothing queued to send, so done */ + if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { + goto abort_anyway; + } + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + /* only send SHUTDOWN 1st time thru */ + struct sctp_nets *netp; + + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - if (TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->sent_queue) && - (asoc->stream_queue_cnt == 0)) { - /* there is nothing queued to send, so done */ - if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - goto abort_anyway; - } - if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { - /* only send SHUTDOWN 1st time thru */ - struct sctp_nets *netp; - - if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); - sctp_stop_timers_for_shutdown(stcb); - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_send_shutdown(stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, NULL); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED); - } + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; } else { - /* - * we still got (or just got) data to send, - * so set SHUTDOWN_PENDING - */ - /* - * XXX sockets draft says that SCTP_EOF - * should be sent with no data. currently, - * we will allow user data to be sent first - * and move to SHUTDOWN-PENDING - */ - SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); - if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); - } - if (TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->sent_queue) && - (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { - struct mbuf *op_err; - - abort_anyway: - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4; - sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); - SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_INP_RUNLOCK(inp); - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_5); - NET_EPOCH_EXIT(et); - return (0); - } else { - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED); - } + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, + stcb->sctp_ep, stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, NULL); + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED); + } + } else { + /* + * we still got (or just got) data to send, so set + * SHUTDOWN_PENDING + */ + /* + * XXX sockets draft says that SCTP_EOF should be sent with + * no data. currently, we will allow user data to be sent + * first and move to SHUTDOWN-PENDING + */ + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); + if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); + } + if (TAILQ_EMPTY(&asoc->send_queue) && + TAILQ_EMPTY(&asoc->sent_queue) && + (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { + struct mbuf *op_err; + + abort_anyway: + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4; + sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); + SCTP_STAT_INCR_COUNTER32(sctps_aborted); + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - soisdisconnecting(so); - NET_EPOCH_EXIT(et); - SCTP_TCB_UNLOCK(stcb); SCTP_INP_RUNLOCK(inp); + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, + SCTP_FROM_SCTP_USRREQ + SCTP_LOC_5); + NET_EPOCH_EXIT(et); return (0); + } else { + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED); } - /* not reached */ - } else { - /* UDP model does not support this */ - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); - return (EOPNOTSUPP); } + soisdisconnecting(so); + NET_EPOCH_EXIT(et); + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + return (0); } int From nobody Thu Jan 11 12:40:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9km95DCbz55dCp; Thu, 11 Jan 2024 12:40: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 4T9km93Dn8z46Br; Thu, 11 Jan 2024 12:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DprmClRYTEo1I1Y7rysS5Hb4/iKi3YIalqXkduUIPoc=; b=t8SDjgZMKd29yBvYMGJd1g0UkE3HY1Zi+5gm3NpaW8yndQewlVEP/Mukzc4Drjw5jKwN0I ijSEsyZBs7WcHG8slptWygL6tRmh6tf3V/P0Pt5H7KjNOtiaw9qH9lTUOrstMunJFANpRc oLTlCNuhMMwNKdpRKoEOFtTtwwar+Ld5+N8md/RTXl6kQFCy2qsU4SzuNnHqZMeg8rOvcC 0LC3KBoznaFYlqPBL7OCzVaehEoFWyiqXgnRcKtPqtYw/KueXBkuCi4zq0thyjMI/2LuCA oi/dQYYN8v/q9DDSIyOmZtJqnELlgxlJ7c5ZZn7QdzwiIwEbttD0RTO0eSTX4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DprmClRYTEo1I1Y7rysS5Hb4/iKi3YIalqXkduUIPoc=; b=lCrua9181h0zzldNmoY04WM76g+G1E1sAmylRNCxSWzSWOZS1avTEgQSIh7TKv+lFQbRmo NNN7NgtCtLmw9C49WfQoAe4fnEpHl+v0TDJOVMJC59lvOZFXt7Vv8ZX42/QISVb757ReDl ohv+YR0c+V0Mr88evMPIRIc99+Rs4dFts9r+/zOW5vYww/txIDqGEnURGXWmX9IVhavWG8 7y3e4WjeQ3nJj5GTZO2O+7HD9KZ2zLeImZwa5qUE7zvpcNvPnLqabcDlfZo/N6eg8o128g xZEz8LLroou+oP0J9PFScGUXldGtIVA2QU9CodWC7IuWUckHCHh5jHbluhBJiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976841; a=rsa-sha256; cv=none; b=vesswibJQb36EEBkEt54kCgZxGkmooU2G4kSl6vxikGqwXOFpBbKiIBx5pBL+cFH7CCsPJ zqcITHVulCKdYaAdXCoeFNtxcJoX77hhc0Q9g99isEieriP+OgF8qoXC7Q00yL0/iGpVPz 80xg6zyxLxloXGSQB49j/cftj0/LUeY8TkY3Uew2zif6LHiKbUGPOOzyoMKBTrirG6yk9S 1l9osyzgTj4Ra6umiuoUJ9C2cV2n6VdjlLe+STEips2yC3hrWx+KzVJpTthKt74JxI3sSl iivKD99wj5GQ9pS0WRWlp0CSuo5bPyzSB0m+noUG2eSRzd5o1zIxvvlYEqxYow== 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 4T9km92KNCzJs9; Thu, 11 Jan 2024 12:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCef7w028887; Thu, 11 Jan 2024 12:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCefgq028884; Thu, 11 Jan 2024 12:40:41 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:40:41 GMT Message-Id: <202401111240.40BCefgq028884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c9e9bfc22e6d - stable/13 - sctp: use consistent names for locking macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c9e9bfc22e6da6969bbb39920a7090a31ee988b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e9bfc22e6da6969bbb39920a7090a31ee988b5 commit c9e9bfc22e6da6969bbb39920a7090a31ee988b5 Author: Michael Tuexen AuthorDate: 2023-08-13 20:32:54 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:40:04 +0000 sctp: use consistent names for locking macros While there, add also a macro for an assert. Will be used shortly. No functional change intended. (cherry picked from commit 6cb8b3b5cde18ac5465f1cf1df3fbac359cb09e9) --- sys/netinet/sctp_lock_bsd.h | 9 +++++++-- sys/netinet/sctp_pcb.c | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctp_lock_bsd.h b/sys/netinet/sctp_lock_bsd.h index 1ff5c87a1163..4e9197917a9e 100644 --- a/sys/netinet/sctp_lock_bsd.h +++ b/sys/netinet/sctp_lock_bsd.h @@ -232,12 +232,12 @@ * or cookie secrets we lock the INP level. */ -#define SCTP_INP_READ_INIT(_inp) do { \ +#define SCTP_INP_READ_LOCK_INIT(_inp) do { \ mtx_init(&(_inp)->inp_rdata_mtx, "sctp-read", "inpr", \ MTX_DEF | MTX_DUPOK); \ } while (0) -#define SCTP_INP_READ_DESTROY(_inp) do { \ +#define SCTP_INP_READ_LOCK_DESTROY(_inp) do { \ mtx_destroy(&(_inp)->inp_rdata_mtx); \ } while (0) @@ -249,6 +249,11 @@ mtx_unlock(&(_inp)->inp_rdata_mtx); \ } while (0) +#define SCTP_INP_READ_LOCK_ASSERT(_inp) do { \ + KASSERT(mtx_owned(&(_inp)->inp_rdata_mtx), \ + ("Don't own INP read queue lock")); \ +} while (0) + #define SCTP_INP_LOCK_INIT(_inp) do { \ mtx_init(&(_inp)->inp_mtx, "sctp-inp", "inp", \ MTX_DEF | MTX_DUPOK); \ diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2cb3f6874df9..15f406eae32d 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2498,7 +2498,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) SCTP_INP_INFO_WLOCK(); SCTP_INP_LOCK_INIT(inp); INP_LOCK_INIT(&inp->ip_inp.inp, "inp", "sctpinp"); - SCTP_INP_READ_INIT(inp); + SCTP_INP_READ_LOCK_INIT(inp); SCTP_ASOC_CREATE_LOCK_INIT(inp); /* lock the new ep */ SCTP_INP_WLOCK(inp); @@ -3675,7 +3675,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) crfree(inp->ip_inp.inp.inp_cred); INP_LOCK_DESTROY(&inp->ip_inp.inp); SCTP_INP_LOCK_DESTROY(inp); - SCTP_INP_READ_DESTROY(inp); + SCTP_INP_READ_LOCK_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); From nobody Thu Jan 11 12:41:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kn110Wrz55dWn; Thu, 11 Jan 2024 12: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 4T9kn10Rrxz46Rc; Thu, 11 Jan 2024 12:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKmv9v4iCPYvdHl1QzSy/sONMP+Un45yIlLtzehRqZ4=; b=d9i0p/+siH6ueUO2SGaEOe/9jCTMcDkl+VjdnI9joepsgjByrCuhv9vZjRGXnkcr1Gv2lB 7ivk7Jp2+cSTLfVZLKOhTsAjIyfWSv44sm4ccWDjREwTJAF61ti2BevKHwzUaw+9TCpjJn 16ICSO09kMk8w0CeLZ98SOdkmKKddRfEnxghh74r5AQ1vUADg6c2w1uaYSXTu+2PMUlyKK 7e26a5wvglvBfrZ7d8ss5fEazNKN+BjaFLjURAmUyVC89fOkwT54RN6DQ+byfA+QaTv/Xt jWvvuv+dVSwpjnXB9ax3SC+/Uis5XM7zZ7r2FrojZlk5ETVCLgQjHKlBo1B62w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKmv9v4iCPYvdHl1QzSy/sONMP+Un45yIlLtzehRqZ4=; b=dM1F627AspEJaTPzTq76bNhT3RIpagdT3VcNQaRduZpabM1nUdKZRy/K1gjphpTOr6bfhD 9tE33TZC3yBHUu4yVG1Vj+FUDCQ/sUSmpbCBbKmlK8X14/R4AnWUOxeTk4wobhYCHQJyC/ kpdFWn7kLqqgw7fU8DK+8Q5an25L2FIyhatTEUEmQ5bdmn6W6qlHs6k1AbEyiOd5E4Q8vh +OmjGNqfGdJ5TDXMhZfjM9H0KEvxwVajQkdMt1nIvBd/h+AiHUe+IgWt9qKYLxk8ypNuLC E23LRsTeJPr9wmA/M9/aLvaCWpwZ56wRL0PJAGRjA4AEe7F6LbN6iohoeJhxSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976885; a=rsa-sha256; cv=none; b=m1bMgKyQYj4AV2i4UbiWNyFahSB3xCib9uocRIKQsr8zyJeTZB+5PuXvVPqSnVhRrDBPsi /5vrvGGwXaUxKKqEG3OdzynyrMH5xnPM9l8/MQyjwkMEMZ56Mc9KcEoFBdxw2pPZaPL2LX ZIHQCRsayMLzSQT1eLdblJ5LKykl8z8OkwpBWeaRYUuxJrf8pXhwrDL6Q89adX6TvYq4/X fCutChejGhHRTHdNHXSQIQDm0RvbY+2YDo4xrlRtJMDMi0JwcGLrsS8WobpuO1Q9anHOv+ tJUu3CMFU4LaylAmS4dfZjkOoijQnZOT4JlqqMG1G9+mAVxZkon7CO1H+Bqs/Q== 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 4T9kn06c77zJqd; Thu, 11 Jan 2024 12:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCfOBQ030922; Thu, 11 Jan 2024 12:41:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCfO3T030919; Thu, 11 Jan 2024 12:41:24 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:41:24 GMT Message-Id: <202401111241.40BCfO3T030919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ecfe48f28a40 - stable/13 - sctp: add an assert List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ecfe48f28a40700f4950c2e5bd21ebc49b942bf4 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfe48f28a40700f4950c2e5bd21ebc49b942bf4 commit ecfe48f28a40700f4950c2e5bd21ebc49b942bf4 Author: Michael Tuexen AuthorDate: 2023-08-13 20:47:43 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:40:56 +0000 sctp: add an assert This enforces a condition mentioned in a comment. (cherry picked from commit e8eb0b713426fe9edbf56719351850fa9469286a) --- sys/netinet/sctputil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 72edf4dd66c9..e21fbe041291 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3636,7 +3636,6 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb) &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } -/* This always must be called with the read-queue LOCKED in the INP */ static void sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, uint32_t val, int so_locked) @@ -3652,6 +3651,8 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, return; } + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ From nobody Thu Jan 11 12:42:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kpK65Swz55dqX; Thu, 11 Jan 2024 12:42: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 4T9kpK5ff8z46qQ; Thu, 11 Jan 2024 12:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n35+OuVbOYcDwHl9Ps4JdeM8pgVMte7hXqpuZitoerA=; b=DCswbkTA5ySx/aLgJvi1iM8GanCQ3lLycH4cTyFHShEWfNzudoAQCrJdnmrih8D30eOAKc SIVAQOGRsI1BAvxG9bb4HFIR+/bAYTaZDovEtb5zXn/Eh8cbgpSag1YgVlOwvPz91ErrMo wCJ475O6gb7N9wSiUOsyHoayFO2YjDlA1KKW35krHoypqlWeYG6UrmE3aH+xftxkNWiZ5w rJBusMT1GOEWpCMMI4yVXDoBgRACAkDq+9FoDNoRtKVK0gJPIhAT2BxQdpIlfYJDccV3vP w0ySlUHnU8CgUlNUziOkWQ85bqcmwEd6o7I4ZjReXoi6M5rKkm9J+sJB2U189w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704976953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n35+OuVbOYcDwHl9Ps4JdeM8pgVMte7hXqpuZitoerA=; b=X8gXzIhrKW3azEtuNX8JNTDb5cQxn+HmfDpweDPJzO1VqT4SRkAlGLneeADlo2B0KcMMlS 5o2VmyyaCpfNP+Jw6XzGnXT5CT89YViJsPsPd+bXF28vqFRKQFsKgSHHugEM83rFmla4ZT N68ilhHpEVu5pkIycDscQkW4lHPNXBeHxU83/nsSJygy8saKdwnqV4+qIFfnGoE1FnUPRG EdO15aG9mEMcWTGQdLIWosVN7jpwzpfvHvd4JFgv15dZSt95mxt0T4XHPJ+/SDgy9CUvLS fQQa4LQqQYwRk1xLRq19K2DRbw23C24oh8XsddNAalmytLzQGLBKgOW3AhrW9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704976953; a=rsa-sha256; cv=none; b=VusXdW4Eb4vZsSoNedXcycZiSXv2GO4e1wn6iaq8lBOPysfQp4wTMPuAQ3oEO5KGzrkwVF phvnAzwAXfJxKJbYXVV6aRRAQgqr3iVt4Xa3dyDmh0JU+8sk2VTWBQ8pujZzcOO2vLl47U Hx9Raci3oHivK6HHUj5arrNXc1bgWkJ3rCQVAH9rJLq3qYXXM4jchrDLTDaJaoVmqwkg7X 1D+vuoUqANeQ7YeaFfmqTHxOcSiBkzW6lNOogEJuZgYGDndc08Z9G9SPv/1vd4wWXnEcNN Vj4sfEqrqaR+avdw3hmDxb7QUPJmDsIGjSl8WBLxc4XiMXzibicczdgCgd+7sQ== 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 4T9kpK4kZczKC4; Thu, 11 Jan 2024 12:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCgX7R034573; Thu, 11 Jan 2024 12:42:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCgXln034570; Thu, 11 Jan 2024 12:42:33 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:42:33 GMT Message-Id: <202401111242.40BCgXln034570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: db083b5e571a - stable/13 - sctp: cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: db083b5e571a1c20044f543b10f31e32eee9a2bf Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=db083b5e571a1c20044f543b10f31e32eee9a2bf commit db083b5e571a1c20044f543b10f31e32eee9a2bf Author: Michael Tuexen AuthorDate: 2023-08-14 10:27:39 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:41:56 +0000 sctp: cleanup Do not put a variable in the stcb for passing it to a function. Just use a parameter of the function. No functional change intended. (cherry picked from commit 749a7fb588c4a872a4f1ce3ee92be86bab1b1f17) --- sys/netinet/sctp_indata.c | 9 ++------- sys/netinet/sctp_pcb.c | 11 +++-------- sys/netinet/sctputil.c | 27 ++++++++++----------------- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index e389cf7826b7..25819af0bdb2 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -5489,9 +5489,8 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, struct sctp_association *asoc; uint32_t new_cum_tsn, gap; unsigned int i, fwd_sz, m_size; - uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_queued_to_read *control, *ncontrol, *sv; + struct sctp_queued_to_read *control, *ncontrol; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { @@ -5672,9 +5671,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, TAILQ_FOREACH(control, &stcb->sctp_ep->read_queue, next) { if ((control->sinfo_stream == sid) && (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) { - str_seq = (sid << 16) | (0x0000ffff & mid); control->pdapi_aborted = 1; - sv = stcb->asoc.control_pdapi; control->end_added = 1; if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); @@ -5697,13 +5694,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, #endif } control->on_strm_q = 0; - stcb->asoc.control_pdapi = control; sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, stcb, SCTP_PARTIAL_DELIVERY_ABORTED, - (void *)&str_seq, + (void *)control, SCTP_SO_NOT_LOCKED); - stcb->asoc.control_pdapi = sv; break; } else if ((control->sinfo_stream == sid) && SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) { diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 15f406eae32d..282ffebad541 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4774,20 +4774,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre * added right after this * msg. */ - uint32_t strseq; - - stcb->asoc.control_pdapi = sq; - strseq = (sq->sinfo_stream << 16) | (sq->mid & 0x0000ffff); sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, stcb, SCTP_PARTIAL_DELIVERY_ABORTED, - (void *)&strseq, + (void *)sq, SCTP_SO_LOCKED); - stcb->asoc.control_pdapi = NULL; } + /* Add an end to wake them */ + sq->end_added = 1; } - /* Add an end to wake them */ - sq->end_added = 1; } } SCTP_INP_READ_UNLOCK(inp); diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index e21fbe041291..828455207fe2 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3638,7 +3638,8 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb) static void sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, - uint32_t val, int so_locked) + struct sctp_queued_to_read *aborted_control, + int so_locked) { struct mbuf *m_notify; struct sctp_pdapi_event *pdapi; @@ -3651,6 +3652,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, return; } + KASSERT(aborted_control != NULL, ("aborted_control is NULL")); SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); @@ -3664,8 +3666,8 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, pdapi->pdapi_flags = 0; pdapi->pdapi_length = sizeof(struct sctp_pdapi_event); pdapi->pdapi_indication = error; - pdapi->pdapi_stream = (val >> 16); - pdapi->pdapi_seq = (val & 0x0000ffff); + pdapi->pdapi_stream = aborted_control->sinfo_stream; + pdapi->pdapi_seq = (uint16_t)aborted_control->mid; pdapi->pdapi_assoc_id = sctp_get_associd(stcb); SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_pdapi_event); @@ -3691,12 +3693,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } control->end_added = 1; - if (stcb->asoc.control_pdapi) - TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, stcb->asoc.control_pdapi, control, next); - else { - /* we really should not see this case */ - TAILQ_INSERT_TAIL(&stcb->sctp_ep->read_queue, control, next); - } + TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, aborted_control, control, next); if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); @@ -4132,14 +4129,10 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, (struct sctp_tmit_chunk *)data, so_locked); break; case SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION: - { - uint32_t val; - - val = *((uint32_t *)data); - - sctp_notify_partial_delivery_indication(stcb, error, val, so_locked); - break; - } + sctp_notify_partial_delivery_indication(stcb, error, + (struct sctp_queued_to_read *)data, + so_locked); + break; case SCTP_NOTIFY_ASSOC_LOC_ABORTED: if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { From nobody Thu Jan 11 12:45:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9ksl6llWz55dhk; Thu, 11 Jan 2024 12:45: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 4T9ksl6Y6Nz47DD; Thu, 11 Jan 2024 12:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xca2YSfNAG5AxBVqcwk4QbhOLrt0icyn4WXgIJG/F5E=; b=caP/iEvYnxUTRhyvTuAhulh0O1zV2Tk8dpAFRVdAcuUJUpzIRmEP1THmQS1TpPdyUpY9Z5 AbmvQJMK8JZ0QaSUtxSIFgLrY6EDhLQuc3AmYmw29q1e5mtOiCrW0j4JuEBwxyrpTmlwe1 h7HrCJFF9qM57lMxJXkoJcjne0VCSIvDJ2Qmc09qNBl8GrldCG6TRNklo7a/yUsZetlal9 NtAam8u7ucSDVuW5pCRDxmCNDRjdFYWQLDlcEBPXKt7Gbyo7z0KvPqGhyrrVA5FfnqkHZz 1fyfGYK36JYzkgA24t5/rhltqdX4TTytSuk2Zatzbo5BPR4WjdiTlR2DjRDrsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xca2YSfNAG5AxBVqcwk4QbhOLrt0icyn4WXgIJG/F5E=; b=nUtBecpD0F0Jd1wFZGwXs0JOTAuj/KQ+OGRr3FMQ3jdG5TaD762cJ5RjIDyknEXhTe59fo Ird9z9aDP1/H6hLqTjPjKb1h9Pzr1MAa+HRlwEYGPKvDgg4Zqr9zELhcPXwYJUlrnQDxnf bszEThZH1m22+Lu6G3e70sVkNoIoW206Gr7Z+XY4Sta5bGgFmaKDWVb/68G/lUyCOLyH/k 3fADlZ7PKHYxPieXvagD7ooGrpSxcLoTeV4SNiRN6K9entX8syOX2erHw6axy725jEeK5c CVx8yZ7/a9vhaXc+3N8EgmRDHnsy7qubsynm5PxfrRkK9BYA6TYvGpVt4ieQhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977131; a=rsa-sha256; cv=none; b=Wqebj+IQrub3GFEJ0f7lfmi6o675d6hkN/N1OBKLcNngxoeMTABIoZSiw5YRpxHYvK4YdX hClmAP7W+wkiWjnbF/YDdYbDDUCWrbJyLOCK463IrBW1RtI2RSTf8/YE0YO0dkDWWUR6wZ 3goeDz+6ezu+A54P9KBChBLaxS/UTR6BuqxaJV+mHLGv6pZuN9CAu9ste+bMPkvs8tns9w hkuFr6PLwEy4sS3LKP9pV2DaUuflDbCotnP9O6h8nnwZcmp2vT/fSd4kNMzLmjmktEx1Jr i3AI5Qk8x5QhOHsoQZDRihSCj/+madq4DhrcaTpdE3UWGUdhGr8D4Jyz+kpW/w== 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 4T9ksl5bRJzKCy; Thu, 11 Jan 2024 12:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCjVGH035298; Thu, 11 Jan 2024 12:45:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCjV68035295; Thu, 11 Jan 2024 12:45:31 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:45:31 GMT Message-Id: <202401111245.40BCjV68035295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bb374dd2c103 - stable/13 - sctp: cleanup cdefs.h include List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bb374dd2c10317ee18a50ff99d3474acb0be74a0 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bb374dd2c10317ee18a50ff99d3474acb0be74a0 commit bb374dd2c10317ee18a50ff99d3474acb0be74a0 Author: Michael Tuexen AuthorDate: 2023-08-18 13:25:34 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:44:49 +0000 sctp: cleanup cdefs.h include (cherry picked from commit c3179e6660e1365111b89cb6c05c3a4c47375e73) --- sys/netinet/sctp.h | 2 +- sys/netinet/sctp_asconf.c | 1 - sys/netinet/sctp_asconf.h | 1 - sys/netinet/sctp_auth.c | 1 - sys/netinet/sctp_auth.h | 1 - sys/netinet/sctp_bsd_addr.c | 1 - sys/netinet/sctp_bsd_addr.h | 1 - sys/netinet/sctp_cc_functions.c | 1 - sys/netinet/sctp_constants.h | 1 - sys/netinet/sctp_crc32.h | 1 - sys/netinet/sctp_header.h | 1 - sys/netinet/sctp_indata.c | 1 - sys/netinet/sctp_indata.h | 1 - sys/netinet/sctp_input.c | 1 - sys/netinet/sctp_input.h | 1 - sys/netinet/sctp_kdtrace.h | 1 - sys/netinet/sctp_lock_bsd.h | 1 - sys/netinet/sctp_os.h | 1 - sys/netinet/sctp_os_bsd.h | 6 ++---- sys/netinet/sctp_output.c | 1 - sys/netinet/sctp_output.h | 1 - sys/netinet/sctp_pcb.c | 1 - sys/netinet/sctp_pcb.h | 1 - sys/netinet/sctp_peeloff.c | 1 - sys/netinet/sctp_peeloff.h | 1 - sys/netinet/sctp_ss_functions.c | 2 +- sys/netinet/sctp_structs.h | 1 - sys/netinet/sctp_sysctl.c | 1 - sys/netinet/sctp_sysctl.h | 1 - sys/netinet/sctp_timer.c | 1 - sys/netinet/sctp_timer.h | 1 - sys/netinet/sctp_uio.h | 1 - sys/netinet/sctp_usrreq.c | 1 - sys/netinet/sctp_var.h | 1 - sys/netinet/sctputil.c | 1 - sys/netinet/sctputil.h | 1 - sys/netinet6/sctp6_usrreq.c | 1 - sys/netinet6/sctp6_var.h | 1 - 38 files changed, 4 insertions(+), 41 deletions(-) diff --git a/sys/netinet/sctp.h b/sys/netinet/sctp.h index e7c584707da2..0a52944473c2 100644 --- a/sys/netinet/sctp.h +++ b/sys/netinet/sctp.h @@ -32,10 +32,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_H_ #define _NETINET_SCTP_H_ +#include #include #define SCTP_PACKED __attribute__((packed)) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 436638e594c7..3a30b0ba3740 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_asconf.h b/sys/netinet/sctp_asconf.h index 4d04e8466d75..ab24ea1683bf 100644 --- a/sys/netinet/sctp_asconf.h +++ b/sys/netinet/sctp_asconf.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_ASCONF_H_ #define _NETINET_SCTP_ASCONF_H_ diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index a1d25a588daa..67f0d26fa0d5 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_auth.h b/sys/netinet/sctp_auth.h index 45deaabf4059..8bfdbaa6d4f6 100644 --- a/sys/netinet/sctp_auth.h +++ b/sys/netinet/sctp_auth.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_AUTH_H_ #define _NETINET_SCTP_AUTH_H_ diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index 74f8ab244bb9..83ff0e1e3cc6 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_bsd_addr.h b/sys/netinet/sctp_bsd_addr.h index 8100ba5225ee..5c66db8a7fcb 100644 --- a/sys/netinet/sctp_bsd_addr.h +++ b/sys/netinet/sctp_bsd_addr.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_BSD_ADDR_H_ #define _NETINET_SCTP_BSD_ADDR_H_ diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c index 128acff404e3..1f96f88a61dd 100644 --- a/sys/netinet/sctp_cc_functions.c +++ b/sys/netinet/sctp_cc_functions.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index a1490a515d14..05e804100aa2 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_CONSTANTS_H_ #define _NETINET_SCTP_CONSTANTS_H_ diff --git a/sys/netinet/sctp_crc32.h b/sys/netinet/sctp_crc32.h index 48a7d3269da5..a8c901249fcb 100644 --- a/sys/netinet/sctp_crc32.h +++ b/sys/netinet/sctp_crc32.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_CRC32_H_ #define _NETINET_SCTP_CRC32_H_ diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h index 49a2dcc40ae9..811cb8bab158 100644 --- a/sys/netinet/sctp_header.h +++ b/sys/netinet/sctp_header.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_HEADER_H_ #define _NETINET_SCTP_HEADER_H_ diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 25819af0bdb2..f7f0e3fdfe7f 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_indata.h b/sys/netinet/sctp_indata.h index 9b2721c6adce..061b65c90bd4 100644 --- a/sys/netinet/sctp_indata.h +++ b/sys/netinet/sctp_indata.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_INDATA_H_ #define _NETINET_SCTP_INDATA_H_ diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 21fe684efad0..fa0b9f4894ea 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_input.h b/sys/netinet/sctp_input.h index b2ea94ef067e..cd736166ac7e 100644 --- a/sys/netinet/sctp_input.h +++ b/sys/netinet/sctp_input.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_INPUT_H_ #define _NETINET_SCTP_INPUT_H_ diff --git a/sys/netinet/sctp_kdtrace.h b/sys/netinet/sctp_kdtrace.h index b86a689802b3..0f9b6a9e3826 100644 --- a/sys/netinet/sctp_kdtrace.h +++ b/sys/netinet/sctp_kdtrace.h @@ -31,7 +31,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_KDTRACE_H_ #define _NETINET_SCTP_KDTRACE_H_ diff --git a/sys/netinet/sctp_lock_bsd.h b/sys/netinet/sctp_lock_bsd.h index 4e9197917a9e..ec66be0cf371 100644 --- a/sys/netinet/sctp_lock_bsd.h +++ b/sys/netinet/sctp_lock_bsd.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_LOCK_BSD_H_ #define _NETINET_SCTP_LOCK_BSD_H_ diff --git a/sys/netinet/sctp_os.h b/sys/netinet/sctp_os.h index 48ce05239402..42f000dc8d55 100644 --- a/sys/netinet/sctp_os.h +++ b/sys/netinet/sctp_os.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_OS_H_ #define _NETINET_SCTP_OS_H_ diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h index 01ab8f2823b8..250feb334bdf 100644 --- a/sys/netinet/sctp_os_bsd.h +++ b/sys/netinet/sctp_os_bsd.h @@ -32,12 +32,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_OS_BSD_H_ #define _NETINET_SCTP_OS_BSD_H_ -/* - * includes - */ + +#include #include "opt_inet6.h" #include "opt_inet.h" #include "opt_sctp.h" diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 56de9cb860c6..7626e4ec066c 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_output.h b/sys/netinet/sctp_output.h index d522812c59db..1a1d17221b02 100644 --- a/sys/netinet/sctp_output.h +++ b/sys/netinet/sctp_output.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_OUTPUT_H_ #define _NETINET_SCTP_OUTPUT_H_ diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 282ffebad541..59686f9ff3f9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 7d3656ed6dfd..ca51f519a24d 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_PCB_H_ #define _NETINET_SCTP_PCB_H_ diff --git a/sys/netinet/sctp_peeloff.c b/sys/netinet/sctp_peeloff.c index ff92bd4d5d88..b122ab50e74e 100644 --- a/sys/netinet/sctp_peeloff.c +++ b/sys/netinet/sctp_peeloff.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_peeloff.h b/sys/netinet/sctp_peeloff.h index 8be10d00e5de..675369af0fa8 100644 --- a/sys/netinet/sctp_peeloff.h +++ b/sys/netinet/sctp_peeloff.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_PEELOFF_H_ #define _NETINET_SCTP_PEELOFF_H_ #if defined(_KERNEL) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index 896a55c6fbc5..1d7b16a6b482 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include /* diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h index 81a0645fa528..fb7deafa9ea3 100644 --- a/sys/netinet/sctp_structs.h +++ b/sys/netinet/sctp_structs.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_STRUCTS_H_ #define _NETINET_SCTP_STRUCTS_H_ diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 88d16f71ef3c..fa93deba8b53 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_sysctl.h b/sys/netinet/sctp_sysctl.h index ba0d18111df6..2eeddd42f7a2 100644 --- a/sys/netinet/sctp_sysctl.h +++ b/sys/netinet/sctp_sysctl.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_SYSCTL_H_ #define _NETINET_SCTP_SYSCTL_H_ diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 3cf3baec7ad3..ef5eb8b89a5d 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #define _IP_VHL #include #include diff --git a/sys/netinet/sctp_timer.h b/sys/netinet/sctp_timer.h index 846e99fc59e2..f6f99d903d9f 100644 --- a/sys/netinet/sctp_timer.h +++ b/sys/netinet/sctp_timer.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_TIMER_H_ #define _NETINET_SCTP_TIMER_H_ diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h index 40fda91d84ae..09af1b59fcae 100644 --- a/sys/netinet/sctp_uio.h +++ b/sys/netinet/sctp_uio.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_UIO_H_ #define _NETINET_SCTP_UIO_H_ diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index b28bfc66af8d..a7af1da8624a 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index 0177dd5ac227..c1c34e542ef2 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_VAR_H_ #define _NETINET_SCTP_VAR_H_ diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 828455207fe2..380aee5f671d 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index f0f6d6bccfc7..c649611d5004 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET_SCTP_UTIL_H_ #define _NETINET_SCTP_UTIL_H_ diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index dca38401c02b..82829d3ba8c5 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #ifdef INET6 #include diff --git a/sys/netinet6/sctp6_var.h b/sys/netinet6/sctp6_var.h index 08f0e37c1e5d..1ba1dcb54452 100644 --- a/sys/netinet6/sctp6_var.h +++ b/sys/netinet6/sctp6_var.h @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include #ifndef _NETINET6_SCTP6_VAR_H_ #define _NETINET6_SCTP6_VAR_H_ From nobody Thu Jan 11 12:46:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9ktw47Sxz55fFC; Thu, 11 Jan 2024 12:46: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 4T9ktw3XnPz47YN; Thu, 11 Jan 2024 12:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsBwVvCL0ntbfMbT0XUgUuY7b86xB8O/N9aOjIx/4f0=; b=iFqtVZhdpXql6ZliPLztkSvUxaux6hmETL2Ak+sec4mFSrYZf0kcjtqzck4cKSwlsTvteI rOIRtm9M1CwfvfmtfmjywXOJ5RAdAsz1MaQFaH2O0kiCj2hzvu/NFLV2mAG70nTQAWslSU jxuQ+L3z7wzG8nrR2SoT/m6VItCIkApw+7lD+XeSmaDbaAwn3pbYgIBYEbBL59ipD+Fils psTvGHtFUaoDZQ5t4jIVkefHoyIS/3x/+WLtRIc25MdtehRAwqbEmz1z//kcci2zEWzbjv Boeul4xUWU97CFAOlgMkx8s8ySEIRKcYNaPBF7Q1nB+0EORG7eJnNjP4Fm9z9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsBwVvCL0ntbfMbT0XUgUuY7b86xB8O/N9aOjIx/4f0=; b=ShJ0GI4eEzMVtyantBfUxSdaMNY+g8LQ13H115AlBv5hrJqN+78r1ya7fWJglSZ4Z0OWOX c5hPkSpxwb5ZoARqukNQwCivq7aGiADjiDxV/zYZ0e9N+DFWOENqCKhQBjs4STu1Syl1Q3 lli0dsfCG6HwVAuo8yJSeYQfVpUygJsXKhhqDsiV2yb+vk5jNZrvXmyBYqQNYAgyon1RX7 Iw+UzaX+XYpEdqb3ppKJFqJ282nRKNpBoIO0otWeZoj4HCnt8zYSFmzkyhYfDSICEfGhyS VmqpAzbgPO52QMC7q4wVCkmP38yLuT+2TGeqwSojaCw/m1tEGZWkn+xNHzNBhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977192; a=rsa-sha256; cv=none; b=pueUsE5H1gFoM/kY/r0YV4yKyEN2nnQhBmIjD/hme8y78NbvXsEeWAMv9H3asXUnBvATfQ n8eS1gNgJw6SWmbojvgFAsLstJlvEG/31sRio3xdM5WCBlgS6md1xQVe9wwUPAzcxYr5fC wbKnCNmpN6S0OhhFF9jIjfqLP+pCw+BZhICR5FzIe4/wY202HD9y0h68AbLrgCoHs3O6oA y1Up+oNqvx0RbtV0KkBSTw2SkrK3bzgXsQjZaX2DLcdf71drVjnpPr3D3+ELAL89bcKwj0 HirSizVfkF+3wxhCSX5EblQg5ElwZgPwxqU7RRTlFaEC3RXObiS6FVTHMgyVMA== 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 4T9ktw2b5szKGG; Thu, 11 Jan 2024 12:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCkWsR035563; Thu, 11 Jan 2024 12:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCkWBa035560; Thu, 11 Jan 2024 12:46:32 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:46:32 GMT Message-Id: <202401111246.40BCkWBa035560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3ec4836e4a1b - stable/13 - sctp: cleanup handling of graceful shutdown of the peer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3ec4836e4a1bfcb1d740dddf20b3c7ec8676913c Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3ec4836e4a1bfcb1d740dddf20b3c7ec8676913c commit 3ec4836e4a1bfcb1d740dddf20b3c7ec8676913c Author: Michael Tuexen AuthorDate: 2023-08-19 10:35:49 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:46:05 +0000 sctp: cleanup handling of graceful shutdown of the peer Don't handle a graceful shutdown of the peer as an implicit signal that all partial messages are complete. First, this is not implemented correctly and second this should not be done by the peer. It is more appropriate to handle this as a protocol violation. Remove the incorrect code and leave detecting the protocol violation and its handling in a followup commit. (cherry picked from commit 4f14d4b6b7f0ca49b14379e48117121af3ed2669) --- sys/netinet/sctp_input.c | 63 +++++++++++----------------------------------- sys/netinet/sctp_pcb.c | 11 +------- sys/netinet/sctp_structs.h | 9 ------- 3 files changed, 16 insertions(+), 67 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index fa0b9f4894ea..f9e49b7b4f62 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -837,8 +837,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, int some_on_streamwheel; int old_state; - SCTPDBG(SCTP_DEBUG_INPUT2, - "sctp_handle_shutdown: handling SHUTDOWN\n"); + SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown: handling SHUTDOWN\n"); if (stcb == NULL) return; asoc = &stcb->asoc; @@ -855,40 +854,12 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, if (*abort_flag) { return; } - if (asoc->control_pdapi) { - /* - * With a normal shutdown we assume the end of last record. - */ - SCTP_INP_READ_LOCK(stcb->sctp_ep); - if (asoc->control_pdapi->on_strm_q) { - struct sctp_stream_in *strm; - - strm = &asoc->strmin[asoc->control_pdapi->sinfo_stream]; - if (asoc->control_pdapi->on_strm_q == SCTP_ON_UNORDERED) { - /* Unordered */ - TAILQ_REMOVE(&strm->uno_inqueue, asoc->control_pdapi, next_instrm); - asoc->control_pdapi->on_strm_q = 0; - } else if (asoc->control_pdapi->on_strm_q == SCTP_ON_ORDERED) { - /* Ordered */ - TAILQ_REMOVE(&strm->inqueue, asoc->control_pdapi, next_instrm); - asoc->control_pdapi->on_strm_q = 0; -#ifdef INVARIANTS - } else { - panic("Unknown state on ctrl:%p on_strm_q:%d", - asoc->control_pdapi, - asoc->control_pdapi->on_strm_q); -#endif - } - } - asoc->control_pdapi->end_added = 1; - asoc->control_pdapi->pdapi_aborted = 1; - asoc->control_pdapi = NULL; - SCTP_INP_READ_UNLOCK(stcb->sctp_ep); - if (stcb->sctp_socket) { - sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); - } - } - /* goto SHUTDOWN_RECEIVED state to block new requests */ + /* + * FIXME MT: Handle the case where there are still incomplete + * received user messages or known missing user messages from the + * peer. One way to handle this is to abort the associations in this + * case. + */ if (stcb->sctp_socket) { if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) && @@ -949,8 +920,9 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n"); - if (stcb == NULL) + if (stcb == NULL) { return; + } asoc = &stcb->asoc; /* process according to association state */ @@ -967,17 +939,12 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, SCTP_TCB_UNLOCK(stcb); return; } - if (asoc->control_pdapi) { - /* - * With a normal shutdown we assume the end of last record. - */ - SCTP_INP_READ_LOCK(stcb->sctp_ep); - asoc->control_pdapi->end_added = 1; - asoc->control_pdapi->pdapi_aborted = 1; - asoc->control_pdapi = NULL; - SCTP_INP_READ_UNLOCK(stcb->sctp_ep); - sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); - } + /* + * FIXME MT: Handle the case where there are still incomplete + * received user messages or known missing user messages from the + * peer. One way to handle this is to abort the associations in this + * case. + */ #ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 59686f9ff3f9..3435377e1064 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3404,7 +3404,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) continue; } if ((stcb->asoc.size_on_reasm_queue > 0) || - (stcb->asoc.control_pdapi) || (stcb->asoc.size_on_all_streams > 0) || ((so != NULL) && (SCTP_SBAVAIL(&so->so_rcv) > 0))) { /* Left with Data unread */ @@ -4761,18 +4760,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre * now. */ if (sq->end_added == 0) { - /* Held for PD-API clear that. */ + /* Held for PD-API, clear that. */ sq->pdapi_aborted = 1; sq->held_length = 0; if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT) && (so != NULL)) { - /* - * Need to add a PD-API - * aborted indication. - * Setting the control_pdapi - * assures that it will be - * added right after this - * msg. - */ sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, stcb, SCTP_PARTIAL_DELIVERY_ABORTED, diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h index fb7deafa9ea3..1d3a3ef72728 100644 --- a/sys/netinet/sctp_structs.h +++ b/sys/netinet/sctp_structs.h @@ -956,15 +956,6 @@ struct sctp_association { uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; - /* - * For the pd-api we should re-write this a bit more efficient. We - * could have multiple sctp_queued_to_read's that we are building at - * once. Now we only do this when we get ready to deliver to the - * socket buffer. Note that we depend on the fact that the struct is - * "stuck" on the read queue until we finish all the pd-api. - */ - struct sctp_queued_to_read *control_pdapi; - uint32_t tsn_of_pdapi_last_delivered; uint32_t pdapi_ppid; uint32_t context; From nobody Thu Jan 11 12:47:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kvh2fhPz55fQh; Thu, 11 Jan 2024 12:47: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 4T9kvh20KYz47gf; Thu, 11 Jan 2024 12:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggsvgIzYXm/6fv8vev2sDKtqYUCqn8f08frm1A/Xnb4=; b=Z4GkyB1oI5Bk/KJIuKjnF/WJ1AnYS6a2GgGn5e3BrwMryrxVeC+lWt3/n4nOYUA3+fEu0M Los7h/6m4McCRJEg23hupT6pvhlqDF/x2cgDdGVceoP5G4MVQds02UblO3KSk0Bhq6TtYp sbr2Qfa7FiRzezdh08AbJUxTl4fUJCrqfirUm5DzX96hNzWEC/ErTA+pK+CLth9VqAU5Av WU/iqTcv+9Llv3520m1LN0Fc/G6lQEOmHv3VD2Mp3z1gTuJMssMLy0k+1vplI9J4jw8M9B IL6fUllD+e2WUOcVlmG+Xj/GOQL83HA+9pElw7w07l6ZcHrrDRdihOPVIpDC0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggsvgIzYXm/6fv8vev2sDKtqYUCqn8f08frm1A/Xnb4=; b=SFxqy5YZFSbg9sRyc7yQheGU8UBa+rqCRFDH9QHX5j5+pTnNF35ehqg+J2kMU+3/y7Vkkc AGi0VvaCvYC0EFGKWQjrTuAvj8YmtfmGV6cOPudYfxYEpgoCtmelrjLxK5UJxq1PNjrsWv jJqTiW0tC8u+5ySMN5YVxf/o+LKgPnHNGt2ZhxJnh/obLzjgwV/L5KUkgRzFfEoYowbBBl 4i3Ch2Iqnwfz+hZVxFJicfm+yhFC99NkAZHACmlSlEJHltRadqOl/AkalEgbts2jDFPc1x xb/JImKdGWaOmES21aTZ4FwzIlH7Ua+VQk0ZV00yujRboVeyB4gDsZYEAwyKqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977232; a=rsa-sha256; cv=none; b=EjFuFpfXhFicCxn5nbivyWhJEqR8Z8RMvOg3IG/YSQ1LrNlVnBBUSy57sktr+limMtITsS 7wih+7wFFbGkQrRCAvLSD6xjw3W3fbIbHZGcQnexefYuO970nGhLbZux9fu+oucG9DU6Xb DEYsF7TrXqXmq0BCShynhECB0nTmr9vh4l9/bPGvvSuc8zly1YfBcLoZLiwfsHv/aZUsIN 1LfKISDR7ahFKofqBaNucSQz5a7QEfOO0M4eP/g4F3V7Rn8IUgTVmyb1KJPG32jEjgHW7e IRa35E8L9f66Ru+kEhiuigXfhbGZd8ochaY3qHwtAViTt6PDXeaD0AzmMhNcxA== 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 4T9kvh0mlNzJqn; Thu, 11 Jan 2024 12:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BClC9Z035776; Thu, 11 Jan 2024 12:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BClCvZ035773; Thu, 11 Jan 2024 12:47:12 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:47:12 GMT Message-Id: <202401111247.40BClCvZ035773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: eb62bba325f3 - stable/13 - sctp: fix a warning List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: eb62bba325f31384a6ae193c655dc1f5ca43f2c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eb62bba325f31384a6ae193c655dc1f5ca43f2c7 commit eb62bba325f31384a6ae193c655dc1f5ca43f2c7 Author: Michael Tuexen AuthorDate: 2023-08-19 11:24:02 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:46:47 +0000 sctp: fix a warning Fix an unused-but-set-variable warning for builds without INVARIANTS. Reported by: O. Hartmann (cherry picked from commit 1095da75032b439d893c0947eda2f3738ecfe494) --- sys/netinet/sctp_input.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f9e49b7b4f62..f93b066f051f 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -833,14 +833,12 @@ static void sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_flag) { - struct sctp_association *asoc; int some_on_streamwheel; int old_state; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown: handling SHUTDOWN\n"); if (stcb == NULL) return; - asoc = &stcb->asoc; if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { return; @@ -872,7 +870,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, sctp_ulp_notify(SCTP_NOTIFY_PEER_SHUTDOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); /* reset time */ - (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); } } if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { @@ -886,8 +884,8 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, /* Now is there unsent data on a stream somewhere? */ some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || + !TAILQ_EMPTY(&stcb->asoc.sent_queue) || some_on_streamwheel) { /* By returning we will push more data out */ return; @@ -916,15 +914,12 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sctp_association *asoc; - SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n"); if (stcb == NULL) { return; } - asoc = &stcb->asoc; /* process according to association state */ if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { @@ -946,8 +941,8 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, * case. */ #ifdef INVARIANTS - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || + !TAILQ_EMPTY(&stcb->asoc.sent_queue) || sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { panic("Queues are not empty when handling SHUTDOWN-ACK"); } From nobody Thu Jan 11 12:48:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kwj5SXyz55fWZ; Thu, 11 Jan 2024 12:48: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 4T9kwj4bwnz48Kq; Thu, 11 Jan 2024 12:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cU11Y6piQJHR6XxxecsXMqpD4E3Oh0xCG4qUySAZKgU=; b=BIJ3/CMtcrDKQUwl0fDFcYGuHL0gqvg80X9AdMTMb7uDH3ZQP8mjVvFKGS1cdveg5W0/HT 8zk7d8fFAbJo1GbTf5Nfak5J3K5AXgWNE6dNMcjfBA+UDtGq4VeaMCJEtx9+hZeRViL/lb aIvxJHnQb5KJ1r28E31S+j7lL/FQZwKGPvWiugev5TQuspzhfKhPNYJEUCuDGGmj6gZIS5 LIDhz9sUYayFCMtxDK+CfOYDdwkpqnUlc4U76FK6C/6hX5Dkh3bm608ghQ80ToXzdVu1Tk DWqT7uFDgNyKjRQXNItSdngRTCUlsec5rkHMp/wMvIwvgTQAu1Xcktmqvu9FXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cU11Y6piQJHR6XxxecsXMqpD4E3Oh0xCG4qUySAZKgU=; b=XmcjoaPermjUzU00gXZEOHHXelvnH8zL7xSmFIy+TxySaei1koUrRRkxiiiENSrQ3qVy5f l+Q1iSYUtrZTpOOAzvoErEHNv8cFVB/UI9aqNIhJL0FS5VmnqOyKtHXOSZgIoRb6McPJBw ariIhYNcqVnZenbTIhzwg3frQM8AZ56fQJ53qPumQ6n4AocAYBh4XvOgvaDDzue5gTso5T DakUpf8QxISSYjA9+EnqKHaFUvGN7YDhSY4sXfU6oqfGROG6vZfnagk1WGOXoxWBbgwfuL KAEUCbSER4Anpguln/4tN2P6FF9uTsOh3kY/NJGxTvNPKKyqgwiWmO8crUHtsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977285; a=rsa-sha256; cv=none; b=mzrkZrXyKl622tWZSmSPd4dGDNOD+CF8IFZ9i97IedeY9B8U/RtNIH9Z0qNS84pIvg2CrA GFMriymnT207uTuHj3PcyrFGDkBZUfO3FLr/KOlWEt1jLFS7k8dEillwik6AvShN83GtqJ D/80gcl9al5oC8TALfTwr/KKwRLIlZkJWiRY3sD6XIovX5DG0Zxs8RtUaxa9L/q2ijhDGj bFJpyF/BW5QlEyxamYf4ROSbN7GQRmkIYcybWAOL9azoMM7EJi4SUAUf8fCihbBbblmNMo mibMO+D3ukrR9AAuxxX3mxq9Bkq8/wzHbczPR/cMpGmrCyxr6b2UCmiUPN5uhw== 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 4T9kwj3fZgzJqq; Thu, 11 Jan 2024 12:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCm58A036180; Thu, 11 Jan 2024 12:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCm5TD036177; Thu, 11 Jan 2024 12:48:05 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:48:05 GMT Message-Id: <202401111248.40BCm5TD036177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f91f135e1546 - stable/13 - sctp: improve handling of SHUTDOWN and SHUTDOWN ACK chunks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f91f135e15463f0ac094a60e2ca02f1079e64997 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f91f135e15463f0ac094a60e2ca02f1079e64997 commit f91f135e15463f0ac094a60e2ca02f1079e64997 Author: Michael Tuexen AuthorDate: 2023-08-23 06:36:15 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:47:34 +0000 sctp: improve handling of SHUTDOWN and SHUTDOWN ACK chunks When handling a SHUTDOWN or SHUTDOWN ACK chunk detect if the peer is violating the protocol by not having made sure all user messages are reveived by the peer. If this situation is detected, abort the association. (cherry picked from commit d18c845f99cbd2d3c0e70b3b9b09d80c655b6fb6) --- sys/netinet/sctp_input.c | 54 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f93b066f051f..5d2a3dd26384 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -829,6 +829,38 @@ sctp_start_net_timers(struct sctp_tcb *stcb) } } +static void +sctp_check_data_from_peer(struct sctp_tcb *stcb, int *abort_flag) +{ + char msg[SCTP_DIAG_INFO_LEN]; + struct sctp_association *asoc; + struct mbuf *op_err; + unsigned int i; + + *abort_flag = 0; + asoc = &stcb->asoc; + if (SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->cumulative_tsn) || + SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn)) { + SCTP_SNPRINTF(msg, sizeof(msg), "Missing TSN"); + *abort_flag = 1; + } + if (!*abort_flag) { + for (i = 0; i < asoc->streamincnt; i++) { + if (!TAILQ_EMPTY(&asoc->strmin[i].inqueue) || + !TAILQ_EMPTY(&asoc->strmin[i].uno_inqueue)) { + SCTP_SNPRINTF(msg, sizeof(msg), "Missing user data"); + *abort_flag = 1; + break; + } + } + } + if (*abort_flag) { + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INPUT + SCTP_LOC_9; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, false, SCTP_SO_NOT_LOCKED); + } +} + static void sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_flag) @@ -852,12 +884,10 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, if (*abort_flag) { return; } - /* - * FIXME MT: Handle the case where there are still incomplete - * received user messages or known missing user messages from the - * peer. One way to handle this is to abort the associations in this - * case. - */ + sctp_check_data_from_peer(stcb, abort_flag); + if (*abort_flag) { + return; + } if (stcb->sctp_socket) { if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) && @@ -914,6 +944,8 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { + int abort_flag; + SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n"); if (stcb == NULL) { @@ -934,12 +966,10 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, SCTP_TCB_UNLOCK(stcb); return; } - /* - * FIXME MT: Handle the case where there are still incomplete - * received user messages or known missing user messages from the - * peer. One way to handle this is to abort the associations in this - * case. - */ + sctp_check_data_from_peer(stcb, &abort_flag); + if (abort_flag) { + return; + } #ifdef INVARIANTS if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || !TAILQ_EMPTY(&stcb->asoc.sent_queue) || From nobody Thu Jan 11 12:49:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kyC2PnTz55fNP; Thu, 11 Jan 2024 12:49: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 4T9kyC0R6jz49Ms; Thu, 11 Jan 2024 12:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1AJXN17PJo2uRh49Bq2bmDxdwafoysfPrZd8fsUvQh4=; b=ZPs9jcnXpJyTr59Ri2eONzUwOly6kqYkzVzb4nF4bs1PNOuY08UJBBtEQ663lcMkTrBwL3 j7jYGVT3X0Y9l6LSNC3O/Wcwd2hvy4xjV9pbnQMvzxDLDSQTEykoWWxPBFp2qQwzerJLhM p6Xb3bSJEQRrWtzaQWY0PSDfvsZSWgcw8MwMZNAJVAOvZ3Fk+BgAcB7Qz6l5CSBfNwwCy1 JMLbKfdPMopfaGCpu//Cq1h/mFKJ/E2y9MV47GTvrDDJeYy9OFYPaoAbzkH6aiEqylGSii 1Lc6nl92oh+S9nBGLfrZCViv3derYRJcHBGiu168MwRykDf1EXIbN2Ru6O5U0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1AJXN17PJo2uRh49Bq2bmDxdwafoysfPrZd8fsUvQh4=; b=XUroXzKZwFspwP2wDadG+wvum+V4SrdryfU7l2m3ieAYATEkNgajw8hiYKmjpHIfwkSBG6 eVzEt/b9qDSYxZFARxyc+/IrNjZhGwo3E1+69fA8sZHgt9nc4FJ17DI15bJfvQrgaeApBE h5F9ztxc7WYlYHWgkLqTe/75p4sUHxPBfnA7uZsawtVLkpx7HSaYvyjlbmAUZx5aKRkwsF lyz2fjj8aZf/VT9MMpQLqCdWA5RNI5ZtBtmGMw/2Xb65DYdP8qKxbwaX1/W49hnihuETjF pSs9xyWJQzvXnp7rELEMhJEYP9JOy5DV7jSJiakgMXe1yutG7R8Pdh7/W/JlMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977363; a=rsa-sha256; cv=none; b=KDa1LwjLxY6MrfonGNm7TMyFRgHdGpmZzdBw4/rOb17TqHr16LJJ96bFiaGz6GRNYqc2c9 6mk/hNl+yYE+w3l+z+ikBP7qcNaTTCrdoRQ1dVh5AY10HTprbZ7bKQ3h2G7QIe1QGem4EM +fXMImEkMaxStGBNSUm46azMQRvYuWfAjVelPaS5rFPbDRXM8c8W2sgM9vY4rojcyLr0pB jaDmceCWbvMpNx1pYiHLs0iqEvUIc6eN6H6VUU53JJioEwi1YWXQ5Lx7cL3qryIUT17aPJ hD1N1cAj3mu/Z1SH+HOxnPcS6VvKEGVDRieR4ZwcZpBDD8eHSSdV70HNVU18BQ== 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 4T9kyB6clrzJqs; Thu, 11 Jan 2024 12:49:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCnMRK036674; Thu, 11 Jan 2024 12:49:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCnMkn036671; Thu, 11 Jan 2024 12:49:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:49:22 GMT Message-Id: <202401111249.40BCnMkn036671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 608c8658c8c9 - stable/13 - sctp: improve handling of socket shutdown for reading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 608c8658c8c9e78ccce884e137ac341366653e01 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=608c8658c8c9e78ccce884e137ac341366653e01 commit 608c8658c8c9e78ccce884e137ac341366653e01 Author: Michael Tuexen AuthorDate: 2023-08-24 13:52:55 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:48:31 +0000 sctp: improve handling of socket shutdown for reading If a socket is marked as cannot read anymore, drop chunks which should be added to a control element in the receive queue. This is consistent with dropping control elements instead of adding them in the same situation. Reported by: syzbot+291f6581cecb77097b16@syzkaller.appspotmail.com (cherry picked from commit 847fa61fad5ef118dc0591d876bf9449200aa818) --- sys/netinet/sctp_indata.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index f7f0e3fdfe7f..c195cce96f39 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -1290,14 +1290,17 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *control, * control and free up the chunk resources. */ uint32_t added = 0; - int i_locked = 0; + bool i_locked = false; - if (control->on_read_q && (hold_rlock == 0)) { - /* - * Its being pd-api'd so we must do some locks. - */ - SCTP_INP_READ_LOCK(stcb->sctp_ep); - i_locked = 1; + if (control->on_read_q) { + if (hold_rlock == 0) { + /* Its being pd-api'd so we must do some locks. */ + SCTP_INP_READ_LOCK(stcb->sctp_ep); + i_locked = true; + } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { + goto out; + } } if (control->data == NULL) { control->data = chk->data; @@ -1346,6 +1349,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *control, control->end_added = 1; control->last_frag_seen = 1; } +out: if (i_locked) { SCTP_INP_READ_UNLOCK(stcb->sctp_ep); } From nobody Thu Jan 11 12:50:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9kz33TtXz55fFs; Thu, 11 Jan 2024 12:50: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 4T9kz330fVz49YK; Thu, 11 Jan 2024 12:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVXdG6tjNwcw6dplRzFz+u+pSMh9uFNa4ENxWFRxU0k=; b=RYYZa8RxRDceqAEUjScsK0ktchfam9CRFPmhfuFhMr5+9wXSHR1O7RR7mY8BOYi+1KAvuT gy9+hqp/hEcm66e8CHRlonJkBMnlV5+9aiZtH8uAPoEFeSkQ+YWaBjVC70voitrlPQP6ey /kpaOW24mz0JBRcQvnaw+Y1qrYbItcVM8Jb5ODlIN4vi9YV8CP81yH+A5JUlL9BLJAq5XR YRXP2AxLbFI8d221PLrDY5L75qxIvCIRPmixlCCsFKLHvTlMcqTIF5+qFPzIl2KNLxHchA IRy5v2ycg7oktT2uKXfI4ABOif/gE4EJGYqTXoEK/FqbIcgzcv+7l/EO2PnElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVXdG6tjNwcw6dplRzFz+u+pSMh9uFNa4ENxWFRxU0k=; b=caiy386+KSlZrJ+yymwXKDBtAIRsbrGCFePbsk7wA+K6CUfduwvX1KebFVMKLXw9Wru/KH NgAJTn58xzPzd7hTpsQC+oEUU9sY3L5+62d7hkX+srfcCTWl4OROkHz75/Ixh651jXd3Bx 8yYXyERbOCTAeEUr9No6SN7dKwAeTp7DpWQrI5S1Vu2lW5sqEPm2w3/U8FaTwKvCAXWPRj X1BxnfOOkAkD5W2JEjBaCCBoprciD4z3yL6iUYxnGn1Xa1nCc/GLQqTarQsIDBMOvvMm1W ls/ImpiPJItZUVebMjQ2Xlw3E1BgfHG6pkjUnBXC5d0Ld2OBGIWKvpAChASMfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977407; a=rsa-sha256; cv=none; b=Nl3Tbb140hIP+694PVelx3yufYEbUlvpQFNJ28SFaU1tv+l+1sAT8JQ2Ln4d0wRyNtoODz i+8rD7h8YHJ0R18C08e8LECO7wjReJXTna4Q5i/utrdOsqGWg8/UsnTVKr0Du7Stm+afqg yuo4syYP/dcF7SsuPveqPqIiObUHy9Chk023spfokNSdBtTOHn+uZ60riAjo9fen5YeuX5 4ZaOw3XAgVwGEBEh6x39KeCLt5urmYzL+SMDHlX1Sley4s+1+HkcrJ+Z9Nqbj1pY5vBFB6 xLFcp/+LBijrUIEze29RpzAIeNvFXILbAC5aJvrAocaZwyLY8iPeoM5IlbTC3A== 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 4T9kz323h2zJsg; Thu, 11 Jan 2024 12:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCo7oX039970; Thu, 11 Jan 2024 12:50:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCo7Ra039965; Thu, 11 Jan 2024 12:50:07 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:50:07 GMT Message-Id: <202401111250.40BCo7Ra039965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6ebc41462538 - stable/13 - sctp: cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ebc414625386c9c90f115e1f132af22dc881b43 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6ebc414625386c9c90f115e1f132af22dc881b43 commit 6ebc414625386c9c90f115e1f132af22dc881b43 Author: Michael Tuexen AuthorDate: 2023-08-25 15:23:34 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:49:44 +0000 sctp: cleanup No functional change intended. Just asserting the conditions when being called. (cherry picked from commit f0c8e8118dbcc9251b11154ee7e4680f79901af1) --- sys/netinet/sctp_timer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index ef5eb8b89a5d..d0f3f936b34d 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -87,7 +87,10 @@ static int sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint16_t threshold) { - if (net) { + KASSERT(stcb != NULL, ("stcb is NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + + if (net != NULL) { net->error_count++; SCTPDBG(SCTP_DEBUG_TIMER4, "Error count for %p now %d thresh:%d\n", (void *)net, net->error_count, @@ -114,11 +117,6 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } } - } - if (stcb == NULL) - return (0); - - if (net) { if ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_INCR, From nobody Thu Jan 11 12:51:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l0R5X8qz55fdk; Thu, 11 Jan 2024 12:51: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 4T9l0R4H20z4Bnh; Thu, 11 Jan 2024 12:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIAloTVHYyq8uhmgmBiE8SXRO7gAdRo7pJ+9S90X3jQ=; b=IbPxf/uPbPBKTosfuhLtkZQijFbdh8MhuJdlJMzRXS1xM0u/NifmQFJRgIKAyNIGRmjFLl qyxhyZyszEsIu9900wIQq7Qinz8+QwaK/dDI8CvEMM6KTi/FH5TzhQGC7aM6JUPP1MXrO2 qOltI+EVKCSVxd1tKlXu9M6XMFzKha7pdrA/WubQcyrvHlsvJiGxpgzovxtoo4yYDXrYnU AG4VQSOTisNoyjs5LtP99oQ3jzsDIfoLfngunEF98P2tW70vMyId9QtSVlMlvfJxPd4OeZ w0rB5dDvImX54714M+sPD+bufaGOqWOgfSJo8FVvFH4X5PvosDjjfw/r4bliZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIAloTVHYyq8uhmgmBiE8SXRO7gAdRo7pJ+9S90X3jQ=; b=OvgQoYMVdpi1HWeviwwdBFkUZa24QJqIiZkvOfua6rDhSYLZeA2tVgDc1onGgYZvzbB0dy L+Kupj7l6m0/quzfLGTVy9eY0tjc3RyoSNM9khCosZqb+FjJc0xbAdhMbApmlFmE2q+44j hs2jNgODqiL4Qe2ZbQSIVuNAMx+WbGpxIOWPAsrqrPVf0dIn/9zUy6XqYslZw4rwZb/951 W5ee6EVZb+526HuDW4XmuwO8hL5shccXEsi+mmbGvNGFQQGjWSV4OEtXwJIHvuj4XN776y PK0DBUTiOeiZXbW7GkKzAVdiPlHWTG4nBeJ7lC9wEfzU/6V3UvLydNaFk5HFPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977479; a=rsa-sha256; cv=none; b=x3TsxsECivEjhtlYhTw5ZxFYWlpHpaXlwWcvENmqS5ZNizwhwGoqZl7kWEyWumc22OVseg WTc3B7Y96N36Zs0EIv/adjQYZaNnVicyXVk554uo2CcUZAjgNyXw99YRPihn04k8eG1v2n 9qMXW0vK2hYUZ9Xz/goSZljyEQ+mU6fW/Qyd/Ds8114E502pbc2Q8uIk44tpJBtBPnRp54 bgvIxYudrX4Fbli3agxiBBMvQ7TwLmDKzSpfXyTUvumEmXf5Acdr1pu3orWJrWEo8fy1jB leooVq0AUryLwP1iyN73+xe0niUOwIcu+7H7UrFkI0rQtC1TF4+OgsNTLNuwfA== 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 4T9l0R3NbYzJr0; Thu, 11 Jan 2024 12:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCpJLb047712; Thu, 11 Jan 2024 12:51:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCpJV5047709; Thu, 11 Jan 2024 12:51:19 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:51:19 GMT Message-Id: <202401111251.40BCpJV5047709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 122e6541316a - stable/13 - sctp: cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 122e6541316a09ba32f89ab7e42571d83fd2e174 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=122e6541316a09ba32f89ab7e42571d83fd2e174 commit 122e6541316a09ba32f89ab7e42571d83fd2e174 Author: Michael Tuexen AuthorDate: 2023-08-25 15:31:19 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:50:49 +0000 sctp: cleanup In particular, don't use a socket level flag, use the inp level one. After adding appropriate locking, this will close a race condition. (cherry picked from commit e40d16ad6ee952f315356ef091fa282f28fac0d5) --- sys/netinet/sctputil.c | 60 +++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 380aee5f671d..3769faeb1842 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4052,14 +4052,14 @@ void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked) { - if ((stcb == NULL) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { - /* If the socket is gone we are out of here */ - return; - } - if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { + struct sctp_inpcb *inp; + struct sctp_nets *net; + + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + + inp = stcb->sctp_ep; + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { return; } if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || @@ -4071,6 +4071,12 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, return; } } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ)) { + return; + } + switch (notification) { case SCTP_NOTIFY_ASSOC_UP: if (stcb->asoc.assoc_up_sent == 0) { @@ -4089,32 +4095,20 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, false, false, so_locked); break; case SCTP_NOTIFY_INTERFACE_DOWN: - { - struct sctp_nets *net; - - net = (struct sctp_nets *)data; - sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE, - (struct sockaddr *)&net->ro._l_addr, error, so_locked); - break; - } + net = (struct sctp_nets *)data; + sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE, + &net->ro._l_addr.sa, error, so_locked); + break; case SCTP_NOTIFY_INTERFACE_UP: - { - struct sctp_nets *net; - - net = (struct sctp_nets *)data; - sctp_notify_peer_addr_change(stcb, SCTP_ADDR_AVAILABLE, - (struct sockaddr *)&net->ro._l_addr, error, so_locked); - break; - } + net = (struct sctp_nets *)data; + sctp_notify_peer_addr_change(stcb, SCTP_ADDR_AVAILABLE, + &net->ro._l_addr.sa, error, so_locked); + break; case SCTP_NOTIFY_INTERFACE_CONFIRMED: - { - struct sctp_nets *net; - - net = (struct sctp_nets *)data; - sctp_notify_peer_addr_change(stcb, SCTP_ADDR_CONFIRMED, - (struct sockaddr *)&net->ro._l_addr, error, so_locked); - break; - } + net = (struct sctp_nets *)data; + sctp_notify_peer_addr_change(stcb, SCTP_ADDR_CONFIRMED, + &net->ro._l_addr.sa, error, so_locked); + break; case SCTP_NOTIFY_SPECIAL_SP_FAIL: sctp_notify_send_failed2(stcb, error, (struct sctp_stream_queue_pending *)data, so_locked); @@ -4225,7 +4219,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n", __func__, notification, notification); break; - } /* end switch */ + } } void From nobody Thu Jan 11 12:54:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l4c6K4yz55g7v; Thu, 11 Jan 2024 12:54: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 4T9l4c5qnLz4CXm; Thu, 11 Jan 2024 12:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FkRNYZTmB85MtZMzeS3ilm4Sb9hZQuDrlhVjvYd9v1o=; b=oNX3gqZrL2wx27dgTET/tgqVHDFWLYPcvYvfXio2A/d0sgZl3XUVGbs5Jygr1LM3e1BrzC DLQH5JkMOzrK05nGwR30soqjC9Q3wpJNN1SI0z5hHMZuMvd2UiChm+QC8yk/KYoVERn8VP IAbvrsTZnazouT48Z5bXpf/nmW63cEbLQhWL6tGPABySfDmqvTn3UAv2r4hVUtRVjQQ6Pw atO0XlxmbLii9+g4ZeZGJbxEULq0Lncb4+Ub5RyvYontv8FyhGS1kDENW7X6kly/EBf1mU SiJo7ZaQnCGyjKuzW4Lna+BZY6uNR6WGXBESjlic7wudQKywPcji8NhKYMaPlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FkRNYZTmB85MtZMzeS3ilm4Sb9hZQuDrlhVjvYd9v1o=; b=IKrQs7O90kFEz0CZSvZISfwwp2l7DTGE3hpvSMDvACwfzUF2FeQW1bnYOtYFlWamzdsmW1 9OoAeJ0BmaTQAFGLscouzSvVrCogrUqtDod/URtnGID7wRF8gkGhvQqust0/mV8g0XY4W+ 9nRT9pmK48cGTm2zJgLWPZjm5ATT1QzH86/VObDlPiniyyHluu3/2WRd+OvH7hLVf3obyN J6AiZO6K0mNqerjYzhOUXCz8t6rHsHGNl2bMWFCeIzg0e0TzoOnjfJsIf5y9K0iYksMOrg LU4JDz0HbXufyyRVAEggWeaDFq7/7ROwjW24adiX0cX3yM8ItFgHHF/NTYRN3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977696; a=rsa-sha256; cv=none; b=XQt7laEO1d3lUOZF1rLfC0+NwsSTcwu9USwbiWe4OzKDgPqX7G1lAnu2WjJCcTQdAX0sbl 3qWXtVAV6MtQyKRuT/mIF/d/w0GKRcVrtMd9APyz/l0P/Onjs669LqpSw/+OGQDQaEFx8C G0tuLDAd7mD2WRB+Ngpff/W1UN1ajt4jY0ndCIS8JgeHr9T1I3C95XxcVUyc25FNvQ/5AX 0vPk8i8gT9ByIsM7DuHy0l8RWJWem48q8ghFVWnuNjMiZ7Y0K0QX78QxwgPBw0ImLv8SCF E50JC+hSv7EXThRIitAQ1RnyC5L3K15CMBDK9K3jTqC/LbM24+9D9HzhgmrP9Q== 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 4T9l4c4tNfzKK5; Thu, 11 Jan 2024 12:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCsua2053894; Thu, 11 Jan 2024 12:54:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCsu9d053891; Thu, 11 Jan 2024 12:54:56 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:54:56 GMT Message-Id: <202401111254.40BCsu9d053891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: abe3c497ea12 - stable/13 - sctp: cleanup SCTP AUTH related notification List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: abe3c497ea1277d099255bded596e29d93366536 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=abe3c497ea1277d099255bded596e29d93366536 commit abe3c497ea1277d099255bded596e29d93366536 Author: Michael Tuexen AuthorDate: 2023-09-08 11:13:43 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:54:28 +0000 sctp: cleanup SCTP AUTH related notification This makes consistent use of the parameters and ensures that all SCTP AUTH related notifications are using sctp_ulp_notify(). No functional change intended. (cherry picked from commit cd3770c5feb038f3904fdb4aa04e09da122f74e3) --- sys/netinet/sctp_auth.c | 32 ++++++++++++++++---------------- sys/netinet/sctp_auth.h | 2 +- sys/netinet/sctputil.c | 15 ++++++--------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index 67f0d26fa0d5..3c1962233347 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -575,7 +575,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked) if ((skey->refcount <= 2) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, - key_id, 0, so_locked); + 0, &key_id, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", __func__, (void *)stcb, key_id, skey->refcount); @@ -1312,7 +1312,7 @@ sctp_deact_sharedkey(struct sctp_tcb *stcb, uint16_t keyid) /* are there other refcount holders on the key? */ if (skey->refcount == 1) { /* no other users, send a notification for this key */ - sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, keyid, 0, + sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, 0, &keyid, SCTP_SO_LOCKED); } @@ -1654,15 +1654,10 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth, return (-1); } /* generate a notification if this is a new key id */ - if (stcb->asoc.authinfo.recv_keyid != shared_key_id) - /* - * sctp_ulp_notify(SCTP_NOTIFY_AUTH_NEW_KEY, stcb, - * shared_key_id, (void - * *)stcb->asoc.authinfo.recv_keyid); - */ - sctp_notify_authentication(stcb, SCTP_AUTH_NEW_KEY, - shared_key_id, stcb->asoc.authinfo.recv_keyid, - SCTP_SO_NOT_LOCKED); + if (stcb->asoc.authinfo.recv_keyid != shared_key_id) { + sctp_ulp_notify(SCTP_NOTIFY_AUTH_NEW_KEY, stcb, 0, + &shared_key_id, SCTP_SO_NOT_LOCKED); + } /* compute a new recv assoc key and cache it */ if (stcb->asoc.authinfo.recv_key != NULL) sctp_free_key(stcb->asoc.authinfo.recv_key); @@ -1705,7 +1700,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth, */ void sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, - uint16_t keyid, uint16_t alt_keyid, int so_locked) + uint16_t keyid, int so_locked) { struct mbuf *m_notify; struct sctp_authkey_event *auth; @@ -1714,8 +1709,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, if ((stcb == NULL) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) - ) { + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { /* If the socket is gone we are out of here */ return; } @@ -1737,7 +1731,12 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, auth->auth_flags = 0; auth->auth_length = sizeof(*auth); auth->auth_keynumber = keyid; - auth->auth_altkeynumber = alt_keyid; + /* XXXMT: The following is BSD specific. */ + if (indication == SCTP_AUTH_NEW_KEY) { + auth->auth_altkeynumber = stcb->asoc.authinfo.recv_keyid; + } else { + auth->auth_altkeynumber = 0; + } auth->auth_indication = indication; auth->auth_assoc_id = sctp_get_associd(stcb); @@ -1757,7 +1756,8 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } /*- diff --git a/sys/netinet/sctp_auth.h b/sys/netinet/sctp_auth.h index 8bfdbaa6d4f6..279ecb6831cd 100644 --- a/sys/netinet/sctp_auth.h +++ b/sys/netinet/sctp_auth.h @@ -212,7 +212,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch, struct mbuf *m, uint32_t offset); extern void sctp_notify_authentication(struct sctp_tcb *stcb, - uint32_t indication, uint16_t keyid, uint16_t alt_keyid, int so_locked); + uint32_t indication, uint16_t keyid, int so_locked); extern int sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit); diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 3769faeb1842..f4013a4816c7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4195,19 +4195,16 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, sctp_notify_shutdown_event(stcb); break; case SCTP_NOTIFY_AUTH_NEW_KEY: - sctp_notify_authentication(stcb, SCTP_AUTH_NEW_KEY, error, - (uint16_t)(uintptr_t)data, - so_locked); + sctp_notify_authentication(stcb, SCTP_AUTH_NEW_KEY, + *(uint16_t *)data, so_locked); break; case SCTP_NOTIFY_AUTH_FREE_KEY: - sctp_notify_authentication(stcb, SCTP_AUTH_FREE_KEY, error, - (uint16_t)(uintptr_t)data, - so_locked); + sctp_notify_authentication(stcb, SCTP_AUTH_FREE_KEY, + *(uint16_t *)data, so_locked); break; case SCTP_NOTIFY_NO_PEER_AUTH: - sctp_notify_authentication(stcb, SCTP_AUTH_NO_AUTH, error, - (uint16_t)(uintptr_t)data, - so_locked); + sctp_notify_authentication(stcb, SCTP_AUTH_NO_AUTH, + 0, so_locked); break; case SCTP_NOTIFY_SENDER_DRY: sctp_notify_sender_dry_event(stcb, so_locked); From nobody Thu Jan 11 12:56:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l6H4H75z55gHY; Thu, 11 Jan 2024 12:56: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 4T9l6H2tzyz4CtF; Thu, 11 Jan 2024 12:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ndre7O1YVCSuieaBl7mwKuegmeVTrwzvQt/PrBzOqM=; b=DABlJXkHqxS+J/doyYX65nSCDNXSL+hb5yH9Pm5RIt981aGqf2tbdbxoJvflUBkrAOLoFw ws3o9HldTj7h62LDz31PBWwOkyQMvm3XOUHcAIHaa+MVX7XpQX1HguVgl4AKdq8oXKui7U C7tzWp/7qQxxLt+V8eu3DataSvE4h6yxBFkR1GvwZNiSeKLAf7Sn53mYubu2Zwx9oZXt/T UZNIErvuBFjDwiyalEZ669lXe73WwR9h+uGid6JOC52LtK0EwgVscUwp5/qtdlODRV2zZW 7dFKuEsMaG5hDT3HmBg6beNjnUr8zAD5UGm0BYiWO6swpN2z2/Y17Y+RBbZg6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ndre7O1YVCSuieaBl7mwKuegmeVTrwzvQt/PrBzOqM=; b=KQ/9lDOMxD98PLLhtVuTgPHY0rivnzPAjEwRQXDoBOSg7uIgcInz9ZALeBNE/5+8vQqKp5 3QcKvFJIGIDfWJ0ZahIz2jYF6hGy2/mK/wOS+4/lTzTS5yg2bUpp+126RSkwzzVrLfOwNR XumyIMk3OHZFaPpX9PTxQ9UgwX+ANl6bDnTIkbI2Zvo9GFa7oPXVxHWI8ykJ+GSsDQvvuM anj0/lTLf/Q87TkfCirH5JMpHfo7uAxZm0/ws53SZ6Rqk9LrAkkygI+URBFRxTxVBkXlib kdkj8fZfapq9f40oc2YdIy4l1Ufwwsl6+ZI2Ppr3l+4/IsRbBUPSuy+vY0Xk5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977783; a=rsa-sha256; cv=none; b=DFjPhC6z2WupPiv7XBLBEZONLc85bPXk/CzRRfIUHqqcAAatMtu/OgMdJQv2a27OIepQId ebcpR+tpLCPZYBMa+Tp1nJxONI3lHKrzuj23E7ZawU12fv/stz+uDT48tNlGc2U7wnz81K 7GISCwkRUh94TbRo8JRviB5wVwBRyONElHAro25AfDjiQmU3UEaYqrfmqtPy9j/duvNgbg cQeWXXTWxXrpG8smgD7aN1GX8lIBmsS6A/hTSaEmjVc8qo3mc5XpS0ZHCjqSJaEh8jxsp0 kdSo7YLRRnY1bTCxso5vc8NWQv8TYrGTnSHbbdZmehjYyr3xSY7AeClL+iEadQ== 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 4T9l6H1ymJzJpD; Thu, 11 Jan 2024 12:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCuNSJ054248; Thu, 11 Jan 2024 12:56:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCuNXF054245; Thu, 11 Jan 2024 12:56:23 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:56:23 GMT Message-Id: <202401111256.40BCuNXF054245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c813c96d678a - stable/13 - sctp: make sure all SCTP RESET notifications use sctp_ulp_notify() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c813c96d678a01d19f2124f0db376fdafa8ac6f2 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c813c96d678a01d19f2124f0db376fdafa8ac6f2 commit c813c96d678a01d19f2124f0db376fdafa8ac6f2 Author: Michael Tuexen AuthorDate: 2023-09-08 12:19:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:55:56 +0000 sctp: make sure all SCTP RESET notifications use sctp_ulp_notify() While there, improve consistency of the notification related code. No functional change intended. (cherry picked from commit 3ac7664774ad038b208cbb31eb52d1608efbd451) --- sys/netinet/sctp_constants.h | 14 +++-- sys/netinet/sctp_input.c | 26 ++++----- sys/netinet/sctputil.c | 135 ++++++++++++++++++++++--------------------- sys/netinet/sctputil.h | 6 -- 4 files changed, 86 insertions(+), 95 deletions(-) diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index 05e804100aa2..d11fe11d5e8f 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -706,12 +706,14 @@ #define SCTP_NOTIFY_STR_RESET_FAILED_IN 20 #define SCTP_NOTIFY_STR_RESET_DENIED_OUT 21 #define SCTP_NOTIFY_STR_RESET_DENIED_IN 22 -#define SCTP_NOTIFY_AUTH_NEW_KEY 23 -#define SCTP_NOTIFY_AUTH_FREE_KEY 24 -#define SCTP_NOTIFY_NO_PEER_AUTH 25 -#define SCTP_NOTIFY_SENDER_DRY 26 -#define SCTP_NOTIFY_REMOTE_ERROR 27 -#define SCTP_NOTIFY_ASSOC_TIMEDOUT 28 +#define SCTP_NOTIFY_STR_RESET_ADD 23 +#define SCTP_NOTIFY_STR_RESET_TSN 24 +#define SCTP_NOTIFY_AUTH_NEW_KEY 25 +#define SCTP_NOTIFY_AUTH_FREE_KEY 26 +#define SCTP_NOTIFY_NO_PEER_AUTH 27 +#define SCTP_NOTIFY_SENDER_DRY 28 +#define SCTP_NOTIFY_REMOTE_ERROR 29 +#define SCTP_NOTIFY_ASSOC_TIMEDOUT 30 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 5d2a3dd26384..7ad9eec07897 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -3508,23 +3508,19 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb, asoc->strmout[i].state = SCTP_STREAM_OPEN; } asoc->streamoutcnt += num_stream; - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGE_DENIED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, NULL, SCTP_SO_NOT_LOCKED); } else { - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGE_FAILED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_FAILED, NULL, SCTP_SO_NOT_LOCKED); } } else if (type == SCTP_STR_RESET_ADD_IN_STREAMS) { if (asoc->stream_reset_outstanding) asoc->stream_reset_outstanding--; if (action == SCTP_STREAM_RESET_RESULT_DENIED) { - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGE_DENIED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, NULL, SCTP_SO_NOT_LOCKED); } else if (action != SCTP_STREAM_RESET_RESULT_PERFORMED) { - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGE_FAILED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, NULL, SCTP_SO_NOT_LOCKED); } } else if (type == SCTP_STR_RESET_TSN_REQUEST) { /** @@ -3570,13 +3566,11 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb, sctp_reset_out_streams(stcb, 0, (uint16_t *)NULL); sctp_reset_in_stream(stcb, 0, (uint16_t *)NULL); - sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), 0); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { - sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), - SCTP_ASSOC_RESET_DENIED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, SCTP_ASSOC_RESET_DENIED, NULL, SCTP_SO_NOT_LOCKED); } else { - sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), - SCTP_ASSOC_RESET_FAILED); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, SCTP_ASSOC_RESET_FAILED, NULL, SCTP_SO_NOT_LOCKED); } } /* get rid of the request and get the request flags */ @@ -3705,7 +3699,7 @@ sctp_handle_str_reset_request_tsn(struct sctp_tcb *stcb, sctp_reset_out_streams(stcb, 0, (uint16_t *)NULL); sctp_reset_in_stream(stcb, 0, (uint16_t *)NULL); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; - sctp_notify_stream_reset_tsn(stcb, asoc->sending_seq, (asoc->mapping_array_base_tsn + 1), 0); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0], asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]); @@ -3870,7 +3864,7 @@ sctp_handle_str_reset_add_strm(struct sctp_tcb *stcb, struct sctp_tmit_chunk *ch /* update the size */ stcb->asoc.streamincnt = num_stream; stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; - sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0); + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); asoc->str_reset_seq_in++; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index f4013a4816c7..b378a55250e0 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3138,9 +3138,10 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, struct mbuf *m_notify; struct sctp_assoc_change *sac; struct sctp_queued_to_read *control; + struct sctp_inpcb *inp; unsigned int notif_len; - uint16_t abort_len; unsigned int i; + uint16_t abort_len; KASSERT(abort == NULL || from_peer, ("sctp_notify_assoc_change: ABORT chunk provided for local termination")); @@ -3149,7 +3150,8 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, if (stcb == NULL) { return; } - if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { + inp = stcb->sctp_ep; + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { notif_len = (unsigned int)sizeof(struct sctp_assoc_change); if (abort != NULL) { abort_len = ntohs(abort->ch.chunk_length); @@ -3227,10 +3229,9 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - so_locked); + sctp_add_to_readq(inp, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } else { sctp_m_freem(m_notify); } @@ -3240,8 +3241,8 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, * comes in. */ set_error: - if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && + if (((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { SOCK_LOCK(stcb->sctp_socket); if (from_peer) { @@ -3264,8 +3265,8 @@ set_error: SOCK_UNLOCK(stcb->sctp_socket); } /* Wake ANY sleepers */ - if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && + if (((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { socantrcvmore(stcb->sctp_socket); } @@ -3354,11 +3355,9 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, + sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, - so_locked); + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void @@ -3485,11 +3484,9 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, + sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, - so_locked); + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void @@ -3583,13 +3580,13 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void -sctp_notify_adaptation_layer(struct sctp_tcb *stcb) +sctp_notify_adaptation_layer(struct sctp_tcb *stcb, int so_locked) { struct mbuf *m_notify; struct sctp_adaptation_event *sai; @@ -3630,9 +3627,9 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb) control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void @@ -3700,7 +3697,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, } static void -sctp_notify_shutdown_event(struct sctp_tcb *stcb) +sctp_notify_shutdown_event(struct sctp_tcb *stcb, int so_locked) { struct mbuf *m_notify; struct sctp_shutdown_event *sse; @@ -3747,14 +3744,13 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void -sctp_notify_sender_dry_event(struct sctp_tcb *stcb, - int so_locked) +sctp_notify_sender_dry_event(struct sctp_tcb *stcb, int so_locked) { struct mbuf *m_notify; struct sctp_sender_dry_event *event; @@ -3796,11 +3792,12 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb, /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } -void -sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t numberout, int flag) +static void +sctp_notify_stream_reset_add(struct sctp_tcb *stcb, int flag, int so_locked) { struct mbuf *m_notify; struct sctp_queued_to_read *control; @@ -3835,8 +3832,8 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t stradd->strchange_flags = flag; stradd->strchange_length = sizeof(struct sctp_stream_change_event); stradd->strchange_assoc_id = sctp_get_associd(stcb); - stradd->strchange_instrms = numberin; - stradd->strchange_outstrms = numberout; + stradd->strchange_instrms = stcb->asoc.streamincnt; + stradd->strchange_outstrms = stcb->asoc.streamoutcnt; SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_stream_change_event); SCTP_BUF_NEXT(m_notify) = NULL; if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) { @@ -3857,13 +3854,13 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } -void -sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag) +static void +sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, int flag, int so_locked) { struct mbuf *m_notify; struct sctp_queued_to_read *control; @@ -3892,8 +3889,8 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32 strasoc->assocreset_flags = flag; strasoc->assocreset_length = sizeof(struct sctp_assoc_reset_event); strasoc->assocreset_assoc_id = sctp_get_associd(stcb); - strasoc->assocreset_local_tsn = sending_tsn; - strasoc->assocreset_remote_tsn = recv_tsn; + strasoc->assocreset_local_tsn = stcb->asoc.sending_seq; + strasoc->assocreset_remote_tsn = stcb->asoc.mapping_array_base_tsn + 1; SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_reset_event); SCTP_BUF_NEXT(m_notify) = NULL; if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) { @@ -3914,14 +3911,14 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32 control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, so_locked); } static void sctp_notify_stream_reset(struct sctp_tcb *stcb, - int number_entries, uint16_t *list, int flag) + int number_entries, uint16_t *list, int flag, int so_locked) { struct mbuf *m_notify; struct sctp_queued_to_read *control; @@ -3978,13 +3975,14 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } static void -sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_error_chunk *chunk) +sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, + struct sctp_error_chunk *chunk, int so_locked) { struct mbuf *m_notify; struct sctp_remote_error *sre; @@ -4039,10 +4037,9 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_erro control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, + sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + SCTP_READ_LOCK_NOT_HELD, so_locked); } else { sctp_m_freem(m_notify); } @@ -4084,11 +4081,10 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, stcb->asoc.assoc_up_sent = 1; } if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) { - sctp_notify_adaptation_layer(stcb); + sctp_notify_adaptation_layer(stcb, so_locked); } if (stcb->asoc.auth_supported == 0) { - sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, - NULL, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); } break; case SCTP_NOTIFY_ASSOC_DOWN: @@ -4153,31 +4149,36 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, case SCTP_NOTIFY_ASSOC_RESTART: sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, false, false, so_locked); if (stcb->asoc.auth_supported == 0) { - sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, - NULL, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); } break; case SCTP_NOTIFY_STR_RESET_SEND: - sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), SCTP_STREAM_RESET_OUTGOING_SSN); + sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), SCTP_STREAM_RESET_OUTGOING_SSN, so_locked); break; case SCTP_NOTIFY_STR_RESET_RECV: - sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), SCTP_STREAM_RESET_INCOMING); + sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), SCTP_STREAM_RESET_INCOMING, so_locked); break; case SCTP_NOTIFY_STR_RESET_FAILED_OUT: sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), - (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_FAILED)); + (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_FAILED), so_locked); break; case SCTP_NOTIFY_STR_RESET_DENIED_OUT: sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), - (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_DENIED)); + (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_DENIED), so_locked); break; case SCTP_NOTIFY_STR_RESET_FAILED_IN: sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), - (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_FAILED)); + (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_FAILED), so_locked); break; case SCTP_NOTIFY_STR_RESET_DENIED_IN: sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), - (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_DENIED)); + (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_DENIED), so_locked); + break; + case SCTP_NOTIFY_STR_RESET_ADD: + sctp_notify_stream_reset_add(stcb, error, so_locked); + break; + case SCTP_NOTIFY_STR_RESET_TSN: + sctp_notify_stream_reset_tsn(stcb, error, so_locked); break; case SCTP_NOTIFY_ASCONF_ADD_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data, @@ -4192,7 +4193,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, error, so_locked); break; case SCTP_NOTIFY_PEER_SHUTDOWN: - sctp_notify_shutdown_event(stcb); + sctp_notify_shutdown_event(stcb, so_locked); break; case SCTP_NOTIFY_AUTH_NEW_KEY: sctp_notify_authentication(stcb, SCTP_AUTH_NEW_KEY, @@ -4210,7 +4211,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, sctp_notify_sender_dry_event(stcb, so_locked); break; case SCTP_NOTIFY_REMOTE_ERROR: - sctp_notify_remote_error(stcb, error, data); + sctp_notify_remote_error(stcb, error, data, so_locked); break; default: SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n", diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index c649611d5004..8de98b4608f8 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -80,12 +80,6 @@ int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, u void sctp_fill_random_store(struct sctp_pcb *); -void -sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, - uint16_t numberout, int flag); -void - sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag); - /* * NOTE: sctp_timer_start() will increment the reference count of any relevant * structure the timer is referencing, in order to prevent a race condition From nobody Thu Jan 11 12:57:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l7B0scCz55gT4; Thu, 11 Jan 2024 12:57: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 4T9l7B0jGFz4CyM; Thu, 11 Jan 2024 12:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WnUlnPwg/EfhxEdSxnafFVmiu7zw2it8erxRY0ZIDro=; b=plNRf4hHOwe31rdZi4vVW2qzd9tedaQrusz3myfHwBLBQmpNhUG4qSi1E7XmY3BLX5srLp idXOqr1fSdIIw57bahsR3W4vbcgrN1pyu/v8llCQF2b3jxvQsaBoqK4zvdTS9zRNTv+4tn YnmJ9e5odK99VXGpW5P61ZlwSu9UXdX0c4GakbSpRTUcDHX/ci1W2YwvzMLDLXOyf2cr+u HgDgR6ZC4e0HPdlXmN+PeizQ7qS+gzDEfqVD3cJlHVSx3ch5NruyWMmBQKHQC6U1b0O6a+ GvWYHTqWGXfjBqC/A9DmYufNA6UC2oYBOhiVl1BCCxUez+mE+PEZXwGIq6rCRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WnUlnPwg/EfhxEdSxnafFVmiu7zw2it8erxRY0ZIDro=; b=V4yAP0mL9euaO69Sam5Hnc1KP36m0NJuFGERtXsdQAVF27N2coz5wFktnGxccVmVl18a6A nvN3tylF70qAuSf/2SgYYQzXxxDmdSPSruYnr7sneGgegn6DNcgySufdZ4xSSTFmqMR68I 1jGk95ixWQjpH7fSIAFHEKEFZ17TgX/HenusZSC92CQgJFdn5DgF/6J+Kb9g5eqczeof3b oVp7bEUyyjm3VUw4yYuB5czdQ3Ek7xBV0A/d2nV4U4bBDZK0unZ/xGIskAFNV27GL1Z88x dXcsN+OzNVFocef8s+7uzwdhMp15uAoLH4VZ6uV6WBdFaDriK8G7H9f1KIJDtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977830; a=rsa-sha256; cv=none; b=vuhoDBzO0BEM0rmWpHaKYmDPF3n2MYo1ByjgGIgS6ni+OrJcRaG2XiziyreqyG+70c2Ff7 GYTIa7NjsQ+/wt6XKZwRL/P1yPQVycZ1s4hfQsoV5z4IEuAlgcdH0/26aKGd1gQpyvYzbc Ync5yXJnOuozfbf3PV2/Cug8LKi1CIfjqeYFzRQIe8H5PKZTNfxsTS0FRkLhg5OuCbVfof kXI9nbyrQwePd6rO+NLx2Wo8mrEJDi6HdtmayifVBqDqBxqmUJabIMW6D+6rijRd37kVqO 0KFH+/VbGGo3/+9+6y4zxgZlhUP8MZR3fqvDWDy2fJL08Nf/Q9OOaSgNZvcjCQ== 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 4T9l796sqrzKMT; Thu, 11 Jan 2024 12:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCv9Do054479; Thu, 11 Jan 2024 12:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCv9Ev054476; Thu, 11 Jan 2024 12:57:09 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:57:09 GMT Message-Id: <202401111257.40BCv9Ev054476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a8694dd1b951 - stable/13 - sctp: cleanup locking for notifications List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a8694dd1b95141ce2a058888e762aa950e3fa47d Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a8694dd1b95141ce2a058888e762aa950e3fa47d commit a8694dd1b95141ce2a058888e762aa950e3fa47d Author: Michael Tuexen AuthorDate: 2023-09-08 14:20:51 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:56:47 +0000 sctp: cleanup locking for notifications All notifications are now queued via sctp_ulp_notify(). Do the locking of the inp read lock there and validate this in all functions being used. This is one step in avoiding race conditions when closing the read end of an SCTP socket. (cherry picked from commit f9425b3a85e9e211b61e11ce8115bf73674bdf49) --- sys/netinet/sctp_auth.c | 12 ++--- sys/netinet/sctputil.c | 132 ++++++++++++++++++++++++++++++------------------ 2 files changed, 87 insertions(+), 57 deletions(-) diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index 3c1962233347..8bcb6d5243db 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -1706,13 +1706,9 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, struct sctp_authkey_event *auth; struct sctp_queued_to_read *control; - if ((stcb == NULL) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { - /* If the socket is gone we are out of here */ - return; - } + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ @@ -1757,7 +1753,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } /*- diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index b378a55250e0..e6121a1635b7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3147,10 +3147,11 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, ("sctp_notify_assoc_change: ABORT chunk provided for local termination")); KASSERT(!from_peer || !timedout, ("sctp_notify_assoc_change: timeouts can only be local")); - if (stcb == NULL) { - return; - } + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); inp = stcb->sctp_ep; + SCTP_INP_READ_LOCK_ASSERT(inp); + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { notif_len = (unsigned int)sizeof(struct sctp_assoc_change); if (abort != NULL) { @@ -3231,7 +3232,7 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, control->tail_mbuf = m_notify; sctp_add_to_readq(inp, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } else { sctp_m_freem(m_notify); } @@ -3282,11 +3283,15 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, struct sctp_paddr_change *spc; struct sctp_queued_to_read *control; - if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT)) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT)) { /* event not enabled */ return; } + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_paddr_change), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) return; @@ -3357,7 +3362,7 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3371,9 +3376,12 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, struct sctp_chunkhdr *chkhdr; int notifhdr_len, chk_len, chkhdr_len, padding_len, payload_len; - if ((stcb == NULL) || - (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT))) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { /* event not enabled */ return; } @@ -3486,7 +3494,7 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3499,12 +3507,16 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, struct sctp_queued_to_read *control; int notifhdr_len; - if ((stcb == NULL) || - (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT))) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { /* event not enabled */ return; } + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { notifhdr_len = sizeof(struct sctp_send_failed_event); } else { @@ -3582,7 +3594,7 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3592,8 +3604,11 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb, int so_locked) struct sctp_adaptation_event *sai; struct sctp_queued_to_read *control; - if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT)) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT)) { /* event not enabled */ return; } @@ -3629,7 +3644,7 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb, int so_locked) control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3642,15 +3657,16 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, struct sctp_queued_to_read *control; struct sockbuf *sb; - if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_PDAPIEVNT)) { + KASSERT(aborted_control != NULL, ("aborted_control is NULL")); + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_PDAPIEVNT)) { /* event not enabled */ return; } - KASSERT(aborted_control != NULL, ("aborted_control is NULL")); - SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ @@ -3703,6 +3719,10 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb, int so_locked) struct sctp_shutdown_event *sse; struct sctp_queued_to_read *control; + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + /* * For TCP model AND UDP connected sockets we will send an error up * when an SHUTDOWN completes @@ -3712,6 +3732,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb, int so_locked) /* mark socket closed for read/write and wakeup! */ socantsendmore(stcb->sctp_socket); } + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT)) { /* event not enabled */ return; @@ -3746,7 +3767,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb, int so_locked) control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3756,8 +3777,11 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb, int so_locked) struct sctp_sender_dry_event *event; struct sctp_queued_to_read *control; - if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DRYEVNT)) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DRYEVNT)) { /* event not enabled */ return; } @@ -3793,7 +3817,7 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb, int so_locked) control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3803,13 +3827,10 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, int flag, int so_locked) struct sctp_queued_to_read *control; struct sctp_stream_change_event *stradd; - if ((stcb == NULL) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { - /* If the socket is gone we are out of here. */ - return; - } + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT)) { /* event not enabled */ return; @@ -3856,7 +3877,7 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, int flag, int so_locked) control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3866,13 +3887,10 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, int flag, int so_locked) struct sctp_queued_to_read *control; struct sctp_assoc_reset_event *strasoc; - if ((stcb == NULL) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { - /* If the socket is gone we are out of here. */ - return; - } + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT)) { /* event not enabled */ return; @@ -3913,7 +3931,7 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, int flag, int so_locked) control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3925,8 +3943,11 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, struct sctp_stream_reset_event *strreset; int len; - if ((stcb == NULL) || - (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT))) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { /* event not enabled */ return; } @@ -3977,7 +3998,7 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + SCTP_READ_LOCK_HELD, so_locked); } static void @@ -3990,10 +4011,14 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, unsigned int notif_len; uint16_t chunk_len; - if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPEERERR)) { + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPEERERR)) { return; } + if (chunk != NULL) { chunk_len = ntohs(chunk->ch.chunk_length); /* @@ -4039,7 +4064,7 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, so_locked); + SCTP_READ_LOCK_HELD, so_locked); } else { sctp_m_freem(m_notify); } @@ -4068,9 +4093,15 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, return; } } + if (notification != SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION) { + SCTP_INP_READ_LOCK(inp); + } + SCTP_INP_READ_LOCK_ASSERT(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ)) { + SCTP_INP_READ_UNLOCK(inp); return; } @@ -4218,6 +4249,9 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, __func__, notification, notification); break; } + if (notification != SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION) { + SCTP_INP_READ_UNLOCK(inp); + } } void From nobody Thu Jan 11 12:57:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l833BLjz55gYd; Thu, 11 Jan 2024 12:57: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 4T9l832j0Tz4DTh; Thu, 11 Jan 2024 12:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnHmVdLoczfldwyWF/6ZvEsJrpWHewStsOElg9XQ61U=; b=kysz8GbvT7kdql7GIrJLwlzd2V4Yzcwe1hwb1r89/mcM5pp7exSWu6tABZHDcUOpkppUUs UHuZqdSleN87nOV8R2MZw030jIGT9SDYDaM0zlapSFky0Q1i31mBVzGFaqZFLIYLHyqeIX kLkLRuoQUmojaKxjfQH7v9r+S9O/Rn56W4X8PVTQYcCptTUmdPKfX/67g9E+lIeIDm0D9i M+vOqIZ8M7f82KAaU6Jo4GToGXKdVhQaZiD2DgrjW+7fzJIiyvPqMCZEwElrPTa4OZgOTU YERP6K3dZW+Mdp8YQkVB749xsAb2Y53FqZfycCwgK5qhadqdPNNut0iZo4+JNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnHmVdLoczfldwyWF/6ZvEsJrpWHewStsOElg9XQ61U=; b=OFmmNoCenEx4WSN7kwzRo802ONU+8oFoGk8X7Z7PUe84JWZ5anC2M+yvLJQ84ZtJXR0Nbf EBGIC4e5LhgnzLUcMZ7/z/jHjbtQeexmvyF9zjiSTlJirGsASR+DriYvgIMmd3J1xoUPLD 3aRELlBBDvfIoQKGkqXch3picJjOt1OJLuxcrn8X4tZXIG6AQlwBLIMR0d/qG0i8covy1k YOF3lJtrC9sy+ZVjbS4e8NLasScB3nludSUYkXuWmickDdi1XwK7AqRNHinYmaatYMY4n3 YH3T7V5tbllOtgGk9zSfC5h8t1CzyewdKHpTcE0V4TpcZwZBSrcn3UEAA+cT7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977875; a=rsa-sha256; cv=none; b=kcLXD6TMq2GjZ0rejhvDeIRmTAoGhP9qSu6EKdUtea7O+gOaWjf2UVkb+7fETZYHEFDFLE ur+dQdsR+DRgTXytolfyxpoE6m5spLeA7F9SkF6flk2yWT66Pq2/i9WvJCtcrYS0w5OjRa RJmvrhGU5xzpjpwoxfUKD9alyzHCTJ7a7ocMq5Bw9g06dcakZ+rlTzQkLB6ju1HfNRA2D+ xeCVhfM1M1teskEqSXrOaVnhndHOJHT12q8z5L5va3VMvnAy7j5ZF33Jn979kHOLt2dytD NeO4hmokghL/XglJ6b2m8HOMlQxZ5PFuInioBOcdiRCVvxWYHGh2Lhz2n6xiEw== 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 4T9l831lxczKHC; Thu, 11 Jan 2024 12:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCvtK8054701; Thu, 11 Jan 2024 12:57:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCvtcN054698; Thu, 11 Jan 2024 12:57:55 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:57:55 GMT Message-Id: <202401111257.40BCvtcN054698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2d12958d4b5b - stable/13 - sctp: don't call sctp_ulp_notify() recursively List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d12958d4b5b0cd7799662f3f69284c716264f92 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2d12958d4b5b0cd7799662f3f69284c716264f92 commit 2d12958d4b5b0cd7799662f3f69284c716264f92 Author: Michael Tuexen AuthorDate: 2023-09-08 19:19:59 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:57:29 +0000 sctp: don't call sctp_ulp_notify() recursively This does not work with the new locking scheme. (cherry picked from commit 1e81a4e7e89bb1870bec84e42284ad10505e957c) --- sys/netinet/sctputil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index e6121a1635b7..8b2e95158ebc 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4115,7 +4115,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, sctp_notify_adaptation_layer(stcb, so_locked); } if (stcb->asoc.auth_supported == 0) { - sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); + sctp_notify_authentication(stcb, SCTP_AUTH_NO_AUTH, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_DOWN: @@ -4180,7 +4180,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, case SCTP_NOTIFY_ASSOC_RESTART: sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, false, false, so_locked); if (stcb->asoc.auth_supported == 0) { - sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); + sctp_notify_authentication(stcb, SCTP_AUTH_NO_AUTH, 0, so_locked); } break; case SCTP_NOTIFY_STR_RESET_SEND: From nobody Thu Jan 11 12:58:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9l951VDDz55ghp; Thu, 11 Jan 2024 12:58: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 4T9l950vZ3z4DkK; Thu, 11 Jan 2024 12:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qugw9W2odbqeXEvLIEAJbZCqsnVom3DIXqPKyeR+tyY=; b=RF8/oKVLPXRYNYhs6vZPEsbaZO3S8vaJj0ZkDJF7RJ3Cozpv3SMz4bcwLC0rR5pAzskXXR iBhHLC/f371enukEy8xZcagsLCB2nWh/8NVDLvyAmAkM0OW+t8RTOtCNP0N1OgM8TtpcO1 u6sMaXE30jX+0bLYqCi08RTZyU/9rOUW1pfWDCCYbgr+3p4GalUmrubdOMWPZfipDzDNIt sgaY7Ipl07wxLnA2ByiRnpTM8wG3YVRcn6k6HkJJ49qZ4gLmsazVTGheCpqm/wdqLprCdo OiXLV6s9nIkQ010ngl9k0ySWkZQS12cWX/fdsTsp2CGBXP38WDyVHhfR0MjZ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704977929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qugw9W2odbqeXEvLIEAJbZCqsnVom3DIXqPKyeR+tyY=; b=QOqZGodKr2ALjzm1S2wrY4OX6/nx7j6EN/LAdgtxDMhf2NkR62qy1k2LluGpwO+IXINcPR qHR2AfnDz7pkSyxvOIvvfE9XLanTi98OV7dWwyvh77IqtjQxiFSs2c6xMmV4X6x1MQ87NR 9HVFZGYiqAoO7qQVJX6hDBgziUaIgrdvhkv3i8dTR9dzVdne1oeozSw2wRHRkP4DmY4657 kImF3XozD2zOk1yGV/HlBxi3jmEAt6Li+KNb7eDOpZjo8prKpNqIaiTgeP67BP5EiiJHkj VPC0K/hscV/KpCHk5+BbpR+Xz3WkzvvHSqCC1oAz2sCn1wFlrkgMWpkt+SyF9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704977929; a=rsa-sha256; cv=none; b=O20zHyRXSLreIPrdOm/zRzer4k39dKOyR6gkh1y9lb9X7Gfm10exsRJ5tcMqQtXGezyo5x o4AcmpC/KnSxE8Qv8OoDI588Tvk2qRi0NdH0TyjppgJHrgshT+lf8+iZ8gJYbmJXGbUkde 3PmHX7dMlPW5s0TXyqQDZfBmiGqON14n0EKhkPhaJJBTCF8Io8IF9j2fEdXcj+zQ3wGVg3 vmOvb26g06jbh5CwOujNRHTFbs0Sn4yiiTybuE3MfeQxdK1lHFXBgVyZdZubIsP/X5/A/9 /wWEoV+3Y3VkqtbOUfYyQ2MX2xCavZ7l0fZVwt8T1IvFa8ZYJA8TOpInXh/O6A== 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 4T9l947494zJrN; Thu, 11 Jan 2024 12:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCwmg1055003; Thu, 11 Jan 2024 12:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCwmZ1055000; Thu, 11 Jan 2024 12:58:48 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:58:48 GMT Message-Id: <202401111258.40BCwmZ1055000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e207b7b8b371 - stable/13 - sctp: improve shutting down the read side of a socket List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e207b7b8b3716fdb64ed5ef10688e0f0cbe954cc Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e207b7b8b3716fdb64ed5ef10688e0f0cbe954cc commit e207b7b8b3716fdb64ed5ef10688e0f0cbe954cc Author: Michael Tuexen AuthorDate: 2023-09-12 23:33:54 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:58:11 +0000 sctp: improve shutting down the read side of a socket When shutdown(..., SHUT_RD) or shutdown(..., SHUT_RDWR) is called, really clean up the read queue and issue an ungraceful shutdown if user messages are affected. Reported by: syzbot+d4e1d30d578891245f59@syzkaller.appspotmail.com (cherry picked from commit 81c5f0fac91dfae64205a6c4f9b2a469d1187372) --- sys/netinet/sctp_usrreq.c | 90 ++++++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index a7af1da8624a..9f1a33b5ff2a 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -789,52 +789,76 @@ sctp_disconnect(struct socket *so) int sctp_flush(struct socket *so, int how) { - /* - * We will just clear out the values and let subsequent close clear - * out the data, if any. Note if the user did a shutdown(SHUT_RD) - * they will not be able to read the data, the socket will block - * that from happening. - */ + struct epoch_tracker et; + struct sctp_tcb *stcb; + struct sctp_queued_to_read *control, *ncontrol; struct sctp_inpcb *inp; + struct mbuf *m, *op_err; + bool need_to_abort = false; + /* + * For 1-to-1 style sockets, flush the read queue and trigger an + * ungraceful shutdown of the association, if and only if user + * messages are lost. Loosing notifications does not need to be + * signalled to the peer. + */ + if (how == PRU_FLUSH_WR) { + /* This function is only relevant for the read directions. */ + return (0); + } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - SCTP_INP_RLOCK(inp); - /* For the 1 to many model this does nothing */ + SCTP_INP_WLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - SCTP_INP_RUNLOCK(inp); + /* For 1-to-many style sockets this function does nothing. */ + SCTP_INP_WUNLOCK(inp); return (0); } - SCTP_INP_RUNLOCK(inp); - if ((how == PRU_FLUSH_RD) || (how == PRU_FLUSH_RDWR)) { - /* - * First make sure the sb will be happy, we don't use these - * except maybe the count - */ - SCTP_INP_WLOCK(inp); - SCTP_INP_READ_LOCK(inp); - inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; - SCTP_INP_READ_UNLOCK(inp); + stcb = LIST_FIRST(&inp->sctp_asoc_list); + if (stcb == NULL) { SCTP_INP_WUNLOCK(inp); - SOCK_LOCK(so); - KASSERT(!SOLISTENING(so), - ("sctp_flush: called on listening socket %p", so)); - SCTP_SB_CLEAR(so->so_rcv); - SOCK_UNLOCK(so); + return (ENOTCONN); } - if ((how == PRU_FLUSH_WR) || (how == PRU_FLUSH_RDWR)) { - /* - * First make sure the sb will be happy, we don't use these - * except maybe the count - */ - SOCK_LOCK(so); - KASSERT(!SOLISTENING(so), - ("sctp_flush: called on listening socket %p", so)); - SOCK_UNLOCK(so); + SCTP_TCB_LOCK(stcb); + SCTP_INP_READ_LOCK(inp); + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; + SOCK_LOCK(so); + TAILQ_FOREACH_SAFE(control, &inp->read_queue, next, ncontrol) { + if ((control->spec_flags & M_NOTIFICATION) == 0) { + need_to_abort = true; + } + TAILQ_REMOVE(&inp->read_queue, control, next); + control->on_read_q = 0; + for (m = control->data; m; m = SCTP_BUF_NEXT(m)) { + sctp_sbfree(control, control->stcb, &so->so_rcv, m); + } + if (control->on_strm_q == 0) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } + sctp_free_a_readq(stcb, control); + } else { + stcb->asoc.size_on_all_streams += control->length; + } + } + SOCK_UNLOCK(so); + SCTP_INP_READ_UNLOCK(inp); + if (need_to_abort) { + inp->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; + SCTP_INP_WUNLOCK(inp); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + NET_EPOCH_ENTER(et); + sctp_abort_an_association(inp, stcb, op_err, false, SCTP_SO_LOCKED); + NET_EPOCH_EXIT(et); + return (ECONNABORTED); } + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_WUNLOCK(inp); return (0); } From nobody Thu Jan 11 13:00:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9lBW0ll3z55gTg; Thu, 11 Jan 2024 13:00: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 4T9lBW0Gbgz4F6k; Thu, 11 Jan 2024 13:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704978003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9f+922MIm1b53DjO7WRtoTmxsQA2Q/8LQYbMIwFazs=; b=KmGQTEoTOzCeai89WZpjd3OG4YwMkiNDwvddhOcE+P6KEg/acO73XefrQpOtrSG0ZkEgll 1f7gHxni+lqcCnx0zeOexsDnuUL4hQ6qN/G1D7vm91R1bR5bgD5RlbbK06zfMxhinOvAjz 4dpKPCb+N+d/EOMoogMvwiYq++mIcx0bkKWwFEU4G9M+O9rJ+Ixs3nPnSbPA8bl/uajMGy +8QBsKaUY0Nb/yA0oIf3HAWwqAFoJf/VedNaILv47OGoFxpo5v30xIYNABzHFWwy0fPoqH sToNwyq5PrwnBWLoZ2xyC1JHC76HUlvmYknlhWkUPD5UvHKPj5owpQmZaC+RDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704978003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9f+922MIm1b53DjO7WRtoTmxsQA2Q/8LQYbMIwFazs=; b=gTxX0lZ2H7UWcF0WM2iYI/+t++e4Q6qmclqvfpYhJSr7Vxz4C19bPI7hMV/ztA5NUSLDec jFKGs1eIOwtIYicnC5ZjFsd2X9cZZI9vteTHIm8lpXf/pc3qDB6JP8u7QVy6k+s4ra3MLh Ln0hIzRtiuEsBCuyZfYp3os+xGZAYzahDeXF5K0ksALr8cp2sBteGMaCehs1szFGGS6zQH lbp8gj5rF4kWXbOj94uh9KrkYrm08Cc2l0yndA9rQyEgEj8OGp3Mxo5bAQwycwiKTzqyC6 ZE7MRgnk16J7jqu71P4ZQeqzlg5dtC6tcioFEr+eqAp/Mi0hi4doeTNXPTzP8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704978003; a=rsa-sha256; cv=none; b=pUcK3JmaNxM/v3hTXXOL+//glqsU7zp0uOuA/48Op4+kkPUpbR0+51FcHTxjyNE1+vWnwx LaJbTzOCQJabEcWWZecg52rJsoUEpbyPVZ6lQip5mBf1qTaI0yejoSxzF+6Uo6I6oGk69u +U+2r3l0Dtgx+/+NDT9UM2NCVt+O+rnarXWRYwBwBL0pOWMYwJ7ZNJGUoFKG4Na1hHpIfk zyaG+6V9xX1IcijiqFZBzWF1Q7HTKPqh1nclgGTTbtsidGOziDKdbpOi10q4q5IepNppIf 4upBpAiN8uXwWAikDATgzNZ7jbdv7LW8C0eXkh32PaDI2k3XIXwgyHO449m26Q== 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 4T9lBV6RFczJrP; Thu, 11 Jan 2024 13:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BD02fB058203; Thu, 11 Jan 2024 13:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BD02v0058195; Thu, 11 Jan 2024 13:00:02 GMT (envelope-from git) Date: Thu, 11 Jan 2024 13:00:02 GMT Message-Id: <202401111300.40BD02v0058195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 947d455fe545 - stable/13 - sctp: further improve shutting down the read side of a socket List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 947d455fe545687a4cadb4d87c6a2139ca73b6c9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=947d455fe545687a4cadb4d87c6a2139ca73b6c9 commit 947d455fe545687a4cadb4d87c6a2139ca73b6c9 Author: Michael Tuexen AuthorDate: 2023-09-13 11:02:51 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:59:04 +0000 sctp: further improve shutting down the read side of a socket Deal with the case that the association is already gone. Reported by: syzbot+e256d42e9b390564530a@syzkaller.appspotmail.com (cherry picked from commit bb56b36d7188e004840294d0bd5dfdf7f3392a05) --- sys/netinet/sctp_usrreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 9f1a33b5ff2a..3289d86ba831 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -818,11 +818,9 @@ sctp_flush(struct socket *so, int how) return (0); } stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb == NULL) { - SCTP_INP_WUNLOCK(inp); - return (ENOTCONN); + if (stcb != NULL) { + SCTP_TCB_LOCK(stcb); } - SCTP_TCB_LOCK(stcb); SCTP_INP_READ_LOCK(inp); inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; SOCK_LOCK(so); @@ -848,7 +846,7 @@ sctp_flush(struct socket *so, int how) } SOCK_UNLOCK(so); SCTP_INP_READ_UNLOCK(inp); - if (need_to_abort) { + if (need_to_abort && (stcb != NULL)) { inp->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; SCTP_INP_WUNLOCK(inp); op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); @@ -857,7 +855,9 @@ sctp_flush(struct socket *so, int how) NET_EPOCH_EXIT(et); return (ECONNABORTED); } - SCTP_TCB_UNLOCK(stcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } SCTP_INP_WUNLOCK(inp); return (0); } From nobody Thu Jan 11 13:29:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9lrb6n9Sz55l3V; Thu, 11 Jan 2024 13:29: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 4T9lrb6JTnz4Hs6; Thu, 11 Jan 2024 13:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704979775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U6F8S9zWcuA2YXA/uf9aY3tbhS9d8evhmLjp4IbRQ/c=; b=OWWGvFuFDJ/vLLNG2XErlSMR4DYFeIyDDlsvcNV6N9YCAEFISOEEtujFDXEzBkLs7zApLh jWwLEohVyKOYBTeEowF/NH2ElE8rM4DCTLqISotxVf7jd2oVWihx/bKdRm0Bi1Km/46DR2 /DEcyP9k3/T+/8uMxbSoimKOg8wEKTMqkSQ7n1ACw0WCihKNymrIicE3a7qBsgPedgYi7v uaJFNprHu7FWuoeVyRR5eKTtFR+YHxceWR/usrnRkatrNIYL1usMxvmtYvGiPqBH0xvmrU HLcc69b59poBlKZ5M38n7FnMGUR1NwDV4imQsNYY32BnA2UmGCpQ7aqwZgTKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704979775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U6F8S9zWcuA2YXA/uf9aY3tbhS9d8evhmLjp4IbRQ/c=; b=LwXlQDu91+lWvXAW1cL3AmekVeaSWeHaS8pXu746BZ2p3MmNQYRLUu/9oWjldI0N0KbqLH KdyqWNttI3JzPD3w8SYu8CB5+2GeHyc/fTBoF7z8Z9S6eNDSLuzZ5evhWIGhLJlYKrR5f4 oAdWyo5LQBnWs3SgY/abreVGFBlJdo9BCwc1F8mS5RtMYSwoeT7RyWSAIG1M1crSiGfk6k hw10JQPP0Ubfl+0ynflNnvZ3eQHbrjpFZnO0hXuZgIQXk7V77MYOJC4jPWNZ5XFwpyZPG/ j3g0XtX371BpZa2aqJuQkwUcrMepci6a5vviWjnILZwiWrflFsnkmZ8WYPUXCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704979775; a=rsa-sha256; cv=none; b=ZSb79lqFmStmgYpAb6i1jt4UvMJVvPFmHOd4eKlCdp3vobj56xKjvcafJIxa8ViwrVknHf rEVpUP1CRPvUSu9AI8ojKGJtTl/vrREZPk5Lb9BJ4IEOeY0x0VUE/pcSFZsP+vaPGc55oy G8QSypysK+6uyH7Z0M2V4k73LUOgpnViTZWh6MrUyD08UR9S2mnq9ikhvSO29ospKb0Oxk t9ORCOR/4W5Ty7HJ3tMLGENvpq1yY4HqVzmASrJ1Cx/f1Wouu8MwmlsV0Hq/Cr6vNmyvFS w7VZaluuMVqOZRwdthKhDs08WY1V++l48RcfyDJpmH78mNdP4/KvkAv5ZF4nNQ== 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 4T9lrb5MzHzLFR; Thu, 11 Jan 2024 13:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BDTZAA005306; Thu, 11 Jan 2024 13:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BDTZom005303; Thu, 11 Jan 2024 13:29:35 GMT (envelope-from git) Date: Thu, 11 Jan 2024 13:29:35 GMT Message-Id: <202401111329.40BDTZom005303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c7163823c9a2 - stable/14 - Cirrus CI: Trigger on pull requests or downstream repos List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c7163823c9a283702604347edc47f015ec4ed4fe Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c7163823c9a283702604347edc47f015ec4ed4fe commit c7163823c9a283702604347edc47f015ec4ed4fe Author: Jose Luis Duran AuthorDate: 2023-10-06 12:13:26 +0000 Commit: Ed Maste CommitDate: 2024-01-11 13:29:12 +0000 Cirrus CI: Trigger on pull requests or downstream repos Since Cirrus Labs is limiting their free usage tier [1], limit CI runs on pull requests only. Otherwise, we might deplete our monthly quota within a few days. Adapt the task amd64-llvm16 to execute on downstream repos or on pull requests only. Other alternatives will be further studied. [1]: https://cirrus-ci.org/blog/2023/07/17/limiting-free-usage-of-cirrus-ci/ (cherry picked from commit 5d371834d29c3c716148f201bb8c1f68f15218fb) --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 317c5b28230d..96fbb873136c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -23,6 +23,7 @@ task: TOOLCHAIN: llvm15 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: amd64-llvm16 World and kernel build and boot smoke test + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH =~ 'pull/.*' env: TARGET: amd64 TARGET_ARCH: amd64 From nobody Thu Jan 11 14:32:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nF70b93z56802; Thu, 11 Jan 2024 14:32: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 4T9nF709dzz4SVF; Thu, 11 Jan 2024 14:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YuEXrJ5TLdU8/hdwWRsmmwlieJbiSVhhPpZGG5OCqZE=; b=GbLIoVWaLB7qXXzrU3qTWo/b/bzNHzJwHmstUC3pCjkQ0H9Ujpifvn8RGJJzGW3nRIjMUJ F6ZznVtd01QAJ8O0Kyd2nr1y8EObMtUoGWbO66xvGX/n4+CKK++0mGc1XboMEJDuhkPiwQ Zasq+LsEEGAdK6sx5q6M5bxTGuNQoRTr9EqQTUS7wV8ZO49kZjA+Mktr+RjreeLCBfWm5w 0dpKECCDApj9BCk6qpjo/yJTuKlwWh4YfnXWmqeqCnXGKZbz91dJf9mcT6HHCgEV4Ovaz8 8q+gtMrvKgWEDnH1B0H4ddSU+rXJmR/UNX86BMwQxdDYLdvxqw0dQLwi24/n0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YuEXrJ5TLdU8/hdwWRsmmwlieJbiSVhhPpZGG5OCqZE=; b=G8ibjk0830eZOpRpNlcLHYZQmOKhwxeaDd1Ev6+TtEjtRYw3cjhV+xRNaY9wJABiaa4ypt I9hWDcbhEZIbJV6VvWOBJu+AMGo+Q4bj70AQ07UNkkdlQwrH1xeGCsvN94Bw0C/bMBQO1Q G4RBxOGBQEb5zyWk3CqpOK4QuS5EwCwTjqy7FQ4GXLGpW4DkTA5wO64xPBALMTA8iFbbBk B4OMpepXX+1RVM9TL8IV3g2CWiO3U1cbWDv1/U/loBFaOMtrJ3xpIJBTWwhlfbJKi7y+E+ VJTSOGdwvrcRTNjTUHxmjTG3XC3fh4fYu/XiEpoc0rcEZWjNrvlTMYE+088bHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983547; a=rsa-sha256; cv=none; b=bUJ4Gk6UwrmJYy8etQZ2s4sA01nBeNAME8SHWrWKn3bdU6tzIToVI7xpIuZKOliSngok14 alYJmi30uv8ZqHFCkkV3IPSAeBezGhK0rJ/QBjSk5KfgoCVRWmGfoi07p9GZsOmWtbud0z Pw+ySjdkKEefJEAfQsSZSGhHlpFKFFf11Lty50uKYpvAH2lKcdZuGzk+5qs2PAfG2Ml6F7 jqfbUxxRvFTwtn7YyB63gKxUQ2BafSTXAjhK3nrOxAwL/v/q62NGIRqfqb93g4ogpALl+1 3uKVmJ1emG4iKXKqo2zPNxY3zuGLsVVCaJJApDe9BviHwYjytayHiN5H9+eumA== 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 4T9nF66LFXzMX7; Thu, 11 Jan 2024 14:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWQfw022179; Thu, 11 Jan 2024 14:32:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWQuF022166; Thu, 11 Jan 2024 14:32:26 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:26 GMT Message-Id: <202401111432.40BEWQuF022166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8ac8b0b6aa17 - stable/14 - setfib.2: Consistently capitalize "FIB" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac8b0b6aa17caa7166b634d1076d280e363ac95 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac8b0b6aa17caa7166b634d1076d280e363ac95 commit 8ac8b0b6aa17caa7166b634d1076d280e363ac95 Author: Mark Johnston AuthorDate: 2024-01-03 20:19:41 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:18:12 +0000 setfib.2: Consistently capitalize "FIB" MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit ee7d5ba1b55441476643983d3f70df5ee9ea97c4) --- lib/libc/sys/setfib.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/setfib.2 b/lib/libc/sys/setfib.2 index efbb7bf171ae..32e2f64910cb 100644 --- a/lib/libc/sys/setfib.2 +++ b/lib/libc/sys/setfib.2 @@ -37,7 +37,7 @@ .Sh DESCRIPTION The .Fn setfib -system call sets the associated fib for all sockets opened +system call sets the associated FIB (routing table) for all sockets opened subsequent to the call, to be that of the argument .Fa fib . The @@ -69,9 +69,9 @@ packet header, however it is not suggested that one use such a large number as memory is allocated for every FIB regardless of whether it is used, and there are places where all FIBs are iterated over. .Pp -The default fib of the process will be applied to all protocol families -that support multiple fibs, and ignored by those that do not. -The default fib for a process may be overridden for a socket with the use +The default FIB of the process will be applied to all protocol families +that support multiple FIBs, and ignored by those that do not. +The default FIB for a process may be overridden for a socket with the use of the .Dv SO_SETFIB socket option. From nobody Thu Jan 11 14:32:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nF81S2Sz567Wk; Thu, 11 Jan 2024 14:32:28 +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 4T9nF80gkfz4SVH; Thu, 11 Jan 2024 14:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLSufdqS0o2lAIzpbrBPliJ3RBMN8Hqf/bZm9n6NrA0=; b=C8rymOKMTSkFXOy8oXVJ4ZQpnavB9rrZpbGwqWEpV3Fnp/D05/1rBjKhsCkGb5Rzta2EWm W2nePgeX5+0izR6TAvLMBRRiUorc9+hPE/5y8GkRPB19VvS19QUv5YtTtyUnHbMUxzNz2B CIzsDmjES6MxII3yCpRDQ5ivDqlDH82RZtLpmNEwq+y2+som0u7Bfm5Hjpmfc5LAbgTwcw LWCxgac577Olv/D70YBFILYblcYOnRjuCouxK7gg8e1HxQ7ogNTR7swuUEXCYguPj4Vjs6 3vYt0KMabmaiqu8iBaUGUMrKUb4+af/3W6ZdpDBp0LAk9Ky4Iaj6DCb1RnsXjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLSufdqS0o2lAIzpbrBPliJ3RBMN8Hqf/bZm9n6NrA0=; b=MvdCa1kdjMvrgL7oHlkIuzXpg6tGzXAVxiMPUWJDooZ6m3mSOtGWNe9qYlpaQYBZZyCJ6f 2/khu6lLMvRmCDvXl2QHfx0At21U7hPifUFlvBHJFZzdI6K/GUNWqNthyqp5HsbyRqV9fF IUZoTEFoczytS4sY0SWwQcnh5kWzOc6QzMGJYiX76AGi5CWyQWTZiS8uAsJymuEsLGQ3Jj 2edBOMVmmRTKQjwslNkBiIPpO+Unb9FiZDY3CtCwaszdmovJAxtkhl/Rj+s9bk2Fq05JbR 7r/3V/n1gFthZ0gbmSqoglY3SHeR45k5ZgPwj5BMaZYv27IGjV7IdVamft1K/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983548; a=rsa-sha256; cv=none; b=fRShDvXnkOFaJxX5ezg9cPHb+gsGKURjc4vJ5cBvv6L+sEeet42nQTVIwp9MLOp9v9qEu1 Po26HRdh97CVcfKHaNjGhd5EQcbIVhkCuSaxqf4MNpJUPAqiHIH5+Xmchfv1B4+WEQMiwb aEmRCsPE47+BtHUb5G0+BMEec42yVXlSezwIJY1UMaptlOwctxvCMzjhHJF2WV2WL5gN/G rl+ooQcm0zrA1YoHTUDsXuR0tecj2uLW6i16EykwXuzOnNumOQvN8xQ85c/UKS1Z3K9O3L UrD++c7sD8yzRJOlWE3DenCy5WKJHYZCYCe7omTmS4rdCBAnCbsGLU4vYrqGEA== 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 4T9nF76sDwzMX8; Thu, 11 Jan 2024 14:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWRNf023452; Thu, 11 Jan 2024 14:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWRgi023441; Thu, 11 Jan 2024 14:32:27 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:27 GMT Message-Id: <202401111432.40BEWRgi023441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d14bf9de60a8 - stable/14 - netinet: Define IPv6 ECN mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: d14bf9de60a879dd9fccfbe977b467e87c0d357d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d14bf9de60a879dd9fccfbe977b467e87c0d357d commit d14bf9de60a879dd9fccfbe977b467e87c0d357d Author: Jose Luis Duran AuthorDate: 2023-10-28 02:50:18 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:18:12 +0000 netinet: Define IPv6 ECN mask Define a mask for the code point used for ECN in the Traffic Class field (2 bits) of an IPv6 header. BE: 0 0 3 0 0 0 0 0 Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Traffic Class | Flow Label | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | For BE (Big Endian), or network-byte order, this corresponds to 0x00300000. For Little Endian, it corresponds to 0x00003000. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit b0e13f785b336670bdf39b83a78435b00d00f43c) --- sys/netinet/ip6.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index 8c3459339bbc..7b85fd5b4ddd 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -97,10 +97,12 @@ struct ip6_hdr { #if BYTE_ORDER == BIG_ENDIAN #define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ +#define IPV6_ECN_MASK 0x00300000 /* ECN code point (2 bits) */ #else #if BYTE_ORDER == LITTLE_ENDIAN #define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ +#define IPV6_ECN_MASK 0x00003000 /* ECN code point (2 bits) */ #endif /* LITTLE_ENDIAN */ #endif #define IPV6_FLOWLABEL_LEN 20 From nobody Thu Jan 11 14:32:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nF943Hgz567wc; Thu, 11 Jan 2024 14:32: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 4T9nF91QCMz4Svk; Thu, 11 Jan 2024 14:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6KY2BecZJxLhKMgn5X8tTxU+hqXYk14jT/wSXZ2lWM=; b=w+Eoo3Qp3gaCN5Fo8EglDtO8JNG4f8QyyvDik2QhUOTpofI3clM5XzRW6Ypgx/APH9T7p9 CtNUayrtPvvQfdCKXQsYb6IOkelU3EgH2X665SCD0YtsuqzRI8BT9tv+prK8OmewPiI98l 0/rani7aiUOXBEGEkHt65LNLUycm1FUQy88ehPRK11SgvSj+rUel+LT2R+McQBl7c1RSBz 12Ks/izl/dHiS5MAJvZ4orVn2w6PHQL0lxerY/g73/dwHWBk34dlGE+imw1GqUo7srTq9/ gBG6ON8eQt3OGO1yHdlIbjQ0p15bKrG9eQE6YeNAo1VNIEy/WHbIGdFT3xGsFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6KY2BecZJxLhKMgn5X8tTxU+hqXYk14jT/wSXZ2lWM=; b=QFFoR55YqaiWSIPfhmBKYnWiBFDFgVVu0n0porqXYMw0T7JI5GLSRfJcdto7euEzoM3V6H 2sN9TTtSZ4G/9w9r4SCWudoChIhfPuogGstmBGf4A6abLNxPgJwxEH2wg3rviR+HWyifGg vx6EC/w6APycmtWu8evtHag5VbT/dR+uzlPTL3i16TZB0px3mzdhGN76Bb+d+Xn/MugQZI UqAq9HO/Rqiz8hAPz+3JzylEbY9qwN0a4s04/xZfqVuIkY52UXi6akC4+kyjAMI0hug56p 6FXmvh1yOT9i/21yLdeagkGHtR2GdZVTxoWGl0QNjyeWAk2EoE7y4zvSZikDgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983549; a=rsa-sha256; cv=none; b=JdLGZ2O4qW4PbKBV5JyE6vq9qklqaf4QvtRzE2t9hknse5nCk8pfMuhBJUyvrCc355atAL SBFzu9hnexFkzmIAoDR3IEpJ3MQ9AgKAKNe4OlRjveZn7dfWx+S1oQafduY97F1QTIIpl0 nhXKozey1Om0nj8Ki+4207B3M8/O7wJKJD2gdWBxMeVrR1aPqaOZ+9gveWY13Ny+CFPGlm UjVSNQYT10CNN7hfXPZ3Q7nr42Iar5/g9FmD7a2QHqXlbPoFHknFxccA7f7raLPNS1Dj2z GgKQYONDOxgqOGgCvPdGnaiLUkUqg1kC54NIv5ALYi56bBU4nYjv9kz2PF9MGg== 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 4T9nF90RjYzMpv; Thu, 11 Jan 2024 14:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWTTi023921; Thu, 11 Jan 2024 14:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWTUc023918; Thu, 11 Jan 2024 14:32:29 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:29 GMT Message-Id: <202401111432.40BEWTUc023918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: df50b9998cb4 - stable/14 - traceroute6: style(9) fixes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: df50b9998cb4ad3abffeb056ab92a4614dd38ae8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df50b9998cb4ad3abffeb056ab92a4614dd38ae8 commit df50b9998cb4ad3abffeb056ab92a4614dd38ae8 Author: Jose Luis Duran AuthorDate: 2023-10-27 23:53:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:18:12 +0000 traceroute6: style(9) fixes No functional change intended. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit 777e494a7634bbdd8ab0cf403ae22a464669d804) --- usr.sbin/traceroute6/traceroute6.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index cf1c12c5962c..7907952e9328 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -342,7 +342,7 @@ static u_long nprobes = 3; static u_long first_hop = 1; static u_long max_hops = 30; static u_int16_t srcport; -static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ +static u_int16_t port = 32768 + 666; /* start udp dest port # for probe packets */ static u_int16_t ident; static int tclass = -1; static int options; /* socket options */ @@ -385,7 +385,7 @@ main(int argc, char *argv[]) } size = sizeof(i); - (void) sysctl(mib, sizeof(mib)/sizeof(mib[0]), &i, &size, NULL, 0); + (void) sysctl(mib, sizeof(mib) / sizeof(mib[0]), &i, &size, NULL, 0); max_hops = i; /* specify to tell receiving interface */ @@ -693,7 +693,7 @@ main(int argc, char *argv[]) exit(1); } if ((useproto == IPPROTO_SCTP) && (datalen & 3)) { - fprintf(stderr, + fprintf(stderr, "traceroute6: packet size must be a multiple of 4.\n"); exit(1); } @@ -1054,7 +1054,7 @@ wait_for_reply(int sock, struct msghdr *mhdr) FD_SET(sock, fdsp); wait.tv_sec = waittime; wait.tv_usec = 0; - if (select(sock+1, fdsp, (fd_set *)0, (fd_set *)0, &wait) > 0) + if (select(sock + 1, fdsp, (fd_set *)0, (fd_set *)0, &wait) > 0) cc = recvmsg(rcvsock, mhdr, 0); free(fdsp); @@ -1071,14 +1071,14 @@ setpolicy(int so, char *policy) buf = ipsec_set_policy(policy, strlen(policy)); if (buf == NULL) { warnx("%s", ipsec_strerror()); - return -1; + return (-1); } (void)setsockopt(so, IPPROTO_IPV6, IPV6_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); free(buf); - return 0; + return (0); } #endif @@ -1115,7 +1115,7 @@ send_probe(int seq, u_long hops) case IPPROTO_UDP: outudp = (struct udphdr *) outpacket; outudp->uh_sport = htons(ident); - outudp->uh_dport = htons(port+seq); + outudp->uh_dport = htons(port + seq); outudp->uh_ulen = htons(datalen); outudp->uh_sum = 0; outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen); @@ -1205,7 +1205,7 @@ send_probe(int seq, u_long hops) fprintf(stderr, "Unknown probe protocol %d.\n", useproto); exit(1); } - + i = send(sndsock, (char *)outpacket, datalen, 0); if (i < 0 || (u_long)i != datalen) { if (i < 0) @@ -1298,7 +1298,7 @@ pr_type(int t0) cp = "Unknown"; break; } - return cp; + return (cp); } int @@ -1366,8 +1366,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) #else rcvhlim = 0; /*XXX*/ #endif - } - else + } else rcvhlim = *hlimp; *type = icp->icmp6_type; @@ -1452,7 +1451,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) return (1); } if (verbose) { - char sbuf[NI_MAXHOST+1], dbuf[INET6_ADDRSTRLEN]; + char sbuf[NI_MAXHOST + 1], dbuf[INET6_ADDRSTRLEN]; u_int8_t *p; int i; @@ -1614,19 +1613,19 @@ inetname(struct sockaddr *sa) } } if (cp) - return cp; + return (cp); if (cap_getnameinfo(capdns, sa, sa->sa_len, line, sizeof(line), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(line, "invalid", sizeof(line)); - return line; + return (line); } /* * CRC32C routine for the Stream Control Transmission Protocol */ -#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF]) +#define CRC32C(c, d) (c = (c >> 8) ^ crc_c[(c ^ (d)) & 0xFF]) static u_int32_t crc_c[256] = { 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, @@ -1707,11 +1706,11 @@ sctp_crc32c(void *pack, u_int32_t len) CRC32C(crc32c, buf[i]); crc32c = ~crc32c; byte0 = crc32c & 0xff; - byte1 = (crc32c>>8) & 0xff; - byte2 = (crc32c>>16) & 0xff; - byte3 = (crc32c>>24) & 0xff; + byte1 = (crc32c >> 8) & 0xff; + byte2 = (crc32c >> 16) & 0xff; + byte3 = (crc32c >> 24) & 0xff; crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); - return htonl(crc32c); + return (htonl(crc32c)); } u_int16_t From nobody Thu Jan 11 14:32:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFB5MJ6z567YT; Thu, 11 Jan 2024 14:32:30 +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 4T9nFB2KFcz4SbG; Thu, 11 Jan 2024 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=neahvrPo+zcRONrAgErO7qzrSDPguq9zAFf+JkB5OmE=; b=KC5JpYjNJOx8h5BxJp9r/3rii114CpCEtsWOBFj3F2669oIUvvbtoVWW4meP8Oc4F1XrhI x27OOg5aB8R3D2U7OeVnfYMzo0WJJxgQOB84Ex3Hum64yXo49jnOFfIW6+n+cwqIe91pyI xsWo6iHR7h7CmyGWrWI0UpcR46KmSuKnn5yNmYIbZ7cC32Tr2Nt9Ykz8j1OQEuio5SrDv2 69q+KR+zAi+X/11U6L8DujELs6tjsCEooCBzRGLhiD+xtUfq/kX8vaUOLR4v6AZnlSVCX4 /cqXu7Xv7UCe8/TH7wrDU22iFSS0IMnqds/gujA42GN4EkLFTOWNY9WKt7oAMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=neahvrPo+zcRONrAgErO7qzrSDPguq9zAFf+JkB5OmE=; b=ij+kUV8bH3wK9Gw/Dmp8u7/lEPopRHsiyXQrJskEf6yqMll9DUBf0hebPEDEShrD3NfUvd wGj5pJIes7kL01NRJU/pKlahrCz8IpRYYWSLNNvX0G4oyb0LYncApE7GPguORgvJW6FNL0 BnHx6P14KUnQ104FH/q2Yo42QfdICjouq346AK1Zt5A8Is2SaL5LXg0RjUbiYG5ddD2RCC McHn0diLYb81Ju3xZZxXZ4J29rTvCGlT/aaOjJPJzqF9Lb4zA5hK7Ly2bq15mLf4GwwF7H 3PmlVX17VmT/p1+PolnFKjbhKVv966doipvIIMAbJBZCy9ci6ubtUW+9+zHxbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983550; a=rsa-sha256; cv=none; b=NBpWqWAP2WFSOmw2Y1sEhn6swOrOqVvBLj2xAS/WD/XhjdSHP4NoJBqOCYbxBPgSHe+knj iknrwE4oXgQpGPJ9jN3hxihuq7tw60zbjshH/H1SzofKwzi3uBs8P7rEBE7E+RKu/qyAu3 TPC15Vghw0djglNfIFvg2kG6Mtdrl46WEouTpewaxM1wxw02Qka6X+VRJrJeGX19ToaPVq zx4gYnT6Ub6aL2uLTqjhN+Iry+CMIrMhsScTqppAYtA8SxbLGGLLHO0yqJQJATupHAUTcA y2/xle+PWTsUKwJviOqRZKA4CHG/CTXVtxYSQSKYz5e59G4+a1/KTXYEwKFVPQ== 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 4T9nFB1NjkzMr9; Thu, 11 Jan 2024 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWU6q023958; Thu, 11 Jan 2024 14:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWUnO023955; Thu, 11 Jan 2024 14:32:30 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:30 GMT Message-Id: <202401111432.40BEWUnO023955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5df995ef0f8b - stable/14 - traceroute: style(9) fixes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5df995ef0f8bcbf44f0c8a45659d5243fd300036 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5df995ef0f8bcbf44f0c8a45659d5243fd300036 commit 5df995ef0f8bcbf44f0c8a45659d5243fd300036 Author: Jose Luis Duran AuthorDate: 2023-10-28 00:13:19 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:18:12 +0000 traceroute: style(9) fixes No functional change intended. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit 943a9f4e470c3d45e4e93e3c91449b8c369c27ab) --- contrib/traceroute/traceroute.c | 55 +++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index 48ad8fdc9104..fc87575ea043 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -539,7 +539,7 @@ main(int argc, char **argv) exit(1); } /* - * Do the setuid-required stuff first, then lose priveleges ASAP. + * Do the setuid-required stuff first, then lose privileges ASAP. * Do error checking for these two calls where they appeared in * the original code. */ @@ -762,7 +762,7 @@ main(int argc, char **argv) } #ifdef HAVE_SETLINEBUF - setlinebuf (stdout); + setlinebuf(stdout); #else setvbuf(stdout, NULL, _IOLBF, 0); #endif @@ -988,7 +988,7 @@ main(int argc, char **argv) if (bind(sndsock, (struct sockaddr *)from, sizeof(*from)) < 0) { Fprintf(stderr, "%s: bind: %s\n", prog, strerror(errno)); - exit (1); + exit(1); } if (as_path) { @@ -1104,7 +1104,8 @@ main(int argc, char **argv) continue; if (!gotlastaddr || from->sin_addr.s_addr != lastaddr) { - if (gotlastaddr) printf("\n "); + if (gotlastaddr) + printf("\n "); print(packet, cc, from); lastaddr = from->sin_addr.s_addr; ++gotlastaddr; @@ -1292,7 +1293,7 @@ wait_for_reply(register int sock, register struct sockaddr_in *fromp, (struct sockaddr *)fromp, &fromlen); free(fdsp); - return(cc); + return (cc); } void @@ -1354,14 +1355,14 @@ setpolicy(int so, char *policy) buf = ipsec_set_policy(policy, strlen(policy)); if (buf == NULL) { warnx("%s", ipsec_strerror()); - return -1; + return (-1); } (void)setsockopt(so, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); free(buf); - return 0; + return (0); } #endif @@ -1390,9 +1391,9 @@ pr_type(register u_char t) }; if (t > 16) - return("OUT-OF-RANGE"); + return ("OUT-OF-RANGE"); - return(ttab[t]); + return (ttab[t]); } int @@ -1433,7 +1434,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from, if (type == ICMP_ECHOREPLY && proto->num == IPPROTO_ICMP && (*proto->check)((u_char *)icp, (u_char)seq)) - return -2; + return (-2); if ((type == ICMP_TIMXCEED && code == ICMP_TIMXCEED_INTRANS) || type == ICMP_UNREACH) { u_char *inner; @@ -1459,7 +1460,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from, Printf("%2d: %8.8x\n", i, ntohl(*lp++)); } #endif - return(0); + return (0); } void @@ -1495,7 +1496,7 @@ udp_prep(struct outdata *outdata) outudp->uh_ulen = htons((u_short)protlen); outudp->uh_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)outudp, protlen, protlen); + u_short sum = p_cksum(outip, (u_short *)outudp, protlen, protlen); outudp->uh_sum = (sum) ? sum : 0xffff; } @@ -1521,7 +1522,7 @@ udplite_prep(struct outdata *outdata) outudp->uh_ulen = htons(8); outudp->uh_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)outudp, protlen, 8); + u_short sum = p_cksum(outip, (u_short *)outudp, protlen, 8); outudp->uh_sum = (sum) ? sum : 0xffff; } @@ -1551,7 +1552,7 @@ tcp_prep(struct outdata *outdata) tcp->th_sum = 0; if (doipcksum) - tcp->th_sum = p_cksum(outip, (u_short*)tcp, protlen, protlen); + tcp->th_sum = p_cksum(outip, (u_short *)tcp, protlen, protlen); } int @@ -1676,7 +1677,7 @@ gre_check(const u_char *data, int seq) { struct grehdr *const gre = (struct grehdr *) data; - return(ntohs(gre->proto) == port + return (ntohs(gre->proto) == port && ntohs(gre->callId) == ident + seq); } @@ -1694,7 +1695,7 @@ gen_check(const u_char *data, int seq) { u_int16_t *const ptr = (u_int16_t *) data; - return(ntohs(ptr[0]) == ident + return (ntohs(ptr[0]) == ident && ntohs(ptr[1]) == port + seq); } @@ -1720,7 +1721,7 @@ print(register u_char *buf, register int cc, register struct sockaddr_in *from) Printf(" %s (%s)", inetname(from->sin_addr), addr); if (verbose) - Printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); + Printf(" %d bytes to %s", cc, inet_ntoa(ip->ip_dst)); } /* @@ -1737,10 +1738,10 @@ p_cksum(struct ip *ip, u_short *data, int len, int cov) ipo.ih_src = ip->ip_src; ipo.ih_dst = ip->ip_dst; - sum[1] = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ - sum[0] = in_cksum(data, cov); /* payload data cksum */ + sum[1] = in_cksum((u_short *)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ + sum[0] = in_cksum(data, cov); /* payload data cksum */ - return ~in_cksum(sum, sizeof(sum)); + return (~in_cksum(sum, sizeof(sum))); } /* @@ -1782,7 +1783,7 @@ in_cksum(register u_short *addr, register int len) * CRC32C routine for the Stream Control Transmission Protocol */ -#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF]) +#define CRC32C(c, d) (c = (c >> 8) ^ crc_c[(c ^ (d)) & 0xFF]) static u_int32_t crc_c[256] = { 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, @@ -1863,11 +1864,11 @@ sctp_crc32c(const void *packet, u_int32_t len) CRC32C(crc32c, buf[i]); crc32c = ~crc32c; byte0 = crc32c & 0xff; - byte1 = (crc32c>>8) & 0xff; - byte2 = (crc32c>>16) & 0xff; - byte3 = (crc32c>>24) & 0xff; + byte1 = (crc32c >> 8) & 0xff; + byte2 = (crc32c >> 16) & 0xff; + byte3 = (crc32c >> 24) & 0xff; crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); - return htonl(crc32c); + return (htonl(crc32c)); } /* @@ -2052,7 +2053,7 @@ str2val(register const char *str, register const char *what, } else val = (int)strtol(str, &ep, 10); if (*ep != '\0') { - Fprintf(stderr, "%s: \"%s\" bad value for %s \n", + Fprintf(stderr, "%s: \"%s\" bad value for %s\n", prog, str, what); exit(1); } @@ -2095,7 +2096,7 @@ setproto(char *pname) pnum = str2val(optarg, "proto number", 1, 255); proto->num = pnum; } - return proto; + return (proto); } void From nobody Thu Jan 11 14:32:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFC3zrvz56806; Thu, 11 Jan 2024 14:32: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 4T9nFC2rZFz4SbS; Thu, 11 Jan 2024 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZowyPJ6pzHUiuNlrJyZjn9WYokRaJpIz1Qj5ROd1Ig=; b=EurCzrvjXFXkLXbnSPP2pEjnLSGzmyk5i/FS2S87UtPtC+6Dloh9iwN5RMUkFeUd6v1fS8 u9Xiewn4IfBiYZ78E97CuhX75byex0iuv9ZoVHEawWoDDfTJoOfbhMURPinbes8f+Gjl0M aP20TluWJKH5wgvXHyelASTDB1Kz+h2UfABKYcYlsHlnof9m/2ZGm8eODfZbvSATXHy6+I dJdoU04FEbV4pk1l5/CIqJpxxUW82vxUYeZ8ca+4aIZbdSx3tPN/Xlc3XRTY6qqy0dKIVh oBT+abOYvBHTrAyXOKkmSVFgcl0o7pDbnFFGIC4vuLVV++pSZ2x5Xn/fufct0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZowyPJ6pzHUiuNlrJyZjn9WYokRaJpIz1Qj5ROd1Ig=; b=bawGnMi4w81xmWuKXhUG7UqJIXTuPujTQNbNcGpDRJM64SGKpsSUBx9rCLVn/PduK6ICwr RULVKS5xsmCGNGXmccvG332V/TDIkD95bsVeaXU2pDV2Z766KCPKwe+SdmK4pNKuXSPeCd +j4cQuKucglyB2YZch1NJ18AZyjL1dDgLQLzsjYKwlVVkpk1DjUo6kcFfc39sokFyZxsJM PYLZicw3T4tffrfG0xI43+/qlogsaFMml00ods5R6zVde4JtXDbPgrsngWBI4OjFve0GvK X4PI2Jdp9Re/d3/ue/P2K8zhNj17LadX3NQ5vV3+oiszUk5oKHGTi8KrHWodhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983551; a=rsa-sha256; cv=none; b=J8QEdZKoIgaP+yq5qOwixmyUbl314tv4AoiX4mHiC+ibVzmycdMAbAxQILoKCCKOmgnj9Q d1kon+nu48E0A1HWjj6qxcudT+epeQVD8rDMVa8/XPzCYqSUFhLp03BNSjxQtbnqgpwY7x 8J1xx2o6QgnT1DZfyhQ1iDHIHsimbVqUq0klLE9Soy52QhW8nYjqiDDyGfqs1OISx/5OuZ 0BXzoIyiLLWCPmoAZodZvC5Pqgv7SnlrVbzOhzW/FJhvy4s+LlR0nddXraVOOIQO3o1c2L e0kbDAAty6OXhhX0gZoyGEHXc2cvgUmYRDBPZI+dxpmZrqnsdaeL1vmFRwc/Gg== 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 4T9nFC1yGRzMXF; Thu, 11 Jan 2024 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWVx0023998; Thu, 11 Jan 2024 14:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWV2T023995; Thu, 11 Jan 2024 14:32:31 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:31 GMT Message-Id: <202401111432.40BEWV2T023995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 675c24cd01f7 - stable/14 - x86: Make cpu_model[] public List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 675c24cd01f7a115806f17bb7b7ac6fd30d3872a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=675c24cd01f7a115806f17bb7b7ac6fd30d3872a commit 675c24cd01f7a115806f17bb7b7ac6fd30d3872a Author: Mark Johnston AuthorDate: 2024-01-04 13:24:04 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:05 +0000 x86: Make cpu_model[] public No functional change intended. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d63ea03674007451682334fa3897918c5c3711a4) --- sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 44314456d8bf..f3677d84570b 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -58,6 +58,7 @@ extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; +extern char cpu_model[]; extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 7b06ecab2ad5..7fa35bd50244 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -157,7 +157,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, "Machine class"); #endif -static char cpu_model[128]; +char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); From nobody Thu Jan 11 14:32:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFD50Nzz567YV; Thu, 11 Jan 2024 14: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 4T9nFD3Vb0z4Sbh; Thu, 11 Jan 2024 14:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u7sh9/Z7EHb8lZGQo58lH2yefVB4K+v3o+cc3vMVYU8=; b=BudzMHVKJivM4vCdn48NhUGENWDe5WLRkQdgK2i11SHDdRtP2sqA59w8iehK9Nq+Az0WKr /ULkRVRY/XTL4ZsCIEykxcPftf1a+hkDuXHcXK4sI6A7Cb00Cqo6fURpc/1uw5gK1R01O8 jfM+LNlUa6O4o96rW7eLJzEqTjOtoCwWVpARQaJ9PiwpYtjkEOdn4LPKADdiTYd8/OfbTB dtu/dWz0GuuS1yge3RhsqBT4hh3YL9+sRpzL8h7Qb9vrAEuG0TY3Yq85ilV1IsVyB1TFsS Z2TUWaD3mqLLXwQDngG2qEi4O/WO2gzo5/YN65rH+m75mdM2uvcmmZjbxuL8hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u7sh9/Z7EHb8lZGQo58lH2yefVB4K+v3o+cc3vMVYU8=; b=UjImIOspkTM7ohG7ZGG891SXRCEeHOZ3eBS6RC7aYJXgVuvplzqgFIzAlb2+EJOoxWjXdf /8tgrIZd411HV65kB59apVDwQYXBolOz0+h3YiqwwNdKcPE1e2/G9wdnoeeH6wiOn/vchy Y7bRGBbVm5znOT4bIYqiMzsQX0ZIfXlTPwNz3jftPDjs+vi1oV+tYgQTU1zB8COloXzW4u I2qvcRZ2KUbt8peo3cn1ncaWB3jf6W6VFN+y5u6BZ41kgFo3xsL1DPW0S+9KBqvTno6A4K appDYZst7OpsimdYn8ysibXfZO9dPKAoUt5Z69kc+DssF5DBNSSMoaYd3/EUgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983552; a=rsa-sha256; cv=none; b=nIRf9ZO2vfP7aOsXhfl9e3WbvWmcB9RX12f6w9eqZH85ixkFDtfsduPgbHZX/pMV+JqTPG RHaPAdXlfWHQ9ArJsflH7iVjbA0qpl8+hsQUTW6hHggNp0B5SRhTOslKVidDE42REfGp4m KgdSs8u+bp65C5rLhxRtreRUbw7z+x/3vQ31B9mhb32xAjx9JaU/Lo9/f9MmTlIGaqpB0g 2yYXsztQXR6VRRiHTxWyFmwYf7dsc4P2MkLk+cYnKn69cBVhv67Kj0FPCyzWUrAPsIkE/8 bGQ1TUW+DpYmm0z2W+OcCqDl5um7yNNraYkojhfU3NyK1vXbv7SSH7SFAQ0/LQ== 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 4T9nFD2cLbzMsw; Thu, 11 Jan 2024 14:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWWds024058; Thu, 11 Jan 2024 14:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWWQq024055; Thu, 11 Jan 2024 14:32:32 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:32 GMT Message-Id: <202401111432.40BEWWQq024055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b2dfbd772e88 - stable/14 - linprocfs: Avoid using a sysctl to get the CPU model string List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b2dfbd772e887d722da0aad1ea9c1ce14e65f47d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b2dfbd772e887d722da0aad1ea9c1ce14e65f47d commit b2dfbd772e887d722da0aad1ea9c1ce14e65f47d Author: Mark Johnston AuthorDate: 2024-01-04 13:25:05 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:07 +0000 linprocfs: Avoid using a sysctl to get the CPU model string This will fail if the reading process is in capability mode. Just copy the string directly. PR: 276043 Reviewed by: emaste, imp, kib Reported and tested by: Ricardo Branco MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d74a742704eb81f0c6f4aa83e4cb0de26a81c400) --- sys/compat/linprocfs/linprocfs.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 0e668b0edde6..5c60d4d8e713 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -201,10 +201,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) static int linprocfs_docpuinfo(PFS_FILL_ARGS) { - int hw_model[2]; - char model[128]; uint64_t freq; - size_t size; u_int cache_size[4]; u_int regs[4] = { 0 }; int fqmhz, fqkhz; @@ -304,12 +301,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "acc_power", }; - hw_model[0] = CTL_HW; - hw_model[1] = HW_MODEL; - model[0] = '\0'; - size = sizeof(model); - if (kernel_sysctl(td, hw_model, 2, &model, &size, 0, 0, 0, 0) != 0) - strcpy(model, "unknown"); #ifdef __i386__ switch (cpu_vendor_id) { case CPU_VENDOR_AMD: @@ -353,7 +344,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "cpuid level\t: %d\n" "wp\t\t: %s\n", i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), - CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING, + CPUID_TO_MODEL(cpu_id), cpu_model, cpu_id & CPUID_STEPPING, fqmhz, fqkhz, (cache_size[2] >> 16), 0, mp_ncpus, i, mp_ncpus, i, i, /*cpu_id & CPUID_LOCAL_APIC_ID ??*/ From nobody Thu Jan 11 14:32:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFF6CZvz567cc; Thu, 11 Jan 2024 14:32: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 4T9nFF4JMxz4SYZ; Thu, 11 Jan 2024 14:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HyqWhEJOhP/vsQhSje2AEs5MyO8/MjEwfMvArjcRWw=; b=yHRYThn68qZuPKARYd9lo+BY8P73iFyJczl+PIupZ6wrY9lxLgnmoAdtOWMpTECiJsSgWd fBMVUmFnrd/fY6FYjD7EGDC94XUw9EtmtaE3xdDSEXWtuzUZuLt77/hYYa7sUgEUSqxFLR cebulJMjisTDVlbarGPRI+INW7ns7AlmU5ryzs50P/Ng+8GEv/dfE91p9tdDtdqgFOC20k TVUI3B9lsMMuf38WHKNLLR0452o2XxnAGXdBl+dZ8IPx0WsG9hFXOy04NEBL1oc/CpEYJU dvBQgxmP4Y3WJgKXdXYYKrhn9oLXOpaorHszoNZqcXgBWZ/W7Y8HS3GhOjSdDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HyqWhEJOhP/vsQhSje2AEs5MyO8/MjEwfMvArjcRWw=; b=qAETwSeWCGBTknECn524eNtF6KmLFwTN0O611yb4qs8aEWJXVoSOKBSTPe6Kw25zJgNq5c qODpzgjaXEmExNKayLoA8TQUn/FwDxVbUf1T3nQ5rl9cxSvMI6Hz7KY1iMtFHrYv0zoeqi e1Fb8babRFZJovmkC7wa9821wAuFQ/nDcusnQxlCZM8qE8hdsyzYqdukUyhebgYSILAIDt aYQfZmLEOAj792mH6S9wUWgk98Q8v23PhUa7yREFc8Yqd4YCH1pbzllPYnzta2+kXoCe/j Vq8Q0A9JjP5tGRRK+uVaARh4Hcvea0uWXc67uSeaPPk1DZJwBnCatLbK5QEJCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983553; a=rsa-sha256; cv=none; b=ui5OeiBwO9qdF63CbeamyBvrUFyuYPlz2skZZ+J+GUJ9yooyy2iNO3S2yrusJco/BBO2ck wnn5Azq5Nq7aw9YvKQ6Oeqq1xHzWcSKvfZ0vt0xmQ4kDbJlmPTk0IHwQQUnsu11yCbpWGe nxPQFgQY3cRHzm5yC/3jRJAr2QejvwPQag7VD5zxW0bOckNrC1VUCDPjQMfnm2MlVrjWzg m7/vUWUzpN78nyW/z7+wEJsvpdiMwQnU+aMKkIcRyYGDp4JuBLai4UUw41kHIhXyqSjkeU 9Gk2O8n8MftaViM84Dm1JcspcAkxfrrh98brHoaxT4ZiacRQs+aQS3KcseQY/Q== 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 4T9nFF3PXzzMdr; Thu, 11 Jan 2024 14:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWX0D024112; Thu, 11 Jan 2024 14:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWXjb024109; Thu, 11 Jan 2024 14:32:33 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:33 GMT Message-Id: <202401111432.40BEWXjb024109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e24406084951 - stable/14 - identcpu: Let the hw.model be readable in capability mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e24406084951373757e55687377b08c08b21a488 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e24406084951373757e55687377b08c08b21a488 commit e24406084951373757e55687377b08c08b21a488 Author: Mark Johnston AuthorDate: 2024-01-04 13:26:53 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:08 +0000 identcpu: Let the hw.model be readable in capability mode On some platforms this static information can be derived directly from the CPU, and there doesn't seem much use in restricting it. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit 0aba5dd2af57ea3ae90eb49d7745c4c5b6f0ab6b) --- sys/arm/arm/identcpu-v6.c | 2 +- sys/arm64/arm64/identcpu.c | 2 +- sys/powerpc/powerpc/cpu.c | 2 +- sys/x86/x86/identcpu.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index 1302d24daf02..6293a5ccaceb 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -56,7 +56,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, "Machine class"); static char cpu_model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, sizeof(cpu_model), "Machine model"); static char hw_buf[81]; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index fced2ffab258..698a98e3da1d 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -107,7 +107,7 @@ SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | "Machine class"); static char cpu_model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, sizeof(cpu_model), "Machine model"); #define MAX_CACHES 8 /* Maximum number of caches supported diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index 518623af9de4..19907e3973e7 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -239,7 +239,7 @@ static void cpu_6xx_print_cacheinfo(u_int, uint16_t); static int cpu_feature_bit(SYSCTL_HANDLER_ARGS); static char model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, model, 0, ""); static const struct cputab *cput; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 7fa35bd50244..3163053a123f 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -158,7 +158,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, #endif char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); static int hw_clockrate; From nobody Thu Jan 11 14:32:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFG5rMsz567SZ; Thu, 11 Jan 2024 14: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 4T9nFG54jMz4T1c; Thu, 11 Jan 2024 14:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDR24IB4R5+qkMsxxXyOQ6sQBSMu/KS0d1KcU+F+mfo=; b=fV/Z17YXJLpciQCbu+HdW26ju8tNGtzCujR2S+DX20IYMh7G7f53c01/fSf931rMZEgcf1 1+NPAfyqCH5TutsY/1UPzLSQRWnWhc0SnXlKJcbNvoDpsLcmrQebCfpe3EmQPzt0g7IEBr 5o2kvCsumNrpGYs6kJB7f82GRUXUtV6ByYh8prr5tVW2lLOCu46sea7ii2L9hPrsJ+R/qH COrm/lyzgwc6lQVC/eVCAmewHJoWmE6JQHyBgutV2qIr0Ap8CqfEm6xMmJR4rhcrE1zfwm tHeHC4fvnZpIR/bOrpQaTU0dHwKQpgX6s25mz2H6ZwhTYwZ89n1xkNAUU/2Zzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDR24IB4R5+qkMsxxXyOQ6sQBSMu/KS0d1KcU+F+mfo=; b=EPLB3RwoAaToxU+NNP/vpb3JWWC3bLMM09ZjIDLwYJaH8GFzB8cEQo47VPFlNO5t9Bv77T YXIn0N7GZY5odRBFuTU/D1fnxQNniIgFokP0rqJQvPDgBuVFphWLJRtW3WhevHOw5cKL1E xjOy0KN9fVt86/WgYpakEahTr0w1hLyo+et3qIF2lefbdOQqK+olUqYJQzr9/6+uB8AlAr E6f9hvQz+78BYQmH65y4hYT3nVp0p19SCLra1dIJ7r9Dcoe2P/BAhvoDUWooXNi8T58bev 5n9qabmXFGdlHipzynDGuxDT3lQzRZO566qoQbp9gnPxTOVD6kIdLTKsXO2n2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983554; a=rsa-sha256; cv=none; b=ozD1/pJGHrIsV0Rjxnli5Ypl69hCUFj9dd8HamXxf/WwEDEveV9PFechWnv0tYG4sZbr43 96rR19zUsgfx4dIIBZnfSi7DVViXDgl469qF4Fdblr+vuMpkPBFtWlWey8D6bjJ8ulbh0Q ws+w9kTVIEaUxjPQJkbqD+Q8HRE52HlbGHqCxlnzpHMZU8MAAJfYfv1An+4XOz4b5pBXUa kPIHK9xYY9lfWS4o7/Sqsc22KlepNGEpZzMcpVHNY7dfiuUuXsoPfJU5Dm4QzxxQna9Vcz i/5NfyjsIJ+xSbpvbRmvmJsu3Vc8+nd96UGqnA6gqMem0KMRvlxqcfOhkxXAyQ== 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 4T9nFG49vdzMsy; Thu, 11 Jan 2024 14:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWYkA024164; Thu, 11 Jan 2024 14:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWY9x024161; Thu, 11 Jan 2024 14:32:34 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:34 GMT Message-Id: <202401111432.40BEWY9x024161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 095ea495b84e - stable/14 - sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRING List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 095ea495b84e09cca5f9b16cb12972377ab17149 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=095ea495b84e09cca5f9b16cb12972377ab17149 commit 095ea495b84e09cca5f9b16cb12972377ab17149 Author: Mark Johnston AuthorDate: 2024-01-04 13:33:05 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:09 +0000 sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRING It is redundant. No functional change intended. MFC after: 1 week (cherry picked from commit 969fc091343e593f15f0f3326f65292b435423d5) --- sys/kern/kern_mib.c | 16 ++++++++-------- sys/x86/x86/identcpu.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 6c19deab1d25..7d2a9e7f8474 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -94,20 +94,20 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Regression test MIB"); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, kern_ident, 0, "Kernel identifier"); -SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD|CTLFLAG_CAPRD, +SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, version, 0, "Kernel version"); -SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, compiler_version, 0, "Version of compiler used to compile kernel"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| - CTLFLAG_CAPRD, ostype, 0, "Operating system type"); +SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, + ostype, 0, "Operating system type"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD|CTLFLAG_CAPRD, char kernelname[MAXPATHLEN] = PATH_KERNEL; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, kernelname, sizeof kernelname, "Name of kernel file booted"); #ifdef COMPAT_FREEBSD12 @@ -458,7 +458,7 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, /* Actual kernel configuration options. */ extern char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, "Kernel configuration file"); #endif diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 3163053a123f..9c82f9f8a882 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -158,7 +158,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, #endif char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, 0, "Machine model"); static int hw_clockrate; @@ -168,7 +168,7 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, u_int hv_base; u_int hv_high; char hv_vendor[16]; -SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, "Hypervisor vendor"); static eventhandler_tag tsc_post_tag; From nobody Thu Jan 11 14:32:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFJ0jfSz567Sh; Thu, 11 Jan 2024 14:32: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 4T9nFH6HBqz4SxF; Thu, 11 Jan 2024 14:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njFua8jI9uL8XQwTazZrzlkxTWhXDduQIqzk+icaWjc=; b=wrR1JWZtTIH76NlVaf47OZc+iHES4t6xkJ/942sabJB4+CgBWu2sIr89neQRSmDfa8Ed/V KZqp4iVWNfsy2tx3wJoTklRsZlbr7LQVoXE1sifckz76e5ahphj7GWpstxLYkU84lalNmP yBrO2BP6xWCl8v8Cmrs0LPFIBhQGv8l0Gbd9X9CcBAXb7LUuNQZE4UhK5BnIgXnezAgUCg rdt38zLNsL46I5oZkyVpEiROka77cBtm99WrG5cY1z9UTLGUKNvRSo9ficYHgq2c6VDzvM qs3gWuED4GvT5bK0KgLKQc9/Ckeo5HA6o1p2cyJZUokLMRc/j3O112OlnUSBnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njFua8jI9uL8XQwTazZrzlkxTWhXDduQIqzk+icaWjc=; b=AIjEnYoTnlfwEYPELq2TCS9+yHVMqHM4hh3tuAk3vzrpmEXy/AP4VWhjxknNszS6v1WpL7 ZVup11bVi9I/zXDpNcYaz0tQTwAqd43VL2xug4y7R9RaQ4R2FNC+nloQzKgoVArs5IoPGL DTTaK8ZcRd7rT4jHAdn8SMe5SMfoD7vd/zD5Q21cW14VKi/rMxgQHtZUX+7eCuvNIDvYWF epwKdb1rk7m2dwT7j83vO/ZfDlczFX0oBmFnBh5SBG2g1lNNGGj33RzhMseW1ZMyUYNY+a oQmDoc5+pnoH8ncuiwc4axZ4NvKIowmnTd6e62ygvGwxLtuibucWjVmAXcN5Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983555; a=rsa-sha256; cv=none; b=kniCVrqX87qKMrom1WjDTesFQ+FtEqI4p9FrFLixD+eeI8+rmWrYZKvR3Kk4k9G5Rc5PCy h+8Y+5vApgEwvNho3g+CALT5IQSxt0HhGsazSIoqFlDTO65J9lJjQEo7NO+PW8/2iIjZuO XpUBI4tsJB0wSrcsFUo/8Jl9ch1VqLIYEJqO8OvcdZNfwzJHJr2N3DEmdsSycJMflFHbhJ cKcsod063YyancGPkg/Cf2gPgXhrmTkRgloIDAu1UOlODZ6RWCHVCx6371XJHvESbQaV7q rljggiLq6opvs/IKLj+sJvzzn38qJVtFTvUjCZ7xWvJXjLdHpsoDa02SyDjaLw== 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 4T9nFH5NGdzMvj; Thu, 11 Jan 2024 14:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWZkk024220; Thu, 11 Jan 2024 14:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWZ6Y024217; Thu, 11 Jan 2024 14:32:35 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:35 GMT Message-Id: <202401111432.40BEWZ6Y024217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b8233245b8d0 - stable/14 - stats: Check for errors from copyout() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b8233245b8d04816d13ea0c4441c0ded57323840 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b8233245b8d04816d13ea0c4441c0ded57323840 commit b8233245b8d04816d13ea0c4441c0ded57323840 Author: Mark Johnston AuthorDate: 2024-01-04 13:33:58 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:19 +0000 stats: Check for errors from copyout() This is in preparation for annotating copyin() and related functions with __result_use_check. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43179 (cherry picked from commit a0993376ec5f979272a62b140ec9f41bc02107b3) --- sys/kern/subr_stats.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_stats.c b/sys/kern/subr_stats.c index 0e7d2fad5f68..6a9dff2b9126 100644 --- a/sys/kern/subr_stats.c +++ b/sys/kern/subr_stats.c @@ -1108,13 +1108,19 @@ stats_v1_blob_clone(struct statsblobv1 **dst, size_t dstmaxsz, */ #ifdef _KERNEL if (flags & SB_CLONE_USRDSTNOFAULT) - copyout_nofault(src, *dst, + error = copyout_nofault(src, *dst, offsetof(struct statsblob, maxsz)); else if (flags & SB_CLONE_USRDST) - copyout(src, *dst, offsetof(struct statsblob, maxsz)); + error = copyout(src, *dst, + offsetof(struct statsblob, maxsz)); else #endif memcpy(*dst, src, offsetof(struct statsblob, maxsz)); +#ifdef _KERNEL + if (error != 0) + goto out; +#endif + if (dstmaxsz >= src->cursz) { postcurszlen = src->cursz - @@ -1126,14 +1132,18 @@ stats_v1_blob_clone(struct statsblobv1 **dst, size_t dstmaxsz, } #ifdef _KERNEL if (flags & SB_CLONE_USRDSTNOFAULT) - copyout_nofault(&(src->cursz), &((*dst)->cursz), + error = copyout_nofault(&(src->cursz), &((*dst)->cursz), postcurszlen); else if (flags & SB_CLONE_USRDST) - copyout(&(src->cursz), &((*dst)->cursz), postcurszlen); + error = copyout(&(src->cursz), &((*dst)->cursz), + postcurszlen); else #endif memcpy(&((*dst)->cursz), &(src->cursz), postcurszlen); } +#ifdef _KERNEL +out: +#endif return (error); } From nobody Thu Jan 11 14:32:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFK1YTHz5680D; Thu, 11 Jan 2024 14:32: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 4T9nFJ6shRz4Sfl; Thu, 11 Jan 2024 14:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mX8VnOWwmB6fAAKpqpw7/jHNkmEP4aDLRRIWA2NharY=; b=ErA0F/ZS4CHRZ5AiSxMB0Ce/z+hpKxRv5B1bCkc3m6o+Vtbzmha4jyYlweiUvgGeYsvDZH Ulmaofm1xBaiCZQqbjXB5WC3E/uFf9lLRacnoqGfZnDPvWy2kedEFRyK5uY/xxq2KGAetD lumxpju22p2bHNwq+bNGEIQrEhDRvPDZUkz6L+lG9MzDL6PQkv68VJaoKKhaUI4yFdwIIM aNSkZ5Cjh/P3BqukvVlVDiSXYjfxKSV6y4RBEkb0KfULs3CM7uXtp90v4wRV5y83g0oEZ5 yH0yZlLk2nQZU36/Ua21YxFwCYm1BjdHgnFiXSybbEYoYqiJy/VWpCZqz8IrRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mX8VnOWwmB6fAAKpqpw7/jHNkmEP4aDLRRIWA2NharY=; b=Ckteiys/dud9s4EM3sbLLxt0W44nn+ZmyHJZvlKJUhXl5ilzuyKwtkgnyWU3fkZ42vA4c8 KRUp8yD//ek9RqA2sYsmRUpGmMStNGv5VOoJXAb0cvPxCYgbum3r1ELOn+pKpljaxBYvgT N0KRE6/u7ELHe1V7MavPjbCIejPDkaw8O1aX4sNjMY4mZ3bccbOQB2DXFTXFf8BVqw/s4y VJXi0VPdqr5haOpj8dxrRtaSIY5cYebQ/Wd8PzGspYcadhiI4X9N42LtVLQOaYb09hqulg tba4uktnOgDmSb3gtG5/py87Htw2NXiYe5hIzqwcw65w4QkOD1j9BSq7qBVjfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983557; a=rsa-sha256; cv=none; b=taa7n/KRDTm62FovVLKnXmwF6mjwMf6Vj+YtPpFOwvYWU7RPSYidrHmGEAK2pJ+tcl3X2c WAqu5LZQU1q/6e5k/aOiygF46zqX1wU53B80dN2Im/wpP/Y05bCQ3UEO6qFdv6mEOqi5uG PCwHhPtkENmsiJZCx3XTBZiMNi6/xbMbm6MGYK7Qc9eoNV9n7D5fkJQFceLqKyPHNraBnD ahTRKRLyH10IUiwVWA1LW7zByDBsO7QZWGQMboOnNPWXDT77TeqOBV3mw4sobpwFXtz9L4 dzvJCUM/MRCprzhIZBg9osakprGX9cdyYPi4lepIRrBAyiqJv+IHJisGEzwwUA== 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 4T9nFJ5zKnzMvk; Thu, 11 Jan 2024 14:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWaXG024256; Thu, 11 Jan 2024 14:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWa24024253; Thu, 11 Jan 2024 14:32:36 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:36 GMT Message-Id: <202401111432.40BEWa24024253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 208e68be1fae - stable/14 - vfs: Simplify vrefact() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 208e68be1faed42ede97431476b33fc88cfd2429 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=208e68be1faed42ede97431476b33fc88cfd2429 commit 208e68be1faed42ede97431476b33fc88cfd2429 Author: Mark Johnston AuthorDate: 2024-01-04 13:11:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:45 +0000 vfs: Simplify vrefact() refcount_acquire() returns the old value, just use that. No functional change intended. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43255 (cherry picked from commit 27f4eda3ddce4009a0ec9be68f474fe3be38933f) --- sys/kern/vfs_subr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0fe2bc46446c..811c5cef45d1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3360,14 +3360,11 @@ vref(struct vnode *vp) void vrefact(struct vnode *vp) { + int old __diagused; CTR2(KTR_VFS, "%s: vp %p", __func__, vp); -#ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_usecount, 1); + old = refcount_acquire(&vp->v_usecount); VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old)); -#else - refcount_acquire(&vp->v_usecount); -#endif } void From nobody Thu Jan 11 14:32:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFL1WJnz567hw; Thu, 11 Jan 2024 14:32: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 4T9nFL0MWTz4T77; Thu, 11 Jan 2024 14:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3lY5J1/EZYsPi2aMmVrvuGU0fxUJcFA4X9T+hdvlU2I=; b=pYqrfBzt4dwsHlNVCSZ9pTe6S2pqqDQ2A3Z8sGbWequ0Lgf7Z6CklnK+tNsJFUNwy3nL8w tU7hwpznEENE2EOAMNNsST4voiwX8WQi4fwBHi1X2IgDrwcxFI+AC0wQLo7JW06T8TnCO4 GaUwSdjxH5kTWeB2R+jIRHFj6ZsE2Kgy5zYuD6rMQxLFV2hLJCRp5IVDLvvN/DvdMUKRmX xYYffaowdw88cZjcjSMuxh/oUDXb8Cy7S3GLbRMfjjcEyhyiBGkpWeV0EsWy+H2QMgpdIH 4bGpFM7CI8Bj1KA4xvRVwRz7uEOr25yTWI7rgsCZlzrDVFtOC4CIxjMYf9h/Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3lY5J1/EZYsPi2aMmVrvuGU0fxUJcFA4X9T+hdvlU2I=; b=G0cy4Tacl7dsqiVhvg9bTl7fVz0awQX4PUklLVEYYJYLSDvENopWf+o0cyg/RAKzrxWLg/ WtImqOdRSyPWN1MCeMmDaFU+Djh0hs2TZ1zb2aqhn2xeKaMGRM9uwInGE74C51aZGZkxnq AIcyHidgpKmur7sZ2jzLLDjMQLXXpTssXf7ogxmQUUNKbDkD4BOlQwCFMRO+2YxBkpvDEj R9mMGoLsocxiCGeslpGSWyPYybETCeSGqGFbXQ5eGZvmzJY94/Qnfvqi05KqbXaxgRTbUd KlUpXjkxjfLIeeFE59DsTHUwkG99nCg5f2dY/LBwuxYS5ddChRcmYivhEZ7Y+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983558; a=rsa-sha256; cv=none; b=rJrYyqQyfz0g+QkjrMDANu5KgJ/RiIqDtKUW3kMHsMDgNLqDnwDlgae0MtYzOpoosOCbBQ 0vOK3HfrlA8noS4UIR4It42l9dI+8nWEfPWe6I6rIcTve6SGy6aXkDL8uetd7BQQNGbZgE B1dPgL7EJVJtVPLNJ5sHQvs1ZQQuCn9PGI1FokZeHA6oM4L48vO9rLE/8lj0Mt5aAl7p7k OVGrTK3LyBCy36Ft/QcHcPxGD8OODl1Dn5oKcHsYjav+PHZ9UoJGV7uudKhqYO76+KAto7 SdGgjenxITnK7SC2gG2mtoG42uQcOcIuK/j+qIqwwgIdk3SPzMEWptZ3Xcef+Q== 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 4T9nFK6SpwzMrJ; Thu, 11 Jan 2024 14:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWbil024317; Thu, 11 Jan 2024 14:32:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWbAg024314; Thu, 11 Jan 2024 14:32:37 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:37 GMT Message-Id: <202401111432.40BEWbAg024314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c2b07a75af21 - stable/14 - file: Remove the fd parameter to fgetvp_lookup() and fgetvp_lookup_smr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c2b07a75af217f11a96de83c31649e4cf567a9d9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c2b07a75af217f11a96de83c31649e4cf567a9d9 commit c2b07a75af217f11a96de83c31649e4cf567a9d9 Author: Mark Johnston AuthorDate: 2024-01-04 13:11:54 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:46 +0000 file: Remove the fd parameter to fgetvp_lookup() and fgetvp_lookup_smr() The fd is always obtained from nameidata, so just fetch it from there instead. No functional change intended. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43257 (cherry picked from commit 55edc40e0c7543c6ea08a28d828bcbf0c8b5dad9) --- sys/kern/kern_descrip.c | 10 +++++++--- sys/kern/vfs_cache.c | 2 +- sys/kern/vfs_lookup.c | 2 +- sys/sys/file.h | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 6ed824e229d6..fe6928e421db 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2964,7 +2964,7 @@ fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, #ifdef CAPABILITIES int -fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) { const struct filedescent *fde; const struct fdescenttbl *fdt; @@ -2974,9 +2974,11 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear const cap_rights_t *haverights; cap_rights_t rights; seqc_t seq; + int fd; VFS_SMR_ASSERT_ENTERED(); + fd = ndp->ni_dirfd; rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); @@ -3030,15 +3032,17 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear } #else int -fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) { const struct fdescenttbl *fdt; struct filedesc *fdp; struct file *fp; struct vnode *vp; + int fd; VFS_SMR_ASSERT_ENTERED(); + fd = ndp->ni_dirfd; fdp = curproc->p_fd; fdt = fdp->fd_files; if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) @@ -3066,7 +3070,7 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear #endif int -fgetvp_lookup(int fd, struct nameidata *ndp, struct vnode **vpp) +fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) { struct thread *td; struct file *fp; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 8917666950c1..e3ab80f94482 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4422,7 +4422,7 @@ cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) ndp = fpl->ndp; cnp = fpl->cnp; - error = fgetvp_lookup_smr(ndp->ni_dirfd, ndp, vpp, &fsearch); + error = fgetvp_lookup_smr(ndp, vpp, &fsearch); if (__predict_false(error != 0)) { return (cache_fpl_aborted(fpl)); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 922adda33b94..6c83746eaf8b 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -360,7 +360,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (cnp->cn_flags & AUDITVNODE2) AUDIT_ARG_ATFD2(ndp->ni_dirfd); - error = fgetvp_lookup(ndp->ni_dirfd, ndp, dpp); + error = fgetvp_lookup(ndp, dpp); } if (error == 0 && (*dpp)->v_type != VDIR && (cnp->cn_pnbuf[0] != '\0' || diff --git a/sys/sys/file.h b/sys/sys/file.h index 214e8a31c969..dcc739e2e9de 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -291,8 +291,8 @@ int fgetvp_read(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch); -int fgetvp_lookup(int fd, struct nameidata *ndp, struct vnode **vpp); +int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch); +int fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp); static __inline __result_use_check bool fhold(struct file *fp) From nobody Thu Jan 11 14:32:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFM4phTz5680H; Thu, 11 Jan 2024 14:32: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 4T9nFM1XXSz4T7K; Thu, 11 Jan 2024 14:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4mass2c0fCDrjxjqVzVLrOxaR97g3YljGYV4Dq1pFtk=; b=oMfiK412bhx81sREvffY7XpZmDKyWaXhtjwY3L87JBrIUDzKutMf4AIr6QeliMl65TxIBv 8c5CV6WOgrvjQY4oa0mi8r9UOfTuKqFraIkL3dkqfiOmvbaVRk416xgDHSk6P+lIlx34TO fcLRLqHeL+noA4An6pK51Hg73zUMDzXAjtzwgzknzJHcYosoQBqiv+jw6sgyS7NUIkTGa6 FworjLGUn3hKhHo1gbQnoRrW6F1Bw1Urp44CEVX1isAUT8sniHtFkcz67uqUKln0GUrmkc wOgpX48hVD8m6vVKg1ybbu9jTW/lN8NIucY7uB037AckWngaaVMRj+mxf5WtXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4mass2c0fCDrjxjqVzVLrOxaR97g3YljGYV4Dq1pFtk=; b=fiDs0UzixLQDWzDsgSAEtohSCJgBA3RAIcMAaofEExh5joBKY8iP2qwNhGF2glwO2Pu6td HjFGn9nTzr5RS3xy6Th1HB5K/QeXci3eCc57KMXdAymcPWQhSx7jujTE/Um7ySQuDxXtQG 051vcoKKUtdXwLhG3u7K4BB0oTWeWE4uE72GGgqXrRi39FkpXmQdKjSuTG+/RuwY5IWYQQ 8TUPSB/PUPWTEcgA3u68+svAQ8XvRKLRoiysUufOYWebboj79MWyxA8nImwrUb2hwfzIW6 kGvSoJH9fLjQ9ZoXv0VJ742QyXxwlXMTXQScFlRTKNj2jZXC1bBm0S8TrbFSlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983559; a=rsa-sha256; cv=none; b=GMJDjAOVcBiYh1q1aBg8s1pwxXRIBRAGLCoQHhcKwVRvRwCrbwm4SJizbPKco6XL8bnLAP FHti6uInbscPiENgrN9UhoD1KgAR13mJC5UNoBi3b6fDCJoSK1BVqTBsOx/eT+YIv3lMRQ xwXoxgJliZIOM9IYeEOw2wyze8LgWJPeSUnj7Hz+voLzLPyiIm5VpKfMxaxf4YtncIfUZY iSNDAbgYRDysdysTE1/p08vAAkV6ZgccB4ba7X8/63oScjgoGsBOhAhchYzettbFFuQtbu eMxIZAGyn0HkZ/i59k5VAIsG/xRFoTYFU7vISCDypJShi6Cv1tXojIEwf1FhZA== 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 4T9nFM0ZHczMvl; Thu, 11 Jan 2024 14:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWcCu024362; Thu, 11 Jan 2024 14:32:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWcm6024359; Thu, 11 Jan 2024 14:32:38 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:38 GMT Message-Id: <202401111432.40BEWcm6024359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e4db787bb86b - stable/14 - frag6: Add another use of frag6_rmqueue() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e4db787bb86b2d7b26ed241df47e6ea03dded2ef Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e4db787bb86b2d7b26ed241df47e6ea03dded2ef commit e4db787bb86b2d7b26ed241df47e6ea03dded2ef Author: Mark Johnston AuthorDate: 2024-01-04 13:11:19 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:22:14 +0000 frag6: Add another use of frag6_rmqueue() No functional change intended. Reviewed by: kp, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43256 (cherry picked from commit 8d01ecd8e9da5192a8b2dfb6c7d58b4aae9ea358) --- sys/netinet6/frag6.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index fbdbc3ef2f28..e976298bf984 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -862,10 +862,6 @@ postinsert: ip6->ip6_flow |= htonl(IPTOS_ECN_CE << 20); nxt = q6->ip6q_nxt; - TAILQ_REMOVE(head, q6, ip6q_tq); - V_ip6qb[bucket].count--; - atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); - ip6_deletefraghdr(m, offset, M_NOWAIT); /* Set nxt(-hdr field value) to the original value. */ @@ -874,10 +870,9 @@ postinsert: #ifdef MAC mac_ip6q_reassemble(q6, m); - mac_ip6q_destroy(q6); #endif - free(q6, M_FRAG6); - atomic_subtract_int(&V_frag6_nfragpackets, 1); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); + frag6_rmqueue(q6, bucket); if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ From nobody Thu Jan 11 14:32:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFN4fD1z567Yr; Thu, 11 Jan 2024 14:32: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 4T9nFN2dmJz4T0G; Thu, 11 Jan 2024 14:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zN8LDzqlfImy595NP3sOcehoM9MfqIVFaoup4z5fO5A=; b=RVPEKfD8Bf3Sj/zw3hKwZy26Q3ju8/NIMoIFl/4iqmgFpgt52aXggNc0+1+yVVrjZmua0H ZO91J0rcPtQBVI72gjn4zJ/lHZpDZNTl/PB37+1+q41grZn4dkM7pC5F+apwHjRlRqRtWB bXLOd73OuhSjtHZYtI2lCjGP7pJ3nFEay4YJMIshkCUiRSbeiqxWvsPcqk1gtEB4o8oD82 AddZWugw3W53QGyUC1/q+OHkLSnassjZDF8ryjLQq6u7KZmN3D/ryNGS2u62oFBSVcftSb t/wz+SLn/uHGo8Pw+59pJbwDMdISucFwSRHgdB6pVst16IMxXjM6TgYlAWjFoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zN8LDzqlfImy595NP3sOcehoM9MfqIVFaoup4z5fO5A=; b=HnzSjHE70E802IbYfsl6TXO1T5oUwi081zXpsZIcdhES63N9NkQoJjjCKsFcPToPNisUDZ CyGeAnWZLEsw8iO7jxPr13c05Wm81lCi6iOxZ3N2fPDmFazl99QVolzNEa7OxdY0zzhrKg o+W9xTcF+UaVjSixbTinuPdSpN10sSonRcFBl8HEaPs6mCuBQhj3xF7gID7fzMQm2pU8hC VaVhLWSyWDRxfvpusMFC7whB2oeVEMc4DGOzUSS+bpkijnQg54F5EENNUnlhB3yxe2pXc2 UUmlUkpE4/B36BD4/jkWCcIzzfihblDI7+KwQ9Q6LpBvFQh6ZATMi/I/4r5HmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983560; a=rsa-sha256; cv=none; b=Dv7od9ECpGkydkmt3ao53GHEg+QavgKuoHIGIJMZI6jJKSEe+0NUcrhI+XS+TiiSkW9VgF sD2HZmfdU5B6O4rRSNSdidt9ZY1PJ3jFAJTzYt7NkFX9I20cy2G9pB8UZOPpVLmRmSvN9X tjAUh1uOzRUH6JW59GiWF/yhy6mJueJXp77t0O8vFB1C7CcOJxFcTNegZLcexEnCw2kUWo N0ilK6cpALsnbiAS/l6RuCZVzOXvWu3wXoVuLJ8kd/y6EoDXq9Rnmn0vHEvBG9bLv+6lOi 0asW9K3MukZ5w0Zai1rXMrfhKP5jXkgnxJ5It8TbrXr10sbJVN/FaRosNQ8Xlg== 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 4T9nFN1d9PzMpy; Thu, 11 Jan 2024 14:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWeDk024407; Thu, 11 Jan 2024 14:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWe7x024404; Thu, 11 Jan 2024 14:32:40 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:40 GMT Message-Id: <202401111432.40BEWe7x024404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 758c5b5c02d0 - stable/14 - cam: Let cam_periph_unmapmem() return an error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 758c5b5c02d0a50f00032a2cda533f5590fb47a7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=758c5b5c02d0a50f00032a2cda533f5590fb47a7 commit 758c5b5c02d0a50f00032a2cda533f5590fb47a7 Author: Mark Johnston AuthorDate: 2023-12-28 17:08:04 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:22:37 +0000 cam: Let cam_periph_unmapmem() return an error As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail if the copyout() operation fails. However, this failure was never signaled to upper layers. In practice it is unlikely to occur since cap_periph_mapmem() would most likely fail in such circumstances anyway, but an error is nonetheless possible. However, some code reading revealed a few paths where the return value of cam_periph_mapmem() is not checked, and this is definitely a bug. Add error checking there and let cam_periph_unmapmem() return errors from copyout(). Reviewed by: dab, mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43201 (cherry picked from commit d068ea16e3264c2d62472a8acf794262cfe703dd) --- sys/cam/cam_compat.c | 21 +++++++++++++-------- sys/cam/cam_periph.c | 21 +++++++++++++-------- sys/cam/cam_periph.h | 2 +- sys/cam/cam_xpt.c | 4 +--- sys/cam/nvme/nvme_da.c | 5 +++-- sys/cam/scsi/scsi_pass.c | 4 ++-- sys/cam/scsi/scsi_sg.c | 6 ++++-- sys/cam/scsi/scsi_target.c | 29 ++++++++++++++++++++--------- 8 files changed, 57 insertions(+), 35 deletions(-) diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c index c377763fc7c5..aed3916267d5 100644 --- a/sys/cam/cam_compat.c +++ b/sys/cam/cam_compat.c @@ -380,11 +380,13 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) struct dev_match_result *dm; struct dev_match_result_0x18 *dm18; struct cam_periph_map_info mapinfo; - int i; + int error, i; /* Remap the CCB into kernel address space */ bzero(&mapinfo, sizeof(mapinfo)); - cam_periph_mapmem(ccb, &mapinfo, maxphys); + error = cam_periph_mapmem(ccb, &mapinfo, maxphys); + if (error != 0) + return (error); dm = ccb->cdm.matches; /* Translate in-place: old fields are smaller */ @@ -432,21 +434,22 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) } } - cam_periph_unmapmem(ccb, &mapinfo); - - return (0); + return (cam_periph_unmapmem(ccb, &mapinfo)); } static int cam_compat_handle_0x19(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp) { + struct cam_periph_map_info mapinfo; union ccb *ccb = (union ccb *)addr; - struct cam_periph_map_info mapinfo; + int error; if (cmd == CAMIOCOMMAND && ccb->ccb_h.func_code == XPT_DEV_MATCH) { bzero(&mapinfo, sizeof(mapinfo)); - cam_periph_mapmem(ccb, &mapinfo, maxphys); + error = cam_periph_mapmem(ccb, &mapinfo, maxphys); + if (error != 0) + return (error); for (int i = 0; i < ccb->cdm.num_patterns; i++) { struct dev_match_pattern *p = &ccb->cdm.patterns[i]; @@ -460,7 +463,9 @@ cam_compat_handle_0x19(struct cdev *dev, u_long cmd, caddr_t addr, int flag, p->pattern.periph_pattern.flags == 0x01f) p->pattern.periph_pattern.flags = PERIPH_MATCH_ANY; } - cam_periph_unmapmem(ccb, &mapinfo); + error = cam_periph_unmapmem(ccb, &mapinfo); + if (error != 0) + return (error); } return ((cbfnp)(dev, cmd, addr, flag, td)); } diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index ebdda9ef449f..af187d3eab51 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1014,17 +1014,17 @@ fail: * Unmap memory segments mapped into kernel virtual address space by * cam_periph_mapmem(). */ -void +int cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) { - int numbufs, i; + int error, numbufs, i; uint8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; uint32_t lengths[CAM_PERIPH_MAXMAPS]; uint32_t dirs[CAM_PERIPH_MAXMAPS]; if (mapinfo->num_bufs_used <= 0) { /* nothing to free and the process wasn't held. */ - return; + return (0); } switch (ccb->ccb_h.func_code) { @@ -1089,12 +1089,11 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) numbufs = 1; break; default: - /* allow ourselves to be swapped once again */ - PRELE(curproc); - return; - break; /* NOTREACHED */ + numbufs = 0; + break; } + error = 0; for (i = 0; i < numbufs; i++) { if (mapinfo->bp[i]) { /* unmap the buffer */ @@ -1104,8 +1103,12 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) uma_zfree(pbuf_zone, mapinfo->bp[i]); } else { if (dirs[i] != CAM_DIR_OUT) { - copyout(*data_ptrs[i], mapinfo->orig[i], + int error1; + + error1 = copyout(*data_ptrs[i], mapinfo->orig[i], lengths[i]); + if (error == 0) + error = error1; } free(*data_ptrs[i], M_CAMPERIPH); } @@ -1116,6 +1119,8 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) /* allow ourselves to be swapped once again */ PRELE(curproc); + + return (error); } int diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h index d0f04388b181..ad18ee6b204c 100644 --- a/sys/cam/cam_periph.h +++ b/sys/cam/cam_periph.h @@ -180,7 +180,7 @@ void cam_periph_invalidate(struct cam_periph *periph); int cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo, u_int maxmap); -void cam_periph_unmapmem(union ccb *ccb, +int cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo); union ccb *cam_periph_getccb(struct cam_periph *periph, uint32_t priority); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 26e656fc5ff2..6eac81c18160 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -566,11 +566,9 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * /* * Map the buffers back into user space. */ - cam_periph_unmapmem(inccb, &mapinfo); + error = cam_periph_unmapmem(inccb, &mapinfo); inccb->ccb_h.path = old_path; - - error = 0; break; } default: diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index e8e75a121679..9901ecccf21c 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -438,8 +438,9 @@ ndaioctl(struct disk *dp, u_long cmd, void *data, int fflag, * Tear down mapping and return status. */ cam_periph_unlock(periph); - cam_periph_unmapmem(ccb, &mapinfo); - error = cam_ccb_success(ccb) ? 0 : EIO; + error = cam_periph_unmapmem(ccb, &mapinfo); + if (!cam_ccb_success(ccb)) + error = EIO; out: cam_periph_lock(periph); xpt_release_ccb(ccb); diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index cf27c304d919..ff48bed30e68 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -2237,14 +2237,14 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb) } cam_periph_unlock(periph); - cam_periph_unmapmem(ccb, &mapinfo); + error = cam_periph_unmapmem(ccb, &mapinfo); cam_periph_lock(periph); ccb->ccb_h.cbfcnp = NULL; ccb->ccb_h.periph_priv = inccb->ccb_h.periph_priv; bcopy(ccb, inccb, sizeof(union ccb)); - return(0); + return (error); } /* diff --git a/sys/cam/scsi/scsi_sg.c b/sys/cam/scsi/scsi_sg.c index b17a156503a2..66ea4b4aa2d7 100644 --- a/sys/cam/scsi/scsi_sg.c +++ b/sys/cam/scsi/scsi_sg.c @@ -883,7 +883,7 @@ sgsendccb(struct cam_periph *periph, union ccb *ccb) { struct sg_softc *softc; struct cam_periph_map_info mapinfo; - int error; + int error, error1; softc = periph->softc; bzero(&mapinfo, sizeof(mapinfo)); @@ -908,7 +908,9 @@ sgsendccb(struct cam_periph *periph, union ccb *ccb) softc->device_stats); cam_periph_unlock(periph); - cam_periph_unmapmem(ccb, &mapinfo); + error1 = cam_periph_unmapmem(ccb, &mapinfo); + if (error == 0) + error = error1; cam_periph_lock(periph); return (error); diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 45a5eb8415b9..6b2fd5adb4ee 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -906,18 +906,29 @@ targreturnccb(struct targ_softc *softc, union ccb *ccb) u_ccbh = &descr->user_ccb->ccb_h; /* Copy out the central portion of the ccb_hdr */ - copyout(&ccb->ccb_h.retry_count, &u_ccbh->retry_count, - offsetof(struct ccb_hdr, periph_priv) - - offsetof(struct ccb_hdr, retry_count)); + error = copyout(&ccb->ccb_h.retry_count, &u_ccbh->retry_count, + offsetof(struct ccb_hdr, periph_priv) - + offsetof(struct ccb_hdr, retry_count)); + if (error != 0) { + xpt_print(softc->path, + "targreturnccb - CCB header copyout failed (%d)\n", error); + } /* Copy out the rest of the ccb (after the ccb_hdr) */ ccb_len = targccblen(ccb->ccb_h.func_code) - sizeof(struct ccb_hdr); - if (descr->mapinfo.num_bufs_used != 0) - cam_periph_unmapmem(ccb, &descr->mapinfo); - error = copyout(&ccb->ccb_h + 1, u_ccbh + 1, ccb_len); - if (error != 0) { - xpt_print(softc->path, - "targreturnccb - CCB copyout failed (%d)\n", error); + if (descr->mapinfo.num_bufs_used != 0) { + int error1; + + error1 = cam_periph_unmapmem(ccb, &descr->mapinfo); + if (error == 0) + error = error1; + } + if (error == 0) { + error = copyout(&ccb->ccb_h + 1, u_ccbh + 1, ccb_len); + if (error != 0) { + xpt_print(softc->path, + "targreturnccb - CCB copyout failed (%d)\n", error); + } } /* Free CCB or send back to devq. */ targfreeccb(softc, ccb); From nobody Thu Jan 11 14:32:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nFP5ctmz567mw; Thu, 11 Jan 2024 14:32: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 4T9nFP3YJ4z4T7l; Thu, 11 Jan 2024 14:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFGW/jHclVO0Nt7T3uHiShlf6am8BLQrtDOxn/YaKRw=; b=EHLorSwPWuYGCVK7I5CL7Zpcp5RaPD4q3SS4mcdCHpDX2NiiZHQmiECcU2osA1DuGOJgYb mYmL+cFxJ2B07KudvFUAmx2l27EGNoRfsdu2JB9U9CGt9zKpuw7CFTI9wxyCj5AsKrpcxl WNAnEB3lau9fub+ObZAPMTm7lmVEUcsRxViClss/dE1dnbJF444w5XLfIXtPrBcggcPhKU eqdieIUtCZ+rjxfe0dhoFQJjQytWd01VqdRR/6rtmELPV4ETAqGJzQrop2V+T/XkWJ/Yr3 IQNZvFptkdWrMdvkTAANzPw9r5OfDXCay06JjIlsTjUOLDB9MH8EAxrOxCWAzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFGW/jHclVO0Nt7T3uHiShlf6am8BLQrtDOxn/YaKRw=; b=CoIZN2RQAWDEXzIq9MsMTwCoglbyGLud8577+36JkgInqAZWUDkx2FBoB7ox/hrCFRYTGm 2D5I9EBrq0JvWTtRbFMu+fyYdXRk8Pq/teVtMwbRQauF3tn6s1gd+5we0+S1aG9tFreBxB YiI4/xh/RuMSZDsguD8kpN/ljupJwXfIpEEOFv0ePer3yPMkByjSTgcm3kulaa+MdfzHEA 0VsEJqw2mLc+/3kDC36ClPVo88sB1xZMEhJuxsVetZzatbuL7JshNv1rW4p/jUI0hqFfvs ip5KtfqoIBwYzZO2SO6P0PuLsDEHH2PNp4XKmW9QWnQsK9jc3DkZqGVCrFc1fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983561; a=rsa-sha256; cv=none; b=nDOyK2oNki3jjZXunyi8PhovpkJfbQB/nvZC6FD5XUxd3sJ4RjepqYq4JL+yaUqM92zrEQ khYi9A+sEnY1Bl8aKQIU4wN6Z3c2msWL/a+2uSCBNtjzujzxVNHcAw/NUf9ZksXZ0Zli9i XiLFvo9xi/QEy+cO8L5Nbu1GoIRH1L0kZJcHPXvId1ChMviNB6HacysMDXq2kPatm7gk73 PgB/VOl9srP1c9ytEmUOJAbOXTfbp1vIAtoa58X2yZDGOufggh+m0Sb+dh/K6B7l4Mkegf 4ssOrQmCpEzQpOB3uO14B5ZGKVFQZNc1+PtYD3qB1g15S0D4hIpi5FYmSjObFA== 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 4T9nFP2dPPzN63; Thu, 11 Jan 2024 14:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWf2j024455; Thu, 11 Jan 2024 14:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWf21024452; Thu, 11 Jan 2024 14:32:41 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:41 GMT Message-Id: <202401111432.40BEWf21024452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 185634d86d96 - stable/14 - targ: Handle errors from suword() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 185634d86d96b836336862d80e4e454c91e3ad99 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=185634d86d96b836336862d80e4e454c91e3ad99 commit 185634d86d96b836336862d80e4e454c91e3ad99 Author: Mark Johnston AuthorDate: 2024-01-04 13:34:31 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:26:53 +0000 targ: Handle errors from suword() In targstart() we are already handling an error and have no go way to signal the failure to upper layers, so ignore the return value of suword() there. This is in preparation for annotating copyin() and related functions with __result_use_check. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43202 (cherry picked from commit 904cd456f0f95c10fdb4c99a0118f30d23242dec) --- sys/cam/scsi/scsi_target.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 6b2fd5adb4ee..6872e3a2a93b 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -635,8 +635,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb) xpt_print(periph->path, "targsendccb failed, err %d\n", error); xpt_release_ccb(start_ccb); - suword(&descr->user_ccb->ccb_h.status, - CAM_REQ_CMP_ERR); + (void)suword(&descr->user_ccb->ccb_h.status, + CAM_REQ_CMP_ERR); TAILQ_INSERT_TAIL(&softc->abort_queue, descr, tqe); notify_user(softc); } @@ -868,7 +868,10 @@ targread(struct cdev *dev, struct uio *uio, int ioflag) CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targread aborted descr %p (%p)\n", user_descr, user_ccb)); - suword(&user_ccb->ccb_h.status, CAM_REQ_ABORTED); + if (suword(&user_ccb->ccb_h.status, CAM_REQ_ABORTED) != 0) { + error = EFAULT; + goto read_fail; + } cam_periph_unlock(softc->periph); error = uiomove((caddr_t)&user_ccb, sizeof(user_ccb), uio); cam_periph_lock(softc->periph); From nobody Thu Jan 11 14:35:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJQ6nSXz568GB; Thu, 11 Jan 2024 14:35:18 +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 4T9nJQ6Jlxz4XWd; Thu, 11 Jan 2024 14:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B8b10SkBubsHMamN2dKcIKKyRA3PvZt10Ff3X0ST/N8=; b=Ar4EmQlh2pGS64vhl9QS8JiJ9EnZ5ZFHXW8jF8yRbZB9/NRLmMnvhnQCfAvcS5qvUm41VS GrRxDbYoYLzcon/U1U5fPQGgtsCBlD2xYyilsPrwfvgXU4A2yEx2fSI2rWvXmtRc63GHSS V3oWkUgDsmAJ6E1GJwB0Lk8P1jesco6rBQ/2dY8bCfaGq9CW4tknUCaQSNFJMjKHtRbsD9 Dc/Rr9ww2o7DNNIq8HEMe0Xp3DsDDqJhs45L7EqrVGkG7LLc4lT2jDAQVvm1RuAyJVf3Zg 8y9H0XZuRsianOKDfe8uvMhqVM0jsa79OmOUk4F++f4I7Gb9E+icxisq5oN1Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B8b10SkBubsHMamN2dKcIKKyRA3PvZt10Ff3X0ST/N8=; b=pwNjFJzz4RZYuzwV6/ZR7PuWffoTgrYNOIHGdwCXQym8afLMurQMm1Vf6YQIvcyNmyO3tc 8cz+sr4BD0X6iQsDrZ4CC/g/ZF/bL6X1HPLPmC2hBhRSqLvy63bqK5sWZrhlxSBw2g7iRk chJ3QfmqpHq/F/24CGQYCklHVz5AUY50iLl1GT6cx/Aq3B4WY7KBqcHDJ+b2Pnwn5ZHPp6 xRyL6NZ8f3TEo1rdEbsmqPUl3BuJqgHoUQ4y4nCMWPBd8JLCOmA4lylloeadNSG3lZejuL 8uzb8IzYqEOtdz1+URd5o5JKZfb8EuLu4Pwmy26fkK5R9NdZWQcIryTL6unFdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983718; a=rsa-sha256; cv=none; b=G4udsxMMFe0Z82pfhSQ7c+IYtmlTLxHEEwsCJtAuKPBuPKCgJiUlyxugd7ZqBX4iasTa6n lXVzcsbxOab0dCfdwQ/zZ0Xl6OeQCyyQypiFsI1JHLPGcGpfp/XmIXii6yqIA8bbupwmrr ntkgSA6bfbuptN/mq5q1hDpqYRGapJiPiL3Ek+VMGFVkJbgDlNAwqhOXagjmf3URyP5fAG 5HKKOTzXWguzFZd6Ij4ZYOKllLraVHLlP8WHGpDK98oY2tAdCzhm783uQF86j3tabxg2Bi HbOHww1K6wbENqf9/5xFzCyMMysWzsCu11E3bgPfckjS+BoPJFk660OP56E8GQ== 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 4T9nJQ5MPSzMrL; Thu, 11 Jan 2024 14:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZIYa025081; Thu, 11 Jan 2024 14:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZIH9025078; Thu, 11 Jan 2024 14:35:18 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:18 GMT Message-Id: <202401111435.40BEZIH9025078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 668e777b0a24 - stable/13 - setfib.2: Consistently capitalize "FIB" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 668e777b0a246b47c64274de118f0dfe59611173 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=668e777b0a246b47c64274de118f0dfe59611173 commit 668e777b0a246b47c64274de118f0dfe59611173 Author: Mark Johnston AuthorDate: 2024-01-03 20:19:41 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:05 +0000 setfib.2: Consistently capitalize "FIB" MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit ee7d5ba1b55441476643983d3f70df5ee9ea97c4) --- lib/libc/sys/setfib.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/setfib.2 b/lib/libc/sys/setfib.2 index efbb7bf171ae..32e2f64910cb 100644 --- a/lib/libc/sys/setfib.2 +++ b/lib/libc/sys/setfib.2 @@ -37,7 +37,7 @@ .Sh DESCRIPTION The .Fn setfib -system call sets the associated fib for all sockets opened +system call sets the associated FIB (routing table) for all sockets opened subsequent to the call, to be that of the argument .Fa fib . The @@ -69,9 +69,9 @@ packet header, however it is not suggested that one use such a large number as memory is allocated for every FIB regardless of whether it is used, and there are places where all FIBs are iterated over. .Pp -The default fib of the process will be applied to all protocol families -that support multiple fibs, and ignored by those that do not. -The default fib for a process may be overridden for a socket with the use +The default FIB of the process will be applied to all protocol families +that support multiple FIBs, and ignored by those that do not. +The default FIB for a process may be overridden for a socket with the use of the .Dv SO_SETFIB socket option. From nobody Thu Jan 11 14:35:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJS15pkz568JN; Thu, 11 Jan 2024 14:35: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 4T9nJS0SNRz4XWj; Thu, 11 Jan 2024 14:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y6cYgqHSXHo8arXk+4HLZFlNzbhRxDU9i9yB8Vv79aE=; b=rVP9PQye6BPKqZ3gW2Cx7t4Bp+qOo1TX0VUhwgOUdBhQj1Dqi1/Mx/3WzlOyb6qkAKtG5G nCvJz9ApWcRAtAHYMTczROTiky0XdLADQxmLiJ6sp4tWzbaHRAG6PQgYS9ptECFXsdyWvk h2v3v/8b1rfu7jx/fr9qvXz0rVu/d/xnJ0AhxjG/CR9BjmNhJCCKnvaHG2/gfxKnuZXEA0 HP0wXKCVyL3WhO9R7+mQC4vlpBsDBxRotGcnMLOo21LMbAVaofL5bPoLM4lJVzZ+tdd3Vm dM0JF8Oi9mL85MLs7cHKJI/GojPKUNIwQR/UgO8SIz7n6Do7OsP/Gnr82V0dVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y6cYgqHSXHo8arXk+4HLZFlNzbhRxDU9i9yB8Vv79aE=; b=b1zy3DoVKwIqZuaCQEqbBFtyf3uctBH5ZBlRhuLlUowP/mPB91zICrAiIUFySyBVmYgGmj tY2fN9pc9TKt9l8IaAYCFWQgjDAie/bWyr2XEFeZfp/h1K0nthuVBov3dO0I4o7TepNjXk xwuwQd6tcYb1u+gVq8gulPUvTus+UqPA10/8oUE84rKz6HWGSiQuWC32FrYcoOUV3TDz/6 AyGRwOnjzBKXQhJXgFRoO/M36qaZomtYx6/V+OeqEo+XjEc4zvHytNN/35AkwK8mCGzqpJ hSOalSQqGs3vo4EN3dpZQq4uUWfkVkziEMRbYNDut/UI9Pp80QRR0FTqDEaivw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983720; a=rsa-sha256; cv=none; b=YRT5ie86bh7Eaf1pVj0JWAyvMk9Cx5iXquUHlnpXzBQkKKicLu1yfkSrkt5qG5Egur8mBq aUEzhiHlWEArA4JwwNnRIAbsn3iTkZrJTvcYkjG9iaXJwTknbRTR8un47LkSZbfzDbMSCY cbsukUzMW1IQqL/GskU0f1715g4aIbm16h6BCjUerJ/cocpOjansdanB1sk5NbUWGaZ0PQ iOihI/zIc82SxPfzYKPW0i4UF7cN1FUQopq+ESs7EQnZWS/cZho+iFECPRiL6cwsHQLY2n bnMF7hBzs29onjDsCyyUpfvi9HOXI3r0CbETQhFZZooXKK7m1SEaPf/UvGXI6g== 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 4T9nJR6bkhzMXJ; Thu, 11 Jan 2024 14:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZJ22025128; Thu, 11 Jan 2024 14:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZJZ4025125; Thu, 11 Jan 2024 14:35:19 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:19 GMT Message-Id: <202401111435.40BEZJZ4025125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c0563fd5fc32 - stable/13 - netinet: Define IPv6 ECN mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c0563fd5fc322bc9948c5402cb28641fec53931c Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c0563fd5fc322bc9948c5402cb28641fec53931c commit c0563fd5fc322bc9948c5402cb28641fec53931c Author: Jose Luis Duran AuthorDate: 2023-10-28 02:50:18 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:05 +0000 netinet: Define IPv6 ECN mask Define a mask for the code point used for ECN in the Traffic Class field (2 bits) of an IPv6 header. BE: 0 0 3 0 0 0 0 0 Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Traffic Class | Flow Label | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | For BE (Big Endian), or network-byte order, this corresponds to 0x00300000. For Little Endian, it corresponds to 0x00003000. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit b0e13f785b336670bdf39b83a78435b00d00f43c) --- sys/netinet/ip6.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index faa6fc290ca1..37d2c1777c32 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -97,10 +97,12 @@ struct ip6_hdr { #if BYTE_ORDER == BIG_ENDIAN #define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ +#define IPV6_ECN_MASK 0x00300000 /* ECN code point (2 bits) */ #else #if BYTE_ORDER == LITTLE_ENDIAN #define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ +#define IPV6_ECN_MASK 0x00003000 /* ECN code point (2 bits) */ #endif /* LITTLE_ENDIAN */ #endif #define IPV6_FLOWLABEL_LEN 20 From nobody Thu Jan 11 14:35:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJT3ZfXz568GG; Thu, 11 Jan 2024 14:35: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 4T9nJT1Wpyz4XJT; Thu, 11 Jan 2024 14:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cT38KGsbiH1qS2l+4fwHrjbgGowEI2VMGE7NRwRwDnc=; b=jqOi9zlC72UpnKzCxAOP42Avyp4BMg866d/4lTF7XyWaVhc1EMKVpCGR0+NEsXWrjZB2bF +kP+O5xnSWXV+5HcpI0vRWu98+xmoSv31KLPIU+7uRLh2PfHyJ2iaZyHRHYlzrGFLmGNq3 G8odCijykod4X96sw2qZmIcH20ZRX++/fkJCvKd4FAf0FhcSpJ5Iim4Hgpb4oHaQd/j851 o8UofWVILem9ya0qMnbSJaIok5JlwKIGiktDLivSm5yR/KXxs2spgA1JaP3NjUmqsbzebz m1A+GOLDA4CFaHjibD5UPDQAbLYn0kaZC92v+NWW/ezwlpNlT22DK4C9Wn4xAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cT38KGsbiH1qS2l+4fwHrjbgGowEI2VMGE7NRwRwDnc=; b=G070cjc64uglW6114V/yUnvg0BObdwQMgqyGqOiQnztBznhWhZAMf/TUbHlEn5SVNt83EL HcfF3a9FZNvgBjpmBa8acZ3R7xO7xoEJKXmEIY78FnEetIucxbioJrTsfhqv7/cXFzroQ7 yzcexg0c3V5evry0bCmBeg3iEgZqOPwWjJ1AWXWcRr74mkcMo/TmHsGTWiU9TzcwYmo/y+ MQpxtAvPsEpf/iKWkUDHgu0e0t7lRgxvaaetyPmuNbmOVs8Fbr3r3d2uiG5/I65ICGZGnZ 8S5sXReQRRUSmRHZIQ/D+HBf4/KlDQs7j9n7W5vlTQCslltjwjRYuPuTlOD72w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983721; a=rsa-sha256; cv=none; b=LMjMxCMGuaLhjzbwH0FAcOkHZgD7RNjZQflso1FlEjQwQGhNy6zZkrGY9HCU9Y7WNLE9X2 l/uO11BkiCP1DNEeCFr9ekHVVgoVDTB1zs0Xpmbpv5qMc2T8ZbKZvXcpQoaYxDvnc60eTe Nt2/MHdvtrJNyqFgd1IUPU1I4r9GHtha56St1fgG4UzUjAQc5kATwlIwfP23JVKVHfBKlq k2ITgdtyYZ8ZqU/u76zRo3cS02h1na3fvRMzgyMgfjV5zWHjgZfKUeNPp6PeYBGbjmqSUb 9Vbp778irs8e+spSGoI3/ICwA+JNUuZyreqg3DmltOzV6qWoRjC6eC4uq6zXSg== 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 4T9nJT0SP1zMdt; Thu, 11 Jan 2024 14:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZKnK025169; Thu, 11 Jan 2024 14:35:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZKUh025166; Thu, 11 Jan 2024 14:35:20 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:20 GMT Message-Id: <202401111435.40BEZKUh025166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d5063a91ce0d - stable/13 - x86: Make cpu_model[] public List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d5063a91ce0d830a2a86228b0a73c39afb53d899 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d5063a91ce0d830a2a86228b0a73c39afb53d899 commit d5063a91ce0d830a2a86228b0a73c39afb53d899 Author: Mark Johnston AuthorDate: 2024-01-04 13:24:04 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:12 +0000 x86: Make cpu_model[] public No functional change intended. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d63ea03674007451682334fa3897918c5c3711a4) --- sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index c938d96372d8..ed585c33e8a8 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -58,6 +58,7 @@ extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; +extern char cpu_model[]; extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index ca057a5c1b77..6a51c48ab604 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -157,7 +157,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); #endif -static char cpu_model[128]; +char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); From nobody Thu Jan 11 14:35:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJV4Rkcz568GL; Thu, 11 Jan 2024 14:35: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 4T9nJV3BKMz4XTj; Thu, 11 Jan 2024 14:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVyuePKJ5c863FgjweH7zHl2Yj7jFKIXS3ypNTvyou4=; b=REfcqTsAOBtjy4ivpE6mU6Fmd8a3ZZg9nQsHymtWiA+UBRUPwUFvW977hWKvbwcW5An56J J37iGDliFvfWDerEJpPOId72CMx5u1DWm1ql5A5hccsfmtfnANS0WysRnb/4seWzw7N29T PVWHIrQyWjth4qchT24MdPB84ae2ruK3rvH3V+Qf7k6KQ0spOl2qP+vB6/yt9pwSvtHvSb Q0NrU+J58Ln6WzR5QnoSqsHIvPb6S7V9rNOtyMPMyfv/ypDj1wUf+uIa1j657gE8gJOHOR 5m7tQSiwdTy4JdSCWQWPxX/vfc764+28sUs7Nh+OINr8rjIGqaTOYGdDhLGx0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVyuePKJ5c863FgjweH7zHl2Yj7jFKIXS3ypNTvyou4=; b=leROcoHZWpLO64NZyEOApWVsupU36YooWVT4xFd+dNCgT1KlyhH11TAF6QkavsAbFvcSZC 64Fvkc6T5MK2XWlq5FhWgaaLMmnsZ1fNysilSYe9DLZCp+u+zaeIeRdZXLZ5mWVudFkGjs IT6ozUWYD1vWm7jzXnGpqyLTpyZq9P482fpRj8WHa4bWuY4r0bnqH8I9CewSV+VosxwDL5 t3pXNgm1PtgH05Nq0QRvU6X6tOhRYb3qsMNMSHkyDC84tF34iq1h/UbwnG8JfOPy3eRtgZ qCKdbqELiwK1VSCYJKnQRMFpOz6g9iSKkfCrW+1B8oIzes5Ezhqr4OC7Gyi6tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983722; a=rsa-sha256; cv=none; b=QyYEu1nJGw39QvH3PNcLz2YHGZ+wFkJGuE02os2/DkYJvVRhqaHp5j0eaxSYBrO2Y7NXgq 2hiJAIUQ7E5OK73EDEDZcWZ1G71qe8rvUYkkFVek7RB5/AODLB89cGS8gwgUxkUoP2KLvG HYvkQ/Qp8pkqHYK5S9F2Vs41zYV7j0OTUxf+QB/Zl8RzRxCDDnPyRuhfMId2v8B1qnjViC FQYXJ4kUIsuVd6fxLfc9Y+cFdc0lrqrw/gl0GDCB11Dgyx+fBOjBrRqakmtloVSL7CLbj+ NKkhc0MzGws6IQvDRP9Ac31OM4N3MeibiOTbgYReWnBenhO0Hq2ekyHHlICSGA== 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 4T9nJV1XN3zMXK; Thu, 11 Jan 2024 14:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZMnS025234; Thu, 11 Jan 2024 14:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZMBM025231; Thu, 11 Jan 2024 14:35:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:22 GMT Message-Id: <202401111435.40BEZMBM025231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e3212b779ae2 - stable/13 - linprocfs: Avoid using a sysctl to get the CPU model string List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e3212b779ae2938428e087ac05c52e484cf2a6c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e3212b779ae2938428e087ac05c52e484cf2a6c2 commit e3212b779ae2938428e087ac05c52e484cf2a6c2 Author: Mark Johnston AuthorDate: 2024-01-04 13:25:05 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:15 +0000 linprocfs: Avoid using a sysctl to get the CPU model string This will fail if the reading process is in capability mode. Just copy the string directly. PR: 276043 Reviewed by: emaste, imp, kib Reported and tested by: Ricardo Branco MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d74a742704eb81f0c6f4aa83e4cb0de26a81c400) --- sys/compat/linprocfs/linprocfs.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 3608a800dc9c..f8bbb0d8fbfc 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -202,10 +202,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) static int linprocfs_docpuinfo(PFS_FILL_ARGS) { - int hw_model[2]; - char model[128]; uint64_t freq; - size_t size; u_int cache_size[4]; u_int regs[4] = { 0 }; int fqmhz, fqkhz; @@ -305,12 +302,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "acc_power", }; - hw_model[0] = CTL_HW; - hw_model[1] = HW_MODEL; - model[0] = '\0'; - size = sizeof(model); - if (kernel_sysctl(td, hw_model, 2, &model, &size, 0, 0, 0, 0) != 0) - strcpy(model, "unknown"); #ifdef __i386__ switch (cpu_vendor_id) { case CPU_VENDOR_AMD: @@ -354,7 +345,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "cpuid level\t: %d\n" "wp\t\t: %s\n", i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), - CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING, + CPUID_TO_MODEL(cpu_id), cpu_model, cpu_id & CPUID_STEPPING, fqmhz, fqkhz, (cache_size[2] >> 16), 0, mp_ncpus, i, mp_ncpus, i, i, /*cpu_id & CPUID_LOCAL_APIC_ID ??*/ From nobody Thu Jan 11 14:35:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJW556Hz568R2; Thu, 11 Jan 2024 14:35: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 4T9nJW3X0lz4XPG; Thu, 11 Jan 2024 14:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JnzHPzycgU63aZvCh7KHtOSeJMDM3Q+v36KjBdvCT9I=; b=tiqso8GVpfqfxyY6m66OvlTe3RFiGqL6Tsoebb5pQc4a2m68SXoZSqBxeNCkRbPKfnn0hO lN7EAYD6GCCoUE1eYxQoqhCutNA74k8S8VATijSguVd2cvNx6A9zcy9WN9mWlHfkvbQFDk m/zAf9tGOxm3qF6nsukEJp5GqYnJ0bKUIouz7jbNwAoMV1ubRVylkVzx+kQH0JTNx4xicK A3q8ZrKNZ0KcIOM3dTiOKLYKBwCXZAD5KzHzQKCbbnWBbF0F5ACPrPQdAaMi6E5t7BnscQ gJzKcjKXzECX+rb7f8nzKCAepsnZtM0yIsx0g8L7dsrtPMfgL4BH83hk3FY78A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JnzHPzycgU63aZvCh7KHtOSeJMDM3Q+v36KjBdvCT9I=; b=QEMkhgnN8x9NyynSPTo2V7mNlmcAllXXCxN4B/mCna+TytbbQ1+tYDp7yeLPrbqre1JEX2 XzhJy+oSCLgko1ePAj4UCi3pufndXvRvX6PEY/vWL/SROzcEdZvOJF+ZaVPj5Bq8ooEgXS eB2xKoM5lzDGTVnoQjranKcKqNmbmLLZ3o/ifIT9K5TjwKbqzvLKDjy+WacAaJU+4Vd3Is 9SwaExU8xPtyFxnaY1zfgbjJAdx3GqNd9d/xjw0G6AUwCzYp75uG0kMmXjO1Q5fRpNj6a8 879SXu4L4D51x9nSwoQLwHsWwIt+ti46CpaVv2wT/nWAPEGXiTiFXGSSAx2r6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983723; a=rsa-sha256; cv=none; b=DN3lInT5SlOOymL0vEupoLlOHV9hzW++/lkHyJa9/+3sGUW++xTuS82J6/SCXWSOqRUh56 G0rVjeIiwgUCodXmSU+8OTPY4ontsdIdyn+9SMXN5Sle81A2/OEsCFzSHTOlvWYJ/Qd1xJ 9cPIfEDjk2bnXnOF1RD0f6/uk6YGcjdMssSzfzQnEneArrrnLYjsHQUNp/+IQ98wgz07E9 n+40HYJWsO5LTFz/7tI5z1Ye0kuMNsc6gZQUQTYM5gcAfENgNrZGuXipKzf1kK7DHc40H0 kX/Y61l8fxqiWNXW7Snd0Hp4ik76C1QblDmaK/giw35tntI8zeKR0wCzs6SyuA== 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 4T9nJW2ZPwzMq1; Thu, 11 Jan 2024 14:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZN0m025288; Thu, 11 Jan 2024 14:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZNTS025285; Thu, 11 Jan 2024 14:35:23 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:23 GMT Message-Id: <202401111435.40BEZNTS025285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 337b2a037299 - stable/13 - identcpu: Let the hw.model be readable in capability mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 337b2a037299915af419723fc57d7d6d46bd5e1e Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=337b2a037299915af419723fc57d7d6d46bd5e1e commit 337b2a037299915af419723fc57d7d6d46bd5e1e Author: Mark Johnston AuthorDate: 2024-01-04 13:26:53 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:16 +0000 identcpu: Let the hw.model be readable in capability mode On some platforms this static information can be derived directly from the CPU, and there doesn't seem much use in restricting it. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit 0aba5dd2af57ea3ae90eb49d7745c4c5b6f0ab6b) --- sys/arm/arm/identcpu-v6.c | 2 +- sys/arm64/arm64/identcpu.c | 2 +- sys/powerpc/powerpc/cpu.c | 2 +- sys/x86/x86/identcpu.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index 5e52645d39af..baae9ac360ad 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -56,7 +56,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); static char cpu_model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, sizeof(cpu_model), "Machine model"); static char hw_buf[81]; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index c46747be1bd5..200841782f03 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -99,7 +99,7 @@ SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); static char cpu_model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, sizeof(cpu_model), "Machine model"); #define MAX_CACHES 8 /* Maximum number of caches supported diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index bf676b8e08e1..d450044780a9 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -239,7 +239,7 @@ static void cpu_6xx_print_cacheinfo(u_int, uint16_t); static int cpu_feature_bit(SYSCTL_HANDLER_ARGS); static char model[64]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, model, 0, ""); static const struct cputab *cput; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 6a51c48ab604..92a88ede5f79 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -158,7 +158,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, #endif char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); static int hw_clockrate; From nobody Thu Jan 11 14:35:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9nJY1KDfz568JT; Thu, 11 Jan 2024 14:35: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 4T9nJX4TWpz4XcV; Thu, 11 Jan 2024 14:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qYYXMoKX1oFXt/K+8jgrwU2v/T5+n1SjrC5ddAiEJ74=; b=Nbw9WQoW2D1JKw6XC2eXIpQP1q1guguCxhvkwB2cCvkXKX0kKsCZt4wrWJvYMxEF2BWvGw rDyPAqWYsnS+kTEacHC8NrD9D7LFYLXzzzAYk93teO1wdCXtuBHDVReljB0FcVa4eVkU+l +ix9F2kAhKtdElp6RlTRaeUW8ku2mTjT5mvwhzwX19WU1g6uJGaS2RrHX/OrebPeuScLH+ wqdcKU4W8vtg8dk9IW/FEgUT921bYAn+ov6xAtXjG5Vx1v94mAEXIM0KWGC5y1m0EISYgp wvxLA+hFwCx3PN3KobxKRBZZysh9hrUZwQ4UqIzmP6Sd9IrTJP8XDgolLbUjag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qYYXMoKX1oFXt/K+8jgrwU2v/T5+n1SjrC5ddAiEJ74=; b=Pcvrs5uh++kVHvxAoNZVrAcVlBeQ0Hhi8I/Wgv0Vo88tUJkd+XhvQ1pCCG7/scqi6bD/Hc bz3cQfep7d4p4lPi+elzbY5JyLGVTBNl7rE2YfFol/iC7FYBwJqxJjG5RdGNLcqWIRa60y B/qjpi3GZc/jrEkBkHacRnw5d6Waznwz/37A49KLEqANopBvVBBcBKT+9gP8Npnr+DQJF0 OtrZCOdtuksAeL6/+DQVyGjLgtiuZyEdpDDSacLz5aGqFy5DlWsskXOmz5W9CpBEQo/QYp qBPtzP2iKwWpqTfr2RvEYkyy2yTPJ0UD3gDwnJR4Dhyt0ShZGhud9pigYxiTeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983724; a=rsa-sha256; cv=none; b=Qkk+9+QJMkMirmXifK6k0IHwWmiUf/qQ7+tCb9nbTwfCzOfzBfDRO977GfFC8DZfyY9RtJ fFRsWjlnP7r8XsBWf8NhIQ+Z2brCuSGMEmaALuGc/rAVbYVQ0g/TFraDSGTRIqM2j3RdaA +81PWUcBZq6XzrUsycY/fmVQwylEDaGipxc6858/qRaYQJwA68UyGCY6RXbhaH/9VQU1mn rXET9siDMmMNL6pEpzXqDUvWXVVovv8LWjEBzfcs6cHdDWngDngYzzoB+V+4b1IYrQNxoh GNJbNbWVWvr0kFVMlzpDtIAyLQYu5/uFf9mI2bqOCNHSNAARm0wlIQXSdUPs2w== 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 4T9nJX3b5tzMrM; Thu, 11 Jan 2024 14:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEZOgN025334; Thu, 11 Jan 2024 14:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEZOle025331; Thu, 11 Jan 2024 14:35:24 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:35:24 GMT Message-Id: <202401111435.40BEZOle025331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a20522d9ae20 - stable/13 - sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRING List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a20522d9ae20610bd266c99dab75f58d7b3ee22b Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a20522d9ae20610bd266c99dab75f58d7b3ee22b commit a20522d9ae20610bd266c99dab75f58d7b3ee22b Author: Mark Johnston AuthorDate: 2024-01-04 13:33:05 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:33:17 +0000 sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRING It is redundant. No functional change intended. MFC after: 1 week (cherry picked from commit 969fc091343e593f15f0f3326f65292b435423d5) --- sys/kern/kern_mib.c | 16 ++++++++-------- sys/x86/x86/identcpu.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 37b7b46c87a2..c9056503925f 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -94,20 +94,20 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Regression test MIB"); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, kern_ident, 0, "Kernel identifier"); -SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD|CTLFLAG_CAPRD, +SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, version, 0, "Kernel version"); -SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, compiler_version, 0, "Version of compiler used to compile kernel"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| - CTLFLAG_CAPRD, ostype, 0, "Operating system type"); +SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, + ostype, 0, "Operating system type"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD|CTLFLAG_CAPRD, char kernelname[MAXPATHLEN] = PATH_KERNEL; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, kernelname, sizeof kernelname, "Name of kernel file booted"); #ifdef COMPAT_FREEBSD12 @@ -449,7 +449,7 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, /* Actual kernel configuration options. */ extern char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, "Kernel configuration file"); #endif diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 92a88ede5f79..1eb6bd6cac6f 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -158,7 +158,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, #endif char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, cpu_model, 0, "Machine model"); static int hw_clockrate; @@ -168,7 +168,7 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, u_int hv_base; u_int hv_high; char hv_vendor[16]; -SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, "Hypervisor vendor"); static eventhandler_tag tsc_post_tag; From nobody Fri Jan 12 12:01:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrL09FMz56h0Z; Fri, 12 Jan 2024 12:01: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 4TBKrK6r0Cz4ps7; Fri, 12 Jan 2024 12:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BELx2rBVsWj4CauK7HfsUXKj7N8pcX1qpJIMTyhllE4=; b=mpRmF9nO+Re513dg6oglrKcpChZV/QrAukckRNTvpZfoAPFNSicdoAGVkEf3vo96DndnXS fA9j5iJg9H+7pRdpWWfXJ/R1e3y3+6BicEwD0BHULmR7p5ShjknpCg3JrOFg2p9GKQb02Z gZcOvmirYyeBd8jnIFdf+kKlcpb3VhVb5fa0PXp9Iv5+YR6Okh6h/3WbLox+JvEu+At86P cHuTVaR27P8ljdbXDCxF/Vh/xXxApaMzX0gMVybb3IxZ6Wh2+G98NaaiMfVyb93ChnNMUz HZOj4MpaDo67yBtzVsUH+56zRjlVkRWCLI+OgUoHgMyBWPys3FNTSzhPZuhgtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BELx2rBVsWj4CauK7HfsUXKj7N8pcX1qpJIMTyhllE4=; b=DXxVYLiloTBVs3sXvr/l0UlR8ydJNJsH90Wt2IenMRQo1WzTEf+6V9MVvSImC20TlE/Fx5 4XCVb/xALiUbcfxPEaJRbFN8qn4CIx1S7/hRuKQIfDC7SDIncUU7dl3G1aRmjS+n38cQmq xeDzTwXDH6etp80jgHwRVOOLV0zm5TtX27PrX1kRAnkBo6tIpANDq7QbcrSpz3W3vfBOxp fUcMWweIpTcBvf8P6B0IG/ZHS4bEUZKE+mutFt3JyjMd9SOWcst85Ts95ZneKlIyl66nbR Fyket8n3xe6UwkkW9cnH1I4it0hhtIC9ABdXlAPujrqylXpiBfS8AUuxYksvXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060882; a=rsa-sha256; cv=none; b=GydUlj129/dr/c2mHd0FhksG8m/FtVTLND2U9dpRH98dP6Mf3xmf31MdBkwDzvSR4JYl5d H7RzqMsbHtYrNozyuRS46NW7amkSr6o2HyZ/bHgpPB8kk60ROlZIOL99qDf9dwmhIWCa1y KevKlMr8WnVw72O7FcNAys5xYIKQ6PkABZK5kdku1FNfrp+Pg/R0ONw2UzQDJOXXzjCGuQ YGRtY9kmm5OGR2P+2GSKujEJe1eo+0VuuMZbBDjrPAibm2oN6xnrK3u2mp17dZNlhbfdLU L58umhLgxZayzlIpE86yQzXk2wHZeumrEOS5eYJOyQ/qR86hbvtd8LC4Q+A7nQ== 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 4TBKrK5thhz11Nt; Fri, 12 Jan 2024 12:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1L3q000457; Fri, 12 Jan 2024 12:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1LC3000454; Fri, 12 Jan 2024 12:01:21 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:21 GMT Message-Id: <202401121201.40CC1LC3000454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a76475313d65 - stable/14 - mlx5(4): only detach IOV children if iov was successfully initialized List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a76475313d6580cb36eb940d5730407d832246de Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a76475313d6580cb36eb940d5730407d832246de commit a76475313d6580cb36eb940d5730407d832246de Author: Konstantin Belousov AuthorDate: 2023-12-29 03:14:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:52 +0000 mlx5(4): only detach IOV children if iov was successfully initialized (cherry picked from commit 987446fa39e8f6887ea16ad49f00f699b2efd210) --- sys/dev/mlx5/driver.h | 2 ++ sys/dev/mlx5/mlx5_core/mlx5_main.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 9daa1235bd9c..6ebe4171a503 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -736,6 +736,8 @@ struct mlx5_core_dev { bool dump_copyout; struct mtx dump_lock; + bool iov_pf; + struct sysctl_ctx_list sysctl_ctx; int msix_eqvec; int pwr_status; diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index f6dc1158f085..6b9b63a24714 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1719,7 +1719,9 @@ static int init_one(struct pci_dev *pdev, pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); - if (err != 0) { + if (err == 0) { + dev->iov_pf = true; + } else { device_printf(bsddev, "Failed to initialize SR-IOV support, error %d\n", err); @@ -1753,8 +1755,11 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; #ifdef PCI_IOV - pci_iov_detach(pdev->dev.bsddev); - mlx5_eswitch_disable_sriov(priv->eswitch); + if (dev->iov_pf) { + pci_iov_detach(pdev->dev.bsddev); + mlx5_eswitch_disable_sriov(priv->eswitch); + dev->iov_pf = false; + } #endif if (mlx5_unload_one(dev, priv, true)) { From nobody Fri Jan 12 12:01:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrM1504z56h5g; Fri, 12 Jan 2024 12:01: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 4TBKrM0Mljz4q40; Fri, 12 Jan 2024 12:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8h86lgD0uzx5VnzQ8GI3JlAIkgalMmuQQx0bqlyOKPI=; b=XSfw8gJXAZuGdGEZoPQ3Nfyv5v0d83abs6oQ4GHwKMzV/RKdpOfyGP0Osuykn2/Sqwhu/l 1Fwac9peESey3j33VFPJRn2g+Hnc9dqK1J4lRTQWN9etqrpUt3YiLrwK1Yzaxcb47BNrYm 2ViS1AGfEkOGdqKyRstFnoLXreRTKVwm1r6k1I2l61IJZ2t4hv1a4nbvtFRFW1VuXahum0 /NiXtSww8iAdREKI6Q/wv1b3o4zWGwpsmnNW7w1jO5vs5cfbH9b1DgHaGnuGgCAGsdDnUs LrE9hcdxnoNCtnxrU4/aLopKa+a5HMAL6NI6tAZxRu+TcBbDFJxmsPla3OnDmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8h86lgD0uzx5VnzQ8GI3JlAIkgalMmuQQx0bqlyOKPI=; b=HwQtiLcSavGm8gWEhCWHps+WUxmoPITVB9V543NwFYqQCEE6T6xvhQABUD/b5qavxrAIeL CFlWj/PN44HacxTzNQxj1oUTisCYgTqGF54Ob/c+YtxJ7l0Jh0/0CaYkuujmXSllAab6Nt 7lqKwg9CtbqgZCR006wBtDilxOS0mgOgCiqjfqQa1nGmRlmoPHJv4N9W80qM5iaoH63ZSU Yx5HQ8p4GeDeiBTicEEMRPXeJM9SvRMpKXx84Iw+xrYiBx2c8IBS37oS3ESdeKjnNF4bCM IzrkAugtwHnxJSnN47S7IzkwsTCNFufEXECtThX/vpzT2D/sOLrI9xXrI6ZYxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060883; a=rsa-sha256; cv=none; b=DgZHWzk0KO/Neg1oqJFZiIMEBW3QxdsACRCIxV64jdxWgO1v1vwqP6NvEnr5PGlInJb1hS pL+FbC+asjeH97Z9zhqdd1P85y/mViv8fbz+Em/ZdnV5C5pCtqW/+zs7lW2tpg4MZ1vxMm Up8/7Seemy1DZIrbX06UDVPv+jAm0dK952A1pVmbYfmtIk99QKT9eX6JB+IalS/ssLbscN ZKK5n9kFFB5Da/x7BuP87n7Go8wLvYUvCKnimx+kW8/+Q9lCkaUOMZ6AZotEFxFFiAdA7Y JyWovllgj+tH3ox+3mYru5OppOq/RwL1JyVbim/OkrS27KLWRREXb02pWnd0iA== 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 4TBKrL6bG1z11yc; Fri, 12 Jan 2024 12:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1MUK000502; Fri, 12 Jan 2024 12:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1MkT000499; Fri, 12 Jan 2024 12:01:22 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:22 GMT Message-Id: <202401121201.40CC1MkT000499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 384c72acb50d - stable/14 - nfsclient copy_file_range(): flush dst vnode data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 384c72acb50d3fd5a3bd07f41d3755867865c0b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=384c72acb50d3fd5a3bd07f41d3755867865c0b6 commit 384c72acb50d3fd5a3bd07f41d3755867865c0b6 Author: Konstantin Belousov AuthorDate: 2023-12-29 23:22:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:52 +0000 nfsclient copy_file_range(): flush dst vnode data PR: 276002 (cherry picked from commit 7dae1467d72ae1f5c8f7be0f7444da23a457d98b) --- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index a690e988b4b3..f86ecd53ad4e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3956,7 +3956,7 @@ generic_copy: if (error == 0) error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0); if (error == 0) - error = ncl_flush(outvp, MNT_WAIT, curthread, 1, 0); + error = ncl_vinvalbuf(outvp, V_SAVE, curthread, 0); /* Do the actual NFSv4.2 RPC. */ ret = ret2 = 0; From nobody Fri Jan 12 12:01:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrN2Qv6z56hJC; Fri, 12 Jan 2024 12: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 4TBKrN1JbXz4q4F; Fri, 12 Jan 2024 12:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KxXWXJpcYEP4Je9L1R6b8kkLVeoaRQPhPwzIlrR2R7c=; b=tOF6yOSn0cLL8Yx+lg+Gl6cumkiuzi9ouIY1aumzDbmfggiP0uA2ZyFGBNPkORpqm6Du/K cIm84WhHnzdPE2fRt7eCkFJGtYvG2aY/XW23YQFbDAa0EBx8A0NHZjSMk6PH8NPC/u75xf IP6tYjhEHTc5REz28hXs8pKdOMZtXgEDzGwBc4RrSxXuN6pNHKPbpkmNXf1vwl9uCt5mOW Jdh7g81iHfAdtGH5qDrCs3mr71g5EzX7hcjMiWBYLMONRufDTjZjV0FLjG6VzdIOQDji6V yg/SkUzj1ACEKbSvlVd2iuzGtxDlG1kDVlWt9DYM13NGJ4yi8LtXzgidQAHJXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KxXWXJpcYEP4Je9L1R6b8kkLVeoaRQPhPwzIlrR2R7c=; b=j4GsTZdj9dIm2GzdPNOXnlFEgkyBhWU0gtpXnSN3PCokE4FeAb1A4ounVcduuYi+AemPmk H5Y5ktGIC9LS7eSRhE5quGbDNrSCiST4+pQi7fzdl1HgpyG6EHFT+X9YdHp9P/eK37h/bs TZMS3+cljxysIhwoOmCa0U473WRaHSUQRQ4wUuEOu3nZcO71zmRNQQb/Ho6DOef9nKQj+H +D43B1MyLUkSGHNMurEvRwvPhJvj67fxmLqGhKdH3fxG1vSb8dgDuM0v/lpxLEaPTczAI2 Xf7FBeuxeLDnUXh1QAniN1tsx1gSIXazSSFT+fiz5HM/pqfaB9zAC8gpJoboAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060884; a=rsa-sha256; cv=none; b=dJiQAMzjNBE5AXF6O5962z5/hanUr4BbaCTTM7eP6DLTGBeA77494cC5e8CltJa/O7ComW QOtdlGaW23nNcoR0DTjNDAdkAV7cdaVmD+tlBpW6w+za37/ll1YSpFUJAzLNJA8QMLirnY lPp9A4dRNNuBKHjywgF3UYL9iQyVSxE+qBtdpwxhGnYFIxkw7NfDPjNMyhKp+sofkkHjLQ ahg33tpkv7iH1iejV3zYTk8d/B81bm6ZXS8lI8wCY31ltIvg59s8mcJ2nYrUYUcgZWdD1w u6YeFVTMmQfZqAtEsp/jZFVp0RS3lrJspT+YAG1xuEFz7X6MtcyeRjXKL6+bIA== 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 4TBKrN0MbWz11lY; Fri, 12 Jan 2024 12:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1Nm5000550; Fri, 12 Jan 2024 12:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1NwJ000547; Fri, 12 Jan 2024 12:01:23 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:23 GMT Message-Id: <202401121201.40CC1NwJ000547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 09c69decd208 - stable/14 - nfsclient: flush dirty pages of the vnode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 09c69decd208d3ccd4dd54ea67c14b48c012c58c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=09c69decd208d3ccd4dd54ea67c14b48c012c58c commit 09c69decd208d3ccd4dd54ea67c14b48c012c58c Author: Konstantin Belousov AuthorDate: 2023-12-30 00:15:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:52 +0000 nfsclient: flush dirty pages of the vnode PR: 276002 (cherry picked from commit 47ec00d9d6071bbb0ee5ed0bdca3c4a468334d9d) --- sys/fs/nfsclient/nfs_clvnops.c | 45 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index f86ecd53ad4e..36ab5485d807 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3705,6 +3705,7 @@ nfs_allocate(struct vop_allocate_args *ap) { struct vnode *vp = ap->a_vp; struct thread *td = curthread; + vm_object_t obj; struct nfsvattr nfsva; struct nfsmount *nmp; struct nfsnode *np; @@ -3733,8 +3734,15 @@ nfs_allocate(struct vop_allocate_args *ap) * Flush first to ensure that the allocate adds to the * file's allocation on the server. */ - if (error == 0) + if (error == 0) { + obj = vp->v_object; + if (obj != NULL) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + } error = ncl_flush(vp, MNT_WAIT, td, 1, 0); + } if (error == 0) error = nfsrpc_allocate(vp, *ap->a_offset, alen, &nfsva, &attrflag, ap->a_cred, td); @@ -3872,13 +3880,14 @@ nfs_copy_file_range(struct vop_copy_file_range_args *ap) struct vnode *invp = ap->a_invp; struct vnode *outvp = ap->a_outvp; struct mount *mp; + vm_object_t invp_obj; struct nfsvattr innfsva, outnfsva; struct vattr va, *vap; struct uio io; struct nfsmount *nmp; size_t len, len2; ssize_t r; - int error, inattrflag, outattrflag, ret, ret2; + int error, inattrflag, outattrflag, ret, ret2, invp_lock; off_t inoff, outoff; bool consecutive, must_commit, tryoutcred; @@ -3891,6 +3900,9 @@ generic_copy: return (ENOSYS); } + invp_lock = LK_SHARED; +relock: + /* Lock both vnodes, avoiding risk of deadlock. */ do { mp = NULL; @@ -3898,14 +3910,14 @@ generic_copy: if (error == 0) { error = vn_lock(outvp, LK_EXCLUSIVE); if (error == 0) { - error = vn_lock(invp, LK_SHARED | LK_NOWAIT); + error = vn_lock(invp, invp_lock | LK_NOWAIT); if (error == 0) break; VOP_UNLOCK(outvp); if (mp != NULL) vn_finished_write(mp); mp = NULL; - error = vn_lock(invp, LK_SHARED); + error = vn_lock(invp, invp_lock); if (error == 0) VOP_UNLOCK(invp); } @@ -3953,8 +3965,23 @@ generic_copy: * stable storage before the Copy RPC. This is done in case the * server reboots during the Copy and needs to be redone. */ - if (error == 0) + if (error == 0) { + invp_obj = invp->v_object; + if (invp_obj != NULL && vm_object_mightbedirty(invp_obj)) { + if (invp_lock != LK_EXCLUSIVE) { + invp_lock = LK_EXCLUSIVE; + VOP_UNLOCK(invp); + VOP_UNLOCK(outvp); + if (mp != NULL) + vn_finished_write(mp); + goto relock; + } + VM_OBJECT_WLOCK(invp_obj); + vm_object_page_clean(invp_obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(invp_obj); + } error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0); + } if (error == 0) error = ncl_vinvalbuf(outvp, V_SAVE, curthread, 0); @@ -4110,6 +4137,7 @@ static int nfs_ioctl(struct vop_ioctl_args *ap) { struct vnode *vp = ap->a_vp; + vm_object_t obj; struct nfsvattr nfsva; struct nfsmount *nmp; int attrflag, content, error, ret; @@ -4127,7 +4155,7 @@ nfs_ioctl(struct vop_ioctl_args *ap) return (ENOTTY); } - error = vn_lock(vp, LK_SHARED); + error = vn_lock(vp, LK_EXCLUSIVE); if (error != 0) return (EBADF); @@ -4153,6 +4181,11 @@ nfs_ioctl(struct vop_ioctl_args *ap) * server, the LayoutCommit will be done to ensure the file * size is up to date on the Metadata Server. */ + + obj = vp->v_object; + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); error = ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0); if (error == 0) error = nfsrpc_seek(vp, (off_t *)ap->a_data, &eof, From nobody Fri Jan 12 12:01:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrP4kvYz56h0c; Fri, 12 Jan 2024 12:01: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 4TBKrP2HDjz4q4d; Fri, 12 Jan 2024 12:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cgdCyCHDnXrE4Glm6oLbMMknqxKX3yx2jRgC2mbzWBQ=; b=qLfdEXxLWLkbj5Hmn4WvQdlsuzb2tq23PN17kx7JUEZl3P5qGxMIJRWy1kYbvtY3o4ewo+ VZBLZDgltwJmYoITRWlSVzK2RSO11HCxOVusIbpCXh1D80zjzKaaYTkfz1bFBzH0mq+Lmd /J7P7kwnCJMmcjswCMfCKSWXKHd/mZXd897fPcm1VI6jqFyFKi30Ct4wdrwx15vljA4sx6 rEpfTBTqF9xjJU9bVKKH168CVU5nTO3QjuaXrCSd8gFAmzr7tCwhpD85dojxEb/b6Jk1YH /mEljJc1J/So8J5DZKCGSLFdQ+N90GtEBaH0cBb5M01VopReJ8xquUap5gSlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cgdCyCHDnXrE4Glm6oLbMMknqxKX3yx2jRgC2mbzWBQ=; b=vUjcZxOB0c2pxFkH6VpGum7Yg//k6y1h2J9R/n3BC/i4SXnlJalH6/X44F6nZ6TL6dmi/6 VjHrKBMNY4pfG08T0RZQxX6jkk49mjn95F4BYqglQT8RT8ntOB8Fgq6fPOCtggbXhoX4qw 8/HwUsaDkejZ6MMccH64ayLhIos81kUUWLtqLSo7n4XFEcs1QfsITdV72psgCWlX+cLvGD IuOIlHyEnZnAiTuAUA0hEwAmu5gIvM/4sEkQeMuO4bW/x1AX+Om+iyN071tPd/p2LK/Avm d6agJHBh+B7bXcu4IpCTaY+J8kWl0fnoaTqbyCVSkX3WTBjfqzcLpw6G26bH9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060885; a=rsa-sha256; cv=none; b=t5H8mj1TMicvNH/zkD6OVTdg7ka2sEkcgSeKeklCH9ac2eSgKaN3h0ofvV3voTbaFp+cR2 HH6MEOd7lhqD1uH1tNakqy1gvS4ASXhmEBJyikqVMQjN3hcU8fBk+SN7+HnjJ6s9pn60bI RoXH0dTX3fS1y0pv5MhyEGO/Y4+Mub3nMDkzDLTmvTJBb+UVTWuePysEbqI+6TNX/3VyBN LCt9RDW0Ai+16EyVRP3cWMdwI/5GxB7KDhEXuUCWqjziQFiiz6oylMA4+iz2Er8l+VlB1X XLeciPyopzmcW3X1J0xKojLV1ny/Y0qcxCUjvARgd3raY01R0wzxbGHw8lMsTw== 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 4TBKrP1Nclz11lZ; Fri, 12 Jan 2024 12:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1Pql000586; Fri, 12 Jan 2024 12:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1P5I000583; Fri, 12 Jan 2024 12:01:25 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:25 GMT Message-Id: <202401121201.40CC1P5I000583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 62b0cb23784b - stable/14 - nfsclient: eliminate ncl_writebp() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 62b0cb23784b282dc771057589a1481bb1ab50cf Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=62b0cb23784b282dc771057589a1481bb1ab50cf commit 62b0cb23784b282dc771057589a1481bb1ab50cf Author: Konstantin Belousov AuthorDate: 2023-12-30 18:46:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:52 +0000 nfsclient: eliminate ncl_writebp() (cherry picked from commit 656d2e83d9eef204c132f879d55782affede2ca9) --- sys/fs/nfsclient/nfs.h | 1 - sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clnode.c | 2 -- sys/fs/nfsclient/nfs_clport.c | 2 -- sys/fs/nfsclient/nfs_clvnops.c | 70 +----------------------------------------- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h index b43194a3abeb..aa755a6b5f4d 100644 --- a/sys/fs/nfsclient/nfs.h +++ b/sys/fs/nfsclient/nfs.h @@ -111,7 +111,6 @@ int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); int ncl_readdirplusrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); -int ncl_writebp(struct buf *, int, struct thread *); int ncl_commit(struct vnode *, u_quad_t, int, struct ucred *, struct thread *); void ncl_clearcommit(struct mount *); int ncl_fsinfo(struct nfsmount *, struct vnode *, struct ucred *, diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index ae529d549d76..63e97f405198 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1315,7 +1315,7 @@ again: } } else if ((n + on) == biosize || (ioflag & IO_ASYNC) != 0) { bp->b_flags |= B_ASYNC; - (void) ncl_writebp(bp, 0, NULL); + (void) bwrite(bp); } else { bdwrite(bp); } diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index c6b6eb4fec88..00e25472f856 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -59,7 +59,6 @@ #include extern struct vop_vector newnfs_vnodeops; -extern struct buf_ops buf_ops_newnfs; MALLOC_DECLARE(M_NEWNFSREQ); uma_zone_t newnfsnode_zone; @@ -131,7 +130,6 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index c0318b692d86..4e3a699fb170 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -77,7 +77,6 @@ extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; extern uma_zone_t newnfsnode_zone; -extern struct buf_ops buf_ops_newnfs; extern uma_zone_t ncl_pbuf_zone; extern short nfsv4_cbport; extern int nfscl_enablecallb; @@ -235,7 +234,6 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 36ab5485d807..3f1ab9741673 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2925,7 +2925,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread *td, * A b_flags == (B_DELWRI | B_NEEDCOMMIT) block has been written to the * server, but has not been committed to stable storage on the server * yet. On the first pass, the byte range is worked out and the commit - * rpc is done. On the second pass, ncl_writebp() is called to do the + * rpc is done. On the second pass, bwrite() is called to do the * job. */ again: @@ -3438,54 +3438,6 @@ nfs_print(struct vop_print_args *ap) return (0); } -/* - * This is the "real" nfs::bwrite(struct buf*). - * We set B_CACHE if this is a VMIO buffer. - */ -int -ncl_writebp(struct buf *bp, int force __unused, struct thread *td) -{ - int oldflags, rtval; - - if (bp->b_flags & B_INVAL) { - brelse(bp); - return (0); - } - - oldflags = bp->b_flags; - bp->b_flags |= B_CACHE; - - /* - * Undirty the bp. We will redirty it later if the I/O fails. - */ - bundirty(bp); - bp->b_flags &= ~B_DONE; - bp->b_ioflags &= ~BIO_ERROR; - bp->b_iocmd = BIO_WRITE; - - bufobj_wref(bp->b_bufobj); - curthread->td_ru.ru_oublock++; - - /* - * Note: to avoid loopback deadlocks, we do not - * assign b_runningbufspace. - */ - vfs_busy_pages(bp, 1); - - BUF_KERNPROC(bp); - bp->b_iooffset = dbtob(bp->b_blkno); - bstrategy(bp); - - if ((oldflags & B_ASYNC) != 0) - return (0); - - rtval = bufwait(bp); - if (oldflags & B_DELWRI) - reassignbuf(bp); - brelse(bp); - return (rtval); -} - /* * nfs special file access vnode op. * Essentially just get vattr and then imitate iaccess() since the device is @@ -3602,26 +3554,6 @@ out: return (fifo_specops.vop_close(ap)); } -/* - * Just call ncl_writebp() with the force argument set to 1. - * - * NOTE: B_DONE may or may not be set in a_bp on call. - */ -static int -nfs_bwrite(struct buf *bp) -{ - - return (ncl_writebp(bp, 1, curthread)); -} - -struct buf_ops buf_ops_newnfs = { - .bop_name = "buf_ops_nfs", - .bop_write = nfs_bwrite, - .bop_strategy = bufstrategy, - .bop_sync = bufsync, - .bop_bdflush = bufbdflush, -}; - static int nfs_getacl(struct vop_getacl_args *ap) { From nobody Fri Jan 12 12:01:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrQ5gYnz56gv3; Fri, 12 Jan 2024 12:01:26 +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 4TBKrQ3P7jz4qKZ; Fri, 12 Jan 2024 12:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVCwJFVBNRLIY/5vvPC5SdUO807nE2t0MHxLFhNyzPg=; b=dQS3WuWiiW/UpZMkUpVCiyDiSN2rfxglBnycktKSbGovNn4VHihm+PKsCU7NQcr5cenHdZ GOPg/In3Xh8NoIB4myEgwDdThJ5I/cOu6RLC/ZDuttRhjhlBWoz5up/z9PUVrRuk6trSAC ZLeFf5T4m89gjhAbpHTBN1jIDIKLeE1N7h65JQHpTU4BQPECXfMNv2Y4na7oLQKtey4+gO OodkHpwJCL10L3h2DBtk0HZcIRjqWV2XUW+zAeul6UDBSDzTDiX+0M/9bgqdXwj9lO3LmD JYWURbE4hMX/VIom25wlehTln+zJ7V1xLnnEQ5guQkxItuFTopF0nYzjlsY2NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVCwJFVBNRLIY/5vvPC5SdUO807nE2t0MHxLFhNyzPg=; b=REBNwekBHrhPun4xlVOyFwjhAv1XqMN2RtlInWDlO8KseaTdKhRnKUfMBKBMvSu4KZy5ub wiLrKHmtZIyKJPTI5zKjSRpFVW30MXhHY23n8UwQCtdkyij/Ycoxy8Z3BRtiBKWnLlj6kK xKPyQRqWTRtH7NHwiaIkAng/LIt/PfdjaPBRCqjhEp3UIxKcflrglrl5oc3HWbsbqCn977 xTmcV8XUjDuwVIZ5+UUH6IMuwUEs2XIZkHE6l4PjBZogKgNoVUt1lYT0XOznxQhyx82uut mJXHoJMD8cCcizTXv0KNNRkvP4xfrJwqajMz8aFUHi3iSdPH1qSpWHCAA2s9Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060886; a=rsa-sha256; cv=none; b=GcaO6we5CO0PjJzsfAMFDmuXI6Rep5j5MXrET+oc4YokoaPxyWQlI5jcTxjRPQVwn/X1gV 6hbKbrN6ULeNjPqYio8LqWalnhf1+qVCqCp/Quq984+K1yHZoZg3UJqDCcQJ94UHNCdgmR 09xmwnY6SQWX9GKO6qdfwhWScqCHJt8sO8PnE2iJHW7lrdhF1E4bhwdl1xn2R0CFBe0K3m 6ZN5oPtyFo1z/Yg1XUnsZeqRVVt3RwIbYnu4xaZdEYptEXBbawx/1SrwMaEyhvQ0dHPgki xHqMy9IMYvTWVYd+llSZIRv21I3Df535sWRkOlV4a6y4gBzkFwsNTmVcHlnXSw== 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 4TBKrQ2RNQz11Kg; Fri, 12 Jan 2024 12:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1QpR000644; Fri, 12 Jan 2024 12:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1QxK000641; Fri, 12 Jan 2024 12:01:26 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:26 GMT Message-Id: <202401121201.40CC1QxK000641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dc024acd5174 - stable/14 - vtruncbuf: add a comment explaining the purpose of the loop List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: dc024acd51740f794d09fc478be6a4f046766ba4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc024acd51740f794d09fc478be6a4f046766ba4 commit dc024acd51740f794d09fc478be6a4f046766ba4 Author: Konstantin Belousov AuthorDate: 2023-12-31 20:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:52 +0000 vtruncbuf: add a comment explaining the purpose of the loop (cherry picked from commit 4c41d10f1538c232174d5200d245e5fcd9936958) --- sys/kern/vfs_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 811c5cef45d1..8cc4a57cdafb 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2558,6 +2558,9 @@ restart_unlocked: ; if (length > 0) { + /* + * Write out vnode metadata, e.g. indirect blocks. + */ restartsync: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { if (bp->b_lblkno > 0) From nobody Fri Jan 12 12:01:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrR68Mwz56hKH; Fri, 12 Jan 2024 12:01: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 4TBKrR4LXHz4q8Z; Fri, 12 Jan 2024 12:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fOKEqdtDUwJh0Ze7sqqF0ABdt6pzzL2spZegm0eDcE=; b=Y7e0jhW6fyVXWgSO8Jb2m0pov3muoe2U7yG8kyM/lppwD71fstafygAAELM9+ZWV+udV4u p5uwJR9X2SRnrfrleKoZEcVeJSczOvGdFkgZRzkizVXQg/JsXLvp01ibL9PUdPzsfKVVWg uqeZFOTyZXf/9IGfFShB15EcANd1QRgGu2uAvL6EU6134cm+cQPCFCmsCDJPLpL4EfUS+S u5mRimUdCXI/EXEoNkiir7BQCsWMZ+u91h9PziNqXI6Fwk4dvb3ZjVytAwHzBNDqijd0A2 wnlHX8SpFm4Yyw9G0RKpWQsMXqaMS56PUKQddk3NJH/T2PUItVWu6v4mUH8b4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fOKEqdtDUwJh0Ze7sqqF0ABdt6pzzL2spZegm0eDcE=; b=mdVTex49PdgpP/wUmMOWooXc7A2e6W5dpyTARo/YB6FzrOD9TPFDAY2I/upE97JMkTrRfw NloBw7y3lbOXm/E88z3jW6foNN6XEbFeG23KCxxA1m6KucMEFHM2jlg3Uf9T3MOz1EM8pK OsWb2JgD25qr6VwKq6a0GF95SDo05/O21snPmpduDmLUDeqQja3YXsM34stR9VI6Delfuo SDlAxG8TCI5eLW9lslpZXa65qu4V2jw++3J31q4fFcCAopvjEPtupbDQOFbghkOTqbOgvO KIheb6TwxAMXhppuK93FDNGNVpWyN/GJ30T6JR4PH9uCBsvFrQNdm4Aly9V9YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060887; a=rsa-sha256; cv=none; b=JV2w7b0fz6KOfIJU887Pad7fRNpkG7vSh1gWSiv5p7VEgs2ODbjZJr14vPcw/FEnbkW0IL d9BgCvchEzVD43YQvMUn3JetsG2n7/+1ks0/mPu2SQnN2OFjw/hO91/nhlWLZJkK2xSAJA 7owOPnFG0izsioRjbwLeCT1LBa0WBr6qoKylAyrtDcek3/phO5LN0Vq6qWs545xbEHMPO+ tG+Ci9DkXhoO16Uml/fMLIkC3bT70xiKwaO/OmrV+Sz7IO5DWBS0nz6vPf+vXWJFhy4ENx MRxtnAWPWyZkgnT3riCITFhv9Dv/v+vz0HYAXbh58cgQteP1A2Qb4WV6Zka+CA== 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 4TBKrR3SBJz11nj; Fri, 12 Jan 2024 12:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1Rid000697; Fri, 12 Jan 2024 12:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1RT6000694; Fri, 12 Jan 2024 12:01:27 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:27 GMT Message-Id: <202401121201.40CC1RT6000694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9e951d6b4b70 - stable/14 - vtruncbuf: improve the check for meta buffer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e951d6b4b708fad9993aca0a1cede1c74d735e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9e951d6b4b708fad9993aca0a1cede1c74d735e0 commit 9e951d6b4b708fad9993aca0a1cede1c74d735e0 Author: Konstantin Belousov AuthorDate: 2023-12-31 20:46:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:53 +0000 vtruncbuf: improve the check for meta buffer (cherry picked from commit 2d33ad48bd37f27925e4c46c798f8f2d23a2b501) --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8cc4a57cdafb..3928cde7a719 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2563,7 +2563,7 @@ restart_unlocked: */ restartsync: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { - if (bp->b_lblkno > 0) + if (bp->b_lblkno >= 0) continue; /* * Since we hold the vnode lock this should only From nobody Fri Jan 12 12:01:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrT0FbVz56h3P; Fri, 12 Jan 2024 12:01: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 4TBKrS534Vz4qCv; Fri, 12 Jan 2024 12:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JujJ1NzMP6ZWkhgE1sQUvDmaWIBq1ZP76FW/dFgcBIQ=; b=Tx3yv2kNBngmMoFTngWm6nzmP/2Va9eD446CYTcP7NjWQ1fT7pOy+mmDRh3ywZa6WBxxbS B3Qv4oiSmS6evzgkhYJZTsEuHWoony8+v0T5vQKrlPN5ZG//a/vQUZ43V3itl3JVaoUP+d DKaVaKMCI9cc81qxSkY8JdFo3gEtOkuNXp6nJCL/uvUzTdCHvaeobtMbAvlMuo8XzaMJah zaRaQEUlLJkafv/0NBiTDRbfbkzRmwsSTlJ8zWOSHrFPkEVnAJ2UL/hJ425ypSnDliKvak QeBFtkcvmEuCx1MOVK7q+nEXDsjCn3OMvwRULKtbjCOol8dbJxEJNMCyUPXUTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JujJ1NzMP6ZWkhgE1sQUvDmaWIBq1ZP76FW/dFgcBIQ=; b=dfNeGMFtOdXCw0UrcVMHLF+qihUkgGE4sxL0YFRlTPr2eJhJodyFFXPlDPhBUpwVrY3+bs KCkp7cwkDZv39ziVVB0o0q1l12JgUdM8g18uwbzWLzukOGIJEybsG40V9XlqvfQr6NbLOy FRyKKGAJtRlqoKEcioFXxtjIG5GjZK1vj+7WjGRp/tm6aSPBkq4GMsi296ObyVJejwGPdx 16qNFXKw/DNG4fD2EcL3HnXtGPeZYFgrkJuzMuAnOIMf7B3/Fyx9SfEuDwtJRc4fXr4mqg grxwyJg7mFFaygLoyX1RBfv97aD9mnpeFBuxJ47PvaLGW0i5u2nlHxw93qLQ0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060888; a=rsa-sha256; cv=none; b=ojw2QlgZtSiGHYC9rsAx3wYsEwEjQ7FfpKdgieg771EVJopfQ5P3VnO+u/MXKNQM6mTC+5 xia/KsRjkTTlMe0i3WCE0zoNzCrO0gZVapMXz10NVHUtFfkKherNAKAhP7hshO5T+x953Q 3dKyJJLJ5bkslGP52YjMGwu2PcAv0kpaJAb4mrgROwyJ37L5P9PMaLndj3Y+wwBHoXBTvs 2/WP5Z5m6so2u14ozFuI0DV4vobYsspCLWEYXAHf+DVzd5SL2OLBoQijuLLkHlHCBVB5wl B79zz6SycfdCZhHMt6JDFm59KitUxMLEt5nowGxhNPMdg6iKZLirz41nPLs1Nw== 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 4TBKrS46Y2z11nk; Fri, 12 Jan 2024 12:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1SNs000754; Fri, 12 Jan 2024 12:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1StQ000751; Fri, 12 Jan 2024 12:01:28 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:28 GMT Message-Id: <202401121201.40CC1StQ000751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cbf323cf503b - stable/14 - nfsclient: limit situations when we do unlocked read-ahead by nfsiod List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: cbf323cf503b69516ef19542c4630c0d42d74b05 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cbf323cf503b69516ef19542c4630c0d42d74b05 commit cbf323cf503b69516ef19542c4630c0d42d74b05 Author: Konstantin Belousov AuthorDate: 2024-01-01 22:22:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:53 +0000 nfsclient: limit situations when we do unlocked read-ahead by nfsiod (cherry picked from commit 70dc6b2ce314a0f32755005ad02802fca7ed186e) --- sys/fs/nfsclient/nfs_clbio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 63e97f405198..7b9b68782d53 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -484,9 +484,14 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) on = uio->uio_offset - (lbn * biosize); /* - * Start the read ahead(s), as required. + * Start the read ahead(s), as required. Do not do + * read-ahead if there are writeable mappings, since + * unlocked read by nfsiod could obliterate changes + * done by userspace. */ - if (nmp->nm_readahead > 0) { + if (nmp->nm_readahead > 0 && + !vm_object_mightbedirty(vp->v_object) && + vp->v_object->un_pager.vnp.writemappings == 0) { for (nra = 0; nra < nmp->nm_readahead && nra < seqcount && (off_t)(lbn + 1 + nra) * biosize < nsize; nra++) { rabn = lbn + 1 + nra; @@ -674,6 +679,8 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) */ NFSLOCKNODE(np); if (nmp->nm_readahead > 0 && + !vm_object_mightbedirty(vp->v_object) && + vp->v_object->un_pager.vnp.writemappings == 0 && (bp->b_flags & B_INVAL) == 0 && (np->n_direofoffset == 0 || (lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) && From nobody Fri Jan 12 12:01:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKrV2NSgz56h5v; Fri, 12 Jan 2024 12:01:30 +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 4TBKrT60JWz4q67; Fri, 12 Jan 2024 12:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dSV1/LRinSk1Jlz251Q/tewE8X6YxCI7ODa/90MRbn4=; b=D3GUJ1kSB0rpiNN61Z4KbdqfSR4zSvt/MmSwh+Q88M+dpliseagkJnWT1DRYoa/bg5SoL5 1oH2fqFh1tH3dNX3OPhamcx5RGyxJvyMF4Pktp62GgPTGzcfDQjIsYY8lEGnWXp98URmfs wISrX7OHewuQHcny6CTYh54tyVjzSAostvorleQRT9jypOJvgxuF4yOjaM7aOITaggzduP 7r1+DxcFSWJEZyh18mpssZEr2I5k36eyJdD+rYo5wu5gDZeku7PRxZip5EFMChvHzD8mav ouOAw/+STuqepruyWE4pwVzJ5VR0Weog2BzZv4PGOPVhVCdxYiVgzEJs4KHpmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dSV1/LRinSk1Jlz251Q/tewE8X6YxCI7ODa/90MRbn4=; b=s79QPRuxAkGXhEJLgKlATkHRVaLl1IKNYBuzYPlOqgG3sVacpQWFk+q5J7hsX8EUGMDqrS PKJE8jwyXlHVNvipfTHJvx7sPoRrrsKPi1/inhdghI/fno/1zFvfmGLh+0V7gRJi0FtkbY p2Cd1O+vtgWS/NdGPKnnE+cWa3KL/pfb7Dh1K8dUI7CurcU+Mm/KG9cruxta+1fccri5Jg XZ66s5r5hyexcBfK/cVkmlCYvelKf4EVesYvC1xZvSodjKbpE6ed6UEDhALuvTGzvRvubW D2jjfEa5yCSHukMU398ww1KnErTvDGb8XWM4VvDSQJKJshXHEkbBEy7X2H+LgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060889; a=rsa-sha256; cv=none; b=ubN5bjgRC98SxJ6p7S/aEJbdr1qGMygRxX+7EaV/0eLT5qv4eS/5l3A6roR2CJfXAXV4WD H2E+CxcBhNQk53aJ2/a89kiRQHUUzUMhF0Xxp41nWDtFqUNfldNp4JIrpzYhcPdmO+8KHO IiIDTRzQ70tBMXAU22hJF48/45N5luv/t/NYX2/E1I9wvhXecHZFcNQR7r3+jGi1GEtkbq tHEJA5Q3MXNI91i6M9YGkkelVS+pyS0qBjegAcDvVkgpWJcpOmIlByytKtA7Xs5LlbNp6j 5kiFcebkUM6xbIq83CwjuA+FvfksN3H/CN0HlH3TAelr4EssK3VL1ZjqUx1ARQ== 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 4TBKrT54bnz122Z; Fri, 12 Jan 2024 12:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC1TYN000793; Fri, 12 Jan 2024 12:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC1TuM000790; Fri, 12 Jan 2024 12:01:29 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:01:29 GMT Message-Id: <202401121201.40CC1TuM000790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2ff28c64288e - stable/14 - ffs/ffs_rawread.c: clean up includes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ff28c64288eefab4962f0e826d776dc30287aef Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ff28c64288eefab4962f0e826d776dc30287aef commit 2ff28c64288eefab4962f0e826d776dc30287aef Author: Konstantin Belousov AuthorDate: 2024-01-08 05:36:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:46:53 +0000 ffs/ffs_rawread.c: clean up includes (cherry picked from commit 8a4577423e82c54942a9390658d059f1169187b1) --- sys/ufs/ffs/ffs_rawread.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index a8df78ee8eff..ef93c1ab6783 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -26,23 +26,21 @@ * SUCH DAMAGE. */ -#include -#include #include +#include +#include +#include #include -#include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include + #include #include #include @@ -54,8 +52,6 @@ #include #include #include -#include -#include static int ffs_rawread_readahead(struct vnode *vp, caddr_t udata, From nobody Fri Jan 12 12:02:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKsy1fYxz56hSc; Fri, 12 Jan 2024 12:02: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 4TBKsy0sqKz4tFC; Fri, 12 Jan 2024 12:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qbsxvO7uqrpN6azesXn79md172GYcxyr5d1wwGEgMc=; b=Y2HUemhNmOW/6aI6W5kYhONcrv9FZ5UPzWmrK/7r52u1vy/wTlYOUXg6e0MJ/+fXQrH5zF 8PPaILGhLsc7xCaYi7RKXKvqD0QqjyXCRB5UVC5GdAZdMK43jCIG/5G5T41UqPsTo5AFx9 GC6dyoLigHMC3W0eoT4NIE/m0dAeSFkmzvlTvgc6PrhWs17BljLWfZXYHZR+G8PbwR8ev/ nvpL8sbnjvh0CSMjXggTUlkUtJcdSPMPr2v4UgY7uWvg6PkAaG2JWy1iZL6B7+ozZrnGn7 0w4u5ocPjWvigQ00dCO+V+PV06MLpXFLtMfu71Kl68jy5I+KbiVo8kOnHztIdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qbsxvO7uqrpN6azesXn79md172GYcxyr5d1wwGEgMc=; b=DDyr8a3lRxhH9BfNWaWGJi+tBKvqy6tDXupsh98pXKIcxYHqQLXvnrb1P7IBQ/uIScxDug ZumJLT3zy4X2/2YjZee/g25IHd7A8WKkPmQjbWlzCRowAT1lqiAX+79/BmyC3VkIFRJeLV EeKT7MUkPIoOxW0MWjm5YXoO7DCtXToIVZ0yeOWgdWob05MlIhSQvRMEPgQ7rKZk2lDUo/ Gy9OYo5CDlo9NgAAII+jgXr70kxelZ97FHZwL9/VIbQ3VozX+Z2k3f8rjjIWnHRgcsgCNY NWEigraObzgMpGSkRyGNtoemLuNlQ+C9/MnFgQw9yrcL/UkIag9wQdxTk988sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060966; a=rsa-sha256; cv=none; b=NQZzpv42WtElXUo07+tzPmCkTjeUt3MxGo9mxsnCcMwGcJznTiRRbnZQKxa3Wi5LqzVwR8 AWxLGRlIEZvrLYqsHkTehf6bOOEXjSkDmgvvsv3UCJtxOzXlKs6ZgV3+S8egk/ywRa6ZdY EG4Er300YfoKSrp23EAYb3LqXKdqq5BIWDLKHQ5NcYV+32A0YibjKuhw0kMOuBrQqBfoC6 Cgvbt2z4/Mp+9ofGZFAP3RCT1Q4G8PV3bJ2ZTs92o6tKWX9Yz/V3zqotn1a6JXLqeLtzRn OsMB5v88xHq3yWyaqoawgjEQpn8i0houHa/uLdU8XWoxeSF9YGiVT6tZrKY9oQ== 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 4TBKsx722bz1236; Fri, 12 Jan 2024 12:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2jjI005485; Fri, 12 Jan 2024 12:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2j3l005482; Fri, 12 Jan 2024 12:02:45 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:45 GMT Message-Id: <202401121202.40CC2j3l005482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a85df799787b - stable/13 - mlx5(4): only detach IOV children if iov was successfully initialized List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a85df799787b8c441bf7d7238f02ca057b7378e5 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a85df799787b8c441bf7d7238f02ca057b7378e5 commit a85df799787b8c441bf7d7238f02ca057b7378e5 Author: Konstantin Belousov AuthorDate: 2023-12-29 03:14:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:51 +0000 mlx5(4): only detach IOV children if iov was successfully initialized (cherry picked from commit 987446fa39e8f6887ea16ad49f00f699b2efd210) --- sys/dev/mlx5/driver.h | 2 ++ sys/dev/mlx5/mlx5_core/mlx5_main.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 958b4a7df747..d866e40372ab 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -708,6 +708,8 @@ struct mlx5_core_dev { bool dump_copyout; struct mtx dump_lock; + bool iov_pf; + struct sysctl_ctx_list sysctl_ctx; int msix_eqvec; int pwr_status; diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 2e0aa2a00cd5..0a05d559072f 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1702,7 +1702,9 @@ static int init_one(struct pci_dev *pdev, pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); - if (err != 0) { + if (err == 0) { + dev->iov_pf = true; + } else { device_printf(bsddev, "Failed to initialize SR-IOV support, error %d\n", err); @@ -1736,8 +1738,11 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; #ifdef PCI_IOV - pci_iov_detach(pdev->dev.bsddev); - mlx5_eswitch_disable_sriov(priv->eswitch); + if (dev->iov_pf) { + pci_iov_detach(pdev->dev.bsddev); + mlx5_eswitch_disable_sriov(priv->eswitch); + dev->iov_pf = false; + } #endif if (mlx5_unload_one(dev, priv, true)) { From nobody Fri Jan 12 12:02:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKsz2f2Hz56hSd; Fri, 12 Jan 2024 12:02:47 +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 4TBKsz1rc6z4t4G; Fri, 12 Jan 2024 12:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4SbcxnLSoFLGLfyf2myNR1QOlY5QGeupgEPJO+BdNE=; b=brTlf3E4sNL9k8ng1B/rES9bceVYgdFCUlmDo6g5KWCohsGcC8/w/xKOXrzwbm8kKMIwgs 85Liw81q9T2GLYhAqIyH9kej9Wu+Hys6l/gLs07dICQB1ssxsGfQ14VXs78JHaA8BIgyJk NPtitmZflsRoUaEqphEHGLokO7kOLliSip5dKRyEaAJCKrX2c5anwSpBFSRe+2gYVXLwfQ AogQah/f/A8stn0bhtoD0yNKiaoVrsPdSK7KBaq7kcgxeq/W67M9K50oThsWmquXif/C0/ XRWMNRNcS+WNt/g13zpNKRAleQGUvNTO3V3WhzglT1aDZUHiUZygnBOqJ/RMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4SbcxnLSoFLGLfyf2myNR1QOlY5QGeupgEPJO+BdNE=; b=qbkaDh8FieSrO57mG1uxK9vslW758AjGal+ikFk5fi1uceXg/09gsXU22Eqh4ee7itwTLV WP1XHEk2TZ5c6o3C5nSthPopF6OpZkWhRF0THh87/t95l/2GoLlbqrEef9FXuphmrPZPkK K+G5kqE9sJrbbKPi6CZvCBIwJJPH+qFmwplPR2cma5Ehm20/758lVq4gDn6d7Y/uX1QpVf ZYB91Prdc8NP5i+VPZFTI9nxB9iStKXQi2eNdS5b7KCg61Z8+5dJb0W/+ULRya1rIdtttx +PxcW7OsB3icNwrKFXiz1cfM+vRamE+44bSop2KVuqtkB0Nn3z/ytmLu64ctQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060967; a=rsa-sha256; cv=none; b=nrimSbXR7CQMrA0F7KwiTXobMF8mb0wqoEN11SNg1BVRqylBAMgFBApOUlbZonU4fuqenF C4jjS+bXZgH6OhycmQmxxs4qohU6iNCPFYB1a2BuCdErX1jZECOYXjcUBpSCEd1/QB0Z0k Xs7I6qoKTeWocE7SwYFkgQN5jPilsQjGDuiaiIjBY/GQEOSjyFuCSYYLGxORxSjrh63NJ6 lslaJuvhXyFQ3Z0uvfDJ/cZY7vqk8tPTZ/hFLui4IjHEXmNRLur11Dql+oVup9Kw2DMXbi g4QM2MNLaiPUUU/D4nVt0Rs/zjZaHGUKo6MfWCXA894FO4Nr0YU+YC6waNUuWg== 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 4TBKsz0vPWz11XL; Fri, 12 Jan 2024 12:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2l1d005538; Fri, 12 Jan 2024 12:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2lSL005535; Fri, 12 Jan 2024 12:02:47 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:47 GMT Message-Id: <202401121202.40CC2lSL005535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d139cab8d13b - stable/13 - nfsclient copy_file_range(): flush dst vnode data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d139cab8d13b83b90872f6ca5dc53890c85826a9 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d139cab8d13b83b90872f6ca5dc53890c85826a9 commit d139cab8d13b83b90872f6ca5dc53890c85826a9 Author: Konstantin Belousov AuthorDate: 2023-12-29 23:22:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:51 +0000 nfsclient copy_file_range(): flush dst vnode data PR: 276002 (cherry picked from commit 7dae1467d72ae1f5c8f7be0f7444da23a457d98b) --- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 642963694a0a..443d8bc6d56b 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3881,7 +3881,7 @@ generic_copy: if (error == 0) error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0); if (error == 0) - error = ncl_flush(outvp, MNT_WAIT, curthread, 1, 0); + error = ncl_vinvalbuf(outvp, V_SAVE, curthread, 0); /* Do the actual NFSv4.2 RPC. */ ret = ret2 = 0; From nobody Fri Jan 12 12:02:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt05m5Cz56gyb; Fri, 12 Jan 2024 12:02: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 4TBKt02vqwz4tKT; Fri, 12 Jan 2024 12:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9+N8u0S9pNc0NHeAXQTBhZvP5ROMevOhF3GOCSR8W6g=; b=KP+DcQQFggHq0HOzylspfE8fzz9g4+OgzYRmnkoR8MSu4K+zyIux4VdgOY2PJbzNU1mt/6 Nyumi0hxR2UQK/Iqc8TwdgFa3EsLICy4zpmJtxo0SsAbF6eZ6vHR/uW8bDrM3zJyzlFmCV kxjpA2tYOwE5zPlwFCb2QWCni6MjN3p1VgrDQqAYBZXdGkagDOrfFTT8AXzvJLEMe4iVzD lTli2Xx/TGXN4Yf4rxPb22YW2t6vq/VhwDoTJpOgCiHoC/pskl/W0yWFLv9JHvsqiaQDZt njPziEE+wzSKH+M3I5+UAZMMHPpaczhx5TOUwRVVIlIwvLGFHTVOZMkA0Pchcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9+N8u0S9pNc0NHeAXQTBhZvP5ROMevOhF3GOCSR8W6g=; b=lR/PLIHXSk56AIm9M20SmJRvZZip46HMKcnNpLqwVoarNQmIbFjSvmFg4HwYbesuH70TlX iONY9AHa6Ku1zrbDZ+0IQ67uNflRZ6R8OUhcIkflJkemmR3pvHiszqc5laByQf9QNVCDJ4 ixZfvaLCfFOFofhoMj40WnbMod0ByuQBlapKGiMgo6D1IAvRlxymu0xySm4+kRaNBwU3m6 OYfDlQ7geKfpaWtpNEsqrzhubDgtENsoBjso54yfDddKZdNG82zS3iyENCc4Z8xgMhClek A6+GPHBx2NNxHVUywLpcAcXQbiLLMwMgAJDUKhvxOoyXs0PKdyz5LXsfhZij+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060968; a=rsa-sha256; cv=none; b=RBkQS7Xs2OoIi99/BK/1y915KWdZVJseNBjFf2MjDwJjuNu8MJn0pT7l61ANvo5UngCYH1 +iZGbNqfPSMLlI2z9JrRsMErRQnxw7CkTPRb1yTN9E6Dyb1k75c524Lv0Arq8jts8MGcNe nVqAW3qFFHbovOXtU+9q3QvYzAYfkx+MgyO1sxTgjKlB9fctAnRSwRPKn1V6P0QJiavs8B i+xvat1bporK7aYh5R90V/MSHIhe20O4jLeUhjKC3bDt1YJEzbm8OUhrUlznrfgAaml871 IMOtMWT5FupcAkFXUNe3t4IhAME9I1BzO7htYWT35b7Atr23HJYhEUuUM86oCw== 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 4TBKt01xVBz12Dc; Fri, 12 Jan 2024 12:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2mmF005587; Fri, 12 Jan 2024 12:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2mMR005584; Fri, 12 Jan 2024 12:02:48 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:48 GMT Message-Id: <202401121202.40CC2mMR005584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cee4d7c22585 - stable/13 - nfsclient: flush dirty pages of the vnode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cee4d7c22585a736a5d231365ceb62e96d80488a Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cee4d7c22585a736a5d231365ceb62e96d80488a commit cee4d7c22585a736a5d231365ceb62e96d80488a Author: Konstantin Belousov AuthorDate: 2023-12-30 00:15:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 nfsclient: flush dirty pages of the vnode PR: 276002 (cherry picked from commit 47ec00d9d6071bbb0ee5ed0bdca3c4a468334d9d) --- sys/fs/nfsclient/nfs_clvnops.c | 45 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 443d8bc6d56b..4ee167cfb5cd 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3731,6 +3731,7 @@ nfs_allocate(struct vop_allocate_args *ap) { struct vnode *vp = ap->a_vp; struct thread *td = curthread; + vm_object_t obj; struct nfsvattr nfsva; struct nfsmount *nmp; struct nfsnode *np; @@ -3759,8 +3760,15 @@ nfs_allocate(struct vop_allocate_args *ap) * Flush first to ensure that the allocate adds to the * file's allocation on the server. */ - if (error == 0) + if (error == 0) { + obj = vp->v_object; + if (obj != NULL) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + } error = ncl_flush(vp, MNT_WAIT, td, 1, 0); + } if (error == 0) error = nfsrpc_allocate(vp, *ap->a_offset, alen, &nfsva, &attrflag, ap->a_cred, td, NULL); @@ -3800,13 +3808,14 @@ nfs_copy_file_range(struct vop_copy_file_range_args *ap) struct vnode *invp = ap->a_invp; struct vnode *outvp = ap->a_outvp; struct mount *mp; + vm_object_t invp_obj; struct nfsvattr innfsva, outnfsva; struct vattr *vap; struct uio io; struct nfsmount *nmp; size_t len, len2; ssize_t r; - int error, inattrflag, outattrflag, ret, ret2; + int error, inattrflag, outattrflag, ret, ret2, invp_lock; off_t inoff, outoff; bool consecutive, must_commit, tryoutcred; @@ -3816,6 +3825,9 @@ generic_copy: return (ENOSYS); } + invp_lock = LK_SHARED; +relock: + /* Lock both vnodes, avoiding risk of deadlock. */ do { mp = NULL; @@ -3823,14 +3835,14 @@ generic_copy: if (error == 0) { error = vn_lock(outvp, LK_EXCLUSIVE); if (error == 0) { - error = vn_lock(invp, LK_SHARED | LK_NOWAIT); + error = vn_lock(invp, invp_lock | LK_NOWAIT); if (error == 0) break; VOP_UNLOCK(outvp); if (mp != NULL) vn_finished_write(mp); mp = NULL; - error = vn_lock(invp, LK_SHARED); + error = vn_lock(invp, invp_lock); if (error == 0) VOP_UNLOCK(invp); } @@ -3878,8 +3890,23 @@ generic_copy: * stable storage before the Copy RPC. This is done in case the * server reboots during the Copy and needs to be redone. */ - if (error == 0) + if (error == 0) { + invp_obj = invp->v_object; + if (invp_obj != NULL && vm_object_mightbedirty(invp_obj)) { + if (invp_lock != LK_EXCLUSIVE) { + invp_lock = LK_EXCLUSIVE; + VOP_UNLOCK(invp); + VOP_UNLOCK(outvp); + if (mp != NULL) + vn_finished_write(mp); + goto relock; + } + VM_OBJECT_WLOCK(invp_obj); + vm_object_page_clean(invp_obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(invp_obj); + } error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0); + } if (error == 0) error = ncl_vinvalbuf(outvp, V_SAVE, curthread, 0); @@ -4021,6 +4048,7 @@ static int nfs_ioctl(struct vop_ioctl_args *ap) { struct vnode *vp = ap->a_vp; + vm_object_t obj; struct nfsvattr nfsva; struct nfsmount *nmp; int attrflag, content, error, ret; @@ -4038,7 +4066,7 @@ nfs_ioctl(struct vop_ioctl_args *ap) return (ENOTTY); } - error = vn_lock(vp, LK_SHARED); + error = vn_lock(vp, LK_EXCLUSIVE); if (error != 0) return (EBADF); @@ -4064,6 +4092,11 @@ nfs_ioctl(struct vop_ioctl_args *ap) * server, the LayoutCommit will be done to ensure the file * size is up to date on the Metadata Server. */ + + obj = vp->v_object; + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); error = ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0); if (error == 0) error = nfsrpc_seek(vp, (off_t *)ap->a_data, &eof, From nobody Fri Jan 12 12:02:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt14jMgz56h6H; Fri, 12 Jan 2024 12:02: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 4TBKt13Thjz4t71; Fri, 12 Jan 2024 12:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+gdKHDhy2GoyxzWPtbIUZgdTcVfdprB+geJjM4NUpo=; b=qZf6qOMBGg/k/ylIZVSkxT7a22LwVwozH5SIPqkE059DCiLLHmPANXnGkSVZ98HYXGpPcp 4QUGOtsjZWvg5UuizwS+d8mJWxB+79LDVprQmYaYE/N1EzzE6dZPNP6I5X7xybY+bnE9ge CXZ6yhel3D5mfEbT/iU2Bkyfqg1SbgaNupyhTlCEVqtsXX/l5GkvHT1krVVGqFi/J+j+7K PcdVhii8qfvgu071MnOFKKAuFPTWo6jtMbpEQtaErdG/7WUwQFGf5qOcjDZaa88kKEzYOd WFU6v6nfYrvqWfLfE5o/ot7PFoXPVDWvN2P5hx01DojkW1LGIPgr7tmoXqq7nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+gdKHDhy2GoyxzWPtbIUZgdTcVfdprB+geJjM4NUpo=; b=T9nRt9QhiyDNQoeWGUA7S5ifv9IH7eDMWhgazGPkHzGLPXwkCfxcmaxZoI4TSu17WG1E6c tYc/qnTPO+OABJIhs1Q7EPf420P/ERH5bjMapl+6jgyfkWYuWF4son9giHTEd4xO5UN+KZ 4GwV95F582FZGLpB2yitLxBjtn+BIZewDo++ghxu/B0ZyhTxYqmcAv+vC1HewHnc2TrWhs 2i49pIuxdtA0PGuAbcyPjEdseZDoVssJZvIaNhN5Io++hlHKfAseAPY4vqv0L22/BS8E8z k8F8r8oNXfBaRe1V+D+KfVN6Rf9zqhkVjd8h3C+PaDYje4hisLVCdsNnAOjMKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060969; a=rsa-sha256; cv=none; b=oJcfccYZZF0SK5BCv8T7NmEGUmmdxfV91iKM7q8Rr1wsQzoHPSRXW3qknG//KgaXz2BUY0 u29SRC0UvthH/ujFA2h6rRJoCV2c5wAHDI9ugGJwPmIiGjEFu8IuX7BZFNZjpNfBo2stzV 2trN41JYpgmIyOHU8lmISWvBCqWd1ma6q9QhEr/hcVglgJy9YHfoUqRqi4uWhF5+7s488s c1rv3oMAs3ssbbqWI75ZRUhd7ji8WC9v5mGwt6H3BvHQNVReR+bD0BlqbOpSsl6N6yn03W Zqbye0rGot/P/puYLC1Y0CMJtulXosaRcxI6X0AhO5jeZG4y1UXpvvWeSl8LiA== 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 4TBKt12XYdz11mH; Fri, 12 Jan 2024 12:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2nvj005624; Fri, 12 Jan 2024 12:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2nXZ005621; Fri, 12 Jan 2024 12:02:49 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:49 GMT Message-Id: <202401121202.40CC2nXZ005621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 93be89569021 - stable/13 - nfsclient: eliminate ncl_writebp() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 93be89569021e8507b2d326902157ccf7cac2141 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=93be89569021e8507b2d326902157ccf7cac2141 commit 93be89569021e8507b2d326902157ccf7cac2141 Author: Konstantin Belousov AuthorDate: 2023-12-30 18:46:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 nfsclient: eliminate ncl_writebp() (cherry picked from commit 656d2e83d9eef204c132f879d55782affede2ca9) --- sys/fs/nfsclient/nfs.h | 1 - sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clnode.c | 2 -- sys/fs/nfsclient/nfs_clport.c | 2 -- sys/fs/nfsclient/nfs_clvnops.c | 70 +----------------------------------------- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h index b43194a3abeb..aa755a6b5f4d 100644 --- a/sys/fs/nfsclient/nfs.h +++ b/sys/fs/nfsclient/nfs.h @@ -111,7 +111,6 @@ int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); int ncl_readdirplusrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); -int ncl_writebp(struct buf *, int, struct thread *); int ncl_commit(struct vnode *, u_quad_t, int, struct ucred *, struct thread *); void ncl_clearcommit(struct mount *); int ncl_fsinfo(struct nfsmount *, struct vnode *, struct ucred *, diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index ae529d549d76..63e97f405198 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1315,7 +1315,7 @@ again: } } else if ((n + on) == biosize || (ioflag & IO_ASYNC) != 0) { bp->b_flags |= B_ASYNC; - (void) ncl_writebp(bp, 0, NULL); + (void) bwrite(bp); } else { bdwrite(bp); } diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index 98fcdf7e0048..a7ace3cdadc9 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -59,7 +59,6 @@ #include extern struct vop_vector newnfs_vnodeops; -extern struct buf_ops buf_ops_newnfs; MALLOC_DECLARE(M_NEWNFSREQ); uma_zone_t newnfsnode_zone; @@ -131,7 +130,6 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 893ab76aec0c..ec97fb360035 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -77,7 +77,6 @@ extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; extern uma_zone_t newnfsnode_zone; -extern struct buf_ops buf_ops_newnfs; extern uma_zone_t ncl_pbuf_zone; extern short nfsv4_cbport; extern int nfscl_enablecallb; @@ -235,7 +234,6 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 4ee167cfb5cd..05948b4d6ef6 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2949,7 +2949,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread *td, * A b_flags == (B_DELWRI | B_NEEDCOMMIT) block has been written to the * server, but has not been committed to stable storage on the server * yet. On the first pass, the byte range is worked out and the commit - * rpc is done. On the second pass, ncl_writebp() is called to do the + * rpc is done. On the second pass, bwrite() is called to do the * job. */ again: @@ -3462,54 +3462,6 @@ nfs_print(struct vop_print_args *ap) return (0); } -/* - * This is the "real" nfs::bwrite(struct buf*). - * We set B_CACHE if this is a VMIO buffer. - */ -int -ncl_writebp(struct buf *bp, int force __unused, struct thread *td) -{ - int oldflags, rtval; - - if (bp->b_flags & B_INVAL) { - brelse(bp); - return (0); - } - - oldflags = bp->b_flags; - bp->b_flags |= B_CACHE; - - /* - * Undirty the bp. We will redirty it later if the I/O fails. - */ - bundirty(bp); - bp->b_flags &= ~B_DONE; - bp->b_ioflags &= ~BIO_ERROR; - bp->b_iocmd = BIO_WRITE; - - bufobj_wref(bp->b_bufobj); - curthread->td_ru.ru_oublock++; - - /* - * Note: to avoid loopback deadlocks, we do not - * assign b_runningbufspace. - */ - vfs_busy_pages(bp, 1); - - BUF_KERNPROC(bp); - bp->b_iooffset = dbtob(bp->b_blkno); - bstrategy(bp); - - if ((oldflags & B_ASYNC) != 0) - return (0); - - rtval = bufwait(bp); - if (oldflags & B_DELWRI) - reassignbuf(bp); - brelse(bp); - return (rtval); -} - /* * nfs special file access vnode op. * Essentially just get vattr and then imitate iaccess() since the device is @@ -3626,26 +3578,6 @@ out: return (fifo_specops.vop_close(ap)); } -/* - * Just call ncl_writebp() with the force argument set to 1. - * - * NOTE: B_DONE may or may not be set in a_bp on call. - */ -static int -nfs_bwrite(struct buf *bp) -{ - - return (ncl_writebp(bp, 1, curthread)); -} - -struct buf_ops buf_ops_newnfs = { - .bop_name = "buf_ops_nfs", - .bop_write = nfs_bwrite, - .bop_strategy = bufstrategy, - .bop_sync = bufsync, - .bop_bdflush = bufbdflush, -}; - static int nfs_getacl(struct vop_getacl_args *ap) { From nobody Fri Jan 12 12:02:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt26wWKz56h12; Fri, 12 Jan 2024 12:02: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 4TBKt24s6hz4tNM; Fri, 12 Jan 2024 12:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Th2uM3G6etTJ/t07pn7XEa58FB8pYmOVflhXx/wKUz8=; b=dyjYYZHrD5h+MEkznKTNchV4O/C4Y2eG1B434J0htA4IBXWn125tR/699iFddnPVmD/3TM btfTzBaCZvL0HNjfJ/n4P5p5SeOYxIRuLZVGJKgpood/RJVwThJ6K9yYbPSCfJAV9BEWNg hEfG+zRIDEsLq//ir/5YlnWMPo0WbZu9jWFdtZq2Cn72PhLsBiYgJt0YvBOkMs6aXDsRvG 1QIIpmfajCsBZhOIBo6+3DC/cBr+XCkxj7SKIMwqG+O3aCM30OuiIpJY2mZ63wQWNix3eS 5fbgLYdmbafKKe/Hoam7OclksJLf5BsTwaDTDeuENOe7jt13uYMQbfALnELODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Th2uM3G6etTJ/t07pn7XEa58FB8pYmOVflhXx/wKUz8=; b=ACa2k7f9eCI9ZCEEYC1Qhpr8GAjH45jh8OpO3P5Tk4FdzgpQ0u0EtL+C6Xehj7ZpUhqVDZ ctPVN8Ga//DvBA5KyoMyggvjX+R7cVUKqFVu72EtXkh4sNpB/cHJ0XD7hKiuKisZ3TdYHq RiBL9e2p2vL2nTXUD4C55z9/EaFTH5SxWukZQjnDMw5g/UcZS4B93FXZXXxqAXsgVc/epT ZoaTlBYKFIG8RiarMMcmq7yCeAw0MiiZXQRGe1kHDEMx5gU+nNkhzqMNOUCpC0HpLmGCJ1 Kr4B9uLpN9ICag0CRxupI+6tR2YjKp3rjZMb9/HZp5dDJO7EX/NMD8gNmd6+ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060970; a=rsa-sha256; cv=none; b=v+0Q2vwFXL1LACvoqwiFMPqdspTjVYQMWRs0PKNfH0feK31iyWJc6tJayTHCxD7dQdUjSH 6L0FizidKxSB3dfp794whLLfe20Juqm8sZoGou01HDNKa/aJinVlep7iGxk/6tUIrVTdhc 6sE5Jf3Dra+0iSpu2Rdr89rp2P94NnN1wUKQt8mvZmJ7l9YtVJPLSKtsUq00bKV4KeXfTm tdnRlj1wtQs+hy1kP75T8bUQpSY39y0FRdcS8/iFKko8U84+xt97CP0jM0vk9gNpeY/Gdz rcwADF2In+1sFu/sf2SLWilxyJDEhZ+hyat2s/Xmueja0en2bLPHgDHbyP7bfw== 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 4TBKt23ckwz11mJ; Fri, 12 Jan 2024 12:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2oEZ005682; Fri, 12 Jan 2024 12:02:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2oSm005679; Fri, 12 Jan 2024 12:02:50 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:50 GMT Message-Id: <202401121202.40CC2oSm005679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3828d60715e6 - stable/13 - vtruncbuf: add a comment explaining the purpose of the loop List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3828d60715e64cfbae93449858cc6ae8ce615a63 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3828d60715e64cfbae93449858cc6ae8ce615a63 commit 3828d60715e64cfbae93449858cc6ae8ce615a63 Author: Konstantin Belousov AuthorDate: 2023-12-31 20:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 vtruncbuf: add a comment explaining the purpose of the loop (cherry picked from commit 4c41d10f1538c232174d5200d245e5fcd9936958) --- sys/kern/vfs_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3305110ed065..c9c76c903977 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2564,6 +2564,9 @@ restart_unlocked: ; if (length > 0) { + /* + * Write out vnode metadata, e.g. indirect blocks. + */ restartsync: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { if (bp->b_lblkno > 0) From nobody Fri Jan 12 12:02:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt40Zwnz56hQc; Fri, 12 Jan 2024 12:02: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 4TBKt35cgsz4tGB; Fri, 12 Jan 2024 12:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAcT7Rih+TDJy5pJgSRjo3utMaATDCj/bjQOw/yP4Fg=; b=YH/8h6xhB2y0lL414Ei/sR6xwfGqMgOm7irJbt4gQ0XVRXRm0R8tJpqZbA6o0U4cW87020 z4TzbBPWzt6o7jgSIZGaan1m1UxL3L/iP7UMVv+W/UpUIZOGYJfAl7LiuiDzvaCtVdKWiq 1PL3R1o8n80twrlRDk40y5syPmhetnLcISEDRZVlv6NrhoXyHUHgCGZLQASPHuvkA2WF7H 0Dhk5kT+jnWaq7KkBGdWnVWo2jO26Z6sQb4X4HePsUW9Q3AnQ0vu8VS1teNdbESGXDKxw2 AQMUys85ue3WYxMJF6GAehJELN7MKuYkW7dvKwjNZJXYsss5KUtczZdI+uRayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAcT7Rih+TDJy5pJgSRjo3utMaATDCj/bjQOw/yP4Fg=; b=RSdlUTHWLWC9ZDeH50RTF2jmhZ+G8iuGheRF8tbZLv7i/+Hd9Am5GWvT3Oj2xyySQQJeA6 JYCfV5zQg67ygC5ars7Tc7OG7qqhm93OWlz21yj304ohQxdZRBVtHNSWbMf2hxZVYL+Wrl 7j9oh1eJfN+d3H32SxaiUJdQXtve8dvaZnHib/VayXudt3rJLB9Z5doeFJJHfVV04Vq9G2 O50tXbTa+zUuOs0TBdig2M829YX/PQP/zsyqNTiW0N5kAGKf34pFHL+NovL41IQM19gG9R MOQUs6RdpU180IP5DDUcvsDaXlSJrdaxpdiV+ShQ3O1ztrUSNo9HQO3OkTPNeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060971; a=rsa-sha256; cv=none; b=yGhw8Z6QbdSVX4dj/gYzf1wNnL6nGLr5bWLAzUUCLhz7osFzTYBoO8+PpRPiDtUT3FidoJ wTJXsbcoLhusp4Sv2q6VULA0KrNiWbpcy9/j4GZm/FWJpMojf2PcvZqLLSbykGrqgnKMSO NaxqenW7ahsZA3ZCF6OlRw9vcGRYtkekKnnrZGS3SC+j9p9wu/rLHV56JB1dfass8i0CTl 6630UAO0yn8decE+5Np6VdeBtvTsTnl/fomFJmSgcQ+ZSLboBeQKBQpuoNgXK2Ak8ez4jc 7oxJQarxnvlMde72L5EANtuaQLvVVifAUrYqPau+fDTvdha6axXh0eplRRna8g== 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 4TBKt34g6tz1237; Fri, 12 Jan 2024 12:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2pYo005730; Fri, 12 Jan 2024 12:02:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2pZ3005727; Fri, 12 Jan 2024 12:02:51 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:51 GMT Message-Id: <202401121202.40CC2pZ3005727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0166a12e580f - stable/13 - vtruncbuf: improve the check for meta buffer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0166a12e580fbacdba9f669065c43e98d3a93aca Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0166a12e580fbacdba9f669065c43e98d3a93aca commit 0166a12e580fbacdba9f669065c43e98d3a93aca Author: Konstantin Belousov AuthorDate: 2023-12-31 20:46:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 vtruncbuf: improve the check for meta buffer (cherry picked from commit 2d33ad48bd37f27925e4c46c798f8f2d23a2b501) --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c9c76c903977..1166fd6c5389 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2569,7 +2569,7 @@ restart_unlocked: */ restartsync: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { - if (bp->b_lblkno > 0) + if (bp->b_lblkno >= 0) continue; /* * Since we hold the vnode lock this should only From nobody Fri Jan 12 12:02:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt536TBz56gyf; Fri, 12 Jan 2024 12:02: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 4TBKt46c1vz4tJJ; Fri, 12 Jan 2024 12:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jYm1VERnF9vPweVocYK6sD3II+coE4bE4Td0F4im+oM=; b=U+FGgpgDNTecX5ZYb3Aqx17R1MF9e3O7TlAKMwk/bIuspqeS1c6gnm5DL02SFS++Z1j4FA owvXc3FZjWFu2IaG5f0id63Qo7FbXTsGzCRu6ZBfapoCfLuj0HxhRVsmVh0/qQNjZyIX62 i+u4sjaoZ3XvAFYjC5xk0AdmCMjgMya8KDqxKJWmwhLDfrEznft9mzvK7NllvnY2wg3UEm /sOcHtN8HK/auWqIyQORTYzDuuSdYg/+Mwblr+W7yBT3+4jlsT+jUi0UnNYO6ibUuqD84o Bcy4IvOAl1+V+S+8uYJMFfaoSJYvGV/9H20D/Ap3FV9CkZlWPNxBb86fBILRRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jYm1VERnF9vPweVocYK6sD3II+coE4bE4Td0F4im+oM=; b=BxMZ0/gITffdeGg7lviyg9PTdd4PgwCHfJGiwu13cTUN/b2ZoXuyYmqlPqU43OE5pcXcPH rpyPgIDvxvCpxOL/fQxUcibsyUEbN3N2otDL6MmlRZzAdt3qHrsijuh+j1INJe1NZABckm 38CSvZK/VHN7x0ZGPdjWcjnI+PPuVW++nchPYoPbtLaei4zYHajcT0MdSImOjQEVgZL2mH xyyALIw83AqClRulseJZg745pdXu0CeazafgFO1PdDmvr7L/lW3DPnzFyjLltE+M2FHYwH o9xbzocPtCWgpjisrkdbBFL6aNcuduUEwERZiC5PJpYt6TQEgRRt6drOqdJ3Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060972; a=rsa-sha256; cv=none; b=x+qZlbIewE1bpto6hZpQk0IjnDLbyvreAqM3VIB/9kGTfGYl2mys7ZC54iiSlT3mwwUgnD hLd1qTzCpbTrwUVdIkYKHWb6jZvNeWwyfrAMo1ywWSM5xrabYnhh0XBOjiAWCgDfCZZndO TPNr8YU1CHe7/1BI7vS68DCHBwuVIrSlZ+jiPsC2VBhCu3hwywcC2/g+/asIr1BlvhTBrb JgTo2EgV+92znI9ezCkeJ/CmCaceeIsBv2GQEOgnS9Cf9ye+y2glIBRgS299k3HIuM7BGh Bi/XMyFBGHzkJ5/TN/ryTFbMc4BJfa4VQiVxJgHur0FjWIcmOiTG0C/1B8UsAw== 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 4TBKt45hSKz121B; Fri, 12 Jan 2024 12:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2qpH005787; Fri, 12 Jan 2024 12:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2qFY005784; Fri, 12 Jan 2024 12:02:52 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:52 GMT Message-Id: <202401121202.40CC2qFY005784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cc5cda1dbaa9 - stable/13 - nfsclient: limit situations when we do unlocked read-ahead by nfsiod List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cc5cda1dbaa907ce52074f47264cc45b5a7d6c8b Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cc5cda1dbaa907ce52074f47264cc45b5a7d6c8b commit cc5cda1dbaa907ce52074f47264cc45b5a7d6c8b Author: Konstantin Belousov AuthorDate: 2024-01-01 22:22:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 nfsclient: limit situations when we do unlocked read-ahead by nfsiod (cherry picked from commit 70dc6b2ce314a0f32755005ad02802fca7ed186e) --- sys/fs/nfsclient/nfs_clbio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 63e97f405198..7b9b68782d53 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -484,9 +484,14 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) on = uio->uio_offset - (lbn * biosize); /* - * Start the read ahead(s), as required. + * Start the read ahead(s), as required. Do not do + * read-ahead if there are writeable mappings, since + * unlocked read by nfsiod could obliterate changes + * done by userspace. */ - if (nmp->nm_readahead > 0) { + if (nmp->nm_readahead > 0 && + !vm_object_mightbedirty(vp->v_object) && + vp->v_object->un_pager.vnp.writemappings == 0) { for (nra = 0; nra < nmp->nm_readahead && nra < seqcount && (off_t)(lbn + 1 + nra) * biosize < nsize; nra++) { rabn = lbn + 1 + nra; @@ -674,6 +679,8 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) */ NFSLOCKNODE(np); if (nmp->nm_readahead > 0 && + !vm_object_mightbedirty(vp->v_object) && + vp->v_object->un_pager.vnp.writemappings == 0 && (bp->b_flags & B_INVAL) == 0 && (np->n_direofoffset == 0 || (lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) && From nobody Fri Jan 12 12:02:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBKt61Zzyz56hNQ; Fri, 12 Jan 2024 12:02: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 4TBKt60Wmxz4tJd; Fri, 12 Jan 2024 12:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gV3rAwzHXr5s7gwNkDri/zOc5ej7iZnmPG7eodqpBng=; b=E3L8+5p7TcibgfWPucSdnkwNA0ORlivG7goDhTfUJzd5M1tcEO6RV8TpUazeGOADBVjKob YPcz2NgHSjyprV1KAQQZCHv60KfJk8NJk+JdBUnKxN7HX6KjZt/uKhUd4Pzha7a4uF/SDb ry4+/MWGj5A/Ov+TqKBjO++I5YSEr12kIzBU6mHzuy4ybMJaTQjLSSvT44orj11Ridbo6Z eV0cFs4nlmx3oR+RlWcbYk7fbnr74ACCU7gXZE4C0gFv7THLkKm+wy9oXfDnWjjqeunI/Q qzdyIA+1iQUwnuAK9vRYGaVaG3XePeuN8n/j125SnfIwPPp1X6uhAdXPAFhKUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705060974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gV3rAwzHXr5s7gwNkDri/zOc5ej7iZnmPG7eodqpBng=; b=XnSC59YiwgP6LqNCWcnEiGO/JpTnpdObNkieoR+s0Af1+gecKWV0BCDHnqfpq4H8CeAwx9 W3FjwD4Qmz1b4TLWJg0rsdx2cgXeSlU+UndbBTxvrVc2FrCs4IyoI4RSltBvUL4G+0+FsX UchhVcCW4JL7hTWm5QHHyyPVcmGHOzesDPGK9MK5YI1y01KqW0pzuUtAM5wnb02l6WQ98g ggwaJy2cCYR+zOoSnuHaVz9nfJFdaHls2Clk/+n28urZQ23Gz+8f2C83Hjya9Si2e5Zc1/ Mh0WnOrhR6BXRNqsRbr07cw0NXIvTJesVnrc3IrR6UbSetNzvxenbn0mqteq3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705060974; a=rsa-sha256; cv=none; b=UoiLBzLEmGH2pdcKyswIzRkGhrAnp63+VmcJlpgQLtp6N52LfIIo0lTW+aFcrNSd9v2zZa atDp03mw9UdSU+DWYTZRiFqvW/tS1cCI4Lo+JyJ18APInmjtbyuGKh9vYdDXT3Y3maRHeL glwCVzNqe+J0x/04RGRrBZWlmZQ8NBB3fWFqixNNV6Ygjvyn8ZPp5uQAEi4ZTqeE+5SIUh INwCtE//ThHcZEQcTv/3U/GLNLkxVr0d2v3mdWcyAwz9qHHZ0SbMSEjslZ4GWaAWJp3Hv3 7nmfiL3tME8yPxF0W8nf5/HfipS6VCPJOdQ7ibQJp4JfiwvHLpKBaAhiRe94Ww== 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 4TBKt56gLvz11jW; Fri, 12 Jan 2024 12:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CC2rr5005827; Fri, 12 Jan 2024 12:02:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CC2rdJ005824; Fri, 12 Jan 2024 12:02:53 GMT (envelope-from git) Date: Fri, 12 Jan 2024 12:02:53 GMT Message-Id: <202401121202.40CC2rdJ005824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c85e01d0bfdd - stable/13 - ffs/ffs_rawread.c: clean up includes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c85e01d0bfddcd23123a8b69d7a92cda55f2e526 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c85e01d0bfddcd23123a8b69d7a92cda55f2e526 commit c85e01d0bfddcd23123a8b69d7a92cda55f2e526 Author: Konstantin Belousov AuthorDate: 2024-01-08 05:36:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-11 16:47:52 +0000 ffs/ffs_rawread.c: clean up includes (cherry picked from commit 8a4577423e82c54942a9390658d059f1169187b1) --- sys/ufs/ffs/ffs_rawread.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index a8df78ee8eff..ef93c1ab6783 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -26,23 +26,21 @@ * SUCH DAMAGE. */ -#include -#include #include +#include +#include +#include #include -#include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include + #include #include #include @@ -54,8 +52,6 @@ #include #include #include -#include -#include static int ffs_rawread_readahead(struct vnode *vp, caddr_t udata, From nobody Fri Jan 12 15:41:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBQjx0VMbz573D9; Fri, 12 Jan 2024 15:41: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 4TBQjw6GX7z4LDC; Fri, 12 Jan 2024 15:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pS/r4xi6pVXEukIxb+xgcHFPMrD6+az4rilbqXxGrNw=; b=WvuLqHgcV4ZzWa5Rvuv0nrzMUV2/gVq5TGQqbfgR8sIrkJJUnAO8pq0svQYGU21Mtmo7Oa 0PIFaTi+vPqQJeE5Lf/96N3gIJqe1tlUNpgLIZRWeYHezvlM4gQRU0uUgLtG2U8gmDufCC dQ+NaWGS9yFHBaCWNCgd3GolQXY0UAZe3HilkMPPKsm5yDM3WZigMdFvjCeL8chtZpKkKE t3i2bS2AZQnVUcUqodYeVjv4QT9emKdGXl1gjPX5MaRfiQOldALOu2GZQN7p/x14KpHOGZ Lmdnpimj0SCIqMbCsNVU62m4g5hcp5UZyLspwlTvqpf4lFBUVHPDeaD+OF/Jdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pS/r4xi6pVXEukIxb+xgcHFPMrD6+az4rilbqXxGrNw=; b=kFTP6AR83GJftnyXlsfR0sWgGOxV+MaBvbIutoY9iiyg9X2dGCsKBpAXFXfoXBHrOMfPsa kdDT/SEsueep6Y3cvLkHed/MWH8/YDa8FE5BQB1hZhhxZgHAAM1LRj+IGXCMllGPI9KZdj hoPtl/S25QTZPY3Yzs8Yu27D4y3LdnFJBxNrB4jLVYtniJTyzIWAKTxQgNcAKIc24X2sc5 OX8qqX+mcZfMBOlNeorDQi0rAG4MjBdZlJAQD8DJiqoEk9v1+p9RXNPVaaEQveFtabaFeX Mn0unHcO8ybJtMk3SabiRDd4vBQyfihshdUfOQga54TcRhKKBqkWrOVls6qTpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705074068; a=rsa-sha256; cv=none; b=aY9yBXIxMMpJG+R0UAlE1HZVsl55CPgbVgU4uYJAnsnpKR5LHZku6I/lGYLDjg4F6nyeah wTTBfLgtDvgTy/2uTsE8tnI3B4LfsknawR+MZiRwfB/IqbPaiWZUWw6h/tTp9sJ2jCr1rC utwleXaXxH7JaC9vgTF+Lw4jfkN6Spw1vPVCTxk85iJxl22Teve8iX/LbRtl/aQCcSMqld aqeWj9Hl2g8DI5NDY5+BnPH0xFAph1mUrTuScw7aVH44KJGwZ4g+6bShPxA/f4zxSHMGts tlDgl6WPrK+9IBIm7gjOmSATfbJ5pHF3NnU88CzxYjlq+DjupzOlxt/9SDuqrA== 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 4TBQjw5KdZz17L4; Fri, 12 Jan 2024 15:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CFf8OR071324; Fri, 12 Jan 2024 15:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CFf8Z6071321; Fri, 12 Jan 2024 15:41:08 GMT (envelope-from git) Date: Fri, 12 Jan 2024 15:41:08 GMT Message-Id: <202401121541.40CFf8Z6071321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 13fbe20942cd - stable/14 - tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 13fbe20942cd99c77daedd28560adaef4653fefb Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=13fbe20942cd99c77daedd28560adaef4653fefb commit 13fbe20942cd99c77daedd28560adaef4653fefb Author: Michael Tuexen AuthorDate: 2023-12-09 11:57:19 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 15:28:41 +0000 tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface When using the sysctl interface for setting a SOL_SOCKET-level socket option, the TCP handler refers to the IP handler, which only handles SO_SETFIB and SO_MAX_PACING_RATE. So call sosetopt(), which handles all SOL_SOCKET-level options. Then you can use tcpsso with SOL_SOCKET-level socket options as expected. Reported by: rscheff Reviewed by: glebius, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42985 (cherry picked from commit bed7633b108930e9e9d2478c75556035938d4e88) --- sys/netinet/in_pcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index a54b93812c55..b00d61eaecf7 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3020,7 +3020,11 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, so = inp->inp_socket; KASSERT(so != NULL, ("inp_socket == NULL")); soref(so); - error = (*ctloutput_set)(inp, &sopt); + if (params->sop_level == SOL_SOCKET) { + INP_WUNLOCK(inp); + error = sosetopt(so, &sopt); + } else + error = (*ctloutput_set)(inp, &sopt); sorele(so); break; } From nobody Fri Jan 12 15:44:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBQnS1x7pz572xp; Fri, 12 Jan 2024 15:44: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 4TBQnS1RwYz4Lxw; Fri, 12 Jan 2024 15:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iKL5eIfq04L7z2tccDclV+bDjIIpTIEqvpLpQm9s40=; b=jFYVNC4YK8lWFd5fOT3y8kYunc/UKLsY0gXxk9ljjNBaH11bC05OsI3LA+dVHRyQIamhS7 RkgwMG+pZZiHo7cNE5sydiPz2ukHBz3W9QbTBRl326du14a9tysyJyDxTTZB4oCNhtIj5o /rUS8xl/w7p+mlfK7hPdGexrcFpXnnvr+/LLognOuTxPi+xM7+ssn+8+LcH1G9tTI5pEHA EJXuDtLfxA+Dm2O5132neN2Zyf1axlfTRqA61kS3Bqe1yawm1iIR8TKZaTM7epnzK615Ar VyeqaYS2XmmrR7cXtqvcLRKsfJZzCUv8Zh9tEwvSPc6j4UJuvIJvXteFmzmpAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iKL5eIfq04L7z2tccDclV+bDjIIpTIEqvpLpQm9s40=; b=uEGyTZXhIfBmfjplMUyJiizETl3SKcu3uXHA/xTBroqnGO+KCjPHbzeATAwr6Z4NtqooOh YZlATBqLaWIVagqlAi8bUM8dPdkCOGTtDW7KG3RbotenC6ueMBBUfbsj1NqfH12rCt3FZw BilsMsprmfQ8DDfFhyx9br6EL1igjlBlwaAOS1bPe9ZLsjyVwshGClEzoYnA0rQ9VhKawV 2S+0Ii8baXXvNSxeOz+O3n4g3YzPknyLCRWWFDILiL0p1NvStaBDWMVNyKN3LpPBhvD1ce 4IW4CRWwuNndvDarNvqHjL086h6l+EfJc/EvOTmVBCsujFVPGeb5QCmVZ+rEMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705074252; a=rsa-sha256; cv=none; b=mEwRUsQ/GAQfk6z1MamnvKM4wpl6EmEOVrmkp2Frvq/BLIT7Zj5gXRpB/2RExno0fNbjzv GyYORqUgKmfiW2wMr4iIJmcvQjzgCKfLp5bayaIXNhrYZHFtYUAAskvoqm4+J6YEks1Fys DnJUsvWKBmFuERQkdvw6BJFCBffTKpFaRhC/lMzg838jHw/fH7QbczM3pu9c42tNEfSuzG ice2DGb8mYHArCPg87bwPyrJ9qIH6twznpRXrDBtKqx7PnbObQlzlF9LgTrEO70WTI/kbG 9oWlJbg7MXrY2a8C3Lh+k6zaJva6OCO1EWKnZBtl4iu/rOanj7OMVZ0wBt3iwA== 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 4TBQnS0Vdnz17b9; Fri, 12 Jan 2024 15:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CFiBlj076343; Fri, 12 Jan 2024 15:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CFiBAQ076340; Fri, 12 Jan 2024 15:44:11 GMT (envelope-from git) Date: Fri, 12 Jan 2024 15:44:11 GMT Message-Id: <202401121544.40CFiBAQ076340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 77292494fb3c - stable/14 - tcpsso: fix typos in man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 77292494fb3c831d5b70923f2258869c252b0311 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=77292494fb3c831d5b70923f2258869c252b0311 commit 77292494fb3c831d5b70923f2258869c252b0311 Author: Michael Tuexen AuthorDate: 2024-01-06 18:17:04 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 15:31:38 +0000 tcpsso: fix typos in man page Reviewed by: manpages (bcr) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43342 (cherry picked from commit f402e087379cf6b2c6045348f87caf69b4ebebef) --- usr.sbin/tcpsso/tcpsso.8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/tcpsso/tcpsso.8 b/usr.sbin/tcpsso/tcpsso.8 index cb51390abac2..36707d6657d4 100644 --- a/usr.sbin/tcpsso/tcpsso.8 +++ b/usr.sbin/tcpsso/tcpsso.8 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 30, 2022 +.Dd January 6, 2024 .Dt TCPSSO 8 .Os .Sh NAME @@ -83,7 +83,7 @@ state can only be handled if their prior state was .Dv SYN_SENT . .Pp .Op Ar level -can be specified as a non negative number or a symbolic name like +can be specified as a non-negative number or a symbolic name like .Dv SOL_SOCKET , .Dv IPPROTO_IP , .Dv IPPROTO_IPV6 , @@ -99,7 +99,7 @@ If that is not the case, is used. .Pp .Ar optname -can be specified as a non negative number or a symbolic name like +can be specified as a non-negative number or a symbolic name like .Dv SO_DEBUG , .Dv IP_TOS , .Dv IPV6_TCLASS , @@ -109,7 +109,7 @@ or .Dv TCP_FUNCTION_BLK . .Pp .Ar optval -can be in integer value, which will be converted to a binary value and +can be an integer value, which will be converted to a binary value and passed as an int value. If it cannot be parsed as an integer value, it will be processed as a string. If the From nobody Fri Jan 12 15:50:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBQxH14Vhz573hr; Fri, 12 Jan 2024 15:50: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 4TBQxH0X18z4Nwh; Fri, 12 Jan 2024 15:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqkvuVtsclB5AF0hUzS9d6Y8bDHMzn3dVv59vE0rEoE=; b=Pxlz2KOlR13XiCjzEF0Hgb9mSlI8pScyxqv1xBKDFYmiKBu+fNxaMBvaH14172khjRZPVT ceWqld2T0oHvU65ZcOkNEHzHKi1nO/YkX2fDYhxxyj5qlXKA3WAjFXYnwsTcxlmgVv3cUT FuoJshU2seD07OlG2FfjYfTDhby7v9DewgBLTC0Is+/kMH7nkd23tRe86PXHVbWczOMpk2 yzxY7Vw+VvrJCRmpwqOFW+NSfs7Qt+9RXCI458RS4JTOKcFgOPAlaEQSQJ7ES1jdIk7sd9 1WM6EjnIJh6K5QEtEoUwN+c4hhOamQVllryu+hk9mEkh/Xn0MG9NnT44ziBxYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqkvuVtsclB5AF0hUzS9d6Y8bDHMzn3dVv59vE0rEoE=; b=H9ZrIFwCMC0ybTl5SN5U1ON+ka4tlWN8OXRWo7Xvt2q7jW4PxQYtvFcD8iOZx32E6/NeWO TB3TzqEY1ZY8w+W+9/qY5tQKHFg0FMFXsip6unKVnek+gG5HmgWSkeQU2igWsGWuIAZqef beT9UVqDihK9xTr38nTb+w/gqx262yvTDSfGlgdsUyAQU4+82MywWHI6x8nryHqQvAPlRS sgYa+vNTDlOKjqtpPcIr8sBxPl8Bc4J3IduUZMyXA5rDOqLMuPO+ZpugjKZ+4Sc3QjP7nO 4f4YqRBr0EaFEeLbYMFW3CjGiSYGjWFPm9AbgT7P2jMBVIrbbD9apKFep4AIkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705074659; a=rsa-sha256; cv=none; b=QNcH7EVCL7LJRO12qnVRkE6JPeFvscMqRdVGXqdKmnkqzhLpmBlrZeo07I1ZYGscrkyl1D 06YacE0urFfydhhCAtMiZZqa6GiMDKd6Gl7FRswfa0vxpiGUDUbDtcZZ+J799Pln8NrY1N jQtAIUfzdd95hSGxU3rjHnp/1KIsrIFqPnzmyeAF5K6b6GVRdnsh4wqFA7fOF8L+ENynRA GWibCErI37lj1dsnUXhb/xJjrc3Yi6wEHCVs4YebQe5se9psPD+SURA1lvDZAO3lY2/Yf3 BUwDRMIWYAJWlNUPPgXhmy7HG0VkaUMxkG1vE6g8b583XNJX9j0kt/NXW/e2xA== 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 4TBQxG6hPzz16wp; Fri, 12 Jan 2024 15:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CFowjI086312; Fri, 12 Jan 2024 15:50:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CFow5t086309; Fri, 12 Jan 2024 15:50:58 GMT (envelope-from git) Date: Fri, 12 Jan 2024 15:50:58 GMT Message-Id: <202401121550.40CFow5t086309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3f57a09489e5 - stable/14 - tcpsso: support TIME_WAIT state List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f57a09489e523fdaea4c927cf725b65112af56c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3f57a09489e523fdaea4c927cf725b65112af56c commit 3f57a09489e523fdaea4c927cf725b65112af56c Author: Michael Tuexen AuthorDate: 2024-01-06 20:31:46 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 15:38:23 +0000 tcpsso: support TIME_WAIT state TCP endpoints in TIME_WAIT are not handled in a special way anymore. Therefore, they can be handled now by tcpsso. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43351 (cherry picked from commit e179d9739b1438ae9acb958f80a983eff7e3dce9) --- usr.sbin/tcpsso/tcpsso.8 | 12 ++++++------ usr.sbin/tcpsso/tcpsso.c | 5 ----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/usr.sbin/tcpsso/tcpsso.8 b/usr.sbin/tcpsso/tcpsso.8 index 36707d6657d4..c06cd8adb25f 100644 --- a/usr.sbin/tcpsso/tcpsso.8 +++ b/usr.sbin/tcpsso/tcpsso.8 @@ -74,12 +74,10 @@ and value on a TCP endpoint from the command line. .Pp TCP endpoints in the -.Dv TIME_WAIT -state can not be handled by -.Nm . -TCP endpoints in the .Dv SYN_RCVD -state can only be handled if their prior state was +state can only be handled by +.Nm +if their prior state was .Dv SYN_SENT . .Pp .Op Ar level @@ -176,7 +174,9 @@ is one of .Dv FIN_WAIT_1 , .Dv CLOSING , .Dv LAST_ACK , -.Dv FIN_WAIT_2 . +.Dv FIN_WAIT_2, +or +.Dv TIME_WAIT . Using .Dv SYN_RCVD only applies to TCP endpoints in the state diff --git a/usr.sbin/tcpsso/tcpsso.c b/usr.sbin/tcpsso/tcpsso.c index b79ae9767fe2..7e7e25246d80 100644 --- a/usr.sbin/tcpsso/tcpsso.c +++ b/usr.sbin/tcpsso/tcpsso.c @@ -115,10 +115,6 @@ tcpssoall(const char *ca_name, const char *stack, int state, continue; - /* Skip endpoints in TIME WAIT. */ - if (xtp->t_state == TCPS_TIME_WAIT) - continue; - /* If requested, skip sockets not having the requested state. */ if ((state != -1) && (xtp->t_state != state)) continue; @@ -453,7 +449,6 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; if ((state == TCP_NSTATES) || - (state == TCPS_TIME_WAIT) || (argc < 2) || (argc > 3) || (apply_all && apply_subset) || (apply_all && apply_specific) || From nobody Fri Jan 12 15:55:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBR2V3c5lz574Mg; Fri, 12 Jan 2024 15:55:30 +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 4TBR2V2g2hz4Pd1; Fri, 12 Jan 2024 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bk9Rfyt4wZZ5u3wku8BR5p2gyFvP4iBtdl6Ihdln4MA=; b=WcP2Mlt25dz1e/piihwCj9MTFiqgWd19wXGcNpJWJk6ARQhGAWw/8OaUkls/hXNJcWkBoQ FirnG03loxnKHfqAsITJfxuWq1mKipi3HcCu9NwD3eRgnjHRPiY93rq30wcWPBueoTDM8I ddwsFcEIvaJrhPv0WAKKq/dcaUMP+4+YEQdZRFIuuGKcrhJpux9EJtD2adzwOrZICbBOX2 5K6Hb0D2r01AGpls/+Fm6FLlYkNVsEAyF59mPf/barlEQnLs9125H4iUfxv3WwrdnNPQ78 5FeP54f4Jg7w4P4d2HZRRxJVqWY5wPiYwrwpihV4rPT7uJZwUsZQD3oRbrzhYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bk9Rfyt4wZZ5u3wku8BR5p2gyFvP4iBtdl6Ihdln4MA=; b=cFkIVxqm4UuoUec3osFQrQgT88mXR9UJweNqHOfULUAFe1Wp4F0vJ1zFt51I+fAsSwMeiz FrATBxkWePRdgxrxVuaOaqfn/1psnbBD3xeQqGU6FVapXgi+HS+UY8hM2nta9pRtCP6/XN D56YR+5MlXdhwqw1FyLSnGwmwXiQb1L43FjqRyPx5eDI+fGRVy+LkFHizjp2T4S43dx+Ky NT3pZ60e4DTGDuRDWjzldn6PdNWcGSGia9YH40Ba5qR0fYsexU/hmZbsL42o/YxBwRubw0 cxKaB8mA5moq4QuFyVDGu0mlVr6Ih5cMlH9qSoBdN5CdkjGD3xwyg9E5jQPkbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705074930; a=rsa-sha256; cv=none; b=jiu4XiKUl+DI0IA+9xYvrp1KmpSi3a/WoiwvXSWBAsT0M7iYlK0X1BMyeUe+RuCjBeLh9K OXJ23NFeZbMEOM1TxOe/3mcGzmyM+fouzUGtLAoDIEYTi4aq19kgI5vKMKJe7sqS8rmC0D Fl5tj44tHSV8vq15Tm1Sm/sKDApawq98ascNPOpuTVTwdLVnEptgD9UjnOiIsY5AnflQAr lSPiIH0ihd6ZwbE6iqZwuraLaeFZdRmInOLPw+OZvs8vTr+Iua+Nv8jDVjdLkdGIbhPNM6 fXOefmAepc4zAjVsv83Q8Z0Ltul4AqOiVnIR4nYR3E4NLNfePXnrXuh089ejjg== 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 4TBR2V1jN3z17Zd; Fri, 12 Jan 2024 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CFtUqi093454; Fri, 12 Jan 2024 15:55:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CFtU03093450; Fri, 12 Jan 2024 15:55:30 GMT (envelope-from git) Date: Fri, 12 Jan 2024 15:55:30 GMT Message-Id: <202401121555.40CFtU03093450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6b019c30ace1 - stable/14 - tcpsso: fix when used without -i option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b019c30ace18b49822ca0869227e677c4ca8081 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6b019c30ace18b49822ca0869227e677c4ca8081 commit 6b019c30ace18b49822ca0869227e677c4ca8081 Author: Michael Tuexen AuthorDate: 2024-01-10 07:33:09 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 15:41:49 +0000 tcpsso: fix when used without -i option Since fdb987bebddf it is not possible anymore to use inp_next iterator for bound, but unconnected sockets. This applies to TCP listening sockets. Therefore the metioned commit broke tcpsso on listening sockets if the -i option was not used. Fix this by iterating through all endpoints instead of only through the bound, but unconnected ones. Reviewed by: markj Fixes: fdb987bebddf ("inpcb: Split PCB hash tables") Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43353 (cherry picked from commit 13720136fbf951a7b472ce086c9cf2de702799ab) --- sys/netinet/in_pcb.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index b00d61eaecf7..95e162e60f53 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2991,25 +2991,22 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, htons(params->sop_inc.inc6_zoneid & 0xffff); } #endif - if (params->sop_inc.inc_lport != htons(0)) { - if (params->sop_inc.inc_fport == htons(0)) - inpi.hash = INP_PCBHASH_WILD(params->sop_inc.inc_lport, + if (params->sop_inc.inc_lport != htons(0) && + params->sop_inc.inc_fport != htons(0)) { +#ifdef INET6 + if (params->sop_inc.inc_flags & INC_ISIPV6) + inpi.hash = INP6_PCBHASH( + ¶ms->sop_inc.inc6_faddr, + params->sop_inc.inc_lport, + params->sop_inc.inc_fport, pcbinfo->ipi_hashmask); else -#ifdef INET6 - if (params->sop_inc.inc_flags & INC_ISIPV6) - inpi.hash = INP6_PCBHASH( - ¶ms->sop_inc.inc6_faddr, - params->sop_inc.inc_lport, - params->sop_inc.inc_fport, - pcbinfo->ipi_hashmask); - else #endif - inpi.hash = INP_PCBHASH( - ¶ms->sop_inc.inc_faddr, - params->sop_inc.inc_lport, - params->sop_inc.inc_fport, - pcbinfo->ipi_hashmask); + inpi.hash = INP_PCBHASH( + ¶ms->sop_inc.inc_faddr, + params->sop_inc.inc_lport, + params->sop_inc.inc_fport, + pcbinfo->ipi_hashmask); } while ((inp = inp_next(&inpi)) != NULL) if (inp->inp_gencnt == params->sop_id) { From nobody Fri Jan 12 16:34:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBRv96W39z577JH; Fri, 12 Jan 2024 16:34: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 4TBRv95yqQz4V6n; Fri, 12 Jan 2024 16:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705077253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SFuEqcR42gvymwsh888EIRRYNIZFYdPzQTxpOfyUuRo=; b=GqchR3HdP+aX6B17bUxYpUI+/ffZxd7kgffyYcT5DkmKGNttt41y0SGjvrvoOxMSN6NSdV vqcwtSSEYxmdRwX28STX9zRM6g6NinB6YoISpAL+yI248Op8FiueeC9OvLe5N1xebSjQ6k pycHi0AGwbH5SHkIxKoC2jTnARD2nzqewRcO7tZOTnCJHd4FtPOmrwIZS2VGMua1DsUJb6 Jd/Di9zRPsp30MfOY59yWgnpGcMyG1fAIqFP2aq+lu4NhgsfTmnesvDZj2C6ZxQhAiqBTE kln3jpqHRyzyuFTOXaJKAv7KlW1/pHlS0Lrz0/nT7okq1//hsliUYOEddljUiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705077253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SFuEqcR42gvymwsh888EIRRYNIZFYdPzQTxpOfyUuRo=; b=WixoKzqbcI7CJ35TdjA+Mf0eaK95Mle5FQ32Xv/1p6yJhfkjLH6PYWuEMzH87TcmDf6/bT F5Cb3Wp1+pxLju+xUpLtHcjirELndGX2ARGMaVTdjuJOkX+yD4nHvXWKCGsQIe+iXGXZeN RFgXF/jdS9kCATHOf1adOCF7396ZC3aeQjAzRgjoBAISC2VepjJrRgKL9N43WOVa7H5Z75 PADOZqtxxensZS6PFbaBIIG+bMipm4kSONqiQd2oZpOtTG0Dk9aX6JnRCtK8JbDNB3wo8I yAUrd05dGOFBxL8PCyWlo/7GB4r1mJPYrsovdNDP+732Ip2epE8O+ZZmAOrlmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705077253; a=rsa-sha256; cv=none; b=GwveRVLIKUTgo2LYB6ZbhD4Qv+UWbMG5tP9il9It1Qr3oO7wi1zwiTpVICnOF2AMUFGFZZ ahLa/az30U6NE8vVjsUsPA/nq/9rIkc7B6QRTDEWZXhXSlX9C4rscqO791QiW267Hntb52 1/OvBb/E8PiPhn+0o74VYR8M1Wj/qEndpk2TzosLGp5AeudT074Qh5FeOfKo1I9pJj0xID g1nTWLNA3xJM1k4Kk5vURWMJ5maiFBj9Otw6y3EJHj4j5eAnBP/D3jvf2J1y+6acpKblg9 vLMJHlpqbW1ahuBEo3TsoYWU3jgKPeUU45cjtHbfLuMNmyQBWUiwG/PlH9Z/mw== 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 4TBRv9510zz189h; Fri, 12 Jan 2024 16:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CGYDSi061129; Fri, 12 Jan 2024 16:34:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CGYDKc061126; Fri, 12 Jan 2024 16:34:13 GMT (envelope-from git) Date: Fri, 12 Jan 2024 16:34:13 GMT Message-Id: <202401121634.40CGYDKc061126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 54190b5e8d42 - stable/14 - sctp: minor clean List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 54190b5e8d42a95ba8266d0ab5ea095ad51741c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=54190b5e8d42a95ba8266d0ab5ea095ad51741c4 commit 54190b5e8d42a95ba8266d0ab5ea095ad51741c4 Author: Michael Tuexen AuthorDate: 2023-11-06 10:04:15 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:31:47 +0000 sctp: minor clean No functional change intended. (cherry picked from commit 3bbbfc8dcd3622b49907e359c8e9682def0bae25) --- sys/netinet/sctp_sysctl.c | 147 +++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 73 deletions(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 2c2cc58ee086..a4be3471e2fd 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -868,11 +868,11 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW) #define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH) #define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ @@ -893,75 +893,76 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ - NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ + sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ - &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, \ + prefix##_DESC) /* * sysctl definitions */ -SCTP_UINT_SYSCTL(sendspace, sctp_sendspace, SCTPCTL_MAXDGRAM) -SCTP_UINT_SYSCTL(recvspace, sctp_recvspace, SCTPCTL_RECVSPACE) -SCTP_UINT_SYSCTL(auto_asconf, sctp_auto_asconf, SCTPCTL_AUTOASCONF) -SCTP_UINT_SYSCTL(ecn_enable, sctp_ecn_enable, SCTPCTL_ECN_ENABLE) -SCTP_UINT_SYSCTL(pr_enable, sctp_pr_enable, SCTPCTL_PR_ENABLE) +SCTP_UINT_SYSCTL(sendspace, sctp_sendspace, SCTPCTL_MAXDGRAM); +SCTP_UINT_SYSCTL(recvspace, sctp_recvspace, SCTPCTL_RECVSPACE); +SCTP_UINT_SYSCTL(auto_asconf, sctp_auto_asconf, SCTPCTL_AUTOASCONF); +SCTP_UINT_SYSCTL(ecn_enable, sctp_ecn_enable, SCTPCTL_ECN_ENABLE); +SCTP_UINT_SYSCTL(pr_enable, sctp_pr_enable, SCTPCTL_PR_ENABLE); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_enable, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_auth, "IU", SCTPCTL_AUTH_ENABLE_DESC); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_asconf, "IU", SCTPCTL_ASCONF_ENABLE_DESC); -SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE) -SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE) -SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE) -SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) -SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) -SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) -SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS) -SCTP_UINT_SYSCTL_RDTUN(tcbhashsize, sctp_hashtblsize, SCTPCTL_TCBHASHSIZE) -SCTP_UINT_SYSCTL_TUN(pcbhashsize, sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE) -SCTP_UINT_SYSCTL(min_split_point, sctp_min_split_point, SCTPCTL_MIN_SPLIT_POINT) -SCTP_UINT_SYSCTL_RDTUN(chunkscale, sctp_chunkscale, SCTPCTL_CHUNKSCALE) -SCTP_UINT_SYSCTL(delayed_sack_time, sctp_delayed_sack_time_default, SCTPCTL_DELAYED_SACK_TIME) -SCTP_UINT_SYSCTL(sack_freq, sctp_sack_freq_default, SCTPCTL_SACK_FREQ) -SCTP_UINT_SYSCTL(sys_resource, sctp_system_free_resc_limit, SCTPCTL_SYS_RESOURCE) -SCTP_UINT_SYSCTL(asoc_resource, sctp_asoc_free_resc_limit, SCTPCTL_ASOC_RESOURCE) -SCTP_UINT_SYSCTL(heartbeat_interval, sctp_heartbeat_interval_default, SCTPCTL_HEARTBEAT_INTERVAL) -SCTP_UINT_SYSCTL(pmtu_raise_time, sctp_pmtu_raise_time_default, SCTPCTL_PMTU_RAISE_TIME) -SCTP_UINT_SYSCTL(shutdown_guard_time, sctp_shutdown_guard_time_default, SCTPCTL_SHUTDOWN_GUARD_TIME) -SCTP_UINT_SYSCTL(secret_lifetime, sctp_secret_lifetime_default, SCTPCTL_SECRET_LIFETIME) -SCTP_UINT_SYSCTL(rto_max, sctp_rto_max_default, SCTPCTL_RTO_MAX) -SCTP_UINT_SYSCTL(rto_min, sctp_rto_min_default, SCTPCTL_RTO_MIN) -SCTP_UINT_SYSCTL(rto_initial, sctp_rto_initial_default, SCTPCTL_RTO_INITIAL) -SCTP_UINT_SYSCTL(init_rto_max, sctp_init_rto_max_default, SCTPCTL_INIT_RTO_MAX) -SCTP_UINT_SYSCTL(valid_cookie_life, sctp_valid_cookie_life_default, SCTPCTL_VALID_COOKIE_LIFE) -SCTP_UINT_SYSCTL(init_rtx_max, sctp_init_rtx_max_default, SCTPCTL_INIT_RTX_MAX) -SCTP_UINT_SYSCTL(assoc_rtx_max, sctp_assoc_rtx_max_default, SCTPCTL_ASSOC_RTX_MAX) -SCTP_UINT_SYSCTL(path_rtx_max, sctp_path_rtx_max_default, SCTPCTL_PATH_RTX_MAX) -SCTP_UINT_SYSCTL(path_pf_threshold, sctp_path_pf_threshold, SCTPCTL_PATH_PF_THRESHOLD) -SCTP_UINT_SYSCTL(add_more_on_output, sctp_add_more_threshold, SCTPCTL_ADD_MORE_ON_OUTPUT) -SCTP_UINT_SYSCTL(incoming_streams, sctp_nr_incoming_streams_default, SCTPCTL_INCOMING_STREAMS) -SCTP_UINT_SYSCTL(outgoing_streams, sctp_nr_outgoing_streams_default, SCTPCTL_OUTGOING_STREAMS) -SCTP_UINT_SYSCTL(cmt_on_off, sctp_cmt_on_off, SCTPCTL_CMT_ON_OFF) -SCTP_UINT_SYSCTL(cmt_use_dac, sctp_cmt_use_dac, SCTPCTL_CMT_USE_DAC) -SCTP_UINT_SYSCTL(cwnd_maxburst, sctp_use_cwnd_based_maxburst, SCTPCTL_CWND_MAXBURST) -SCTP_UINT_SYSCTL(nat_friendly, sctp_nat_friendly, SCTPCTL_NAT_FRIENDLY) -SCTP_UINT_SYSCTL(abc_l_var, sctp_L2_abc_variable, SCTPCTL_ABC_L_VAR) -SCTP_UINT_SYSCTL(max_chained_mbufs, sctp_mbuf_threshold_count, SCTPCTL_MAX_CHAINED_MBUFS) -SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN) -SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST) -SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT) -SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL) -SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK) -SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL) -SCTP_UINT_SYSCTL(default_cc_module, sctp_default_cc_module, SCTPCTL_DEFAULT_CC_MODULE) -SCTP_UINT_SYSCTL(default_ss_module, sctp_default_ss_module, SCTPCTL_DEFAULT_SS_MODULE) -SCTP_UINT_SYSCTL(default_frag_interleave, sctp_default_frag_interleave, SCTPCTL_DEFAULT_FRAG_INTERLEAVE) -SCTP_UINT_SYSCTL(mobility_base, sctp_mobility_base, SCTPCTL_MOBILITY_BASE) -SCTP_UINT_SYSCTL(mobility_fasthandoff, sctp_mobility_fasthandoff, SCTPCTL_MOBILITY_FASTHANDOFF) +SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE); +SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE); +SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE); +SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH); +SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST); +SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST); +SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS); +SCTP_UINT_SYSCTL_RDTUN(tcbhashsize, sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); +SCTP_UINT_SYSCTL_TUN(pcbhashsize, sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); +SCTP_UINT_SYSCTL_RDTUN(chunkscale, sctp_chunkscale, SCTPCTL_CHUNKSCALE); +SCTP_UINT_SYSCTL(min_split_point, sctp_min_split_point, SCTPCTL_MIN_SPLIT_POINT); +SCTP_UINT_SYSCTL(delayed_sack_time, sctp_delayed_sack_time_default, SCTPCTL_DELAYED_SACK_TIME); +SCTP_UINT_SYSCTL(sack_freq, sctp_sack_freq_default, SCTPCTL_SACK_FREQ); +SCTP_UINT_SYSCTL(sys_resource, sctp_system_free_resc_limit, SCTPCTL_SYS_RESOURCE); +SCTP_UINT_SYSCTL(asoc_resource, sctp_asoc_free_resc_limit, SCTPCTL_ASOC_RESOURCE); +SCTP_UINT_SYSCTL(heartbeat_interval, sctp_heartbeat_interval_default, SCTPCTL_HEARTBEAT_INTERVAL); +SCTP_UINT_SYSCTL(pmtu_raise_time, sctp_pmtu_raise_time_default, SCTPCTL_PMTU_RAISE_TIME); +SCTP_UINT_SYSCTL(shutdown_guard_time, sctp_shutdown_guard_time_default, SCTPCTL_SHUTDOWN_GUARD_TIME); +SCTP_UINT_SYSCTL(secret_lifetime, sctp_secret_lifetime_default, SCTPCTL_SECRET_LIFETIME); +SCTP_UINT_SYSCTL(rto_max, sctp_rto_max_default, SCTPCTL_RTO_MAX); +SCTP_UINT_SYSCTL(rto_min, sctp_rto_min_default, SCTPCTL_RTO_MIN); +SCTP_UINT_SYSCTL(rto_initial, sctp_rto_initial_default, SCTPCTL_RTO_INITIAL); +SCTP_UINT_SYSCTL(init_rto_max, sctp_init_rto_max_default, SCTPCTL_INIT_RTO_MAX); +SCTP_UINT_SYSCTL(valid_cookie_life, sctp_valid_cookie_life_default, SCTPCTL_VALID_COOKIE_LIFE); +SCTP_UINT_SYSCTL(init_rtx_max, sctp_init_rtx_max_default, SCTPCTL_INIT_RTX_MAX); +SCTP_UINT_SYSCTL(assoc_rtx_max, sctp_assoc_rtx_max_default, SCTPCTL_ASSOC_RTX_MAX); +SCTP_UINT_SYSCTL(path_rtx_max, sctp_path_rtx_max_default, SCTPCTL_PATH_RTX_MAX); +SCTP_UINT_SYSCTL(path_pf_threshold, sctp_path_pf_threshold, SCTPCTL_PATH_PF_THRESHOLD); +SCTP_UINT_SYSCTL(add_more_on_output, sctp_add_more_threshold, SCTPCTL_ADD_MORE_ON_OUTPUT); +SCTP_UINT_SYSCTL(incoming_streams, sctp_nr_incoming_streams_default, SCTPCTL_INCOMING_STREAMS); +SCTP_UINT_SYSCTL(outgoing_streams, sctp_nr_outgoing_streams_default, SCTPCTL_OUTGOING_STREAMS); +SCTP_UINT_SYSCTL(cmt_on_off, sctp_cmt_on_off, SCTPCTL_CMT_ON_OFF); +SCTP_UINT_SYSCTL(cmt_use_dac, sctp_cmt_use_dac, SCTPCTL_CMT_USE_DAC); +SCTP_UINT_SYSCTL(cwnd_maxburst, sctp_use_cwnd_based_maxburst, SCTPCTL_CWND_MAXBURST); +SCTP_UINT_SYSCTL(nat_friendly, sctp_nat_friendly, SCTPCTL_NAT_FRIENDLY); +SCTP_UINT_SYSCTL(abc_l_var, sctp_L2_abc_variable, SCTPCTL_ABC_L_VAR); +SCTP_UINT_SYSCTL(max_chained_mbufs, sctp_mbuf_threshold_count, SCTPCTL_MAX_CHAINED_MBUFS); +SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN); +SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST); +SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT); +SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL); +SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK); +SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL); +SCTP_UINT_SYSCTL(default_cc_module, sctp_default_cc_module, SCTPCTL_DEFAULT_CC_MODULE); +SCTP_UINT_SYSCTL(default_ss_module, sctp_default_ss_module, SCTPCTL_DEFAULT_SS_MODULE); +SCTP_UINT_SYSCTL(default_frag_interleave, sctp_default_frag_interleave, SCTPCTL_DEFAULT_FRAG_INTERLEAVE); +SCTP_UINT_SYSCTL(mobility_base, sctp_mobility_base, SCTPCTL_MOBILITY_BASE); +SCTP_UINT_SYSCTL(mobility_fasthandoff, sctp_mobility_fasthandoff, SCTPCTL_MOBILITY_FASTHANDOFF); #if defined(SCTP_LOCAL_TRACE_BUF) SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RD, NULL, 0, sctp_sysctl_handle_trace_log, "S,sctplog", "SCTP logging (struct sctp_log)"); @@ -970,22 +971,22 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLFLAG_VNET | CTLTYPE_UINT | #endif SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_udp_tunneling, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SCTP_UINT_SYSCTL(enable_sack_immediately, sctp_enable_sack_immediately, SCTPCTL_SACK_IMMEDIATELY_ENABLE) -SCTP_UINT_SYSCTL(nat_friendly_init, sctp_inits_include_nat_friendly, SCTPCTL_NAT_FRIENDLY_INITS) -SCTP_UINT_SYSCTL(vtag_time_wait, sctp_vtag_time_wait, SCTPCTL_TIME_WAIT) -SCTP_UINT_SYSCTL(buffer_splitting, sctp_buffer_splitting, SCTPCTL_BUFFER_SPLITTING) -SCTP_UINT_SYSCTL(initial_cwnd, sctp_initial_cwnd, SCTPCTL_INITIAL_CWND) -SCTP_UINT_SYSCTL(rttvar_bw, sctp_rttvar_bw, SCTPCTL_RTTVAR_BW) -SCTP_UINT_SYSCTL(rttvar_rtt, sctp_rttvar_rtt, SCTPCTL_RTTVAR_RTT) -SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTPCTL_RTTVAR_EQRET) -SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS) -SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN) -SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE) -SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SCTPCTL_SENDALL_LIMIT) -SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE) -SCTP_UINT_SYSCTL(ootb_with_zero_cksum, sctp_ootb_with_zero_cksum, SCTPCTL_OOTB_WITH_ZERO_CKSUM) +SCTP_UINT_SYSCTL(enable_sack_immediately, sctp_enable_sack_immediately, SCTPCTL_SACK_IMMEDIATELY_ENABLE); +SCTP_UINT_SYSCTL(nat_friendly_init, sctp_inits_include_nat_friendly, SCTPCTL_NAT_FRIENDLY_INITS); +SCTP_UINT_SYSCTL(vtag_time_wait, sctp_vtag_time_wait, SCTPCTL_TIME_WAIT); +SCTP_UINT_SYSCTL(buffer_splitting, sctp_buffer_splitting, SCTPCTL_BUFFER_SPLITTING); +SCTP_UINT_SYSCTL(initial_cwnd, sctp_initial_cwnd, SCTPCTL_INITIAL_CWND); +SCTP_UINT_SYSCTL(rttvar_bw, sctp_rttvar_bw, SCTPCTL_RTTVAR_BW); +SCTP_UINT_SYSCTL(rttvar_rtt, sctp_rttvar_rtt, SCTPCTL_RTTVAR_RTT); +SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTPCTL_RTTVAR_EQRET); +SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS); +SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN); +SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE); +SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SCTPCTL_SENDALL_LIMIT); +SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE); +SCTP_UINT_SYSCTL(ootb_with_zero_cksum, sctp_ootb_with_zero_cksum, SCTPCTL_OOTB_WITH_ZERO_CKSUM); #ifdef SCTP_DEBUG -SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG) +SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG); #endif SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_stats, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); From nobody Fri Jan 12 16:39:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBS17146Cz577n7; Fri, 12 Jan 2024 16:39: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 4TBS170bjvz4VSN; Fri, 12 Jan 2024 16:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705077563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CBTjKpABJUcbEh04a65l/b0bVWtFQPSL0h3vXfFl5U=; b=k5S58Y8CzGWlzc46I3GNI8IWRVAnJUAZvz/9+sc9/ui+yui5gWdwiMHr3c8GLFx00L/DQp OB4xnz2TBrNrBtqm/SGsFnpa8ugFJjAA9dQWK5kvwFKNteKcrU3/E2ef14ZrJz4VWX/6B9 GTemC9BIr140QwCl2IGLxUAMVcrX50ycKHFa+jFi4n0+NydBAs8xTXI7Oukj469ybDQ5ps lQDrwM14W5yEi47hMmoIO6Qr2WdScLoUiRAaBj/L9dbaF58Lk+GInv4qk0854vMtpfe55K xqIeJGLbCbQvcA/ayJmWXkV320JvvrP1VVaBLw5oVkfB9uWgBKhCIn8ybS5LnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705077563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CBTjKpABJUcbEh04a65l/b0bVWtFQPSL0h3vXfFl5U=; b=ysxXM/DMVYU6V6fgOQOS/hcqTchchnNyxTSVIMMpOoeRMyvDCr+mpltSua2+J0kfgJGAUI RBYivl2bexJzYLfNf90UJGv6ibg1yoBwQJa5E0n8pheuD0e2e1rqMAC9GX+C07w7nGwKr8 g0Z1jhvnGhnYbGMckXPz5fwv7WMhbAvBw95O/MXr5T96USiYGOAVlD1qt9TILpJrKmNcFW JiVCxBTFDVJ8fHF92vU0UHB057YJJpGFg79pHZ6Cw2/QDLu0A66ZjvToKH9tBZ1adV5diR xdwbiYSdRiBIxA9Apzk6SpchUyzRBrbRp7a9aAcJAcmpyyedqAWOjtMeSrw0ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705077563; a=rsa-sha256; cv=none; b=GwxEp6zohm4N0TLPzV7l1lQgGeTAHRFLrGbwBORMUR7ripAURynr8n6TwJGyzba8ZCEqPw u82ZubH08BGlIGQDhn62oMQYXrIbjmbb+BLcD9J2Kf/a7EaoTqOwnDbSgSrg8yylw5ca87 3ZdxlY0gnHSMwaZFSfe3zn1kOF6qdWHsBe1m97XI5xvxw90EEtJXVwalkTE6BSG3ehLPXu +vJI0aZlyeBtUw2Gu1JAGJuGMv7l+uzbUirZEiRDMFtL58C7fCod8bsN3jYHHXCfS1VFOL UMfs6yJWrOf6L6hc/JZmMvYTZNcoYEktl9LH5RMc/IuQgDa6wwdERy0OYJFtSw== 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 4TBS166Sndz18h7; Fri, 12 Jan 2024 16:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CGdMgn062088; Fri, 12 Jan 2024 16:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CGdMWk062085; Fri, 12 Jan 2024 16:39:22 GMT (envelope-from git) Date: Fri, 12 Jan 2024 16:39:22 GMT Message-Id: <202401121639.40CGdMWk062085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 9a75f1475fb6 - stable/14 - tcp rack: remove references to rb trees List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a75f1475fb6ddd8d34d50a7b071ffa0c6a60a2c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9a75f1475fb6ddd8d34d50a7b071ffa0c6a60a2c commit 9a75f1475fb6ddd8d34d50a7b071ffa0c6a60a2c Author: Michael Tuexen AuthorDate: 2023-11-05 14:21:06 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:37:31 +0000 tcp rack: remove references to rb trees The references should have been removed in https://cgit.freebsd.org/src/commit/?id=030434acaf4631c4e205f8bccedcc7f845cbfcbf Reviewed by: rscheff, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42386 (cherry picked from commit b10ae5a9b21aa11e96a1951ccc4525dd1fdb60b3) --- sys/netinet/tcp_stacks/rack.c | 24 ++++++++++++------------ sys/netinet/tcp_stacks/tcp_rack.h | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0dd724399ebd..760bd4ee9689 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -7472,7 +7472,7 @@ need_retran: (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -7692,8 +7692,8 @@ rack_remxt_tmr(struct tcpcb *tp) * order. This way we send in the proper order and any * sacks that come floating in will "re-ack" the data. * To do this we zap the tmap with an INIT and then - * walk through and place every rsm in the RB tree - * back in its seq ordered place. + * walk through and place every rsm in the tail queue + * hash table back in its seq ordered place. */ TAILQ_INIT(&rack->r_ctl.rc_tmap); @@ -8355,7 +8355,7 @@ rack_update_entry(struct tcpcb *tp, struct tcp_rack *rack, (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -8545,7 +8545,7 @@ again: (void)tqhash_insert(rack->r_ctl.tqh, rsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, rsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -8619,7 +8619,7 @@ refind: (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -9776,7 +9776,7 @@ do_rest_ofb: (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -9897,7 +9897,7 @@ do_rest_ofb: } /* * There is more not coverend by this rsm move on - * to the next block in the RB tree. + * to the next block in the tail queue hash table. */ nrsm = tqhash_next(rack->r_ctl.tqh, rsm); start = rsm->r_end; @@ -10138,7 +10138,7 @@ do_rest_ofb: (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:% rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:% rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -12478,7 +12478,7 @@ rack_un_collapse_window(struct tcp_rack *rack, int line) (void)tqhash_insert(rack->r_ctl.tqh, nrsm); #else if ((insret = tqhash_insert(rack->r_ctl.tqh, nrsm)) != 0) { - panic("Insert in rb tree of %p fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash of %p fails ret:%d rack:%p rsm:%p", nrsm, insret, rack, rsm); } #endif @@ -14808,7 +14808,7 @@ rack_init_outstanding(struct tcpcb *tp, struct tcp_rack *rack, uint32_t us_cts, } #ifdef INVARIANTS if ((insret = tqhash_insert(rack->r_ctl.tqh, rsm)) != 0) { - panic("Insert in rb tree fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash fails ret:%d rack:%p rsm:%p", insret, rack, rsm); } #else @@ -14868,7 +14868,7 @@ rack_init_outstanding(struct tcpcb *tp, struct tcp_rack *rack, uint32_t us_cts, } #ifdef INVARIANTS if ((insret = tqhash_insert(rack->r_ctl.tqh, rsm)) != 0) { - panic("Insert in rb tree fails ret:%d rack:%p rsm:%p", + panic("Insert in tailq_hash fails ret:%d rack:%p rsm:%p", insret, rack, rsm); } #else diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 38239ef97b4d..4152a1a5d7ba 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -120,7 +120,6 @@ rack_ts_to_msec(uint64_t ts) } -RB_HEAD(rack_rb_tree_head, rack_sendmap); TAILQ_HEAD(rack_head, rack_sendmap); TAILQ_HEAD(def_opt_head, deferred_opt_list); From nobody Fri Jan 12 16:50:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSGW40q2z578WM; Fri, 12 Jan 2024 16:50: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 4TBSGW3W9bz4X5Z; Fri, 12 Jan 2024 16:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9mevGSkwFZIv3l8WwRTQlxEs2Wvf2wiXiZen898kFs=; b=sTaATeinOv8Mp3+asRkitMx2xEPgEXeirDv053FZKS6X2vy669nEAyyhqfCPB61E3eeFhn IofnpGLLwKXVyOYyFfO0d6UTS7IE5y96bMAUmdxafiaIdIWDdr3LqRu96slz28D/T1Lp9W 0u4eAEKstYIqWNkch++JpUPLsTpDyYSDCj+k+ODhAnnNRjV5POJn6wUtilBYbY+F0qk9js WDAZVAQlmaVlHOX/kZUAkjlk09woW6f57L5TUR14g0e+mwSdl+cYD3qh+jksSnbMVvoSRY UhRixQM505BMhamTneSif8O/PQf8wyU0RPNlre98EMBwdjsnnInKB958m9pTKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9mevGSkwFZIv3l8WwRTQlxEs2Wvf2wiXiZen898kFs=; b=qKwgdmNOmyBKxs1KvV8kg6roRKGYaA/b//EOHvXJXoVy5S0MnAimg55j6/XkCkBQmgRRyx QEoOST4gc6QPfMAwl/WnOTgx2+eOTL1noeX1dhl6y9uvDGyWt/KGixv+jvldCaIdg4FGO6 bbhu5u3jn5+PnvQbCrUD2Y49vzH7Ui7G7bvZdAgxegG/73JAn1FphSEAqcdCu13+JrYIDE +zcYhYKYEr+Fwadx/cULjHCFg0UzXvznq6hScBYHbLzis/N8LqahAwwSEGQnBNwR7fCtGT 1DPgEowgiSgQN1NIq0328yXmTY+D8J+5xGDZg+0UQemWJUOoCtR/kw1uDhCNZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705078259; a=rsa-sha256; cv=none; b=X5MPW63uT2LHk0oqiObSM8orJyK0R34HpTlfPmbvv8Bc24griATrUUsX6SRr6uNVx7HLRB Bp/sDOZlcMYS8tojuW9vPbjjSrz2tOmlpb5cf3QDni0EP4pLlmxBwNPRH2MCYzKhMAdWG+ FB/BFaOHHUwXnIXbMqLBJYPOTCYwJhuzkpz5YenCzxsI+kx6F1JmeRvbhUPYwSqLhSnsmu TXYDDpt+15mmHqCLjY4CWgdoV474nsroC3OaWHtIelvswvWJmT7kpKHlG8bzMfkWi3hogG KcimQxMXFs8eEkC+J2LKGM9+1CTwtug36lDlOLGtov9V/KBCTSkcgNQOdpQlEQ== 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 4TBSGW2YvQz18rF; Fri, 12 Jan 2024 16:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CGox4l089387; Fri, 12 Jan 2024 16:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CGoxCP089385; Fri, 12 Jan 2024 16:50:59 GMT (envelope-from git) Date: Fri, 12 Jan 2024 16:50:59 GMT Message-Id: <202401121650.40CGoxCP089385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e71e4d9ef1ba - stable/14 - if_tuntap: improve code consistency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e71e4d9ef1ba26f054894465fd53684c1fe2154d Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e71e4d9ef1ba26f054894465fd53684c1fe2154d commit e71e4d9ef1ba26f054894465fd53684c1fe2154d Author: Michael Tuexen AuthorDate: 2023-11-04 09:22:42 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:40:30 +0000 if_tuntap: improve code consistency No functional change intended. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42462 (cherry picked from commit 4ffe410e40e90c265c20cb4675ed74a40dc1fcc4) --- sys/net/if_tuntap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index a1d9929a2e28..298f37bebc56 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1413,8 +1413,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, else af = RO_GET_FAMILY(ro, dst); - if (bpf_peers_present(ifp->if_bpf)) - bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); + BPF_MTAP2(ifp, &af, sizeof(af), m0); /* prepend sockaddr? this may abort if the mbuf allocation fails */ if (cached_tun_flags & TUN_LMODE) { From nobody Fri Jan 12 16:53:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSKZ0bZFz5795w; Fri, 12 Jan 2024 16:53: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 4TBSKY6ksLz4XrS; Fri, 12 Jan 2024 16:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHTygr40q/eob9Iro/FoRmbuY7cv9d/iX+78D1jW3/0=; b=ENVUF994Ok6ILN9kOi67G+AcHV1YrXDQPqm0hZeFvyZuG6kvYxvnjgc6DrfBH0PCyRCuXh KVuD5eFcjpZzEMd/gdGKu3XfU1MkJkAnUn9iPmpIBqzqVY59Zmjaf6bF51LIr7Qn4WlTvA qxV6YCuFEGW6mQr4seC3H3Xm3Oyzuu/kfCPQt+jFyxVrm8UG2QfnZbtqTB4ewCydpfQQh9 dB55aY2ugssUoeSBaQed3zDR1SHA9qteCAY6P3fxwivz1nBwhdsXuf+7LCWLwwBOITRE7m pXOEasaFeaY5YgemCd5XdSqf0/TRvUIB2zZ7smgQlPPkDmGHL/Y7Gou8uarsnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHTygr40q/eob9Iro/FoRmbuY7cv9d/iX+78D1jW3/0=; b=VjfIZeIQdjQ92cf9B3IfIojDoqx/g1rwMq4DPV/3RqYo4RlihM/EDvFnq8xga4SQuUIStq 1D5hQRasLCJnczVzsfrgoA37hfIMEhLBMpMDtzJXQNXTAo3RUtn8zm0usKX3odb9GJdg49 SNptCqKco9EMIYPArnwveM2ZmtU8+WZpFncQItmEZl2CJd65jMq9GBYyqcztFLBCBOjjon Fj54ruGnPBru4ppXJcSda38+Nm2x+Xm/ycCG6YU4s1r3diUfSpZo2AHBKBCTebvYcrKB6t 0XKH+6uY9G8L02MMVZ21C/srf6PX85fLhEo1+ZsAsVkyYfTY/Lf9JkA2rYjzsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705078417; a=rsa-sha256; cv=none; b=h2EDis6IX/IUgBGuQv0QcYo41pk1eLPXvm5ja64NXxlvEE5AAw3DOfuCUgbtUex9fgHh6a rN/2MX6pUUaHq6mqNBYIEUY4744f98wdke/eNhhFOBQsuXkhRU1v0D5s7tnjsUjeWaJcQ5 ivMuzoqW13kkW9Hpm58dumrxhkGGg+/irL8+pK8xeM4Lj69JG+43FtuWaLVYcIXa7Xqbo6 JGKwsYsRRWRpKS/ekEH9CEp/VYnbpAp7xXrJ8VpQOLmWs4jvaZAkmlJxnn1/NS0PD0AU+/ CwjsRCyOc+WUAUoe4QPX+Hj9zzTj1pSMBGw5Bl+6rV3UcZuWRl8lC3MK7e5BQA== 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 4TBSKY5nymz192x; Fri, 12 Jan 2024 16:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CGrbo6096048; Fri, 12 Jan 2024 16:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CGrbvs096045; Fri, 12 Jan 2024 16:53:37 GMT (envelope-from git) Date: Fri, 12 Jan 2024 16:53:37 GMT Message-Id: <202401121653.40CGrbvs096045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e0f22f9e1867 - stable/14 - if_tuntap: trigger the bpf hook on transmitting for the tap interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e0f22f9e1867e9a4a2fc90327a13265eb233c7f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e0f22f9e1867e9a4a2fc90327a13265eb233c7f3 commit e0f22f9e1867e9a4a2fc90327a13265eb233c7f3 Author: Michael Tuexen AuthorDate: 2023-11-05 19:32:46 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:51:40 +0000 if_tuntap: trigger the bpf hook on transmitting for the tap interface The tun interface triggers the bpf hook when a packet is transmitted, the tap interface triggers it when the packet is read from the character device. This is inconsistent. So fix the tap device such that it behaves like the tun device. This is needed for adding support for the tap device to packetdrill. Reviewed by: kevans, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42467 (cherry picked from commit 35af22ac986c4f3e8160c943a478492e748b6f23) --- sys/net/if_tuntap.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 298f37bebc56..f273e4993dfd 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -933,6 +933,16 @@ tunstart_l2(struct ifnet *ifp) TUN_UNLOCK(tp); } /* tunstart_l2 */ +static int +tap_transmit(struct ifnet *ifp, struct mbuf *m) +{ + int error; + + BPF_MTAP(ifp, m); + IFQ_HANDOFF(ifp, m, error); + return (error); +} + /* XXX: should return an error code so it can fail. */ static void tuncreate(struct cdev *dev) @@ -972,6 +982,8 @@ tuncreate(struct cdev *dev) if ((tp->tun_flags & TUN_L2) != 0) { ifp->if_init = tunifinit; ifp->if_start = tunstart_l2; + ifp->if_transmit = tap_transmit; + ifp->if_qflush = if_qflush; ether_gen_addr(ifp, &eaddr); ether_ifattach(ifp, eaddr.octet); @@ -1713,9 +1725,6 @@ tunread(struct cdev *dev, struct uio *uio, int flag) } TUN_UNLOCK(tp); - if ((tp->tun_flags & TUN_L2) != 0) - BPF_MTAP(ifp, m); - len = min(tp->tun_vhdrlen, uio->uio_resid); if (len > 0) { struct virtio_net_hdr_mrg_rxbuf vhdr; From nobody Fri Jan 12 16:58:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSRS56WFz579BC; Fri, 12 Jan 2024 16:58: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 4TBSRS4Z6cz4Xtd; Fri, 12 Jan 2024 16:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=so4dI3Fl7ypfsbV5WDnU5CWeX85icpMVi2zTOzOQxyw=; b=QAC/mlFkQZZnJuCeTwikWta+/mJi7iMtGiF3j0wac3oi2Ga87tzr3rO8+XYhGVK09HHRhm lNuE5S01w7TptLUEyn1P/gIlUi0mPGzkdRNsh9uQr4e94tbngdXuRfHCaOppDUDfNCU5uY GVu9Gekda23Eh/BgRIXJ85T3IXA8Bi0Slx51Eaz9rHH1/BUeG0Mlsg7RJvoTaFSzkfFTfs Ocr3B7/T/NvGjF/A0H7ZfilU4GXxXftnGfP+jbd254WoQXoG60LSqxXVXOHpkWrQ5xRUOh d4j3KVxlRWPmjHwzbGd6kYetkXhXGIH94BkV8ACQMwpXn1JC1W5cKso22GuBGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=so4dI3Fl7ypfsbV5WDnU5CWeX85icpMVi2zTOzOQxyw=; b=uix76mwRMSDSq2IsWd6j9jhyBJ10Bre35m0GVfWk91utXS70NgfX7VFhscLeCNFyutGe4x 1LuiDB7uVpYyeTEAWMWFimO4wKZFpotA1S0uCs74cba9dddHCt6r+afCrg+waxYvLeClOu 4CHY+FyLWeGK3KWAZItHN38EoK7LRO9K9xbcoCQPc+dqurzOXBF6aZAYlO5eLtcx6ALm+p KECeMghptzw07haqKmLytGo1tXB96EKIZqLCn7h+3A86ZdB+Hd2PwwkGx4ohSx60n/5w+P v1ISu/tGQlJfzMH2VLY2WSv/DYYq4t/+S8iA5BWbeQctnhILPG2nNW0ltcNr/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705078724; a=rsa-sha256; cv=none; b=CcxT2FHbGmhu7DcRf/D6O/2mo4hIBud46Xk80YEzZbkDzwyi6qRylraN2oTY19ENZDF9G+ JvlRCtfWw44xiuHDW2Kby6ZU4PO0SQbKIRpcdSf3ykLX/+nhRB79LIMkSCzPCIuID8B66l 3JBZgWDMTGcZJxZKHLcRozLHq3GHeP3R6gyBXMsM27ZPiZ7L5zPhQsFix8ET//AnpK2drb 1dhItNC3BvWUwNjmE9kAYdA0TUxk7nlgpVp8NEx80i8W5+PmsDDw9GSKXenRtTi5ZB1KnY YqNo34GAbsfb/IZWYuEHg8lD4Jb9HjHHfOye+luxENH0KafhrxhnWDAJik2txQ== 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 4TBSRS3bqmz19NJ; Fri, 12 Jan 2024 16:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CGwign096857; Fri, 12 Jan 2024 16:58:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CGwi3k096854; Fri, 12 Jan 2024 16:58:44 GMT (envelope-from git) Date: Fri, 12 Jan 2024 16:58:44 GMT Message-Id: <202401121658.40CGwi3k096854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 002829ea6139 - stable/14 - if_tuntap: support receive checksum offloading for tap interfaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 002829ea6139fcbfc295790c97aed811535736fa Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=002829ea6139fcbfc295790c97aed811535736fa commit 002829ea6139fcbfc295790c97aed811535736fa Author: Michael Tuexen AuthorDate: 2023-11-09 10:37:27 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:55:40 +0000 if_tuntap: support receive checksum offloading for tap interfaces When enabled, pretend that the IPv4 and transport layer checksum is correct for packets injected via the character device. This is a prerequisite for adding support for LRO, which will be added next. Then packetdrill can be used to test the LRO code in local mode. Reviewed by: rscheff, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42477 (cherry picked from commit ff69d13a50d1d07601de0885fd94f6a09a7ba383) --- sys/net/if_tuntap.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index f273e4993dfd..738e6b997ace 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -977,6 +977,8 @@ tuncreate(struct cdev *dev) ifp->if_flags = iflags; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; + if ((tp->tun_flags & TUN_L2) != 0) + ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; ifp->if_capenable |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) { @@ -1784,9 +1786,35 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, return (0); } - if (vhdr != NULL && virtio_net_rx_csum(m, &vhdr->hdr)) { - m_freem(m); - return (0); + if (vhdr != NULL) { + if (virtio_net_rx_csum(m, &vhdr->hdr)) { + m_freem(m); + return (0); + } + } else { + switch (ntohs(eh->ether_type)) { +#ifdef INET + case ETHERTYPE_IP: + if (ifp->if_capenable & IFCAP_RXCSUM) { + m->m_pkthdr.csum_flags |= + CSUM_IP_CHECKED | CSUM_IP_VALID | + CSUM_DATA_VALID | CSUM_SCTP_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + break; +#endif +#ifdef INET6 + case ETHERTYPE_IPV6: + if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { + m->m_pkthdr.csum_flags |= + CSUM_DATA_VALID_IPV6 | CSUM_SCTP_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + break; +#endif + } } /* Pass packet up to parent. */ From nobody Fri Jan 12 17:01:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSW01wvLz579KV; Fri, 12 Jan 2024 17:01: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 4TBSW00WYcz4YTY; Fri, 12 Jan 2024 17:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FQCCMdLYrCrcZ1ocZwtvWXozz5dvK2C6nc0QqMoXscI=; b=XAMLB7tfmr9xde9qP9DsE/xV2sFH02KPRFLoUZljfdVcWj+1ii18TjKQfA47n0WX/C2grp JSWxupKwpaL6nhFKBI7V0v7n7m3didLf6fnjmjqWWi+Enopsgui1ygXdO5GOtpQ+SyzmNd x3nUtSw54h+pfwkW3LnMjY8CPXr2sQugJ8yYjxDRHJJ/Ffmi1WJhWoES2V0PeRIJ0bvU/D 8TuJtcQtG9s8Esc1libHogCXeh2V4rXrSMkhMnZn7q1pZisXrMvpiHR1q+Xetd4amVnm2n w+xXAVZLhJOgfOtzw2gB/Hc82XdIS9VMmgRZVvhoH8UVYI3y/5fpUyJxVGU8NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705078908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FQCCMdLYrCrcZ1ocZwtvWXozz5dvK2C6nc0QqMoXscI=; b=a1toEqwjwH/99nSzYVogKPqHycs1lLFUTOMcF3MFHmlsGDOOxl6/gasP5xhoWM113RvWaU /mHfSq8H80vnwSirMDAsyFElMEyLoFTuW3FVmrfjq/PXUsUbuf0D2Wkh4s0bvM9N/8QhFr FroAVVR1loEBqH5ZuNZh4Tjg65fZSy/2lMuCgkPSvunYUCadksR75qkyXbdkixQx8k/9SL yVe6iP5AvpaLn3dBytCetHGVvHmE/1EN0asRaMGaTPYpfKGocywaf3tPGIyZpNRVd4qFsE 28p/U3lfdvrg3g8gYhBLabBMLvOk0g0QiBY0SVvS1tlJZB4v1rnUNozv3wkLVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705078908; a=rsa-sha256; cv=none; b=pT4JelkKvJnFnltZa76VsAV0lMls1VglzTgoFYbp//y7Cl1SWNXjSq2R1IxG0J3bMJmCyo Y0jZPxW5ukkHjZqDLn0f32w+pKClUtqQb+LzqkcKnd5Am0R6lqaZEcXjASSKmYs5+/ye7E Fn7PH3lqk5x0bkfTN5lwEEUWEvN5rZj1sZvD3Zz2+qUoPJzIMSyhQg5Vwuo36/E/rhXRNL eS1wLtHDRfa3t6wnZ9P268hOJKBv0t8dw3QaRKInWdOV2t3ogn9UVBWeCN1cSPT/yghGTI XEDDPF2j9Ejdur8ZwRCuWt765KqChPu16hiBwk44Bb/nm8UmIV9XkahqzSDAJA== 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 4TBSVz6kBGz19Ns; Fri, 12 Jan 2024 17:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CH1l30010041; Fri, 12 Jan 2024 17:01:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CH1lYC010039; Fri, 12 Jan 2024 17:01:47 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:01:47 GMT Message-Id: <202401121701.40CH1lYC010039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 83e524e8f656 - stable/14 - if_tuntap: remove redundant check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 83e524e8f6567f7f336304eb3f2f9ceeea68cd66 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=83e524e8f6567f7f336304eb3f2f9ceeea68cd66 commit 83e524e8f6567f7f336304eb3f2f9ceeea68cd66 Author: Michael Tuexen AuthorDate: 2023-11-09 10:43:54 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 16:59:27 +0000 if_tuntap: remove redundant check eh can't be NULL, so there is no need to check for it. Reported by: zlei Sponsored by: Netflix, Inc. (cherry picked from commit 44669b76504991ef3ac10ef10bc0fa931ae79c45) --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 738e6b997ace..0de5b0d2d521 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1779,7 +1779,7 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, eh = mtod(m, struct ether_header *); - if (eh && (ifp->if_flags & IFF_PROMISC) == 0 && + if ((ifp->if_flags & IFF_PROMISC) == 0 && !ETHER_IS_MULTICAST(eh->ether_dhost) && bcmp(eh->ether_dhost, IF_LLADDR(ifp), ETHER_ADDR_LEN) != 0) { m_freem(m); From nobody Fri Jan 12 17:04:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSZh1FcBz579lr; Fri, 12 Jan 2024 17:05: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 4TBSZg5wWXz4ZKl; Fri, 12 Jan 2024 17:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LltCxDpAyRgki284OwsYWCGyzI2EYNLYtLdjkCEsYzA=; b=wXJYExTYMtYqVRW+qS0rKHVsfQmZHzTPq61e6npHzlevZBnpGWngVm817Em6A2N7ZrQwUE /Y4YTZsuJSPotS6nRwi8IvCKRLs8J44a2rKGfxBiSW6vdER77+LdopZg0z2X6xTgqHvmwl z79f0fMZ+NEz6w5XXQgMFXrmNEBFVK2b+46hL8qo+mcaHxcHy30QEaq3/sRrUyKTQhEVz/ JdyK4O7Z5yO18S/D9IUMlbZObbL+s7vEPUXVBWsZoSJqYWxNsB3Ffm8ej/cGa+uoYH7sXC vZuqz1QMH+FfpLlKiwOSW1fl59BEFCfa3bo6qozqLolCqXj/8mqfk0KpYDm7zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LltCxDpAyRgki284OwsYWCGyzI2EYNLYtLdjkCEsYzA=; b=jcaUkQ1Rp4N11uU4bK8Zt349F9U72PxjQ70kOveXajw+AOqdi64VZ3+e8UgjTq9zS0IQ67 xnTTG9AtCsaBTcqdyWzq4OGwCvoj5TdxXgOEBTvxuCcYKPIxnzcFpDgAtKPD2p5hPdq+r9 8iUzO7hjpe1zcfoISPwOUaI5joQ4cr0syoJ4nDC/1tYeSXrvCUllaPudNaMiL9d5XiehJ+ kUPm+Zu+lF5GNX2BO00dfKTjXUw2XLcwp0Ju5z8uESHATSfm0PW8CnwoVGT+ra7BELbEe6 GKWhg6sjrz/BQ7O9wETx+csVEtALh4iX44k4HqJwsaYE5VVgG1fsG+trSFut+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705079099; a=rsa-sha256; cv=none; b=QbmQOPTZEYtFiUR1ElKzYj2ULRancQ0+4OHi1+hJ68k8NKoanhPsjXM7hN5UbJ3cVq+5p7 7S1ErZ+4Er8Qkh8yxHhsAc5VXCeMcZlVgeEAiEPJ1bmeOzCOMCGnAyTbV7mrbnuYqiHtZw JxEU8Sz77kgeNYnF8+zZo7HkpWf25VznjZmN7twhFQNd1HL0YHJxdtX44f/Anmtc7xhOfk szc+mu3EBA82QGVHOyLBNxL+Havm0rTMqCw1c7MBBIKRfO5p4C11xL98pXFXy7SaQ+8Oxm lLHcBmTYG6/WK4yqP4xVCH7/MF7XBN+8yxLdjYMmdX79ig6eTlm40dJ3c25lJQ== 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 4TBSZg4sZZz19P6; Fri, 12 Jan 2024 17:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CH4xoo014191; Fri, 12 Jan 2024 17:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CH4xW4014188; Fri, 12 Jan 2024 17:04:59 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:04:59 GMT Message-Id: <202401121704.40CH4xW4014188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fded38cde763 - stable/14 - if_tuntap: add LRO support to tap devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: fded38cde763e77ec13c8df041788ac3a473ca00 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fded38cde763e77ec13c8df041788ac3a473ca00 commit fded38cde763e77ec13c8df041788ac3a473ca00 Author: Michael Tuexen AuthorDate: 2023-11-19 14:57:53 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:02:35 +0000 if_tuntap: add LRO support to tap devices This allows testing the LRO code with packetdrill in local mode. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42548 (cherry picked from commit 99c79cab422705f92f05a2924a29bdf823372ebf) --- sys/net/if_tuntap.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 0de5b0d2d521..98c5044d6867 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -97,6 +97,7 @@ #endif #include #include +#include #include #include #include @@ -144,6 +145,8 @@ struct tuntap_softc { struct ether_addr tun_ether; /* remote address */ int tun_busy; /* busy count */ int tun_vhdrlen; /* virtio-net header length */ + struct lro_ctrl tun_lro; /* for TCP LRO */ + bool tun_lro_ready; /* TCP LRO initialized */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) @@ -978,7 +981,8 @@ tuncreate(struct cdev *dev) IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) - ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; + ifp->if_capabilities |= + IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO; ifp->if_capenable |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) { @@ -1175,6 +1179,12 @@ tundtor(void *data) (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; + if (l2tun && tp->tun_lro_ready) { + TUNDEBUG (ifp, "LRO disabled\n"); + tcp_lro_free(&tp->tun_lro); + tp->tun_lro_ready = false; + } + if (ifp->if_flags & IFF_UP) { TUN_UNLOCK(tp); if_down(ifp); @@ -1219,6 +1229,14 @@ tuninit(struct ifnet *ifp) getmicrotime(&ifp->if_lastchange); TUN_UNLOCK(tp); } else { + if (tcp_lro_init(&tp->tun_lro) == 0) { + TUNDEBUG(ifp, "LRO enabled\n"); + tp->tun_lro.ifp = ifp; + tp->tun_lro_ready = true; + } else { + TUNDEBUG(ifp, "Could not enable LRO\n"); + tp->tun_lro_ready = false; + } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; TUN_UNLOCK(tp); /* attempt to start output */ @@ -1765,6 +1783,7 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; + int result; ifp = TUN2IFP(tp); @@ -1820,7 +1839,15 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); - (*ifp->if_input)(ifp, m); + if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) { + result = tcp_lro_rx(&tp->tun_lro, m, 0); + TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result); + } else + result = TCP_LRO_CANNOT; + if (result == 0) + tcp_lro_flush_all(&tp->tun_lro); + else + (*ifp->if_input)(ifp, m); NET_EPOCH_EXIT(et); CURVNET_RESTORE(); /* ibytes are counted in parent */ From nobody Fri Jan 12 17:08:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSfj2MxFz57BCn; Fri, 12 Jan 2024 17:08: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 4TBSfj1qNqz4bCh; Fri, 12 Jan 2024 17:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eEuicgCP+QqzsejWvj4aRVw2hgCpvTZ/iepLXuHsvMU=; b=fHUuZUzVNQEhetTPXiOyVRfzwrJLkT0+E8NEuTyr+Sduh3VwK3HG1OYaFYkb4rLk07yEMn UbiS2tuK5Pn9OHAdjT3VJp3GMonPl9ChdT6zO81iA27ycofZB8uroeTITKw4o6VKsmg9rB 6ruvvHcq63rMUXrjW6t19HF4M5vVu+S00AlS/UAABrqKI3s5f15T+OAV5XynurFv1prXVe 8MVD0AyiHgdetzKyHK4PHdZXm/igttppoxIBNrB2fq+9OQGTYeMt1GbaIknHN14p4FTLEC zCVygTjjMwXxjS4Z/ZbKZwu0Zcc2hzB14DkwnisrQuj5tQnYSDdIGUD2+CXYfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eEuicgCP+QqzsejWvj4aRVw2hgCpvTZ/iepLXuHsvMU=; b=f38yh2mH058DlmyLnFYnr+j83Tpi2Y+OOAg5PcjJzSLjWVPz5GfIImZgl+Ki3qKaeZZ3xi odbtYGHtnDZ/l3UcBy8DFQiDWe/QukyiO8Gev8zSUfg+Dlza2SoSXf4hffRoH52JeMWZwM XEPYG7dQl23Nd4wmaQq6nHPa96DDAm/0Bnx4aLd8NVg9DUdCTg5M2eFGuZhBIEwMmMMFEX +epvCNGRugLzaDc3cl8WdpF+UBhe/kSLxyL9sFSLxn/r2purNc1w9jl5zQ3Lv/gUOFFuCV s9g+hdtPGupcVMjbrCdybvtwcdHG1kIu5b4IjnJ1oQijHoh9bsL4SXPS7DlDxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705079309; a=rsa-sha256; cv=none; b=rJaBu75Fnu4Nx6qKNgP/fR9rmRMfoNvAhuRaEtpG0zJavbrc8Fsv/JvEMR2Yj+DaTV0TQM JZsOlzoddp4i+d6NmWzV4FEy1ZJR2sTTfWBTsvGb6WBhr36N+DaFOTFa5C8gn6AmxgL+0O eHoh2wTJajum6K5scuAgeXOUfX3BEDGL3swdvC+gPkdvYZ/+2kygWeebimXRwnIT9sy0VY rJj4z+Rs43dKdaU5fdxPSAzyH+03qMQA4xIIZ+XGN/5yLxJczZ3OTQYxd+4fzEjNwyJy0B A8dKKXKFtnCRWfcnrJX5GiZ86ZZET8AgFrAgAskv3N8U+bhK2YhiQVWZ3Pq9WQ== 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 4TBSfj0bmMz19G1; Fri, 12 Jan 2024 17:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CH8S06015364; Fri, 12 Jan 2024 17:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CH8Stk015361; Fri, 12 Jan 2024 17:08:28 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:08:28 GMT Message-Id: <202401121708.40CH8Stk015361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0459cf327549 - stable/14 - if_tuntap: fix NOIP build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0459cf327549f067ea1583a8d428e556232b6082 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0459cf327549f067ea1583a8d428e556232b6082 commit 0459cf327549f067ea1583a8d428e556232b6082 Author: Gleb Smirnoff AuthorDate: 2023-12-04 18:18:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:05:12 +0000 if_tuntap: fix NOIP build Note: this removes one TUNDEBUG() for the sake of not having one more ifdefed variable declaration and for the overall code brevity. The call from tuntap into LRO can be so easily traced with dtrace(1) that an 80-ish printf(9)-based debugging can be omitted. Fixes: 99c79cab422705f92f05a2924a29bdf823372ebf (cherry picked from commit 5b0010b4678d778967a5a82fb38507e46a071e38) --- sys/net/if_tuntap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 98c5044d6867..4cb219dc92b6 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1178,13 +1178,13 @@ tundtor(void *data) if ((tp->tun_flags & TUN_VMNET) != 0 || (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; - +#if defined(INET) || defined(INET6) if (l2tun && tp->tun_lro_ready) { TUNDEBUG (ifp, "LRO disabled\n"); tcp_lro_free(&tp->tun_lro); tp->tun_lro_ready = false; } - +#endif if (ifp->if_flags & IFF_UP) { TUN_UNLOCK(tp); if_down(ifp); @@ -1229,6 +1229,7 @@ tuninit(struct ifnet *ifp) getmicrotime(&ifp->if_lastchange); TUN_UNLOCK(tp); } else { +#if defined(INET) || defined(INET6) if (tcp_lro_init(&tp->tun_lro) == 0) { TUNDEBUG(ifp, "LRO enabled\n"); tp->tun_lro.ifp = ifp; @@ -1237,6 +1238,7 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "Could not enable LRO\n"); tp->tun_lro_ready = false; } +#endif ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; TUN_UNLOCK(tp); /* attempt to start output */ @@ -1783,7 +1785,6 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; - int result; ifp = TUN2IFP(tp); @@ -1839,14 +1840,12 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); - if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) { - result = tcp_lro_rx(&tp->tun_lro, m, 0); - TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result); - } else - result = TCP_LRO_CANNOT; - if (result == 0) +#if defined(INET) || defined(INET6) + if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO && + tcp_lro_rx(&tp->tun_lro, m, 0) == 0) tcp_lro_flush_all(&tp->tun_lro); else +#endif (*ifp->if_input)(ifp, m); NET_EPOCH_EXIT(et); CURVNET_RESTORE(); From nobody Fri Jan 12 17:22:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBSz90lJWz57ChT; Fri, 12 Jan 2024 17:22: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 4TBSz90GYqz4dcb; Fri, 12 Jan 2024 17:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705080165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSSF+EeR+PO9W9bNCxSGKV64HVk/f0R2UrirBcTAFJI=; b=nXK9CdSQ8TnY2dt1MS4Q71iAdtDu4zoC+KYR1aBIdYzfO8qCXeCDa6OuJlA/FLBxV6TAKd nVdMPHiQYguOdaFfA1KO5ZlQCK59DcYrJtGNwwndK20FX1q/DuoUotedm7Ou+R1VsEFHcV Pj1XzGWVHNJwPMrXsluwxGiQkIlv3Ss0vkY1DM4Y0oo7Po4fWO6yI63E1VATblEojlCZhh SvQTnl2o/k5T0pvNqsh9kgPMLYj7w86MoHLek9Y5D7pB4VijiKh6YS3a/Uju2IpvnGr6qg 6yyzRDVUCD09BGiHNdtBrmKzvk9dtBcTi2X3Ey7RC4U/XqjBkXud48+/mMOGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705080165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSSF+EeR+PO9W9bNCxSGKV64HVk/f0R2UrirBcTAFJI=; b=Gv9vc561Wb9Ys0c3e4spgGxvBWyx6vHDM4WrG4LZFKS1qq1ROLtQ7b6cfO0Dm+GbHQn2Ji R8ub+t80rgwBhMHKpVI41861PuqA7YmLWZSYZS2yrC/bsR5ThqZntnTQ1ey+ifM8QAIwqT L8kZotuNa3GLMfFU9AQFS2QbBcbtQoJWJA+LrY1U7tpClWn6tCUMZFkBxg8FbSOa2AKrkP cB0WU7z22ZyDg7BEZkJOjZ9pmuizkNFRO8eM77JeDCJaYoVochoGI7jOqdZ8BoG35KfGsc txYIkF3pYX3w05a4fsjpYByP0LhoISdcD78IrOSRZFIkRYx0NA5OCM/ui9xYdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705080165; a=rsa-sha256; cv=none; b=ETBC7g4RQsygcgqYMXlL0M8mphFuOnZIe8dC1Bix1EC2O26dlJ4vShaPo22H4nXlrR5xQQ bR5sx6CErnQ1AYw9LTwypwCmzAdLuNIzRiX3nwN5TLJ0NW9InSpTpSgGMrfLd0MjRGfvRR xJqUdXn5PiZHTJWzJLJ5TEYuoeliF1bZzUtxTX76SqXdxQCchvXA47vmaFBL4YOwUy6SEU rpzKUb5kbx1KUP/paVgxc8PGpnGpqCRSgkVpfxTu/3z4bUH1an//IIICUoWuoLmHIPxzbA jRymlgX17CX1M3s6J3XofPKxnTlMp5MbTJ6ny+BDPonYEhq8wb1gEFS+WeVz3g== 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 4TBSz86R7Xz19dm; Fri, 12 Jan 2024 17:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHMiNG048930; Fri, 12 Jan 2024 17:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHMiNo048927; Fri, 12 Jan 2024 17:22:44 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:22:44 GMT Message-Id: <202401121722.40CHMiNo048927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 15eda0e9027d - stable/13 - udplite: fix checksum computation on the sender side List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 15eda0e9027d39d4e38e23a31752b1e02e2d2d6c Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=15eda0e9027d39d4e38e23a31752b1e02e2d2d6c commit 15eda0e9027d39d4e38e23a31752b1e02e2d2d6c Author: Michael Tuexen AuthorDate: 2023-11-01 09:24:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:22:20 +0000 udplite: fix checksum computation on the sender side Don't fill the fields of the UDP/IP header not used for the checksum computation before performing the checksum computation. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D42275 (cherry picked from commit aa64a8f5c35c13b1c325f1a4597c987a37bec5da) --- sys/netinet/udp_usrreq.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a476b0d8251a..ea9ff161e429 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1408,8 +1408,12 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, * into network format. */ ui = mtod(m, struct udpiphdr *); - bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ - ui->ui_v = IPVERSION << 4; + /* + * Filling only those fields of udpiphdr that participate in the + * checksum calculation. The rest must be zeroed and will be filled + * later. + */ + bzero(ui->ui_x1, sizeof(ui->ui_x1)); ui->ui_pr = pr; ui->ui_src = laddr; ui->ui_dst = faddr; @@ -1434,16 +1438,6 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, cscov_partial = (cscov == 0) ? 0 : 1; } - /* - * Set the Don't Fragment bit in the IP header. - */ - if (inp->inp_flags & INP_DONTFRAG) { - struct ip *ip; - - ip = (struct ip *)&ui->ui_i; - ip->ip_off |= htons(IP_DF); - } - if (inp->inp_socket->so_options & SO_DONTROUTE) ipflags |= IP_ROUTETOIF; if (inp->inp_socket->so_options & SO_BROADCAST) @@ -1477,9 +1471,16 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); } + /* + * After finishing the checksum computation, fill the remaining fields + * of udpiphdr. + */ + ((struct ip *)ui)->ip_v = IPVERSION; + ((struct ip *)ui)->ip_tos = tos; ((struct ip *)ui)->ip_len = htons(sizeof(struct udpiphdr) + len); - ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ - ((struct ip *)ui)->ip_tos = tos; /* XXX */ + if (inp->inp_flags & INP_DONTFRAG) + ((struct ip *)ui)->ip_off |= htons(IP_DF); + ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; UDPSTAT_INC(udps_opackets); /* From nobody Fri Jan 12 17:50:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTbY451jz57FRm; Fri, 12 Jan 2024 17:50: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 4TBTbY3dQmz4hwl; Fri, 12 Jan 2024 17:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XuKFWaw19+8oCjGX/HHWSPum8USxK6SV+nSXh/VVOEM=; b=A8eNPagXZumWQTksXTGSdtXTm2mdLSDK3yMJCN33XQQkCJGM/KIIYpQ8bl6DxDHtViDlkL 6BqgDf4kyEy0YNt1QpnySGlRGy9zZ8RODSSOalLHVLUPKxEXfuWDCUXDArZ4dN9oI/WFwF UYbEkqNMi5A65XbgAmamNvc6IMIv+AZ2OEtyjP/krBDo2JuGMcZASLJPZl0tW73Y1oiVhu bFbrRR41UFDymjTk4ccW2QOJgWpolpVIns8QgoVBPBlsTCVFBGPfCShCP5WtJkz7hZmEii FaSvT3gvZqT7ZH54nJ0I2WYbwATYC9Tus73zPCa9i/xnV09MVuw4IAQ1etLk1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XuKFWaw19+8oCjGX/HHWSPum8USxK6SV+nSXh/VVOEM=; b=dOBGXluqFC9TrdUS+BlPQkp7RjMyqUbzTRBxh3q2/PtPa65yDkmb7JUzr8rFvyLz0+N9fo 6m4Pvqc/m5ghP7W/XkDj8jS+8wifpXsMy8sOis4fvOZ4Nr0MilvO/hXxglEkDwh/bzYtdh /tXYLsQDo86bEuXP82NvnI7RQh4xG+2mamIP1/kA5PuRZsla5c2apZQW03GYslO6/UsA57 6RB74BmHwn/u04mGTMgkP++tufDR7W0f0FKHyx2DnSWV6UEQF4SvYfXsKhIlz1KcnMkJ66 yC7cfykpSwfu+zCk363w3xonZ3jmVWyubhiWEbvc1POvrASIohT8939z8aiCLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705081849; a=rsa-sha256; cv=none; b=iiBcbpuCFoxRCdB5w5atb8w8J/ODGKBqIydMuC6MqNANhKUMwysUP1C2kJUbW1umhE6V++ f3UlE0Sue+tTLZj6ahD713J3N8z4+/5eT5EdFFwCv3xTaO55FqMsZ/HJjcSRdH6s+lZGw/ u7MOd5toz/DzMQXAsRPVtejVyFZwl5jAYiFhRHLJqp6kK2HVBYMS4LkOntyk5eFyEpfviO Z0mj3aO+VjzWKj4SE/FvhJAsAmsoExSR9SHzHBUEnOnb4bLqjNdGKsHFfpdsGmXf9jz6J0 bfhxCbc8DAGOTGTY/O3AoyCABH+2Rz73zdF/KuV6SNPPg4OU2i2eDox0cU8vQg== 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 4TBTbY2gr8z1B3d; Fri, 12 Jan 2024 17:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHonRr093053; Fri, 12 Jan 2024 17:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHoniC093050; Fri, 12 Jan 2024 17:50:49 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:50:49 GMT Message-Id: <202401121750.40CHoniC093050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3b766249d9f0 - stable/13 - udplite: make socketoption available on IPv6 sockets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b766249d9f04a4cb8d9d44c98853611e02bfd6d Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3b766249d9f04a4cb8d9d44c98853611e02bfd6d commit 3b766249d9f04a4cb8d9d44c98853611e02bfd6d Author: Michael Tuexen AuthorDate: 2023-11-05 14:28:54 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:35:25 +0000 udplite: make socketoption available on IPv6 sockets This patch allows the IPPROTO_UDPLITE-level socket options UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on AF_INET6 sockets in addition to AF_INET sockets. Reviewed by: ae, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42430 (cherry picked from commit 03c3a70abe5e9fa259b954de78ae69229fa9c99f) --- sys/netinet/udp_usrreq.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index ea9ff161e429..c868bf777103 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1009,6 +1009,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); @@ -1056,6 +1060,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); From nobody Fri Jan 12 17:50:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTbZ5bv4z57FP4; Fri, 12 Jan 2024 17:50: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 4TBTbZ44M6z4hm9; Fri, 12 Jan 2024 17:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6Z3XkQntTYrv4UzRFrcNMl1VJD/A6tTzIwsH6/pcoA=; b=IuGGE2hJqZ/qPD54JAMTnMYwipJrmNTWbn8Ghq9rBcAw8caWgTMleGni6O8SKYz+3ZzTi6 13KYmRhsipykCV6j2sFFhDvSU4+Qsil8tuJxk3rYpPu2U0yTXfl34h0kSujKJAENg7IZUC I1FMG+O3o/Wxwv74RdLC2e0DfLilapqcrinH6D+qSlbBCyXme0HnQjCr4wUISuG02nVn7W GXvhE6dRgbW2ZGBUssBawg0y7XztHUYawBAsaBbRqnJmaw90WwoVHupTBFarHTVRWSmt4u +gtA7AhrGgriBAWAgsYta6J7Q+IcNMRj8dHAmwxiSK9yoz8s/uJLP29EmY0abA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6Z3XkQntTYrv4UzRFrcNMl1VJD/A6tTzIwsH6/pcoA=; b=OBo9C4i3mF9FTi3etvRj5h8Rlc9jJGQe68fIavd6TXOKyrk/HbtXoRUCwsXVHqowDPKDGy Kn4A/74QnPIgE3kpdKA/H7huvfqJnaP9pLCxsI0kS9ZM0qZivjNMzdQuZ9Q59r1/2Ad63N yG6aJaHfcZA++EO9F6XCGFbjIVXL9S3k0EbBdF3DKkx78RlffUhKDSKflOaTr8I+CtPOdE ZAHP6jA/7zAKVooBfkCtUZGzBNssy0D6WFba8ZHfuEBJuGYr0T7dcHxW3XEqFgEdGXQAZ7 c89DP2PIYO4fkJJZiX8IHcpthEHJ0JIYfngpMtjEwZuaio1uFek/Yc2s0BV6uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705081850; a=rsa-sha256; cv=none; b=CUj30MhwFje7OuJ1DEwy9YrixegnKghIA/s78VUGxElb0PqA61miumE8z6gqx8dgF8jL0n bVSj6WubwnedxUfdQM3DJvz6+KNRZQ6bfMAmyaaFoivC7Xoh/vWbZNzQPNaa8hvI12hMKc vvVRc/SBsmV10kw8G3xyS3YBHkPEPHqxAIYs+09wo8044uteXgcD6UrJE5oRc977TDeWhN 76kD4YK8jyaM4Uuee/mrv4FjM5bG/XCnC4HMJhlFZtIHNARH+2Ss7M+1aVVHuzIZbHpFIW lN5naXKBMPccLP6zf4YT5sDSvyylYkZwmrSAXdfezycvdwHi9ez9ZIQHoI7hZg== 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 4TBTbZ39Msz1BVd; Fri, 12 Jan 2024 17:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHoobO093996; Fri, 12 Jan 2024 17:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHoo0g093982; Fri, 12 Jan 2024 17:50:50 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:50:50 GMT Message-Id: <202401121750.40CHoo0g093982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fab809a67d23 - stable/13 - sctp: minor clean List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fab809a67d2328dd369fb9013fe63d01bbd5d982 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fab809a67d2328dd369fb9013fe63d01bbd5d982 commit fab809a67d2328dd369fb9013fe63d01bbd5d982 Author: Michael Tuexen AuthorDate: 2023-11-06 10:04:15 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:50:11 +0000 sctp: minor clean No functional change intended. (cherry picked from commit 3bbbfc8dcd3622b49907e359c8e9682def0bae25) --- sys/netinet/sctp_sysctl.c | 145 +++++++++++++++++++++++----------------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index fa93deba8b53..60c4a506ddae 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -864,11 +864,11 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW) #define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH) #define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ @@ -889,75 +889,76 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ - NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ + sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ - &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, \ + prefix##_DESC) /* * sysctl definitions */ -SCTP_UINT_SYSCTL(sendspace, sctp_sendspace, SCTPCTL_MAXDGRAM) -SCTP_UINT_SYSCTL(recvspace, sctp_recvspace, SCTPCTL_RECVSPACE) -SCTP_UINT_SYSCTL(auto_asconf, sctp_auto_asconf, SCTPCTL_AUTOASCONF) -SCTP_UINT_SYSCTL(ecn_enable, sctp_ecn_enable, SCTPCTL_ECN_ENABLE) -SCTP_UINT_SYSCTL(pr_enable, sctp_pr_enable, SCTPCTL_PR_ENABLE) +SCTP_UINT_SYSCTL(sendspace, sctp_sendspace, SCTPCTL_MAXDGRAM); +SCTP_UINT_SYSCTL(recvspace, sctp_recvspace, SCTPCTL_RECVSPACE); +SCTP_UINT_SYSCTL(auto_asconf, sctp_auto_asconf, SCTPCTL_AUTOASCONF); +SCTP_UINT_SYSCTL(ecn_enable, sctp_ecn_enable, SCTPCTL_ECN_ENABLE); +SCTP_UINT_SYSCTL(pr_enable, sctp_pr_enable, SCTPCTL_PR_ENABLE); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_enable, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_auth, "IU", SCTPCTL_AUTH_ENABLE_DESC); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_asconf, "IU", SCTPCTL_ASCONF_ENABLE_DESC); -SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE) -SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE) -SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE) -SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) -SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) -SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) -SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS) -SCTP_UINT_SYSCTL_RDTUN(tcbhashsize, sctp_hashtblsize, SCTPCTL_TCBHASHSIZE) -SCTP_UINT_SYSCTL_TUN(pcbhashsize, sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE) -SCTP_UINT_SYSCTL(min_split_point, sctp_min_split_point, SCTPCTL_MIN_SPLIT_POINT) -SCTP_UINT_SYSCTL_RDTUN(chunkscale, sctp_chunkscale, SCTPCTL_CHUNKSCALE) -SCTP_UINT_SYSCTL(delayed_sack_time, sctp_delayed_sack_time_default, SCTPCTL_DELAYED_SACK_TIME) -SCTP_UINT_SYSCTL(sack_freq, sctp_sack_freq_default, SCTPCTL_SACK_FREQ) -SCTP_UINT_SYSCTL(sys_resource, sctp_system_free_resc_limit, SCTPCTL_SYS_RESOURCE) -SCTP_UINT_SYSCTL(asoc_resource, sctp_asoc_free_resc_limit, SCTPCTL_ASOC_RESOURCE) -SCTP_UINT_SYSCTL(heartbeat_interval, sctp_heartbeat_interval_default, SCTPCTL_HEARTBEAT_INTERVAL) -SCTP_UINT_SYSCTL(pmtu_raise_time, sctp_pmtu_raise_time_default, SCTPCTL_PMTU_RAISE_TIME) -SCTP_UINT_SYSCTL(shutdown_guard_time, sctp_shutdown_guard_time_default, SCTPCTL_SHUTDOWN_GUARD_TIME) -SCTP_UINT_SYSCTL(secret_lifetime, sctp_secret_lifetime_default, SCTPCTL_SECRET_LIFETIME) -SCTP_UINT_SYSCTL(rto_max, sctp_rto_max_default, SCTPCTL_RTO_MAX) -SCTP_UINT_SYSCTL(rto_min, sctp_rto_min_default, SCTPCTL_RTO_MIN) -SCTP_UINT_SYSCTL(rto_initial, sctp_rto_initial_default, SCTPCTL_RTO_INITIAL) -SCTP_UINT_SYSCTL(init_rto_max, sctp_init_rto_max_default, SCTPCTL_INIT_RTO_MAX) -SCTP_UINT_SYSCTL(valid_cookie_life, sctp_valid_cookie_life_default, SCTPCTL_VALID_COOKIE_LIFE) -SCTP_UINT_SYSCTL(init_rtx_max, sctp_init_rtx_max_default, SCTPCTL_INIT_RTX_MAX) -SCTP_UINT_SYSCTL(assoc_rtx_max, sctp_assoc_rtx_max_default, SCTPCTL_ASSOC_RTX_MAX) -SCTP_UINT_SYSCTL(path_rtx_max, sctp_path_rtx_max_default, SCTPCTL_PATH_RTX_MAX) -SCTP_UINT_SYSCTL(path_pf_threshold, sctp_path_pf_threshold, SCTPCTL_PATH_PF_THRESHOLD) -SCTP_UINT_SYSCTL(add_more_on_output, sctp_add_more_threshold, SCTPCTL_ADD_MORE_ON_OUTPUT) -SCTP_UINT_SYSCTL(incoming_streams, sctp_nr_incoming_streams_default, SCTPCTL_INCOMING_STREAMS) -SCTP_UINT_SYSCTL(outgoing_streams, sctp_nr_outgoing_streams_default, SCTPCTL_OUTGOING_STREAMS) -SCTP_UINT_SYSCTL(cmt_on_off, sctp_cmt_on_off, SCTPCTL_CMT_ON_OFF) -SCTP_UINT_SYSCTL(cmt_use_dac, sctp_cmt_use_dac, SCTPCTL_CMT_USE_DAC) -SCTP_UINT_SYSCTL(cwnd_maxburst, sctp_use_cwnd_based_maxburst, SCTPCTL_CWND_MAXBURST) -SCTP_UINT_SYSCTL(nat_friendly, sctp_nat_friendly, SCTPCTL_NAT_FRIENDLY) -SCTP_UINT_SYSCTL(abc_l_var, sctp_L2_abc_variable, SCTPCTL_ABC_L_VAR) -SCTP_UINT_SYSCTL(max_chained_mbufs, sctp_mbuf_threshold_count, SCTPCTL_MAX_CHAINED_MBUFS) -SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN) -SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST) -SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT) -SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL) -SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK) -SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL) -SCTP_UINT_SYSCTL(default_cc_module, sctp_default_cc_module, SCTPCTL_DEFAULT_CC_MODULE) -SCTP_UINT_SYSCTL(default_ss_module, sctp_default_ss_module, SCTPCTL_DEFAULT_SS_MODULE) -SCTP_UINT_SYSCTL(default_frag_interleave, sctp_default_frag_interleave, SCTPCTL_DEFAULT_FRAG_INTERLEAVE) -SCTP_UINT_SYSCTL(mobility_base, sctp_mobility_base, SCTPCTL_MOBILITY_BASE) -SCTP_UINT_SYSCTL(mobility_fasthandoff, sctp_mobility_fasthandoff, SCTPCTL_MOBILITY_FASTHANDOFF) +SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE); +SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE); +SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE); +SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH); +SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST); +SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST); +SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS); +SCTP_UINT_SYSCTL_RDTUN(tcbhashsize, sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); +SCTP_UINT_SYSCTL_TUN(pcbhashsize, sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); +SCTP_UINT_SYSCTL_RDTUN(chunkscale, sctp_chunkscale, SCTPCTL_CHUNKSCALE); +SCTP_UINT_SYSCTL(min_split_point, sctp_min_split_point, SCTPCTL_MIN_SPLIT_POINT); +SCTP_UINT_SYSCTL(delayed_sack_time, sctp_delayed_sack_time_default, SCTPCTL_DELAYED_SACK_TIME); +SCTP_UINT_SYSCTL(sack_freq, sctp_sack_freq_default, SCTPCTL_SACK_FREQ); +SCTP_UINT_SYSCTL(sys_resource, sctp_system_free_resc_limit, SCTPCTL_SYS_RESOURCE); +SCTP_UINT_SYSCTL(asoc_resource, sctp_asoc_free_resc_limit, SCTPCTL_ASOC_RESOURCE); +SCTP_UINT_SYSCTL(heartbeat_interval, sctp_heartbeat_interval_default, SCTPCTL_HEARTBEAT_INTERVAL); +SCTP_UINT_SYSCTL(pmtu_raise_time, sctp_pmtu_raise_time_default, SCTPCTL_PMTU_RAISE_TIME); +SCTP_UINT_SYSCTL(shutdown_guard_time, sctp_shutdown_guard_time_default, SCTPCTL_SHUTDOWN_GUARD_TIME); +SCTP_UINT_SYSCTL(secret_lifetime, sctp_secret_lifetime_default, SCTPCTL_SECRET_LIFETIME); +SCTP_UINT_SYSCTL(rto_max, sctp_rto_max_default, SCTPCTL_RTO_MAX); +SCTP_UINT_SYSCTL(rto_min, sctp_rto_min_default, SCTPCTL_RTO_MIN); +SCTP_UINT_SYSCTL(rto_initial, sctp_rto_initial_default, SCTPCTL_RTO_INITIAL); +SCTP_UINT_SYSCTL(init_rto_max, sctp_init_rto_max_default, SCTPCTL_INIT_RTO_MAX); +SCTP_UINT_SYSCTL(valid_cookie_life, sctp_valid_cookie_life_default, SCTPCTL_VALID_COOKIE_LIFE); +SCTP_UINT_SYSCTL(init_rtx_max, sctp_init_rtx_max_default, SCTPCTL_INIT_RTX_MAX); +SCTP_UINT_SYSCTL(assoc_rtx_max, sctp_assoc_rtx_max_default, SCTPCTL_ASSOC_RTX_MAX); +SCTP_UINT_SYSCTL(path_rtx_max, sctp_path_rtx_max_default, SCTPCTL_PATH_RTX_MAX); +SCTP_UINT_SYSCTL(path_pf_threshold, sctp_path_pf_threshold, SCTPCTL_PATH_PF_THRESHOLD); +SCTP_UINT_SYSCTL(add_more_on_output, sctp_add_more_threshold, SCTPCTL_ADD_MORE_ON_OUTPUT); +SCTP_UINT_SYSCTL(incoming_streams, sctp_nr_incoming_streams_default, SCTPCTL_INCOMING_STREAMS); +SCTP_UINT_SYSCTL(outgoing_streams, sctp_nr_outgoing_streams_default, SCTPCTL_OUTGOING_STREAMS); +SCTP_UINT_SYSCTL(cmt_on_off, sctp_cmt_on_off, SCTPCTL_CMT_ON_OFF); +SCTP_UINT_SYSCTL(cmt_use_dac, sctp_cmt_use_dac, SCTPCTL_CMT_USE_DAC); +SCTP_UINT_SYSCTL(cwnd_maxburst, sctp_use_cwnd_based_maxburst, SCTPCTL_CWND_MAXBURST); +SCTP_UINT_SYSCTL(nat_friendly, sctp_nat_friendly, SCTPCTL_NAT_FRIENDLY); +SCTP_UINT_SYSCTL(abc_l_var, sctp_L2_abc_variable, SCTPCTL_ABC_L_VAR); +SCTP_UINT_SYSCTL(max_chained_mbufs, sctp_mbuf_threshold_count, SCTPCTL_MAX_CHAINED_MBUFS); +SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN); +SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST); +SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT); +SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL); +SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK); +SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL); +SCTP_UINT_SYSCTL(default_cc_module, sctp_default_cc_module, SCTPCTL_DEFAULT_CC_MODULE); +SCTP_UINT_SYSCTL(default_ss_module, sctp_default_ss_module, SCTPCTL_DEFAULT_SS_MODULE); +SCTP_UINT_SYSCTL(default_frag_interleave, sctp_default_frag_interleave, SCTPCTL_DEFAULT_FRAG_INTERLEAVE); +SCTP_UINT_SYSCTL(mobility_base, sctp_mobility_base, SCTPCTL_MOBILITY_BASE); +SCTP_UINT_SYSCTL(mobility_fasthandoff, sctp_mobility_fasthandoff, SCTPCTL_MOBILITY_FASTHANDOFF); #if defined(SCTP_LOCAL_TRACE_BUF) SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RD, NULL, 0, sctp_sysctl_handle_trace_log, "S,sctplog", "SCTP logging (struct sctp_log)"); @@ -966,21 +967,21 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLFLAG_VNET | CTLTYPE_UINT | #endif SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_udp_tunneling, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SCTP_UINT_SYSCTL(enable_sack_immediately, sctp_enable_sack_immediately, SCTPCTL_SACK_IMMEDIATELY_ENABLE) -SCTP_UINT_SYSCTL(nat_friendly_init, sctp_inits_include_nat_friendly, SCTPCTL_NAT_FRIENDLY_INITS) -SCTP_UINT_SYSCTL(vtag_time_wait, sctp_vtag_time_wait, SCTPCTL_TIME_WAIT) -SCTP_UINT_SYSCTL(buffer_splitting, sctp_buffer_splitting, SCTPCTL_BUFFER_SPLITTING) -SCTP_UINT_SYSCTL(initial_cwnd, sctp_initial_cwnd, SCTPCTL_INITIAL_CWND) -SCTP_UINT_SYSCTL(rttvar_bw, sctp_rttvar_bw, SCTPCTL_RTTVAR_BW) -SCTP_UINT_SYSCTL(rttvar_rtt, sctp_rttvar_rtt, SCTPCTL_RTTVAR_RTT) -SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTPCTL_RTTVAR_EQRET) -SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS) -SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN) -SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE) -SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SCTPCTL_SENDALL_LIMIT) -SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE) +SCTP_UINT_SYSCTL(enable_sack_immediately, sctp_enable_sack_immediately, SCTPCTL_SACK_IMMEDIATELY_ENABLE); +SCTP_UINT_SYSCTL(nat_friendly_init, sctp_inits_include_nat_friendly, SCTPCTL_NAT_FRIENDLY_INITS); +SCTP_UINT_SYSCTL(vtag_time_wait, sctp_vtag_time_wait, SCTPCTL_TIME_WAIT); +SCTP_UINT_SYSCTL(buffer_splitting, sctp_buffer_splitting, SCTPCTL_BUFFER_SPLITTING); +SCTP_UINT_SYSCTL(initial_cwnd, sctp_initial_cwnd, SCTPCTL_INITIAL_CWND); +SCTP_UINT_SYSCTL(rttvar_bw, sctp_rttvar_bw, SCTPCTL_RTTVAR_BW); +SCTP_UINT_SYSCTL(rttvar_rtt, sctp_rttvar_rtt, SCTPCTL_RTTVAR_RTT); +SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTPCTL_RTTVAR_EQRET); +SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS); +SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN); +SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE); +SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SCTPCTL_SENDALL_LIMIT); +SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE); #ifdef SCTP_DEBUG -SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG) +SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG); #endif SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RW, NULL, 0, sctp_sysctl_handle_stats, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); From nobody Fri Jan 12 17:52:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTdG6ZYKz57FV1; Fri, 12 Jan 2024 17:52:18 +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 4TBTdG5ZK2z4kSH; Fri, 12 Jan 2024 17:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D7j97GSusO0CWV7UR5yVQF47NUsY3f58+iBx4T4WNRw=; b=kVLykXSnEtItAlVtlwt2ZJXCSd3Yeko/YWi6tD6BfdawGAGNdHWN8gXuJqj+6oxetXWExD 8gfsP1YeBVDNwxAOOAsTk7oXoSa29VgSy5t/a5iDyTFw4VwFBn69gaSUBa+R41RSIVylTQ Yzy9B235tNv3HBJOd3zDmSbo8qycgJ9LCt0Kx5E1ST/55064wD07GaiRicGNPD226rlh3a b0x2XbYIyut9llZ9lbExnT25vRd2uc5WTRMYOvkJh4MLqA5Q+D590iqsPfRJNtTpcGWFiZ 30pdxEkwTpw4iQYnoK3S/fWWdP7Li6kE2VQmbHZyVBkKuROp1tR2k5O+17LF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D7j97GSusO0CWV7UR5yVQF47NUsY3f58+iBx4T4WNRw=; b=csdh44nC5AaCkAwx67pOCQbtkwIdF9SnsPzCO3cxdnOOBQGM3JxUz3Dh1H4IudNn1fx4hK fWftzvKtU4IiBmoEa5sooIRo9CplLAd+a/s7ndbJOI5YXHdKXwPiTGuvm7a/KfAiNIMM6d 2MbmKgGIXaTS+SkP0iJFQ9wAfg4DEp2nE3sJPyJ4Kf/rbgG0VeOQJl+eTfpEa6kJJQooc4 oLz+fD9N3nNFZmkYHvHgs9ZJa6/ckdNCCOXbzLc7me7YJ2YPux5XdzW9DqvtAFTmGPALnc kxh+tQ8p5Zm0AFz4OQkkZhSbvlb3iwP8G79OzhWvK+oE/KO0X+cL3zpNZ9U5yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705081938; a=rsa-sha256; cv=none; b=iev7AgEf7PuIvO38JuTxeOim7ZmsE5+bFMMGR3lZu4PBpGOJmZhpFywBoIGx/k8eThgZpP /VCa30vG2EOJAtKf+Aoe4hcpvGc0Fyw/vF8OrsSH5Y9XQYETbul6LIqY47HQCeJ4M84NPW qfwRQ+xrs9yPVXvDlx97BMDx9QLgIx5p6r62KkX68s0m5Bg5cgGzmeMs+z9rVbfs2MUD1k FQnokWBHCbfIjdVOMFtf4sl2qBAe8GMX6ndlqtI1MD9NXUQ7pGDNQxrSX45fOm3jNvTJWq CE+/4NjPNsT8iXTx0PajADM83Z9oTjxN8jAjET7brT92DDEXhXkBFZEKs40yvg== 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 4TBTdG4dDFz1Bwh; Fri, 12 Jan 2024 17:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHqIpA098622; Fri, 12 Jan 2024 17:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHqIdq098619; Fri, 12 Jan 2024 17:52:18 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:52:18 GMT Message-Id: <202401121752.40CHqIdq098619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4aaf087b879b - stable/13 - if_tuntap: improve code consistency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4aaf087b879b914a917923fd77a6b15429fd4c77 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4aaf087b879b914a917923fd77a6b15429fd4c77 commit 4aaf087b879b914a917923fd77a6b15429fd4c77 Author: Michael Tuexen AuthorDate: 2023-11-04 09:22:42 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:51:57 +0000 if_tuntap: improve code consistency No functional change intended. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42462 (cherry picked from commit 4ffe410e40e90c265c20cb4675ed74a40dc1fcc4) --- sys/net/if_tuntap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index da55034638d1..d9243ae8bb6c 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1406,8 +1406,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, else af = RO_GET_FAMILY(ro, dst); - if (bpf_peers_present(ifp->if_bpf)) - bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); + BPF_MTAP2(ifp, &af, sizeof(af), m0); /* prepend sockaddr? this may abort if the mbuf allocation fails */ if (cached_tun_flags & TUN_LMODE) { From nobody Fri Jan 12 17:53:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTf64KPZz57FfC; Fri, 12 Jan 2024 17:53: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 4TBTf63T0Vz4kXh; Fri, 12 Jan 2024 17:53:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=demYKFCs0RzN1twlGoRge3ZPGHKttyYwrDtZyXXx8l4=; b=ISOKX8o6mfw8WXi1FLkkaa4cxbSRqZ+6OHsZpu+fQ4768hSv6jnN2fy4GVzUVVYlRirJTA 1iuEW95PU2ZTDiO9L0a39tGJtdsZQx0W1nTBoG45B13DhbbvA/aIlgzq9Yq4qavu3ehO6W gftwrzhVsnwWnWoGinpn3d1xdgpZ0dC1gT7mYEQ1hRJxkmAg62chdenFUWPFZBGrWkfPEx dg+Wk7/wpXXjFDUBXnYAqbn6gCni+AOEZG7TMCSsoSeGnOmd190FDO1WCOkgQPEuFsWmEf rSa0MRFQUXtLqN6cQaCCfWknwOPpn0KXl8cTNSnMbUcapxabfi5DO8JtD+pKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705081982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=demYKFCs0RzN1twlGoRge3ZPGHKttyYwrDtZyXXx8l4=; b=n/Os8PTMZ52Oy7xmEjdssh+2zr80QNBTpQOnN8NO1kjyEW8nP0ZAdmi2wJxm2k3dZsPGsM 4r/AvpQSLOhiJMNzv7X4KWCzDRK1I/IWX4u5VqR78lnDpZVn5jrwuuX27h1LfZMqdYSsGE YSw5cEwOfIRD/ATbH+s/O72Zk+50O8U9o+HGvXy4fjWcc+vPgdjwp2plsAofD5ZNdjYRkQ 9ADGV77r8JJ5QV+O1COVGv/9eO5vDBTfojClam7V0807yTvs+drbkHkVdYQcoA7tt3FCSZ 0XYrIwEMrqh70k8+cNpJ1nmvF1fCOH6j4//3p0vRqBU4ErzK8M49RkTaYBf/9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705081982; a=rsa-sha256; cv=none; b=s987mwQk34q2AnFb753y8qAE1icIMvH/3b+vWa6OW8+QKq/EOoDZwNeNwHrRJTmfPkSZ5k 1kpyGJaAsOJ0d4ViYnz57C5pGppUFH7YgakZ23xirYw54OwHgeT8N5kKomNl/uxsjD1p2z s/+5FgZV8RUct2X5T2bdcDe0RdlO7NIp0cc88zcd3gVov6G8N5w67jchXY2c6s+k0ZWfzo M2gwS7rI3FiDsNGeSoXjNi4e0XRitgfKSE9C9d8iyO+S+LIYnrzQanZHE2Ci3/kX5OfCqJ 0Nv1vye83x/gdUku3LNI1rVNnPg93X/BvWUm925aEnMTwceQvyFpTPWOZeLJQQ== 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 4TBTf62YJQz1BcL; Fri, 12 Jan 2024 17:53:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHr2qs099425; Fri, 12 Jan 2024 17:53:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHr2DF099422; Fri, 12 Jan 2024 17:53:02 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:53:02 GMT Message-Id: <202401121753.40CHr2DF099422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f6aae554b076 - stable/13 - if_tuntap: trigger the bpf hook on transmitting for the tap interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6aae554b0764dcf9fcb9fe886bdf722f3856e0d Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f6aae554b0764dcf9fcb9fe886bdf722f3856e0d commit f6aae554b0764dcf9fcb9fe886bdf722f3856e0d Author: Michael Tuexen AuthorDate: 2023-11-05 19:32:46 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:52:36 +0000 if_tuntap: trigger the bpf hook on transmitting for the tap interface The tun interface triggers the bpf hook when a packet is transmitted, the tap interface triggers it when the packet is read from the character device. This is inconsistent. So fix the tap device such that it behaves like the tun device. This is needed for adding support for the tap device to packetdrill. Reviewed by: kevans, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42467 (cherry picked from commit 35af22ac986c4f3e8160c943a478492e748b6f23) --- sys/net/if_tuntap.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index d9243ae8bb6c..29e9c05e52bc 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -926,6 +926,16 @@ tunstart_l2(struct ifnet *ifp) TUN_UNLOCK(tp); } /* tunstart_l2 */ +static int +tap_transmit(struct ifnet *ifp, struct mbuf *m) +{ + int error; + + BPF_MTAP(ifp, m); + IFQ_HANDOFF(ifp, m, error); + return (error); +} + /* XXX: should return an error code so it can fail. */ static void tuncreate(struct cdev *dev) @@ -965,6 +975,8 @@ tuncreate(struct cdev *dev) if ((tp->tun_flags & TUN_L2) != 0) { ifp->if_init = tunifinit; ifp->if_start = tunstart_l2; + ifp->if_transmit = tap_transmit; + ifp->if_qflush = if_qflush; ether_gen_addr(ifp, &eaddr); ether_ifattach(ifp, eaddr.octet); @@ -1706,9 +1718,6 @@ tunread(struct cdev *dev, struct uio *uio, int flag) } TUN_UNLOCK(tp); - if ((tp->tun_flags & TUN_L2) != 0) - BPF_MTAP(ifp, m); - len = min(tp->tun_vhdrlen, uio->uio_resid); if (len > 0) { struct virtio_net_hdr_mrg_rxbuf vhdr; From nobody Fri Jan 12 17:53:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTfv5v13z57FY8; Fri, 12 Jan 2024 17:53: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 4TBTfv4Ncbz4l0k; Fri, 12 Jan 2024 17:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX3nAgSXhrgb/S/zA9DLpRhYqZPIRJNojMiql8ZfOSY=; b=oR5MSnEX+smZXBZrhsWPZ4mP3jqYYI5bDayMko4svHllv9lioE8hrDnPk/LWZ3nrMjhSAT paRv7rSQ6IMDXztVTg56UgNKiE0aXTcKoXlfyEr9nZ8RTEAaV79sWMezCzxPy57OC7VuxI uAbkcVVdGVgnVusqsafRmVYhAzLVfuv0asa0FzUlSyTMCKLN5xR19FuLbAMDQUirG13hcG SH5um6eNRXKPDV9XX5gSmPK3slLk4BvsYEUOVLp7SlQKxrlilPvgOTfsjBe48hJFaOAa78 H/oiAF6d2ITNEcvOiO8RFoABH/EuXijSV0HF/YTt8wViIXIrAWQWkFJHoCAqpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX3nAgSXhrgb/S/zA9DLpRhYqZPIRJNojMiql8ZfOSY=; b=MkF0ERAy5zF7CO3BXtvzvEvg5jds3Ho/BbrVjlVn3r+0UumP5Qu99K8+VsDCQXfybagTOb VsYC4+oulQsadYPLAwWSxDa9eQI/dTpGAu83lPzWKkWe7V2mgzLEt1hPf6IAoh0yUz7SiX LW14GeDmKkyAppK8a3f4lU4W3jcfuWdCvxIb5wz65YeovFPSl6/T23iveNZ1uKr8iVevX4 C+YIQ3lBUmCJFMbmVcXDxPhehmY31uulu5F+0GJ48rv28aXBXgftQ4ktcKelcO/Rh/Ep3z a8F7AbB7EuhUxaT0xThhYNtYJsNLopCgcZHh9Idf5GPfGxdRzcl5UFRDxO1JNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705082023; a=rsa-sha256; cv=none; b=veZz/DiuDNJT/iVSniYhsVXGAyUi9MxJPsaFtVcAFuZ/N/aSYmrZ7r2J7THo1K2cnG5Ie2 To/24E0M3+KMdGDvMpSgC8mgqiFLJ9HyTCfp2Hu7JrgNknRoBarlU+0P+ef4Hn9vnODYM3 lKaXUkh5EHVgiDnhvU3OQLzlPNyGCIKDJBbZwzlfgtNh1mGiByYII5lWMQ6p/1ihHVeP0l kFvcwOHdNlt8jifmOw9PCx90Ushf85yAWks2CirLp+W5KhB14VZdLiBdzVE1JmXhb4/61/ w5UPmW6+9ZSGEqc9uYq4U4q1ViQrni1cYxy+xtAe3UsduEgyTxmN6Mqf8Pj/ZA== 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 4TBTfv3SRPz1BlD; Fri, 12 Jan 2024 17:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHrhHx099693; Fri, 12 Jan 2024 17:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHrhhv099690; Fri, 12 Jan 2024 17:53:43 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:53:43 GMT Message-Id: <202401121753.40CHrhhv099690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 41988a137d55 - stable/13 - if_tuntap: support receive checksum offloading for tap interfaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 41988a137d556b0e4bd6259bc7af0c63f6975596 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=41988a137d556b0e4bd6259bc7af0c63f6975596 commit 41988a137d556b0e4bd6259bc7af0c63f6975596 Author: Michael Tuexen AuthorDate: 2023-11-09 10:37:27 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:53:19 +0000 if_tuntap: support receive checksum offloading for tap interfaces When enabled, pretend that the IPv4 and transport layer checksum is correct for packets injected via the character device. This is a prerequisite for adding support for LRO, which will be added next. Then packetdrill can be used to test the LRO code in local mode. Reviewed by: rscheff, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42477 (cherry picked from commit ff69d13a50d1d07601de0885fd94f6a09a7ba383) --- sys/net/if_tuntap.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 29e9c05e52bc..9cadd971eb37 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -970,6 +970,8 @@ tuncreate(struct cdev *dev) ifp->if_flags = iflags; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; + if ((tp->tun_flags & TUN_L2) != 0) + ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; ifp->if_capenable |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) { @@ -1777,9 +1779,35 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, return (0); } - if (vhdr != NULL && virtio_net_rx_csum(m, &vhdr->hdr)) { - m_freem(m); - return (0); + if (vhdr != NULL) { + if (virtio_net_rx_csum(m, &vhdr->hdr)) { + m_freem(m); + return (0); + } + } else { + switch (ntohs(eh->ether_type)) { +#ifdef INET + case ETHERTYPE_IP: + if (ifp->if_capenable & IFCAP_RXCSUM) { + m->m_pkthdr.csum_flags |= + CSUM_IP_CHECKED | CSUM_IP_VALID | + CSUM_DATA_VALID | CSUM_SCTP_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + break; +#endif +#ifdef INET6 + case ETHERTYPE_IPV6: + if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { + m->m_pkthdr.csum_flags |= + CSUM_DATA_VALID_IPV6 | CSUM_SCTP_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + break; +#endif + } } /* Pass packet up to parent. */ From nobody Fri Jan 12 17:54:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTgW6JJ4z57FfW; Fri, 12 Jan 2024 17:54: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 4TBTgW5LvGz4l4Y; Fri, 12 Jan 2024 17:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smCW7op62EynZ8hAYsnWtKL6Smy+S2ECXbtnPazCosY=; b=Tz0WWT0mwTv+MpsfTcq+Putp8ZZsW7wc3wQ6oH4NGOMiJenEKAFwROPCW3hdh9lTw81T08 MRooztL2AUDkrt4XUMmW40csaPl4gZYFVCxsy90EXCQnWe10HwqvdJ7zdAZ+6Pk8G1JSJv qWDgvu4wFtOTLcd7Qijy9rsBXwRONONCHyJcKVmHjeUuR/eO4MoAadPhQpael3lkw7OO7H yyJFKIakv0LhdaDKLWtoaFq9sjsFY+vje6dNvazYOfcCQKcylSkMYTd9GrgehBHeQQp+bv rHxZhJmnwMI6mSh/uYL584uHf1V6w0b3JBg52X1BdXhMU2ISzY4QXy5j6cTOuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smCW7op62EynZ8hAYsnWtKL6Smy+S2ECXbtnPazCosY=; b=IpxCFgICABIgRZ3EwSCD7f7a/dyY6reH/VFl+oV4EOUPGitiAiO0wufI1Urh0R7Jc8z0JR gfiVTPW6Hjsg/mOjMyw7CHh2GV3y9RUIlwYPvAFXe7fNnra7D/tHRYD1Nzp2f+ZWd7Bp3X cdbm1LYKUE5/K5O8eQyE3OQt7Ld5D633+Re7R/je5/oE39GQwdllP6BxWqtya9GxIX0zVp JWEmbrmejzWz1Cu2EaPFyV4yPqtYNvloLY26v7yFqH359B2G8V1UCz4Ug30pzWcOkv95FE OAbLpAPBb/iiVXb6Hb8T5ToHbYdQnkL/Es8WnoJYpHmPJrkYeCK7TRUPUj/MAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705082055; a=rsa-sha256; cv=none; b=g37UcLi99WNJHeSphJt5SUJBDWZtgC9ZAzo98R7r0U8NDw08+SkOUJR3qzPHOGKEGc9MSV weF6RwNLAEG6y9fbzB0BxXsKteo30LrfBc2bsyjlILUzTKGpD0WSziCvgULZy3uCJRDQQN ca+fWfbpzR7oLgJ9614kpJeiOdkK6C6BFfzxbfazuVbBXXncVJ0dGHjYHYgqmxp9PnTget c9uQGxhYCDtkPhriSPQbeYyQ3wet07pwLeOBZBSLEY65qfq6ts86aMaIVR+yGJTW1VpVke qAQiExcJGcZAV741cwqsD8lBPGYMl8hZOSSEReV+UR44w4X+Ii5Ujz35MB5bUg== 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 4TBTgW4Q0sz1BBW; Fri, 12 Jan 2024 17:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHsF9B099914; Fri, 12 Jan 2024 17:54:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHsFtV099912; Fri, 12 Jan 2024 17:54:15 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:54:15 GMT Message-Id: <202401121754.40CHsFtV099912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 299e9fe9709a - stable/14 - netlink: Add sysctl descriptions for net.netlink tree List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 299e9fe9709ac520ce1ea5069d0e25540acff573 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=299e9fe9709ac520ce1ea5069d0e25540acff573 commit 299e9fe9709ac520ce1ea5069d0e25540acff573 Author: Ed Maste AuthorDate: 2023-10-12 01:38:00 +0000 Commit: Ed Maste CommitDate: 2024-01-12 17:53:45 +0000 netlink: Add sysctl descriptions for net.netlink tree Reviewed by: markj, melifaro Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43368 (cherry picked from commit 20010b86fe0e181bdad947449fced07bf3fb9cb6) --- sys/netlink/netlink_glue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_glue.c b/sys/netlink/netlink_glue.c index e7649c6b13dc..879adefab7bd 100644 --- a/sys/netlink/netlink_glue.c +++ b/sys/netlink/netlink_glue.c @@ -50,8 +50,10 @@ #include /* Standard bits: built-in the kernel */ -SYSCTL_NODE(_net, OID_AUTO, netlink, CTLFLAG_RD, 0, ""); -SYSCTL_NODE(_net_netlink, OID_AUTO, debug, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); +SYSCTL_NODE(_net, OID_AUTO, netlink, CTLFLAG_RD, 0, + "RFC3549 Netlink network state socket family"); +SYSCTL_NODE(_net_netlink, OID_AUTO, debug, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Netlink per-subsystem debug levels"); MALLOC_DEFINE(M_NETLINK, "netlink", "Memory used for netlink packets"); From nobody Fri Jan 12 17:54:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBTgj5wH2z57Fhf; Fri, 12 Jan 2024 17:54: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 4TBTgj5N3wz4lRt; Fri, 12 Jan 2024 17:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypLR3s1Ga7ufcE98LpytK3fMOsy/tiWG51DBgmmaw6E=; b=xTDZRVrIuqkVpA+cb8D9t+KmNS0Z7WuC2/s+/NhH3h6iRO8zbnVk3QTpdEfsgiv6vO929I 04o+xLN5d/1yyWJCvmYj706VTy7WKZMfBctfxSaRlpM5LmZOgL9BmHSPo3XymBGGlVPV3T UQs8z5N7kj5Ot1KmHIpjAKwGgsqOP40KfImo/Vw3N1spcjK8q4yuFHcxFjJO3tdisOhClx zuNODUcvBgilqUSh/Dfb5IpvMyy05SiYo8hvrOM30asJL/Gg4I8r2PfWzc+aRUfjT24e+X HM2YE2l3dR7nPhwLI7cJR8oH96koYteUeklF6j8xFE3h4BIDj8osTfpzvWlO6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypLR3s1Ga7ufcE98LpytK3fMOsy/tiWG51DBgmmaw6E=; b=bFbPRXvEB9Eu0A5tEPl4Hg/YonXbgleoby5ERRIFhAZB/4FYxuj1yNclixt948qB426gwA bsevExyP7yKVwUzai79S5hh9tzr6iaiKdBDAFkFklYD1eW4r+WzQctGDNveajejqm1vmYU JmtDC96UtpvikdY0Vr8DxhGS4seUMyC+Mc0DKhGOByeaEtiB0rVxRXXQla/MWVviGJomTk 21A9J+LZynYDp6firD8qfAlByMUjPGgD+E6sMPNeAYETNtJsOt7ET7GsxxOuEedR0i3D9c 8cY5qmqOIRqxjvVxlRKW1Z5JWuvgXNr7lLG53gdp+EtpFlL/aJozdKZEw/MOeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705082065; a=rsa-sha256; cv=none; b=dMEY2JX+3J2OKGp+Zuzh4oO8P0pKoDZDAA2ADe4Gu2QNKj06HsRcNPh37OhIoaNyEoQNby Qje+WRS3z94JLNRqnFAH0r81ViS3VAJXhkTOAiBhm8tRRN+fieYhWnmfL8xJnBf5RZKbxl TP9MxH3vuF4kJtzniDyPUT0hSvlUxASqoPpKzXCWZXBFQi93YECZ9JR/aFSCTAHnP9wcWI olQhan8eBiApC5cK+d5onBr7O0Kv0HBDWCq7mjpOXNFEaVG0aLSsGX0m08839ij3PRwJRl nCfUW1lTxKYobqzfRVtXTUNlwG1/CbqewiQf+xbLtrPad/morkQQ+mzxul66sQ== 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 4TBTgj4R6Xz1BnP; Fri, 12 Jan 2024 17:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHsPOd000086; Fri, 12 Jan 2024 17:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHsPQ8000083; Fri, 12 Jan 2024 17:54:25 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:54:25 GMT Message-Id: <202401121754.40CHsPQ8000083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 7fe50d188806 - stable/13 - if_tuntap: remove redundant check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7fe50d188806a49da30fedd1f3f6d8fad1100b95 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7fe50d188806a49da30fedd1f3f6d8fad1100b95 commit 7fe50d188806a49da30fedd1f3f6d8fad1100b95 Author: Michael Tuexen AuthorDate: 2023-11-09 10:43:54 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:54:01 +0000 if_tuntap: remove redundant check eh can't be NULL, so there is no need to check for it. Reported by: zlei Sponsored by: Netflix, Inc. (cherry picked from commit 44669b76504991ef3ac10ef10bc0fa931ae79c45) --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 9cadd971eb37..28b8454c2894 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1772,7 +1772,7 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, eh = mtod(m, struct ether_header *); - if (eh && (ifp->if_flags & IFF_PROMISC) == 0 && + if ((ifp->if_flags & IFF_PROMISC) == 0 && !ETHER_IS_MULTICAST(eh->ether_dhost) && bcmp(eh->ether_dhost, IF_LLADDR(ifp), ETHER_ADDR_LEN) != 0) { m_freem(m); From nobody Fri Jan 12 17:55:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBThs2qF4z57FwZ; Fri, 12 Jan 2024 17:55: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 4TBThs1wX6z4lQy; Fri, 12 Jan 2024 17:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2H1F9JxYrxtUrWHhfDEXQmbndL6Zs+zD/0B+lXHjlQ=; b=M57J4Zo3WMkH1jljvjlrL4T26oPhRzXHqEAXs/VT0OnVRvujo84lkFyEjnV/+VKr6WjBGw 8mWooXpz9wS50oAxVoH2cDLX9Q1RwHfjtYzH2DlFEqwiZIviQhnLrhuH2T5I+zVk2A9O44 QHXTbVsVZ0PG+1za+nVQhxXN6T2g6oa288L4RPLphCBV5jEjI9WXuH73o64UIMnGdst84a iSLiynUN1ODEaYlNVJGJebjkJrV+SLl20DJR0V303SRmtybfS8lxFMfLTzErsvixcyOfrj 4NO9C7dLicW4kbqiH42h41wHgA5e2j2A7wEEnFuvcOcnMKRkWlWAjBnfs1rCVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705082125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2H1F9JxYrxtUrWHhfDEXQmbndL6Zs+zD/0B+lXHjlQ=; b=LYhMYx0z/O1hIl3sxWLWSLUhrqsxlh311Cnj4bgfhO5eRE7q8UjEDrwvyVSXjiDwMpsjqK AHXxfR85tQlcUQE1Ky/iunrUz8FiPP7ZVTHZMbVNWA0quBB8fet5/WAyH+2JueNIKP4T6I 3e9J3a5EJyrEhGqqT8Fg8WVX00xI9a8c2XE6RL8rZuUXH7gsAT5hYXaCtgrorRo1CG0D88 NY+6jEJAdrC3ld6LFGGpyBsBUUEXRk+zvUd+0tpY2epYvs2fQ0862mtkzsCS+jqENAKq4A MdFD+lM3IvuX17sPqc6My4tuO9NBFNipsBt+8RAStDrDJy0TZPMudZ6S13+Jfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705082125; a=rsa-sha256; cv=none; b=I51cHv/ViEgXAlgudpIgDBPd1asG8gwDdYRlEqpEz0aBXR97uHjBF0rGr9yi3LTOero5/Z TLqO/s0PGSCG9qMd8uAtdSWsr81E1dzI1yfn08YJrbWOBaInVsSFA8/TCgeFsQLZrXZcxY Q+wuM/Yrh6QQP63MeLmkqc2W3QeYYxOMkrVmJjem2D9Rbitehy9G7PcYEhOdFk7L5/SkXd POg6cIdwectN5osrA+S2tS4pp4s1B9dqOxN0GthsOqbQ0m5swXhD83CcEmdosSioU7rnLN teAzMQVlma/2YyySmp28Eo525sLML/k6Mx6LR7038kEeE80rqwMYj14Bp5aG9g== 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 4TBThs0zcfz1BBX; Fri, 12 Jan 2024 17:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CHtP8n000380; Fri, 12 Jan 2024 17:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CHtPiW000377; Fri, 12 Jan 2024 17:55:25 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:55:25 GMT Message-Id: <202401121755.40CHtPiW000377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 73e955d3ea57 - stable/13 - if_tuntap: add LRO support to tap devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 73e955d3ea57f05fb3ae353bc01eec1e6f2e2397 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=73e955d3ea57f05fb3ae353bc01eec1e6f2e2397 commit 73e955d3ea57f05fb3ae353bc01eec1e6f2e2397 Author: Michael Tuexen AuthorDate: 2023-11-19 14:57:53 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:54:43 +0000 if_tuntap: add LRO support to tap devices This allows testing the LRO code with packetdrill in local mode. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42548 (cherry picked from commit 99c79cab422705f92f05a2924a29bdf823372ebf) --- sys/net/if_tuntap.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 28b8454c2894..a2eecd31723d 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -96,6 +96,7 @@ #endif #include #include +#include #include #include #include @@ -143,6 +144,8 @@ struct tuntap_softc { struct ether_addr tun_ether; /* remote address */ int tun_busy; /* busy count */ int tun_vhdrlen; /* virtio-net header length */ + struct lro_ctrl tun_lro; /* for TCP LRO */ + bool tun_lro_ready; /* TCP LRO initialized */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) @@ -971,7 +974,8 @@ tuncreate(struct cdev *dev) IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) - ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; + ifp->if_capabilities |= + IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO; ifp->if_capenable |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) { @@ -1168,6 +1172,12 @@ tundtor(void *data) (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; + if (l2tun && tp->tun_lro_ready) { + TUNDEBUG (ifp, "LRO disabled\n"); + tcp_lro_free(&tp->tun_lro); + tp->tun_lro_ready = false; + } + if (ifp->if_flags & IFF_UP) { TUN_UNLOCK(tp); if_down(ifp); @@ -1212,6 +1222,14 @@ tuninit(struct ifnet *ifp) getmicrotime(&ifp->if_lastchange); TUN_UNLOCK(tp); } else { + if (tcp_lro_init(&tp->tun_lro) == 0) { + TUNDEBUG(ifp, "LRO enabled\n"); + tp->tun_lro.ifp = ifp; + tp->tun_lro_ready = true; + } else { + TUNDEBUG(ifp, "Could not enable LRO\n"); + tp->tun_lro_ready = false; + } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; TUN_UNLOCK(tp); /* attempt to start output */ @@ -1758,6 +1776,7 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; + int result; ifp = TUN2IFP(tp); @@ -1813,7 +1832,15 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); - (*ifp->if_input)(ifp, m); + if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) { + result = tcp_lro_rx(&tp->tun_lro, m, 0); + TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result); + } else + result = TCP_LRO_CANNOT; + if (result == 0) + tcp_lro_flush_all(&tp->tun_lro); + else + (*ifp->if_input)(ifp, m); NET_EPOCH_EXIT(et); CURVNET_RESTORE(); /* ibytes are counted in parent */ From nobody Fri Jan 12 21:10:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBZ1p39zPz56N08; Fri, 12 Jan 2024 21:10: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 4TBZ1p2Flyz4Vm2; Fri, 12 Jan 2024 21:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705093822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VejDXPJFKYgRq23Es+p/vBfZFYBKov5RQHRqe3kgIO4=; b=KJZ1fL6OKCvPF9R+qVgfdGxZ3L7FbGxlNvepHotnDeoaTgWy6cnr/x91mBWgdw0SxcXm1c TWGWrFr+ia1+r76k61nLQ19VEWiGn0ScXik/PnKyjnK8dvOX1I6rpbXIKzUsBIgTvt+TTp ujKlq33+i/WlLZN/fWpXG0J7MPFXSIx5rvszSLWizawpoiGKcGIDZ2ZtpfiU01xxBzWYP+ dagrst68gSI7PtrrmvHTAL6ffvW5bNOQfZkCjNa0VS7/UuZTe7ExMNBA4fxY32wafm6msq Sn6gpmh/DkVKug7lUCVz8XmCS6EsDD2NM0ccg4lHOZ4XiMmZT5F9O8JFa5CWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705093822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VejDXPJFKYgRq23Es+p/vBfZFYBKov5RQHRqe3kgIO4=; b=FkVTzYJ3Ldn1rsLZXzNTa25mj/oXfxd6V0nlk6bnyVEDmgHriLjCireurfeoWTCzA9bEvl mc1xW9E/j1qe4jI2m/Rc8zy8wgymuCOiqQ9DsyWUCbmRNG55FmggRH5DHpeuBfVqUApeqm xChXhwEo0mcxItHOVvdq5iQupkGSG0eKUDtmlmEZGRduvYUz0NenJKzh84GlvGL63PwM3X jWuGeOiYngQXcvAjUicVkUy8VSeU3WSbfdgsH1eDrK6cRfMNURlgArvenRstrDl1xqpRbY YnFz5yczHgjSw0UfwMR0h/mjvZ9U18qNxbaN0fUSh+u/1FN5zO4Fn9Ychkvbkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705093822; a=rsa-sha256; cv=none; b=jBnaZkz+ISPs2gzKVuD800qJw9JnuBilhC0UhGH9uRC/yeYpdnHFmTrwKLe1a5AISCf2EA 7o3LqYY9ckcQeqeDHrVxKxEh+A3K3VOBYzMuyDigv7VngyTFanEPgC2uXeUoOF06nvpxx+ 6URWg8/98uu2tXS+m0bFMnhobBD6Yqn2Gn+eMcukCEDXb8381ZnWpvk81M95U43tEMxb9n 77/FJWxWRBzqw4MZ1MOyD2nNXRF0cZY3JGQWZQoY2Fkuybe0LIXzc4BW6tXNOmWdaMELWn 6I85T1uIJzlKPX//nf9RRuSGh+Fh0rn9N0+PErhFVyfpOQ8ei+OJliqLdAl6Tg== 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 4TBZ1p1JBpz1HcX; Fri, 12 Jan 2024 21:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40CLAME2032317; Fri, 12 Jan 2024 21:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CLAM2t032314; Fri, 12 Jan 2024 21:10:22 GMT (envelope-from git) Date: Fri, 12 Jan 2024 21:10:22 GMT Message-Id: <202401122110.40CLAM2t032314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4c4633fdffbe - stable/13 - if_tuntap: fix NOIP build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c4633fdffbe8e4b6d328c2bc9bb3edacc9ab50a Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4c4633fdffbe8e4b6d328c2bc9bb3edacc9ab50a commit 4c4633fdffbe8e4b6d328c2bc9bb3edacc9ab50a Author: Gleb Smirnoff AuthorDate: 2023-12-04 18:18:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 21:09:27 +0000 if_tuntap: fix NOIP build Note: this removes one TUNDEBUG() for the sake of not having one more ifdefed variable declaration and for the overall code brevity. The call from tuntap into LRO can be so easily traced with dtrace(1) that an 80-ish printf(9)-based debugging can be omitted. Fixes: 99c79cab422705f92f05a2924a29bdf823372ebf (cherry picked from commit 5b0010b4678d778967a5a82fb38507e46a071e38) --- sys/net/if_tuntap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index a2eecd31723d..a6695adc93c5 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1171,13 +1171,13 @@ tundtor(void *data) if ((tp->tun_flags & TUN_VMNET) != 0 || (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; - +#if defined(INET) || defined(INET6) if (l2tun && tp->tun_lro_ready) { TUNDEBUG (ifp, "LRO disabled\n"); tcp_lro_free(&tp->tun_lro); tp->tun_lro_ready = false; } - +#endif if (ifp->if_flags & IFF_UP) { TUN_UNLOCK(tp); if_down(ifp); @@ -1222,6 +1222,7 @@ tuninit(struct ifnet *ifp) getmicrotime(&ifp->if_lastchange); TUN_UNLOCK(tp); } else { +#if defined(INET) || defined(INET6) if (tcp_lro_init(&tp->tun_lro) == 0) { TUNDEBUG(ifp, "LRO enabled\n"); tp->tun_lro.ifp = ifp; @@ -1230,6 +1231,7 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "Could not enable LRO\n"); tp->tun_lro_ready = false; } +#endif ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; TUN_UNLOCK(tp); /* attempt to start output */ @@ -1776,7 +1778,6 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; - int result; ifp = TUN2IFP(tp); @@ -1832,14 +1833,12 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); - if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) { - result = tcp_lro_rx(&tp->tun_lro, m, 0); - TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result); - } else - result = TCP_LRO_CANNOT; - if (result == 0) +#if defined(INET) || defined(INET6) + if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO && + tcp_lro_rx(&tp->tun_lro, m, 0) == 0) tcp_lro_flush_all(&tp->tun_lro); else +#endif (*ifp->if_input)(ifp, m); NET_EPOCH_EXIT(et); CURVNET_RESTORE(); From nobody Sun Jan 14 21:53:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv251dlz57DfP; Sun, 14 Jan 2024 21: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 4TCpv236mvz4Dx3; Sun, 14 Jan 2024 21:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bda/fu7Mzm2Y77o6ul7BOi8P/JD9ymBZHuf+mXFNb84=; b=QtyFKfAR3drzVEsWyfu4gfR8FybULrNrKQDF2OdhSSXqKj7CPOv3foANe6K1V/42Wfm8Tm BfT/qmULiZMpzCxC6Sld1uvKaQi8RTmQn6FN/P89C9IaLn+FSkwM6TNHC9jt6n58Bu0jOe Hg1JkewHGUsrcXAwy4M2ZLOTJpJLhpMRq8pQYWkdqzWJDHteXCeI0RNt1Vwv1KG1V7Pqye NBl4PQKwA/Afb6pYnV5ZDvFd1eYdHDHvbMn1GZxVxbzA3tJ3Szbyxa6+kx1l5pGxnG4VeB CsnCEa5OZNpae1eL6SiRLjzGNEvWQMa0PCfF1pq6VdSO8ud9loBv7XQmuWr23w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bda/fu7Mzm2Y77o6ul7BOi8P/JD9ymBZHuf+mXFNb84=; b=Fi+uzD1Upc1FrTsSQ8394/VVJAi1ujhmGXHITV3Zou5OmNOwVPf/nRHO88mcOK+bnJoIK3 oQU90aaNCqU02DFsIRfE+qjtFRCfNYrXd7jCazZXB4pn2tH2o0YwxUw9jlhgoKXj9humNb I0mnM/ZhCcQYGLyxF+CV5JOje3qrEKtkqqO2+7dGwli874dzA5nxCgTCRsLeTupP9skhHp SzcypCo2AN1jekJHr6UZN6LpW+qfcNQtI1tdxoi79l/ruJhwIS0na09I9tI66/0TvTPbcP idNzanUg5CFfJStpw9scOwOD7rJhinxtgm+xsFH7Sqly0dXnZmH4t5GKpd8W9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269230; a=rsa-sha256; cv=none; b=dxgAqIoH+lFrMb2wzo12eq6AqAnFMP8ZRpBWNdVj+GtD9tSi9/s2+gw2iMdF/lpaU5yw1Z Qkjm2wuVV+PR9yvzJ1JASAdckojE0qOECqa+QWlUDS9Oyj1XiFVAOvEIhdzLbx94aedkIn JNLr0yHmOkLzOxygmoWfNG/ERsuZ9lluEBLUnJAlv5FbRLxnAOBwnL6FpDhD/NJreuJwNO InlsM88WR03Qt73VLpqaWxIF5/+ULPnhsaKcWOJ3e5J/X6TL9G0XFDTaQfJpq5NMM3yrS+ 7mbn64AwvcbbiJSryGx5cRpn9TI4dIeToLovBKpDiG7Ra/6NT6ZaGll0P8vAFA== 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 4TCpv22BgtzWMH; Sun, 14 Jan 2024 21:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELroXW041369; Sun, 14 Jan 2024 21:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELroF8041366; Sun, 14 Jan 2024 21:53:50 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:50 GMT Message-Id: <202401142153.40ELroF8041366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 6b358493a69c - stable/14 - ena: Upgrade ena-com to freebsd v2.7.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b358493a69c7a483b767dfe2c95c4b3c194cd2a Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=6b358493a69c7a483b767dfe2c95c4b3c194cd2a commit 6b358493a69c7a483b767dfe2c95c4b3c194cd2a Author: Arthur Kiyanovski AuthorDate: 2023-12-28 13:52:31 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:10 +0000 ena: Upgrade ena-com to freebsd v2.7.0 Merge commit '04cf7cee5ae0c6bb29eb21ce85bab7ca7386a95f' Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit adfed2d835a7f9382941896d15a487dac6fe659c) --- sys/contrib/ena-com/ena_admin_defs.h | 1412 ------------------------ sys/contrib/ena-com/ena_com.c | 431 +++++++- sys/contrib/ena-com/ena_com.h | 187 +++- sys/contrib/ena-com/ena_common_defs.h | 50 - sys/contrib/ena-com/ena_defs/ena_admin_defs.h | 146 ++- sys/contrib/ena-com/ena_defs/ena_common_defs.h | 3 +- sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h | 18 +- sys/contrib/ena-com/ena_defs/ena_regs_defs.h | 13 +- sys/contrib/ena-com/ena_eth_com.c | 45 +- sys/contrib/ena-com/ena_eth_com.h | 29 +- sys/contrib/ena-com/ena_eth_io_defs.h | 960 ---------------- sys/contrib/ena-com/ena_fbsd_log.h | 74 -- sys/contrib/ena-com/ena_plat.h | 52 +- sys/contrib/ena-com/ena_regs_defs.h | 137 --- 14 files changed, 807 insertions(+), 2750 deletions(-) diff --git a/sys/contrib/ena-com/ena_admin_defs.h b/sys/contrib/ena-com/ena_admin_defs.h deleted file mode 100644 index 1d845c08256e..000000000000 --- a/sys/contrib/ena-com/ena_admin_defs.h +++ /dev/null @@ -1,1412 +0,0 @@ -/*- - * BSD LICENSE - * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER 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. - */ - -#ifndef _ENA_ADMIN_H_ -#define _ENA_ADMIN_H_ - -enum ena_admin_aq_opcode { - ENA_ADMIN_CREATE_SQ = 1, - - ENA_ADMIN_DESTROY_SQ = 2, - - ENA_ADMIN_CREATE_CQ = 3, - - ENA_ADMIN_DESTROY_CQ = 4, - - ENA_ADMIN_GET_FEATURE = 8, - - ENA_ADMIN_SET_FEATURE = 9, - - ENA_ADMIN_GET_STATS = 11, -}; - -enum ena_admin_aq_completion_status { - ENA_ADMIN_SUCCESS = 0, - - ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE = 1, - - ENA_ADMIN_BAD_OPCODE = 2, - - ENA_ADMIN_UNSUPPORTED_OPCODE = 3, - - ENA_ADMIN_MALFORMED_REQUEST = 4, - - /* Additional status is provided in ACQ entry extended_status */ - ENA_ADMIN_ILLEGAL_PARAMETER = 5, - - ENA_ADMIN_UNKNOWN_ERROR = 6, -}; - -enum ena_admin_aq_feature_id { - ENA_ADMIN_DEVICE_ATTRIBUTES = 1, - - ENA_ADMIN_MAX_QUEUES_NUM = 2, - - ENA_ADMIN_HW_HINTS = 3, - - ENA_ADMIN_RSS_HASH_FUNCTION = 10, - - ENA_ADMIN_STATELESS_OFFLOAD_CONFIG = 11, - - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG = 12, - - ENA_ADMIN_MTU = 14, - - ENA_ADMIN_RSS_HASH_INPUT = 18, - - ENA_ADMIN_INTERRUPT_MODERATION = 20, - - ENA_ADMIN_AENQ_CONFIG = 26, - - ENA_ADMIN_LINK_CONFIG = 27, - - ENA_ADMIN_HOST_ATTR_CONFIG = 28, - - ENA_ADMIN_FEATURES_OPCODE_NUM = 32, -}; - -enum ena_admin_placement_policy_type { - /* descriptors and headers are in host memory */ - ENA_ADMIN_PLACEMENT_POLICY_HOST = 1, - - /* descriptors and headers are in device memory (a.k.a Low Latency - * Queue) - */ - ENA_ADMIN_PLACEMENT_POLICY_DEV = 3, -}; - -enum ena_admin_link_types { - ENA_ADMIN_LINK_SPEED_1G = 0x1, - - ENA_ADMIN_LINK_SPEED_2_HALF_G = 0x2, - - ENA_ADMIN_LINK_SPEED_5G = 0x4, - - ENA_ADMIN_LINK_SPEED_10G = 0x8, - - ENA_ADMIN_LINK_SPEED_25G = 0x10, - - ENA_ADMIN_LINK_SPEED_40G = 0x20, - - ENA_ADMIN_LINK_SPEED_50G = 0x40, - - ENA_ADMIN_LINK_SPEED_100G = 0x80, - - ENA_ADMIN_LINK_SPEED_200G = 0x100, - - ENA_ADMIN_LINK_SPEED_400G = 0x200, -}; - -enum ena_admin_completion_policy_type { - /* completion queue entry for each sq descriptor */ - ENA_ADMIN_COMPLETION_POLICY_DESC = 0, - - /* completion queue entry upon request in sq descriptor */ - ENA_ADMIN_COMPLETION_POLICY_DESC_ON_DEMAND = 1, - - /* current queue head pointer is updated in OS memory upon sq - * descriptor request - */ - ENA_ADMIN_COMPLETION_POLICY_HEAD_ON_DEMAND = 2, - - /* current queue head pointer is updated in OS memory for each sq - * descriptor - */ - ENA_ADMIN_COMPLETION_POLICY_HEAD = 3, -}; - -/* basic stats return ena_admin_basic_stats while extanded stats return a - * buffer (string format) with additional statistics per queue and per - * device id - */ -enum ena_admin_get_stats_type { - ENA_ADMIN_GET_STATS_TYPE_BASIC = 0, - - ENA_ADMIN_GET_STATS_TYPE_EXTENDED = 1, -}; - -enum ena_admin_get_stats_scope { - ENA_ADMIN_SPECIFIC_QUEUE = 0, - - ENA_ADMIN_ETH_TRAFFIC = 1, -}; - -struct ena_admin_aq_common_desc { - /* 11:0 : command_id - * 15:12 : reserved12 - */ - uint16_t command_id; - - /* as appears in ena_admin_aq_opcode */ - uint8_t opcode; - - /* 0 : phase - * 1 : ctrl_data - control buffer address valid - * 2 : ctrl_data_indirect - control buffer address - * points to list of pages with addresses of control - * buffers - * 7:3 : reserved3 - */ - uint8_t flags; -}; - -/* used in ena_admin_aq_entry. Can point directly to control data, or to a - * page list chunk. Used also at the end of indirect mode page list chunks, - * for chaining. - */ -struct ena_admin_ctrl_buff_info { - uint32_t length; - - struct ena_common_mem_addr address; -}; - -struct ena_admin_sq { - uint16_t sq_idx; - - /* 4:0 : reserved - * 7:5 : sq_direction - 0x1 - Tx; 0x2 - Rx - */ - uint8_t sq_identity; - - uint8_t reserved1; -}; - -struct ena_admin_aq_entry { - struct ena_admin_aq_common_desc aq_common_descriptor; - - union { - uint32_t inline_data_w1[3]; - - struct ena_admin_ctrl_buff_info control_buffer; - } u; - - uint32_t inline_data_w4[12]; -}; - -struct ena_admin_acq_common_desc { - /* command identifier to associate it with the aq descriptor - * 11:0 : command_id - * 15:12 : reserved12 - */ - uint16_t command; - - uint8_t status; - - /* 0 : phase - * 7:1 : reserved1 - */ - uint8_t flags; - - uint16_t extended_status; - - /* serves as a hint what AQ entries can be revoked */ - uint16_t sq_head_indx; -}; - -struct ena_admin_acq_entry { - struct ena_admin_acq_common_desc acq_common_descriptor; - - uint32_t response_specific_data[14]; -}; - -struct ena_admin_aq_create_sq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - /* 4:0 : reserved0_w1 - * 7:5 : sq_direction - 0x1 - Tx, 0x2 - Rx - */ - uint8_t sq_identity; - - uint8_t reserved8_w1; - - /* 3:0 : placement_policy - Describing where the SQ - * descriptor ring and the SQ packet headers reside: - * 0x1 - descriptors and headers are in OS memory, - * 0x3 - descriptors and headers in device memory - * (a.k.a Low Latency Queue) - * 6:4 : completion_policy - Describing what policy - * to use for generation completion entry (cqe) in - * the CQ associated with this SQ: 0x0 - cqe for each - * sq descriptor, 0x1 - cqe upon request in sq - * descriptor, 0x2 - current queue head pointer is - * updated in OS memory upon sq descriptor request - * 0x3 - current queue head pointer is updated in OS - * memory for each sq descriptor - * 7 : reserved15_w1 - */ - uint8_t sq_caps_2; - - /* 0 : is_physically_contiguous - Described if the - * queue ring memory is allocated in physical - * contiguous pages or split. - * 7:1 : reserved17_w1 - */ - uint8_t sq_caps_3; - - /* associated completion queue id. This CQ must be created prior to - * SQ creation - */ - uint16_t cq_idx; - - /* submission queue depth in entries */ - uint16_t sq_depth; - - /* SQ physical base address in OS memory. This field should not be - * used for Low Latency queues. Has to be page aligned. - */ - struct ena_common_mem_addr sq_ba; - - /* specifies queue head writeback location in OS memory. Valid if - * completion_policy is set to completion_policy_head_on_demand or - * completion_policy_head. Has to be cache aligned - */ - struct ena_common_mem_addr sq_head_writeback; - - uint32_t reserved0_w7; - - uint32_t reserved0_w8; -}; - -enum ena_admin_sq_direction { - ENA_ADMIN_SQ_DIRECTION_TX = 1, - - ENA_ADMIN_SQ_DIRECTION_RX = 2, -}; - -struct ena_admin_acq_create_sq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; - - uint16_t sq_idx; - - uint16_t reserved; - - /* queue doorbell address as an offset to PCIe MMIO REG BAR */ - uint32_t sq_doorbell_offset; - - /* low latency queue ring base address as an offset to PCIe MMIO - * LLQ_MEM BAR - */ - uint32_t llq_descriptors_offset; - - /* low latency queue headers' memory as an offset to PCIe MMIO - * LLQ_MEM BAR - */ - uint32_t llq_headers_offset; -}; - -struct ena_admin_aq_destroy_sq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_sq sq; -}; - -struct ena_admin_acq_destroy_sq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; -}; - -struct ena_admin_aq_create_cq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - /* 4:0 : reserved5 - * 5 : interrupt_mode_enabled - if set, cq operates - * in interrupt mode, otherwise - polling - * 7:6 : reserved6 - */ - uint8_t cq_caps_1; - - /* 4:0 : cq_entry_size_words - size of CQ entry in - * 32-bit words, valid values: 4, 8. - * 7:5 : reserved7 - */ - uint8_t cq_caps_2; - - /* completion queue depth in # of entries. must be power of 2 */ - uint16_t cq_depth; - - /* msix vector assigned to this cq */ - uint32_t msix_vector; - - /* cq physical base address in OS memory. CQ must be physically - * contiguous - */ - struct ena_common_mem_addr cq_ba; -}; - -struct ena_admin_acq_create_cq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; - - uint16_t cq_idx; - - /* actual cq depth in number of entries */ - uint16_t cq_actual_depth; - - uint32_t numa_node_register_offset; - - uint32_t cq_head_db_register_offset; - - uint32_t cq_interrupt_unmask_register_offset; -}; - -struct ena_admin_aq_destroy_cq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - uint16_t cq_idx; - - uint16_t reserved1; -}; - -struct ena_admin_acq_destroy_cq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; -}; - -/* ENA AQ Get Statistics command. Extended statistics are placed in control - * buffer pointed by AQ entry - */ -struct ena_admin_aq_get_stats_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - union { - /* command specific inline data */ - uint32_t inline_data_w1[3]; - - struct ena_admin_ctrl_buff_info control_buffer; - } u; - - /* stats type as defined in enum ena_admin_get_stats_type */ - uint8_t type; - - /* stats scope defined in enum ena_admin_get_stats_scope */ - uint8_t scope; - - uint16_t reserved3; - - /* queue id. used when scope is specific_queue */ - uint16_t queue_idx; - - /* device id, value 0xFFFF means mine. only privileged device can get - * stats of other device - */ - uint16_t device_id; -}; - -/* Basic Statistics Command. */ -struct ena_admin_basic_stats { - uint32_t tx_bytes_low; - - uint32_t tx_bytes_high; - - uint32_t tx_pkts_low; - - uint32_t tx_pkts_high; - - uint32_t rx_bytes_low; - - uint32_t rx_bytes_high; - - uint32_t rx_pkts_low; - - uint32_t rx_pkts_high; - - uint32_t rx_drops_low; - - uint32_t rx_drops_high; -}; - -struct ena_admin_acq_get_stats_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - struct ena_admin_basic_stats basic_stats; -}; - -struct ena_admin_get_set_feature_common_desc { - /* 1:0 : select - 0x1 - current value; 0x3 - default - * value - * 7:3 : reserved3 - */ - uint8_t flags; - - /* as appears in ena_admin_aq_feature_id */ - uint8_t feature_id; - - uint16_t reserved16; -}; - -struct ena_admin_device_attr_feature_desc { - uint32_t impl_id; - - uint32_t device_version; - - /* bitmap of ena_admin_aq_feature_id */ - uint32_t supported_features; - - uint32_t reserved3; - - /* Indicates how many bits are used physical address access. */ - uint32_t phys_addr_width; - - /* Indicates how many bits are used virtual address access. */ - uint32_t virt_addr_width; - - /* unicast MAC address (in Network byte order) */ - uint8_t mac_addr[6]; - - uint8_t reserved7[2]; - - uint32_t max_mtu; -}; - -struct ena_admin_queue_feature_desc { - /* including LLQs */ - uint32_t max_sq_num; - - uint32_t max_sq_depth; - - uint32_t max_cq_num; - - uint32_t max_cq_depth; - - uint32_t max_llq_num; - - uint32_t max_llq_depth; - - uint32_t max_header_size; - - /* Maximum Descriptors number, including meta descriptor, allowed for - * a single Tx packet - */ - uint16_t max_packet_tx_descs; - - /* Maximum Descriptors number allowed for a single Rx packet */ - uint16_t max_packet_rx_descs; -}; - -struct ena_admin_set_feature_mtu_desc { - /* exclude L2 */ - uint32_t mtu; -}; - -struct ena_admin_set_feature_host_attr_desc { - /* host OS info base address in OS memory. host info is 4KB of - * physically contiguous - */ - struct ena_common_mem_addr os_info_ba; - - /* host debug area base address in OS memory. debug area must be - * physically contiguous - */ - struct ena_common_mem_addr debug_ba; - - /* debug area size */ - uint32_t debug_area_size; -}; - -struct ena_admin_feature_intr_moder_desc { - /* interrupt delay granularity in usec */ - uint16_t intr_delay_resolution; - - uint16_t reserved; -}; - -struct ena_admin_get_feature_link_desc { - /* Link speed in Mb */ - uint32_t speed; - - /* bit field of enum ena_admin_link types */ - uint32_t supported; - - /* 0 : autoneg - * 1 : duplex - Full Duplex - * 31:2 : reserved2 - */ - uint32_t flags; -}; - -struct ena_admin_feature_aenq_desc { - /* bitmask for AENQ groups the device can report */ - uint32_t supported_groups; - - /* bitmask for AENQ groups to report */ - uint32_t enabled_groups; -}; - -struct ena_admin_feature_offload_desc { - /* 0 : TX_L3_csum_ipv4 - * 1 : TX_L4_ipv4_csum_part - The checksum field - * should be initialized with pseudo header checksum - * 2 : TX_L4_ipv4_csum_full - * 3 : TX_L4_ipv6_csum_part - The checksum field - * should be initialized with pseudo header checksum - * 4 : TX_L4_ipv6_csum_full - * 5 : tso_ipv4 - * 6 : tso_ipv6 - * 7 : tso_ecn - */ - uint32_t tx; - - /* Receive side supported stateless offload - * 0 : RX_L3_csum_ipv4 - IPv4 checksum - * 1 : RX_L4_ipv4_csum - TCP/UDP/IPv4 checksum - * 2 : RX_L4_ipv6_csum - TCP/UDP/IPv6 checksum - * 3 : RX_hash - Hash calculation - */ - uint32_t rx_supported; - - uint32_t rx_enabled; -}; - -enum ena_admin_hash_functions { - ENA_ADMIN_TOEPLITZ = 1, - - ENA_ADMIN_CRC32 = 2, -}; - -struct ena_admin_feature_rss_flow_hash_control { - uint32_t keys_num; - - uint32_t reserved; - - uint32_t key[10]; -}; - -struct ena_admin_feature_rss_flow_hash_function { - /* 7:0 : funcs - bitmask of ena_admin_hash_functions */ - uint32_t supported_func; - - /* 7:0 : selected_func - bitmask of - * ena_admin_hash_functions - */ - uint32_t selected_func; - - /* initial value */ - uint32_t init_val; -}; - -/* RSS flow hash protocols */ -enum ena_admin_flow_hash_proto { - ENA_ADMIN_RSS_TCP4 = 0, - - ENA_ADMIN_RSS_UDP4 = 1, - - ENA_ADMIN_RSS_TCP6 = 2, - - ENA_ADMIN_RSS_UDP6 = 3, - - ENA_ADMIN_RSS_IP4 = 4, - - ENA_ADMIN_RSS_IP6 = 5, - - ENA_ADMIN_RSS_IP4_FRAG = 6, - - ENA_ADMIN_RSS_NOT_IP = 7, - - /* TCPv6 with extension header */ - ENA_ADMIN_RSS_TCP6_EX = 8, - - /* IPv6 with extension header */ - ENA_ADMIN_RSS_IP6_EX = 9, - - ENA_ADMIN_RSS_PROTO_NUM = 16, -}; - -/* RSS flow hash fields */ -enum ena_admin_flow_hash_fields { - /* Ethernet Dest Addr */ - ENA_ADMIN_RSS_L2_DA = BIT(0), - - /* Ethernet Src Addr */ - ENA_ADMIN_RSS_L2_SA = BIT(1), - - /* ipv4/6 Dest Addr */ - ENA_ADMIN_RSS_L3_DA = BIT(2), - - /* ipv4/6 Src Addr */ - ENA_ADMIN_RSS_L3_SA = BIT(3), - - /* tcp/udp Dest Port */ - ENA_ADMIN_RSS_L4_DP = BIT(4), - - /* tcp/udp Src Port */ - ENA_ADMIN_RSS_L4_SP = BIT(5), -}; - -struct ena_admin_proto_input { - /* flow hash fields (bitwise according to ena_admin_flow_hash_fields) */ - uint16_t fields; - - uint16_t reserved2; -}; - -struct ena_admin_feature_rss_hash_control { - struct ena_admin_proto_input supported_fields[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input selected_fields[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input reserved2[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input reserved3[ENA_ADMIN_RSS_PROTO_NUM]; -}; - -struct ena_admin_feature_rss_flow_hash_input { - /* supported hash input sorting - * 1 : L3_sort - support swap L3 addresses if DA is - * smaller than SA - * 2 : L4_sort - support swap L4 ports if DP smaller - * SP - */ - uint16_t supported_input_sort; - - /* enabled hash input sorting - * 1 : enable_L3_sort - enable swap L3 addresses if - * DA smaller than SA - * 2 : enable_L4_sort - enable swap L4 ports if DP - * smaller than SP - */ - uint16_t enabled_input_sort; -}; - -enum ena_admin_os_type { - ENA_ADMIN_OS_LINUX = 1, - - ENA_ADMIN_OS_WIN = 2, - - ENA_ADMIN_OS_DPDK = 3, - - ENA_ADMIN_OS_FREEBSD = 4, - - ENA_ADMIN_OS_IPXE = 5, -}; - -struct ena_admin_host_info { - /* defined in enum ena_admin_os_type */ - uint32_t os_type; - - /* os distribution string format */ - uint8_t os_dist_str[128]; - - /* OS distribution numeric format */ - uint32_t os_dist; - - /* kernel version string format */ - uint8_t kernel_ver_str[32]; - - /* Kernel version numeric format */ - uint32_t kernel_ver; - - /* 7:0 : major - * 15:8 : minor - * 23:16 : sub_minor - */ - uint32_t driver_version; - - /* features bitmap */ - uint32_t supported_network_features[4]; -}; - -struct ena_admin_rss_ind_table_entry { - uint16_t cq_idx; - - uint16_t reserved; -}; - -struct ena_admin_feature_rss_ind_table { - /* min supported table size (2^min_size) */ - uint16_t min_size; - - /* max supported table size (2^max_size) */ - uint16_t max_size; - - /* table size (2^size) */ - uint16_t size; - - uint16_t reserved; - - /* index of the inline entry. 0xFFFFFFFF means invalid */ - uint32_t inline_index; - - /* used for updating single entry, ignored when setting the entire - * table through the control buffer. - */ - struct ena_admin_rss_ind_table_entry inline_entry; -}; - -/* When hint value is 0, driver should use it's own predefined value */ -struct ena_admin_ena_hw_hints { - /* value in ms */ - uint16_t mmio_read_timeout; - - /* value in ms */ - uint16_t driver_watchdog_timeout; - - /* Per packet tx completion timeout. value in ms */ - uint16_t missing_tx_completion_timeout; - - uint16_t missed_tx_completion_count_threshold_to_reset; - - /* value in ms */ - uint16_t admin_completion_tx_timeout; - - uint16_t netdev_wd_timeout; - - uint16_t max_tx_sgl_size; - - uint16_t max_rx_sgl_size; - - uint16_t reserved[8]; -}; - -struct ena_admin_get_feat_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_ctrl_buff_info control_buffer; - - struct ena_admin_get_set_feature_common_desc feat_common; - - uint32_t raw[11]; -}; - -struct ena_admin_get_feat_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - union { - uint32_t raw[14]; - - struct ena_admin_device_attr_feature_desc dev_attr; - - struct ena_admin_queue_feature_desc max_queue; - - struct ena_admin_feature_aenq_desc aenq; - - struct ena_admin_get_feature_link_desc link; - - struct ena_admin_feature_offload_desc offload; - - struct ena_admin_feature_rss_flow_hash_function flow_hash_func; - - struct ena_admin_feature_rss_flow_hash_input flow_hash_input; - - struct ena_admin_feature_rss_ind_table ind_table; - - struct ena_admin_feature_intr_moder_desc intr_moderation; - - struct ena_admin_ena_hw_hints hw_hints; - } u; -}; - -struct ena_admin_set_feat_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_ctrl_buff_info control_buffer; - - struct ena_admin_get_set_feature_common_desc feat_common; - - union { - uint32_t raw[11]; - - /* mtu size */ - struct ena_admin_set_feature_mtu_desc mtu; - - /* host attributes */ - struct ena_admin_set_feature_host_attr_desc host_attr; - - /* AENQ configuration */ - struct ena_admin_feature_aenq_desc aenq; - - /* rss flow hash function */ - struct ena_admin_feature_rss_flow_hash_function flow_hash_func; - - /* rss flow hash input */ - struct ena_admin_feature_rss_flow_hash_input flow_hash_input; - - /* rss indirection table */ - struct ena_admin_feature_rss_ind_table ind_table; - } u; -}; - -struct ena_admin_set_feat_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - union { - uint32_t raw[14]; - } u; -}; - -struct ena_admin_aenq_common_desc { - uint16_t group; - - uint16_t syndrom; - - /* 0 : phase */ - uint8_t flags; - - uint8_t reserved1[3]; - - uint32_t timestamp_low; - - uint32_t timestamp_high; -}; - -/* asynchronous event notification groups */ -enum ena_admin_aenq_group { - ENA_ADMIN_LINK_CHANGE = 0, - - ENA_ADMIN_FATAL_ERROR = 1, - - ENA_ADMIN_WARNING = 2, - - ENA_ADMIN_NOTIFICATION = 3, - - ENA_ADMIN_KEEP_ALIVE = 4, - - ENA_ADMIN_AENQ_GROUPS_NUM = 5, -}; - -enum ena_admin_aenq_notification_syndrom { - ENA_ADMIN_SUSPEND = 0, - - ENA_ADMIN_RESUME = 1, - - ENA_ADMIN_UPDATE_HINTS = 2, -}; - -struct ena_admin_aenq_entry { - struct ena_admin_aenq_common_desc aenq_common_desc; - - /* command specific inline data */ - uint32_t inline_data_w4[12]; -}; - -struct ena_admin_aenq_link_change_desc { - struct ena_admin_aenq_common_desc aenq_common_desc; - - /* 0 : link_status */ - uint32_t flags; -}; - -struct ena_admin_aenq_keep_alive_desc { - struct ena_admin_aenq_common_desc aenq_common_desc; - - uint32_t rx_drops_low; - - uint32_t rx_drops_high; -}; - -struct ena_admin_ena_mmio_req_read_less_resp { - uint16_t req_id; - - uint16_t reg_off; - - /* value is valid when poll is cleared */ - uint32_t reg_val; -}; - -/* aq_common_desc */ -#define ENA_ADMIN_AQ_COMMON_DESC_COMMAND_ID_MASK GENMASK(11, 0) -#define ENA_ADMIN_AQ_COMMON_DESC_PHASE_MASK BIT(0) -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_SHIFT 1 -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_MASK BIT(1) -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_SHIFT 2 -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_MASK BIT(2) - -/* sq */ -#define ENA_ADMIN_SQ_SQ_DIRECTION_SHIFT 5 -#define ENA_ADMIN_SQ_SQ_DIRECTION_MASK GENMASK(7, 5) - -/* acq_common_desc */ *** 3278 LINES SKIPPED *** From nobody Sun Jan 14 21:53:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv367tfz57Dsw; Sun, 14 Jan 2024 21:53: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 4TCpv34FBJz4Dlc; Sun, 14 Jan 2024 21:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uE6I/1GlAeHy3L7kGbHnv/Y217mObnwbx0PiRKYGHLI=; b=pf9oVQofo98EYfyR6OnzfGNiJMon/l7Phgh955tpiLC5iqWgkfxhTgzLQoVtpigi4zjBdX qF44lW8B/7zFuarUv43ZrM5Z3ZLNyO7FZKJrJPjzUqMiMsImBmJffJpkFbQ1j3yu6kw0bj UX+0gHSTfua/t3/ZG8Tla+UBtPTGTeZ2FDh+VPkKnn06Z7fLSyFU9AP0weo9XHZ41sF3Js FuZGLHLSorpauy3CNkOMhd6l5E6RA10uEVTo4fta04IfnMLbOW60kT/O0WzCFtMhzzCvHS WB5Qmxh9Hbt/nlblm9Jm+26lCgt+AeiPrplVVmPt+fZo9EdpvrCq+X0JaEPe1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uE6I/1GlAeHy3L7kGbHnv/Y217mObnwbx0PiRKYGHLI=; b=ITmth6asiBGcTT6HRirgqwOqx2TxR2aXLJ+4y3R0RJu4J9hPtMB0HAjB0LYyZ4BHmEAP5Y kUzm+k/jY8pvZ7Z5iMjEXHki2thqf+PUPVIO1+CgVOnUlBATCKWdGlD2Ghc4TdCole2bFz WwRtXkXh+Bxoo1YYdFzaWqAKVT8s2tiMC8LYQUULbStOmbx2PWZR4hRKWfzBdgSSBPEfEN qJKoiqmuASsDJBt9aO7WPzj1j4p66RYOFM1BvPIVVsq++klU0AX1pTM5xAy8EGaAn3VkzY bTtqIqngO6hDVpei99WN8WO8ioXu1jW3oMyjhLNg+fhX8YRV3oRfqJKR1ysUsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269231; a=rsa-sha256; cv=none; b=qmhQS3DqRju2dwQ4dpVANLXoMt1HK+l3EAJU10AuY6wqiebLoLF8urwVmbCE3u/AjqmUO6 wVyCenXvXx4WHuB+22FZBSTWI9jyGMCXCanRf08G1870JSo/ziIl/G6NRwq/T7K8qxrvHA Lq/O7lk+i232BC71IpQFbB6L0FOpLFuFYdSdcMVSYqiVxrxq6YgVgs0fg0CcIKhACBNWBC cNkzIXIDpnaoGRga2gBewF5k+wIDgyVgh+/JlEfOOXrsjdCklczgnGpr0Rrm90oFNpRuZ5 a92uwl0K6+38kPMNLykyPDpd8+ajj7qTNx8ZZ54WyLkHhZrzQJnCY/DXY/3heA== 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 4TCpv33JG3zWDL; Sun, 14 Jan 2024 21:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrpVu041417; Sun, 14 Jan 2024 21:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrp4J041414; Sun, 14 Jan 2024 21:53:51 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:51 GMT Message-Id: <202401142153.40ELrp4J041414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 71cd348d2454 - stable/14 - ena: Add sysctl support for spreading IRQs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71cd348d245404b17c08c69b2aa8be3190e68732 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=71cd348d245404b17c08c69b2aa8be3190e68732 commit 71cd348d245404b17c08c69b2aa8be3190e68732 Author: Osama Abboud AuthorDate: 2023-10-30 11:27:03 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:10 +0000 ena: Add sysctl support for spreading IRQs This commit allows spreading IO IRQs over different CPUs through sysctl. Two sysctl nodes are introduced: 1- base_cpu: servers as the first CPU to which the first IO IRQ will be bound. 2- cpu_stride: sets the distance between every two CPUs to which every two consecutive IO IRQs are bound. For example for doing the following IO IRQs / CPU binding: IRQ idx | CPU ---------------- 1 | 0 2 | 2 3 | 4 4 | 6 Run the following commands: sysctl dev.ena..irq_affinity.base_cpu=0 sysctl dev.ena..irq_affinity.cpu_stride=2 Also introduced rss_enabled field, which is intended to replace '#ifdef RSS' in multiple places, in order to prevent code duplication. We want to bind interrupts to CPUs in case of rss set OR in case the newly defined sysctl paremeter is set. This requires to remove a couple of '#ifdef RSS' as well in the structs, since we'll be using the relevant parameters in the CPU binding code. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f9e1d9471077109c19fd7d6dc9c1d35432efdede) --- sys/dev/ena/ena.c | 126 ++++++++++++++++++++++++++++++++++------ sys/dev/ena/ena.h | 14 +++-- sys/dev/ena/ena_sysctl.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+), 22 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 455386a4f152..067c8a6f3a08 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1237,6 +1237,84 @@ ena_update_io_rings(struct ena_adapter *adapter, uint32_t num) ena_init_io_rings(adapter); } +int +ena_update_base_cpu(struct ena_adapter *adapter, int new_num) +{ + int old_num; + int rc = 0; + bool dev_was_up; + + dev_was_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); + old_num = adapter->irq_cpu_base; + + ena_down(adapter); + + adapter->irq_cpu_base = new_num; + + if (dev_was_up) { + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to configure device %d IRQ base CPU. " + "Reverting to previous value: %d\n", + new_num, old_num); + + adapter->irq_cpu_base = old_num; + + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to revert to previous setup." + "Triggering device reset.\n"); + ENA_FLAG_SET_ATOMIC( + ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + ena_trigger_reset(adapter, + ENA_REGS_RESET_OS_TRIGGER); + } + } + } + return (rc); +} + +int +ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num) +{ + uint32_t old_num; + int rc = 0; + bool dev_was_up; + + dev_was_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); + old_num = adapter->irq_cpu_stride; + + ena_down(adapter); + + adapter->irq_cpu_stride = new_num; + + if (dev_was_up) { + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to configure device %d IRQ CPU stride. " + "Reverting to previous value: %d\n", + new_num, old_num); + + adapter->irq_cpu_stride = old_num; + + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to revert to previous setup." + "Triggering device reset.\n"); + ENA_FLAG_SET_ATOMIC( + ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + ena_trigger_reset(adapter, + ENA_REGS_RESET_OS_TRIGGER); + } + } + } + return (rc); +} + /* Caller should sanitize new_num */ int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) @@ -1683,6 +1761,13 @@ ena_setup_io_intr(struct ena_adapter *adapter) ena_log(adapter->pdev, DBG, "ena_setup_io_intr vector: %d\n", adapter->msix_entries[irq_idx].vector); + if (adapter->irq_cpu_base > ENA_BASE_CPU_UNSPECIFIED) { + adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = + (unsigned)(adapter->irq_cpu_base + + i * adapter->irq_cpu_stride) % (unsigned)mp_ncpus; + CPU_SETOF(adapter->que[i].cpu, &adapter->que[i].cpu_mask); + } + #ifdef RSS adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = rss_getcpu(cur_bind); @@ -1790,20 +1875,19 @@ ena_request_io_irq(struct ena_adapter *adapter) } irq->requested = true; -#ifdef RSS - rc = bus_bind_intr(adapter->pdev, irq->res, irq->cpu); - if (unlikely(rc != 0)) { - ena_log(pdev, ERR, - "failed to bind interrupt handler for irq %ju to cpu %d: %d\n", - rman_get_start(irq->res), irq->cpu, rc); - goto err; - } + if (adapter->rss_enabled || adapter->irq_cpu_base > ENA_BASE_CPU_UNSPECIFIED) { + rc = bus_bind_intr(adapter->pdev, irq->res, irq->cpu); + if (unlikely(rc != 0)) { + ena_log(pdev, ERR, + "failed to bind interrupt handler for irq %ju to cpu %d: %d\n", + rman_get_start(irq->res), irq->cpu, rc); + goto err; + } - ena_log(pdev, INFO, "queue %d - cpu %d\n", - i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#endif + ena_log(pdev, INFO, "queue %d - cpu %d\n", + i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); + } } - return (rc); err: @@ -1814,13 +1898,14 @@ err: /* Once we entered err: section and irq->requested is true we free both intr and resources */ - if (irq->requested) + if (irq->requested) { rcc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (unlikely(rcc != 0)) - ena_log(pdev, ERR, - "could not release irq: %d, error: %d\n", - irq->vector, rcc); + if (unlikely(rcc != 0)) + ena_log(pdev, ERR, + "could not release irq: %d, error: %d\n", + irq->vector, rcc); + } /* If we entered err: section without irq->requested set we know it was bus_alloc_resource_any() that needs cleanup, provided @@ -3523,6 +3608,13 @@ ena_attach(device_t pdev) adapter->missing_tx_max_queues = ENA_DEFAULT_TX_MONITORED_QUEUES; adapter->missing_tx_threshold = ENA_DEFAULT_TX_CMP_THRESHOLD; + adapter->irq_cpu_base = ENA_BASE_CPU_UNSPECIFIED; + adapter->irq_cpu_stride = 0; + +#ifdef RSS + adapter->rss_enabled = 1; +#endif + if (version_printed++ == 0) ena_log(pdev, INFO, "%s\n", ena_version); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b6e791d6ff6a..3687e9b2522e 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -69,6 +69,7 @@ #define ENA_DEFAULT_RING_SIZE 1024 #define ENA_MIN_RING_SIZE 256 +#define ENA_BASE_CPU_UNSPECIFIED -1 /* * Refill Rx queue when number of required descriptors is above * QUEUE_SIZE / ENA_RX_REFILL_THRESH_DIVIDER or ENA_RX_REFILL_THRESH_PACKET @@ -201,9 +202,7 @@ struct ena_irq { void *cookie; unsigned int vector; bool requested; -#ifdef RSS int cpu; -#endif char name[ENA_IRQNAME_SIZE]; }; @@ -216,10 +215,8 @@ struct ena_que { struct taskqueue *cleanup_tq; uint32_t id; -#ifdef RSS int cpu; cpuset_t cpu_mask; -#endif int domain; struct sysctl_oid *oid; }; @@ -448,6 +445,12 @@ struct ena_adapter { ena_state_t flags; + /* IRQ CPU affinity */ + int irq_cpu_base; + uint32_t irq_cpu_stride; + + uint8_t rss_enabled; + /* Queue will represent one TX and one RX ring */ struct ena_que que[ENA_MAX_NUM_IO_QUEUES] __aligned(CACHE_LINE_SIZE); @@ -524,7 +527,8 @@ int ena_update_buf_ring_size(struct ena_adapter *adapter, int ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, uint32_t new_rx_size); int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num); - +int ena_update_base_cpu(struct ena_adapter *adapter, int new_num); +int ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num); static inline int ena_mbuf_count(struct mbuf *mbuf) { diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index d450fcf48d15..6668f9924787 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -38,6 +38,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); +static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ #ifndef RSS static void ena_sysctl_add_rss(struct ena_adapter *); @@ -45,6 +46,8 @@ static void ena_sysctl_add_rss(struct ena_adapter *); static int ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_io_queues_nb(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS); static int ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS); #ifndef RSS static int ena_sysctl_rss_key(SYSCTL_HANDLER_ARGS); @@ -102,6 +105,7 @@ ena_sysctl_add_nodes(struct ena_adapter *adapter) ena_sysctl_add_stats(adapter); ena_sysctl_add_eni_metrics(adapter); ena_sysctl_add_tuneables(adapter); + ena_sysctl_add_irq_affinity(adapter); #ifndef RSS ena_sysctl_add_rss(adapter); #endif @@ -448,6 +452,36 @@ ena_sysctl_add_rss(struct ena_adapter *adapter) } #endif /* RSS */ +static void +ena_sysctl_add_irq_affinity(struct ena_adapter *adapter) +{ + device_t dev; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + dev = adapter->pdev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "irq_affinity", + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Decide base CPU and stride for irqs affinity."); + child = SYSCTL_CHILDREN(tree); + + /* Add base cpu leaf */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "base_cpu", + CTLTYPE_S32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_irq_base_cpu, "I", "Base cpu index for setting irq affinity."); + + /* Add cpu stride leaf */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "cpu_stride", + CTLTYPE_S32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_irq_cpu_stride, "I", "Distance between irqs when setting affinity."); +} + /* * ena_sysctl_update_queue_node_nb - Register/unregister sysctl queue nodes. @@ -707,6 +741,117 @@ unlock: return (0); } +static int +ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int irq_base_cpu = 0; + int error; + + ENA_LOCK_LOCK(); + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { + error = ENODEV; + goto unlock; + } + + error = sysctl_wire_old_buffer(req, sizeof(irq_base_cpu)); + if (error == 0) { + irq_base_cpu = adapter->irq_cpu_base; + error = sysctl_handle_int(oidp, &irq_base_cpu, 0, req); + } + if (error != 0 || req->newptr == NULL) + goto unlock; + + if (irq_base_cpu <= ENA_BASE_CPU_UNSPECIFIED) { + ena_log(adapter->pdev, ERR, + "Requested base CPU is less than zero.\n"); + error = EINVAL; + goto unlock; + } + + if (irq_base_cpu > mp_ncpus) { + ena_log(adapter->pdev, INFO, + "Requested base CPU is larger than the number of available CPUs. \n"); + error = EINVAL; + goto unlock; + + } + + if (irq_base_cpu == adapter->irq_cpu_base) { + ena_log(adapter->pdev, INFO, + "Requested IRQ base CPU is equal to current value " + "(%d)\n", + adapter->irq_cpu_base); + goto unlock; + } + + ena_log(adapter->pdev, INFO, + "Requested new IRQ base CPU: %d, current value: %d\n", + irq_base_cpu, adapter->irq_cpu_base); + + error = ena_update_base_cpu(adapter, irq_base_cpu); + +unlock: + ENA_LOCK_UNLOCK(); + + return (error); +} + +static int +ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int32_t irq_cpu_stride = 0; + int error; + + ENA_LOCK_LOCK(); + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { + error = ENODEV; + goto unlock; + } + + error = sysctl_wire_old_buffer(req, sizeof(irq_cpu_stride)); + if (error == 0) { + irq_cpu_stride = adapter->irq_cpu_stride; + error = sysctl_handle_int(oidp, &irq_cpu_stride, 0, req); + } + if (error != 0 || req->newptr == NULL) + goto unlock; + + if (irq_cpu_stride < 0) { + ena_log(adapter->pdev, ERR, + "Requested IRQ stride is less than zero.\n"); + error = EINVAL; + goto unlock; + } + + if (irq_cpu_stride > mp_ncpus) { + ena_log(adapter->pdev, INFO, + "Warning: Requested IRQ stride is larger than the number of available CPUs.\n"); + } + + if (irq_cpu_stride == adapter->irq_cpu_stride) { + ena_log(adapter->pdev, INFO, + "Requested IRQ CPU stride is equal to current value " + "(%u)\n", + adapter->irq_cpu_stride); + goto unlock; + } + + ena_log(adapter->pdev, INFO, + "Requested new IRQ CPU stride: %u, current value: %u\n", + irq_cpu_stride, adapter->irq_cpu_stride); + + error = ena_update_cpu_stride(adapter, irq_cpu_stride); + if (error != 0) + goto unlock; + +unlock: + ENA_LOCK_UNLOCK(); + + return (error); +} + #ifndef RSS /* * Change the Receive Side Scaling hash key. From nobody Sun Jan 14 21:53:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv50jH7z57DjB; Sun, 14 Jan 2024 21:53: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 4TCpv45J1Bz4F06; Sun, 14 Jan 2024 21:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyo6QBQt6gI7qZWxrqXqHHT8OgIDEQYvRWS1LANbZA8=; b=QB/HZUZZnfpgt/th0/yvDF3ycemBq+6TpzPqUs3TU3HEFLUX2xpUCsAW5UjEwXGtTbhkVr qZuGSwNNa+lgMOnHLfkkmtE107XeNigGL9pWV7GlLShlnbqMIUCs6PFpxbURQGv8oRr+WQ ElEb4Y6cMLsrqTH3BJU9QDYdoWInQAALGrPTs1AavNdeWt+jr8RK/H6Q08c2LWEkQF0S0y souozTMFD+gNI0HMp90bwbKT1npmAhBcvKwYkyJBmKRjPDXIE7+qpBTuCWBLmU7+kljyrT h3ZEn1CyeGy1n3Fue0s5Iy/0PlLvLORGgLD8zFVZlfHIvcFaoBdWIwqxGIimug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyo6QBQt6gI7qZWxrqXqHHT8OgIDEQYvRWS1LANbZA8=; b=ORpQCOTJBAD7mT4gbjFcMVBkuK4UZmhLIqsGzQmKAxHv11TOmk4i0MW/bVZ9pGX3SAZfqn 9TRGcVLaiKxwFGkT9qidkphlGOEmubm1eQt3LWpOsF7bu8K/B0sifRCHilpLm+fjSdxURK qE0E0LXBViG12dzBOe9/oh+mNd4lhNFsThgsvLP20Q766jX8/dxc0lGPWyvry88nR4Byzh f/VXwUpKZqSDdZzUdrkiH5ZJKZC7jXV84c2ddxIJ7BoSjEQdoFZFz6v6RZvrf5kliaI8Vx KUSWuX3iAP4I76/xdLTVcwMhU9fC+kig+L+bTL1uOq9oFGRTTCt4P7g1SaE9Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269232; a=rsa-sha256; cv=none; b=HfcVJEpL4YM+OIqjdlIMd8HthRI5ZobNczOgxw5oLLURYIKTQhCBPsD8J/ITjBk2GDSypd FvZ5Dve0m1WP6tQKnP9XaqdIeXRiSHtJclxu5eAz3LNwkVV3DEcYzsHjveOm/ibN2EFldz iCH0lPic0h8utj9EOXVv5N5Ec/dHoOuARZyvCR0NtJSITDvWZhGdLTirPgK1omPNgHGaQt P39rkTQXJZ4BmqHQLacl2Vn4jV+NSNBs03G6wHTCcV5jzJnRc+uKOU/o/PFLlCzedLCRCe vefd+IhsSUGwe6FGl2Vx08XPBvfRJSCeJf3C9+aCPmX1DqeQjdPDTMCPWdBCkA== 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 4TCpv44L22zWvh; Sun, 14 Jan 2024 21:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrqBU041487; Sun, 14 Jan 2024 21:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrqsU041484; Sun, 14 Jan 2024 21:53:52 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:52 GMT Message-Id: <202401142153.40ELrqsU041484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 4526ef3d05dd - stable/14 - ena: Change measurement unit of time since last tx cleanup to ms List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4526ef3d05dd469f5f61d22783a861d9db5c56fd Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=4526ef3d05dd469f5f61d22783a861d9db5c56fd commit 4526ef3d05dd469f5f61d22783a861d9db5c56fd Author: Arthur Kiyanovski AuthorDate: 2023-06-14 10:12:16 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:10 +0000 ena: Change measurement unit of time since last tx cleanup to ms This commit: 1. Sets the time since last cleanup to milliseconds. 2. Fixes incorrect indentations. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 9272e45c04c0d4fcb5d767e962783f3ab192f64e) --- sys/dev/ena/ena.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 067c8a6f3a08..ba1712093a7a 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3102,13 +3102,13 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, if (unlikely(time_offset > adapter->missing_tx_timeout)) { if (tx_buf->print_once) { - time_since_last_cleanup = TICKS_2_USEC(ticks - + time_since_last_cleanup = TICKS_2_MSEC(ticks - tx_ring->tx_last_cleanup_ticks); missing_tx_comp_to = sbttoms( adapter->missing_tx_timeout); ena_log(pdev, WARN, "Found a Tx that wasn't completed on time, qid %d, index %d. " - "%d usecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", + "%d msecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", tx_ring->qid, i, time_since_last_cleanup, missing_tx_comp_to); } From nobody Sun Jan 14 21:53:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv60DFLz57Dt4; Sun, 14 Jan 2024 21:53: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 4TCpv563TPz4F4v; Sun, 14 Jan 2024 21:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YaeOgKoi1JIDCpbcHruqLZWPIbbC/EecgOk4zu2tDpQ=; b=dXc/7u1qAw2bSv+PtNDdW0/eZ307qMkAKjAzM57SHyDykymVGSCVPt2mAsaN+4g7qcxTN+ a60vOAAaXeTa75PGrCI+MUmWq+Kr0TFm3YInSxlIIYX94uMDi352m7JyA6SrOD6ZYsx+rM J9sN8sxk09gX5e0J6lyBCjujPTQ2sCrmizWeWD7SPa7clCrvxWxJfKAH4mHUhRpBgER9KP iKdJ8/20zbLW1FCAbjw5TrMn2ok+Qp/bFvcevGnGGvQnLEiEJOTFic3vjX7jHvzHTM9sp2 /PYjHX8Si4HUu/rRHdXMNkdtMOK1XWnolxQ7O4spiQeSL6aqu6OCIz3s3mfy7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YaeOgKoi1JIDCpbcHruqLZWPIbbC/EecgOk4zu2tDpQ=; b=U2qZ7v6OoPMUjsSwWGLcuv0MPbyVkFqxeEN5NPpXVI8aTut9xwAdMyi0eHgh8i56zeXwEV 6FZcch/FRJ+EhhMB69FikU/kRmyEGp2b6ixoot0xjUS1om+PO8ZvqfMjrIP6/yE6yJk33x UH3lyMT/nyVpA0JD52Uu2xExfAdggB70Z3ucvJPjMSFb35IoLQCzE0VKv3nAf2Odf8o+Na xW691bWsqyak8knHIiuKBFmRpEtgOHjY4osEif96AT6Is7LAIKsOE38rCrY1IcbAHNN/Fq B5B2CaHmtdXs2+O7IV7apzI7YybFEjk2cikyzZYenNrQDOc2w8L60LXwGv4O2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269233; a=rsa-sha256; cv=none; b=YIL31hddhp5m3kWQGutDbPyW+Ynb8MEeUbs/HigS6Ql7TfOO9VFDV6f5VTJ677oYroMuP3 oxHusmZALB8oZUrtrQ+d3IzlNZBMRD/v2ZIoA01m4rVFueN3lVBF9dx8cWPkIXHXrz4Sz7 EHtblZNhTSAgmrdpx5ryCjMd2SB5/RZlvDO/XT8izowW0tMm6HhyaEHGeN8lrcZov0fL+y XGY0rqV2KBMJXY9Db9obNczzR7MA5xGatMnxFTD0fOgEb2/JcWdbpSU52BHjDyIj0OhD3S SKK2zb1HrNcBiREn0btXufG1KIQ0trOO3yKrqN4k8MJn8nPgI8Cd3ubf1i0p7A== 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 4TCpv558w4zWDM; Sun, 14 Jan 2024 21:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrrJ0041532; Sun, 14 Jan 2024 21:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrrAo041529; Sun, 14 Jan 2024 21:53:53 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:53 GMT Message-Id: <202401142153.40ELrrAo041529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 00916b6d298e - stable/14 - ena: Update ena_com_update_intr_reg API usage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00916b6d298e61140c6730b9f21e0d0fb0886f04 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=00916b6d298e61140c6730b9f21e0d0fb0886f04 commit 00916b6d298e61140c6730b9f21e0d0fb0886f04 Author: Osama Abboud AuthorDate: 2023-09-11 08:38:39 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:10 +0000 ena: Update ena_com_update_intr_reg API usage This commit fixes the usage of this function to be compatible with the new API introduced by ena-com update to v2.7.0 Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 72e34ebdd08854dc896f267b0461e241c4040241) --- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena_datapath.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index ba1712093a7a..aca2e0b43041 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2026,7 +2026,7 @@ ena_unmask_all_io_irqs(struct ena_adapter *adapter) for (i = 0; i < adapter->num_io_queues; i++) { ena_qid = ENA_IO_TXQ_IDX(i); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - ena_com_update_intr_reg(&intr_reg, 0, 0, true); + ena_com_update_intr_reg(&intr_reg, 0, 0, true, false); tx_ring = &adapter->tx_ring[i]; counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 3e0a8aa2bd74..e5c424139d3c 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -104,7 +104,7 @@ ena_cleanup(void *arg, int pending) /* Signal that work is done and unmask interrupt */ ena_com_update_intr_reg(&intr_reg, ENA_RX_IRQ_INTERVAL, - ENA_TX_IRQ_INTERVAL, true); + ENA_TX_IRQ_INTERVAL, true, false); counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); } From nobody Sun Jan 14 21:53:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv716j1z57Dnc; Sun, 14 Jan 2024 21:53: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 4TCpv66nhkz4F0Z; Sun, 14 Jan 2024 21:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1T+eZ7twPGmFhdN6EZTbgGofGv8XK5ZKlvUXtH64F0=; b=JMWYswqzoydTkrvql9UMD2G9CFXIYv5xVliMYivOQO90TEiQyxyBVD3/9X2Uy9tu3Arh0E etv1omL11aA6vpjl/155OHgBI7QfJxysZlE8LG7pqALc6q65VDU7JBEnpqSixFdTSLsaHp fVyjzEvmP6obCm8FZPZwpGfFen8R9B39stduPn0HV/oROVx8Gmsan7kEObkKgJvZegEOl8 UsEAqq2P5IN3S6pu/V37GICX2C9McCCZN4DMqdgy0oMwpuX6j+FROTHx24IqrX2p72DfP9 rRmNwULtObYKrASXN/Ir+3ktzUkHZ1qFzi9I2kC8xOcU2GGq8IwcIJdo6wwiwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1T+eZ7twPGmFhdN6EZTbgGofGv8XK5ZKlvUXtH64F0=; b=Va7Dy6DkxYJhh4mxC+dCLcF30R0+nSdxnPsI3Um3Df6ksBmYPtYYjzONDdkKlN5nfFaW97 0tWqgcYUz47nvDTzuiwn5cO3oVRCJzQr/dboJbrKoyXvmv5u1oYJXGb3+9Rch3X8Pnj+r/ X9GRwEH+VguCQnetQnKXsrwTWyvFWnG4rqWORNoBEy4JPSFuMDp6eanEcZU18/mLij/DK6 mF5BOiC5ao+p2I9RqS2Tk/piXtDmSQxGMws3Mz+so4FZIBC1sX6yQ/vuBAowEa6ic+tEzN fC4ArW6HVhGLvh7RSxiNsprkiYI8x/AEbK41nkS4R/jdqzV8LLQBmwen1agWbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269235; a=rsa-sha256; cv=none; b=UCFbUYnPJHznTDtz9hKo2GO1Ov51QFa1HFvFszDevX5PCfZkne2O5HZ8Y9ng/xK/3xsdUb ZeXlHI0ZX5rFl/D2ugda0/Srn9+/+6yyKii6XSIG8MHqdEN1ZO7eDrpYurwZR7+C7MoP8l rbOqqNbAlUAsKU2Yj2q7Qp/OYl4qxnX0U/cV8se/54tlBYtWmrYVAGRtRhG4oSjdVXS62v 9IXjIirJdycGxlJf/t/h34593oGzoKBA6AmP0XSwrn4rkJaIIOnfQEt1+kGClAmaBulbOF Se3FfSZan4rJzlOApN/5rT4QddXhZZdBLE4bzNpS7SQojOgozAR/FexIulhY1Q== 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 4TCpv65kG1zVyq; Sun, 14 Jan 2024 21:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrs5d041580; Sun, 14 Jan 2024 21:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrsLN041577; Sun, 14 Jan 2024 21:53:54 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:54 GMT Message-Id: <202401142153.40ELrsLN041577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 9d773b0d5f56 - stable/14 - ena: Remove CQ tail pointer update API List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d773b0d5f56268ce7fc2fc60d8d551963de8f36 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=9d773b0d5f56268ce7fc2fc60d8d551963de8f36 commit 9d773b0d5f56268ce7fc2fc60d8d551963de8f36 Author: Osama Abboud AuthorDate: 2023-09-11 08:43:08 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:10 +0000 ena: Remove CQ tail pointer update API This commit removes the usage of this API from the freebsd driver since the relevant functionality is not supported by the device. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 2835752e075f2fa3edcb596df8306c570ec4cae6) --- sys/dev/ena/ena_datapath.c | 3 --- sys/dev/ena/ena_netmap.c | 1 - 2 files changed, 4 deletions(-) diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index e5c424139d3c..177f33ea8ef3 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -298,7 +298,6 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ena_com_comp_ack( &adapter->ena_dev->io_sq_queues[ena_qid], total_done); - ena_com_update_dev_comp_head(io_cq); total_done = 0; } } while (likely(--budget)); @@ -313,7 +312,6 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_ring->next_to_clean = next_to_clean; ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); - ena_com_update_dev_comp_head(io_cq); } /* @@ -690,7 +688,6 @@ ena_rx_cleanup(struct ena_ring *rx_ring) ENA_RX_REFILL_THRESH_PACKET); if (refill_required > refill_threshold) { - ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); ena_refill_rx_bufs(rx_ring, refill_required); } diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 9ef0619829f4..a8d7cad05ab5 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -814,7 +814,6 @@ ena_netmap_tx_cleanup(struct ena_netmap_ctx *ctx) /* acknowledge completion of sent packets */ ctx->ring->next_to_clean = ctx->nt; ena_com_comp_ack(ctx->ring->ena_com_io_sq, total_tx_descs); - ena_com_update_dev_comp_head(ctx->ring->ena_com_io_cq); } } From nobody Sun Jan 14 21:53:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv82flVz57DfX; Sun, 14 Jan 2024 21:53: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 4TCpv80hf3z4FDQ; Sun, 14 Jan 2024 21:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4brFaU/krOQvGQkKbFoQWOP7NjwOOzTrJUfm3igKNh8=; b=VDHm0srux9wY7eU5d50/YHWzeXiMQyNxASeG7chd0svynyMaUTVNP32MdMKPyKduCIcwOq I9ygiajmen2QFNdDdz4h72wAO/dsNKIOqzHauONLFJKmT5td4RL7yl4PcCCLAAcpB5kMcP GARKVg35k47Bn4ViH0od24fJkNEBpGnjNCWU0W+gKMWqOR4kXdshT/MpyoHYUqxDOBAPrv dIp/GE3cvkcO0OAxmauuB8BpRMkRE4pltGkdaEsDWv4RtUVMGTw2F9QK7I5rDNIfs7jQtD zw0mMysmivWeAU8v9TL208/SpdCS4Pz85dzqB9yFjauUpH2FVJCXMe++ImXqAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4brFaU/krOQvGQkKbFoQWOP7NjwOOzTrJUfm3igKNh8=; b=uiswNvy9hI/nj7eztr6sUdz5ZJ4TQLm5D1ITEsPclwbOytISOA5Xt65Cm7vxQTOW06EdZ2 wlQpOk0EXZyj2/3iZEq6/mX0zfWVKaaDWdvfVGdFokJKajQiU2rsRTmBELhiS1oNe507wp Y0fCB9+jj2LiQNLXkmw3zld0q8jOY7Q8fj4HzR2hgwZr26w6OFe/PFxBkI1P1eop8SiKEb ivSoDgnZbuq5mlsc2pex2uv18Cb2YMZdebiPgH/qd9F89Kfui9zpovdsqpVIJ6AhZ+kmiv soxalwZ+tNG8Ihrukr/5rRb/FemblaAnhpKJH9BCprYnkJDMmEpoWAPhDKD+tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269236; a=rsa-sha256; cv=none; b=U4uOFbaszRHsuWodN3inKft65VipX456hHPJkJCa8QbzpPaiAMXlTU2SQWgC4pcgHDLyu7 KG0nBFxiGNiGlNDv+nC7z5yc/gvhZy5mm1irmNMK3Sc02QzzcZFi6OEneFz7BIqBthF9Ri qZxYXq3zRQ+nk5R5DWPQI5nTsttj2GID8UKoBM269fkascQ0DVrj/6RlZ/F/KYRoo18b5v a3rh9J0FaHn2TWwliXCBQMu1LDzxobTVy5St5K4VIVMD2O8iJWY90m7zl47hiiO5NnuAgG YtNfawW3bUI8SdBaYa6b2WGKaB5eQnDgeC5/77ghQSUVfec2zhI5QoXgHErWSw== 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 4TCpv76vRRzWvl; Sun, 14 Jan 2024 21:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrtm0041634; Sun, 14 Jan 2024 21:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrtAh041631; Sun, 14 Jan 2024 21:53:55 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:55 GMT Message-Id: <202401142153.40ELrtAh041631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 79c446badb02 - stable/14 - ena: Introduce shared sample interval for all stats List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79c446badb02c3458f061925d6ccbe073af3dcd9 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=79c446badb02c3458f061925d6ccbe073af3dcd9 commit 79c446badb02c3458f061925d6ccbe073af3dcd9 Author: Osama Abboud AuthorDate: 2023-09-12 10:13:48 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:11 +0000 ena: Introduce shared sample interval for all stats Rename sample_interval node to stats_sample_interval and move it up in the sysctl tree to make it clear that it's relevant for all the stats and not only ENI metrics (Currently, sample interval node is found under eni_metrics node). Path to node: dev.ena..stats_sample_interval Once this parameter is set it will set the sample interval for all the stats node including SRD/customer metrics. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 5b925280d9a54eaefd85827bf6e84049aea8fa98) --- sys/dev/ena/ena.c | 12 ++++++------ sys/dev/ena/ena.h | 4 ++-- sys/dev/ena/ena_sysctl.c | 42 +++++++++++++++++++++--------------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index aca2e0b43041..f6357a43ea34 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3321,19 +3321,19 @@ ena_timer_service(void *data) check_for_empty_rx_ring(adapter); /* - * User controller update of the ENI metrics. + * User controller update of the ENA metrics. * If the delay was set to 0, then the stats shouldn't be updated at * all. - * Otherwise, wait 'eni_metrics_sample_interval' seconds, before + * Otherwise, wait 'metrics_sample_interval' seconds, before * updating stats. * As timer service is executed every second, it's enough to increment * appropriate counter each time the timer service is executed. */ - if ((adapter->eni_metrics_sample_interval != 0) && - (++adapter->eni_metrics_sample_interval_cnt >= - adapter->eni_metrics_sample_interval)) { + if ((adapter->metrics_sample_interval != 0) && + (++adapter->metrics_sample_interval_cnt >= + adapter->metrics_sample_interval)) { taskqueue_enqueue(adapter->metrics_tq, &adapter->metrics_task); - adapter->eni_metrics_sample_interval_cnt = 0; + adapter->metrics_sample_interval_cnt = 0; } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 3687e9b2522e..fd0c6e3692c7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -480,8 +480,8 @@ struct ena_adapter { uint32_t missing_tx_threshold; bool disable_meta_caching; - uint16_t eni_metrics_sample_interval; - uint16_t eni_metrics_sample_interval_cnt; + uint16_t metrics_sample_interval; + uint16_t metrics_sample_interval_cnt; /* Statistics */ struct ena_stats_dev dev_stats; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 6668f9924787..bcf684e9e0ca 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -48,14 +48,14 @@ static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_io_queues_nb(SYSCTL_HANDLER_ARGS); static int ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS); static int ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS); -static int ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_metrics_interval(SYSCTL_HANDLER_ARGS); #ifndef RSS static int ena_sysctl_rss_key(SYSCTL_HANDLER_ARGS); static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #endif -/* Limit max ENI sample rate to be an hour. */ -#define ENI_METRICS_MAX_SAMPLE_INTERVAL 3600 +/* Limit max ENA sample rate to be an hour. */ +#define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, @@ -368,16 +368,6 @@ ena_sysctl_add_eni_metrics(struct ena_adapter *adapter) SYSCTL_ADD_U64(ctx, eni_list, OID_AUTO, "linklocal_allowance_exceeded", CTLFLAG_RD, &eni_metrics->linklocal_allowance_exceeded, 0, "Linklocal packet rate allowance exceeded"); - - /* - * Tuneable, which determines how often ENI metrics will be read. - * 0 means it's turned off. Maximum allowed value is limited by: - * ENI_METRICS_MAX_SAMPLE_INTERVAL. - */ - SYSCTL_ADD_PROC(ctx, eni_list, OID_AUTO, "sample_interval", - CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, - ena_sysctl_eni_metrics_interval, "SU", - "Interval in seconds for updating ENI emetrics. 0 turns off the update."); } static void @@ -411,6 +401,16 @@ ena_sysctl_add_tuneables(struct ena_adapter *adapter) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "io_queues_nb", CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, ena_sysctl_io_queues_nb, "I", "Number of IO queues."); + + /* + * Tuneable, which determines how often ENA metrics will be read. + * 0 means it's turned off. Maximum allowed value is limited by: + * ENA_METRICS_MAX_SAMPLE_INTERVAL. + */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "stats_sample_interval", + CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_metrics_interval, "SU", + "Interval in seconds for updating Netword interface metrics. 0 turns off the update."); } /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -694,7 +694,7 @@ unlock: } static int -ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS) +ena_sysctl_metrics_interval(SYSCTL_HANDLER_ARGS) { struct ena_adapter *adapter = arg1; uint16_t interval; @@ -708,32 +708,32 @@ ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, sizeof(interval)); if (error == 0) { - interval = adapter->eni_metrics_sample_interval; + interval = adapter->metrics_sample_interval; error = sysctl_handle_16(oidp, &interval, 0, req); } if (error != 0 || req->newptr == NULL) goto unlock; - if (interval > ENI_METRICS_MAX_SAMPLE_INTERVAL) { + if (interval > ENA_METRICS_MAX_SAMPLE_INTERVAL) { ena_log(adapter->pdev, ERR, - "ENI metrics update interval is out of range - maximum allowed value: %d seconds\n", - ENI_METRICS_MAX_SAMPLE_INTERVAL); + "ENA metrics update interval is out of range - maximum allowed value: %d seconds\n", + ENA_METRICS_MAX_SAMPLE_INTERVAL); error = EINVAL; goto unlock; } if (interval == 0) { ena_log(adapter->pdev, INFO, - "ENI metrics update is now turned off\n"); + "ENA metrics update is now turned off\n"); bzero(&adapter->eni_metrics, sizeof(adapter->eni_metrics)); } else { ena_log(adapter->pdev, INFO, - "ENI metrics update interval is set to: %" PRIu16 + "ENA metrics update interval is set to: %" PRIu16 " seconds\n", interval); } - adapter->eni_metrics_sample_interval = interval; + adapter->metrics_sample_interval = interval; unlock: ENA_LOCK_UNLOCK(); From nobody Sun Jan 14 21:53:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpv93kKYz57DwG; Sun, 14 Jan 2024 21:53: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 4TCpv91l5Vz4FDk; Sun, 14 Jan 2024 21:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r57zkA2bAZxF4IrVS4oAXseCq+hEKPO2h/fhdduEp9M=; b=BfWqSxseVSbnYP1fi/YgxU5kNTYhqEuH0F1Jup3FiuxR4hgzwNicJGP04hlFYpGDDkhvC5 hsKDPstqYmYOah2TlGP4P2jMU3Dz9E5DS40tWEGfLmSY58Yf3Uj4HXozXUMv/BWxKN3RbT MccS42Ja5qkBzto45aWgRfdkde0f0WpNVy4Pmn075qsVFcLsox0tOrUb2TNik3MJAFEqF2 AvXej1hnZixl6zvaqqgg4tRuKspRYWkgJS3ycYlBK5SPzc3QQ5vFi1nSNbVyA+fKYDEi1X ZzN5z98VDTzunzmhHMPnKHSvNP1nb2j4h44vyQMHkOu3TJ8v7SoEYVOaiYuESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r57zkA2bAZxF4IrVS4oAXseCq+hEKPO2h/fhdduEp9M=; b=XXjL76Qci7s8Iu+DDGCIy0Ms3MVmgeFYa+3UzNUCHhp/B4MwlmgOiyfyISn52HwTQjVPgB 2S31J3+bMLL5J7MCf7MI8g27+V1bqDWtZFoGGnRf7FdPZK7aNVFvV31kAw5XBnuK3RRaOu TX6ybLscnAf9fj5O0/MLPNcBXr+mqd/+uFQBCkiW12OAdmuKACyKyiRwc4rUjBTsGvH8mV 572PGk32eP5NFRj8MkCnMYopvRe6pu3TxUrUdwQHC/TFYzly3NepOvt1t4mX3qV3QMfqjK 8NFcApmq8CGowTI9ZN1POfh0Rn+dAVNEyOHps2sTPfy4A1Z/wMeGIXGKszz0mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269237; a=rsa-sha256; cv=none; b=MOc6ZxjGiudFUILLPztX/QKBv/guDaNWQZR0CCfzkltR4ca+Olk6WocgclTiK3g9PGo6Fl O3HukX2krmvXTaU+EgAYl2Ryj1dtlvftiMJAACXjfERVhojmmMARHGZiSJHoE7sueQnIiT d2Y0vn4shWSJUUGEYGrMMAioEcU77URYM/OwMhrHfDXwogFVZoakxGBp06ZfZByG8i4Jwt ZhVmJpOGIXePwzsnqg3oH6Bs80Xn0OM1AgVTyrCoRmtGLzCxywnVsgG7HY6RkJZNvkms9e dpq0IEmzaeZUhtu7dXjv209DlzncenKFx8h3DaaA7KVAEZJ1YgCj2pF5txqvzw== 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 4TCpv90rXGzWPS; Sun, 14 Jan 2024 21:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrvbo041679; Sun, 14 Jan 2024 21:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrvvL041676; Sun, 14 Jan 2024 21:53:57 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:57 GMT Message-Id: <202401142153.40ELrvvL041676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 538f9ea8fa58 - stable/14 - ena: Support customer metric with sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 538f9ea8fa58654c6d56000e6893cd8255506c9f Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=538f9ea8fa58654c6d56000e6893cd8255506c9f commit 538f9ea8fa58654c6d56000e6893cd8255506c9f Author: Osama Abboud AuthorDate: 2023-09-12 10:17:03 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:11 +0000 ena: Support customer metric with sysctl This commit adds sysctl support for customer metrics. Different customer metrics can be found in the following sysctl node: sysctl dev.ena..customer_metrics Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f97993ad7b9c9e4787bd198d11f348c271af513e) --- sys/dev/ena/ena.c | 49 +++++++++++++++++++++++++-- sys/dev/ena/ena.h | 1 + sys/dev/ena/ena_sysctl.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/ena/ena_sysctl.h | 1 + 4 files changed, 135 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index f6357a43ea34..64c3d79f00db 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -166,6 +166,7 @@ static int ena_enable_msix_and_set_admin_interrupts(struct ena_adapter *); static void ena_update_on_link_change(void *, struct ena_admin_aenq_entry *); static void unimplemented_aenq_handler(void *, struct ena_admin_aenq_entry *); static int ena_copy_eni_metrics(struct ena_adapter *); +static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME @@ -3305,6 +3306,25 @@ ena_copy_eni_metrics(struct ena_adapter *adapter) return (rc); } +static int +ena_copy_customer_metrics(struct ena_adapter *adapter) +{ + struct ena_com_dev *dev; + u32 supported_metrics_count; + int rc, len; + + dev = adapter->ena_dev; + + supported_metrics_count = ena_com_get_customer_metric_count(dev); + len = supported_metrics_count * sizeof(u64); + + /* Fill the data buffer */ + rc = ena_com_get_customer_metrics(adapter->ena_dev, + (char *)(adapter->customer_metrics_array), len); + + return (rc); +} + static void ena_timer_service(void *data) { @@ -3542,7 +3562,12 @@ ena_metrics_task(void *arg, int pending) struct ena_adapter *adapter = (struct ena_adapter *)arg; ENA_LOCK_LOCK(); - (void)ena_copy_eni_metrics(adapter); + + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_CUSTOMER_METRICS)) + (void)ena_copy_customer_metrics(adapter); + else if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENI_STATS)) + (void)ena_copy_eni_metrics(adapter); + ENA_LOCK_UNLOCK(); } @@ -3756,6 +3781,18 @@ ena_attach(device_t pdev) /* initialize rings basic information */ ena_init_io_rings(adapter); + rc = ena_com_allocate_customer_metrics_buffer(ena_dev); + if (rc) { + ena_log(pdev, ERR, "Failed to allocate customer metrics buffer.\n"); + goto err_msix_free; + } + + rc = ena_sysctl_allocate_customer_metrics_buffer(adapter); + if (unlikely(rc)){ + ena_log(pdev, ERR, "Failed to allocate sysctl customer metrics buffer.\n"); + goto err_metrics_buffer_destroy; + } + /* Initialize statistics */ ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); @@ -3767,7 +3804,7 @@ ena_attach(device_t pdev) rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); if (unlikely(rc != 0)) { ena_log(pdev, ERR, "Error with network interface setup\n"); - goto err_msix_free; + goto err_customer_metrics_alloc; } /* Initialize reset task queue */ @@ -3805,6 +3842,10 @@ ena_attach(device_t pdev) err_detach: ether_ifdetach(adapter->ifp); #endif /* DEV_NETMAP */ +err_customer_metrics_alloc: + free(adapter->customer_metrics_array, M_DEVBUF); +err_metrics_buffer_destroy: + ena_com_delete_customer_metrics_buffer(ena_dev); err_msix_free: ena_free_stats(adapter); ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); @@ -3903,6 +3944,10 @@ ena_detach(device_t pdev) ena_com_delete_host_info(ena_dev); + free(adapter->customer_metrics_array, M_DEVBUF); + + ena_com_delete_customer_metrics_buffer(ena_dev); + if_free(adapter->ifp); free(ena_dev->bus, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index fd0c6e3692c7..18988d719a18 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -487,6 +487,7 @@ struct ena_adapter { struct ena_stats_dev dev_stats; struct ena_hw_stats hw_stats; struct ena_admin_eni_stats eni_metrics; + uint64_t *customer_metrics_array; enum ena_regs_reset_reason_types reset_reason; }; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index bcf684e9e0ca..edae5c3c23fa 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -37,6 +37,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); +static void ena_sysctl_add_customer_metrics(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -58,6 +59,39 @@ static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) +#define SYSCTL_GSTRING_LEN 64 + +#define ENA_METRIC_ENI_ENTRY(stat, desc) { \ + .name = #stat, \ + .description = #desc, \ +} + +struct ena_hw_metrics { + char name[SYSCTL_GSTRING_LEN]; + char description[SYSCTL_GSTRING_LEN]; +}; + +static const struct ena_hw_metrics ena_hw_stats_strings[] = { + ENA_METRIC_ENI_ENTRY( + bw_in_allowance_exceeded, Inbound BW allowance exceeded), + ENA_METRIC_ENI_ENTRY( + bw_out_allowance_exceeded, Outbound BW allowance exceeded), + ENA_METRIC_ENI_ENTRY( + pps_allowance_exceeded, PPS allowance exceeded), + ENA_METRIC_ENI_ENTRY( + conntrack_allowance_exceeded, Connection tracking allowance exceeded), + ENA_METRIC_ENI_ENTRY( + linklocal_allowance_exceeded, Linklocal packet rate allowance), + ENA_METRIC_ENI_ENTRY( + conntrack_allowance_available, Number of available conntracks), +}; + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif + +#define ENA_CUSTOMER_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_hw_stats_strings) + static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ENA driver parameters"); @@ -98,12 +132,29 @@ SYSCTL_BOOL(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, int ena_rss_table_size = ENA_RX_RSS_TABLE_SIZE; +int ena_sysctl_allocate_customer_metrics_buffer(struct ena_adapter *adapter) +{ + int rc = 0; + + adapter->customer_metrics_array = malloc((sizeof(u64) * ENA_CUSTOMER_METRICS_ARRAY_SIZE), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (unlikely(adapter->customer_metrics_array == NULL)) + rc = ENOMEM; + + return rc; +} void ena_sysctl_add_nodes(struct ena_adapter *adapter) { + struct ena_com_dev *dev = adapter->ena_dev; + + if (ena_com_get_cap(dev, ENA_ADMIN_CUSTOMER_METRICS)) + ena_sysctl_add_customer_metrics(adapter); + else if (ena_com_get_cap(dev, ENA_ADMIN_ENI_STATS)) + ena_sysctl_add_eni_metrics(adapter); + ena_sysctl_add_wd(adapter); ena_sysctl_add_stats(adapter); - ena_sysctl_add_eni_metrics(adapter); ena_sysctl_add_tuneables(adapter); ena_sysctl_add_irq_affinity(adapter); #ifndef RSS @@ -328,6 +379,40 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &admin_stats->no_completion, 0, "Commands not completed"); } +static void +ena_sysctl_add_customer_metrics(struct ena_adapter *adapter) +{ + device_t dev; + struct ena_com_dev *ena_dev; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + struct sysctl_oid *customer_metric; + struct sysctl_oid_list *customer_list; + + int i; + + dev = adapter->pdev; + ena_dev = adapter->ena_dev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + customer_metric = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "customer_metrics", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA's customer metrics"); + customer_list = SYSCTL_CHILDREN(customer_metric); + + for (i = 0; i < ENA_CUSTOMER_METRICS_ARRAY_SIZE; i++) { + if (ena_com_get_customer_metric_support(ena_dev, i)) { + SYSCTL_ADD_U64(ctx, customer_list, OID_AUTO, ena_hw_stats_strings[i].name, + CTLFLAG_RD, &adapter->customer_metrics_array[i], 0, + ena_hw_stats_strings[i].description); + } + } +} + static void ena_sysctl_add_eni_metrics(struct ena_adapter *adapter) { diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index 188c3a61a3d2..e9b4bfaae1cb 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -40,6 +40,7 @@ void ena_sysctl_add_nodes(struct ena_adapter *adapter); void ena_sysctl_update_queue_node_nb(struct ena_adapter *adapter, int old, int new); +int ena_sysctl_allocate_customer_metrics_buffer(struct ena_adapter *adapter); extern int ena_enable_9k_mbufs; #define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) From nobody Sun Jan 14 21:53:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpvB5YNYz57DcY; Sun, 14 Jan 2024 21:53: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 4TCpvB3L7Rz4FBd; Sun, 14 Jan 2024 21:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LyXlbv82k7XDAwL/v1WhLUVZuh0ueNTrDIj5rhi1qBQ=; b=lRPCXSoEtcVfM3aRcZTSuTKCQFtSx+plVHKfbJANspv2NJuIVlsDgZXTquRcw/7OecvZIz +t7O119pE5/YXYkTZnV6rtLMHZjIH+37wmYviKGkccm+xcUIYqUFwPEpCWROKSHMaqZC5W q/dg8j2oqBQq+0xtDXFvHYWMWT6iy6ZJaa5F/BJz9NgFNMIyIXVEe893rd+mHJ2pPJGzYB rW7WH9IPHAH9vuUn3f/zOc4TQvNM7gyilxFEkU0q3Zh9RhEodLWj2O7ce3CYqgtD7ejSc4 jQxmNX1cI8MKk/nRuG6nd0RpS+Nk7DVPSd2Qklnz9LMoVcwCwMtg3p6yPEaadQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LyXlbv82k7XDAwL/v1WhLUVZuh0ueNTrDIj5rhi1qBQ=; b=SzqeiO347gQo/OEXdY7vSFuno+vlX150Qh/LaDYY96WEQZEdjuDukrOaxddZrJixHMJwFU /+nUE00PWOnq2M5d+TL5PkkBvb5o+48gmRrZxy0PeIQi2hkYh2T9XosOvv2cCB8Y9duha8 cdltWPVnNkpw54kXaVQvoHAOdK4OoH8TfzkZc2UteG4UsGq0Hx8C2ixLF0PF+JZ2XXBmcX GBfZRa1PeAT6Kde+XzUE1/UAK2jgMhaeF5AoAh73Arc2vgrq9LeSlRfy28Xi6hrpRzcUdc FCd67s9LSHK5vt5fJa9dkRD+qaIsFgZtmAoFmmchPwk5muODgX28Du1vrmMrWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269238; a=rsa-sha256; cv=none; b=UZuxCpAQVP9Bi2gWlisYExpjstvTLtP2rfhN66yJwEFbICoPc0qazfgG0CIaUh88HyLLoU PZ87ZpfchRw0cvbHA94ZlqqfIUI13O22V1g7APxyDT6Cb5Zbdhy2BFRywI/LiiTAICS1ds yqKivIvopiX6bKTmCPe37Uq00jWeqVfTPMv32fj5xuBXpCXC6N/AG1WHMD2c0ySuj9ynQc csj1RkOXdUZrDoRz8FQen19+MyMt+J/1ozuDebTxTfXX+DrCHioJWYptqklfo2jwuaWTL/ DtiNwFqribQkiayh+rmSVcxbw1OjQK9zy5qA2Tf06O3Ql71n8NTAv2jCVMFlQQ== 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 4TCpvB1s8LzWMJ; Sun, 14 Jan 2024 21:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrweZ041730; Sun, 14 Jan 2024 21:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrwij041727; Sun, 14 Jan 2024 21:53:58 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:58 GMT Message-Id: <202401142153.40ELrwij041727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 9757b07f1800 - stable/14 - ena: Support srd metrics with sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9757b07f18000ef57b0c95ef5b4af1f4cc492af5 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=9757b07f18000ef57b0c95ef5b4af1f4cc492af5 commit 9757b07f18000ef57b0c95ef5b4af1f4cc492af5 Author: Osama Abboud AuthorDate: 2023-09-12 11:17:45 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:11 +0000 ena: Support srd metrics with sysctl This commit introduces SRD metrics through sysctl. The metrics can be queried using the following sysctl node: sysctl dev.ena..ena_srd_info Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 36d42c862f4a5643f6e2395e8d7b7e5c4580499a) --- sys/dev/ena/ena.c | 10 +++++++ sys/dev/ena/ena.h | 1 + sys/dev/ena/ena_sysctl.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 64c3d79f00db..45bca630b4c2 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -166,6 +166,7 @@ static int ena_enable_msix_and_set_admin_interrupts(struct ena_adapter *); static void ena_update_on_link_change(void *, struct ena_admin_aenq_entry *); static void unimplemented_aenq_handler(void *, struct ena_admin_aenq_entry *); static int ena_copy_eni_metrics(struct ena_adapter *); +static int ena_copy_srd_metrics(struct ena_adapter *); static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); @@ -3306,6 +3307,12 @@ ena_copy_eni_metrics(struct ena_adapter *adapter) return (rc); } +static int +ena_copy_srd_metrics(struct ena_adapter *adapter) +{ + return ena_com_get_ena_srd_info(adapter->ena_dev, &adapter->ena_srd_info); +} + static int ena_copy_customer_metrics(struct ena_adapter *adapter) { @@ -3568,6 +3575,9 @@ ena_metrics_task(void *arg, int pending) else if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENI_STATS)) (void)ena_copy_eni_metrics(adapter); + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENA_SRD_INFO)) + (void)ena_copy_srd_metrics(adapter); + ENA_LOCK_UNLOCK(); } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 18988d719a18..5647fe973502 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -487,6 +487,7 @@ struct ena_adapter { struct ena_stats_dev dev_stats; struct ena_hw_stats hw_stats; struct ena_admin_eni_stats eni_metrics; + struct ena_admin_ena_srd_info ena_srd_info; uint64_t *customer_metrics_array; enum ena_regs_reset_reason_types reset_reason; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index edae5c3c23fa..fd5545dbe5fb 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -38,6 +38,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); static void ena_sysctl_add_customer_metrics(struct ena_adapter *); +static void ena_sysctl_add_srd_info(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -59,18 +60,46 @@ static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) -#define SYSCTL_GSTRING_LEN 64 +#define SYSCTL_GSTRING_LEN 128 #define ENA_METRIC_ENI_ENTRY(stat, desc) { \ .name = #stat, \ .description = #desc, \ } +#define ENA_STAT_ENTRY(stat, desc, stat_type) { \ + .name = #stat, \ + .description = #desc, \ + .stat_offset = offsetof(struct ena_admin_##stat_type, stat) / sizeof(u64), \ +} + +#define ENA_STAT_ENA_SRD_ENTRY(stat, desc) \ + ENA_STAT_ENTRY(stat, desc, ena_srd_stats) + struct ena_hw_metrics { char name[SYSCTL_GSTRING_LEN]; char description[SYSCTL_GSTRING_LEN]; }; +struct ena_srd_metrics { + char name[SYSCTL_GSTRING_LEN]; + char description[SYSCTL_GSTRING_LEN]; + int stat_offset; +}; + +static const struct ena_srd_metrics ena_srd_stats_strings[] = { + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_tx_pkts, Number of packets transmitted over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_eligible_tx_pkts, Number of packets transmitted or could + have been transmitted over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_rx_pkts, Number of packets received over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_resource_utilization, Percentage of the ENA SRD resources + that are in use), +}; + static const struct ena_hw_metrics ena_hw_stats_strings[] = { ENA_METRIC_ENI_ENTRY( bw_in_allowance_exceeded, Inbound BW allowance exceeded), @@ -91,6 +120,7 @@ static const struct ena_hw_metrics ena_hw_stats_strings[] = { #endif #define ENA_CUSTOMER_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_hw_stats_strings) +#define ENA_SRD_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_srd_stats_strings) static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ENA driver parameters"); @@ -153,6 +183,9 @@ ena_sysctl_add_nodes(struct ena_adapter *adapter) else if (ena_com_get_cap(dev, ENA_ADMIN_ENI_STATS)) ena_sysctl_add_eni_metrics(adapter); + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENA_SRD_INFO)) + ena_sysctl_add_srd_info(adapter); + ena_sysctl_add_wd(adapter); ena_sysctl_add_stats(adapter); ena_sysctl_add_tuneables(adapter); @@ -379,6 +412,47 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &admin_stats->no_completion, 0, "Commands not completed"); } +static void +ena_sysctl_add_srd_info(struct ena_adapter *adapter) +{ + device_t dev; + + struct sysctl_oid *ena_srd_info; + struct sysctl_oid_list *srd_list; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + struct ena_admin_ena_srd_stats *srd_stats_ptr; + struct ena_srd_metrics cur_stat_strings; + + int i; + + dev = adapter->pdev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + ena_srd_info = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "ena_srd_info", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA's SRD information"); + srd_list = SYSCTL_CHILDREN(ena_srd_info); + + SYSCTL_ADD_U64(ctx, srd_list, OID_AUTO, "ena_srd_mode", + CTLFLAG_RD, &adapter->ena_srd_info.flags, 0, + "Describes which ENA-express features are enabled"); + + srd_stats_ptr = &adapter->ena_srd_info.ena_srd_stats; + + for (i = 0 ; i < ENA_SRD_METRICS_ARRAY_SIZE; i++) { + cur_stat_strings = ena_srd_stats_strings[i]; + SYSCTL_ADD_U64(ctx, srd_list, OID_AUTO, cur_stat_strings.name, + CTLFLAG_RD, (u64 *)srd_stats_ptr + cur_stat_strings.stat_offset, + 0, cur_stat_strings.description); + } +} + static void ena_sysctl_add_customer_metrics(struct ena_adapter *adapter) { From nobody Sun Jan 14 21:53:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpvD0ZSYz57DcZ; Sun, 14 Jan 2024 21:54: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 4TCpvC463xz4FH0; Sun, 14 Jan 2024 21:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jbd1Z1LNyWbIU9mkkPqXyfCCPgKTqsvdG1e9+kXBs3k=; b=i89Db+iCemBl5CwCPBQqN5qZ1za/mRDyi5qimxHEyAS3D2AWRZYmeUzWimBdE0NODTYszC wjutviFgnMFJml2pX9LEeEAsQJh+UPraEGkGtXDSvkPeg3aIgU4UbWE6AEv/Bf1k75aXYU +Ar5I2HobC2mh+6NkhLzsAVHPgVUKCDYHfme/kF2xykb0W7gMqUKu6F5iAv5H+XvlcZjig b1QoAUJuhYNaD5pvVKdPyaDZYmji9L7rzzT7LbZSnzuk14/NoMp+5M1+PzIBdUy+tfevSx RgcXRU3DJ3xVowWOsDLo3cwbF2gkVU9VKSSdxVbD20rnimyxiCoo5sba4+OPAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jbd1Z1LNyWbIU9mkkPqXyfCCPgKTqsvdG1e9+kXBs3k=; b=cawhidGtVHi8/xn9j2o8JuUX085ZFPoT8Vkb3KdntcvtQ4f1ZZ/WjEJbK6n6GVmpQM33oU 88W6WTN3IjlZjCcRQYIq9Br8sPFgXXq0NVPTTY5dzkHXyw0ztUfkCNDqRClrfruI9DzSoA TCZypf2Wd/jaMak0M+Dve9Z0AQ5QT84qpDPaYeqOo/r8z+5DBUC+qbPvXU48/VnKOqfC3k sysXBcqFp4CRDkZLybSpfpyWASiSQqa3FmRFMRMrI7T1yHgtrqBwwKZPi8zYBJziz4tGlX XFOJyrGG/jU1SVAzMPOia/J1bMm0G7TKt8ymDKYzayJtVH5lTBjg7a7MfBAMXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269239; a=rsa-sha256; cv=none; b=aKTDhzUS1+8Xsu9V+BlJHcYeTJT/pxW04Vh7KZwyf8PvnANj8QpWf2vd1rCL+EtOVIPFao rZCNgLnlo0u8YpsBpuI8jgO/4HgbRJLNU4LEzshDJCF4Zpz4D1iAvMUR7zunVdoJ7kelMT cVv06BNUutkgvG3D+5uiUFa7I0OL+DRsfz5nZ8p4d6dUfplGVV+ZEwRNIdS+GTQXqh8qll 0qXNAqtnZkVFHKrzeXw/Il8hCoKDagTMUKtzhSFZqKcJPoY26qvSheOFsfh5In55yrrLYo u1hWLwplStH9+zJdos8C4faYwwEfCTaAYGU9mkkWaz+Ln5PKWd01H2bkU3dvPw== 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 4TCpvC2y9CzWPT; Sun, 14 Jan 2024 21:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELrxDS041779; Sun, 14 Jan 2024 21:53:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELrxDN041776; Sun, 14 Jan 2024 21:53:59 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:53:59 GMT Message-Id: <202401142153.40ELrxDN041776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: eb29118a2fe5 - stable/14 - ena: Update the license dating to 2023 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eb29118a2fe523d5f7abd804274a47e37f4c3b1e Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=eb29118a2fe523d5f7abd804274a47e37f4c3b1e commit eb29118a2fe523d5f7abd804274a47e37f4c3b1e Author: Osama Abboud AuthorDate: 2023-10-23 17:16:38 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:11 +0000 ena: Update the license dating to 2023 Some of the files are using outdated linceses. Update the license to be 2023. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 246aa273244e91a30d70997a3be790a29f9eb29c) --- share/man/man4/ena.4 | 2 +- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena.h | 2 +- sys/dev/ena/ena_datapath.c | 2 +- sys/dev/ena/ena_datapath.h | 2 +- sys/dev/ena/ena_netmap.c | 2 +- sys/dev/ena/ena_netmap.h | 2 +- sys/dev/ena/ena_rss.c | 2 +- sys/dev/ena/ena_rss.h | 2 +- sys/dev/ena/ena_sysctl.c | 2 +- sys/dev/ena/ena_sysctl.h | 2 +- sys/modules/ena/Makefile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index befc2bb2ae0b..50a180871627 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2015-2022 Amazon.com, Inc. or its affiliates. +.\" Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 45bca630b4c2..3ff32cc9966c 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 5647fe973502..2c758d37622f 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 177f33ea8ef3..66a93bbe7a6c 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.h b/sys/dev/ena/ena_datapath.h index c6166a806c6a..43292b5abbe9 100644 --- a/sys/dev/ena/ena_datapath.h +++ b/sys/dev/ena/ena_datapath.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index a8d7cad05ab5..d95f48f7380c 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.h b/sys/dev/ena/ena_netmap.h index aa4d0d3d815a..598fcf1f08b2 100644 --- a/sys/dev/ena/ena_netmap.h +++ b/sys/dev/ena/ena_netmap.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c index ce21a0a8950e..d90a7fbb253a 100644 --- a/sys/dev/ena/ena_rss.c +++ b/sys/dev/ena/ena_rss.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.h b/sys/dev/ena/ena_rss.h index 20dc41cc64a4..1c1c89261b35 100644 --- a/sys/dev/ena/ena_rss.h +++ b/sys/dev/ena/ena_rss.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index fd5545dbe5fb..ea651837ebb6 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index e9b4bfaae1cb..4f5834214005 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/modules/ena/Makefile b/sys/modules/ena/Makefile index 95326888cc6c..f8b71588afa1 100644 --- a/sys/modules/ena/Makefile +++ b/sys/modules/ena/Makefile @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From nobody Sun Jan 14 21:54:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCpvF0VK4z57DwN; Sun, 14 Jan 2024 21:54: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 4TCpvD4sJtz4FMd; Sun, 14 Jan 2024 21:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24sLK7QIHm7DT7hq1+yVm/lUyMLwXDvupw/C9F77Qlc=; b=hYzcyi6B4KjDpxJKOCszhKMETByFgUrJzGwCT4rdHQSom6fnEBI8uOwPyoCDqOnCoG64ba SnYJQxsbTRxvd09ib/ApI3dkLE6t0ns+UyBM+yuKKYwHHlNlU+6Wl9OVvVKPkRZ0FOTLj/ 1/u1Lfk1HNVfqjY4FVrD8uMs0PlT1JwLhvVWPP3FgGdHFEVPCF2jPwJsQtLRueVAFnbk5G d80Ptsmm3JoC5/5F9DKoMhdxWu2FJBZVz7eikBcHP6LejcX/7be41NkHvEstZR0ARH9mgl zp+9gOCSIAdyNsSpiM44ZUPRzkflfpzjuZ8Cy7LARBtskYeiwl1PpQtylXXhoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705269240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24sLK7QIHm7DT7hq1+yVm/lUyMLwXDvupw/C9F77Qlc=; b=g3/TJ7+tpseDQ3FYiiWdpaYoK56sU8ECmui5ZtexXRP6kPpjUq6FMJXmBr0G8HqHiXrLr7 IU5M+sOd68epxlYytb78z0acs3R/Cd1CUSmYQgjwkolWypanXKYgdrQ0BFmDVEPVrUwEi8 qlP5bGB8ztMUeA7dc9LdOMZPbpB/5BbsT0X3NMpDamDimv9JT11cKGoQAE6H3XeaQNeK0z hY2AMfI0T0z/wNFBZYDLtNgU/fK4BCI8AGeEGfSnWwew4Y/zpG8IT9FNGBLIMPireUBEen lenwGS8Np54z8mVAHgFNwAi2CoQb7jsY/1NXCXKCbaNyr5ZGt4ZXaKXuWJT2tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705269240; a=rsa-sha256; cv=none; b=c75gkmDfrGHfeEvvqlDcj4ukVFwadvSlyh19QTcDc85vqXcLm98YdARrosq3KhleOQf5a9 qJYVVX5gYKAxnfkM1hC8anG+EA8N/6fu0b/J0pH0xd0367WYao+eox+q/FxuU53ARc/N49 DO6Fr/pZhZpx66hh73SqfodaxgynqM/6oFmbRSpHOdkPTPoHpmAuyGc/h9YrpNPpHfuFkm /jM29AXPODiVJFH59jIRm+eXkAbUzbHLGRUerdjxWsb37IBaEG1179BKAF71mcUITVkoWq yy/r5ck7fyrKOZIJ5o+W8cRYDjjHRIK+Hy6Y3nm9xWg/iEoaTMzqJar5xJFOUQ== 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 4TCpvD3yTpzWDN; Sun, 14 Jan 2024 21:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ELs0IR041832; Sun, 14 Jan 2024 21:54:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ELs0aA041829; Sun, 14 Jan 2024 21:54:00 GMT (envelope-from git) Date: Sun, 14 Jan 2024 21:54:00 GMT Message-Id: <202401142154.40ELs0aA041829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 9015208bff0a - stable/14 - ena: Update driver version to v2.7.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9015208bff0a940a837f654d1f2e21ff34efc382 Auto-Submitted: auto-generated The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=9015208bff0a940a837f654d1f2e21ff34efc382 commit 9015208bff0a940a837f654d1f2e21ff34efc382 Author: Osama Abboud AuthorDate: 2023-10-30 11:12:24 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 21:18:11 +0000 ena: Update driver version to v2.7.0 Features: * Introduce customer and SRD metrics through sysctl * Introduce spreading IRQs to CPUs capability using sysctl * Upgrade ena-com to v2.7.0 Bug Fixes: * Remove outdated APIs Minor Changes: * Introduce a shared stats sample interval for all stats Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 4e2688cc762d94b190029f0c5efab9c4bb5521be) --- sys/dev/ena/ena.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 2c758d37622f..3e42568ba8a9 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -38,8 +38,8 @@ #include "ena-com/ena_eth_com.h" #define ENA_DRV_MODULE_VER_MAJOR 2 -#define ENA_DRV_MODULE_VER_MINOR 6 -#define ENA_DRV_MODULE_VER_SUBMINOR 3 +#define ENA_DRV_MODULE_VER_MINOR 7 +#define ENA_DRV_MODULE_VER_SUBMINOR 0 #define ENA_DRV_MODULE_NAME "ena" From nobody Sun Jan 14 22:07:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCF3NPMz57G5R; Sun, 14 Jan 2024 22:07: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 4TCqCF2FtKz4KFg; Sun, 14 Jan 2024 22:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Gg0AyI/9GG16w92Qk0i4kyrXEfYqGzD/Q3tl4uOFyk=; b=reAf5ttRiVZsltRBmKD98aUTFuZKMIXJF2PmyOEOUMF0DIgnC1/CwEx3MRJaN3u+UgOXR6 p9va5jPKTWfmLFqyChykYTNdmUB/OxA3IdUzaQ7xetzCTtIrPVcRGay7RhKzAiL7T4BqNC 2UTtF/I6W5HwOtaHoUrpw8MOdzqdzERPMS6vROcx8yML1nHCV3EvyP/Bg0c2s31RaxtOPD L+sHUb34ZMwPy3MSR3PJ2Q8V9Phog2C2MBc1uA1P4WpAkGC/FObFQxmuAy1BiJMbgQwS4n q7ul2ftHZZAf8O5TLB5qDt2u63qJcKTP3e91CMg8mygL5Efx2SGZt6DOTm/Tsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Gg0AyI/9GG16w92Qk0i4kyrXEfYqGzD/Q3tl4uOFyk=; b=aeLO8nTbZgblR73Jiuz+/QdqlS1GyDgE5dciJRWzGLpNwEHYdHdQgLD9gxJ72UcTVlQKi0 /4ClAin3OpgjVuRvCVWnC/KcVRxVUXkmBVsl3DBgyjpr5lIO4hHxDHR8b4XrENIH5ZrJ6l Hg36U1jxPBCzlJlhyXY3F4NB0bAAnoUELtKXWDjo1smAiPF7Gs86hnbSiUsWBNiYNqiI5M /7w+y2HoX071tFdMZMedYsvqXzhMG+7pssooY5A4RaVIxybrj9l3kLhfYDU6WgRTFX+Lh3 WQE5E33eHvqGN9cilB7pTmyrG3bQciuRfnPXD0cAWXUhwFQSz7bYQsdy05TlwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270073; a=rsa-sha256; cv=none; b=y2nMKghcOa5z6qQ3bWmKVRJzjR3EzleUnSRvTkWGpW6yQ5uARJCK4sjMYFND5QXMA6HWzz PXjzzP8r98KRU1OU++5LkXRVJ3OcNVjiHmnN6UpbhoN8mBLrvPps3x9JpDOTTV3Y9FEKUH piGIu9W0lQxFAa+nbxwI2BHkPhaKZjQS1qi3p6FryFqEx8O0pfVuDrPIdtM1AHuHhGrk+J L6Q/MhIZHBjiypGKV7sbUhRY7sxc1QfAyoGU4k9wG+pRo7Pfr+qFcBcWRdYb2yvdreJelO GnuUx2xxA4m/7wXZFk2CTGIXU1qv0ZjCJP56D270hfv6IoLldASzjWrPokmEJw== 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 4TCqCF1FjpzXHJ; Sun, 14 Jan 2024 22:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7rru059981; Sun, 14 Jan 2024 22:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7rKS059977; Sun, 14 Jan 2024 22:07:53 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:53 GMT Message-Id: <202401142207.40EM7rKS059977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: c07c5801f82b - stable/13 - ena: Upgrade ena-com to freebsd v2.7.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c07c5801f82b3e087dc40d4fbeeffed1c0acf436 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=c07c5801f82b3e087dc40d4fbeeffed1c0acf436 commit c07c5801f82b3e087dc40d4fbeeffed1c0acf436 Author: Arthur Kiyanovski AuthorDate: 2023-12-28 13:52:31 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:22 +0000 ena: Upgrade ena-com to freebsd v2.7.0 Merge commit '04cf7cee5ae0c6bb29eb21ce85bab7ca7386a95f' Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit adfed2d835a7f9382941896d15a487dac6fe659c) --- sys/contrib/ena-com/ena_admin_defs.h | 1412 ------------------------ sys/contrib/ena-com/ena_com.c | 431 +++++++- sys/contrib/ena-com/ena_com.h | 187 +++- sys/contrib/ena-com/ena_common_defs.h | 50 - sys/contrib/ena-com/ena_defs/ena_admin_defs.h | 146 ++- sys/contrib/ena-com/ena_defs/ena_common_defs.h | 3 +- sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h | 18 +- sys/contrib/ena-com/ena_defs/ena_regs_defs.h | 13 +- sys/contrib/ena-com/ena_eth_com.c | 45 +- sys/contrib/ena-com/ena_eth_com.h | 29 +- sys/contrib/ena-com/ena_eth_io_defs.h | 960 ---------------- sys/contrib/ena-com/ena_fbsd_log.h | 74 -- sys/contrib/ena-com/ena_plat.h | 52 +- sys/contrib/ena-com/ena_regs_defs.h | 137 --- 14 files changed, 807 insertions(+), 2750 deletions(-) diff --git a/sys/contrib/ena-com/ena_admin_defs.h b/sys/contrib/ena-com/ena_admin_defs.h deleted file mode 100644 index 1d845c08256e..000000000000 --- a/sys/contrib/ena-com/ena_admin_defs.h +++ /dev/null @@ -1,1412 +0,0 @@ -/*- - * BSD LICENSE - * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER 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. - */ - -#ifndef _ENA_ADMIN_H_ -#define _ENA_ADMIN_H_ - -enum ena_admin_aq_opcode { - ENA_ADMIN_CREATE_SQ = 1, - - ENA_ADMIN_DESTROY_SQ = 2, - - ENA_ADMIN_CREATE_CQ = 3, - - ENA_ADMIN_DESTROY_CQ = 4, - - ENA_ADMIN_GET_FEATURE = 8, - - ENA_ADMIN_SET_FEATURE = 9, - - ENA_ADMIN_GET_STATS = 11, -}; - -enum ena_admin_aq_completion_status { - ENA_ADMIN_SUCCESS = 0, - - ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE = 1, - - ENA_ADMIN_BAD_OPCODE = 2, - - ENA_ADMIN_UNSUPPORTED_OPCODE = 3, - - ENA_ADMIN_MALFORMED_REQUEST = 4, - - /* Additional status is provided in ACQ entry extended_status */ - ENA_ADMIN_ILLEGAL_PARAMETER = 5, - - ENA_ADMIN_UNKNOWN_ERROR = 6, -}; - -enum ena_admin_aq_feature_id { - ENA_ADMIN_DEVICE_ATTRIBUTES = 1, - - ENA_ADMIN_MAX_QUEUES_NUM = 2, - - ENA_ADMIN_HW_HINTS = 3, - - ENA_ADMIN_RSS_HASH_FUNCTION = 10, - - ENA_ADMIN_STATELESS_OFFLOAD_CONFIG = 11, - - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG = 12, - - ENA_ADMIN_MTU = 14, - - ENA_ADMIN_RSS_HASH_INPUT = 18, - - ENA_ADMIN_INTERRUPT_MODERATION = 20, - - ENA_ADMIN_AENQ_CONFIG = 26, - - ENA_ADMIN_LINK_CONFIG = 27, - - ENA_ADMIN_HOST_ATTR_CONFIG = 28, - - ENA_ADMIN_FEATURES_OPCODE_NUM = 32, -}; - -enum ena_admin_placement_policy_type { - /* descriptors and headers are in host memory */ - ENA_ADMIN_PLACEMENT_POLICY_HOST = 1, - - /* descriptors and headers are in device memory (a.k.a Low Latency - * Queue) - */ - ENA_ADMIN_PLACEMENT_POLICY_DEV = 3, -}; - -enum ena_admin_link_types { - ENA_ADMIN_LINK_SPEED_1G = 0x1, - - ENA_ADMIN_LINK_SPEED_2_HALF_G = 0x2, - - ENA_ADMIN_LINK_SPEED_5G = 0x4, - - ENA_ADMIN_LINK_SPEED_10G = 0x8, - - ENA_ADMIN_LINK_SPEED_25G = 0x10, - - ENA_ADMIN_LINK_SPEED_40G = 0x20, - - ENA_ADMIN_LINK_SPEED_50G = 0x40, - - ENA_ADMIN_LINK_SPEED_100G = 0x80, - - ENA_ADMIN_LINK_SPEED_200G = 0x100, - - ENA_ADMIN_LINK_SPEED_400G = 0x200, -}; - -enum ena_admin_completion_policy_type { - /* completion queue entry for each sq descriptor */ - ENA_ADMIN_COMPLETION_POLICY_DESC = 0, - - /* completion queue entry upon request in sq descriptor */ - ENA_ADMIN_COMPLETION_POLICY_DESC_ON_DEMAND = 1, - - /* current queue head pointer is updated in OS memory upon sq - * descriptor request - */ - ENA_ADMIN_COMPLETION_POLICY_HEAD_ON_DEMAND = 2, - - /* current queue head pointer is updated in OS memory for each sq - * descriptor - */ - ENA_ADMIN_COMPLETION_POLICY_HEAD = 3, -}; - -/* basic stats return ena_admin_basic_stats while extanded stats return a - * buffer (string format) with additional statistics per queue and per - * device id - */ -enum ena_admin_get_stats_type { - ENA_ADMIN_GET_STATS_TYPE_BASIC = 0, - - ENA_ADMIN_GET_STATS_TYPE_EXTENDED = 1, -}; - -enum ena_admin_get_stats_scope { - ENA_ADMIN_SPECIFIC_QUEUE = 0, - - ENA_ADMIN_ETH_TRAFFIC = 1, -}; - -struct ena_admin_aq_common_desc { - /* 11:0 : command_id - * 15:12 : reserved12 - */ - uint16_t command_id; - - /* as appears in ena_admin_aq_opcode */ - uint8_t opcode; - - /* 0 : phase - * 1 : ctrl_data - control buffer address valid - * 2 : ctrl_data_indirect - control buffer address - * points to list of pages with addresses of control - * buffers - * 7:3 : reserved3 - */ - uint8_t flags; -}; - -/* used in ena_admin_aq_entry. Can point directly to control data, or to a - * page list chunk. Used also at the end of indirect mode page list chunks, - * for chaining. - */ -struct ena_admin_ctrl_buff_info { - uint32_t length; - - struct ena_common_mem_addr address; -}; - -struct ena_admin_sq { - uint16_t sq_idx; - - /* 4:0 : reserved - * 7:5 : sq_direction - 0x1 - Tx; 0x2 - Rx - */ - uint8_t sq_identity; - - uint8_t reserved1; -}; - -struct ena_admin_aq_entry { - struct ena_admin_aq_common_desc aq_common_descriptor; - - union { - uint32_t inline_data_w1[3]; - - struct ena_admin_ctrl_buff_info control_buffer; - } u; - - uint32_t inline_data_w4[12]; -}; - -struct ena_admin_acq_common_desc { - /* command identifier to associate it with the aq descriptor - * 11:0 : command_id - * 15:12 : reserved12 - */ - uint16_t command; - - uint8_t status; - - /* 0 : phase - * 7:1 : reserved1 - */ - uint8_t flags; - - uint16_t extended_status; - - /* serves as a hint what AQ entries can be revoked */ - uint16_t sq_head_indx; -}; - -struct ena_admin_acq_entry { - struct ena_admin_acq_common_desc acq_common_descriptor; - - uint32_t response_specific_data[14]; -}; - -struct ena_admin_aq_create_sq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - /* 4:0 : reserved0_w1 - * 7:5 : sq_direction - 0x1 - Tx, 0x2 - Rx - */ - uint8_t sq_identity; - - uint8_t reserved8_w1; - - /* 3:0 : placement_policy - Describing where the SQ - * descriptor ring and the SQ packet headers reside: - * 0x1 - descriptors and headers are in OS memory, - * 0x3 - descriptors and headers in device memory - * (a.k.a Low Latency Queue) - * 6:4 : completion_policy - Describing what policy - * to use for generation completion entry (cqe) in - * the CQ associated with this SQ: 0x0 - cqe for each - * sq descriptor, 0x1 - cqe upon request in sq - * descriptor, 0x2 - current queue head pointer is - * updated in OS memory upon sq descriptor request - * 0x3 - current queue head pointer is updated in OS - * memory for each sq descriptor - * 7 : reserved15_w1 - */ - uint8_t sq_caps_2; - - /* 0 : is_physically_contiguous - Described if the - * queue ring memory is allocated in physical - * contiguous pages or split. - * 7:1 : reserved17_w1 - */ - uint8_t sq_caps_3; - - /* associated completion queue id. This CQ must be created prior to - * SQ creation - */ - uint16_t cq_idx; - - /* submission queue depth in entries */ - uint16_t sq_depth; - - /* SQ physical base address in OS memory. This field should not be - * used for Low Latency queues. Has to be page aligned. - */ - struct ena_common_mem_addr sq_ba; - - /* specifies queue head writeback location in OS memory. Valid if - * completion_policy is set to completion_policy_head_on_demand or - * completion_policy_head. Has to be cache aligned - */ - struct ena_common_mem_addr sq_head_writeback; - - uint32_t reserved0_w7; - - uint32_t reserved0_w8; -}; - -enum ena_admin_sq_direction { - ENA_ADMIN_SQ_DIRECTION_TX = 1, - - ENA_ADMIN_SQ_DIRECTION_RX = 2, -}; - -struct ena_admin_acq_create_sq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; - - uint16_t sq_idx; - - uint16_t reserved; - - /* queue doorbell address as an offset to PCIe MMIO REG BAR */ - uint32_t sq_doorbell_offset; - - /* low latency queue ring base address as an offset to PCIe MMIO - * LLQ_MEM BAR - */ - uint32_t llq_descriptors_offset; - - /* low latency queue headers' memory as an offset to PCIe MMIO - * LLQ_MEM BAR - */ - uint32_t llq_headers_offset; -}; - -struct ena_admin_aq_destroy_sq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_sq sq; -}; - -struct ena_admin_acq_destroy_sq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; -}; - -struct ena_admin_aq_create_cq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - /* 4:0 : reserved5 - * 5 : interrupt_mode_enabled - if set, cq operates - * in interrupt mode, otherwise - polling - * 7:6 : reserved6 - */ - uint8_t cq_caps_1; - - /* 4:0 : cq_entry_size_words - size of CQ entry in - * 32-bit words, valid values: 4, 8. - * 7:5 : reserved7 - */ - uint8_t cq_caps_2; - - /* completion queue depth in # of entries. must be power of 2 */ - uint16_t cq_depth; - - /* msix vector assigned to this cq */ - uint32_t msix_vector; - - /* cq physical base address in OS memory. CQ must be physically - * contiguous - */ - struct ena_common_mem_addr cq_ba; -}; - -struct ena_admin_acq_create_cq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; - - uint16_t cq_idx; - - /* actual cq depth in number of entries */ - uint16_t cq_actual_depth; - - uint32_t numa_node_register_offset; - - uint32_t cq_head_db_register_offset; - - uint32_t cq_interrupt_unmask_register_offset; -}; - -struct ena_admin_aq_destroy_cq_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - uint16_t cq_idx; - - uint16_t reserved1; -}; - -struct ena_admin_acq_destroy_cq_resp_desc { - struct ena_admin_acq_common_desc acq_common_desc; -}; - -/* ENA AQ Get Statistics command. Extended statistics are placed in control - * buffer pointed by AQ entry - */ -struct ena_admin_aq_get_stats_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - union { - /* command specific inline data */ - uint32_t inline_data_w1[3]; - - struct ena_admin_ctrl_buff_info control_buffer; - } u; - - /* stats type as defined in enum ena_admin_get_stats_type */ - uint8_t type; - - /* stats scope defined in enum ena_admin_get_stats_scope */ - uint8_t scope; - - uint16_t reserved3; - - /* queue id. used when scope is specific_queue */ - uint16_t queue_idx; - - /* device id, value 0xFFFF means mine. only privileged device can get - * stats of other device - */ - uint16_t device_id; -}; - -/* Basic Statistics Command. */ -struct ena_admin_basic_stats { - uint32_t tx_bytes_low; - - uint32_t tx_bytes_high; - - uint32_t tx_pkts_low; - - uint32_t tx_pkts_high; - - uint32_t rx_bytes_low; - - uint32_t rx_bytes_high; - - uint32_t rx_pkts_low; - - uint32_t rx_pkts_high; - - uint32_t rx_drops_low; - - uint32_t rx_drops_high; -}; - -struct ena_admin_acq_get_stats_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - struct ena_admin_basic_stats basic_stats; -}; - -struct ena_admin_get_set_feature_common_desc { - /* 1:0 : select - 0x1 - current value; 0x3 - default - * value - * 7:3 : reserved3 - */ - uint8_t flags; - - /* as appears in ena_admin_aq_feature_id */ - uint8_t feature_id; - - uint16_t reserved16; -}; - -struct ena_admin_device_attr_feature_desc { - uint32_t impl_id; - - uint32_t device_version; - - /* bitmap of ena_admin_aq_feature_id */ - uint32_t supported_features; - - uint32_t reserved3; - - /* Indicates how many bits are used physical address access. */ - uint32_t phys_addr_width; - - /* Indicates how many bits are used virtual address access. */ - uint32_t virt_addr_width; - - /* unicast MAC address (in Network byte order) */ - uint8_t mac_addr[6]; - - uint8_t reserved7[2]; - - uint32_t max_mtu; -}; - -struct ena_admin_queue_feature_desc { - /* including LLQs */ - uint32_t max_sq_num; - - uint32_t max_sq_depth; - - uint32_t max_cq_num; - - uint32_t max_cq_depth; - - uint32_t max_llq_num; - - uint32_t max_llq_depth; - - uint32_t max_header_size; - - /* Maximum Descriptors number, including meta descriptor, allowed for - * a single Tx packet - */ - uint16_t max_packet_tx_descs; - - /* Maximum Descriptors number allowed for a single Rx packet */ - uint16_t max_packet_rx_descs; -}; - -struct ena_admin_set_feature_mtu_desc { - /* exclude L2 */ - uint32_t mtu; -}; - -struct ena_admin_set_feature_host_attr_desc { - /* host OS info base address in OS memory. host info is 4KB of - * physically contiguous - */ - struct ena_common_mem_addr os_info_ba; - - /* host debug area base address in OS memory. debug area must be - * physically contiguous - */ - struct ena_common_mem_addr debug_ba; - - /* debug area size */ - uint32_t debug_area_size; -}; - -struct ena_admin_feature_intr_moder_desc { - /* interrupt delay granularity in usec */ - uint16_t intr_delay_resolution; - - uint16_t reserved; -}; - -struct ena_admin_get_feature_link_desc { - /* Link speed in Mb */ - uint32_t speed; - - /* bit field of enum ena_admin_link types */ - uint32_t supported; - - /* 0 : autoneg - * 1 : duplex - Full Duplex - * 31:2 : reserved2 - */ - uint32_t flags; -}; - -struct ena_admin_feature_aenq_desc { - /* bitmask for AENQ groups the device can report */ - uint32_t supported_groups; - - /* bitmask for AENQ groups to report */ - uint32_t enabled_groups; -}; - -struct ena_admin_feature_offload_desc { - /* 0 : TX_L3_csum_ipv4 - * 1 : TX_L4_ipv4_csum_part - The checksum field - * should be initialized with pseudo header checksum - * 2 : TX_L4_ipv4_csum_full - * 3 : TX_L4_ipv6_csum_part - The checksum field - * should be initialized with pseudo header checksum - * 4 : TX_L4_ipv6_csum_full - * 5 : tso_ipv4 - * 6 : tso_ipv6 - * 7 : tso_ecn - */ - uint32_t tx; - - /* Receive side supported stateless offload - * 0 : RX_L3_csum_ipv4 - IPv4 checksum - * 1 : RX_L4_ipv4_csum - TCP/UDP/IPv4 checksum - * 2 : RX_L4_ipv6_csum - TCP/UDP/IPv6 checksum - * 3 : RX_hash - Hash calculation - */ - uint32_t rx_supported; - - uint32_t rx_enabled; -}; - -enum ena_admin_hash_functions { - ENA_ADMIN_TOEPLITZ = 1, - - ENA_ADMIN_CRC32 = 2, -}; - -struct ena_admin_feature_rss_flow_hash_control { - uint32_t keys_num; - - uint32_t reserved; - - uint32_t key[10]; -}; - -struct ena_admin_feature_rss_flow_hash_function { - /* 7:0 : funcs - bitmask of ena_admin_hash_functions */ - uint32_t supported_func; - - /* 7:0 : selected_func - bitmask of - * ena_admin_hash_functions - */ - uint32_t selected_func; - - /* initial value */ - uint32_t init_val; -}; - -/* RSS flow hash protocols */ -enum ena_admin_flow_hash_proto { - ENA_ADMIN_RSS_TCP4 = 0, - - ENA_ADMIN_RSS_UDP4 = 1, - - ENA_ADMIN_RSS_TCP6 = 2, - - ENA_ADMIN_RSS_UDP6 = 3, - - ENA_ADMIN_RSS_IP4 = 4, - - ENA_ADMIN_RSS_IP6 = 5, - - ENA_ADMIN_RSS_IP4_FRAG = 6, - - ENA_ADMIN_RSS_NOT_IP = 7, - - /* TCPv6 with extension header */ - ENA_ADMIN_RSS_TCP6_EX = 8, - - /* IPv6 with extension header */ - ENA_ADMIN_RSS_IP6_EX = 9, - - ENA_ADMIN_RSS_PROTO_NUM = 16, -}; - -/* RSS flow hash fields */ -enum ena_admin_flow_hash_fields { - /* Ethernet Dest Addr */ - ENA_ADMIN_RSS_L2_DA = BIT(0), - - /* Ethernet Src Addr */ - ENA_ADMIN_RSS_L2_SA = BIT(1), - - /* ipv4/6 Dest Addr */ - ENA_ADMIN_RSS_L3_DA = BIT(2), - - /* ipv4/6 Src Addr */ - ENA_ADMIN_RSS_L3_SA = BIT(3), - - /* tcp/udp Dest Port */ - ENA_ADMIN_RSS_L4_DP = BIT(4), - - /* tcp/udp Src Port */ - ENA_ADMIN_RSS_L4_SP = BIT(5), -}; - -struct ena_admin_proto_input { - /* flow hash fields (bitwise according to ena_admin_flow_hash_fields) */ - uint16_t fields; - - uint16_t reserved2; -}; - -struct ena_admin_feature_rss_hash_control { - struct ena_admin_proto_input supported_fields[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input selected_fields[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input reserved2[ENA_ADMIN_RSS_PROTO_NUM]; - - struct ena_admin_proto_input reserved3[ENA_ADMIN_RSS_PROTO_NUM]; -}; - -struct ena_admin_feature_rss_flow_hash_input { - /* supported hash input sorting - * 1 : L3_sort - support swap L3 addresses if DA is - * smaller than SA - * 2 : L4_sort - support swap L4 ports if DP smaller - * SP - */ - uint16_t supported_input_sort; - - /* enabled hash input sorting - * 1 : enable_L3_sort - enable swap L3 addresses if - * DA smaller than SA - * 2 : enable_L4_sort - enable swap L4 ports if DP - * smaller than SP - */ - uint16_t enabled_input_sort; -}; - -enum ena_admin_os_type { - ENA_ADMIN_OS_LINUX = 1, - - ENA_ADMIN_OS_WIN = 2, - - ENA_ADMIN_OS_DPDK = 3, - - ENA_ADMIN_OS_FREEBSD = 4, - - ENA_ADMIN_OS_IPXE = 5, -}; - -struct ena_admin_host_info { - /* defined in enum ena_admin_os_type */ - uint32_t os_type; - - /* os distribution string format */ - uint8_t os_dist_str[128]; - - /* OS distribution numeric format */ - uint32_t os_dist; - - /* kernel version string format */ - uint8_t kernel_ver_str[32]; - - /* Kernel version numeric format */ - uint32_t kernel_ver; - - /* 7:0 : major - * 15:8 : minor - * 23:16 : sub_minor - */ - uint32_t driver_version; - - /* features bitmap */ - uint32_t supported_network_features[4]; -}; - -struct ena_admin_rss_ind_table_entry { - uint16_t cq_idx; - - uint16_t reserved; -}; - -struct ena_admin_feature_rss_ind_table { - /* min supported table size (2^min_size) */ - uint16_t min_size; - - /* max supported table size (2^max_size) */ - uint16_t max_size; - - /* table size (2^size) */ - uint16_t size; - - uint16_t reserved; - - /* index of the inline entry. 0xFFFFFFFF means invalid */ - uint32_t inline_index; - - /* used for updating single entry, ignored when setting the entire - * table through the control buffer. - */ - struct ena_admin_rss_ind_table_entry inline_entry; -}; - -/* When hint value is 0, driver should use it's own predefined value */ -struct ena_admin_ena_hw_hints { - /* value in ms */ - uint16_t mmio_read_timeout; - - /* value in ms */ - uint16_t driver_watchdog_timeout; - - /* Per packet tx completion timeout. value in ms */ - uint16_t missing_tx_completion_timeout; - - uint16_t missed_tx_completion_count_threshold_to_reset; - - /* value in ms */ - uint16_t admin_completion_tx_timeout; - - uint16_t netdev_wd_timeout; - - uint16_t max_tx_sgl_size; - - uint16_t max_rx_sgl_size; - - uint16_t reserved[8]; -}; - -struct ena_admin_get_feat_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_ctrl_buff_info control_buffer; - - struct ena_admin_get_set_feature_common_desc feat_common; - - uint32_t raw[11]; -}; - -struct ena_admin_get_feat_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - union { - uint32_t raw[14]; - - struct ena_admin_device_attr_feature_desc dev_attr; - - struct ena_admin_queue_feature_desc max_queue; - - struct ena_admin_feature_aenq_desc aenq; - - struct ena_admin_get_feature_link_desc link; - - struct ena_admin_feature_offload_desc offload; - - struct ena_admin_feature_rss_flow_hash_function flow_hash_func; - - struct ena_admin_feature_rss_flow_hash_input flow_hash_input; - - struct ena_admin_feature_rss_ind_table ind_table; - - struct ena_admin_feature_intr_moder_desc intr_moderation; - - struct ena_admin_ena_hw_hints hw_hints; - } u; -}; - -struct ena_admin_set_feat_cmd { - struct ena_admin_aq_common_desc aq_common_descriptor; - - struct ena_admin_ctrl_buff_info control_buffer; - - struct ena_admin_get_set_feature_common_desc feat_common; - - union { - uint32_t raw[11]; - - /* mtu size */ - struct ena_admin_set_feature_mtu_desc mtu; - - /* host attributes */ - struct ena_admin_set_feature_host_attr_desc host_attr; - - /* AENQ configuration */ - struct ena_admin_feature_aenq_desc aenq; - - /* rss flow hash function */ - struct ena_admin_feature_rss_flow_hash_function flow_hash_func; - - /* rss flow hash input */ - struct ena_admin_feature_rss_flow_hash_input flow_hash_input; - - /* rss indirection table */ - struct ena_admin_feature_rss_ind_table ind_table; - } u; -}; - -struct ena_admin_set_feat_resp { - struct ena_admin_acq_common_desc acq_common_desc; - - union { - uint32_t raw[14]; - } u; -}; - -struct ena_admin_aenq_common_desc { - uint16_t group; - - uint16_t syndrom; - - /* 0 : phase */ - uint8_t flags; - - uint8_t reserved1[3]; - - uint32_t timestamp_low; - - uint32_t timestamp_high; -}; - -/* asynchronous event notification groups */ -enum ena_admin_aenq_group { - ENA_ADMIN_LINK_CHANGE = 0, - - ENA_ADMIN_FATAL_ERROR = 1, - - ENA_ADMIN_WARNING = 2, - - ENA_ADMIN_NOTIFICATION = 3, - - ENA_ADMIN_KEEP_ALIVE = 4, - - ENA_ADMIN_AENQ_GROUPS_NUM = 5, -}; - -enum ena_admin_aenq_notification_syndrom { - ENA_ADMIN_SUSPEND = 0, - - ENA_ADMIN_RESUME = 1, - - ENA_ADMIN_UPDATE_HINTS = 2, -}; - -struct ena_admin_aenq_entry { - struct ena_admin_aenq_common_desc aenq_common_desc; - - /* command specific inline data */ - uint32_t inline_data_w4[12]; -}; - -struct ena_admin_aenq_link_change_desc { - struct ena_admin_aenq_common_desc aenq_common_desc; - - /* 0 : link_status */ - uint32_t flags; -}; - -struct ena_admin_aenq_keep_alive_desc { - struct ena_admin_aenq_common_desc aenq_common_desc; - - uint32_t rx_drops_low; - - uint32_t rx_drops_high; -}; - -struct ena_admin_ena_mmio_req_read_less_resp { - uint16_t req_id; - - uint16_t reg_off; - - /* value is valid when poll is cleared */ - uint32_t reg_val; -}; - -/* aq_common_desc */ -#define ENA_ADMIN_AQ_COMMON_DESC_COMMAND_ID_MASK GENMASK(11, 0) -#define ENA_ADMIN_AQ_COMMON_DESC_PHASE_MASK BIT(0) -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_SHIFT 1 -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_MASK BIT(1) -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_SHIFT 2 -#define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_MASK BIT(2) - -/* sq */ -#define ENA_ADMIN_SQ_SQ_DIRECTION_SHIFT 5 -#define ENA_ADMIN_SQ_SQ_DIRECTION_MASK GENMASK(7, 5) - -/* acq_common_desc */ *** 3278 LINES SKIPPED *** From nobody Sun Jan 14 22:07:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCG4Q0yz57G2s; Sun, 14 Jan 2024 22:07: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 4TCqCG3Pc0z4KNc; Sun, 14 Jan 2024 22:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0facqwzNXsk9FgbUjGydmhvJgNbjf6sf9y2tdDn0dtI=; b=k+wYEL/NCa22P04RDftivmW4OqzFPWWSnqh8lho13D3u1jkUJX+CFOUxQZxcxnmr0l5cvn uQMTo8U+RQqqAZ7ik6NjA71M80ZIEpexPxH8sR4uPi0e7kM2TudGoVQx4y+lwujcOtXoXA jIEMDhic0Jz8ndhlY98kEohRi0l+Uc+FwdTIjIEstqzAFWGoHasjYE0Ygt05TD+qr88YRC U3N+dQjfM2kAqQdpvqxOreyvlBq0eLabzIUg27fitB3DBcJlD7NBMEe9ThHNAtep2jahfg 0Qd/dveXlLjCKe9eb2+/0Q0vVmN9483yQij7o4A4flG91IEKG9amIVh7BddkkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0facqwzNXsk9FgbUjGydmhvJgNbjf6sf9y2tdDn0dtI=; b=KiEiHPV9wxGlQm23wBYUVdb0vcO6jzgGZWLd8RxCR2aQMayuONzL+yx/4OGv+kNBeSnxmK /7HjMtG8gq60R4hwkKtPKaZcgxhqBLLRivvJmv0RrUIl2QwOjG3ALCJ9hUGBkqyi/Jzgcq NxeUaiyA1cH6f6W5yR8K1W9JaeFapmo67j8IOOpPsqAxPMscLEGRTAUHYnXr3wayRHpf8i NDG9hOKp1EuUnVB8U29p8ir0lvkUQ9zlagH8m/7tt/nJJJImZI87PL9uoY/7KKvbw7btia GftjYHlVN4uAEQxagXLYI5SAQmfgmbYvGp6q9n30AnI+wSKs5bLmXxIBinsmIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270074; a=rsa-sha256; cv=none; b=jjD7kJBIflTD1euZrxKrOOZJXBtQbkgUXiII/bv+GC5CUNuZwjhF5eXG1n57XZEnsRK/ya NHbPUAJkhbXBa8QiIUKUYQmoDhm41e9FY3JUPZgadeS02cYa2JHcFPjqxA0v36oByqAHUT zPsbYX5LMWZiuEkYUBiOZvP4dfnBPB/TWm3v0bKZyRUvlkrdUUtcdqeQGBExSolH4I10uC ieu1px766lhHP/54pKyq/dEjaWuurgP0BethC2SZrFTbKfDMfELy4E4x3YxVzD8nJMTfXr jFdFwb0ULwYETqSHhyHO6h4VmWMVOmzyXggOywm+9HZWHLiynb9HrtW1L5PQGg== 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 4TCqCG2VwLzXHK; Sun, 14 Jan 2024 22:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7s1S060034; Sun, 14 Jan 2024 22:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7sRj060031; Sun, 14 Jan 2024 22:07:54 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:54 GMT Message-Id: <202401142207.40EM7sRj060031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 99c3944243a0 - stable/13 - ena: Add sysctl support for spreading IRQs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99c3944243a055f52611b2a65dcb87d08295da3b Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=99c3944243a055f52611b2a65dcb87d08295da3b commit 99c3944243a055f52611b2a65dcb87d08295da3b Author: Osama Abboud AuthorDate: 2023-10-30 11:27:03 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:22 +0000 ena: Add sysctl support for spreading IRQs This commit allows spreading IO IRQs over different CPUs through sysctl. Two sysctl nodes are introduced: 1- base_cpu: servers as the first CPU to which the first IO IRQ will be bound. 2- cpu_stride: sets the distance between every two CPUs to which every two consecutive IO IRQs are bound. For example for doing the following IO IRQs / CPU binding: IRQ idx | CPU ---------------- 1 | 0 2 | 2 3 | 4 4 | 6 Run the following commands: sysctl dev.ena..irq_affinity.base_cpu=0 sysctl dev.ena..irq_affinity.cpu_stride=2 Also introduced rss_enabled field, which is intended to replace '#ifdef RSS' in multiple places, in order to prevent code duplication. We want to bind interrupts to CPUs in case of rss set OR in case the newly defined sysctl paremeter is set. This requires to remove a couple of '#ifdef RSS' as well in the structs, since we'll be using the relevant parameters in the CPU binding code. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f9e1d9471077109c19fd7d6dc9c1d35432efdede) --- sys/dev/ena/ena.c | 126 ++++++++++++++++++++++++++++++++++------ sys/dev/ena/ena.h | 14 +++-- sys/dev/ena/ena_sysctl.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+), 22 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index ac6a59b632e0..7de87e6f3f4d 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1237,6 +1237,84 @@ ena_update_io_rings(struct ena_adapter *adapter, uint32_t num) ena_init_io_rings(adapter); } +int +ena_update_base_cpu(struct ena_adapter *adapter, int new_num) +{ + int old_num; + int rc = 0; + bool dev_was_up; + + dev_was_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); + old_num = adapter->irq_cpu_base; + + ena_down(adapter); + + adapter->irq_cpu_base = new_num; + + if (dev_was_up) { + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to configure device %d IRQ base CPU. " + "Reverting to previous value: %d\n", + new_num, old_num); + + adapter->irq_cpu_base = old_num; + + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to revert to previous setup." + "Triggering device reset.\n"); + ENA_FLAG_SET_ATOMIC( + ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + ena_trigger_reset(adapter, + ENA_REGS_RESET_OS_TRIGGER); + } + } + } + return (rc); +} + +int +ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num) +{ + uint32_t old_num; + int rc = 0; + bool dev_was_up; + + dev_was_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); + old_num = adapter->irq_cpu_stride; + + ena_down(adapter); + + adapter->irq_cpu_stride = new_num; + + if (dev_was_up) { + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to configure device %d IRQ CPU stride. " + "Reverting to previous value: %d\n", + new_num, old_num); + + adapter->irq_cpu_stride = old_num; + + rc = ena_up(adapter); + if (unlikely(rc != 0)) { + ena_log(adapter->pdev, ERR, + "Failed to revert to previous setup." + "Triggering device reset.\n"); + ENA_FLAG_SET_ATOMIC( + ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + ena_trigger_reset(adapter, + ENA_REGS_RESET_OS_TRIGGER); + } + } + } + return (rc); +} + /* Caller should sanitize new_num */ int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) @@ -1683,6 +1761,13 @@ ena_setup_io_intr(struct ena_adapter *adapter) ena_log(adapter->pdev, DBG, "ena_setup_io_intr vector: %d\n", adapter->msix_entries[irq_idx].vector); + if (adapter->irq_cpu_base > ENA_BASE_CPU_UNSPECIFIED) { + adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = + (unsigned)(adapter->irq_cpu_base + + i * adapter->irq_cpu_stride) % (unsigned)mp_ncpus; + CPU_SETOF(adapter->que[i].cpu, &adapter->que[i].cpu_mask); + } + #ifdef RSS adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = rss_getcpu(cur_bind); @@ -1790,20 +1875,19 @@ ena_request_io_irq(struct ena_adapter *adapter) } irq->requested = true; -#ifdef RSS - rc = bus_bind_intr(adapter->pdev, irq->res, irq->cpu); - if (unlikely(rc != 0)) { - ena_log(pdev, ERR, - "failed to bind interrupt handler for irq %ju to cpu %d: %d\n", - rman_get_start(irq->res), irq->cpu, rc); - goto err; - } + if (adapter->rss_enabled || adapter->irq_cpu_base > ENA_BASE_CPU_UNSPECIFIED) { + rc = bus_bind_intr(adapter->pdev, irq->res, irq->cpu); + if (unlikely(rc != 0)) { + ena_log(pdev, ERR, + "failed to bind interrupt handler for irq %ju to cpu %d: %d\n", + rman_get_start(irq->res), irq->cpu, rc); + goto err; + } - ena_log(pdev, INFO, "queue %d - cpu %d\n", - i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#endif + ena_log(pdev, INFO, "queue %d - cpu %d\n", + i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); + } } - return (rc); err: @@ -1814,13 +1898,14 @@ err: /* Once we entered err: section and irq->requested is true we free both intr and resources */ - if (irq->requested) + if (irq->requested) { rcc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (unlikely(rcc != 0)) - ena_log(pdev, ERR, - "could not release irq: %d, error: %d\n", - irq->vector, rcc); + if (unlikely(rcc != 0)) + ena_log(pdev, ERR, + "could not release irq: %d, error: %d\n", + irq->vector, rcc); + } /* If we entered err: section without irq->requested set we know it was bus_alloc_resource_any() that needs cleanup, provided @@ -3524,6 +3609,13 @@ ena_attach(device_t pdev) adapter->missing_tx_max_queues = ENA_DEFAULT_TX_MONITORED_QUEUES; adapter->missing_tx_threshold = ENA_DEFAULT_TX_CMP_THRESHOLD; + adapter->irq_cpu_base = ENA_BASE_CPU_UNSPECIFIED; + adapter->irq_cpu_stride = 0; + +#ifdef RSS + adapter->rss_enabled = 1; +#endif + if (version_printed++ == 0) ena_log(pdev, INFO, "%s\n", ena_version); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b6e791d6ff6a..3687e9b2522e 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -69,6 +69,7 @@ #define ENA_DEFAULT_RING_SIZE 1024 #define ENA_MIN_RING_SIZE 256 +#define ENA_BASE_CPU_UNSPECIFIED -1 /* * Refill Rx queue when number of required descriptors is above * QUEUE_SIZE / ENA_RX_REFILL_THRESH_DIVIDER or ENA_RX_REFILL_THRESH_PACKET @@ -201,9 +202,7 @@ struct ena_irq { void *cookie; unsigned int vector; bool requested; -#ifdef RSS int cpu; -#endif char name[ENA_IRQNAME_SIZE]; }; @@ -216,10 +215,8 @@ struct ena_que { struct taskqueue *cleanup_tq; uint32_t id; -#ifdef RSS int cpu; cpuset_t cpu_mask; -#endif int domain; struct sysctl_oid *oid; }; @@ -448,6 +445,12 @@ struct ena_adapter { ena_state_t flags; + /* IRQ CPU affinity */ + int irq_cpu_base; + uint32_t irq_cpu_stride; + + uint8_t rss_enabled; + /* Queue will represent one TX and one RX ring */ struct ena_que que[ENA_MAX_NUM_IO_QUEUES] __aligned(CACHE_LINE_SIZE); @@ -524,7 +527,8 @@ int ena_update_buf_ring_size(struct ena_adapter *adapter, int ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, uint32_t new_rx_size); int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num); - +int ena_update_base_cpu(struct ena_adapter *adapter, int new_num); +int ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num); static inline int ena_mbuf_count(struct mbuf *mbuf) { diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index d450fcf48d15..6668f9924787 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -38,6 +38,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); +static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ #ifndef RSS static void ena_sysctl_add_rss(struct ena_adapter *); @@ -45,6 +46,8 @@ static void ena_sysctl_add_rss(struct ena_adapter *); static int ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_io_queues_nb(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS); static int ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS); #ifndef RSS static int ena_sysctl_rss_key(SYSCTL_HANDLER_ARGS); @@ -102,6 +105,7 @@ ena_sysctl_add_nodes(struct ena_adapter *adapter) ena_sysctl_add_stats(adapter); ena_sysctl_add_eni_metrics(adapter); ena_sysctl_add_tuneables(adapter); + ena_sysctl_add_irq_affinity(adapter); #ifndef RSS ena_sysctl_add_rss(adapter); #endif @@ -448,6 +452,36 @@ ena_sysctl_add_rss(struct ena_adapter *adapter) } #endif /* RSS */ +static void +ena_sysctl_add_irq_affinity(struct ena_adapter *adapter) +{ + device_t dev; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + dev = adapter->pdev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "irq_affinity", + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Decide base CPU and stride for irqs affinity."); + child = SYSCTL_CHILDREN(tree); + + /* Add base cpu leaf */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "base_cpu", + CTLTYPE_S32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_irq_base_cpu, "I", "Base cpu index for setting irq affinity."); + + /* Add cpu stride leaf */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "cpu_stride", + CTLTYPE_S32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_irq_cpu_stride, "I", "Distance between irqs when setting affinity."); +} + /* * ena_sysctl_update_queue_node_nb - Register/unregister sysctl queue nodes. @@ -707,6 +741,117 @@ unlock: return (0); } +static int +ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int irq_base_cpu = 0; + int error; + + ENA_LOCK_LOCK(); + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { + error = ENODEV; + goto unlock; + } + + error = sysctl_wire_old_buffer(req, sizeof(irq_base_cpu)); + if (error == 0) { + irq_base_cpu = adapter->irq_cpu_base; + error = sysctl_handle_int(oidp, &irq_base_cpu, 0, req); + } + if (error != 0 || req->newptr == NULL) + goto unlock; + + if (irq_base_cpu <= ENA_BASE_CPU_UNSPECIFIED) { + ena_log(adapter->pdev, ERR, + "Requested base CPU is less than zero.\n"); + error = EINVAL; + goto unlock; + } + + if (irq_base_cpu > mp_ncpus) { + ena_log(adapter->pdev, INFO, + "Requested base CPU is larger than the number of available CPUs. \n"); + error = EINVAL; + goto unlock; + + } + + if (irq_base_cpu == adapter->irq_cpu_base) { + ena_log(adapter->pdev, INFO, + "Requested IRQ base CPU is equal to current value " + "(%d)\n", + adapter->irq_cpu_base); + goto unlock; + } + + ena_log(adapter->pdev, INFO, + "Requested new IRQ base CPU: %d, current value: %d\n", + irq_base_cpu, adapter->irq_cpu_base); + + error = ena_update_base_cpu(adapter, irq_base_cpu); + +unlock: + ENA_LOCK_UNLOCK(); + + return (error); +} + +static int +ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int32_t irq_cpu_stride = 0; + int error; + + ENA_LOCK_LOCK(); + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { + error = ENODEV; + goto unlock; + } + + error = sysctl_wire_old_buffer(req, sizeof(irq_cpu_stride)); + if (error == 0) { + irq_cpu_stride = adapter->irq_cpu_stride; + error = sysctl_handle_int(oidp, &irq_cpu_stride, 0, req); + } + if (error != 0 || req->newptr == NULL) + goto unlock; + + if (irq_cpu_stride < 0) { + ena_log(adapter->pdev, ERR, + "Requested IRQ stride is less than zero.\n"); + error = EINVAL; + goto unlock; + } + + if (irq_cpu_stride > mp_ncpus) { + ena_log(adapter->pdev, INFO, + "Warning: Requested IRQ stride is larger than the number of available CPUs.\n"); + } + + if (irq_cpu_stride == adapter->irq_cpu_stride) { + ena_log(adapter->pdev, INFO, + "Requested IRQ CPU stride is equal to current value " + "(%u)\n", + adapter->irq_cpu_stride); + goto unlock; + } + + ena_log(adapter->pdev, INFO, + "Requested new IRQ CPU stride: %u, current value: %u\n", + irq_cpu_stride, adapter->irq_cpu_stride); + + error = ena_update_cpu_stride(adapter, irq_cpu_stride); + if (error != 0) + goto unlock; + +unlock: + ENA_LOCK_UNLOCK(); + + return (error); +} + #ifndef RSS /* * Change the Receive Side Scaling hash key. From nobody Sun Jan 14 22:07:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCH6DjGz57FtW; Sun, 14 Jan 2024 22:07: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 4TCqCH4TM2z4KCr; Sun, 14 Jan 2024 22:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IUIRcZn/IiZEvnGnKY654vYdztUTa/Bb7CqNwMK0kFM=; b=UmZpmKbwq5n0ZsUJlOxPwxtKEUn8EOKdwWxIiFbyGpQkZBZX4ah6U1oG1H1eoUnmeG38Er ygJaTwzjhdOq9f5kzuWFBAKVbwnTAtzJe6uRbF1dsv16y7soVE7mud5LlEHws8cncSAZAN jEQhmrnyMcFzQ0cj+GSATbbUtCESjk4ZToEAoQPaszWmcxLO+LknorcQEl8hBm9NHaQul8 NdDM0wmiLvSBWWfcArHjXEqyfik65F0o7IQTg51dpoxWIbIMMSh6Agcvq3Q46D1pXX9D0j z9n0AQ/Yz9zn6tHh+ddFyLExvO7mNeYJl3Yso4hGaqJkvhLodHMCB3e3bykaKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IUIRcZn/IiZEvnGnKY654vYdztUTa/Bb7CqNwMK0kFM=; b=ErPjpbPlfaCd8S4wkcezaVyok/ekmKLuPL479AMpsqRjl7CbNs9EPlS7VOGCHk6cMP9JUf n11by3xZIL7FL4OvGB5PysCIFZ4cSfunHAWs7iEwG9rW4NFcPj+MwBYtM9KGMBvEWiLY+M TfPv7l/k8StrGYgzFgjHDWsSLVdmYWVhFq1kDK8cyOhq33k0CqHvqSrfNkJv6ULlalmCJd TmiD6HydrnofSRaNRDnO1dgSSMKLpFEynklk07qyF2tGeVcpTlBuR6veAEnVM0SFdouJhe MKXNIusEutc11UhwkOlc3UnQE02xv0eBGpK6qM7exxND3MP0fNXb3CT2k8s7WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270075; a=rsa-sha256; cv=none; b=GZDn86ZLqaP2goc7u4cANtOL+k0LkiCqo7OIfhUQGTK0U6GjAKs8UshCCRu8xVke/X9cow oXIWD5ighPZuU4IAde1nqxTLO8laqeJKMMpG3pdjK8gpaC7v7NN4ZcRU9ZI0N+7ySKaIPr wudxBZbH5kcRjrhpRWgdCfKtznAMMk6NTrKIEHOE72lUBotHfMna5Ts1nGrfO/VyOzQmFy ppWdzyRauoaWqWXzI1gRQdX5EQkOqLp9/uQYUESHNMowBrG0TVaHi69mehRWp5iJIDD+bH y2ULU7BNEVJtq1FxuKyn94M6FRcDMbQGOX/JaCuFcLkLcAejTvo7nW7/EZnw3g== 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 4TCqCH3Zc7zX5M; Sun, 14 Jan 2024 22:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7tSO060098; Sun, 14 Jan 2024 22:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7tPf060095; Sun, 14 Jan 2024 22:07:55 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:55 GMT Message-Id: <202401142207.40EM7tPf060095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 6e9bfa8040b5 - stable/13 - ena: Change measurement unit of time since last tx cleanup to ms List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e9bfa8040b59409f6f4d3c963e2221d23487746 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=6e9bfa8040b59409f6f4d3c963e2221d23487746 commit 6e9bfa8040b59409f6f4d3c963e2221d23487746 Author: Arthur Kiyanovski AuthorDate: 2023-06-14 10:12:16 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:22 +0000 ena: Change measurement unit of time since last tx cleanup to ms This commit: 1. Sets the time since last cleanup to milliseconds. 2. Fixes incorrect indentations. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 9272e45c04c0d4fcb5d767e962783f3ab192f64e) --- sys/dev/ena/ena.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 7de87e6f3f4d..8b213b250ec7 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3103,13 +3103,13 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, if (unlikely(time_offset > adapter->missing_tx_timeout)) { if (tx_buf->print_once) { - time_since_last_cleanup = TICKS_2_USEC(ticks - + time_since_last_cleanup = TICKS_2_MSEC(ticks - tx_ring->tx_last_cleanup_ticks); missing_tx_comp_to = sbttoms( adapter->missing_tx_timeout); ena_log(pdev, WARN, "Found a Tx that wasn't completed on time, qid %d, index %d. " - "%d usecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", + "%d msecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", tx_ring->qid, i, time_since_last_cleanup, missing_tx_comp_to); } From nobody Sun Jan 14 22:07:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCK09xvz57FtY; Sun, 14 Jan 2024 22:07: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 4TCqCJ52SFz4KG0; Sun, 14 Jan 2024 22:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIIyODbzoIg8GynyfjrAbV5xqF+FtQ1G/ADGoQFnMAA=; b=MT3nAoojx4w8BXBHzol7s8oGtBprKgrFD5Ub2I9s1BAqHJ92kEgwpuHSqAWAgO/auIi00f dEhVaA/X7LH9Sj5zF37tQgSHqkX5m1w7dCbFLcRPjbFFZtWwj9fmku2OIO9v9c2PwiIij3 +03Tebu6VQeIcsqg+7TIj6G6MCYRskVHkSU9q/3hqhy0/Ig3Vgv3S7wC6VqgmVgbvgt/K8 KFcr6RzKCsNiTDvCeCfcwrQRvDXABecWvoWtWtkKcoPI0aIVRjI953aWVGRPWGeIYOTorQ mtKJpIOJXgmwvG+pgBT2U35Xmguc9M4wadQk1pfVwETVNkCcoiv8hTBjFoQkNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIIyODbzoIg8GynyfjrAbV5xqF+FtQ1G/ADGoQFnMAA=; b=CeGOUshcu6hNhH1y38Uf2MiMgkqduy59tpbIZKtPzxisb1paTwGUYovsza/OwmYZuoucmb U3TrUgfkRQYZSQ4taEX3NetfB1+34hXCYnpcsvUMPS3wiooLzu3MBalYzxbkXn2ZqvukHy 9fwoxDHwXj0erWpdzPyBmdWp5ifF+wInW7wHA7xp+BZ5htbsicq7GXBR4oQ08nDJ+WZ9E4 I4yJuSLS8oihr3mtoFmzZ0JJ2FwSq1URjAEuZDnasOHyGx+WO8oSsoAR30BnY0zp30eB+Q piR3hRMz6CqVWthkch1jvrcybAzYWrEdYaZxBrNgAqhK//SD+xHyZVUBJm/sIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270076; a=rsa-sha256; cv=none; b=T+V+quJG0LCz8MMBurwlLElLDNQ0ZlB5SdNCE/edq8F+uHRqKCGP4xoyX3N8hWO6WPUKbT thoLuDdlN6Pm8ueL/aLMQxkcu69gflI3lmQMMwGH5HhDdKIfomV+xvc5H0B5IL5vOsYpWC LlW3j2vffUnMpaRizux1vCah14NJbUkwzJLoAXKMq558MEYI3ocjx/CSf08N5qHLPxx7LG QPxSXtL/aesiXD93cFE0uSZQzXlKlK1Fbo2RmZvWVBpWNOJZHs5nbBR1T9ueXNtqk3JReh hkWRd6FiugOLyZWI6P1431cTa3gYZ3o0vMDDYHRgFv/yJczs9SREPCU7edlGmA== 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 4TCqCJ47lKzXHL; Sun, 14 Jan 2024 22:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7ucW060140; Sun, 14 Jan 2024 22:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7uXw060137; Sun, 14 Jan 2024 22:07:56 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:56 GMT Message-Id: <202401142207.40EM7uXw060137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 2f7f8526c38d - stable/13 - ena: Update ena_com_update_intr_reg API usage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f7f8526c38db6febb68f66bf9edbf819bc9c8e4 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=2f7f8526c38db6febb68f66bf9edbf819bc9c8e4 commit 2f7f8526c38db6febb68f66bf9edbf819bc9c8e4 Author: Osama Abboud AuthorDate: 2023-09-11 08:38:39 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:22 +0000 ena: Update ena_com_update_intr_reg API usage This commit fixes the usage of this function to be compatible with the new API introduced by ena-com update to v2.7.0 Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 72e34ebdd08854dc896f267b0461e241c4040241) --- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena_datapath.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 8b213b250ec7..f078dbf78060 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2026,7 +2026,7 @@ ena_unmask_all_io_irqs(struct ena_adapter *adapter) for (i = 0; i < adapter->num_io_queues; i++) { ena_qid = ENA_IO_TXQ_IDX(i); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - ena_com_update_intr_reg(&intr_reg, 0, 0, true); + ena_com_update_intr_reg(&intr_reg, 0, 0, true, false); tx_ring = &adapter->tx_ring[i]; counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index f10571f7165b..725a6e82094f 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -104,7 +104,7 @@ ena_cleanup(void *arg, int pending) /* Signal that work is done and unmask interrupt */ ena_com_update_intr_reg(&intr_reg, ENA_RX_IRQ_INTERVAL, - ENA_TX_IRQ_INTERVAL, true); + ENA_TX_IRQ_INTERVAL, true, false); counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); } From nobody Sun Jan 14 22:07:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCL2C6lz57G7N; Sun, 14 Jan 2024 22:07: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 4TCqCK66MHz4KP2; Sun, 14 Jan 2024 22:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzbLhYNSj7Kmtc/AIwPX8kyjeLgQ1teyqHntysN3nP0=; b=HD784maJS0rgELfi2I/s1S4biEI8M4rPW6V5eTZ77scpjjUuI5vgWbxixN6XuGpQix+s3P CXw3Z99h5yQl268lHZo4KmppI7f7ZEa3wO75LnYArqXqUAlDljGrW2Mig+kekIAPfZ4+nz YuqbBCWWGYx2yIXuhVdXSTSrSY51Vb7xwo6WufY7dI4w11OdsVRfApQ6VFAe3pcF9bARIx M89CIfMcBMg58ywQhRMMMTl8ONTQu9LVcz9P2M3k+NXvq6Mp2LutxTI3CZ8GPVbPt34ePU hbU6Ac9WM/Y98BPdjqroAuU9+7Z2zzZ2GL9CptEapIL5zLVGJ22vEBJlTEFOIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzbLhYNSj7Kmtc/AIwPX8kyjeLgQ1teyqHntysN3nP0=; b=n/Pt4esMLsge26fkJOylE3BcWILIg7WqKUT69aDIKV6wWYI01n/8EM98wx3FA0CSZS6gsU YbwTSNK9JxKikiL9/GI4Ap5TEkL30qwO53ix2AILI1+BXVn+0HcLeOSo8Wl5AdDyFoImHB ODNtYXKqZ+a14rNVKr0fAuTj3ehj34NB2pGirZBlaDETH31VTQhBGiwzljhQaDefZVKJNx Y/5MUIsAebdUnqfo8NgouOdl1EIuBNtbZfi7YnFYQ7AYPkfloOri4U2chazNKi8UK6oyro U3XYud/1l0NZPKEa5MSPUlnQw0IR2blUDzRz33564OjHE1TOMMyhbJj0tgjc6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270077; a=rsa-sha256; cv=none; b=RgjrRipLBNP0Plb7+vqj3k5hncKbkYde57+x73ZibyG6qgDWO3jaw3Mr+HU1wGQr1EYOKK ZawZkT3gmEdkeePKkFwNSNWWivyo7lWTxNT/gOxyXxNvO36pX1XBvbVtOkQ9a8krBkEr8F 3PBI6M0XJTmleTalnfxazosofqIjGGsDZWhIg42QgzcPAPQdgNLkIgzs0+S/i8FaaDev7E PVwMYo33btddr7eIUhG5nrzT8xTo/8B2MSC9KaGkp8/098p29bwUR7/YBeIY8NbpokXVjg LbEtHnBpaazQZ45qVZm36WKjoH2V2ON4+3eHlmn+rkXRhghsGzSGYOH/Qsa2ww== 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 4TCqCK59WCzXHM; Sun, 14 Jan 2024 22:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7v4L060192; Sun, 14 Jan 2024 22:07:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7vcN060189; Sun, 14 Jan 2024 22:07:57 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:57 GMT Message-Id: <202401142207.40EM7vcN060189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 026a78a2adb4 - stable/13 - ena: Remove CQ tail pointer update API List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 026a78a2adb461e0f340a5d6f8d7284a0df9da29 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=026a78a2adb461e0f340a5d6f8d7284a0df9da29 commit 026a78a2adb461e0f340a5d6f8d7284a0df9da29 Author: Osama Abboud AuthorDate: 2023-09-11 08:43:08 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Remove CQ tail pointer update API This commit removes the usage of this API from the freebsd driver since the relevant functionality is not supported by the device. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 2835752e075f2fa3edcb596df8306c570ec4cae6) --- sys/dev/ena/ena_datapath.c | 3 --- sys/dev/ena/ena_netmap.c | 1 - 2 files changed, 4 deletions(-) diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 725a6e82094f..7c30177588b4 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -298,7 +298,6 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ena_com_comp_ack( &adapter->ena_dev->io_sq_queues[ena_qid], total_done); - ena_com_update_dev_comp_head(io_cq); total_done = 0; } } while (likely(--budget)); @@ -313,7 +312,6 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_ring->next_to_clean = next_to_clean; ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); - ena_com_update_dev_comp_head(io_cq); } /* @@ -690,7 +688,6 @@ ena_rx_cleanup(struct ena_ring *rx_ring) ENA_RX_REFILL_THRESH_PACKET); if (refill_required > refill_threshold) { - ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); ena_refill_rx_bufs(rx_ring, refill_required); } diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 3990d1bccd75..f7d7e3d367cb 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -814,7 +814,6 @@ ena_netmap_tx_cleanup(struct ena_netmap_ctx *ctx) /* acknowledge completion of sent packets */ ctx->ring->next_to_clean = ctx->nt; ena_com_comp_ack(ctx->ring->ena_com_io_sq, total_tx_descs); - ena_com_update_dev_comp_head(ctx->ring->ena_com_io_cq); } } From nobody Sun Jan 14 22:07:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCM0xCmz57G5Z; Sun, 14 Jan 2024 22:07: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 4TCqCM0LT3z4K7J; Sun, 14 Jan 2024 22:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cwd7+gSmkKNYkp9lesI96GDK/WbMvxQ7n/O5oWFWlIY=; b=N5mBZQ0lXYvg6Cw5gVNjt93cIRZ3Uat1fNkLGskeEW9tF/yYUURSH/wy5KY6a+LsC+XUXR obHIz6A2XdtEhWRLtD5QoMn4ezdtVdrQZ3tDcD2MDG75Sta7BRqSMsCIR5DJ60MW3Eo8n2 E5QzQt4BKyVjMRDJaqRu0UI2PhBpq5bqT/RkNpiqVo0xKNFCVoAfFu7ke0Gq38vJkg+Ua5 PmMgclC5iN+4TPZJV4Rolj9LMz2uKVJXRiSoIuEebyrwy65AL9W3c66iM7fF2Uqk4breAd GTzHR1n4L8QTrnbMKRllQBtMIrIfBn6d9CJO85Hhcv1j8pfA4OpL79Kj+uqtmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cwd7+gSmkKNYkp9lesI96GDK/WbMvxQ7n/O5oWFWlIY=; b=e6oA4Fgmxxvh1vwM0E+xdma3Slv3OgxPyKtqra1G8KXJzgB04puCGCPavoYOT1H24Dlldr 7apEVpvXoKS9148T3izTgXgEhDrXul+cPTmkFrDwJaHkGSDhraDoLCE87BWuTj4ZmyYH4Q +wwbhsPIw3bOuBDfPPII8qorkQLM/+UBgBKSq/WMROd74JljKRLQB84cgnYwxX5O9n4hdN 9tsaBdNZJryudXONjMNOf83/Qxmf5alXEdPabuydjrAEnFtoM/AzRbOxq5C2Wbej8Zpy3r OcOcZemGPKNpZqe6OWXB4Mx5IZxOSpeXO07JhCjyU8mkAsKmyr8J7Uy5OVOPaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270079; a=rsa-sha256; cv=none; b=tqZhtbRbrGrQ1e8+IWZ0fAOYs5/f4PKNKyKkoPZm/2xs+HSCVPU+ir8VATxiK2pn8mKCEf qiIIBE9xzapMDPZypqX65BM2Qxn0f0QiM6++AViN+ZLmbbWwT9pHwgAIH8pkmJGoRLt26T Tl/qfDo4Z8brPjtyp9pQ7bkHmiW1KHqUgtIQhXpbjsyqN4gzxDCQOPJAIROaHbv2oEvEvc 9a3zdfiuB7A+JLuAsP/+4XM5hget4SWu847p/fQG2xVNV9z0w+FZNA06A/EiP0oHKO6Wgj Ic92K5EgZGDh3sb+q1MwK///ol3FVlh4NGfRbMC9bGcMMGtTHpqWQp6jZVCpUA== 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 4TCqCL6V6jzXHN; Sun, 14 Jan 2024 22:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7wM1060243; Sun, 14 Jan 2024 22:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7wAF060240; Sun, 14 Jan 2024 22:07:58 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:58 GMT Message-Id: <202401142207.40EM7wAF060240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: cdf3fb73ae13 - stable/13 - ena: Introduce shared sample interval for all stats List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdf3fb73ae13214b6575f4761478c5be534cbed9 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=cdf3fb73ae13214b6575f4761478c5be534cbed9 commit cdf3fb73ae13214b6575f4761478c5be534cbed9 Author: Osama Abboud AuthorDate: 2023-09-12 10:13:48 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Introduce shared sample interval for all stats Rename sample_interval node to stats_sample_interval and move it up in the sysctl tree to make it clear that it's relevant for all the stats and not only ENI metrics (Currently, sample interval node is found under eni_metrics node). Path to node: dev.ena..stats_sample_interval Once this parameter is set it will set the sample interval for all the stats node including SRD/customer metrics. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 5b925280d9a54eaefd85827bf6e84049aea8fa98) --- sys/dev/ena/ena.c | 12 ++++++------ sys/dev/ena/ena.h | 4 ++-- sys/dev/ena/ena_sysctl.c | 42 +++++++++++++++++++++--------------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index f078dbf78060..4ff1cb624a6a 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3322,19 +3322,19 @@ ena_timer_service(void *data) check_for_empty_rx_ring(adapter); /* - * User controller update of the ENI metrics. + * User controller update of the ENA metrics. * If the delay was set to 0, then the stats shouldn't be updated at * all. - * Otherwise, wait 'eni_metrics_sample_interval' seconds, before + * Otherwise, wait 'metrics_sample_interval' seconds, before * updating stats. * As timer service is executed every second, it's enough to increment * appropriate counter each time the timer service is executed. */ - if ((adapter->eni_metrics_sample_interval != 0) && - (++adapter->eni_metrics_sample_interval_cnt >= - adapter->eni_metrics_sample_interval)) { + if ((adapter->metrics_sample_interval != 0) && + (++adapter->metrics_sample_interval_cnt >= + adapter->metrics_sample_interval)) { taskqueue_enqueue(adapter->metrics_tq, &adapter->metrics_task); - adapter->eni_metrics_sample_interval_cnt = 0; + adapter->metrics_sample_interval_cnt = 0; } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 3687e9b2522e..fd0c6e3692c7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -480,8 +480,8 @@ struct ena_adapter { uint32_t missing_tx_threshold; bool disable_meta_caching; - uint16_t eni_metrics_sample_interval; - uint16_t eni_metrics_sample_interval_cnt; + uint16_t metrics_sample_interval; + uint16_t metrics_sample_interval_cnt; /* Statistics */ struct ena_stats_dev dev_stats; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 6668f9924787..bcf684e9e0ca 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -48,14 +48,14 @@ static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_io_queues_nb(SYSCTL_HANDLER_ARGS); static int ena_sysctl_irq_base_cpu(SYSCTL_HANDLER_ARGS); static int ena_sysctl_irq_cpu_stride(SYSCTL_HANDLER_ARGS); -static int ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_metrics_interval(SYSCTL_HANDLER_ARGS); #ifndef RSS static int ena_sysctl_rss_key(SYSCTL_HANDLER_ARGS); static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #endif -/* Limit max ENI sample rate to be an hour. */ -#define ENI_METRICS_MAX_SAMPLE_INTERVAL 3600 +/* Limit max ENA sample rate to be an hour. */ +#define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, @@ -368,16 +368,6 @@ ena_sysctl_add_eni_metrics(struct ena_adapter *adapter) SYSCTL_ADD_U64(ctx, eni_list, OID_AUTO, "linklocal_allowance_exceeded", CTLFLAG_RD, &eni_metrics->linklocal_allowance_exceeded, 0, "Linklocal packet rate allowance exceeded"); - - /* - * Tuneable, which determines how often ENI metrics will be read. - * 0 means it's turned off. Maximum allowed value is limited by: - * ENI_METRICS_MAX_SAMPLE_INTERVAL. - */ - SYSCTL_ADD_PROC(ctx, eni_list, OID_AUTO, "sample_interval", - CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, - ena_sysctl_eni_metrics_interval, "SU", - "Interval in seconds for updating ENI emetrics. 0 turns off the update."); } static void @@ -411,6 +401,16 @@ ena_sysctl_add_tuneables(struct ena_adapter *adapter) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "io_queues_nb", CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, ena_sysctl_io_queues_nb, "I", "Number of IO queues."); + + /* + * Tuneable, which determines how often ENA metrics will be read. + * 0 means it's turned off. Maximum allowed value is limited by: + * ENA_METRICS_MAX_SAMPLE_INTERVAL. + */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "stats_sample_interval", + CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_MPSAFE, adapter, 0, + ena_sysctl_metrics_interval, "SU", + "Interval in seconds for updating Netword interface metrics. 0 turns off the update."); } /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -694,7 +694,7 @@ unlock: } static int -ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS) +ena_sysctl_metrics_interval(SYSCTL_HANDLER_ARGS) { struct ena_adapter *adapter = arg1; uint16_t interval; @@ -708,32 +708,32 @@ ena_sysctl_eni_metrics_interval(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, sizeof(interval)); if (error == 0) { - interval = adapter->eni_metrics_sample_interval; + interval = adapter->metrics_sample_interval; error = sysctl_handle_16(oidp, &interval, 0, req); } if (error != 0 || req->newptr == NULL) goto unlock; - if (interval > ENI_METRICS_MAX_SAMPLE_INTERVAL) { + if (interval > ENA_METRICS_MAX_SAMPLE_INTERVAL) { ena_log(adapter->pdev, ERR, - "ENI metrics update interval is out of range - maximum allowed value: %d seconds\n", - ENI_METRICS_MAX_SAMPLE_INTERVAL); + "ENA metrics update interval is out of range - maximum allowed value: %d seconds\n", + ENA_METRICS_MAX_SAMPLE_INTERVAL); error = EINVAL; goto unlock; } if (interval == 0) { ena_log(adapter->pdev, INFO, - "ENI metrics update is now turned off\n"); + "ENA metrics update is now turned off\n"); bzero(&adapter->eni_metrics, sizeof(adapter->eni_metrics)); } else { ena_log(adapter->pdev, INFO, - "ENI metrics update interval is set to: %" PRIu16 + "ENA metrics update interval is set to: %" PRIu16 " seconds\n", interval); } - adapter->eni_metrics_sample_interval = interval; + adapter->metrics_sample_interval = interval; unlock: ENA_LOCK_UNLOCK(); From nobody Sun Jan 14 22:07:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCN3CQrz57G7P; Sun, 14 Jan 2024 22:08: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 4TCqCN1K5bz4KDd; Sun, 14 Jan 2024 22:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNBwT7pkz09KND13g0JuiIj83ZuGgTaWgv/KIpHk+Jc=; b=IFQYrInnKL1eMIOXFLsejqU1rjRFtwyxRnYSU7AjDovAIkqQXNOY/jnC9MjI/JsDVyzkK8 c8of4hJUBHuDLYZgbZPcBKBJ/Pet5jEnAAWoUw1daJnoAzRF5l1j5Ube1hJe7vxaZ6BStp BinbcuJfl0Itejg4gapOtNdPQZ9u3pbFpE7y8ik6lTkxnlI6VlYhR7YTJ5GFP4qaVxDru/ KB+shWNahdT1L1uhisCT1Matjrgk4o6j9HhLL1LDm5F+UWIlVPfhGPtbdRWN7nxRZqFyoZ pLZ+fyQ0vyIMJTZE2D6PZmrRgCYJmpW7cXYWTZ4pID/TAbpNwRbC1QzY4WUujw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNBwT7pkz09KND13g0JuiIj83ZuGgTaWgv/KIpHk+Jc=; b=WTfVvd39j3NdVUBoH8GPovr5QOhJbTs4gGBeT5HI7sumXH8OTIr6OMwaaIjIi4vaBbgabk GenStqcYyBTxgw1eLMQXtbx3IgsYwtlYxiTHRn0HsRKlDfrulg5PQ0WV+Cz2BZn+e/CWjU oTXvaUVRV6JUAlliZI5r77Rv7ICF8cJDN6z4apvvGXQNNgcFEDq0mPWsrDrPBjP+lDDoL8 b7Jw800YVdKXRVb8bI9IW28nV21rk56k0PbcCjlhveI85ypFVUUmkdoe2Pvz4dCZlIenT0 qFl4XDpsnjUs1yUHdqPzx7ovaz8LjlT0qeboPMH1RPCYPR/uxFPIoGZhHfkW8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270080; a=rsa-sha256; cv=none; b=PbNJwDpWU7xQyoVLPdZYgemMlb42N1df8TaWrQ+0gvUmAdLlIebDkeub9mrKLumql3DsZj cJgbkSWVDFMpMP2xJ+dUB1joGkYe8hVrs2kP05M0l+umBtCmnms4znc/14Sw8zV52DmxYY 3T5ixt+AJYKIQTw4tYkOGANf3d7FXjs6clRh+LijGXM2h0dvVd63Rebmc0PKZjZlX2edGF dVCBbZXcst5PKWPOePVN0vyNquVmhsnsiBKgW+V/79wfm8MOj2gt9XodasHXgQrkCW/sGk A3F8avNAeGePALUleSO7z32XWzyq1b5c9C6PRBb6sa3eiaiGQ+g4WwX9aDuqVw== 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 4TCqCN0QFvzX3P; Sun, 14 Jan 2024 22:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM7xtO060295; Sun, 14 Jan 2024 22:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM7xrQ060292; Sun, 14 Jan 2024 22:07:59 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:07:59 GMT Message-Id: <202401142207.40EM7xrQ060292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: 86f779a18c0d - stable/13 - ena: Support customer metric with sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 86f779a18c0d6efb722b4763c1fa158626382ba3 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=86f779a18c0d6efb722b4763c1fa158626382ba3 commit 86f779a18c0d6efb722b4763c1fa158626382ba3 Author: Osama Abboud AuthorDate: 2023-09-12 10:17:03 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Support customer metric with sysctl This commit adds sysctl support for customer metrics. Different customer metrics can be found in the following sysctl node: sysctl dev.ena..customer_metrics Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f97993ad7b9c9e4787bd198d11f348c271af513e) --- sys/dev/ena/ena.c | 49 +++++++++++++++++++++++++-- sys/dev/ena/ena.h | 1 + sys/dev/ena/ena_sysctl.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/ena/ena_sysctl.h | 1 + 4 files changed, 135 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 4ff1cb624a6a..72db1a9d99cb 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -166,6 +166,7 @@ static int ena_enable_msix_and_set_admin_interrupts(struct ena_adapter *); static void ena_update_on_link_change(void *, struct ena_admin_aenq_entry *); static void unimplemented_aenq_handler(void *, struct ena_admin_aenq_entry *); static int ena_copy_eni_metrics(struct ena_adapter *); +static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME @@ -3306,6 +3307,25 @@ ena_copy_eni_metrics(struct ena_adapter *adapter) return (rc); } +static int +ena_copy_customer_metrics(struct ena_adapter *adapter) +{ + struct ena_com_dev *dev; + u32 supported_metrics_count; + int rc, len; + + dev = adapter->ena_dev; + + supported_metrics_count = ena_com_get_customer_metric_count(dev); + len = supported_metrics_count * sizeof(u64); + + /* Fill the data buffer */ + rc = ena_com_get_customer_metrics(adapter->ena_dev, + (char *)(adapter->customer_metrics_array), len); + + return (rc); +} + static void ena_timer_service(void *data) { @@ -3543,7 +3563,12 @@ ena_metrics_task(void *arg, int pending) struct ena_adapter *adapter = (struct ena_adapter *)arg; ENA_LOCK_LOCK(); - (void)ena_copy_eni_metrics(adapter); + + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_CUSTOMER_METRICS)) + (void)ena_copy_customer_metrics(adapter); + else if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENI_STATS)) + (void)ena_copy_eni_metrics(adapter); + ENA_LOCK_UNLOCK(); } @@ -3757,6 +3782,18 @@ ena_attach(device_t pdev) /* initialize rings basic information */ ena_init_io_rings(adapter); + rc = ena_com_allocate_customer_metrics_buffer(ena_dev); + if (rc) { + ena_log(pdev, ERR, "Failed to allocate customer metrics buffer.\n"); + goto err_msix_free; + } + + rc = ena_sysctl_allocate_customer_metrics_buffer(adapter); + if (unlikely(rc)){ + ena_log(pdev, ERR, "Failed to allocate sysctl customer metrics buffer.\n"); + goto err_metrics_buffer_destroy; + } + /* Initialize statistics */ ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); @@ -3768,7 +3805,7 @@ ena_attach(device_t pdev) rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); if (unlikely(rc != 0)) { ena_log(pdev, ERR, "Error with network interface setup\n"); - goto err_msix_free; + goto err_customer_metrics_alloc; } /* Initialize reset task queue */ @@ -3806,6 +3843,10 @@ ena_attach(device_t pdev) err_detach: ether_ifdetach(adapter->ifp); #endif /* DEV_NETMAP */ +err_customer_metrics_alloc: + free(adapter->customer_metrics_array, M_DEVBUF); +err_metrics_buffer_destroy: + ena_com_delete_customer_metrics_buffer(ena_dev); err_msix_free: ena_free_stats(adapter); ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); @@ -3904,6 +3945,10 @@ ena_detach(device_t pdev) ena_com_delete_host_info(ena_dev); + free(adapter->customer_metrics_array, M_DEVBUF); + + ena_com_delete_customer_metrics_buffer(ena_dev); + if_free(adapter->ifp); free(ena_dev->bus, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index fd0c6e3692c7..18988d719a18 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -487,6 +487,7 @@ struct ena_adapter { struct ena_stats_dev dev_stats; struct ena_hw_stats hw_stats; struct ena_admin_eni_stats eni_metrics; + uint64_t *customer_metrics_array; enum ena_regs_reset_reason_types reset_reason; }; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index bcf684e9e0ca..edae5c3c23fa 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -37,6 +37,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); +static void ena_sysctl_add_customer_metrics(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -58,6 +59,39 @@ static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) +#define SYSCTL_GSTRING_LEN 64 + +#define ENA_METRIC_ENI_ENTRY(stat, desc) { \ + .name = #stat, \ + .description = #desc, \ +} + +struct ena_hw_metrics { + char name[SYSCTL_GSTRING_LEN]; + char description[SYSCTL_GSTRING_LEN]; +}; + +static const struct ena_hw_metrics ena_hw_stats_strings[] = { + ENA_METRIC_ENI_ENTRY( + bw_in_allowance_exceeded, Inbound BW allowance exceeded), + ENA_METRIC_ENI_ENTRY( + bw_out_allowance_exceeded, Outbound BW allowance exceeded), + ENA_METRIC_ENI_ENTRY( + pps_allowance_exceeded, PPS allowance exceeded), + ENA_METRIC_ENI_ENTRY( + conntrack_allowance_exceeded, Connection tracking allowance exceeded), + ENA_METRIC_ENI_ENTRY( + linklocal_allowance_exceeded, Linklocal packet rate allowance), + ENA_METRIC_ENI_ENTRY( + conntrack_allowance_available, Number of available conntracks), +}; + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif + +#define ENA_CUSTOMER_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_hw_stats_strings) + static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ENA driver parameters"); @@ -98,12 +132,29 @@ SYSCTL_BOOL(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, int ena_rss_table_size = ENA_RX_RSS_TABLE_SIZE; +int ena_sysctl_allocate_customer_metrics_buffer(struct ena_adapter *adapter) +{ + int rc = 0; + + adapter->customer_metrics_array = malloc((sizeof(u64) * ENA_CUSTOMER_METRICS_ARRAY_SIZE), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (unlikely(adapter->customer_metrics_array == NULL)) + rc = ENOMEM; + + return rc; +} void ena_sysctl_add_nodes(struct ena_adapter *adapter) { + struct ena_com_dev *dev = adapter->ena_dev; + + if (ena_com_get_cap(dev, ENA_ADMIN_CUSTOMER_METRICS)) + ena_sysctl_add_customer_metrics(adapter); + else if (ena_com_get_cap(dev, ENA_ADMIN_ENI_STATS)) + ena_sysctl_add_eni_metrics(adapter); + ena_sysctl_add_wd(adapter); ena_sysctl_add_stats(adapter); - ena_sysctl_add_eni_metrics(adapter); ena_sysctl_add_tuneables(adapter); ena_sysctl_add_irq_affinity(adapter); #ifndef RSS @@ -328,6 +379,40 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &admin_stats->no_completion, 0, "Commands not completed"); } +static void +ena_sysctl_add_customer_metrics(struct ena_adapter *adapter) +{ + device_t dev; + struct ena_com_dev *ena_dev; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + struct sysctl_oid *customer_metric; + struct sysctl_oid_list *customer_list; + + int i; + + dev = adapter->pdev; + ena_dev = adapter->ena_dev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + customer_metric = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "customer_metrics", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA's customer metrics"); + customer_list = SYSCTL_CHILDREN(customer_metric); + + for (i = 0; i < ENA_CUSTOMER_METRICS_ARRAY_SIZE; i++) { + if (ena_com_get_customer_metric_support(ena_dev, i)) { + SYSCTL_ADD_U64(ctx, customer_list, OID_AUTO, ena_hw_stats_strings[i].name, + CTLFLAG_RD, &adapter->customer_metrics_array[i], 0, + ena_hw_stats_strings[i].description); + } + } +} + static void ena_sysctl_add_eni_metrics(struct ena_adapter *adapter) { diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index 188c3a61a3d2..e9b4bfaae1cb 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -40,6 +40,7 @@ void ena_sysctl_add_nodes(struct ena_adapter *adapter); void ena_sysctl_update_queue_node_nb(struct ena_adapter *adapter, int old, int new); +int ena_sysctl_allocate_customer_metrics_buffer(struct ena_adapter *adapter); extern int ena_enable_9k_mbufs; #define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) From nobody Sun Jan 14 22:08:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCP4Mgzz57G5d; Sun, 14 Jan 2024 22:08: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 4TCqCP2nGJz4K7p; Sun, 14 Jan 2024 22:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yF/D6jH9qepvFX0gdtie+rbtHm68+ozgPsUvDG3eZxA=; b=skrMELLhZtMas0Hd+rW01ky12Hze2Or6Q3iOMJSrBAEIS+2if9BtE1aMNdhYREsN2RlPB1 dXWxVUQcDbjNMTrPtQcQUirDVWe/ijJy708nzLfoE6Gtx4uPBI1BrUKsbxcIPmhzDLKTtF aQGih88tXQ5ryLspHAAe+aH94EyTdTSqYmlZdGuMBD4rdrxJo522fhbB2PHuq/TcTHYazf J7U60qA3W7H4UmC5VTWBAMGvJLMZx3OWZj3WvbrLqqRZTgfhZGVVYfPNKLKl3KvQhTf78g W3hMU0r8aX2j4FqUh2Y+EZfji6PXFUXt1p0xBAxMGWPeuePpfYnBVw8PdI2cdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yF/D6jH9qepvFX0gdtie+rbtHm68+ozgPsUvDG3eZxA=; b=FO6915uyGR3mqKNRfL8V/LDOZsvziBZ5fHx9mJxzTkhSg+tyTWuH7PUM8EW9a6K6L2Gv9B CKJCrwqSF/HZk2Ag+Kq8idydg+RuPnf3mwAGavjwOibjffocUBoIUnIfgzdSIVSwiSe7OM A4eMLqzUT7vVsH8B3r0izHx3Ka1YrnoHC2Vxrn9R1BhQImSRYOH8+3VfCZI/fGC58qkkRH yH8mCJCNuz1MJRk7LNm2j5yQDWCxiB/n6VFup+3TUv9idvJi7NwyEKvCjlYU7av+OHqM/a jT5IvWBFA4e1W4QsWDnhFllGo3wIsa3j2lFxNb+NXCz3CnOxGk88Bg/vay3mrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270081; a=rsa-sha256; cv=none; b=GQ7SHSN5o42UtcYBEpdRaYaou0u9HyLqwSLL7hhGYlLSlLpKKnXNfI0YZExkzTQDjzHDu9 DmMfKKMdXOlTkNq/Sfa77zmLPjYQFvcoBhyXHR1JtlyJjb2/l5wA5R4P1haXQNbK4fFBqU +LFFe0PpMg7WphNfJRGZqogZKjUoz97MEQtvJbrX0Qj7/9HjrhkAXfZt9KTuvaCt1yWVj1 q//vPIGGe5MIBTTfLP5IuYqDP8XZmvbBewHNEDWpRg8lrtFv+7R/nfwyyy5tBkQyuek+8q WrGh5BIksPh8htNWWhl2clGeiGyzj/BcIcwPYlTw/vX2M3tXIgBWw8t33yJkVQ== 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 4TCqCP1RHLzXB9; Sun, 14 Jan 2024 22:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM81WI060348; Sun, 14 Jan 2024 22:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM81E2060345; Sun, 14 Jan 2024 22:08:01 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:08:01 GMT Message-Id: <202401142208.40EM81E2060345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: be6292777476 - stable/13 - ena: Support srd metrics with sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: be62927774761ff99dda241e6b3e3e0d8b91fb05 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=be62927774761ff99dda241e6b3e3e0d8b91fb05 commit be62927774761ff99dda241e6b3e3e0d8b91fb05 Author: Osama Abboud AuthorDate: 2023-09-12 11:17:45 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Support srd metrics with sysctl This commit introduces SRD metrics through sysctl. The metrics can be queried using the following sysctl node: sysctl dev.ena..ena_srd_info Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 36d42c862f4a5643f6e2395e8d7b7e5c4580499a) --- sys/dev/ena/ena.c | 10 +++++++ sys/dev/ena/ena.h | 1 + sys/dev/ena/ena_sysctl.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 72db1a9d99cb..a61635aa8c80 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -166,6 +166,7 @@ static int ena_enable_msix_and_set_admin_interrupts(struct ena_adapter *); static void ena_update_on_link_change(void *, struct ena_admin_aenq_entry *); static void unimplemented_aenq_handler(void *, struct ena_admin_aenq_entry *); static int ena_copy_eni_metrics(struct ena_adapter *); +static int ena_copy_srd_metrics(struct ena_adapter *); static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); @@ -3307,6 +3308,12 @@ ena_copy_eni_metrics(struct ena_adapter *adapter) return (rc); } +static int +ena_copy_srd_metrics(struct ena_adapter *adapter) +{ + return ena_com_get_ena_srd_info(adapter->ena_dev, &adapter->ena_srd_info); +} + static int ena_copy_customer_metrics(struct ena_adapter *adapter) { @@ -3569,6 +3576,9 @@ ena_metrics_task(void *arg, int pending) else if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENI_STATS)) (void)ena_copy_eni_metrics(adapter); + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENA_SRD_INFO)) + (void)ena_copy_srd_metrics(adapter); + ENA_LOCK_UNLOCK(); } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 18988d719a18..5647fe973502 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -487,6 +487,7 @@ struct ena_adapter { struct ena_stats_dev dev_stats; struct ena_hw_stats hw_stats; struct ena_admin_eni_stats eni_metrics; + struct ena_admin_ena_srd_info ena_srd_info; uint64_t *customer_metrics_array; enum ena_regs_reset_reason_types reset_reason; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index edae5c3c23fa..fd5545dbe5fb 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -38,6 +38,7 @@ static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); static void ena_sysctl_add_eni_metrics(struct ena_adapter *); static void ena_sysctl_add_customer_metrics(struct ena_adapter *); +static void ena_sysctl_add_srd_info(struct ena_adapter *); static void ena_sysctl_add_tuneables(struct ena_adapter *); static void ena_sysctl_add_irq_affinity(struct ena_adapter *); /* Kernel option RSS prevents manipulation of key hash and indirection table. */ @@ -59,18 +60,46 @@ static int ena_sysctl_rss_indir_table(SYSCTL_HANDLER_ARGS); #define ENA_METRICS_MAX_SAMPLE_INTERVAL 3600 #define ENA_HASH_KEY_MSG_SIZE (ENA_HASH_KEY_SIZE * 2 + 1) -#define SYSCTL_GSTRING_LEN 64 +#define SYSCTL_GSTRING_LEN 128 #define ENA_METRIC_ENI_ENTRY(stat, desc) { \ .name = #stat, \ .description = #desc, \ } +#define ENA_STAT_ENTRY(stat, desc, stat_type) { \ + .name = #stat, \ + .description = #desc, \ + .stat_offset = offsetof(struct ena_admin_##stat_type, stat) / sizeof(u64), \ +} + +#define ENA_STAT_ENA_SRD_ENTRY(stat, desc) \ + ENA_STAT_ENTRY(stat, desc, ena_srd_stats) + struct ena_hw_metrics { char name[SYSCTL_GSTRING_LEN]; char description[SYSCTL_GSTRING_LEN]; }; +struct ena_srd_metrics { + char name[SYSCTL_GSTRING_LEN]; + char description[SYSCTL_GSTRING_LEN]; + int stat_offset; +}; + +static const struct ena_srd_metrics ena_srd_stats_strings[] = { + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_tx_pkts, Number of packets transmitted over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_eligible_tx_pkts, Number of packets transmitted or could + have been transmitted over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_rx_pkts, Number of packets received over ENA SRD), + ENA_STAT_ENA_SRD_ENTRY( + ena_srd_resource_utilization, Percentage of the ENA SRD resources + that are in use), +}; + static const struct ena_hw_metrics ena_hw_stats_strings[] = { ENA_METRIC_ENI_ENTRY( bw_in_allowance_exceeded, Inbound BW allowance exceeded), @@ -91,6 +120,7 @@ static const struct ena_hw_metrics ena_hw_stats_strings[] = { #endif #define ENA_CUSTOMER_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_hw_stats_strings) +#define ENA_SRD_METRICS_ARRAY_SIZE ARRAY_SIZE(ena_srd_stats_strings) static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ENA driver parameters"); @@ -153,6 +183,9 @@ ena_sysctl_add_nodes(struct ena_adapter *adapter) else if (ena_com_get_cap(dev, ENA_ADMIN_ENI_STATS)) ena_sysctl_add_eni_metrics(adapter); + if (ena_com_get_cap(adapter->ena_dev, ENA_ADMIN_ENA_SRD_INFO)) + ena_sysctl_add_srd_info(adapter); + ena_sysctl_add_wd(adapter); ena_sysctl_add_stats(adapter); ena_sysctl_add_tuneables(adapter); @@ -379,6 +412,47 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &admin_stats->no_completion, 0, "Commands not completed"); } +static void +ena_sysctl_add_srd_info(struct ena_adapter *adapter) +{ + device_t dev; + + struct sysctl_oid *ena_srd_info; + struct sysctl_oid_list *srd_list; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + struct ena_admin_ena_srd_stats *srd_stats_ptr; + struct ena_srd_metrics cur_stat_strings; + + int i; + + dev = adapter->pdev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + ena_srd_info = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "ena_srd_info", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA's SRD information"); + srd_list = SYSCTL_CHILDREN(ena_srd_info); + + SYSCTL_ADD_U64(ctx, srd_list, OID_AUTO, "ena_srd_mode", + CTLFLAG_RD, &adapter->ena_srd_info.flags, 0, + "Describes which ENA-express features are enabled"); + + srd_stats_ptr = &adapter->ena_srd_info.ena_srd_stats; + + for (i = 0 ; i < ENA_SRD_METRICS_ARRAY_SIZE; i++) { + cur_stat_strings = ena_srd_stats_strings[i]; + SYSCTL_ADD_U64(ctx, srd_list, OID_AUTO, cur_stat_strings.name, + CTLFLAG_RD, (u64 *)srd_stats_ptr + cur_stat_strings.stat_offset, + 0, cur_stat_strings.description); + } +} + static void ena_sysctl_add_customer_metrics(struct ena_adapter *adapter) { From nobody Sun Jan 14 22:08:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCQ4XMXz57G7T; Sun, 14 Jan 2024 22:08: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 4TCqCQ3Qclz4KPp; Sun, 14 Jan 2024 22:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zF9SAZ6I++SE4WaWlrtlHEFiX240JpzwDt/3rppIiGI=; b=ZdzedZTH15ZvBq3kSHE8JOvFxgKj2b9Cf7+ohaNSWAyjI1jnEBJL74V9E9cPuj9Oh7AZ6V KlZ/uov1UdyMZxJtNibEN9lA6moGfPINyH/RJ+OkeZbTgtHQkER1XOfz3iXvOkHYXnhi3t lngCTGbcnY8pdFQC9AiG72KUY8rxgbAsBe1CA4+Nlj8fu4tl6zNzehlAzZFU9BXJXvJz5p q1Z4B27B3uUYGjN3CNbjxy3OInkh+c+JYhzYig6cLD+G66cpxBUd5LT15hzz391olu58vh uE8tcdVNTA3ZQtkcQGTJvbkiaeTQpk0+9USbVo+K+c7aEwhpZjm4NzmLFzDLjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zF9SAZ6I++SE4WaWlrtlHEFiX240JpzwDt/3rppIiGI=; b=iCxIz8AkgPRDShSjRcUaeHQjNoqoPvTiNA/d8OsbyJ0NORjp11LfBm0UrYRWMF4/82SH1T E+vCHCgp0ecSqmhwVXep2ZaTzVAipwo9Mj1l2F4vlkMOzwqlDm5wdL8cFaX3V0nfbnZFCl fCTfCD2qMoMMnNGseAJL6/IPfmhBcVIhwOR5nLNUHRfqsmriI5kjoZR+ADL5wePAOmLaR2 Ak2/41VQZxZfaazwbJqGx7dKWsOIzaTlHAI1ek0DWeiibqoHd/3xTYN1x3+/VTkQxzwDr7 ERnhN16N2fZdTNuzI6VG3OyS027Hy4Sty7zclnlWIHIpjUJGEBfyUu4SoxgutQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270082; a=rsa-sha256; cv=none; b=JdLmpdgX7LVrR+KyNR+OvEkySMqZXWbNPs9T24mjIR0WMqyzmsvHKrC3Bek2zOUZWub+54 5pc3Dl1QQr1hm0VLh0w7SQvivbvqB5vl6F3B7euGgZSJKfO+9CDtEE06F6bThp9xy5wi+9 9QD65F7VW7LpLawqZadOIHErtMLX9V89Q6hckf96cUQtTZi2L6+i4A+Tx06d4HcZo8b+7p kqjWYpm/vpw85CzFPzP5Fq7nzpnEE0zS/BqDbI/dQcICcbgU0ECCcZPRihXiAT9fp4gsMI 0xwUTtZky7TZe36+UWNipJOMzmbvcihpdqgZY57gZwmAubhcQzw2k9bm9in6zA== 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 4TCqCQ2XVjzWKf; Sun, 14 Jan 2024 22:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM825E060396; Sun, 14 Jan 2024 22:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM82HW060393; Sun, 14 Jan 2024 22:08:02 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:08:02 GMT Message-Id: <202401142208.40EM82HW060393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: ba2007c083ef - stable/13 - ena: Update the license dating to 2023 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba2007c083ef3e3fdede46072af30b164abbe4b6 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=ba2007c083ef3e3fdede46072af30b164abbe4b6 commit ba2007c083ef3e3fdede46072af30b164abbe4b6 Author: Osama Abboud AuthorDate: 2023-10-23 17:16:38 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Update the license dating to 2023 Some of the files are using outdated linceses. Update the license to be 2023. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 246aa273244e91a30d70997a3be790a29f9eb29c) --- share/man/man4/ena.4 | 2 +- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena.h | 2 +- sys/dev/ena/ena_datapath.c | 2 +- sys/dev/ena/ena_datapath.h | 2 +- sys/dev/ena/ena_netmap.c | 2 +- sys/dev/ena/ena_netmap.h | 2 +- sys/dev/ena/ena_rss.c | 2 +- sys/dev/ena/ena_rss.h | 2 +- sys/dev/ena/ena_sysctl.c | 2 +- sys/dev/ena/ena_sysctl.h | 2 +- sys/modules/ena/Makefile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index d876aa61a1f4..4f3d03745467 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2015-2022 Amazon.com, Inc. or its affiliates. +.\" Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index a61635aa8c80..fd4bca93ad93 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 5647fe973502..2c758d37622f 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 7c30177588b4..f93b5fc6bd48 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.h b/sys/dev/ena/ena_datapath.h index c6166a806c6a..43292b5abbe9 100644 --- a/sys/dev/ena/ena_datapath.h +++ b/sys/dev/ena/ena_datapath.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index f7d7e3d367cb..27e306c5a2ac 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.h b/sys/dev/ena/ena_netmap.h index aa4d0d3d815a..598fcf1f08b2 100644 --- a/sys/dev/ena/ena_netmap.h +++ b/sys/dev/ena/ena_netmap.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c index ce21a0a8950e..d90a7fbb253a 100644 --- a/sys/dev/ena/ena_rss.c +++ b/sys/dev/ena/ena_rss.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.h b/sys/dev/ena/ena_rss.h index 20dc41cc64a4..1c1c89261b35 100644 --- a/sys/dev/ena/ena_rss.h +++ b/sys/dev/ena/ena_rss.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index fd5545dbe5fb..ea651837ebb6 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index e9b4bfaae1cb..4f5834214005 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2021 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/modules/ena/Makefile b/sys/modules/ena/Makefile index 95326888cc6c..f8b71588afa1 100644 --- a/sys/modules/ena/Makefile +++ b/sys/modules/ena/Makefile @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From nobody Sun Jan 14 22:08:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqCR75RDz57G37; Sun, 14 Jan 2024 22:08: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 4TCqCR5YB1z4KNP; Sun, 14 Jan 2024 22:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y2ciTP6FjNncXI90YmSETiBksHG8zv9OxlTnLSTbgtY=; b=pJtwq9tVt7vg0NiIJbJc7CSTtjD5aStyc6xbFFdoJIRZgVGcHE9/3um9cI3CXW9hYsp7i6 l8ByxPGwGSG7FpCxw0QXzXrpxBPvWQ2iIzAIddik7PbovgrcSouPQrQShAotSQmhBUEb3q x+skDzy67hXvefm1qliRkzwTTG+0tiAsmWzdTfaUWBD8kKhXCD6IXPRzI51z51mnuTtqLD UbTELzL2sXhh6JaYX92ccRtRNWlWIFExHaeLSXmsrNstoo1B/GlhJJZs92dQtaAPigRxwQ nbe/bjkIq+6GQ1ilRMx5G9hPIdhIQ3uWy+4P445QYF12pPfcAFCmf2tSz/wy0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705270083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y2ciTP6FjNncXI90YmSETiBksHG8zv9OxlTnLSTbgtY=; b=G7POA20m+q6w2QRA9hjicSLVZ7F9eOY9obIGGoeRlgT0jY+L5FkN6Gjv0XB2+KWG1knPna uZpmw7MnzTIFYLZsCl0Wgd2SIAiaSGoPbYr01wMModEtsst4XaFgal/CACeGkrWugvcx/h 0JfGkvVOeDT+evDVQVWU2bVTt30iK2vfHfW0K0J5YivfUI2lddxoW+lJKA5cI7DnRCFhTS +rv/FILY6p6QXGExPInEMjLM8XvfLJPF1I06/IUEZtCaMLh2/B+HG1J39WLCfwPRRvpBPG 1xY4vFbO6gksjH1opq5VljvZKBAup3+y0iucjMH8nunsiiUovvAx87/hgGFaWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705270083; a=rsa-sha256; cv=none; b=POV5cRLpFgJL2IX9NblB2BA+0CO4bQYwaExEL8MBUkIeTAQyJsJ3d9OpF+81bkK0pWoDya /sez5Rfzdgyr0DwjWE43/K8rmfR0toTuqjgq+XzP9dv+9yxlUXU5p+DmVqIFgR29QVp5ZJ qAHjTItOVk4AnxysMzEw6d411iKlXrdSclhDUK6KcB6W7QSVJ/rP4yhjzdwRM9tYd3qxyy AOwFQMgCymcOGQgTDsVTr/hzWEdl83/HVJDVGRXJR8P13WbzpH1LyZftJVjf6/+mh2tOAE hKkejXaZqHQQ/bIFoXBsiUNgbd/r9j/k4TSCbuuRForqdTa+tqQz5k7P28L3Sw== 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 4TCqCR3cLJzWKg; Sun, 14 Jan 2024 22:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EM83ho060441; Sun, 14 Jan 2024 22:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EM83JL060438; Sun, 14 Jan 2024 22:08:03 GMT (envelope-from git) Date: Sun, 14 Jan 2024 22:08:03 GMT Message-Id: <202401142208.40EM83JL060438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Arthur Kiyanovski Subject: git: c8a0dbcaff3f - stable/13 - ena: Update driver version to v2.7.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8a0dbcaff3f17a94589a957aafdfa3ab5c9d235 Auto-Submitted: auto-generated The branch stable/13 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=c8a0dbcaff3f17a94589a957aafdfa3ab5c9d235 commit c8a0dbcaff3f17a94589a957aafdfa3ab5c9d235 Author: Osama Abboud AuthorDate: 2023-10-30 11:12:24 +0000 Commit: Arthur Kiyanovski CommitDate: 2024-01-14 07:43:23 +0000 ena: Update driver version to v2.7.0 Features: * Introduce customer and SRD metrics through sysctl * Introduce spreading IRQs to CPUs capability using sysctl * Upgrade ena-com to v2.7.0 Bug Fixes: * Remove outdated APIs Minor Changes: * Introduce a shared stats sample interval for all stats Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 4e2688cc762d94b190029f0c5efab9c4bb5521be) --- sys/dev/ena/ena.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 2c758d37622f..3e42568ba8a9 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -38,8 +38,8 @@ #include "ena-com/ena_eth_com.h" #define ENA_DRV_MODULE_VER_MAJOR 2 -#define ENA_DRV_MODULE_VER_MINOR 6 -#define ENA_DRV_MODULE_VER_SUBMINOR 3 +#define ENA_DRV_MODULE_VER_MINOR 7 +#define ENA_DRV_MODULE_VER_SUBMINOR 0 #define ENA_DRV_MODULE_NAME "ena"