From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:17:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96D224C817C; Mon, 11 Jan 2021 01:17: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDbRb3bDxz4XGD; Mon, 11 Jan 2021 01:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E115125F1; Mon, 11 Jan 2021 01:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1HlX7007683; Mon, 11 Jan 2021 01:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1HlbK007682; Mon, 11 Jan 2021 01:17:47 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:17:47 GMT Message-Id: <202101110117.10B1HlbK007682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: ffd9daf078c6 - stable/12 - bsdcat, cpio, tar: derive version string from archive.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ffd9daf078c67fd1b5805447e1ffa2031544d193 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:17:47 -0000 The branch stable/12 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd9daf078c67fd1b5805447e1ffa2031544d193 commit ffd9daf078c67fd1b5805447e1ffa2031544d193 Author: Xin LI AuthorDate: 2020-12-29 21:38:47 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:16:37 +0000 bsdcat,cpio,tar: derive version string from archive.h (cherry picked from commit 2ff66a915526b6509ca57f2046bc7b20b0de8a61) --- usr.bin/bsdcat/Makefile | 3 ++- usr.bin/cpio/Makefile | 3 ++- usr.bin/tar/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/bsdcat/Makefile b/usr.bin/bsdcat/Makefile index b9ce457a57f6..2e625cf553e5 100644 --- a/usr.bin/bsdcat/Makefile +++ b/usr.bin/bsdcat/Makefile @@ -6,7 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.5.0 +BSDCAT_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile index d3dcb040a902..078963798afa 100644 --- a/usr.bin/cpio/Makefile +++ b/usr.bin/cpio/Makefile @@ -6,7 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.5.0 +BSDCPIO_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 09ad12ee3fa1..8b9b31169e72 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -4,7 +4,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.5.0 +BSDTAR_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:19:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10BB04C86BB; Mon, 11 Jan 2021 01:19: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDbV601Qrz4XgY; Mon, 11 Jan 2021 01:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8189124AD; Mon, 11 Jan 2021 01:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1Jvm1008119; Mon, 11 Jan 2021 01:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1Jv3H008118; Mon, 11 Jan 2021 01:19:57 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:19:57 GMT Message-Id: <202101110119.10B1Jv3H008118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 7e3d37d73d38 - stable/11 - bsdcat, cpio, tar: derive version string from archive.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 7e3d37d73d382c6d36e4dcb36de79ac3f233be3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:19:58 -0000 The branch stable/11 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=7e3d37d73d382c6d36e4dcb36de79ac3f233be3e commit 7e3d37d73d382c6d36e4dcb36de79ac3f233be3e Author: Xin LI AuthorDate: 2020-12-29 21:38:47 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:19:25 +0000 bsdcat,cpio,tar: derive version string from archive.h (cherry picked from commit 2ff66a915526b6509ca57f2046bc7b20b0de8a61) --- usr.bin/bsdcat/Makefile | 3 ++- usr.bin/cpio/Makefile | 3 ++- usr.bin/tar/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/bsdcat/Makefile b/usr.bin/bsdcat/Makefile index 92ad8502c62e..2e13d108c45b 100644 --- a/usr.bin/bsdcat/Makefile +++ b/usr.bin/bsdcat/Makefile @@ -6,7 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.5.0 +BSDCAT_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile index b5d53d14ee22..50d93c28aac0 100644 --- a/usr.bin/cpio/Makefile +++ b/usr.bin/cpio/Makefile @@ -6,7 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.5.0 +BSDCPIO_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index c2c89652a87d..1e5cbc36015d 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -4,7 +4,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.5.0 +BSDTAR_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:22:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 247774C86AD; Mon, 11 Jan 2021 01:22: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDbXt0Zt9z4YFR; Mon, 11 Jan 2021 01:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06DEB121F2; Mon, 11 Jan 2021 01:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1MLh3019903; Mon, 11 Jan 2021 01:22:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1ML2m019902; Mon, 11 Jan 2021 01:22:21 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:22:21 GMT Message-Id: <202101110122.10B1ML2m019902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 65ca6e859780 - stable/10 - bsdcat, cpio, tar: derive version string from archive.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/10 X-Git-Reftype: branch X-Git-Commit: 65ca6e859780da7c483ac4f811f599248c5c45c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:22:22 -0000 The branch stable/10 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=65ca6e859780da7c483ac4f811f599248c5c45c5 commit 65ca6e859780da7c483ac4f811f599248c5c45c5 Author: Xin LI AuthorDate: 2020-12-29 21:38:47 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:22:02 +0000 bsdcat,cpio,tar: derive version string from archive.h (cherry picked from commit 2ff66a915526b6509ca57f2046bc7b20b0de8a61) --- usr.bin/bsdcat/Makefile | 3 ++- usr.bin/cpio/Makefile | 3 ++- usr.bin/tar/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/bsdcat/Makefile b/usr.bin/bsdcat/Makefile index 992874f9eac4..c2864b7e7aba 100644 --- a/usr.bin/bsdcat/Makefile +++ b/usr.bin/bsdcat/Makefile @@ -6,7 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.5.0 +BSDCAT_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile index 12211978fe83..ab2e6b74a897 100644 --- a/usr.bin/cpio/Makefile +++ b/usr.bin/cpio/Makefile @@ -6,7 +6,8 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.5.0 +BSDCPIO_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 78b74cb8455a..89f42289d88b 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -4,7 +4,8 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.5.0 +BSDTAR_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h .PATH: ${LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:26:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBA6C4C8C55; Mon, 11 Jan 2021 01:26: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDbdd4kTCz4Y0b; Mon, 11 Jan 2021 01:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90D4912815; Mon, 11 Jan 2021 01:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1QTVp020651; Mon, 11 Jan 2021 01:26:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1QTCk020650; Mon, 11 Jan 2021 01:26:29 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:26:29 GMT Message-Id: <202101110126.10B1QTCk020650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 060bec6624fb - stable/12 - contrib/libarchive: Import libarchive 3.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 060bec6624fb36120f21bb2c5db5e4e97f7cf38e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:26:29 -0000 The branch stable/12 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=060bec6624fb36120f21bb2c5db5e4e97f7cf38e commit 060bec6624fb36120f21bb2c5db5e4e97f7cf38e Author: Martin Matuska AuthorDate: 2020-12-27 23:34:06 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:25:32 +0000 contrib/libarchive: Import libarchive 3.5.1 (cherry picked from commit 69a18c5826c9633a6d77e18f9f34e02c83d22717) --- contrib/libarchive/NEWS | 2 ++ contrib/libarchive/libarchive/archive.h | 4 ++-- contrib/libarchive/libarchive/archive_entry.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 598cf75166b1..47cebdd4b9b7 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Dec 26, 2020: libarchive 3.5.1 released + Dec 01, 2020: libarchive 3.5.0 released Oct 14, 2020: Support for system extended attributes diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 7e55a926c740..55f0fad15730 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.5.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.5.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index 4b6cc257a63a..a1b9fe43fe22 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 /* * Note: archive_entry.h is for use outside of libarchive; the From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:29:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90B214C8C69; Mon, 11 Jan 2021 01:29: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDbhZ3gvVz4Y8K; Mon, 11 Jan 2021 01:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629F812079; Mon, 11 Jan 2021 01:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1T2SB021128; Mon, 11 Jan 2021 01:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1T2un021127; Mon, 11 Jan 2021 01:29:02 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:29:02 GMT Message-Id: <202101110129.10B1T2un021127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: a52a83deed5b - stable/11 - contrib/libarchive: Import libarchive 3.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: a52a83deed5b769a14e4a01f6859887eb1f245c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:29:02 -0000 The branch stable/11 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=a52a83deed5b769a14e4a01f6859887eb1f245c9 commit a52a83deed5b769a14e4a01f6859887eb1f245c9 Author: Martin Matuska AuthorDate: 2020-12-27 23:34:06 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:28:43 +0000 contrib/libarchive: Import libarchive 3.5.1 (cherry picked from commit 69a18c5826c9633a6d77e18f9f34e02c83d22717) --- contrib/libarchive/NEWS | 2 ++ contrib/libarchive/libarchive/archive.h | 4 ++-- contrib/libarchive/libarchive/archive_entry.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 598cf75166b1..47cebdd4b9b7 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Dec 26, 2020: libarchive 3.5.1 released + Dec 01, 2020: libarchive 3.5.0 released Oct 14, 2020: Support for system extended attributes diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 7e55a926c740..55f0fad15730 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.5.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.5.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index 4b6cc257a63a..a1b9fe43fe22 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 /* * Note: archive_entry.h is for use outside of libarchive; the From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 01:42:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96AF14C967B; Mon, 11 Jan 2021 01:42: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDc0Q3t3Sz4ZCl; Mon, 11 Jan 2021 01:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77B7212855; Mon, 11 Jan 2021 01:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10B1gkRd046382; Mon, 11 Jan 2021 01:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10B1gkxm046381; Mon, 11 Jan 2021 01:42:46 GMT (envelope-from git) Date: Mon, 11 Jan 2021 01:42:46 GMT Message-Id: <202101110142.10B1gkxm046381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 5f80b1e0ae5a - stable/10 - contrib/libarchive: Import libarchive 3.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/10 X-Git-Reftype: branch X-Git-Commit: 5f80b1e0ae5a78a18482d01f0b68622354ba35df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 01:42:46 -0000 The branch stable/10 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=5f80b1e0ae5a78a18482d01f0b68622354ba35df commit 5f80b1e0ae5a78a18482d01f0b68622354ba35df Author: Martin Matuska AuthorDate: 2020-12-27 23:34:06 +0000 Commit: Martin Matuska CommitDate: 2021-01-11 01:34:58 +0000 contrib/libarchive: Import libarchive 3.5.1 (cherry picked from commit 69a18c5826c9633a6d77e18f9f34e02c83d22717) --- contrib/libarchive/NEWS | 2 ++ contrib/libarchive/libarchive/archive.h | 4 ++-- contrib/libarchive/libarchive/archive_entry.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 598cf75166b1..47cebdd4b9b7 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Dec 26, 2020: libarchive 3.5.1 released + Dec 01, 2020: libarchive 3.5.0 released Oct 14, 2020: Support for system extended attributes diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 7e55a926c740..55f0fad15730 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.5.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.5.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index 4b6cc257a63a..a1b9fe43fe22 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3005000 +#define ARCHIVE_VERSION_NUMBER 3005001 /* * Note: archive_entry.h is for use outside of libarchive; the From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 14:53:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8340D4DBCB2; Mon, 11 Jan 2021 14: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDxYL3Hm4z3nsg; Mon, 11 Jan 2021 14:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63CF01C25A; Mon, 11 Jan 2021 14:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BErwDx073695; Mon, 11 Jan 2021 14:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BErw5s073694; Mon, 11 Jan 2021 14:53:58 GMT (envelope-from git) Date: Mon, 11 Jan 2021 14:53:58 GMT Message-Id: <202101111453.10BErw5s073694@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: 44851ff2f65d - stable/12 - igmp: Avoid leaking mbuf when source validation fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 44851ff2f65de3bdf3b3fa469a7bb5546e77e170 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 14:53:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=44851ff2f65de3bdf3b3fa469a7bb5546e77e170 commit 44851ff2f65de3bdf3b3fa469a7bb5546e77e170 Author: Mark Johnston AuthorDate: 2021-01-08 18:32:04 +0000 Commit: Mark Johnston CommitDate: 2021-01-11 14:41:55 +0000 igmp: Avoid leaking mbuf when source validation fails PR: 252504 Submitted by: Panagiotis Tsolakos (cherry picked from commit 501159696cb5204d94d03393e4bc5d82f2e348e6) --- sys/netinet/igmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 6f35f8156d23..a68a5a1ca9dd 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1533,6 +1533,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto) if (nsrc * sizeof(in_addr_t) > UINT16_MAX - iphlen - IGMP_V3_QUERY_MINLEN) { IGMPSTAT_INC(igps_rcv_tooshort); + m_freem(m); return (IPPROTO_DONE); } /* From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 14:53:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A706C4DBE97; Mon, 11 Jan 2021 14:53: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDxYM4K1gz3nwD; Mon, 11 Jan 2021 14:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8769A1C800; Mon, 11 Jan 2021 14:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BErx4Y073716; Mon, 11 Jan 2021 14:53:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BErxde073715; Mon, 11 Jan 2021 14:53:59 GMT (envelope-from git) Date: Mon, 11 Jan 2021 14:53:59 GMT Message-Id: <202101111453.10BErxde073715@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: a0d7f3d90046 - stable/12 - safexcel: Stop using a stack buffer for the ring lock name 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/12 X-Git-Reftype: branch X-Git-Commit: a0d7f3d9004675b0da39745a0e17747a8d55beb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 14:53:59 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a0d7f3d9004675b0da39745a0e17747a8d55beb4 commit a0d7f3d9004675b0da39745a0e17747a8d55beb4 Author: Mark Johnston AuthorDate: 2021-01-08 18:32:04 +0000 Commit: Mark Johnston CommitDate: 2021-01-11 14:42:15 +0000 safexcel: Stop using a stack buffer for the ring lock name mtx_init() does not make a copy of the name so the buffer must be valid for the lifetime of the driver instance. Store each ring's lock's name in the ring structure. (cherry picked from commit 8ba6acbbe6995efcd12c375e1826d55e35a8bdc9) --- sys/dev/safexcel/safexcel.c | 6 +++--- sys/dev/safexcel/safexcel_var.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 9762a20e7c4d..079e9653bfb1 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -783,15 +783,15 @@ safexcel_init_rings(struct safexcel_softc *sc) { struct safexcel_cmd_descr *cdesc; struct safexcel_ring *ring; - char buf[32]; uint64_t atok; int i, j; for (i = 0; i < sc->sc_config.rings; i++) { ring = &sc->sc_ring[i]; - snprintf(buf, sizeof(buf), "safexcel_ring%d", i); - mtx_init(&ring->mtx, buf, NULL, MTX_DEF); + snprintf(ring->lockname, sizeof(ring->lockname), + "safexcel_ring%d", i); + mtx_init(&ring->mtx, ring->lockname, NULL, MTX_DEF); STAILQ_INIT(&ring->free_requests); STAILQ_INIT(&ring->ready_requests); STAILQ_INIT(&ring->queued_requests); diff --git a/sys/dev/safexcel/safexcel_var.h b/sys/dev/safexcel/safexcel_var.h index 4c6b9b73642a..b35ea8cead7b 100644 --- a/sys/dev/safexcel/safexcel_var.h +++ b/sys/dev/safexcel/safexcel_var.h @@ -392,6 +392,8 @@ struct safexcel_ring { struct safexcel_dma_mem dma_atok; bus_dma_tag_t data_dtag; + + char lockname[32]; }; struct safexcel_intr_handle { From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 14:54:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78FB84DBCBC; Mon, 11 Jan 2021 14: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDxYN60J6z3nwH; Mon, 11 Jan 2021 14:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A56191C529; Mon, 11 Jan 2021 14:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BEs0e9073738; Mon, 11 Jan 2021 14:54:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BEs00Y073737; Mon, 11 Jan 2021 14:54:00 GMT (envelope-from git) Date: Mon, 11 Jan 2021 14:54:00 GMT Message-Id: <202101111454.10BEs00Y073737@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: e222e1ff8909 - stable/12 - safexcel: Fix a race around unblocking of crypto ops 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/12 X-Git-Reftype: branch X-Git-Commit: e222e1ff890957ba6c62dfd2d2bf4cb22f87997a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 14:54:01 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e222e1ff890957ba6c62dfd2d2bf4cb22f87997a commit e222e1ff890957ba6c62dfd2d2bf4cb22f87997a Author: Mark Johnston AuthorDate: 2021-01-08 18:32:04 +0000 Commit: Mark Johnston CommitDate: 2021-01-11 14:43:00 +0000 safexcel: Fix a race around unblocking of crypto ops safexcel_ring_intr() could fail to observed that sc_blocked is set after completing all outstanding ops for a ring, in which case blocked ops would be deferred forever. Request structures are managed by individual rings, so move the "blocked" flag into the per-ring state block and use the ring lock to synchronize with safexcel_process(). Remove sc_mtx since it is now unused. (cherry picked from commit 092cf8d63f9fb9153c677f5793135926edc101d7) --- sys/dev/safexcel/safexcel.c | 27 +++++++++------------------ sys/dev/safexcel/safexcel_var.h | 4 ++-- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 079e9653bfb1..c1736fc5f080 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -160,8 +160,9 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) struct safexcel_res_descr *rdesc; struct safexcel_request *req; struct safexcel_ring *ring; - uint32_t error, i, ncdescs, nrdescs, nreqs; + uint32_t blocked, error, i, ncdescs, nrdescs, nreqs; + blocked = 0; ring = &sc->sc_ring[ringidx]; mtx_lock(&ring->mtx); @@ -231,6 +232,8 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_PROC_COUNT, SAFEXCEL_xDR_PROC_xD_PKT(nreqs) | (sc->sc_config.rd_offset * nrdescs * sizeof(uint32_t))); + blocked = ring->blocked; + ring->blocked = 0; } out: if (!STAILQ_EMPTY(&ring->queued_requests)) { @@ -239,6 +242,9 @@ out: SAFEXCEL_HIA_CDR_THRESH_PKT_MODE | 1); } mtx_unlock(&ring->mtx); + + if (blocked) + crypto_unblock(sc->sc_cid, blocked); } static void @@ -248,7 +254,7 @@ safexcel_ring_intr(void *arg) struct safexcel_intr_handle *ih; uint32_t status, stat; int ring; - bool blocked, rdrpending; + bool rdrpending; ih = arg; sc = ih->sc; @@ -281,14 +287,6 @@ safexcel_ring_intr(void *arg) if (rdrpending) safexcel_rdr_intr(sc, ring); - - mtx_lock(&sc->sc_mtx); - blocked = sc->sc_blocked; - sc->sc_blocked = 0; - mtx_unlock(&sc->sc_mtx); - - if (blocked) - crypto_unblock(sc->sc_cid, blocked); } static int @@ -1100,8 +1098,6 @@ safexcel_alloc_dev_resources(struct safexcel_softc *sc) goto out; } - mtx_init(&sc->sc_mtx, "safexcel softc", NULL, MTX_DEF); - return (0); out: @@ -1118,8 +1114,6 @@ safexcel_free_dev_resources(struct safexcel_softc *sc) { int i; - mtx_destroy(&sc->sc_mtx); - for (i = 0; i < SAFEXCEL_MAX_RINGS && sc->sc_intr[i] != NULL; i++) bus_release_resource(sc->sc_dev, SYS_RES_IRQ, rman_get_rid(sc->sc_intr[i]), sc->sc_intr[i]); @@ -1163,7 +1157,6 @@ safexcel_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_blocked = 0; sc->sc_cid = -1; if (safexcel_alloc_dev_resources(sc)) @@ -2666,10 +2659,8 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) mtx_lock(&ring->mtx); req = safexcel_alloc_request(sc, ring); if (__predict_false(req == NULL)) { - mtx_lock(&sc->sc_mtx); + ring->blocked = CRYPTO_SYMQ; mtx_unlock(&ring->mtx); - sc->sc_blocked = CRYPTO_SYMQ; - mtx_unlock(&sc->sc_mtx); return (ERESTART); } diff --git a/sys/dev/safexcel/safexcel_var.h b/sys/dev/safexcel/safexcel_var.h index b35ea8cead7b..3ced5055545a 100644 --- a/sys/dev/safexcel/safexcel_var.h +++ b/sys/dev/safexcel/safexcel_var.h @@ -385,6 +385,8 @@ struct safexcel_ring { struct sglist *res_data; struct safexcel_res_descr_ring rdr; + int blocked; + struct safexcel_request *requests; STAILQ_HEAD(, safexcel_request) ready_requests; STAILQ_HEAD(, safexcel_request) queued_requests; @@ -413,9 +415,7 @@ struct safexcel_softc { struct safexcel_ring sc_ring[SAFEXCEL_MAX_RINGS]; int sc_ringidx; - struct mtx sc_mtx; - int sc_blocked; int32_t sc_cid; struct safexcel_reg_offsets sc_offsets; struct safexcel_config sc_config; From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 14:54:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6CB54DBCCC; Mon, 11 Jan 2021 14:54: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDxYQ0D3tz3nnN; Mon, 11 Jan 2021 14:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D80711C7BB; Mon, 11 Jan 2021 14:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BEs1Ke073756; Mon, 11 Jan 2021 14:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BEs121073755; Mon, 11 Jan 2021 14:54:01 GMT (envelope-from git) Date: Mon, 11 Jan 2021 14:54:01 GMT Message-Id: <202101111454.10BEs121073755@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: ee01a1e7d862 - stable/12 - mpr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl 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/12 X-Git-Reftype: branch X-Git-Commit: ee01a1e7d862a5a33b43b8ae9da220d83f089c21 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 14:54:05 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ee01a1e7d862a5a33b43b8ae9da220d83f089c21 commit ee01a1e7d862a5a33b43b8ae9da220d83f089c21 Author: Mark Johnston AuthorDate: 2021-01-08 18:32:05 +0000 Commit: Mark Johnston CommitDate: 2021-01-11 14:43:17 +0000 mpr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl The device mapping table contains sc->max_devices entries, so only indices in [0, sc->max_devices) are valid. Differential Revision: https://reviews.freebsd.org/D27964 (cherry picked from commit adc0dcc352bb9f5a67a054d95c6959ea5aa26d91) --- sys/dev/mpr/mpr_user.c | 2 +- sys/dev/mps/mps_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c index 9bcc7f78da0f..1b2aa398b22b 100644 --- a/sys/dev/mpr/mpr_user.c +++ b/sys/dev/mpr/mpr_user.c @@ -2232,7 +2232,7 @@ mpr_user_btdh(struct mpr_softc *sc, mpr_btdh_mapping_t *data) if (bus != 0) return (EINVAL); - if (target > sc->max_devices) { + if (target >= sc->max_devices) { mpr_dprint(sc, MPR_XINFO, "Target ID is out of range " "for Bus/Target to DevHandle mapping."); return (EINVAL); diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c index 15ae463a1ad1..af1526c36d4c 100644 --- a/sys/dev/mps/mps_user.c +++ b/sys/dev/mps/mps_user.c @@ -2135,7 +2135,7 @@ mps_user_btdh(struct mps_softc *sc, mps_btdh_mapping_t *data) if (bus != 0) return (EINVAL); - if (target > sc->max_devices) { + if (target >= sc->max_devices) { mps_dprint(sc, MPS_FAULT, "Target ID is out of range " "for Bus/Target to DevHandle mapping."); return (EINVAL); From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 14:54:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06BF94DBB62; Mon, 11 Jan 2021 14:54: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDxYS4S6pz3nnc; Mon, 11 Jan 2021 14:54:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E7121C3B7; Mon, 11 Jan 2021 14:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BEs2GG073778; Mon, 11 Jan 2021 14:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BEs2VB073777; Mon, 11 Jan 2021 14:54:02 GMT (envelope-from git) Date: Mon, 11 Jan 2021 14:54:02 GMT Message-Id: <202101111454.10BEs2VB073777@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: ed6fa9d618bf - stable/12 - mpr, mps: Fix a stack buffer overflow in the user passthru ioctl 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/12 X-Git-Reftype: branch X-Git-Commit: ed6fa9d618bff47dcd3fb000e5805e29d331578d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 14:54:06 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ed6fa9d618bff47dcd3fb000e5805e29d331578d commit ed6fa9d618bff47dcd3fb000e5805e29d331578d Author: Mark Johnston AuthorDate: 2021-01-08 18:32:04 +0000 Commit: Mark Johnston CommitDate: 2021-01-11 14:43:37 +0000 mpr, mps: Fix a stack buffer overflow in the user passthru ioctl Previously we copied in the request into a stack-allocated structure that could be smaller than the request size. Furthermore, we checked the request size only after doing the copyin. Fix this by allocating a buffer to hold the request, then copying the buffer's contents into a command descriptor. This is a bit heavy-handed but I expect the overhead will not be noticeable. The approach of coping the header in first is susceptible to TOCTOU problems. Reviewed by: imp Reported by: maxpl0it@protonmail.com Differential Revision: https://reviews.freebsd.org/D27963 (cherry picked from commit de828a91db29fb20440e0d92f3d3136b314a9584) --- sys/dev/mpr/mpr_user.c | 30 +++++++++++++++--------------- sys/dev/mps/mps_user.c | 32 ++++++++++++++++---------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c index 1b2aa398b22b..3995d01154f7 100644 --- a/sys/dev/mpr/mpr_user.c +++ b/sys/dev/mpr/mpr_user.c @@ -737,11 +737,12 @@ RetFree: static int mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) { - MPI2_REQUEST_HEADER *hdr, tmphdr; + MPI2_REQUEST_HEADER *hdr, *tmphdr; MPI2_DEFAULT_REPLY *rpl; Mpi26NVMeEncapsulatedErrorReply_t *nvme_error_reply = NULL; Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL; struct mpr_command *cm = NULL; + void *req = NULL; int i, err = 0, dir = 0, sz; uint8_t tool, function = 0; u_int sense_len; @@ -793,22 +794,21 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) data->ReplySize, data->PtrData, data->DataSize, data->PtrDataOut, data->DataOutSize, data->DataDirection); - /* - * copy in the header so we know what we're dealing with before we - * commit to allocating a command for it. - */ - err = copyin(PTRIN(data->PtrRequest), &tmphdr, data->RequestSize); - if (err != 0) - goto RetFreeUnlocked; - - if (data->RequestSize > (int)sc->reqframesz) { + if (data->RequestSize > sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } - function = tmphdr.Function; + req = malloc(data->RequestSize, M_MPRUSER, M_WAITOK | M_ZERO); + tmphdr = (MPI2_REQUEST_HEADER *)req; + + err = copyin(PTRIN(data->PtrRequest), req, data->RequestSize); + if (err != 0) + goto RetFreeUnlocked; + + function = tmphdr->Function; mpr_dprint(sc, MPR_USER, "%s: Function %02X MsgFlags %02X\n", __func__, - function, tmphdr.MsgFlags); + function, tmphdr->MsgFlags); /* * Handle a passthru TM request. @@ -825,7 +825,7 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) /* Copy the header in. Only a small fixup is needed. */ task = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; - bcopy(&tmphdr, task, data->RequestSize); + memcpy(task, req, data->RequestSize); task->TaskMID = cm->cm_desc.Default.SMID; cm->cm_data = NULL; @@ -872,7 +872,6 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) mpr_lock(sc); cm = mpr_alloc_command(sc); - if (cm == NULL) { mpr_printf(sc, "%s: no mpr requests\n", __func__); err = ENOMEM; @@ -881,7 +880,7 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) mpr_unlock(sc); hdr = (MPI2_REQUEST_HEADER *)cm->cm_req; - bcopy(&tmphdr, hdr, data->RequestSize); + memcpy(hdr, req, data->RequestSize); /* * Do some checking to make sure the IOCTL request contains a valid @@ -1154,6 +1153,7 @@ RetFree: Ret: sc->mpr_flags &= ~MPR_FLAGS_BUSY; mpr_unlock(sc); + free(req, M_MPRUSER); return (err); } diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c index af1526c36d4c..ab4d1d2d86f3 100644 --- a/sys/dev/mps/mps_user.c +++ b/sys/dev/mps/mps_user.c @@ -677,7 +677,7 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) mps_dprint(sc, MPS_USER, "%s: req %p %d rpl %p %d\n", __func__, cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); - if (cmd->req_len > (int)sc->reqframesz) { + if (cmd->req_len > sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } @@ -750,9 +750,10 @@ RetFree: static int mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) { - MPI2_REQUEST_HEADER *hdr, tmphdr; + MPI2_REQUEST_HEADER *hdr, *tmphdr; MPI2_DEFAULT_REPLY *rpl = NULL; struct mps_command *cm = NULL; + void *req = NULL; int err = 0, dir = 0, sz; uint8_t function = 0; u_int sense_len; @@ -804,22 +805,21 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) data->ReplySize, data->PtrData, data->DataSize, data->PtrDataOut, data->DataOutSize, data->DataDirection); - /* - * copy in the header so we know what we're dealing with before we - * commit to allocating a command for it. - */ - err = copyin(PTRIN(data->PtrRequest), &tmphdr, data->RequestSize); - if (err != 0) - goto RetFreeUnlocked; - - if (data->RequestSize > (int)sc->reqframesz) { + if (data->RequestSize > sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } - function = tmphdr.Function; + req = malloc(data->RequestSize, M_MPSUSER, M_WAITOK | M_ZERO); + tmphdr = (MPI2_REQUEST_HEADER *)req; + + err = copyin(PTRIN(data->PtrRequest), req, data->RequestSize); + if (err != 0) + goto RetFreeUnlocked; + + function = tmphdr->Function; mps_dprint(sc, MPS_USER, "%s: Function %02X MsgFlags %02X\n", __func__, - function, tmphdr.MsgFlags); + function, tmphdr->MsgFlags); /* * Handle a passthru TM request. @@ -836,7 +836,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) /* Copy the header in. Only a small fixup is needed. */ task = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; - bcopy(&tmphdr, task, data->RequestSize); + memcpy(task, req, data->RequestSize); task->TaskMID = cm->cm_desc.Default.SMID; cm->cm_data = NULL; @@ -883,7 +883,6 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) mps_lock(sc); cm = mps_alloc_command(sc); - if (cm == NULL) { mps_printf(sc, "%s: no mps requests\n", __func__); err = ENOMEM; @@ -892,7 +891,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) mps_unlock(sc); hdr = (MPI2_REQUEST_HEADER *)cm->cm_req; - bcopy(&tmphdr, hdr, data->RequestSize); + memcpy(hdr, req, data->RequestSize); /* * Do some checking to make sure the IOCTL request contains a valid @@ -1059,6 +1058,7 @@ RetFreeUnlocked: Ret: sc->mps_flags &= ~MPS_FLAGS_BUSY; mps_unlock(sc); + free(req, M_MPSUSER); return (err); } From owner-dev-commits-src-branches@freebsd.org Mon Jan 11 21:14:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 254764E6578; Mon, 11 Jan 2021 21:14: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF60j0WtKz4trY; Mon, 11 Jan 2021 21:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 009AD21615; Mon, 11 Jan 2021 21:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10BLEiCW067125; Mon, 11 Jan 2021 21:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10BLEitJ067124; Mon, 11 Jan 2021 21:14:44 GMT (envelope-from git) Date: Mon, 11 Jan 2021 21:14:44 GMT Message-Id: <202101112114.10BLEitJ067124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 0a09fd56501c - stable/12 - geom(8): list geoms with /dev/ prefix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a09fd56501c2508c9d2797302544d55112d767f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 21:14:45 -0000 The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=0a09fd56501c2508c9d2797302544d55112d767f commit 0a09fd56501c2508c9d2797302544d55112d767f Author: Robert Wing AuthorDate: 2020-12-12 07:22:38 +0000 Commit: Robert Wing CommitDate: 2021-01-11 20:54:22 +0000 geom(8): list geoms with /dev/ prefix Allow geom(8) to list geoms with the '/dev/' prefix. `geom part show` accepts the '/dev/' prefix but `geom part list` does not. Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior of find_geom() in lib/geom/part/geom_part.c. PR: 188213 Reported by: Ronald F. Guilmette Reviewed by: imp, kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D27556 (cherry picked from commit f200cc255f8e90b1905d94d0506a22f5dcd467c0) --- sbin/geom/core/geom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index e6d6d789908f..58b33a067700 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -862,6 +863,9 @@ find_geom(struct gclass *classp, const char *name) { struct ggeom *gp; + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0) return (gp); From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 03:03:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E862C4EEE3D; Tue, 12 Jan 2021 03:03: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFFlT5zKtz3pnP; Tue, 12 Jan 2021 03:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9B625E29; Tue, 12 Jan 2021 03:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C33nfT022963; Tue, 12 Jan 2021 03:03:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C33n6w022962; Tue, 12 Jan 2021 03:03:49 GMT (envelope-from git) Date: Tue, 12 Jan 2021 03:03:49 GMT Message-Id: <202101120303.10C33n6w022962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 78d1f57dd963 - stable/12 - Fix devinfo typo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 78d1f57dd963b5dd9f43847d66cff406d446081c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 03:03:50 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=78d1f57dd963b5dd9f43847d66cff406d446081c commit 78d1f57dd963b5dd9f43847d66cff406d446081c Author: Alexander Motin AuthorDate: 2021-01-05 19:56:23 +0000 Commit: Alexander Motin CommitDate: 2021-01-12 03:03:33 +0000 Fix devinfo typo. Submitted by: Nick Wolff Differential Revision: https://reviews.freebsd.org/D27981 (cherry picked from commit 4d86ab429ee9b4b22654b52380512f7b8cee4478) --- usr.sbin/devinfo/devinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c index be18c57dc5e7..ee5ac0a1f7eb 100644 --- a/usr.sbin/devinfo/devinfo.c +++ b/usr.sbin/devinfo/devinfo.c @@ -235,7 +235,7 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n", "usage: devinfo [-rv]", " devinfo -u", - " devifno -p dev [-v]"); + " devinfo -p dev [-v]"); exit(1); } From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 08:25:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 488E74CE19F; Tue, 12 Jan 2021 08:25: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFNv01YY7z4b5N; Tue, 12 Jan 2021 08:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 239FF29875; Tue, 12 Jan 2021 08:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C8PmWJ036571; Tue, 12 Jan 2021 08:25:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C8PmhK036570; Tue, 12 Jan 2021 08:25:48 GMT (envelope-from git) Date: Tue, 12 Jan 2021 08:25:48 GMT Message-Id: <202101120825.10C8PmhK036570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: bd89fbd27c6b - stable/12 - newvers: append commit count to uname version string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bd89fbd27c6b582df4bba750df652bb36402fc7e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 08:25:48 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=bd89fbd27c6b582df4bba750df652bb36402fc7e commit bd89fbd27c6b582df4bba750df652bb36402fc7e Author: Ed Maste AuthorDate: 2019-08-01 14:13:04 +0000 Commit: Li-Wen Hsu CommitDate: 2021-01-12 08:19:43 +0000 newvers: append commit count to uname version string In a git world this provides a facsimile of a monotonically increasing version number. This might be refined further, but this provides a starting point for investigation. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20462 The "Relnotes" flag in the commit message is removed in cherry-pick as git repo doesn't affect the stable/11 and stable/12 release. (cherry picked from commit ecb2bbc081ae906956f4718ec946b9e4fcea241f) --- sys/conf/newvers.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e047f1e68d39..4b5651fdd4bf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -231,6 +231,10 @@ if [ -n "$git_cmd" ] ; then git=" ${git}" fi fi + git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + if [ -n "$git_cnt" ] ; then + git="${git}-c${git_cnt}" + fi git_b=`$git_cmd rev-parse --abbrev-ref HEAD` if [ -n "$git_b" ] ; then git="${git}(${git_b})" From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 08:25:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58CAA4CDFEF; Tue, 12 Jan 2021 08:25: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFNv127hqz4Zm4; Tue, 12 Jan 2021 08:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CE0429876; Tue, 12 Jan 2021 08:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C8Pnq1036594; Tue, 12 Jan 2021 08:25:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C8PntE036593; Tue, 12 Jan 2021 08:25:49 GMT (envelope-from git) Date: Tue, 12 Jan 2021 08:25:49 GMT Message-Id: <202101120825.10C8PntE036593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 079273384c22 - stable/12 - Fix newvers.sh to no longer print an outdated SVN rev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 079273384c22961b15d520c172645ba626af1db1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 08:25:49 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=079273384c22961b15d520c172645ba626af1db1 commit 079273384c22961b15d520c172645ba626af1db1 Author: Ulrich Spörlein AuthorDate: 2020-12-23 21:29:34 +0000 Commit: Li-Wen Hsu CommitDate: 2021-01-12 08:19:43 +0000 Fix newvers.sh to no longer print an outdated SVN rev We have stopped using SVN, so the notes containing the old SVN revisions are no longer populated, so fall back to purely counting the number of commits (currently at about 255337). Also turn the format more into what git-describe produces, with a name first, then the number of commits and the hash last. Note that as we don't tag anything on `main`, git describe will never produce something useful there and finds the newest vendor tag that was merged in instead. Sample output: FreeBSD 13.0-CURRENT #6 main-c255126-gb81783dc98e6-dirty FreeBSD 12.2-STABLE #0 stable/12-c243035-gd16dac42b641-dirty MFC after: 3 weeks Reviewed by: imp, glebius Differential Revision: https://reviews.freebsd.org/D27751 (cherry picked from commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f) --- sys/conf/newvers.sh | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 4b5651fdd4bf..48f778ed1223 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -210,40 +210,21 @@ if [ -n "$svnversion" ] ; then fi if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="=${git}" - else - svn=`$git_cmd log --grep '^git-svn-id:' | \ - grep '^ git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -z "$svn" ] ; then - svn=`$git_cmd log --format='format:%N' | \ - grep '^svn ' | head -1 | \ - sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` - fi - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi + git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="${git}-c${git_cnt}" + git="c${git_cnt}-g${git}" fi - git_b=`$git_cmd rev-parse --abbrev-ref HEAD` - if [ -n "$git_b" ] ; then - git="${git}(${git_b})" + git_b=$($git_cmd rev-parse --abbrev-ref HEAD) + if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then + git="${git_b}-${git}" fi if $git_cmd --work-tree=${VCSTOP} diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" modified=true fi + git=" ${git}" fi if [ -n "$p4_cmd" ] ; then From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 08:25:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557044CE0D4; Tue, 12 Jan 2021 08:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFNvB3qlDz4Zpc; Tue, 12 Jan 2021 08:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6106E297F3; Tue, 12 Jan 2021 08:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C8PvEg036744; Tue, 12 Jan 2021 08:25:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C8PvOm036743; Tue, 12 Jan 2021 08:25:57 GMT (envelope-from git) Date: Tue, 12 Jan 2021 08:25:57 GMT Message-Id: <202101120825.10C8PvOm036743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 3518e1924536 - stable/11 - Fix newvers.sh to no longer print an outdated SVN rev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 3518e1924536de2facc96030ab2707751ab0f5fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 08:25:59 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=3518e1924536de2facc96030ab2707751ab0f5fc commit 3518e1924536de2facc96030ab2707751ab0f5fc Author: Ulrich Spörlein AuthorDate: 2020-12-23 21:29:34 +0000 Commit: Li-Wen Hsu CommitDate: 2021-01-12 08:24:00 +0000 Fix newvers.sh to no longer print an outdated SVN rev We have stopped using SVN, so the notes containing the old SVN revisions are no longer populated, so fall back to purely counting the number of commits (currently at about 255337). Also turn the format more into what git-describe produces, with a name first, then the number of commits and the hash last. Note that as we don't tag anything on `main`, git describe will never produce something useful there and finds the newest vendor tag that was merged in instead. Sample output: FreeBSD 13.0-CURRENT #6 main-c255126-gb81783dc98e6-dirty FreeBSD 12.2-STABLE #0 stable/12-c243035-gd16dac42b641-dirty MFC after: 3 weeks Reviewed by: imp, glebius Differential Revision: https://reviews.freebsd.org/D27751 (cherry picked from commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f) --- sys/conf/newvers.sh | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 593f14ef4145..9b7a1c19991a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -212,40 +212,21 @@ if [ -n "$svnversion" ] ; then fi if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="=${git}" - else - svn=`$git_cmd log --grep '^git-svn-id:' | \ - grep '^ git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -z "$svn" ] ; then - svn=`$git_cmd log --format='format:%N' | \ - grep '^svn ' | head -1 | \ - sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` - fi - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi + git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="${git}-c${git_cnt}" + git="c${git_cnt}-g${git}" fi - git_b=`$git_cmd rev-parse --abbrev-ref HEAD` - if [ -n "$git_b" ] ; then - git="${git}(${git_b})" + git_b=$($git_cmd rev-parse --abbrev-ref HEAD) + if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then + git="${git_b}-${git}" fi if $git_cmd --work-tree=${VCSDIR}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" modified=true fi + git=" ${git}" fi if [ -n "$p4_cmd" ] ; then From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 08:26:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 147104CE303; Tue, 12 Jan 2021 08:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFNvC2v8jz4Zrq; Tue, 12 Jan 2021 08:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BF1629DA7; Tue, 12 Jan 2021 08:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C8Pu7f036721; Tue, 12 Jan 2021 08:25:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C8Puli036720; Tue, 12 Jan 2021 08:25:56 GMT (envelope-from git) Date: Tue, 12 Jan 2021 08:25:56 GMT Message-Id: <202101120825.10C8Puli036720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 98dfc7de6176 - stable/11 - newvers: append commit count to uname version string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 98dfc7de6176972d7b6b7dce9b18439c0c9edabe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 08:26:05 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=98dfc7de6176972d7b6b7dce9b18439c0c9edabe commit 98dfc7de6176972d7b6b7dce9b18439c0c9edabe Author: Ed Maste AuthorDate: 2019-08-01 14:13:04 +0000 Commit: Li-Wen Hsu CommitDate: 2021-01-12 08:22:30 +0000 newvers: append commit count to uname version string In a git world this provides a facsimile of a monotonically increasing version number. This might be refined further, but this provides a starting point for investigation. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20462 The "Relnotes" flag in the commit message is removed in cherry-pick as git repo doesn't affect the stable/11 and stable/12 release. (cherry picked from commit ecb2bbc081ae906956f4718ec946b9e4fcea241f) --- sys/conf/newvers.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 661bbc3978e6..593f14ef4145 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -233,6 +233,10 @@ if [ -n "$git_cmd" ] ; then git=" ${git}" fi fi + git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + if [ -n "$git_cnt" ] ; then + git="${git}-c${git_cnt}" + fi git_b=`$git_cmd rev-parse --abbrev-ref HEAD` if [ -n "$git_b" ] ; then git="${git}(${git_b})" From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:40:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB5F14DE23C; Tue, 12 Jan 2021 16:40: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFbsj5Lfqz3mlL; Tue, 12 Jan 2021 16:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA06D2FFB5; Tue, 12 Jan 2021 16:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGePcb082521; Tue, 12 Jan 2021 16:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGePiw082520; Tue, 12 Jan 2021 16:40:25 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:40:25 GMT Message-Id: <202101121640.10CGePiw082520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 992ef0f90dea - stable/12 - MFC ec52ff6d1411 and 747feea146d8: Streamline the infiniband code according to the ethernet code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 992ef0f90deab792aef67c8e66167a7ad48ea905 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:40:25 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=992ef0f90deab792aef67c8e66167a7ad48ea905 commit 992ef0f90deab792aef67c8e66167a7ad48ea905 Author: Hans Petter Selasky AuthorDate: 2020-12-29 17:01:57 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:34:32 +0000 MFC ec52ff6d1411 and 747feea146d8: Streamline the infiniband code according to the ethernet code. Specifically implement the if_requestencap callback function for infiniband. Most of the changes are simply a cut and paste of the equivalent ethernet part. Reviewed by: melifaro @ Differential Revision: https://reviews.freebsd.org/D27631 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/net/if_infiniband.c | 297 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 197 insertions(+), 100 deletions(-) diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 19f7cdf7ffea..b644f91f2cda 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -143,139 +143,236 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb) mb->m_pkthdr.len += sizeof(*ibh); } +static void +update_mbuf_csumflags(struct mbuf *src, struct mbuf *dst) +{ + int csum_flags = 0; + + if (src->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); + if (src->m_pkthdr.csum_flags & CSUM_DELAY_DATA) + csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR); + if (src->m_pkthdr.csum_flags & CSUM_SCTP) + csum_flags |= CSUM_SCTP_VALID; + dst->m_pkthdr.csum_flags |= csum_flags; + if (csum_flags & CSUM_DATA_VALID) + dst->m_pkthdr.csum_data = 0xffff; +} + /* - * Infiniband output routine. + * Handle link-layer encapsulation requests. */ static int -infiniband_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, - struct route *ro) +infiniband_requestencap(struct ifnet *ifp, struct if_encap_req *req) { - uint8_t edst[INFINIBAND_ADDR_LEN]; -#if defined(INET) || defined(INET6) - struct llentry *lle = NULL; -#endif - struct infiniband_header *ibh; - int error = 0; - uint16_t type; - bool is_gw; + struct infiniband_header *ih; + struct arphdr *ah; + uint16_t etype; + const uint8_t *lladdr; - is_gw = ((ro != NULL) && (ro->ro_flags & RT_HAS_GW) != 0); + if (req->rtype != IFENCAP_LL) + return (EOPNOTSUPP); -#ifdef MAC - error = mac_ifnet_check_transmit(ifp, m); - if (error) - goto bad; -#endif + if (req->bufsize < INFINIBAND_HDR_LEN) + return (ENOMEM); - M_PROFILE(m); - if (ifp->if_flags & IFF_MONITOR) { - error = ENETDOWN; - goto bad; - } - if (!((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING))) { - error = ENETDOWN; - goto bad; - } + ih = (struct infiniband_header *)req->buf; + lladdr = req->lladdr; + req->lladdr_off = 0; - switch (dst->sa_family) { - case AF_LINK: - goto output; -#ifdef INET + switch (req->family) { case AF_INET: - if (lle != NULL && (lle->la_flags & LLE_VALID)) { - memcpy(edst, lle->ll_addr, sizeof(edst)); - } else if (m->m_flags & M_MCAST) { - infiniband_ipv4_multicast_map( - ((const struct sockaddr_in *)dst)->sin_addr.s_addr, - ifp->if_broadcastaddr, edst); - } else { - error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); - if (error) { - if (error == EWOULDBLOCK) - error = 0; - m = NULL; /* mbuf is consumed by resolver */ - goto bad; - } - } - type = htons(ETHERTYPE_IP); + etype = htons(ETHERTYPE_IP); break; - case AF_ARP: { - struct arphdr *ah; - - if (m->m_len < sizeof(*ah)) { - error = EINVAL; - goto bad; - } - - ah = mtod(m, struct arphdr *); - - if (m->m_len < arphdr_len(ah)) { - error = EINVAL; - goto bad; - } + case AF_INET6: + etype = htons(ETHERTYPE_IPV6); + break; + case AF_ARP: + ah = (struct arphdr *)req->hdata; ah->ar_hrd = htons(ARPHRD_INFINIBAND); switch (ntohs(ah->ar_op)) { case ARPOP_REVREQUEST: case ARPOP_REVREPLY: - type = htons(ETHERTYPE_REVARP); + etype = htons(ETHERTYPE_REVARP); break; case ARPOP_REQUEST: case ARPOP_REPLY: default: - type = htons(ETHERTYPE_ARP); + etype = htons(ETHERTYPE_ARP); break; } - if (m->m_flags & M_BCAST) { - memcpy(edst, ifp->if_broadcastaddr, INFINIBAND_ADDR_LEN); + if (req->flags & IFENCAP_FLAG_BROADCAST) + lladdr = ifp->if_broadcastaddr; + break; + default: + return (EAFNOSUPPORT); + } + + ih->ib_protocol = etype; + ih->ib_reserved = 0; + memcpy(ih->ib_hwaddr, lladdr, INFINIBAND_ADDR_LEN); + req->bufsize = sizeof(struct infiniband_header); + + return (0); +} + +static int +infiniband_resolve_addr(struct ifnet *ifp, struct mbuf *m, + const struct sockaddr *dst, struct route *ro, uint8_t *phdr, + uint32_t *pflags, struct llentry **plle) +{ + struct infiniband_header *ih; + uint32_t lleflags = 0; + int error = 0; + + if (plle) + *plle = NULL; + ih = (struct infiniband_header *)phdr; + + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) { + error = arpresolve(ifp, 0, m, dst, phdr, &lleflags, plle); } else { - if (ah->ar_hln != INFINIBAND_ADDR_LEN) { - error = EINVAL; - goto bad; + if (m->m_flags & M_BCAST) { + memcpy(ih->ib_hwaddr, ifp->if_broadcastaddr, + INFINIBAND_ADDR_LEN); + } else { + infiniband_ipv4_multicast_map( + ((const struct sockaddr_in *)dst)->sin_addr.s_addr, + ifp->if_broadcastaddr, ih->ib_hwaddr); } - memcpy(edst, ar_tha(ah), INFINIBAND_ADDR_LEN); + ih->ib_protocol = htons(ETHERTYPE_IP); + ih->ib_reserved = 0; } break; - } #endif #ifdef INET6 - case AF_INET6: { - const struct ip6_hdr *ip6; - - ip6 = mtod(m, const struct ip6_hdr *); - if (m->m_len < sizeof(*ip6)) { - error = EINVAL; - goto bad; - } else if (lle != NULL && (lle->la_flags & LLE_VALID)) { - memcpy(edst, lle->ll_addr, sizeof(edst)); - } else if (m->m_flags & M_MCAST) { + case AF_INET6: + if ((m->m_flags & M_MCAST) == 0) { + error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags, plle); + } else { infiniband_ipv6_multicast_map( &((const struct sockaddr_in6 *)dst)->sin6_addr, - ifp->if_broadcastaddr, edst); - } else if (ip6->ip6_nxt == IPPROTO_ICMPV6) { - memcpy(edst, ifp->if_broadcastaddr, INFINIBAND_ADDR_LEN); - } else { - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); - if (error) { - if (error == EWOULDBLOCK) - error = 0; - m = NULL; /* mbuf is consumed by resolver */ - goto bad; - } + ifp->if_broadcastaddr, ih->ib_hwaddr); + ih->ib_protocol = htons(ETHERTYPE_IPV6); + ih->ib_reserved = 0; } - type = htons(ETHERTYPE_IPV6); break; - } #endif default: - error = EAFNOSUPPORT; + if_printf(ifp, "can't handle af%d\n", dst->sa_family); + if (m != NULL) + m_freem(m); + return (EAFNOSUPPORT); + } + + if (error == EHOSTDOWN) { + if (ro != NULL && (ro->ro_flags & RT_HAS_GW) != 0) + error = EHOSTUNREACH; + } + + if (error != 0) + return (error); + + *pflags = RT_MAY_LOOP; + if (lleflags & LLE_IFADDR) + *pflags |= RT_L2_ME; + + return (0); +} + +/* + * Infiniband output routine. + */ +static int +infiniband_output(struct ifnet *ifp, struct mbuf *m, + const struct sockaddr *dst, struct route *ro) +{ + uint8_t linkhdr[INFINIBAND_HDR_LEN]; + uint8_t *phdr; + struct llentry *lle = NULL; + struct infiniband_header *ih; + int error = 0; + int hlen; /* link layer header length */ + uint32_t pflags; + bool addref; + + addref = false; + phdr = NULL; + pflags = 0; + if (ro != NULL) { + /* XXX BPF uses ro_prepend */ + if (ro->ro_prepend != NULL) { + phdr = ro->ro_prepend; + hlen = ro->ro_plen; + } else if (!(m->m_flags & (M_BCAST | M_MCAST))) { + if ((ro->ro_flags & RT_LLE_CACHE) != 0) { + lle = ro->ro_lle; + if (lle != NULL && + (lle->la_flags & LLE_VALID) == 0) { + LLE_FREE(lle); + lle = NULL; /* redundant */ + ro->ro_lle = NULL; + } + if (lle == NULL) { + /* if we lookup, keep cache */ + addref = 1; + } else + /* + * Notify LLE code that + * the entry was used + * by datapath. + */ + llentry_mark_used(lle); + } + if (lle != NULL) { + phdr = lle->r_linkdata; + hlen = lle->r_hdrlen; + pflags = lle->r_flags; + } + } + } + +#ifdef MAC + error = mac_ifnet_check_transmit(ifp, m); + if (error) + goto bad; +#endif + + M_PROFILE(m); + if (ifp->if_flags & IFF_MONITOR) { + error = ENETDOWN; goto bad; } + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { + error = ENETDOWN; + goto bad; + } + + if (phdr == NULL) { + /* No prepend data supplied. Try to calculate ourselves. */ + phdr = linkhdr; + hlen = INFINIBAND_HDR_LEN; + error = infiniband_resolve_addr(ifp, m, dst, ro, phdr, &pflags, + addref ? &lle : NULL); + if (addref && lle != NULL) + ro->ro_lle = lle; + if (error != 0) + return (error == EWOULDBLOCK ? 0 : error); + } + + if ((pflags & RT_L2_ME) != 0) { + update_mbuf_csumflags(m, m); + return (if_simloop(ifp, m, dst->sa_family, 0)); + } /* - * Add local net header. If no space in first mbuf, + * Add local infiniband header. If no space in first mbuf, * allocate another. */ M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); @@ -283,16 +380,15 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, error = ENOBUFS; goto bad; } - ibh = mtod(m, struct infiniband_header *); - - ibh->ib_protocol = type; - memcpy(ibh->ib_hwaddr, edst, sizeof(edst)); + if ((pflags & RT_HAS_HEADER) == 0) { + ih = mtod(m, struct infiniband_header *); + memcpy(ih, phdr, hlen); + } /* * Queue message on interface, update output statistics if * successful, and start output if interface not yet active. */ -output: return (ifp->if_transmit(ifp, m)); bad: if (m != NULL) @@ -482,6 +578,7 @@ infiniband_ifattach(struct ifnet *ifp, const uint8_t *lla, const uint8_t *llb) ifp->if_output = infiniband_output; ifp->if_input = infiniband_input; ifp->if_resolvemulti = infiniband_resolvemulti; + ifp->if_requestencap = infiniband_requestencap; if (ifp->if_baudrate == 0) ifp->if_baudrate = IF_Gbps(10); /* default value */ From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:40:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD6574DE24D; Tue, 12 Jan 2021 16:40: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFbt44BqQz3mwq; Tue, 12 Jan 2021 16:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 830671A3; Tue, 12 Jan 2021 16:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGeiCn082671; Tue, 12 Jan 2021 16:40:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGeiH9082670; Tue, 12 Jan 2021 16:40:44 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:40:44 GMT Message-Id: <202101121640.10CGeiH9082670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 5a6dd9d6f4f8 - stable/12 - MFC 19ecb5e8dabe: Fix for IPoIB over lagg(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5a6dd9d6f4f8e9cfa084edc36ca650375ba4a322 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:40:44 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5a6dd9d6f4f8e9cfa084edc36ca650375ba4a322 commit 5a6dd9d6f4f8e9cfa084edc36ca650375ba4a322 Author: Hans Petter Selasky AuthorDate: 2020-12-29 16:34:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:35:49 +0000 MFC 19ecb5e8dabe: Fix for IPoIB over lagg(4). Need to update both link layer address and broadcast address when active link changes for IP over infiniband. This is because the broadcast address contains the so-called P-key, which is interface dependent. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D27658 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/net/if_lagg.c | 12 +++++------- sys/net/if_lagg.h | 5 +++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 4699a6b8d769..049978bcfd6c 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -496,11 +496,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) int if_type; int error; static const uint8_t eaddr[LAGG_ADDR_LEN]; - static const uint8_t ib_bcast_addr[INFINIBAND_ADDR_LEN] = { - 0x00, 0xff, 0xff, 0xff, - 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff - }; if (params != NULL) { error = copyin(params, &iflp, sizeof(iflp)); @@ -582,7 +577,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) ether_ifattach(ifp, eaddr); break; case IFT_INFINIBAND: - infiniband_ifattach(ifp, eaddr, ib_bcast_addr); + infiniband_ifattach(ifp, eaddr, sc->sc_bcast_addr); break; default: break; @@ -1214,8 +1209,11 @@ lagg_watchdog_infiniband(void *arg) lp_ifp = lp->lp_ifp; if (ifp != NULL && lp_ifp != NULL && - memcmp(IF_LLADDR(ifp), IF_LLADDR(lp_ifp), ifp->if_addrlen) != 0) { + (memcmp(IF_LLADDR(ifp), IF_LLADDR(lp_ifp), ifp->if_addrlen) != 0 || + memcmp(sc->sc_bcast_addr, lp_ifp->if_broadcastaddr, ifp->if_addrlen) != 0)) { memcpy(IF_LLADDR(ifp), IF_LLADDR(lp_ifp), ifp->if_addrlen); + memcpy(sc->sc_bcast_addr, lp_ifp->if_broadcastaddr, ifp->if_addrlen); + CURVNET_SET(ifp->if_vnet); EVENTHANDLER_INVOKE(iflladdr_event, ifp); CURVNET_RESTORE(); diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h index 2a7796748786..de0fdd712b3e 100644 --- a/sys/net/if_lagg.h +++ b/sys/net/if_lagg.h @@ -257,13 +257,14 @@ struct lagg_softc { int flowid_shift; /* shift the flowid */ struct lagg_counters detached_counters; /* detached ports sum */ struct callout sc_watchdog; /* watchdog timer */ +#define LAGG_ADDR_LEN \ + MAX(INFINIBAND_ADDR_LEN, ETHER_ADDR_LEN) + uint8_t sc_bcast_addr[LAGG_ADDR_LEN]; }; struct lagg_port { struct ifnet *lp_ifp; /* physical interface */ struct lagg_softc *lp_softc; /* parent lagg */ -#define LAGG_ADDR_LEN \ - MAX(INFINIBAND_ADDR_LEN, ETHER_ADDR_LEN) uint8_t lp_lladdr[LAGG_ADDR_LEN]; u_char lp_iftype; /* interface type */ From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:42:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 402FF4DE274; Tue, 12 Jan 2021 16:42: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFbwW1Mbjz3n6D; Tue, 12 Jan 2021 16:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21A2A2FED6; Tue, 12 Jan 2021 16:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGgpVo086947; Tue, 12 Jan 2021 16:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGgpoB086946; Tue, 12 Jan 2021 16:42:51 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:42:51 GMT Message-Id: <202101121642.10CGgpoB086946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 8d9bc45628bb - stable/12 - MFC ddce63fcb6d0: Remove not needed variable initialization. And switch from int to bool while at it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8d9bc45628bbb7200dd5e41e3a44119405307842 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:42:51 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8d9bc45628bbb7200dd5e41e3a44119405307842 commit 8d9bc45628bbb7200dd5e41e3a44119405307842 Author: Hans Petter Selasky AuthorDate: 2020-12-23 10:37:44 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:41:39 +0000 MFC ddce63fcb6d0: Remove not needed variable initialization. And switch from int to bool while at it. Reviewed by: melifaro@ Differential Revision: https://reviews.freebsd.org/D27725 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/net/if_ethersubr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 9591d9f1ebcc..532d6a7a342b 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -289,7 +289,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, char linkhdr[ETHER_HDR_LEN], *phdr; struct ether_header *eh; struct pf_mtag *t; - int loop_copy = 1; + bool loop_copy; int hlen; /* link layer header length */ uint32_t pflags; struct llentry *lle = NULL; @@ -359,7 +359,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, update_mbuf_csumflags(m, m); return (if_simloop(ifp, m, dst->sa_family, 0)); } - loop_copy = pflags & RT_MAY_LOOP; + loop_copy = (pflags & RT_MAY_LOOP) != 0; /* * Add local net header. If no space in first mbuf, From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:51:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D3DE4DE5B8; Tue, 12 Jan 2021 16:51: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFc5w2pCKz3nZn; Tue, 12 Jan 2021 16:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 530B231D; Tue, 12 Jan 2021 16:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGp0j4095631; Tue, 12 Jan 2021 16:51:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGp0Ns095630; Tue, 12 Jan 2021 16:51:00 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:51:00 GMT Message-Id: <202101121651.10CGp0Ns095630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 92b2a4deed65 - stable/12 - MFC 1622a498525b: No need to stop XHCI endpoints in disabled state. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 92b2a4deed657a389cdbf91d92ab20ae6996989c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:51:00 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=92b2a4deed657a389cdbf91d92ab20ae6996989c commit 92b2a4deed657a389cdbf91d92ab20ae6996989c Author: Hans Petter Selasky AuthorDate: 2020-12-23 10:54:42 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:44:02 +0000 MFC 1622a498525b: No need to stop XHCI endpoints in disabled state. Some AMD XHCI implementations apparently assert a permanent internal failure if this happens. Submitted by: ali.abdallah@suse.com PR: 251503 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/controller/xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 2bdb77f4ad25..70a73dcc94c4 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3896,6 +3896,8 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) * endpoint context state diagram in the XHCI specification: */ switch (xhci_get_endpoint_state(udev, epno)) { + case XHCI_EPCTX_0_EPSTATE_DISABLED: + break; case XHCI_EPCTX_0_EPSTATE_STOPPED: break; case XHCI_EPCTX_0_EPSTATE_HALTED: From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:51:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B948E4DE3DB; Tue, 12 Jan 2021 16:51: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFc5y4pkvz3nVp; Tue, 12 Jan 2021 16:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 979292FFEC; Tue, 12 Jan 2021 16:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGp2Gd095672; Tue, 12 Jan 2021 16:51:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGp2cS095671; Tue, 12 Jan 2021 16:51:02 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:51:02 GMT Message-Id: <202101121651.10CGp2cS095671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e424e6325355 - stable/12 - MFC 9e7fa1e66c1e: Collect statistics from all rate-limit queues in mlx5en(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e424e632535539a72604c651d071e2e8bf6eadbb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:51:02 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e424e632535539a72604c651d071e2e8bf6eadbb commit e424e632535539a72604c651d071e2e8bf6eadbb Author: Hans Petter Selasky AuthorDate: 2020-10-12 08:18:48 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:47:00 +0000 MFC 9e7fa1e66c1e: Collect statistics from all rate-limit queues in mlx5en(4). Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index ef500664cdef..b22f949fdb87 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -904,6 +904,30 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) } } +#ifdef RATELIMIT + /* Collect statistics from all rate-limit queues */ + for (j = 0; j < priv->rl.param.tx_worker_threads_def; j++) { + struct mlx5e_rl_worker *rlw = priv->rl.workers + j; + + for (i = 0; i < priv->rl.param.tx_channels_per_worker_def; i++) { + struct mlx5e_rl_channel *channel = rlw->channels + i; + struct mlx5e_sq *sq = channel->sq; + + if (sq == NULL) + continue; + + sq_stats = &sq->stats; + + tso_packets += sq_stats->tso_packets; + tso_bytes += sq_stats->tso_bytes; + tx_queue_dropped += sq_stats->dropped; + tx_queue_dropped += sq_stats->enobuf; + tx_defragged += sq_stats->defragged; + tx_offload_none += sq_stats->csum_offload_none; + } + } +#endif + /* update counters */ s->tso_packets = tso_packets; s->tso_bytes = tso_bytes; From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:51:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 959E14DE72A; Tue, 12 Jan 2021 16: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFc5x3mydz3njT; Tue, 12 Jan 2021 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 748451CB; Tue, 12 Jan 2021 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGp1a9095654; Tue, 12 Jan 2021 16:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGp14X095653; Tue, 12 Jan 2021 16:51:01 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:51:01 GMT Message-Id: <202101121651.10CGp14X095653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 79818c801026 - stable/12 - MFC aca12148b113: Improve error message printing in krping. Don't print completion queue flush as an error. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 79818c80102617558796df7b1cd9b7087cf39830 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:51:01 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=79818c80102617558796df7b1cd9b7087cf39830 commit 79818c80102617558796df7b1cd9b7087cf39830 Author: Hans Petter Selasky AuthorDate: 2020-12-09 12:59:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:45:45 +0000 MFC aca12148b113: Improve error message printing in krping. Don't print completion queue flush as an error. Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/contrib/rdma/krping/krping.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/contrib/rdma/krping/krping.c b/sys/contrib/rdma/krping/krping.c index c734da36247f..e9a379984dec 100644 --- a/sys/contrib/rdma/krping/krping.c +++ b/sys/contrib/rdma/krping/krping.c @@ -362,10 +362,6 @@ static void krping_cq_event_handler(struct ib_cq *cq, void *ctx) int ret; BUG_ON(cb->cq != cq); - if (cb->state == ERROR) { - printk(KERN_ERR PFX "cq completion in ERROR state\n"); - return; - } if (cb->frtest) { printk(KERN_ERR PFX "cq completion event in frtest!\n"); return; @@ -384,7 +380,10 @@ static void krping_cq_event_handler(struct ib_cq *cq, void *ctx) goto error; } } - + if (cb->state == ERROR) { + printk(KERN_ERR PFX "cq completion in ERROR state\n"); + return; + } switch (wc.opcode) { case IB_WC_SEND: DEBUG_LOG("send completion\n"); From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:51:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99FEB4DE785; Tue, 12 Jan 2021 16:51: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFc613fkLz3nW5; Tue, 12 Jan 2021 16:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAFF22FE76; Tue, 12 Jan 2021 16:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGp47R095716; Tue, 12 Jan 2021 16:51:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGp4U2095715; Tue, 12 Jan 2021 16:51:04 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:51:04 GMT Message-Id: <202101121651.10CGp4U2095715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 2e0dd1574137 - stable/12 - MFC ea0efc370416: Add support for PL2303HXN to uplcom(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2e0dd1574137757c4267c38c11493aab005136e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:51:07 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=2e0dd1574137757c4267c38c11493aab005136e3 commit 2e0dd1574137757c4267c38c11493aab005136e3 Author: Hans Petter Selasky AuthorDate: 2021-01-07 14:34:26 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:48:06 +0000 MFC ea0efc370416: Add support for PL2303HXN to uplcom(4). Code changes in this commit were obtained from straight from OpenBSD's uplcom.c with almost no modification, the list of chip names and USB IDs was obtained from Linux. Differential Revision: https://reviews.freebsd.org/D27952 Submitted by: tomli_tomli.me (Yifeng Li) Sponsored by: Mellanox Technologies // NVIDIA Networking --- share/man/man4/uplcom.4 | 4 +- sys/dev/usb/serial/uplcom.c | 94 +++++++++++++++++++++++++++++++++++++++------ sys/dev/usb/usbdevs | 6 +++ 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/share/man/man4/uplcom.4 b/share/man/man4/uplcom.4 index b79aac28a80c..3066551b4ab4 100644 --- a/share/man/man4/uplcom.4 +++ b/share/man/man4/uplcom.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd January 7, 2021 .Dt UPLCOM 4 .Os .Sh NAME @@ -134,6 +134,8 @@ PLANEX USB-RS232 URS-03 .It Prolific Generic USB-Serial Adapters .It +Prolific Generic USB-Serial Adapters (HXN) +.It Prolific Pharos USB-Serial Adapter .It Prolific USB-Serial Controller D diff --git a/sys/dev/usb/serial/uplcom.c b/sys/dev/usb/serial/uplcom.c index a054601cc8ea..5bbbab94feb6 100644 --- a/sys/dev/usb/serial/uplcom.c +++ b/sys/dev/usb/serial/uplcom.c @@ -131,8 +131,13 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UPLCOM_BULK_BUF_SIZE 1024 /* bytes */ #define UPLCOM_SET_REQUEST 0x01 +#define UPLCOM_SET_REQUEST_PL2303HXN 0x80 #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 +#define UPLCOM_SET_CRTSCTS_PL2303HXN 0xFA +#define UPLCOM_CLEAR_CRTSCTS_PL2303HXN 0xFF +#define UPLCOM_CRTSCTS_REG_PL2303HXN 0x0A +#define UPLCOM_STATUS_REG_PL2303HX 0x8080 #define RSAQ_STATUS_CTS 0x80 #define RSAQ_STATUS_OVERRUN_ERROR 0x40 #define RSAQ_STATUS_PARITY_ERROR 0x20 @@ -145,6 +150,7 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 #define TYPE_PL2303HXD 2 +#define TYPE_PL2303HXN 3 #define UPLCOM_STATE_INDEX 8 @@ -289,6 +295,12 @@ static const STRUCT_USB_HOST_ID uplcom_devs[] = { UPLCOM_DEV(PROLIFIC, MOTOROLA), /* Motorola cable */ UPLCOM_DEV(PROLIFIC, PHAROS), /* Prolific Pharos */ UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ + UPLCOM_DEV(PROLIFIC, PL2303GC), /* Generic adapter (PL2303HXN, type GC) */ + UPLCOM_DEV(PROLIFIC, PL2303GB), /* Generic adapter (PL2303HXN, type GB) */ + UPLCOM_DEV(PROLIFIC, PL2303GT), /* Generic adapter (PL2303HXN, type GT) */ + UPLCOM_DEV(PROLIFIC, PL2303GL), /* Generic adapter (PL2303HXN, type GL) */ + UPLCOM_DEV(PROLIFIC, PL2303GE), /* Generic adapter (PL2303HXN, type GE) */ + UPLCOM_DEV(PROLIFIC, PL2303GS), /* Generic adapter (PL2303HXN, type GS) */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ UPLCOM_DEV(PROLIFIC, RSAQ3), /* I/O DATA USB-RSAQ3 */ UPLCOM_DEV(PROLIFIC, UIC_MSR206), /* UIC MSR206 Card Reader */ @@ -368,6 +380,10 @@ uplcom_attach(device_t dev) struct usb_device_descriptor *dd; int error; + struct usb_device_request req; + usb_error_t err; + uint8_t buf[4]; + DPRINTFN(11, "\n"); device_set_usb_desc(dev); @@ -407,6 +423,25 @@ uplcom_attach(device_t dev) break; } + /* + * The new chip revision PL2303HXN is only compatible with the new + * UPLCOM_SET_REQUEST_PL2303HXN command. Issuing the old command + * UPLCOM_SET_REQUEST to the new chip raises an error. Thus, PL2303HX + * and PL2303HXN can be distinguished by issuing an old-style request + * (on a status register) to the new chip and checking the error. + */ + if (sc->sc_chiptype == TYPE_PL2303HX) { + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, UPLCOM_STATUS_REG_PL2303HX); + req.wIndex[0] = sc->sc_data_iface_no; + req.wIndex[1] = 0; + USETW(req.wLength, 1); + err = usbd_do_request(sc->sc_udev, NULL, &req, buf); + if (err) + sc->sc_chiptype = TYPE_PL2303HXN; + } + switch (sc->sc_chiptype) { case TYPE_PL2303: DPRINTF("chiptype: 2303\n"); @@ -414,6 +449,9 @@ uplcom_attach(device_t dev) case TYPE_PL2303HX: DPRINTF("chiptype: 2303HX/TA\n"); break; + case TYPE_PL2303HXN: + DPRINTF("chiptype: 2303HXN\n"); + break; case TYPE_PL2303HXD: DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); break; @@ -475,7 +513,8 @@ uplcom_attach(device_t dev) usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); - } else { + } else if (sc->sc_chiptype == TYPE_PL2303HX || + sc->sc_chiptype == TYPE_PL2303HXD) { /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || @@ -483,6 +522,12 @@ uplcom_attach(device_t dev) UPLCOM_SET_REQUEST, 9, 0, 0)) { goto detach; } + } else if (sc->sc_chiptype == TYPE_PL2303HXN) { + /* reset upstream data pipes */ + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST_PL2303HXN, 0x07, 0x03, 0)) { + goto detach; + } } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -546,6 +591,11 @@ uplcom_reset(struct uplcom_softc *sc, struct usb_device *udev) { struct usb_device_request req; + if (sc->sc_chiptype == TYPE_PL2303HXN) { + /* PL2303HXN doesn't need this reset sequence */ + return (0); + } + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); @@ -583,6 +633,11 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t chiptype) { int err; + if (chiptype == TYPE_PL2303HXN) { + /* PL2303HXN doesn't need this initialization sequence */ + return (0); + } + if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1) || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x0404, 0, 0) || uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1) @@ -729,7 +784,7 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) * * The PL2303 can only set specific baud rates, up to 1228800 baud. * The PL2303HX can set any baud rate up to 6Mb. - * The PL2303HX rev. D can set any baud rate up to 12Mb. + * The PL2303HX rev. D and PL2303HXN can set any baud rate up to 12Mb. * */ @@ -737,6 +792,10 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) if (t->c_ospeed & 0x80000000) return 0; switch (sc->sc_chiptype) { + case TYPE_PL2303HXN: + if (t->c_ospeed <= 12000000) + return (0); + break; case TYPE_PL2303HXD: if (t->c_ospeed <= 12000000) return (0); @@ -874,21 +933,34 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) DPRINTF("crtscts = on\n"); req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = UPLCOM_SET_REQUEST; - USETW(req.wValue, 0); - if (sc->sc_chiptype != TYPE_PL2303) - USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); - else - USETW(req.wIndex, UPLCOM_SET_CRTSCTS); + if (sc->sc_chiptype == TYPE_PL2303HXN) { + req.bRequest = UPLCOM_SET_REQUEST_PL2303HXN; + USETW(req.wValue, UPLCOM_CRTSCTS_REG_PL2303HXN); + USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303HXN); + } else { + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, 0); + if (sc->sc_chiptype != TYPE_PL2303) + USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); + else + USETW(req.wIndex, UPLCOM_SET_CRTSCTS); + } USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); } else { req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = UPLCOM_SET_REQUEST; - USETW(req.wValue, 0); - USETW(req.wIndex, 0); + if (sc->sc_chiptype == TYPE_PL2303HXN) { + req.bRequest = UPLCOM_SET_REQUEST_PL2303HXN; + USETW(req.wValue, UPLCOM_CRTSCTS_REG_PL2303HXN); + USETW(req.wIndex, UPLCOM_CLEAR_CRTSCTS_PL2303HXN); + } + else { + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + } USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index b64526593c25..84508657b6ef 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3794,6 +3794,12 @@ product PROLIFIC MICROMAX_610U 0x0612 Micromax 610U product PROLIFIC DCU11 0x1234 DCU-11 Phone Cable product PROLIFIC UIC_MSR206 0x206a UIC MSR206 Card Reader product PROLIFIC PL2303 0x2303 PL2303 Serial (ATEN/IOGEAR UC232A) +product PROLIFIC PL2303GC 0x23a3 PL2303HXN Serial, type GC +product PROLIFIC PL2303GB 0x23b3 PL2303HXN Serial, type GB +product PROLIFIC PL2303GT 0x23c3 PL2303HXN Serial, type GT +product PROLIFIC PL2303GL 0x23d3 PL2303HXN Serial, type GL +product PROLIFIC PL2303GE 0x23e3 PL2303HXN Serial, type GE +product PROLIFIC PL2303GS 0x23f3 PL2303HXN Serial, type GS product PROLIFIC PL2305 0x2305 Parallel printer product PROLIFIC ATAPI4 0x2307 ATAPI-4 Controller product PROLIFIC PL2501 0x2501 PL2501 Host-Host interface From owner-dev-commits-src-branches@freebsd.org Tue Jan 12 16:51:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70E804DE784; Tue, 12 Jan 2021 16:51: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFc605L8Nz3nm5; Tue, 12 Jan 2021 16:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB9C52FF49; Tue, 12 Jan 2021 16:51:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CGp3Hm095694; Tue, 12 Jan 2021 16:51:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CGp3V4095693; Tue, 12 Jan 2021 16:51:03 GMT (envelope-from git) Date: Tue, 12 Jan 2021 16:51:03 GMT Message-Id: <202101121651.10CGp3V4095693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 9566c2ab4eda - stable/12 - MFC c834f30a0c16: Add new PCI ID for XHCI(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9566c2ab4eda314a843d2f3dc72780accdc91927 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:51:08 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9566c2ab4eda314a843d2f3dc72780accdc91927 commit 9566c2ab4eda314a843d2f3dc72780accdc91927 Author: Hans Petter Selasky AuthorDate: 2021-01-07 14:27:24 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-12 16:47:35 +0000 MFC c834f30a0c16: Add new PCI ID for XHCI(4). Submitted by: Dmitry Luhtionov Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/controller/xhci_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index d18a115709b1..4c64fc5c8d94 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -134,6 +134,8 @@ xhci_pci_match(device_t self) return ("Intel Panther Point USB 3.0 controller"); case 0x22b58086: return ("Intel Braswell USB 3.0 controller"); + case 0x31a88086: + return ("Intel Gemini Lake USB 3.0 controller"); case 0x5aa88086: return ("Intel Apollo Lake USB 3.0 controller"); case 0x8c318086: From owner-dev-commits-src-branches@freebsd.org Wed Jan 13 01:14:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8F2A4EC9B8; Wed, 13 Jan 2021 01:14: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFqGn5Bmvz3DFN; Wed, 13 Jan 2021 01:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 965AF6C50; Wed, 13 Jan 2021 01:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10D1EPLi048822; Wed, 13 Jan 2021 01:14:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10D1EPCB048821; Wed, 13 Jan 2021 01:14:25 GMT (envelope-from git) Date: Wed, 13 Jan 2021 01:14:25 GMT Message-Id: <202101130114.10D1EPCB048821@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: 7aca3f4a7754 - stable/12 - Style. Improve some KASSERTs messages. 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/12 X-Git-Reftype: branch X-Git-Commit: 7aca3f4a77542ca4fc1575de9366eeeacb62a331 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 01:14:25 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7aca3f4a77542ca4fc1575de9366eeeacb62a331 commit 7aca3f4a77542ca4fc1575de9366eeeacb62a331 Author: Konstantin Belousov AuthorDate: 2020-12-31 00:45:47 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-13 01:08:26 +0000 Style. Improve some KASSERTs messages. (cherry picked from commit 993a1699b1948d30c4903440e8d8b23a7d5fc6c5) --- sys/kern/kern_proc.c | 8 +++----- sys/kern/kern_sig.c | 12 ++++++------ sys/kern/tty.c | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index a4cc1825e31f..566b9a8ea43a 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -533,12 +533,10 @@ enterthispgrp(struct proc *p, struct pgrp *pgrp) PGRP_LOCK_ASSERT(p->p_pgrp, MA_NOTOWNED); SESS_LOCK_ASSERT(p->p_session, MA_NOTOWNED); KASSERT(pgrp->pg_session == p->p_session, - ("%s: pgrp's session %p, p->p_session %p.\n", - __func__, - pgrp->pg_session, - p->p_session)); + ("%s: pgrp's session %p, p->p_session %p proc %p\n", + __func__, pgrp->pg_session, p->p_session, p)); KASSERT(pgrp != p->p_pgrp, - ("%s: p belongs to pgrp.", __func__)); + ("%s: p %p belongs to pgrp %p", __func__, p, pgrp)); doenterpgrp(p, pgrp); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 74647ca6822a..b84793285d8a 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2208,9 +2208,9 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) * is default; don't stop the process below if sleeping, * and don't clear any pending SIGCONT. */ - if ((prop & SIGPROP_TTYSTOP) && - (p->p_pgrp->pg_jobc == 0) && - (action == SIG_DFL)) { + if ((prop & SIGPROP_TTYSTOP) != 0 && + p->p_pgrp->pg_jobc == 0 && + action == SIG_DFL) { if (ksi && (ksi->ksi_flags & KSI_INS)) ksiginfo_tryfree(ksi); return (ret); @@ -2950,10 +2950,10 @@ issignal(struct thread *td) * should ignore tty stops. */ if (prop & SIGPROP_STOP) { - if (p->p_flag & - (P_TRACED | P_WEXIT | P_SINGLE_EXIT) || + if ((p->p_flag & (P_TRACED | P_WEXIT | + P_SINGLE_EXIT)) != 0 || (p->p_pgrp->pg_jobc == 0 && - prop & SIGPROP_TTYSTOP)) + (prop & SIGPROP_TTYSTOP) != 0)) break; /* == ignore */ if (TD_SBDRY_INTR(td)) { KASSERT((td->td_flags & TDF_SBDRY) != 0, diff --git a/sys/kern/tty.c b/sys/kern/tty.c index f82c1feca021..63324ac3e881 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -446,7 +446,7 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) } pg = p->p_pgrp; - if (p->p_flag & P_PPWAIT || pg->pg_jobc == 0) { + if ((p->p_flag & P_PPWAIT) != 0 || pg->pg_jobc == 0) { /* Don't allow the action to happen. */ PROC_UNLOCK(p); return (EIO); From owner-dev-commits-src-branches@freebsd.org Wed Jan 13 01:14:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C750F4EC962; Wed, 13 Jan 2021 01:14: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFqGp5J05z3DJ5; Wed, 13 Jan 2021 01:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8A966D32; Wed, 13 Jan 2021 01:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10D1EQ8C048844; Wed, 13 Jan 2021 01:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10D1EQYD048843; Wed, 13 Jan 2021 01:14:26 GMT (envelope-from git) Date: Wed, 13 Jan 2021 01:14:26 GMT Message-Id: <202101130114.10D1EQYD048843@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: cbba81681a13 - stable/12 - x86 identcpu.c: fix formatting of the comment. 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/12 X-Git-Reftype: branch X-Git-Commit: cbba81681a133cd79745a7007f4d4da0a970e754 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 01:14:26 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cbba81681a133cd79745a7007f4d4da0a970e754 commit cbba81681a133cd79745a7007f4d4da0a970e754 Author: Konstantin Belousov AuthorDate: 2021-01-06 14:52:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-13 01:09:07 +0000 x86 identcpu.c: fix formatting of the comment. (cherry picked from commit aa9450e44b5f017bb132ab5a00df68c9d7aa1d94) --- sys/x86/x86/identcpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index ad8bcc9a6888..2907575377b8 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -215,7 +215,7 @@ static struct { } cpu_vendors[] = { { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ - { HYGON_VENDOR_ID, CPU_VENDOR_HYGON }, /* HygonGenuine*/ + { HYGON_VENDOR_ID, CPU_VENDOR_HYGON }, /* HygonGenuine */ { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ #ifdef __i386__ { NSC_VENDOR_ID, CPU_VENDOR_NSC }, /* Geode by NSC */ From owner-dev-commits-src-branches@freebsd.org Wed Jan 13 01:14:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5759C4EC6F7; Wed, 13 Jan 2021 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFqGr13zdz3DKy; Wed, 13 Jan 2021 01:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6AD76C51; Wed, 13 Jan 2021 01:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10D1ERCT048866; Wed, 13 Jan 2021 01:14:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10D1ERrQ048865; Wed, 13 Jan 2021 01:14:27 GMT (envelope-from git) Date: Wed, 13 Jan 2021 01:14:27 GMT Message-Id: <202101130114.10D1ERrQ048865@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: 49038d1723a9 - stable/12 - tsc: use u_int for return type for prototype, same as in definitions. 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/12 X-Git-Reftype: branch X-Git-Commit: 49038d1723a9d45e064f482d510230ed5395b675 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 01:14:28 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49038d1723a9d45e064f482d510230ed5395b675 commit 49038d1723a9d45e064f482d510230ed5395b675 Author: Konstantin Belousov AuthorDate: 2021-01-05 20:44:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-13 01:09:29 +0000 tsc: use u_int for return type for prototype, same as in definitions. (cherry picked from commit 826fc3cc3d59c1d0af4caf3a08888e168bfe22b2) --- sys/x86/x86/tsc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 92e33dd9d373..cb1ba0758db9 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -90,12 +90,12 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status); static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status); -static unsigned tsc_get_timecount(struct timecounter *tc); -static inline unsigned tsc_get_timecount_low(struct timecounter *tc); -static unsigned tsc_get_timecount_lfence(struct timecounter *tc); -static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); -static unsigned tsc_get_timecount_mfence(struct timecounter *tc); -static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); +static u_int tsc_get_timecount(struct timecounter *tc); +static inline u_int tsc_get_timecount_low(struct timecounter *tc); +static u_int tsc_get_timecount_lfence(struct timecounter *tc); +static u_int tsc_get_timecount_low_lfence(struct timecounter *tc); +static u_int tsc_get_timecount_mfence(struct timecounter *tc); +static u_int tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); static uint32_t x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc); From owner-dev-commits-src-branches@freebsd.org Thu Jan 14 10:52:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA9B44DD5B0; Thu, 14 Jan 2021 10:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DGh2w4Xz3z3QLh; Thu, 14 Jan 2021 10:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F2D4B6B; Thu, 14 Jan 2021 10:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10EAq8Pl068458; Thu, 14 Jan 2021 10:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10EAq85M068457; Thu, 14 Jan 2021 10:52:08 GMT (envelope-from git) Date: Thu, 14 Jan 2021 10:52:08 GMT Message-Id: <202101141052.10EAq85M068457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: f9b0587dc2f9 - stable/12 - pfctl: Another set skip fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f9b0587dc2f98800f9f72944fd66a695200c554b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2021 10:52:08 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f9b0587dc2f98800f9f72944fd66a695200c554b commit f9b0587dc2f98800f9f72944fd66a695200c554b Author: Kristof Provost AuthorDate: 2021-01-11 13:09:08 +0000 Commit: Kristof Provost CommitDate: 2021-01-14 08:39:57 +0000 pfctl: Another set skip fix When retrieving the list of group members we cannot simply use ifa_lookup(), because it expects the interface to have an IP (v4 or v6) address. This means that interfaces with no address are not found. This presents as interfacing being alternately marked as skip and not whenever the rules are re-loaded. Happily we only need to fix ifa_grouplookup(). Teach it to also accept AF_LINK (i.e. interface) node_hosts. PR: 250994 MFC after: 3 days (cherry picked from commit 0c156a3c32cd0d9168570da5686ddc96abcbbc5a) --- sbin/pfctl/pfctl_parser.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index f9a60253da44..120178c50087 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1392,6 +1392,26 @@ ifa_exists(char *ifa_name) return (NULL); } +static struct node_host * +if_lookup(char *if_name) +{ + struct node_host *p, *n; + + for (p = iftab; p; p = p->next) { + if (! strcmp(if_name, p->ifname)) { + n = calloc(1, sizeof(struct node_host)); + bcopy(p, n, sizeof(struct node_host)); + + n->next = NULL; + n->tail = n; + + return (n); + } + } + + return (NULL); +} + struct node_host * ifa_grouplookup(char *ifa_name, int flags) { @@ -1415,7 +1435,7 @@ ifa_grouplookup(char *ifa_name, int flags) for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(struct ifg_req); ifg++) { len -= sizeof(struct ifg_req); - if ((n = ifa_lookup(ifg->ifgrq_member, flags)) == NULL) + if ((n = if_lookup(ifg->ifgrq_member)) == NULL) continue; if (h == NULL) h = n; From owner-dev-commits-src-branches@freebsd.org Thu Jan 14 18:32:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB8594EA7A9; Thu, 14 Jan 2021 18: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DGtGK5tY0z4lKH; Thu, 14 Jan 2021 18:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCE7C6BAA; Thu, 14 Jan 2021 18:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10EIWfc9064842; Thu, 14 Jan 2021 18:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10EIWfEK064839; Thu, 14 Jan 2021 18:32:41 GMT (envelope-from git) Date: Thu, 14 Jan 2021 18:32:41 GMT Message-Id: <202101141832.10EIWfEK064839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 15760e084c6a - stable/12 - pfctl: Call ifa_load() before ifa_grouplookup() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 15760e084c6a4bcc4d135e4a4e1204b35f72c062 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2021 18:32:41 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=15760e084c6a4bcc4d135e4a4e1204b35f72c062 commit 15760e084c6a4bcc4d135e4a4e1204b35f72c062 Author: Kristof Provost AuthorDate: 2020-04-19 15:37:13 +0000 Commit: Kristof Provost CommitDate: 2021-01-14 13:04:22 +0000 pfctl: Call ifa_load() before ifa_grouplookup() ifa_grouplookup() uses the data loaded in ifa_load() (through is_a_group()), so we must call ifa_load() before we can rely on any of the data it populates. Submitted by: Nick Rogers MFC after: 1 week Sponsored by: RG Nets (cherry picked from commit 8fd675d8a0538544a85483f7a9bed2bd48382926) --- sbin/pfctl/pfctl_parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 120178c50087..2efb97285798 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1456,15 +1456,16 @@ ifa_lookup(char *ifa_name, int flags) int got4 = 0, got6 = 0; const char *last_if = NULL; + /* first load iftab and isgroup_map */ + if (iftab == NULL) + ifa_load(); + if ((h = ifa_grouplookup(ifa_name, flags)) != NULL) return (h); if (!strncmp(ifa_name, "self", IFNAMSIZ)) ifa_name = NULL; - if (iftab == NULL) - ifa_load(); - for (p = iftab; p; p = p->next) { if (ifa_skip_if(ifa_name, p)) continue; From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 07:27:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFE5B4DAF01; Fri, 15 Jan 2021 07:27: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 4DHCSd4cWDz4XGk; Fri, 15 Jan 2021 07:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF1E18C03; Fri, 15 Jan 2021 07:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10F7RjOs066812; Fri, 15 Jan 2021 07:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10F7Rj6t066811; Fri, 15 Jan 2021 07:27:45 GMT (envelope-from git) Date: Fri, 15 Jan 2021 07:27:45 GMT Message-Id: <202101150727.10F7Rj6t066811@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: 0074d2118ac2 - stable/12 - linuxkpi: handle ARI 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/12 X-Git-Reftype: branch X-Git-Commit: 0074d2118ac24f23b43bc1923cc588dfebd73548 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 07:27:45 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0074d2118ac24f23b43bc1923cc588dfebd73548 commit 0074d2118ac24f23b43bc1923cc588dfebd73548 Author: Konstantin Belousov AuthorDate: 2021-01-04 21:41:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-15 06:57:01 +0000 linuxkpi: handle ARI (cherry picked from commit de27805fee0bbe3b714615b1df4cf0b8ebbc39b9) --- sys/compat/linuxkpi/common/src/linux_pci.c | 21 +++++++++++++++------ sys/conf/kmod.mk | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index d3b64e07b980..e73b324c47fb 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pcib_if.h" + static device_probe_t linux_pci_probe; static device_attach_t linux_pci_attach; static device_detach_t linux_pci_detach; @@ -234,12 +236,16 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, struct pci_bus *pbus; struct pci_devinfo *dinfo; device_t parent; + uintptr_t rid; int error; + bool isdrm; linux_set_current(curthread); - if (pdrv != NULL && pdrv->isdrm) { - parent = device_get_parent(dev); + parent = device_get_parent(dev); + isdrm = pdrv != NULL && pdrv->isdrm; + + if (isdrm) { dinfo = device_get_ivars(parent); device_set_ivars(dev, dinfo); } else { @@ -249,7 +255,11 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, pdev->dev.parent = &linux_root_device; pdev->dev.bsddev = dev; INIT_LIST_HEAD(&pdev->dev.irqents); - pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); + if (isdrm) + PCI_GET_ID(device_get_parent(parent), parent, PCI_ID_RID, &rid); + else + PCI_GET_ID(parent, dev, PCI_ID_RID, &rid); + pdev->devfn = rid; pdev->device = dinfo->cfg.device; pdev->vendor = dinfo->cfg.vendor; pdev->subsystem_vendor = dinfo->cfg.subvendor; @@ -474,9 +484,8 @@ pci_resource_start(struct pci_dev *pdev, int bar) if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return (0); - dev = pci_find_dbsf(pdev->bus->domain, pdev->bus->number, - PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); - MPASS(dev != NULL); + dev = pdev->pdrv != NULL && pdev->pdrv->isdrm ? + device_get_parent(pdev->dev.bsddev) : pdev->dev.bsddev; if (BUS_TRANSLATE_RESOURCE(dev, rle->type, rle->start, &newstart)) { device_printf(pdev->dev.bsddev, "translate of %#jx failed\n", (uintmax_t)rle->start); diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index fce55e529e29..610484ba7e36 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -113,6 +113,7 @@ LINUXKPI_GENSRCS+= \ device_if.h \ pci_if.h \ pci_iov_if.h \ + pcib_if.h \ vnode_if.h \ usb_if.h \ opt_usb.h \ From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:26:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F101C4E7235; Fri, 15 Jan 2021 14:26: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 4DHNmH67VDz51SK; Fri, 15 Jan 2021 14:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C50371DDC3; Fri, 15 Jan 2021 14:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FEQtqo013687; Fri, 15 Jan 2021 14:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FEQtYF013686; Fri, 15 Jan 2021 14:26:55 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:26:55 GMT Message-Id: <202101151426.10FEQtYF013686@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: e7c49bf5d78c - stable/12 - clang-format libc string functions imported from musl 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/12 X-Git-Reftype: branch X-Git-Commit: e7c49bf5d78cca59832d568c282a296a3f74529f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:26:56 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e7c49bf5d78cca59832d568c282a296a3f74529f commit e7c49bf5d78cca59832d568c282a296a3f74529f Author: Ed Maste AuthorDate: 2020-11-18 22:01:34 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:35 +0000 clang-format libc string functions imported from musl We have adopted these and don't consider them 'contrib' code, so bring them closer to style(9). This is a followon to r315467 and r351700. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4874ddfd373c582d9cd7fe915d2259295d75d1e5) --- lib/libc/string/memchr.c | 25 ++++---- lib/libc/string/memmem.c | 147 ++++++++++++++++++++++++++++------------------- lib/libc/string/strstr.c | 147 +++++++++++++++++++++++++++++------------------ 3 files changed, 194 insertions(+), 125 deletions(-) diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c index d89d09775272..4b5d6f6a4c8a 100644 --- a/lib/libc/string/memchr.c +++ b/lib/libc/string/memchr.c @@ -25,30 +25,35 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include +#include +#include #define SS (sizeof(size_t)) -#define ALIGN (sizeof(size_t)-1) -#define ONES ((size_t)-1/UCHAR_MAX) -#define HIGHS (ONES * (UCHAR_MAX/2+1)) -#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS) +#define ALIGN (sizeof(size_t) - 1) +#define ONES ((size_t)-1 / UCHAR_MAX) +#define HIGHS (ONES * (UCHAR_MAX / 2 + 1)) +#define HASZERO(x) (((x)-ONES) & ~(x)&HIGHS) -void *memchr(const void *src, int c, size_t n) +void * +memchr(const void *src, int c, size_t n) { const unsigned char *s = src; c = (unsigned char)c; #ifdef __GNUC__ - for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--); + for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--) + ; if (n && *s != c) { typedef size_t __attribute__((__may_alias__)) word; const word *w; size_t k = ONES * c; - for (w = (const void *)s; n>=SS && !HASZERO(*w^k); w++, n-=SS); + for (w = (const void *)s; n >= SS && !HASZERO(*w ^ k); + w++, n -= SS) + ; s = (const void *)w; } #endif - for (; n && *s != c; s++, n--); + for (; n && *s != c; s++, n--) + ; return n ? (void *)s : 0; } diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c index e0a65a6a3f91..27863b9db623 100644 --- a/lib/libc/string/memmem.c +++ b/lib/libc/string/memmem.c @@ -25,40 +25,47 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include -static char *twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) +static char * +twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { - uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1]; - for (h+=2, k-=2; k; k--, hw = hw<<8 | *h++) - if (hw == nw) return (char *)h-2; - return hw == nw ? (char *)h-2 : 0; + uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1]; + for (h += 2, k -= 2; k; k--, hw = hw << 8 | *h++) + if (hw == nw) + return (char *)h - 2; + return hw == nw ? (char *)h - 2 : 0; } -static char *threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) +static char * +threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { - uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8; - uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8; - for (h+=3, k-=3; k; k--, hw = (hw|*h++)<<8) - if (hw == nw) return (char *)h-3; - return hw == nw ? (char *)h-3 : 0; + uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8; + uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8; + for (h += 3, k -= 3; k; k--, hw = (hw | *h++) << 8) + if (hw == nw) + return (char *)h - 3; + return hw == nw ? (char *)h - 3 : 0; } -static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) +static char * +fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { - uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3]; - uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3]; - for (h+=4, k-=4; k; k--, hw = hw<<8 | *h++) - if (hw == nw) return (char *)h-4; - return hw == nw ? (char *)h-4 : 0; + uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; + uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; + for (h += 4, k -= 4; k; k--, hw = hw << 8 | *h++) + if (hw == nw) + return (char *)h - 4; + return hw == nw ? (char *)h - 4 : 0; } -#define MAX(a,b) ((a)>(b)?(a):(b)) -#define MIN(a,b) ((a)<(b)?(a):(b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define BITOP(a,b,op) \ - ((a)[(size_t)(b)/(8*sizeof *(a))] op (size_t)1<<((size_t)(b)%(8*sizeof *(a)))) +#define BITOP(a, b, op) \ + ((a)[(size_t)(b) / (8 * sizeof *(a))] op \ + (size_t)1 << ((size_t)(b) % (8 * sizeof *(a)))) /* * Two Way string search algorithm, with a bad shift table applied to the last @@ -68,25 +75,30 @@ static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned ch * Reference: CROCHEMORE M., PERRIN D., 1991, Two-way string-matching, * Journal of the ACM 38(3):651-675 */ -static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const unsigned char *n, size_t l) +static char * +twoway_memmem(const unsigned char *h, const unsigned char *z, + const unsigned char *n, size_t l) { size_t i, ip, jp, k, p, ms, p0, mem, mem0; size_t byteset[32 / sizeof(size_t)] = { 0 }; size_t shift[256]; /* Computing length of needle and fill shift table */ - for (i=0; i n[jp+k]) { + } else + k++; + } else if (n[ip + k] > n[jp + k]) { jp += k; k = 1; p = jp - ip; @@ -99,14 +111,17 @@ static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const p0 = p; /* And with the opposite comparison */ - ip = -1; jp = 0; k = p = 1; - while (jp+k ms+1) ms = ip; - else p = p0; + if (ip + 1 > ms + 1) + ms = ip; + else + p = p0; /* Periodic needle? */ - if (memcmp(n, n+p, ms+1)) { + if (memcmp(n, n + p, ms + 1)) { mem0 = 0; - p = MAX(ms, l-ms-1) + 1; - } else mem0 = l-p; + p = MAX(ms, l - ms - 1) + 1; + } else + mem0 = l - p; mem = 0; /* Search loop */ for (;;) { /* If remainder of haystack is shorter than needle, done */ - if (z-h < l) return 0; + if (z - h < l) + return 0; /* Check last byte first; advance by shift on mismatch */ - if (BITOP(byteset, h[l-1], &)) { - k = l-shift[h[l-1]]; + if (BITOP(byteset, h[l - 1], &)) { + k = l - shift[h[l - 1]]; if (k) { - if (mem0 && mem && k < p) k = l-p; + if (mem0 && mem && k < p) + k = l - p; h += k; mem = 0; continue; @@ -146,38 +166,49 @@ static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const } /* Compare right half */ - for (k=MAX(ms+1,mem); kmem && n[k-1] == h[k-1]; k--); - if (k <= mem) return (char *)h; + for (k = ms + 1; k > mem && n[k - 1] == h[k - 1]; k--) + ; + if (k <= mem) + return (char *)h; h += p; mem = mem0; } } -void *memmem(const void *h0, size_t k, const void *n0, size_t l) +void * +memmem(const void *h0, size_t k, const void *n0, size_t l) { const unsigned char *h = h0, *n = n0; /* Return immediately on empty needle */ - if (!l) return (void *)h; + if (!l) + return (void *)h; /* Return immediately when needle is longer than haystack */ - if (k __FBSDID("$FreeBSD$"); -#include #include +#include -static char *twobyte_strstr(const unsigned char *h, const unsigned char *n) +static char * +twobyte_strstr(const unsigned char *h, const unsigned char *n) { - uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1]; - for (h++; *h && hw != nw; hw = hw<<8 | *++h); - return *h ? (char *)h-1 : 0; + uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1]; + for (h++; *h && hw != nw; hw = hw << 8 | *++h) + ; + return *h ? (char *)h - 1 : 0; } -static char *threebyte_strstr(const unsigned char *h, const unsigned char *n) +static char * +threebyte_strstr(const unsigned char *h, const unsigned char *n) { - uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8; - uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8; - for (h+=2; *h && hw != nw; hw = (hw|*++h)<<8); - return *h ? (char *)h-2 : 0; + uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8; + uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8; + for (h += 2; *h && hw != nw; hw = (hw | *++h) << 8) + ; + return *h ? (char *)h - 2 : 0; } -static char *fourbyte_strstr(const unsigned char *h, const unsigned char *n) +static char * +fourbyte_strstr(const unsigned char *h, const unsigned char *n) { - uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3]; - uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3]; - for (h+=3; *h && hw != nw; hw = hw<<8 | *++h); - return *h ? (char *)h-3 : 0; + uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; + uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; + for (h += 3; *h && hw != nw; hw = hw << 8 | *++h) + ; + return *h ? (char *)h - 3 : 0; } -#define MAX(a,b) ((a)>(b)?(a):(b)) -#define MIN(a,b) ((a)<(b)?(a):(b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define BITOP(a,b,op) \ - ((a)[(size_t)(b)/(8*sizeof *(a))] op (size_t)1<<((size_t)(b)%(8*sizeof *(a)))) +#define BITOP(a, b, op) \ + ((a)[(size_t)(b) / (8 * sizeof *(a))] op \ + (size_t)1 << ((size_t)(b) % (8 * sizeof *(a)))) /* * Two Way string search algorithm, with a bad shift table applied to the last @@ -65,7 +72,8 @@ static char *fourbyte_strstr(const unsigned char *h, const unsigned char *n) * Reference: CROCHEMORE M., PERRIN D., 1991, Two-way string-matching, * Journal of the ACM 38(3):651-675 */ -static char *twoway_strstr(const unsigned char *h, const unsigned char *n) +static char * +twoway_strstr(const unsigned char *h, const unsigned char *n) { const unsigned char *z; size_t l, ip, jp, k, p, ms, p0, mem, mem0; @@ -73,19 +81,23 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) size_t shift[256]; /* Computing length of needle and fill shift table */ - for (l=0; n[l] && h[l]; l++) - BITOP(byteset, n[l], |=), shift[n[l]] = l+1; - if (n[l]) return 0; /* hit the end of h */ + for (l = 0; n[l] && h[l]; l++) + BITOP(byteset, n[l], |=), shift[n[l]] = l + 1; + if (n[l]) + return 0; /* hit the end of h */ /* Compute maximal suffix */ - ip = -1; jp = 0; k = p = 1; - while (jp+k n[jp+k]) { + } else + k++; + } else if (n[ip + k] > n[jp + k]) { jp += k; k = 1; p = jp - ip; @@ -98,14 +110,17 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) p0 = p; /* And with the opposite comparison */ - ip = -1; jp = 0; k = p = 1; - while (jp+k ms+1) ms = ip; - else p = p0; + if (ip + 1 > ms + 1) + ms = ip; + else + p = p0; /* Periodic needle? */ - if (memcmp(n, n+p, ms+1)) { + if (memcmp(n, n + p, ms + 1)) { mem0 = 0; - p = MAX(ms, l-ms-1) + 1; - } else mem0 = l-p; + p = MAX(ms, l - ms - 1) + 1; + } else + mem0 = l - p; mem = 0; /* Initialize incremental end-of-haystack pointer */ @@ -130,21 +148,24 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) /* Search loop */ for (;;) { /* Update incremental end-of-haystack pointer */ - if (z-h < l) { + if (z - h < l) { /* Fast estimate for MIN(l,63) */ size_t grow = l | 63; const unsigned char *z2 = memchr(z, 0, grow); if (z2) { z = z2; - if (z-h < l) return 0; - } else z += grow; + if (z - h < l) + return 0; + } else + z += grow; } /* Check last byte first; advance by shift on mismatch */ - if (BITOP(byteset, h[l-1], &)) { - k = l-shift[h[l-1]]; + if (BITOP(byteset, h[l - 1], &)) { + k = l - shift[h[l - 1]]; if (k) { - if (k < mem) k = mem; + if (k < mem) + k = mem; h += k; mem = 0; continue; @@ -156,34 +177,46 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) } /* Compare right half */ - for (k=MAX(ms+1,mem); n[k] && n[k] == h[k]; k++); + for (k = MAX(ms + 1, mem); n[k] && n[k] == h[k]; k++) + ; if (n[k]) { - h += k-ms; + h += k - ms; mem = 0; continue; } /* Compare left half */ - for (k=ms+1; k>mem && n[k-1] == h[k-1]; k--); - if (k <= mem) return (char *)h; + for (k = ms + 1; k > mem && n[k - 1] == h[k - 1]; k--) + ; + if (k <= mem) + return (char *)h; h += p; mem = mem0; } } -char *strstr(const char *h, const char *n) +char * +strstr(const char *h, const char *n) { /* Return immediately on empty needle */ - if (!n[0]) return (char *)h; + if (!n[0]) + return (char *)h; /* Use faster algorithms for short needles */ h = strchr(h, *n); - if (!h || !n[1]) return (char *)h; - if (!h[1]) return 0; - if (!n[2]) return twobyte_strstr((void *)h, (void *)n); - if (!h[2]) return 0; - if (!n[3]) return threebyte_strstr((void *)h, (void *)n); - if (!h[3]) return 0; - if (!n[4]) return fourbyte_strstr((void *)h, (void *)n); + if (!h || !n[1]) + return (char *)h; + if (!h[1]) + return 0; + if (!n[2]) + return twobyte_strstr((void *)h, (void *)n); + if (!h[2]) + return 0; + if (!n[3]) + return threebyte_strstr((void *)h, (void *)n); + if (!h[3]) + return 0; + if (!n[4]) + return fourbyte_strstr((void *)h, (void *)n); return twoway_strstr((void *)h, (void *)n); } From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:26:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F09BE4E6AB8; Fri, 15 Jan 2021 14:26: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 4DHNmJ6Y2Xz51Cf; Fri, 15 Jan 2021 14:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D45631D9DE; Fri, 15 Jan 2021 14:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FEQuqL013709; Fri, 15 Jan 2021 14:26:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FEQuD1013708; Fri, 15 Jan 2021 14:26:56 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:26:56 GMT Message-Id: <202101151426.10FEQuD1013708@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: 13bc5a7358e5 - stable/12 - libc: optimize memmem two-way bad character shift 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/12 X-Git-Reftype: branch X-Git-Commit: 13bc5a7358e5a39feec12b77b097c70dd111305e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:26:57 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=13bc5a7358e5a39feec12b77b097c70dd111305e commit 13bc5a7358e5a39feec12b77b097c70dd111305e Author: Ed Maste AuthorDate: 2020-11-19 00:02:12 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:35 +0000 libc: optimize memmem two-way bad character shift first, the condition (mem && k < p) is redundant, because mem being nonzero implies the needle is periodic with period exactly p, in which case any byte that appears in the needle must appear in the last p bytes of the needle, bounding the shift (k) by p. second, the whole point of replacing the shift k by mem (=l-p) is to prevent shifting by less than mem when discarding the memory on shift, in which case linear time could not be guaranteed. but as written, the check also replaced shifts greater than mem by mem, reducing the benefit of the shift. there is no possible benefit to this reduction of the shift; since mem is being cleared, the full shift is valid and more optimal. so only replace the shift by mem when it would be less than mem. musl commits: 8f5a820d147da36bcdbddd201b35d293699dacd8 122d67f846cb0be2c9e1c3880db9eb9545bbe38c Obtained from: musl (cherry picked from commit 7dbcd06e63101d51e6a777f7315cfde794411e53) --- lib/libc/string/memmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c index 27863b9db623..9e7bf94b1464 100644 --- a/lib/libc/string/memmem.c +++ b/lib/libc/string/memmem.c @@ -153,8 +153,8 @@ twoway_memmem(const unsigned char *h, const unsigned char *z, if (BITOP(byteset, h[l - 1], &)) { k = l - shift[h[l - 1]]; if (k) { - if (mem0 && mem && k < p) - k = l - p; + if (k < mem) + k = mem; h += k; mem = 0; continue; From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:26:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EA664E731A; Fri, 15 Jan 2021 14:26: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 4DHNmL1Y4jz5128; Fri, 15 Jan 2021 14:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08DB21D9DF; Fri, 15 Jan 2021 14:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FEQvbL013728; Fri, 15 Jan 2021 14:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FEQvqE013727; Fri, 15 Jan 2021 14:26:57 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:26:57 GMT Message-Id: <202101151426.10FEQvqE013727@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: 56880a501396 - stable/12 - libc: fix undefined behavior from signed overflow in strstr and memmem 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/12 X-Git-Reftype: branch X-Git-Commit: 56880a50139647318a123d67fe459ca840351729 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:27:00 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=56880a50139647318a123d67fe459ca840351729 commit 56880a50139647318a123d67fe459ca840351729 Author: Ed Maste AuthorDate: 2020-11-19 00:03:15 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:35 +0000 libc: fix undefined behavior from signed overflow in strstr and memmem unsigned char promotes to int, which can overflow when shifted left by 24 bits or more. this has been reported multiple times but then forgotten. it's expected to be benign UB, but can trap when built with explicit overflow catching (ubsan or similar). fix it now. note that promotion to uint32_t is safe and portable even outside of the assumptions usually made in musl, since either uint32_t has rank at least unsigned int, so that no further default promotions happen, or int is wide enough that the shift can't overflow. this is a desirable property to have in case someone wants to reuse the code elsewhere. musl commit: 593caa456309714402ca4cb77c3770f4c24da9da Obtained from: musl (cherry picked from commit 33482dae89c26158a22ccb3b7f2ca6e6652f29b4) --- lib/libc/string/memmem.c | 8 ++++---- lib/libc/string/strstr.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c index 9e7bf94b1464..be52763e2652 100644 --- a/lib/libc/string/memmem.c +++ b/lib/libc/string/memmem.c @@ -41,8 +41,8 @@ twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) static char * threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { - uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8; - uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8; + uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8; + uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8; for (h += 3, k -= 3; k; k--, hw = (hw | *h++) << 8) if (hw == nw) return (char *)h - 3; @@ -52,8 +52,8 @@ threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) static char * fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { - uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; - uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; + uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; + uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; for (h += 4, k -= 4; k; k--, hw = hw << 8 | *h++) if (hw == nw) return (char *)h - 4; diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c index d726aff1f1c3..72f8abb9e200 100644 --- a/lib/libc/string/strstr.c +++ b/lib/libc/string/strstr.c @@ -40,8 +40,8 @@ twobyte_strstr(const unsigned char *h, const unsigned char *n) static char * threebyte_strstr(const unsigned char *h, const unsigned char *n) { - uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8; - uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8; + uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8; + uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8; for (h += 2; *h && hw != nw; hw = (hw | *++h) << 8) ; return *h ? (char *)h - 2 : 0; @@ -50,8 +50,8 @@ threebyte_strstr(const unsigned char *h, const unsigned char *n) static char * fourbyte_strstr(const unsigned char *h, const unsigned char *n) { - uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; - uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; + uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; + uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; for (h += 3; *h && hw != nw; hw = hw << 8 | *++h) ; return *h ? (char *)h - 3 : 0; From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:27:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CB264E6AD6; Fri, 15 Jan 2021 14:27: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 4DHNmN1X0bz516X; Fri, 15 Jan 2021 14:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 316721DF17; Fri, 15 Jan 2021 14:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FEQxPP013750; Fri, 15 Jan 2021 14:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FEQxZh013749; Fri, 15 Jan 2021 14:26:59 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:26:59 GMT Message-Id: <202101151426.10FEQxZh013749@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: 7366c22508e9 - stable/12 - diff: honour flags with -q 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/12 X-Git-Reftype: branch X-Git-Commit: 7366c22508e98357a17664b683841b47d268b5f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:27:01 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7366c22508e98357a17664b683841b47d268b5f8 commit 7366c22508e98357a17664b683841b47d268b5f8 Author: Ed Maste AuthorDate: 2021-01-09 16:22:28 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:35 +0000 diff: honour flags with -q Previously -q (just print a line when files differ) ignored flags like -w (ignore whitespace). Avoid the D_BRIEF short-circuit when flags are in effect. PR: 252515 Reported by: Scott Aitken Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28064 (cherry picked from commit 12a8d3027d414abd15798de1b6d8b01151bdac50) --- usr.bin/diff/diffreg.c | 4 +++- usr.bin/diff/tests/diff_test.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 74c0df7dce30..7d2b20b43def 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -369,7 +369,9 @@ diffreg(char *file1, char *file2, int flags, int capsicum) goto closem; } - if (diff_format == D_BRIEF && ignore_pats == NULL) { + if (diff_format == D_BRIEF && ignore_pats == NULL && + (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0) + { rval = D_DIFFER; status |= 1; goto closem; diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 9f460231f480..7ee88d1fe607 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -9,6 +9,7 @@ atf_test_case group_format atf_test_case side_by_side atf_test_case brief_format atf_test_case b230049 +atf_test_case b252515 atf_test_case Bflag atf_test_case Nflag atf_test_case tabsize @@ -65,6 +66,14 @@ b230049_body() b230049_a.in b230049_b.in } +b252515_body() +{ + printf 'a b\n' > b252515_a.in + printf 'a b\n' > b252515_b.in + atf_check -o empty -s eq:0 \ + diff -qw b252515_a.in b252515_b.in +} + header_body() { export TZ=UTC @@ -228,6 +237,7 @@ atf_init_test_cases() atf_add_test_case side_by_side atf_add_test_case brief_format atf_add_test_case b230049 + atf_add_test_case b252515 atf_add_test_case Bflag atf_add_test_case Nflag atf_add_test_case tabsize From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:27:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25EDE4E731D; Fri, 15 Jan 2021 14:27: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 4DHNmP51pTz51LL; Fri, 15 Jan 2021 14:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 518301DB79; Fri, 15 Jan 2021 14:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FER02E013772; Fri, 15 Jan 2021 14:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FER076013771; Fri, 15 Jan 2021 14:27:00 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:27:00 GMT Message-Id: <202101151427.10FER076013771@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: c586a84d56f3 - stable/12 - cmp: use C99 bool for flags 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/12 X-Git-Reftype: branch X-Git-Commit: c586a84d56f37eee73d880172ec7f2a8152e58ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:27:02 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c586a84d56f37eee73d880172ec7f2a8152e58ab commit c586a84d56f37eee73d880172ec7f2a8152e58ab Author: Ed Maste AuthorDate: 2021-01-11 00:02:55 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:36 +0000 cmp: use C99 bool for flags Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28072 (cherry picked from commit 1f7661742de650bcb6b9124ee3da7e94c8650c4b) --- usr.bin/cmp/cmp.c | 27 ++++++++++++++------------- usr.bin/cmp/extern.h | 2 +- usr.bin/cmp/link.c | 1 + usr.bin/cmp/misc.c | 1 + 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index e1f9fb6823ef..c762f1346abf 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -int lflag, sflag, xflag, zflag; +bool lflag, sflag, xflag, zflag; static const struct option long_opts[] = { @@ -77,7 +77,8 @@ main(int argc, char *argv[]) { struct stat sb1, sb2; off_t skip1, skip2; - int ch, fd1, fd2, oflag, special; + int ch, fd1, fd2, oflag; + bool special; const char *file1, *file2; oflag = O_RDONLY; @@ -87,18 +88,18 @@ main(int argc, char *argv[]) oflag |= O_NOFOLLOW; break; case 'l': /* print all differences */ - lflag = 1; + lflag = true; break; case 's': /* silent run */ - sflag = 1; - zflag = 1; + sflag = true; + zflag = true; break; case 'x': /* hex output */ - lflag = 1; - xflag = 1; + lflag = true; + xflag = true; break; case 'z': /* compare size first */ - zflag = 1; + zflag = true; break; case '?': default: @@ -120,9 +121,9 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit rights on stderr"); /* Backward compatibility -- handle "-" meaning stdin. */ - special = 0; + special = false; if (strcmp(file1 = argv[0], "-") == 0) { - special = 1; + special = true; fd1 = STDIN_FILENO; file1 = "stdin"; } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { @@ -135,7 +136,7 @@ main(int argc, char *argv[]) if (special) errx(ERR_EXIT, "standard input may only be specified once"); - special = 1; + special = true; fd2 = STDIN_FILENO; file2 = "stdin"; } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { @@ -174,7 +175,7 @@ main(int argc, char *argv[]) exit(ERR_EXIT); } if (!S_ISREG(sb1.st_mode)) - special = 1; + special = true; else { if (fstat(fd2, &sb2)) { if (!sflag) @@ -183,7 +184,7 @@ main(int argc, char *argv[]) exit(ERR_EXIT); } if (!S_ISREG(sb2.st_mode)) - special = 1; + special = true; } } diff --git a/usr.bin/cmp/extern.h b/usr.bin/cmp/extern.h index 84507b1929dc..82c5ea42b175 100644 --- a/usr.bin/cmp/extern.h +++ b/usr.bin/cmp/extern.h @@ -44,4 +44,4 @@ void c_special(int, const char *, off_t, int, const char *, off_t); void diffmsg(const char *, const char *, off_t, off_t); void eofmsg(const char *); -extern int lflag, sflag, xflag, zflag; +extern bool lflag, sflag, xflag, zflag; diff --git a/usr.bin/cmp/link.c b/usr.bin/cmp/link.c index 3aecf4f10738..9193147e830e 100644 --- a/usr.bin/cmp/link.c +++ b/usr.bin/cmp/link.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/usr.bin/cmp/misc.c b/usr.bin/cmp/misc.c index a99ab4facb73..1e84f0d7a527 100644 --- a/usr.bin/cmp/misc.c +++ b/usr.bin/cmp/misc.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 14:27:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F96C4E71E4; Fri, 15 Jan 2021 14:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHNmQ6nRBz51LP; Fri, 15 Jan 2021 14:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 605A21D9E0; Fri, 15 Jan 2021 14:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FER18k013790; Fri, 15 Jan 2021 14:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FER1KJ013789; Fri, 15 Jan 2021 14:27:01 GMT (envelope-from git) Date: Fri, 15 Jan 2021 14:27:01 GMT Message-Id: <202101151427.10FER1KJ013789@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: 23b5fa56a182 - stable/12 - cmp: fix -s (silent) when used with skip offsets 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/12 X-Git-Reftype: branch X-Git-Commit: 23b5fa56a182574fef416caeb55e6c735087e411 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 14:27:04 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=23b5fa56a182574fef416caeb55e6c735087e411 commit 23b5fa56a182574fef416caeb55e6c735087e411 Author: Ed Maste AuthorDate: 2021-01-11 00:02:56 +0000 Commit: Ed Maste CommitDate: 2021-01-15 14:25:36 +0000 cmp: fix -s (silent) when used with skip offsets -s causes cmp to print nothing for differing files, for use when only the exit status is of interest. -z compares the file size first, for regular files, and fails the comparison early if they do not match. Prior to this change -s implied -z as an optimization, but this is not valid when file offsets are specified. Now, enable the -z optimization for -s only if both skip arguments are not provided / 0. Note that using -z with differing skip values will currently always fail. We may want to compare size1 - skip1 with size2 - skip2 instaead, and in any case the man page should be clarified. PR: 252542 Fixes: 3e6902efc802ab57fc4e9bf798f2d271b152e7f9 Reported by: William Ahern Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28071 (cherry picked from commit 80445b7a3f738e0b0a33ee7a11905a275346a6de) --- usr.bin/cmp/cmp.c | 4 +++- usr.bin/cmp/tests/cmp_test2.sh | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index c762f1346abf..47f9b671985c 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -92,7 +92,6 @@ main(int argc, char *argv[]) break; case 's': /* silent run */ sflag = true; - zflag = true; break; case 'x': /* hex output */ lflag = true; @@ -149,6 +148,9 @@ main(int argc, char *argv[]) skip1 = argc > 2 ? strtol(argv[2], NULL, 0) : 0; skip2 = argc == 4 ? strtol(argv[3], NULL, 0) : 0; + if (sflag && skip1 == 0 && skip2 == 0) + zflag = true; + if (fd1 == -1) { if (fd2 == -1) { c_link(file1, skip1, file2, skip2); diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 2b0d66382d36..7f9801fc92bd 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -62,8 +62,22 @@ symlink_body() { atf_check -s not-exit:0 -o ignore -e ignore cmp -h a.lnk adup.lnk } +atf_test_case pr252542 +pr252542_head() +{ + atf_set "descr" "Test cmp(1) -s with file offset skips" +} +pr252542_body() +{ + echo -n '1234567890' > a + echo -n 'abc567890' > b + atf_check -s exit:0 cmp -s a b 4 3 + atf_check -s exit:1 -o ignore cmp -z a b 4 3 +} + atf_init_test_cases() { atf_add_test_case special atf_add_test_case symlink + atf_add_test_case pr252542 } From owner-dev-commits-src-branches@freebsd.org Fri Jan 15 20:59:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A5EF4F2B6A; Fri, 15 Jan 2021 20:59: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 4DHYT50F75z3pmj; Fri, 15 Jan 2021 20:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF1ED23172; Fri, 15 Jan 2021 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FKxKWC020957; Fri, 15 Jan 2021 20:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FKxKCs020956; Fri, 15 Jan 2021 20:59:20 GMT (envelope-from git) Date: Fri, 15 Jan 2021 20:59:20 GMT Message-Id: <202101152059.10FKxKCs020956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: b791b5763f2b - stable/12 - netmap: pkt-gen: fix offset hex formatting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b791b5763f2bf3a3e8c45e00f66f5a63f2a12bf1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 20:59:21 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=b791b5763f2bf3a3e8c45e00f66f5a63f2a12bf1 commit b791b5763f2bf3a3e8c45e00f66f5a63f2a12bf1 Author: Vincenzo Maffione AuthorDate: 2021-01-12 22:02:28 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-15 20:58:56 +0000 netmap: pkt-gen: fix offset hex formatting PR: 252594 Reported by: brpoole@vt.edu MFC after: 3 days --- tools/tools/netmap/pkt-gen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c index e6237b8ba281..55504c09ae58 100644 --- a/tools/tools/netmap/pkt-gen.c +++ b/tools/tools/netmap/pkt-gen.c @@ -3176,17 +3176,17 @@ main(int arc, char **argv) struct netmap_if *nifp = g.nmd->nifp; struct nmreq_register *req = &g.nmd->reg; - D("nifp at offset %"PRIu64", %d tx %d rx region %d", + D("nifp at offset %"PRIu64" ntxqs %d nrxqs %d memid %d", req->nr_offset, req->nr_tx_rings, req->nr_rx_rings, req->nr_mem_id); for (i = 0; i < req->nr_tx_rings + req->nr_host_tx_rings; i++) { struct netmap_ring *ring = NETMAP_TXRING(nifp, i); - D(" TX%d at 0x%p slots %d", i, + D(" TX%d at offset %p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); } for (i = 0; i < req->nr_rx_rings + req->nr_host_rx_rings; i++) { struct netmap_ring *ring = NETMAP_RXRING(nifp, i); - D(" RX%d at 0x%p slots %d", i, + D(" RX%d at offset %p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); } } From owner-dev-commits-src-branches@freebsd.org Sat Jan 16 06:41:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B79024D5B62; Sat, 16 Jan 2021 06:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHpP34sgSz3CH0; Sat, 16 Jan 2021 06:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99DD228AF; Sat, 16 Jan 2021 06:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10G6fh52086768; Sat, 16 Jan 2021 06:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10G6fhk8086766; Sat, 16 Jan 2021 06:41:43 GMT (envelope-from git) Date: Sat, 16 Jan 2021 06:41:43 GMT Message-Id: <202101160641.10G6fhk8086766@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: ecdc6d1ddde6 - stable/12 - Add tcgetwinsize(3) and tcsetwinsize(3) to termios 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/12 X-Git-Reftype: branch X-Git-Commit: ecdc6d1ddde65a345904a9a805f9efd522da8eed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 06:41:43 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ecdc6d1ddde65a345904a9a805f9efd522da8eed commit ecdc6d1ddde65a345904a9a805f9efd522da8eed Author: Konstantin Belousov AuthorDate: 2020-12-24 23:05:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-16 06:38:49 +0000 Add tcgetwinsize(3) and tcsetwinsize(3) to termios (cherry picked from commit 7d7fad7bd969fb464f64d34932234060cee112af) --- include/termios.h | 6 ++++++ lib/libc/gen/Symbol.map | 2 ++ lib/libc/gen/termios.c | 14 ++++++++++++++ sys/sys/_winsize.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/ttycom.h | 12 +----------- 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/include/termios.h b/include/termios.h index ce31d447f60a..9b808329a426 100644 --- a/include/termios.h +++ b/include/termios.h @@ -38,6 +38,9 @@ #include #include #include +#if __BSD_VISIBLE +#include +#endif #ifndef _PID_T_DECLARED typedef __pid_t pid_t; @@ -92,6 +95,9 @@ int tcsetsid(int, pid_t); void cfmakeraw(struct termios *); void cfmakesane(struct termios *); int cfsetspeed(struct termios *, speed_t); + +int tcgetwinsize(int, struct winsize *); +int tcsetwinsize(int, const struct winsize *); #endif __END_DECLS diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index cbc230c3f07f..22de2fd79755 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -429,6 +429,8 @@ FBSD_1.6 { sigandset; sigisemptyset; sigorset; + tcgetwinsize; + tcsetwinsize; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c index 7b98c486f472..f072b2f045d9 100644 --- a/lib/libc/gen/termios.c +++ b/lib/libc/gen/termios.c @@ -275,3 +275,17 @@ tcflow(int fd, int action) } /* NOTREACHED */ } + +int +tcgetwinsize(int fd, struct winsize *w) +{ + + return (_ioctl(fd, TIOCGWINSZ, w)); +} + +int +tcsetwinsize(int fd, const struct winsize *w) +{ + + return (_ioctl(fd, TIOCSWINSZ, w)); +} diff --git a/sys/sys/_winsize.h b/sys/sys/_winsize.h new file mode 100644 index 000000000000..78d0b8a6ec38 --- /dev/null +++ b/sys/sys/_winsize.h @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1988, 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)ttycom.h 8.1 (Berkeley) 3/28/94 + * $FreeBSD$ + */ + +#ifndef _SYS__WINSIZE_H_ +#define _SYS__WINSIZE_H_ + +/* + * Window/terminal size structure. This information is stored by the kernel + * in order to provide a consistent interface, but is not used by the kernel. + */ +struct winsize { + unsigned short ws_row; /* rows, in characters */ + unsigned short ws_col; /* columns, in characters */ + unsigned short ws_xpixel; /* horizontal size, pixels */ + unsigned short ws_ypixel; /* vertical size, pixels */ +}; + +#endif /* !_SYS__WINSIZE_H_ */ diff --git a/sys/sys/ttycom.h b/sys/sys/ttycom.h index 5aabb074a009..a7309d4c5d6b 100644 --- a/sys/sys/ttycom.h +++ b/sys/sys/ttycom.h @@ -41,23 +41,13 @@ #define _SYS_TTYCOM_H_ #include +#include /* * Tty ioctl's except for those supported only for backwards compatibility * with the old tty driver. */ -/* - * Window/terminal size structure. This information is stored by the kernel - * in order to provide a consistent interface, but is not used by the kernel. - */ -struct winsize { - unsigned short ws_row; /* rows, in characters */ - unsigned short ws_col; /* columns, in characters */ - unsigned short ws_xpixel; /* horizontal size, pixels */ - unsigned short ws_ypixel; /* vertical size, pixels */ -}; - /* 0-2 compat */ /* 3-7 unused */ /* 8-10 compat */ From owner-dev-commits-src-branches@freebsd.org Sat Jan 16 06:41:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E51414D5C5C; Sat, 16 Jan 2021 06:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHpP45w22z3Bnj; Sat, 16 Jan 2021 06:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADEB25D3; Sat, 16 Jan 2021 06:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10G6fi3U086789; Sat, 16 Jan 2021 06:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10G6finf086788; Sat, 16 Jan 2021 06:41:44 GMT (envelope-from git) Date: Sat, 16 Jan 2021 06:41:44 GMT Message-Id: <202101160641.10G6finf086788@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: 8af3b2026a8e - stable/12 - tcgetwinsize(3): provide man page 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/12 X-Git-Reftype: branch X-Git-Commit: 8af3b2026a8eafba9f22d823c30900b019b813fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 06:41:45 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8af3b2026a8eafba9f22d823c30900b019b813fe commit 8af3b2026a8eafba9f22d823c30900b019b813fe Author: Konstantin Belousov AuthorDate: 2021-01-01 22:28:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-16 06:39:15 +0000 tcgetwinsize(3): provide man page (cherry picked from commit 4e0c81c5fafb5b72cabc342f640aff6cac445853) --- lib/libc/gen/Makefile.inc | 2 + lib/libc/gen/tcgetwinsize.3 | 164 ++++++++++++++++++++++++++++++++++++++++++++ share/man/man4/termios.4 | 1 + 3 files changed, 167 insertions(+) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 264b079b9ed0..5431ea33f7c3 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -301,6 +301,7 @@ MAN+= alarm.3 \ syslog.3 \ tcgetpgrp.3 \ tcgetsid.3 \ + tcgetwinsize.3 \ tcsendbreak.3 \ tcsetattr.3 \ tcsetpgrp.3 \ @@ -516,6 +517,7 @@ MLINKS+=syslog.3 closelog.3 \ syslog.3 openlog.3 \ syslog.3 setlogmask.3 \ syslog.3 vsyslog.3 +MLINKS+=tcgetwinsize.3 tcsetwinsize.3 MLINKS+=tcsendbreak.3 tcdrain.3 \ tcsendbreak.3 tcflow.3 \ tcsendbreak.3 tcflush.3 diff --git a/lib/libc/gen/tcgetwinsize.3 b/lib/libc/gen/tcgetwinsize.3 new file mode 100644 index 000000000000..1bc96689c792 --- /dev/null +++ b/lib/libc/gen/tcgetwinsize.3 @@ -0,0 +1,164 @@ +.\"- +.\" Copyright (c) 2020 Soumendra Ganguly +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" Portions of this text are reprinted and reproduced in electronic form +.\" from P1003.1-202x, Draft 1.1, Draft Standard for Information Technology -- +.\" Portable Operating System Interface (POSIX), The Open Group Base +.\" Specifications Issue 8, Copyright (C) 2020 by the Institute of +.\" Electrical and Electronics Engineers, Inc and The Open Group. In the +.\" event of any discrepancy between this version and the original IEEE and +.\" The Open Group Standard, the original IEEE and The Open Group Standard is +.\" the referee document. The original Standard can be obtained online at +.\" http://www.opengroup.org/unix/online.html. +.\" +.\" $FreeBSD$ +.\" +.Dd December 28, 2020 +.Dt TCGETWINSIZE 3 +.Os +.Sh NAME +.Nm tcgetwinsize , +.Nm tcsetwinsize +.Nd get, set the size of a terminal window +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In termios.h +.Bd -literal +struct winsize { + unsigned short ws_row; /* number of rows, in characters */ + unsigned short ws_col; /* number of columns, in characters */ + unsigned short ws_xpixel; /* horizontal size, in pixels */ + unsigned short ws_ypixel; /* vertical size, in pixels */ +}; +.Ed +.Pp +.Ft int +.Fn tcgetwinsize "int fd" "struct winsize *w" +.Ft int +.Fn tcsetwinsize "int fd" "const struct winsize *w" +.Sh DESCRIPTION +The +.Fn tcgetwinsize +function gets the terminal window size of the terminal of which +.Fa fd +is an open file descriptor and stores it in the +.Vt winsize +structure of which +.Fa w +is a pointer. +.Pp +The +.Fn tcsetwinsize +function sets the terminal window size of the terminal of which +.Fa fd +is an open file descriptor from the +.Vt winsize +structure referenced by +.Fa w . +The change occurs immediately. +If the terminal window size of the terminal +is changed successfully to have a value that is different from the value that +it had before the +.Fn tcsetwinsize +call, then the +.Dv SIGWINCH +signal is sent to all those members of the foreground process group of the +terminal that have the terminal as their controlling terminal. +.Pp +The above declaration of +.Vt "struct winsize" +may not be literal. +It is provided only to list the accessible members. +Therefore, before calling +.Fn tcsetwinsize , +the members of the +.Vt winsize +structure must be initialized by calling +.Fn tcgetwinsize . +The information in a +.Vt winsize +structure is stored by the kernel in order to provide a consistent interface, +but it is not used by the kernel. +.Sh RETURN VALUE +.Rv -std tcgetwinsize tcsetwinsize +The terminal window size remains unchanged if +.Fn tcsetwinsize +fails. +.Pp +.Sh ERRORS +The following are the possible failure conditions: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument to +.Fn tcgetwinsize +or to +.Fn tcsetwinsize +is not a valid file descriptor. +.It Bq Er ENOTTY +The +.Fa fd +argument to +.Fn tcgetwinsize +or to +.Fn tcsetwinsize +is not associated with a character special device. +.It Bq Er EINVAL +The +.Fa w +argument to +.Fn tcsetwinsize +is not valid. +.It Bq Er EFAULT +The +.Fa w +argument to +.Fn tcgetwinsize +or to +.Fn tcsetwinsize +points outside the process's allocated address space. +.El +.Sh SEE ALSO +.Xr stty 1 , +.Xr ioctl 2 , +.Xr sigaction 2 , +.Xr termios 4 , +.Xr tty 4 +.Sh STANDARDS +The +.Fn tcgetwinsize +and +.Fn tcsetwinsize +functions are expected to conform to +.St -p1003.1 +Base Specifications, Issue 8. +The +.Fa ws_xpixel +and +.Fa ws_ypixel +members of +.Vt "struct winsize" +are FreeBSD extensions. diff --git a/share/man/man4/termios.4 b/share/man/man4/termios.4 index a08abfa12c66..81d76aa873fd 100644 --- a/share/man/man4/termios.4 +++ b/share/man/man4/termios.4 @@ -1575,6 +1575,7 @@ the values in the header .Sh SEE ALSO .Xr stty 1 , .Xr tcgetsid 3 , +.Xr tcgetwinsize 3, .Xr tcsendbreak 3 , .Xr tcsetattr 3 , .Xr tcsetsid 3 , From owner-dev-commits-src-branches@freebsd.org Sat Jan 16 06:41:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93B0F4D5BE8; Sat, 16 Jan 2021 06:41: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 4DHpP617QLz3C7D; Sat, 16 Jan 2021 06:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D15212444; Sat, 16 Jan 2021 06:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10G6fj6b086811; Sat, 16 Jan 2021 06:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10G6fjB9086810; Sat, 16 Jan 2021 06:41:45 GMT (envelope-from git) Date: Sat, 16 Jan 2021 06:41:45 GMT Message-Id: <202101160641.10G6fjB9086810@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: e88bf6998796 - stable/12 - x86 budma_bounce: style. 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/12 X-Git-Reftype: branch X-Git-Commit: e88bf6998796b7e286cc4c2590e09a4292b9c5c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 06:41:48 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e88bf6998796b7e286cc4c2590e09a4292b9c5c9 commit e88bf6998796b7e286cc4c2590e09a4292b9c5c9 Author: Konstantin Belousov AuthorDate: 2021-01-11 23:42:04 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-16 06:40:54 +0000 x86 budma_bounce: style. (cherry picked from commit 895ad33784e00fc9d601fd51f0571e0e02d9d146) --- sys/x86/x86/busdma_bounce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index a66881e79b58..43cf37230d72 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -400,7 +400,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) * A dmamap to for use with dmamap_load is also allocated. */ static int -bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, bus_dmamap_t *mapp) { vm_memattr_t attr; From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B6524DB966; Sun, 17 Jan 2021 05:10: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 4DJNKV5g9sz3wKf; Sun, 17 Jan 2021 05:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B52751B9F6; Sun, 17 Jan 2021 05:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AcCl046095; Sun, 17 Jan 2021 05:10:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5AcYf046094; Sun, 17 Jan 2021 05:10:38 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:38 GMT Message-Id: <202101170510.10H5AcYf046094@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: b9f6bda16b27 - stable/12 - x86: Add rdtscp32() into cpufunc.h. 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/12 X-Git-Reftype: branch X-Git-Commit: b9f6bda16b274b2b090db39781f7eb315b80c126 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:39 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f6bda16b274b2b090db39781f7eb315b80c126 commit b9f6bda16b274b2b090db39781f7eb315b80c126 Author: Konstantin Belousov AuthorDate: 2021-01-09 20:39:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:44:18 +0000 x86: Add rdtscp32() into cpufunc.h. (cherry picked from commit 45974de8fb23710873417f1d2ca513761da6cacc) --- sys/amd64/include/cpufunc.h | 9 +++++++++ sys/i386/include/cpufunc.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 2a03d9b61941..85e6c60a4ffd 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -412,6 +412,15 @@ rdtsc32(void) return (rv); } +static __inline uint32_t +rdtscp32(void) +{ + uint32_t rv; + + __asm __volatile("rdtscp" : "=a" (rv) : : "ecx", "edx"); + return (rv); +} + static __inline void wbinvd(void) { diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 3feeef02499c..9646590a6a40 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -412,6 +412,15 @@ rdtsc32(void) return (rv); } +static __inline uint32_t +rdtscp32(void) +{ + uint32_t rv; + + __asm __volatile("rdtscp" : "=a" (rv) : : "ecx", "edx"); + return (rv); +} + static __inline void wbinvd(void) { From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 025FB4DBB89; Sun, 17 Jan 2021 05:10: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 4DJNKW6btLz3wKh; Sun, 17 Jan 2021 05:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5C411BBA2; Sun, 17 Jan 2021 05:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AdqH046117; Sun, 17 Jan 2021 05:10:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5Adlk046116; Sun, 17 Jan 2021 05:10:39 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:39 GMT Message-Id: <202101170510.10H5Adlk046116@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: b63c36db2065 - stable/12 - libc: implement rtld_get_stack_prot() for real 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/12 X-Git-Reftype: branch X-Git-Commit: b63c36db2065770a0b17925cb3b51cde6af95add Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:40 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b63c36db2065770a0b17925cb3b51cde6af95add commit b63c36db2065770a0b17925cb3b51cde6af95add Author: Konstantin Belousov AuthorDate: 2021-01-10 03:05:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:44:43 +0000 libc: implement rtld_get_stack_prot() for real (cherry picked from commit 81b3a0a34145ee6c855f50c8035728f76d63c3f0) --- lib/libc/gen/dlfcn.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index f7f162753b4b..395a6d9402e8 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); /* * Linkage to services provided by the dynamic linker. */ +#include #include +#include #include #include #include @@ -256,8 +258,30 @@ _rtld_addr_phdr(const void *addr __unused, int _rtld_get_stack_prot(void) { +#ifndef IN_LIBDL + unsigned i; + int r; + static int ret; + + r = atomic_load_int(&ret); + if (r != 0) + return (r); - return (PROT_EXEC | PROT_READ | PROT_WRITE); + _once(&dl_phdr_info_once, dl_init_phdr_info); + r = PROT_EXEC | PROT_READ | PROT_WRITE; + for (i = 0; i < phdr_info.dlpi_phnum; i++) { + if (phdr_info.dlpi_phdr[i].p_type != PT_GNU_STACK) + continue; + r = PROT_READ | PROT_WRITE; + if ((phdr_info.dlpi_phdr[i].p_flags & PF_X) != 0) + r |= PROT_EXEC; + break; + } + atomic_store_int(&ret, r); + return (r); +#else + return (0); +#endif } #pragma weak _rtld_is_dlopened From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C08CA4DBAD9; Sun, 17 Jan 2021 05:10: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 4DJNKY37tWz3vxc; Sun, 17 Jan 2021 05:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282C01B9F7; Sun, 17 Jan 2021 05:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AeaW046136; Sun, 17 Jan 2021 05:10:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5Ae6l046135; Sun, 17 Jan 2021 05:10:40 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:40 GMT Message-Id: <202101170510.10H5Ae6l046135@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: 77ac245e9e32 - stable/12 - tmpfs_reclaim: style 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/12 X-Git-Reftype: branch X-Git-Commit: 77ac245e9e3245b88623dc853975a37a3e7d0369 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:42 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=77ac245e9e3245b88623dc853975a37a3e7d0369 commit 77ac245e9e3245b88623dc853975a37a3e7d0369 Author: Konstantin Belousov AuthorDate: 2021-01-13 06:55:38 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:45:05 +0000 tmpfs_reclaim: style (cherry picked from commit 685265ecfbd8e929d7c6988a99b708d3a3a5cbf4) --- sys/fs/tmpfs/tmpfs_vnops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 7a4308445a6a..84134e48e83e 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1302,11 +1302,11 @@ tmpfs_inactive(struct vop_inactive_args *v) int tmpfs_reclaim(struct vop_reclaim_args *v) { - struct vnode *vp = v->a_vp; - + struct vnode *vp; struct tmpfs_mount *tmp; struct tmpfs_node *node; + vp = v->a_vp; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); @@ -1321,9 +1321,11 @@ tmpfs_reclaim(struct vop_reclaim_args *v) TMPFS_NODE_LOCK(node); tmpfs_free_vp(vp); - /* If the node referenced by this vnode was deleted by the user, + /* + * If the node referenced by this vnode was deleted by the user, * we must free its associated data structures (now that the vnode - * is being reclaimed). */ + * is being reclaimed). + */ if (node->tn_links == 0 && (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { node->tn_vpstate = TMPFS_VNODE_DOOMED; @@ -1333,7 +1335,7 @@ tmpfs_reclaim(struct vop_reclaim_args *v) TMPFS_NODE_UNLOCK(node); MPASS(vp->v_data == NULL); - return 0; + return (0); } int From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE1F64DBB1C; Sun, 17 Jan 2021 05:10: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 4DJNKb59zVz3wL1; Sun, 17 Jan 2021 05:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E16C1BDA2; Sun, 17 Jan 2021 05:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AgnE046158; Sun, 17 Jan 2021 05:10:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5Agk0046157; Sun, 17 Jan 2021 05:10:42 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:42 GMT Message-Id: <202101170510.10H5Agk0046157@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: 208ebc381f51 - stable/12 - tmpfs_free_tmp(): explicitly assert that tmp is locked 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/12 X-Git-Reftype: branch X-Git-Commit: 208ebc381f51f80a39489e3a1b5fa4e704ac9359 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:45 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=208ebc381f51f80a39489e3a1b5fa4e704ac9359 commit 208ebc381f51f80a39489e3a1b5fa4e704ac9359 Author: Konstantin Belousov AuthorDate: 2021-01-05 18:53:45 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:45:24 +0000 tmpfs_free_tmp(): explicitly assert that tmp is locked (cherry picked from commit 9f200bc47b5d8445d91d51f6dfd6af0f1fbbe354) --- sys/fs/tmpfs/tmpfs_vfsops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 942d2d499b26..c9c211dca002 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -529,8 +529,9 @@ tmpfs_unmount(struct mount *mp, int mntflags) void tmpfs_free_tmp(struct tmpfs_mount *tmp) { - + TMPFS_MP_ASSERT_LOCKED(tmp); MPASS(tmp->tm_refcount > 0); + tmp->tm_refcount--; if (tmp->tm_refcount > 0) { TMPFS_UNLOCK(tmp); From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C41474DBDB9; Sun, 17 Jan 2021 05:10: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 4DJNKc6yLLz3wLH; Sun, 17 Jan 2021 05:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 499571BFE7; Sun, 17 Jan 2021 05:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AhPv046178; Sun, 17 Jan 2021 05:10:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5AhBB046177; Sun, 17 Jan 2021 05:10:43 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:43 GMT Message-Id: <202101170510.10H5AhBB046177@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: 71dfe98e34ac - stable/12 - tty_wait_background: improve locking. 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/12 X-Git-Reftype: branch X-Git-Commit: 71dfe98e34acdcb8b0f90880de28611e66662e91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:46 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=71dfe98e34acdcb8b0f90880de28611e66662e91 commit 71dfe98e34acdcb8b0f90880de28611e66662e91 Author: Konstantin Belousov AuthorDate: 2020-12-31 13:45:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:45:47 +0000 tty_wait_background: improve locking. (cherry picked from commit a008bdeda3b8278fe600cf83ecf44acd1ccb30b6) --- sys/kern/tty.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 63324ac3e881..693032908b3a 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -413,7 +413,7 @@ tty_is_ctty(struct tty *tp, struct proc *p) int tty_wait_background(struct tty *tp, struct thread *td, int sig) { - struct proc *p = td->td_proc; + struct proc *p; struct pgrp *pg; ksiginfo_t ksi; int error; @@ -421,8 +421,22 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) MPASS(sig == SIGTTIN || sig == SIGTTOU); tty_assert_locked(tp); + p = td->td_proc; for (;;) { + pg = p->p_pgrp; + PGRP_LOCK(pg); PROC_LOCK(p); + + /* + * pg may no longer be our process group. + * Re-check after locking. + */ + if (p->p_pgrp != pg) { + PROC_UNLOCK(p); + PGRP_UNLOCK(pg); + continue; + } + /* * The process should only sleep, when: * - This terminal is the controlling terminal @@ -435,6 +449,7 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) if (!tty_is_ctty(tp, p) || p->p_pgrp == tp->t_pgrp) { /* Allow the action to happen. */ PROC_UNLOCK(p); + PGRP_UNLOCK(pg); return (0); } @@ -442,13 +457,14 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) SIGISMEMBER(td->td_sigmask, sig)) { /* Only allow them in write()/ioctl(). */ PROC_UNLOCK(p); + PGRP_UNLOCK(pg); return (sig == SIGTTOU ? 0 : EIO); } - pg = p->p_pgrp; if ((p->p_flag & P_PPWAIT) != 0 || pg->pg_jobc == 0) { /* Don't allow the action to happen. */ PROC_UNLOCK(p); + PGRP_UNLOCK(pg); return (EIO); } PROC_UNLOCK(p); @@ -463,20 +479,7 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) ksi.ksi_signo = sig; sig = 0; } - PGRP_LOCK(pg); - - /* - * pg may no longer be our process group. - * Re-check after locking process group. - */ - PROC_LOCK(p); - if (p->p_pgrp != pg) { - PROC_UNLOCK(p); - PGRP_UNLOCK(pg); - continue; - } - PROC_UNLOCK(p); pgsignal(pg, ksi.ksi_signo, 1, &ksi); PGRP_UNLOCK(pg); From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385044DB9BA; Sun, 17 Jan 2021 05:10: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 4DJNKf52dbz3wHm; Sun, 17 Jan 2021 05:10:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64E321BE95; Sun, 17 Jan 2021 05:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5AiKf046198; Sun, 17 Jan 2021 05:10:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5Ai3j046197; Sun, 17 Jan 2021 05:10:44 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:44 GMT Message-Id: <202101170510.10H5Ai3j046197@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: 16787d049ece - stable/12 - issignal(): when handling STOP-like signals, drop sigacts mutex earlier. 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/12 X-Git-Reftype: branch X-Git-Commit: 16787d049ece7fdf457e7571050e837fc24a697f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:47 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16787d049ece7fdf457e7571050e837fc24a697f commit 16787d049ece7fdf457e7571050e837fc24a697f Author: Konstantin Belousov AuthorDate: 2020-12-31 01:45:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:46:19 +0000 issignal(): when handling STOP-like signals, drop sigacts mutex earlier. (cherry picked from commit e0d83cd3e49f0b9e16bc82ced7bd3b0ef9aa6a71) --- sys/kern/kern_sig.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b84793285d8a..9fbb6d86457a 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2950,17 +2950,20 @@ issignal(struct thread *td) * should ignore tty stops. */ if (prop & SIGPROP_STOP) { + mtx_unlock(&ps->ps_mtx); if ((p->p_flag & (P_TRACED | P_WEXIT | P_SINGLE_EXIT)) != 0 || (p->p_pgrp->pg_jobc == 0 && - (prop & SIGPROP_TTYSTOP) != 0)) + (prop & SIGPROP_TTYSTOP) != 0)) { + mtx_lock(&ps->ps_mtx); break; /* == ignore */ + } if (TD_SBDRY_INTR(td)) { KASSERT((td->td_flags & TDF_SBDRY) != 0, ("lost TDF_SBDRY")); + mtx_lock(&ps->ps_mtx); return (-1); } - mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); sigqueue_delete(&td->td_sigqueue, sig); From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 05:10:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 663B44DBDC8; Sun, 17 Jan 2021 05:10: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 4DJNKh3kBjz3wVj; Sun, 17 Jan 2021 05:10:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 836771BDA3; Sun, 17 Jan 2021 05:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H5Aj4u046220; Sun, 17 Jan 2021 05:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H5AjFm046219; Sun, 17 Jan 2021 05:10:45 GMT (envelope-from git) Date: Sun, 17 Jan 2021 05:10:45 GMT Message-Id: <202101170510.10H5AjFm046219@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: 33c122e9190b - stable/12 - tmpfs: make M_TMPFSMNT static to tmpfs_vfsops.c 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/12 X-Git-Reftype: branch X-Git-Commit: 33c122e9190bd3ed96656253a750031aa500b954 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 05:10:52 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33c122e9190bd3ed96656253a750031aa500b954 commit 33c122e9190bd3ed96656253a750031aa500b954 Author: Konstantin Belousov AuthorDate: 2021-01-05 18:52:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-17 04:46:45 +0000 tmpfs: make M_TMPFSMNT static to tmpfs_vfsops.c (cherry picked from commit 42bebbda9ed13d12d0454b676aa81f34b39e496f) --- sys/fs/tmpfs/tmpfs.h | 1 - sys/fs/tmpfs/tmpfs_vfsops.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 3872cd1c0b13..ec920f8b0537 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -42,7 +42,6 @@ #include #ifdef _SYS_MALLOC_H_ -MALLOC_DECLARE(M_TMPFSMNT); MALLOC_DECLARE(M_TMPFSNAME); #endif diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index c9c211dca002..219ec9ee69f2 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); */ #define TMPFS_DEFAULT_ROOT_MODE (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) -MALLOC_DEFINE(M_TMPFSMNT, "tmpfs mount", "tmpfs mount structures"); +static MALLOC_DEFINE(M_TMPFSMNT, "tmpfs mount", "tmpfs mount structures"); MALLOC_DEFINE(M_TMPFSNAME, "tmpfs name", "tmpfs file names"); static int tmpfs_mount(struct mount *); From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 09:18:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFED14E1D5C; Sun, 17 Jan 2021 09:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJTqZ5z63z4dQ2; Sun, 17 Jan 2021 09:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B53E61F105; Sun, 17 Jan 2021 09:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10H9IYr4062296; Sun, 17 Jan 2021 09:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10H9IYYL062295; Sun, 17 Jan 2021 09:18:34 GMT (envelope-from git) Date: Sun, 17 Jan 2021 09:18:34 GMT Message-Id: <202101170918.10H9IYYL062295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 3d3c424eb6e3 - stable/12 - bectl(8): sync man page and help text MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3d3c424eb6e3909f2f7cd318b9a8a1bbb0783705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 09:18:34 -0000 The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=3d3c424eb6e3909f2f7cd318b9a8a1bbb0783705 commit 3d3c424eb6e3909f2f7cd318b9a8a1bbb0783705 Author: Robert Wing AuthorDate: 2021-01-06 19:38:25 +0000 Commit: Robert Wing CommitDate: 2021-01-17 09:12:42 +0000 bectl(8): sync man page and help text Sync man page with behavior of bectl(8). Sync help text with man page. PR: 246697 Reported by: olgeni Submitted by: olgeni (with changes) Reviewed by: kevans, olgeni Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D27482 (cherry picked from commit b1ea63e2e3c92d1346af067f5cf609e3e062f8b9) --- sbin/bectl/bectl.8 | 11 +++++------ sbin/bectl/bectl.c | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index e45bc6b99551..809a0d2f51a8 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2020 +.Dd January 6, 2021 .Dt BECTL 8 .Os .Sh NAME @@ -71,8 +71,7 @@ .Ar newBeName .Nm .Brq Cm ujail | unjail -.Brq Ar jailId | jailName -.Ar beName +.Brq Ar jailId | jailName | beName .Nm .Brq Cm umount | unmount .Op Fl f @@ -249,7 +248,7 @@ generated by All default parameters may be overwritten. .It Xo .Cm list -.Op Fl DHas +.Op Fl aDHs .Oo Bro Fl c Ar property | Fl C Ar property Brc Oc .Xc .Pp @@ -312,8 +311,8 @@ Rename the given to the given .Ar newBeName . The boot environment will not be unmounted in order for this rename to occur. -.It Cm ujail Bro Ar jailId | jailName Brc Ar beName -.It Cm unjail Bro Ar jailId | jailName Brc Ar beName +.It Cm ujail Brq Ar jailId | jailName | beName +.It Cm unjail Brq Ar jailId | jailName | beName Destroy the jail created from the given boot environment. .It Xo .Cm umount diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 71108b9c0855..768d1cd89ac2 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -78,13 +78,12 @@ usage(bool explicit) "\tbectl destroy [-F] {beName | beName@snapshot}\n" "\tbectl export sourceBe\n" "\tbectl import targetBe\n" - "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " - "{jailID | jailName}\n" - "\t bootenv [utility [argument ...]]\n" - "\tbectl list [-DHas] [{-c property | -C property}]\n" + "\tbectl jail [-bU] [{-o key=value | -u key}]... beName\n" + "\t [utility [argument ...]]\n" + "\tbectl list [-aDHs] [{-c property | -C property}]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" - "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" + "\tbectl {ujail | unjail} {jailID | jailName | beName}\n" "\tbectl {umount | unmount} [-f] beName\n"); return (explicit ? 0 : EX_USAGE); From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 13:34:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 446434E9707; Sun, 17 Jan 2021 13:34: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 4DJbW41LYSz4vq9; Sun, 17 Jan 2021 13:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 215A8225D6; Sun, 17 Jan 2021 13:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10HDYeZZ000236; Sun, 17 Jan 2021 13:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10HDYeTU000235; Sun, 17 Jan 2021 13:34:40 GMT (envelope-from git) Date: Sun, 17 Jan 2021 13:34:40 GMT Message-Id: <202101171334.10HDYeTU000235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 9882b8313200 - stable/12 - netmap: iflib: stop krings during interface reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9882b83132007acc0e6cef6d248fb12cdebba278 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 13:34:40 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=9882b83132007acc0e6cef6d248fb12cdebba278 commit 9882b83132007acc0e6cef6d248fb12cdebba278 Author: Vincenzo Maffione AuthorDate: 2021-01-09 20:54:11 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-17 12:02:44 +0000 netmap: iflib: stop krings during interface reset When different processes open separate subsets of the available rings of a same netmap interface, a device reset may be performed while one of the processes is actively using some rings (e.g., caused by another process executing a nmport_open()). With this patch, such situation will cause the active process to get a POLLERR, so that it can have a chance to detect the situation. We also guarantee that no process is running a txsync or rxsync (ioctl or poll) while an iflib device reset is in progress. PR: 252453 MFC after: 1 week (cherry picked from commit 1d238b07d5d4d9660ae0e08daede6da7e91c7853) netmap: iflib: fix asserts in netmap_fl_refill() When netmap_fl_refill() is called at initialization time (e.g., during netmap_iflib_register()), nic_i must be 0, since the free list is reinitialized. At the end of the refill cycle, nic_i must still be zero, because exactly N descriptors (N is the ring size) are refilled. This patch therefore fixes the assertions to check on nic_i rather than on nm_i. The current netmap_reset() may in fact cause nm_i to be != 0 while the device is resetting: this may happen when multiple non-cooperating processes open different subsets of the available netmap rings. PR: 252518 MFC after: 1 week (cherry picked from commit 3189ba61673af5bd3ed2ee9e33be92bc0b9995ba) netmap: refactor netmap_reset The netmap_reset() function is meant to be called by the driver when they initialize (or re-initialize) a hardware ring. However, since the introduction of support for opening (in netmap mode) a subset of the available rings, netmap_reset() may be called multiple times on actively used rings, causing both kring and netmap ring to transition to an inconsistent state. This changes improves the situation by resetting all the indices fields of the kring to 0, as expected after the reinitialization of a hardware ring. PR: 252518 MFC after: 1 week (cherry picked from commit 7ba6ecf216fb15e8b147db268b91d9b82c5a0682) netmap: iflib: enable/disable krings on any interface reinit Since 1d238b07d5d4d9660ae0e0, krings are disabled before a reinit cycle triggered by iflib_netmap_register. However, this operation is actually necessary also for any interface reinit triggered by other causes (i.e., ifconfig commands). We achieve this goal by moving the krings enable/disable operation inside iflib_stop() and iflib_init_locked(). Once here, this change also removes some redundant operations from iflib_netmap_register(), that are already performed by iflib_stop(). PR: 252453 MFC after: 1 week (cherry picked from commit 3d65fd97e85ab807f3baa62aa979ae527914a3ea) iflib: fix build failure in case DEV_NETMAP is not defined This addresses the build failure introduced by 3d65fd97e85ab807f3baa62. MFC with: 3d65fd97e85ab807f3baa62 (cherry picked from commit 8aa8484cbf06bb26ad87177fe4aebcaf1519f138) netmap: restore hwofs and support it in iflib Restore the hwofs functionality temporarily disabled by 7ba6ecf216fb15e8b147db2 to prevent issues with iflib. This patch brings the necessary changes to iflib to enable howfs to allow interface restarts without disrupting netmap applications actively using its rings. After this change, it becomes possible for multiple non-cooperating netmap applications to use non-overlapping subsets of the available netmap rings without clashing with each other. PR: 252453 MFC after: 1 week (cherry picked from commit 55f0ad5fdee1a779d6889481ba591a819081b9ca) --- sys/dev/netmap/netmap.c | 94 +++++++++++++++++++++++-------------------------- sys/net/iflib.c | 67 +++++++++++++++++++++++++---------- 2 files changed, 94 insertions(+), 67 deletions(-) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 982f76d45faa..075c27b7a597 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -633,7 +633,7 @@ void netmap_disable_all_rings(struct ifnet *ifp) { if (NM_NA_VALID(ifp)) { - netmap_set_all_rings(NA(ifp), NM_KR_STOPPED); + netmap_set_all_rings(NA(ifp), NM_KR_LOCKED); } } @@ -4056,75 +4056,71 @@ done: /* - * netmap_reset() is called by the driver routines when reinitializing - * a ring. The driver is in charge of locking to protect the kring. - * If native netmap mode is not set just return NULL. - * If native netmap mode is set, in particular, we have to set nr_mode to - * NKR_NETMAP_ON. + * Reset function to be called by the driver routines when reinitializing + * a hardware ring. The driver is in charge of locking to protect the kring + * while this operation is being performed. This is normally achieved by + * calling netmap_disable_all_rings() before triggering a reset. + * If the kring is not in netmap mode, return NULL to inform the caller + * that this is the case. + * If the kring is in netmap mode, set hwofs so that the netmap indices + * seen by userspace (head/cut/tail) do not change, although the internal + * NIC indices have been reset to 0. + * In any case, adjust kring->nr_mode. */ struct netmap_slot * netmap_reset(struct netmap_adapter *na, enum txrx tx, u_int n, u_int new_cur) { struct netmap_kring *kring; - int new_hwofs, lim; + u_int new_hwtail, new_hwofs; if (!nm_native_on(na)) { nm_prdis("interface not in native netmap mode"); return NULL; /* nothing to reinitialize */ } - /* XXX note- in the new scheme, we are not guaranteed to be - * under lock (e.g. when called on a device reset). - * In this case, we should set a flag and do not trust too - * much the values. In practice: TODO - * - set a RESET flag somewhere in the kring - * - do the processing in a conservative way - * - let the *sync() fixup at the end. - */ if (tx == NR_TX) { if (n >= na->num_tx_rings) return NULL; - kring = na->tx_rings[n]; - - if (kring->nr_pending_mode == NKR_NETMAP_OFF) { - kring->nr_mode = NKR_NETMAP_OFF; - return NULL; - } - - // XXX check whether we should use hwcur or rcur - new_hwofs = kring->nr_hwcur - new_cur; + /* + * Set hwofs to rhead, so that slots[rhead] is mapped to + * the NIC internal slot 0, and thus the netmap buffer + * at rhead is the next to be transmitted. Transmissions + * that were pending before the reset are considered as + * sent, so that we can have hwcur = rhead. All the slots + * are now owned by the user, so we can also reinit hwtail. + */ + new_hwofs = kring->rhead; + new_hwtail = nm_prev(kring->rhead, kring->nkr_num_slots - 1); } else { if (n >= na->num_rx_rings) return NULL; kring = na->rx_rings[n]; - - if (kring->nr_pending_mode == NKR_NETMAP_OFF) { - kring->nr_mode = NKR_NETMAP_OFF; - return NULL; - } - - new_hwofs = kring->nr_hwtail - new_cur; + /* + * Set hwofs to hwtail, so that slots[hwtail] is mapped to + * the NIC internal slot 0, and thus the netmap buffer + * at hwtail is the next to be given to the NIC. + * Unread slots (the ones in [rhead,hwtail[) are owned by + * the user, and thus the caller cannot give them + * to the NIC right now. + */ + new_hwofs = kring->nr_hwtail; + new_hwtail = kring->nr_hwtail; } - lim = kring->nkr_num_slots - 1; - if (new_hwofs > lim) - new_hwofs -= lim + 1; - - /* Always set the new offset value and realign the ring. */ - if (netmap_debug & NM_DEBUG_ON) - nm_prinf("%s %s%d hwofs %d -> %d, hwtail %d -> %d", - na->name, - tx == NR_TX ? "TX" : "RX", n, - kring->nkr_hwofs, new_hwofs, - kring->nr_hwtail, - tx == NR_TX ? lim : kring->nr_hwtail); - kring->nkr_hwofs = new_hwofs; - if (tx == NR_TX) { - kring->nr_hwtail = kring->nr_hwcur + lim; - if (kring->nr_hwtail > lim) - kring->nr_hwtail -= lim + 1; + if (kring->nr_pending_mode == NKR_NETMAP_OFF) { + kring->nr_mode = NKR_NETMAP_OFF; + return NULL; } + if (netmap_verbose) { + nm_prinf("%s, hc %u->%u, ht %u->%u, ho %u->%u", kring->name, + kring->nr_hwcur, kring->rhead, + kring->nr_hwtail, new_hwtail, + kring->nkr_hwofs, new_hwofs); + } + kring->nr_hwcur = kring->rhead; + kring->nr_hwtail = new_hwtail; + kring->nkr_hwofs = new_hwofs; /* * Wakeup on the individual and global selwait @@ -4226,7 +4222,7 @@ nm_set_native_flags(struct netmap_adapter *na) struct ifnet *ifp = na->ifp; /* We do the setup for intercepting packets only if we are the - * first user of this adapapter. */ + * first user of this adapter. */ if (na->active_fds > 0) { return; } diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 3e115e992e4a..1653fd31a7f7 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -807,11 +807,6 @@ iflib_netmap_register(struct netmap_adapter *na, int onoff) int status; CTX_LOCK(ctx); - IFDI_INTR_DISABLE(ctx); - - /* Tell the stack that the interface is no longer active */ - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - if (!CTX_IS_VF(ctx)) IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip); @@ -820,7 +815,10 @@ iflib_netmap_register(struct netmap_adapter *na, int onoff) /* * Enable (or disable) netmap flags, and intercept (or restore) * ifp->if_transmit. This is done once the device has been stopped - * to prevent race conditions. + * to prevent race conditions. Also, this must be done after + * calling netmap_disable_all_rings() and before calling + * netmap_enable_all_rings(), so that these two functions see the + * updated state of the NAF_NETMAP_ON bit. */ if (onoff) { nm_set_native_flags(na); @@ -842,13 +840,13 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) { struct netmap_adapter *na = kring->na; u_int const lim = kring->nkr_num_slots - 1; - u_int nm_i = kring->nr_hwcur; struct netmap_ring *ring = kring->ring; bus_dmamap_t *map; struct if_rxd_update iru; if_ctx_t ctx = rxq->ifr_ctx; iflib_fl_t fl = &rxq->ifr_fl[0]; u_int nic_i_first, nic_i; + u_int nm_i; int i, n; #if IFLIB_DEBUG_COUNTERS int rf_count = 0; @@ -857,30 +855,42 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) /* * This function is used both at initialization and in rxsync. * At initialization we need to prepare (with isc_rxd_refill()) - * all the (N) netmap buffers in the ring, in such a way to keep - * fl->ifl_pidx and kring->nr_hwcur in sync (except for - * kring->nkr_hwofs); at rxsync time, both indexes point to the - * next buffer to be refilled. + * all the netmap buffers currently owned by the kernel, in + * such a way to keep fl->ifl_pidx and kring->nr_hwcur in sync + * (except for kring->nkr_hwofs). These may be less than + * kring->nkr_num_slots if netmap_reset() was called while + * an application using the kring that still owned some + * buffers. + * At rxsync time, both indexes point to the next buffer to be + * refilled. * In any case we publish (with isc_rxd_flush()) up to * (fl->ifl_pidx - 1) % N (included), to avoid the NIC tail/prod * pointer to overrun the head/cons pointer, although this is * not necessary for some NICs (e.g. vmx). */ - if (__predict_false(init)) - n = kring->nkr_num_slots; - else { - n = kring->rhead - nm_i; + if (__predict_false(init)) { + n = kring->nkr_num_slots - nm_kr_rxspace(kring); + } else { + n = kring->rhead - kring->nr_hwcur; if (n == 0) return (0); /* Nothing to do. */ if (n < 0) n += kring->nkr_num_slots; } - /* Start to refill from nr_hwcur, publishing n buffers. */ iru_init(&iru, rxq, 0 /* flid */); map = fl->ifl_sds.ifsd_map; nic_i = fl->ifl_pidx; - MPASS(nic_i == netmap_idx_k2n(kring, nm_i)); + nm_i = netmap_idx_n2k(kring, nic_i); + if (__predict_false(init)) { + /* + * On init/reset, nic_i must be 0, and we must + * start to refill from hwtail (see netmap_reset()). + */ + MPASS(nic_i == 0); + MPASS(nm_i == kring->nr_hwtail); + } else + MPASS(nm_i == kring->nr_hwcur); DBG_COUNTER_INC(fl_refills); while (n > 0) { #if IFLIB_DEBUG_COUNTERS @@ -920,7 +930,10 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) ctx->isc_rxd_refill(ctx->ifc_softc, &iru); } fl->ifl_pidx = nic_i; - MPASS(!init || nm_i == 0); + /* + * At the end of the loop we must have refilled everything + * we could possibly refill. + */ MPASS(nm_i == kring->rhead); kring->nr_hwcur = nm_i; @@ -1302,6 +1315,8 @@ iflib_netmap_timer(void *arg) #define iflib_netmap_txq_init(ctx, txq) (0) #define iflib_netmap_rxq_init(ctx, rxq) (0) #define iflib_netmap_detach(ifp) +#define netmap_enable_all_rings(ifp) +#define netmap_disable_all_rings(ifp) #define iflib_netmap_attach(ctx) (0) #define netmap_rx_irq(ifp, qid, budget) (0) @@ -2452,6 +2467,12 @@ iflib_init_locked(if_ctx_t ctx) if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); IFDI_INTR_DISABLE(ctx); + /* + * See iflib_stop(). Useful in case iflib_init_locked() is + * called without first calling iflib_stop(). + */ + netmap_disable_all_rings(ifp); + tx_ip_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP); tx_ip6_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_SCTP); /* Set hardware offload abilities */ @@ -2508,6 +2529,9 @@ done: for (i = 0; i < sctx->isc_ntxqsets; i++, txq++) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); + + /* Re-enable txsync/rxsync. */ + netmap_enable_all_rings(ifp); } static int @@ -2553,6 +2577,13 @@ iflib_stop(if_ctx_t ctx) IFDI_STOP(ctx); DELAY(1000); + /* + * Stop any pending txsync/rxsync and prevent new ones + * form starting. Processes blocked in poll() will get + * POLLERR. + */ + netmap_disable_all_rings(ctx->ifc_ifp); + iflib_debug_reset(); /* Wait for current tx queue users to exit to disarm watchdog timer. */ for (i = 0; i < scctx->isc_ntxqsets; i++, txq++) { From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 13:40:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68E694E977F; Sun, 17 Jan 2021 13:40: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 4DJbdM1zfnz3C7g; Sun, 17 Jan 2021 13:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3603222416; Sun, 17 Jan 2021 13:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10HDe7cs003151; Sun, 17 Jan 2021 13:40:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10HDe7nc003148; Sun, 17 Jan 2021 13:40:07 GMT (envelope-from git) Date: Sun, 17 Jan 2021 13:40:07 GMT Message-Id: <202101171340.10HDe7nc003148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: fa1a4ff944f4 - stable/12 - netmap: vtnet: stop krings during interface reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fa1a4ff944f4b3e841df0cdd67c6373a589ffdd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 13:40:07 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=fa1a4ff944f4b3e841df0cdd67c6373a589ffdd5 commit fa1a4ff944f4b3e841df0cdd67c6373a589ffdd5 Author: Vincenzo Maffione AuthorDate: 2021-01-09 22:34:10 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-17 13:38:09 +0000 netmap: vtnet: stop krings during interface reset Similarly to what done for iflib in 1d238b07d5d4d9660ae0e, this patch prevents access to the krings during the interface reset triggered by netmap_register(). MFC after: 1 week (cherry picked from commit 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a) netmap: vtnet: enable/disable krings on any interface reinit See 3d65fd97e85ab807f3b for a detailed explanation. PR: 252453 MFC after: 1 week (cherry picked from commit bb714db6d39583a9fbf5d11849c5e2365e7c0d80) netmap: vtnet: fix RX initialization after netmap_reset() At device reset, we must not publish those netmap receive buffers that are owned by userspace (nm_kr_rxspace). MFC after: 1 week (cherry picked from commit 3005e10ddbfbec3ecf46a080607bb0d85986eee5) --- sys/dev/netmap/if_vtnet_netmap.h | 21 +++++++++++++-------- sys/dev/netmap/netmap.c | 4 ++++ sys/dev/virtio/network/if_vtnet.c | 10 ++++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/sys/dev/netmap/if_vtnet_netmap.h b/sys/dev/netmap/if_vtnet_netmap.h index 0f686ed60788..cd652938bca5 100644 --- a/sys/dev/netmap/if_vtnet_netmap.h +++ b/sys/dev/netmap/if_vtnet_netmap.h @@ -50,7 +50,7 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state) : VTNET_INIT_NETMAP_EXIT); VTNET_CORE_UNLOCK(sc); - return 0; + return (0); } @@ -213,20 +213,25 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) struct netmap_kring *kring; struct netmap_slot *slot; int error; + int num; slot = netmap_reset(na, NR_RX, rxq->vtnrx_id, 0); if (slot == NULL) return -1; kring = na->rx_rings[rxq->vtnrx_id]; - /* Expose all the RX netmap buffers we can. In case of no indirect + /* + * Expose all the RX netmap buffers we can. In case of no indirect * buffers, the number of netmap slots in the RX ring matches the * maximum number of 2-elements sglist that the RX virtqueue can - * accommodate. We need to start from kring->nr_hwcur, which is 0 - * on netmap register and may be different from 0 if a virtio - * re-init happens while the device is in use by netmap. */ - rxq->vtnrx_nm_refill = kring->nr_hwcur; - error = vtnet_netmap_kring_refill(kring, na->num_rx_desc - 1); + * accommodate. We need to start from kring->nr_hwtail, which is 0 + * on the first netmap register and may be different from 0 if a + * virtio re-init (caused by a netma register or i.e., ifconfig) + * happens while the device is in use by netmap. + */ + rxq->vtnrx_nm_refill = kring->nr_hwtail; + num = na->num_rx_desc - 1 - nm_kr_rxspace(kring); + error = vtnet_netmap_kring_refill(kring, num); virtqueue_notify(rxq->vtnrx_vq); return error; @@ -256,7 +261,7 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) * First part: import newly received packets. * Only accept our own buffers (matching the token). We should only get * matching buffers. The hwtail should never overrun hwcur, because - * we publish only N-1 receive buffers (and non N). + * we publish only N-1 receive buffers (and not N). * In any case we must not leave this routine with the interrupts * disabled, pending packets in the VQ and hwtail == (hwcur - 1), * otherwise the pending packets could stall. diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 075c27b7a597..f75567565bf1 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -616,6 +616,10 @@ netmap_set_all_rings(struct netmap_adapter *na, int stopped) if (!nm_netmap_on(na)) return; + if (netmap_verbose) { + nm_prinf("%s: %sable all rings", na->name, + (stopped ? "dis" : "en")); + } for_rx_tx(t) { for (i = 0; i < netmap_real_rings(na, t); i++) { netmap_set_ring(na, i, t, stopped); diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ff0a07672f49..6018fe56e360 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -2833,6 +2833,11 @@ vtnet_stop(struct vtnet_softc *sc) /* Only advisory. */ vtnet_disable_interrupts(sc); +#ifdef DEV_NETMAP + /* Stop any pending txsync/rxsync and disable them. */ + netmap_disable_all_rings(ifp); +#endif /* DEV_NETMAP */ + /* * Stop the host adapter. This resets it to the pre-initialized * state. It will not generate any interrupts until after it is @@ -3098,6 +3103,11 @@ vtnet_init_locked(struct vtnet_softc *sc, int init_mode) vtnet_update_link_status(sc); callout_reset(&sc->vtnet_tick_ch, hz, vtnet_tick, sc); +#ifdef DEV_NETMAP + /* Re-enable txsync/rxsync. */ + netmap_enable_all_rings(ifp); +#endif /* DEV_NETMAP */ + return; fail: From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 13:40:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8013E4E9DAE; Sun, 17 Jan 2021 13:40: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 4DJbdz3FDKz3CKt; Sun, 17 Jan 2021 13:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 625A922700; Sun, 17 Jan 2021 13:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10HDed2E008728; Sun, 17 Jan 2021 13:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10HDed26008727; Sun, 17 Jan 2021 13:40:39 GMT (envelope-from git) Date: Sun, 17 Jan 2021 13:40:39 GMT Message-Id: <202101171340.10HDed26008727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 45b2c3bec4f2 - stable/12 - re: netmap: enable/disable krings on interface reinit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 13:40:39 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 commit 45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 Author: Vincenzo Maffione AuthorDate: 2021-01-10 15:09:05 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-17 13:40:31 +0000 re: netmap: enable/disable krings on interface reinit This prevents krings from being used during an interface reset, and notifies the active applications. See also 1d238b07d5d4d9660ae0. MFC after: 1 week (cherry picked from commit 54bbcca4f9790e012e0a0f1512d9c879a48d5293) --- sys/dev/re/if_re.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 3bb80a236f8d..d3080031f3b9 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -3359,6 +3359,10 @@ re_init_locked(struct rl_softc *sc) sc->rl_watchdog_timer = 0; callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); + +#ifdef DEV_NETMAP + netmap_enable_all_rings(ifp); +#endif /* DEV_NETMAP */ } /* @@ -3607,6 +3611,10 @@ re_stop(struct rl_softc *sc) callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#ifdef DEV_NETMAP + netmap_disable_all_rings(ifp); +#endif /* DEV_NETMAP */ + /* * Disable accepting frames to put RX MAC into idle state. * Otherwise it's possible to get frames while stop command