From nobody Mon Aug 12 06:57:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wj51F5T6Pz5TJy9; Mon, 12 Aug 2024 06:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wj51F2jjVz4rT1; Mon, 12 Aug 2024 06:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723445841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqPniyDCSdVbYDc08sEg3QlunCCZLtrPOAMxxSRoyug=; b=DTfmVpKP1jWH8tChZ4bNl3u8B18Bh4pNqSL+kEM/qis5stP39B8/6yZLo9CWbBKAin778j Q4t3Fr4m4Mxsz6117YyN1KkQ+q/I7cMrwnyoVsQxCal9NrFSVlVM+2Xb5MlO4+V3LNo1mJ 7Nk6vVJzZlgNl7KtVZJSucwRz4BQVQV0YUdxQAz9F7mUtxOZGYQHGoZ2g5aGoYQm4Iqq5b jHQlp8oB/G8N/QXsBIk/Pqkeu37Ew1pcmuOs/bgw76/fiMWXg35AqVHe+OrTUFM77co1kz L0oypTRnOPkkAJvjmjKEsnjXBKusVeo/CwlTYHK7QY/dbT3rBQD19i5Kn126gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723445841; a=rsa-sha256; cv=none; b=SAMzVUqFFHFfEHc5wleuj0lDxOWkjovJeHWM78/mmU4ZnMium9J7pEpuBQb04CGPJkySQx YdfTuJLbDp02N8tcuS5C/BYqtFs6JjNpjcFN65gAAE1wWrQSRM6jJRn8sknmfvf9kmqcUK AbKEg51Ygrg29BOXB70JV/hoR7SjZzJ884QnaBXE8un+lbcdbbuGQBIqLcjmFDrmOxQQQs h+xcXWqLZHQkqSK4kKZv7fn24iLldC+sxJ/fJ2tQwzc0cSEexNUxvXExxw7IcLCKwCRoTm 0Qm0XAMFqKOVr97IdL6W2jxeko36zTV3Dw3Da/bdop5HY/9zx0H4gMUaE3Wucg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723445841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqPniyDCSdVbYDc08sEg3QlunCCZLtrPOAMxxSRoyug=; b=I6I2EHmyCjlehwYVwvvdUdwDt1MJxRkmJgr4MS9fZRpkKb83ZIgY75ThQjx9L/QJ3KNTpr 0AsIYGPDXJsJBdp4tDho3icVY5b9W5pTCFuMp7JU2Z4v6AWAGaBqmpNd7Y3uAID7vYMxTK XcoLOn/2Jf9H+xT7E+G0Z85xdakl6fvPGJ7IXnJCk8dpWlplhxJWRkp9QyMAeU8mVzj90A rsPDTVitcxg7Mr4ex9csVwFGNFyyolgwHxCo+PpnTNb+FFoLRRwkOqgZUvl4nPI58/YJC3 ArLGzBsT1pPQSIcXZsUB1QUenxukiXuiAhy6V+3GAWbhAAC72N6vgHVNAX3n4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wj51F2KwRzHVg; Mon, 12 Aug 2024 06:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47C6vLAF028513; Mon, 12 Aug 2024 06:57:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47C6vLTX028510; Mon, 12 Aug 2024 06:57:21 GMT (envelope-from git) Date: Mon, 12 Aug 2024 06:57:21 GMT Message-Id: <202408120657.47C6vLTX028510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 6ea4d95f6c76 - main - Move support of Realtek 8156/8156B from cdce(4) to ure(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 6ea4d95f6c76aa64d2db5c04c87e68dc299544df Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=6ea4d95f6c76aa64d2db5c04c87e68dc299544df commit 6ea4d95f6c76aa64d2db5c04c87e68dc299544df Author: Li-Wen Hsu AuthorDate: 2024-08-12 04:04:05 +0000 Commit: Li-Wen Hsu CommitDate: 2024-08-12 06:56:28 +0000 Move support of Realtek 8156/8156B from cdce(4) to ure(4) Reviewed by: kevlo, imp, hrs MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45088 --- share/man/man4/cdce.4 | 6 +----- share/man/man4/ure.4 | 9 +++++++-- sys/dev/usb/net/if_cdce.c | 1 - sys/dev/usb/net/if_ure.c | 2 +- sys/dev/usb/quirk/usb_quirk.c | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/share/man/man4/cdce.4 b/share/man/man4/cdce.4 index 6768c7bbf517..9d842e475d85 100644 --- a/share/man/man4/cdce.4 +++ b/share/man/man4/cdce.4 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" -.Dd February 10, 2023 +.Dd May 3, 2024 .Dt CDCE 4 .Os .Sh NAME @@ -107,10 +107,6 @@ Sharp Zaurus PDA .It Terayon TJ-715 DOCSIS Cable Modem .It -Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller -.It -Planex USB-LAN2500R -.It Huawei 3G/4G LTE (eg. E3372, E5573) and other mobile network devices .El .Sh DIAGNOSTICS diff --git a/share/man/man4/ure.4 b/share/man/man4/ure.4 index 18b68ec9bc8a..942764109dd8 100644 --- a/share/man/man4/ure.4 +++ b/share/man/man4/ure.4 @@ -23,12 +23,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 31, 2016 +.Dd May 3, 2024 .Dt URE 4 .Os .Sh NAME .Nm ure -.Nd "RealTek RTL8152/RTL8153 USB to Ethernet controller driver" +.Nd "RealTek RTL8152/RTL8153/RTL8153B/RTL8156/RTL8156B USB to Ethernet controller driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -90,6 +90,11 @@ Set 1000baseTX operation over twisted pair. The RealTek gigE chips support 1000Mbps in .Cm full-duplex mode only. +.It Cm 2500base-T +Set 2500Base-T operation over twisted pair. +The RealTek 8156/8156B chips support 2500Mbps in +.Cm full-duplex +mode only. .El .Pp The diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index d53d861cfb00..cbb6ae76ef0c 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -281,7 +281,6 @@ static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLA300, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC700, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, - {USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8156, 0)}, {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x16), diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index e9112f403ef5..3f72adb21aea 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -478,7 +478,7 @@ done: } /* - * Probe for a RTL8152/RTL8153 chip. + * Probe for a RTL8152/RTL8153/RTL8156 chip. */ static int ure_probe(device_t dev) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 11be1215062e..d6ddeafd7195 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -111,7 +111,6 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { USB_QUIRK(ELSA, MODEM1, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, UQ_CFG_INDEX_1), USB_QUIRK(CISCOLINKSYS, USB3GIGV1, UQ_CFG_INDEX_1), - USB_QUIRK(REALTEK, RTL8156, UQ_CFG_INDEX_2), /* Quirks for printer devices */ USB_QUIRK(HP, 895C, UQ_BROKEN_BIDIR), USB_QUIRK(HP, 880C, UQ_BROKEN_BIDIR), From nobody Mon Aug 12 13:32:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjFmv3wFjz5Scs4; Mon, 12 Aug 2024 13:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjFmv2X0yz4bl5; Mon, 12 Aug 2024 13:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723469535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=chc4fn8pD1IEujb7T/gVZ7lebMIlzClVCyXR5DSUAHI=; b=DV6b+n7u3uTjTQR1n69FLiXxPBV8Cb35h4X62uKtQXwzUjDNwwbOOAxPG9sT1lMPd1b9ol EzNTYI5pbkzCgwt0Sleur02cZFJhtP5tYKTYOgYiavQogpWluBjO/Y1cqLjO5KChjipNYl h39JXBCdpmdTTEcuYGU3LoBqmiGWJoypCjM5bxo3oiVXBpd+vRjZ18I935E+hm2gBfyvpJ 1IGMZOQ2Bun0NiG0nHx03DtKu/jfZwVSsUsLPLcaum2Z1crNxHrZhZUk6ADb2q9GKKec1P CwSZYZsLotnP750I0oZjHvNEj94Atylg04SRwI3QGHuB2lvTy0YiGMSRs1mMNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723469535; a=rsa-sha256; cv=none; b=e0ItqkSM8z7jPKF4UaVeYDSZm7LLwtxznz8fLsl84RrgyhdoGJpAwUEujTjY+imuTI5nKc AZU8Us1x1uoFZUE+2xilHzjRidKx5lpGY9H7+8XC4MN66SfSPhOPYFyW8Y/S6GHBs4Qhea 58Ma5Lp+od4doUnG735UMZho/WAjbL9rbFQjFyNAJcS8qqXjavcexSsiUPDnaUyM3ouyMV 7uCgDgQrRs3QeQUh8Dpzx0UdlLQFcflm3ZTCFhQn8tcr/aLgy+wNbRFeBalrbrTalFKKIG /837dh0ncWxFSLqJm62dnLsmOsZqUB+Y4/skldCXsSzCJ7ZTwa9f0j1cvItsHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723469535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=chc4fn8pD1IEujb7T/gVZ7lebMIlzClVCyXR5DSUAHI=; b=Y+QgO/4BaFhg6cNlO4dbCOo6+Ga6UhDQJ4iblZBeNQKmARi9dQINOTOcEbFOl49pumJY6p PJk7nCudYq55Zo+29CWoBEsRKJxyIahPAtqp02EL8nIWscnOUMoa10/eraM035AtD9IF3Z gfte2gPevS/a8YmYN+Vm+ENqIHwahd8oebfZttHeBwkWTA41yl96iXjTblRZ503Uqwcgku dpcEK8JbCpP6pSctbOp6dS4PiY6wUh7uOqolXcMBdscNCkY/MdH7dsdtGc/r+jH7QOsNg2 ON2AcRx9VuL6bpJvlHA+NVG8XofdABjK8saCxFcuWxxDJAoBRhMJVgUSNDG0wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjFmv27lzzTm1; Mon, 12 Aug 2024 13:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CDWFqp007154; Mon, 12 Aug 2024 13:32:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CDWFWU007151; Mon, 12 Aug 2024 13:32:15 GMT (envelope-from git) Date: Mon, 12 Aug 2024 13:32:15 GMT Message-Id: <202408121332.47CDWFWU007151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: f5ce3f4ef562 - main - Fix EFI loader reproducibility with lld List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 commit f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 Author: Dimitry Andric AuthorDate: 2024-08-11 19:48:27 +0000 Commit: Dimitry Andric CommitDate: 2024-08-12 13:31:02 +0000 Fix EFI loader reproducibility with lld When the various loaders under stand/efi are built, the resulting binaries differ over multiple runs, even if WITH_REPRODUCIBLE_BUILD is used. This is caused by lld multithreading and the custom linker scripts for the loaders, and affects the following binaries: * loader_4th.efi * loader_4th.sym * loader_4th.sym.full * loader_lua.efi * loader_lua.sym * loader_lua.sym.full * loader_simp.efi * loader_simp.sym * loader_simp.sym.full Work around this by disabling lld threading for these binaries. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46271 --- stand/efi/loader/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 057cb15fb7ff..8f6802831824 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -105,6 +105,11 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie LDFLAGS+= -Wl,--no-dynamic-linker .endif +# When lld is using multiple threads, which it does by default, it can +# result in non-reproducible output with the custom linker script. Work +# around this by disabling threading. +LDFLAGS.lld+= -Wl,--threads=1 + CLEANFILES+= ${LOADER}.efi ${LOADER}.efi: ${PROG} From nobody Mon Aug 12 15:20:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjJ9n1MD8z5SrL0; Mon, 12 Aug 2024 15:20:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjJ9m3S1Bz4pls; Mon, 12 Aug 2024 15:20:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=dwu7P3aQ; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f2a as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6b7a36f26f3so46928136d6.1; Mon, 12 Aug 2024 08:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723476027; x=1724080827; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=sYqd0z6V0wkBJQyJmZtsTnoUymHigrrKljfArYDqzB0=; b=dwu7P3aQQ9jYRGnWIxP/0qvNtvKIrmRp8QCwNc7gjh9MAPbAKAO0U65yHwARXRB0xI KFypH5HQjhO1bptRhb5RV55V0ReAZh2QlLHmGXX9WhVV8DUvHNebFU/zW2dMm1QpN9M3 CzoCPZxd4myhi5iMXXmNAsCNdn72tUNdERIe5Sc1dcwOUiMZvhE2lPnV/I5sofRUAvAJ DrsYnsqkX/9V1taxiPBLUksdeL8XaKJjOSh0SkXPa1bZNP8S2YnO4b6fGfsvG1sdicee f1RRdm7sUPU01J4GehrMo0sP8TjLp1pCNOXiBwVrEU3APfuTHGqZz6HM44dO9oHF4AmO 7HhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723476027; x=1724080827; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sYqd0z6V0wkBJQyJmZtsTnoUymHigrrKljfArYDqzB0=; b=hnVbRysGlddG7PD4wV8gYzqCI6jYTq9LKYl2oC74xDjMq6VMBd0xsvUhuullRvDLUZ Ec3jYbM7xUdNGqBS43rsKEarked9P5UBkLrDOJpBZS7E6s+KazO07MTcwkrDVBWfPRcg jqa2pyK0uKmP5/LDKan8VT9iXTFTDEMwPdtTgHZu1bDUDTXszoHdPgXsP9/XRCpX1uX5 UzyAR2UCC3hraPZz3gyXRXUkIeQenq0ddT76j+JPs2QfRs53Y7uRJdjCPtETm/jHNFOL bJsc1U4jDU8PLXJQvJ7VGzRwR9keiSy9hMVjQo7ZpsUk9TvzZTqac4U2tdrSYq/ELixc VTtA== X-Forwarded-Encrypted: i=1; AJvYcCUoTCtha0llft5E9oANkQUqj4gOJdoZIc0/5z8HwQ/0UCLLoz5+qtk+oYpWuNwHHz5W5dSA4frJWmFjCHq5/iUKm1+TJ+LEUVlJxbPXV/tYb5/cO6ORJ8A4HWf3w9YEK1ip81E56/wjSezCzb7aJxSGLW3jKbZ+Ax1Z9FcySxoBqfH8sGtNrghhwcQeTi+IrZd0ZjK73EZqsGwZrLxN9tMlJ38= X-Gm-Message-State: AOJu0YzymjaE20hjLOhAtvPza4Fn/sL02KaN4tcW2NUp7WA3Oip4gnc6 7e5I8OLSW2XkHmJf976iF4lmBkbe4Sar9VnOjFE8RLquLtHcm2BY85Y+uKRP X-Google-Smtp-Source: AGHT+IGdBlcUDoyAkPyar8+HaYceSyDgj/Tmi3tT/VNP3NflkixNAecIJvU4Faredz8d9wOynjiQPQ== X-Received: by 2002:ad4:5c6a:0:b0:6b7:923c:e0b7 with SMTP id 6a1803df08f44-6bf4fa2d7c4mr6907586d6.21.1723476026620; Mon, 12 Aug 2024 08:20:26 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bd82c874c5sm25910716d6.48.2024.08.12.08.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 08:20:25 -0700 (PDT) Date: Mon, 12 Aug 2024 11:20:23 -0400 From: Mark Johnston To: tuexen@freebsd.org Cc: Zhenlei Huang , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , FreeBSD Security Team Subject: Re: git: 9b569353e0b0 - main - tcp: initialize V_ts_offset_secret for all vnets Message-ID: References: <202408091415.479EF480062250@gitrepo.freebsd.org> <640CAD45-A146-45D1-AFAD-7FDC6B9F6006@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <640CAD45-A146-45D1-AFAD-7FDC6B9F6006@freebsd.org> X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.56 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.956]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2a:from]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_FIVE(0.00)[6]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4WjJ9m3S1Bz4pls On Sat, Aug 10, 2024 at 12:07:35PM +0200, tuexen@freebsd.org wrote: > > On 10. Aug 2024, at 02:20, Zhenlei Huang wrote: > > > > > > > >> On Aug 9, 2024, at 10:15 PM, Michael Tuexen wrote: > >> > >> The branch main has been updated by tuexen: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=9b569353e0b073a513cf10debbe634c2ceb29fdf > >> > >> commit 9b569353e0b073a513cf10debbe634c2ceb29fdf > >> Author: Michael Tuexen > >> AuthorDate: 2024-08-09 14:12:22 +0000 > >> Commit: Michael Tuexen > >> CommitDate: 2024-08-09 14:12:22 +0000 > >> > >> tcp: initialize V_ts_offset_secret for all vnets > >> > >> Initialize V_ts_offset_secret for each vnet, not only for the > >> default vnet, since it is vnet specific. > >> > >> Reviewed by: Peter Lei > >> MFC after: 3 days > >> Sponsored by: Netflix, Inc. > >> Differential Revision: https://reviews.freebsd.org/D46246 > >> --- > >> sys/netinet/tcp_subr.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c > >> index 9e95a87b3596..9b5f2651fb35 100644 > >> --- a/sys/netinet/tcp_subr.c > >> +++ b/sys/netinet/tcp_subr.c > >> @@ -1465,6 +1465,7 @@ tcp_vnet_init(void *arg __unused) > >> VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); > >> > >> V_tcp_msl = TCPTV_MSL; > >> + arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0); > > > > Emm, does it have any (potential) security problems if not initialized ? If yes then does it deserve an SA ? > I don't know, if it deserves a SA. I plan to MFC it after 3 days and would > like to get it included in 13.4 (I sent a notice announcing this to re@ > yesterday). > > The consequence of the bug is that the offset for the TCP timestamp is > predictable for all vnets not being the default vnet (vnet0). > > So an attacker could setup TCP connections to multiple TCP endpoints > and try to figure out > * if they belong to the same host. > * what the ticks value of the host is. > > However, this requires > (a) the attacker knows that the TCP endpoints are on a FreeBSD host. > (b) that at least two TCP endpoints are not in vnet0. > (c) the attacker knows the way the offset is computed. > > (c) is a consequence of (a). > > I also CC'ed the security team, so they are aware of it and can chime in. I don't really see why two endpoints are needed to figure out the uptime of the host. The timestamp we use is a hash of the connection 4-tuple and the secret, which is all zeroes for a VNET jail affected by this bug. One could precompute the hash outputs for some range of time values, connect twice to the same endpoint, and check to see whether the timestamps correspond to two of the precomputed values in a way that roughly matches the time delta between the connections. Assuming a), one can then infer 1) whether the endpoint is in a VNET jail, and 2) the uptime of the host. This assumes that the VNET isn't behind a NAT service, since otherwise the 4-tuple will be different, but even then the search space might be small enough to succeed. From nobody Mon Aug 12 19:38:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjPvD6QDLz5T0jl; Mon, 12 Aug 2024 19:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjPvD4fxBz4LbM; Mon, 12 Aug 2024 19:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723491496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fIyvSLg52s1bqKCyzdhOgcmQlTXBaQsgECys+cb0Ro=; b=hOmt/GqLWol4OrtwpY4ThYpE0wanaxzwKgb+MlJk49BROezEbDZARoiRAJMr5WlZGqwfpq Ll6OBZg68ZqptErppbBMETNLjkAPzQck7SFC7AVMLQ7QPl3k8h2k0LUJCP4/XvSNzziDfb ox1uf+hfG04ZccapWLsfyCQ2y5rNF4ufh6l5rSr3DWUtBgSheYI4lAXWHT3j2a65pBuzRL A3SVYh+jGJ7qunV7r0R2Dk+38BdZSTr/EUYcMmyjSHvYVoepnlZ2pTIYi6GvZHjbyT7Jyd bdqRrwgQ7xy0E9vkpnvwVpKg291JTmamK16e92OTn5JpP4YRLVS2kWY6bXt7kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723491496; a=rsa-sha256; cv=none; b=LTnsewBMIfZgtnBVTl61vtoS+sve+bQ5jwe8z/AfANHHtge/XncmNz60cXLwYXFQd4BY0D S0Gv/t7XofSpmcB+YBk6Fsu84NejqoHkrLWJ5Bm71POERxk3YZUULLONfLecbJfFAtVF1A wr5NRYvkzMTDROpeAp7DVutrDQygQhcSzm9iTj0HpCnnriNZoq1s21g3ZarAOEjPmfcg1B vpmamFou+g8imnM5x5/ph8KTg3xFg2vBddKdLO7TRJLNdCBXo/kubp41E4HrG4cWwbSkf3 0B0soMpk8bTNI4qPJMjhuLrXBzwat3ta/dqo/n/HzS9BwAH1FjQAW4EtMYxMmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723491496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fIyvSLg52s1bqKCyzdhOgcmQlTXBaQsgECys+cb0Ro=; b=bkgcztorH9pJCGaEt18PpUnHDnhoo5V1i9cWpVGYzBVNHI/6H4Sq5cZimLL+tOG8fobm55 ogqQbSC78oVsmNFaPqzjbTMYO9RLYl5zGqH5vI/sPJtTjzY/Jd6LQkFjs3bVsgs4SVFAY0 LWg4BlAbpY7zm45KAEPlQiv0Grq6F1aNnpWtHNKaeHSez4opugLIh+YG0NV+QXrAE77ibZ kXqFTYJWEx+Ko98IFRVF3cEdnvYNKpESyyOh4wCtJMmw8UTfBjgz6+WqVvjOEKpu47xFpi jiXuBM1XpUR6+ivOduUyGzgc96H8yHV4IXpLlCCLL+876Sy+MA2AvWT3U6hxTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjPvD485szgb4; Mon, 12 Aug 2024 19:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CJcGP1017941; Mon, 12 Aug 2024 19:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CJcGi1017938; Mon, 12 Aug 2024 19:38:16 GMT (envelope-from git) Date: Mon, 12 Aug 2024 19:38:16 GMT Message-Id: <202408121938.47CJcGi1017938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: ccb0365643dc - main - stale symlinks: configurable obj dir prefix List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccb0365643dc5e8d37ada3789bbe370b81ba5b3c Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=ccb0365643dc5e8d37ada3789bbe370b81ba5b3c commit ccb0365643dc5e8d37ada3789bbe370b81ba5b3c Author: Wolfram Schneider AuthorDate: 2024-08-12 19:34:43 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-12 19:34:43 +0000 stale symlinks: configurable obj dir prefix Use $MAKEOBJDIRPREFIX if set, otherwise /usr/obj --- tools/build/stale-symlink-buildworld.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh index a4515db3fccb..32ebc1f9d66d 100755 --- a/tools/build/stale-symlink-buildworld.sh +++ b/tools/build/stale-symlink-buildworld.sh @@ -11,8 +11,10 @@ PATH="/bin:/usr/bin"; export PATH : ${ncpu=$(nproc)} +obj_dir_prefix=${MAKEOBJDIRPREFIX:="/usr/obj"} + # check other directories as well -: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} +: ${STALE_SYMLINK_BUILDWORLD_DIRS=$obj_dir_prefix} trap 'rm -f $script' 0 script=$(mktemp -t stale-symlink) From nobody Mon Aug 12 20:41:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjRJP5414z5T6qj; Mon, 12 Aug 2024 20:41:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjRJP2JXnz4RNG; Mon, 12 Aug 2024 20:41:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c965:bc32:9a61:38c2]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 5AF05721E2806; Mon, 12 Aug 2024 22:41:36 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: 9b569353e0b0 - main - tcp: initialize V_ts_offset_secret for all vnets From: tuexen@freebsd.org In-Reply-To: Date: Mon, 12 Aug 2024 22:41:35 +0200 Cc: Zhenlei Huang , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , FreeBSD Security Team Content-Transfer-Encoding: quoted-printable Message-Id: <87B7ADB0-5FEE-4ACA-A0E3-492CDB1A1DD1@freebsd.org> References: <202408091415.479EF480062250@gitrepo.freebsd.org> <640CAD45-A146-45D1-AFAD-7FDC6B9F6006@freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Queue-Id: 4WjRJP2JXnz4RNG > On 12. Aug 2024, at 17:20, Mark Johnston wrote: >=20 > On Sat, Aug 10, 2024 at 12:07:35PM +0200, tuexen@freebsd.org wrote: >>> On 10. Aug 2024, at 02:20, Zhenlei Huang wrote: >>>=20 >>>=20 >>>=20 >>>> On Aug 9, 2024, at 10:15 PM, Michael Tuexen = wrote: >>>>=20 >>>> The branch main has been updated by tuexen: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9b569353e0b073a513cf10debbe634c2= ceb29fdf >>>>=20 >>>> commit 9b569353e0b073a513cf10debbe634c2ceb29fdf >>>> Author: Michael Tuexen >>>> AuthorDate: 2024-08-09 14:12:22 +0000 >>>> Commit: Michael Tuexen >>>> CommitDate: 2024-08-09 14:12:22 +0000 >>>>=20 >>>> tcp: initialize V_ts_offset_secret for all vnets >>>>=20 >>>> Initialize V_ts_offset_secret for each vnet, not only for the >>>> default vnet, since it is vnet specific. >>>>=20 >>>> Reviewed by: Peter Lei >>>> MFC after: 3 days >>>> Sponsored by: Netflix, Inc. >>>> Differential Revision: https://reviews.freebsd.org/D46246 >>>> --- >>>> sys/netinet/tcp_subr.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>=20 >>>> diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c >>>> index 9e95a87b3596..9b5f2651fb35 100644 >>>> --- a/sys/netinet/tcp_subr.c >>>> +++ b/sys/netinet/tcp_subr.c >>>> @@ -1465,6 +1465,7 @@ tcp_vnet_init(void *arg __unused) >>>> VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); >>>>=20 >>>> V_tcp_msl =3D TCPTV_MSL; >>>> + arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0); >>>=20 >>> Emm, does it have any (potential) security problems if not = initialized ? If yes then does it deserve an SA ? >> I don't know, if it deserves a SA. I plan to MFC it after 3 days and = would >> like to get it included in 13.4 (I sent a notice announcing this to = re@ >> yesterday). >>=20 >> The consequence of the bug is that the offset for the TCP timestamp = is >> predictable for all vnets not being the default vnet (vnet0). >>=20 >> So an attacker could setup TCP connections to multiple TCP endpoints >> and try to figure out >> * if they belong to the same host. >> * what the ticks value of the host is. >>=20 >> However, this requires >> (a) the attacker knows that the TCP endpoints are on a FreeBSD host. >> (b) that at least two TCP endpoints are not in vnet0. >> (c) the attacker knows the way the offset is computed. >>=20 >> (c) is a consequence of (a). >>=20 >> I also CC'ed the security team, so they are aware of it and can chime = in. >=20 > I don't really see why two endpoints are needed to figure out the = uptime Bad wording on my side. > of the host. The timestamp we use is a hash of the connection 4-tuple > and the secret, which is all zeroes for a VNET jail affected by this = bug. Correct. >=20 > One could precompute the hash outputs for some range of time values, > connect twice to the same endpoint, and check to see whether the > timestamps correspond to two of the precomputed values in a way that > roughly matches the time delta between the connections. Assuming a), > one can then infer 1) whether the endpoint is in a VNET jail, and 2) = the > uptime of the host. What I meant: If the attacker knows the four tuple and the secret, the attacker can setup a TCP connection to an end-point and can compute the ticks value. This gives an indication of the up time. If the sysctl net.inet.tcp.ts_offset_per_conn is off (not the default) and the system operates as a server, an attacker could figure out that two end points have the same ticks value and, most likely, are on the same host. >=20 > This assumes that the VNET isn't behind a NAT service, since otherwise > the 4-tuple will be different, but even then the search space might be > small enough to succeed. Correct. If the attacker doesn't see the four tuple (or the IP address pair), the ticks value can't be computed. What I was referring to are the arguments why you don't want to use TCP timestamps, if the timestamps are just the uptime. Best regards Michael From nobody Mon Aug 12 21:05:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjRrR3HCdz5T9Hh; Mon, 12 Aug 2024 21:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjRrR2Sxrz4Txf; Mon, 12 Aug 2024 21:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723496759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zzy7aJ+bjR9GL/sXGbtcaJkOu0ne6S29NmAskV61KJA=; b=jVSk8dLap+PhrxC1hfE4DiZsa2YJ6xwhbXwBXi8RHGyVwBkHikOt6YBPnU6X/4TjH42wlx Bb2wyRplISgJSGD1Lbf+qRqglw7b7KwpmbHWpTK+Bx68vzwCMGppktB1+xt9blnSFf+09Z tEJPBJdqVIBM+qtOKK+15GsrKbSFETYLRtjgDYrygNvgpbYjfC4YTm+3xqe6kkimoAZSAp KNxs/U/oKE0oLET0wF/MkkGsTcot/AYluyEX1wl1aHLkOSuB6OowkRS7aDndBFNMdTqGbQ R3KtH092IkFZ2W/NqGPNyYsHQzl8FkGYagFR+WfuplebDwMFEkFouCEqqeNDQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723496759; a=rsa-sha256; cv=none; b=LkKtxjB9wvDW39oARvky+2crGSh3R0FOgg91HJwjeSHpVbxuqsS8n16WRobajF9RSn1ipS tEt/+ES8+CwsbIbF/sWgm3qrFSDnBsLxVly7BouDhdvFXofvr5hv8AKEDUPJv1RMAx1ng+ 9V9VAeRMUr7cju83FEaLCq7t+fWFa6CE3YAjkafupluACVr7UcMZectqda0SRlleVA6Ar3 bRVo7U/nx9Rf2B93Hdt3o7QJhUjjqnFI2Nvgi68/KxvGnmZOY9F0x600GkzHp3llsUlcHq giOs68pyBWq7v/Bhw8ZMV17afrjDq4GQrgL6cYLgrPrnpnojmGUfXBiKh3Nu1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723496759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zzy7aJ+bjR9GL/sXGbtcaJkOu0ne6S29NmAskV61KJA=; b=bkeM/ExfilGt0xXNzfTQufF0TEv3W/NFGPBUyNUO1nv1DsRi9mMIfpfeGXisNpu1PmBUUM XM9AZrSIoxndbbodEFeUz0JkNQbDkJIQhnDCLpVi3rfVqpPmK9nYVj+J7sBbU8S9zgokXa subiNyohaAeV/k+ddR2n17qenmEuLdKCxmJPQqH4drXIjGyBSE2cnObU9fIK4VbpQmSbg3 NxgyqtRKZYDOLKVSpTN27b7yMc6HISgAwbnlNclaQwdTdB997QI9DSc+dWyF2lmZJgfmkw XBBbCJirSu447Ra5yUTckZnY7EqpV21jVzSfSxI+4ecscbEBYCmq3s7EJWDhEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjRrR1yRVzk2j; Mon, 12 Aug 2024 21:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CL5xLC069621; Mon, 12 Aug 2024 21:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CL5xGF069618; Mon, 12 Aug 2024 21:05:59 GMT (envelope-from git) Date: Mon, 12 Aug 2024 21:05:59 GMT Message-Id: <202408122105.47CL5xGF069618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b70247df0ba4 - main - axgbe: use bit_foreach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b70247df0ba43a97fb4b06bbc85163a3ecaf08a5 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b70247df0ba43a97fb4b06bbc85163a3ecaf08a5 commit b70247df0ba43a97fb4b06bbc85163a3ecaf08a5 Author: Doug Moore AuthorDate: 2024-08-12 21:04:32 +0000 Commit: Doug Moore CommitDate: 2024-08-12 21:04:32 +0000 axgbe: use bit_foreach bitstring.h includes a definition of bit_foreach, for iterating over the set bits of a bitstring. axgbe implements its own version of this for bitstrings. Drop it, and use the bitstring method. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D46037 --- sys/dev/axgbe/xgbe-dev.c | 7 +++-- sys/dev/axgbe/xgbe_osdep.h | 66 ---------------------------------------------- 2 files changed, 3 insertions(+), 70 deletions(-) diff --git a/sys/dev/axgbe/xgbe-dev.c b/sys/dev/axgbe/xgbe-dev.c index 39d0dab144a2..3a7d683ea5a9 100644 --- a/sys/dev/axgbe/xgbe-dev.c +++ b/sys/dev/axgbe/xgbe-dev.c @@ -826,7 +826,7 @@ static int xgbe_update_vlan_hash_table(struct xgbe_prv_data *pdata) { uint32_t crc; - uint16_t vid; + size_t vid; uint16_t vlan_hash_table = 0; __le16 vid_le = 0; @@ -834,14 +834,13 @@ xgbe_update_vlan_hash_table(struct xgbe_prv_data *pdata) XGMAC_IOREAD(pdata, MAC_VLANHTR)); /* Generate the VLAN Hash Table value */ - for_each_set_bit(vid, pdata->active_vlans, VLAN_NVID) { - + bit_foreach(pdata->active_vlans, VLAN_NVID, vid) { /* Get the CRC32 value of the VLAN ID */ vid_le = cpu_to_le16(vid); crc = bitrev32(~xgbe_vid_crc32_le(vid_le)) >> 28; vlan_hash_table |= (1 << crc); - axgbe_printf(1, "%s: vid 0x%x vid_le 0x%x crc 0x%x " + axgbe_printf(1, "%s: vid 0x%lx vid_le 0x%x crc 0x%x " "vlan_hash_table 0x%x\n", __func__, vid, vid_le, crc, vlan_hash_table); } diff --git a/sys/dev/axgbe/xgbe_osdep.h b/sys/dev/axgbe/xgbe_osdep.h index 1f0359657dcd..40c1607b20e3 100644 --- a/sys/dev/axgbe/xgbe_osdep.h +++ b/sys/dev/axgbe/xgbe_osdep.h @@ -56,11 +56,6 @@ typedef uint32_t __le32; #define le32_to_cpu(x) htole32(x) #define cpu_to_le16(x) htole16(x) -#define for_each_set_bit(bit, addr, size) \ - for ((bit) = find_first_bit((addr), (size)); \ - (bit) < (size); \ - (bit) = find_next_bit((addr), (size), (bit) + 1)) - typedef struct mtx spinlock_t; static inline void @@ -241,65 +236,4 @@ get_bitmask_order(unsigned int count) return (order); /* We could be slightly more clever with -1 here... */ } -static inline unsigned long -find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) -{ - long mask; - int offs; - int bit; - int pos; - - if (offset >= size) - return (size); - pos = offset / BITS_PER_LONG; - offs = offset % BITS_PER_LONG; - bit = BITS_PER_LONG * pos; - addr += pos; - if (offs) { - mask = (*addr) & ~BITMAP_LAST_WORD_MASK(offs); - if (mask) - return (bit + __ffsl(mask)); - if (size - bit <= BITS_PER_LONG) - return (size); - bit += BITS_PER_LONG; - addr++; - } - for (size -= bit; size >= BITS_PER_LONG; - size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { - if (*addr == 0) - continue; - return (bit + __ffsl(*addr)); - } - if (size) { - mask = (*addr) & BITMAP_LAST_WORD_MASK(size); - if (mask) - bit += __ffsl(mask); - else - bit += size; - } - return (bit); -} - -static inline unsigned long -find_first_bit(const unsigned long *addr, unsigned long size) -{ - long mask; - int bit; - - for (bit = 0; size >= BITS_PER_LONG; - size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { - if (*addr == 0) - continue; - return (bit + __ffsl(*addr)); - } - if (size) { - mask = (*addr) & BITMAP_LAST_WORD_MASK(size); - if (mask) - bit += __ffsl(mask); - else - bit += size; - } - return (bit); -} - #endif /* _XGBE_OSDEP_H_ */ From nobody Mon Aug 12 21:53:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjSv81bHNz5TF61; Mon, 12 Aug 2024 21:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjSv818dsz4YPQ; Mon, 12 Aug 2024 21:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723499604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IYXapbmRSQ3HN50WkL9zeBmqhzG5GEPF75+uwPvEfFk=; b=LpXZlsB+qwA1UmK/ILooAQW6xQzmK2dfAiZaSPFnkzftOHwbIq08YpI0hzQ1cLShxs7HPw gIqlB77z6vLvRnEDxPGDhbB68QgbXm+aGYwmTAUOA/TVzy6ZeDlVodw0EQIm4Su6fL8jBB 077sN1BtZoOX03iS4CxQBWKAfrVelx3lBSVlmV/2/SLAt/xbS9VS+d/CGHGLCmy3u3Ap5l PBcFCz6wuH7eaj6G4J9k2W3nqa/CKAwCqZTop1TgNeD6LRosEec5PnI/8N+2QCE/GZWi+o Nbwa97pGd5EXbue68YmNovNXFJvOA5GKi0XhcgDySQHypCh8jXfnh4pzqImGEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723499604; a=rsa-sha256; cv=none; b=DaJ3O7VoFSWgUvJyt3xG0arUinHu49Pfx8/ND7sJyZxjjLRyWEROmOeWbn/XmO8H2ANNu6 XBcQNCMZ4vwxKbVxNHXJuiY+DdKw2eSx/WlOVhBY/osXJvin1X5qbkC54zMKcO2gApfXsf WUS0rGBMZV409iaM6/TNSPBKp4542YC5KPJBJWY/hZ9LThwFIM6wU3CBBdk/elv9yJEawf kX92Z6vABey9vqhmtDWZv67CB7nQe643Q3ux2hiVO2oTjTiHXnC3s0JAoLuLBTlF7amd7e oEX9fgVxZCELtuFj1BOA+6QJXgHBGaTd+M/N8RSBeXJSa45OrqYGiN0W4wxA9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723499604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IYXapbmRSQ3HN50WkL9zeBmqhzG5GEPF75+uwPvEfFk=; b=jNqs+9hvEybWeVTkMwiRvGGYm7+iaWe6nmc5hoHXaZGKgSM6trXC4tcZypEy313GdpXM0p HKyKodqw1QSmrDIuX4kO2EY6X8/RPiZ2DCox+sSemDos2+74tN71UY5cEn//RApy5ilbin fg5eO/0JbK2Tuz3VfWpzreofLYAgMMpPK57049S2GlK1Yh4+Nky9Z2/YhNt7C7MeEFe6xv ibh4eRH85CRxW99UpqkeqkBvfOIQUxxL7w1ppSG9f44T18k4hrNjsy4Hv4wocOXzASMHpr kNuEEN98KQg4t2HLj75CkTZYXWPuKKkdaFKI6zA6hziWmp3FsjoGQrYUfhabHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjSv80lGQzkdT; Mon, 12 Aug 2024 21:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CLrOUL052619; Mon, 12 Aug 2024 21:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CLrNuW052616; Mon, 12 Aug 2024 21:53:23 GMT (envelope-from git) Date: Mon, 12 Aug 2024 21:53:23 GMT Message-Id: <202408122153.47CLrNuW052616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 97c31cc80098 - main - kldxref: Clarify ambiguous comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97c31cc80098956688a36a173a42b54549350d40 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=97c31cc80098956688a36a173a42b54549350d40 commit 97c31cc80098956688a36a173a42b54549350d40 Author: Jessica Clarke AuthorDate: 2024-08-12 21:53:13 +0000 Commit: Jessica Clarke CommitDate: 2024-08-12 21:53:13 +0000 kldxref: Clarify ambiguous comment This previously read, to me at least, as if the not only applied to ending with ".ko", not to the entire rest of the sentence, and thus the implementation looked wrong. The history of D43507 however shows that the behaviour is as intended. --- usr.sbin/kldxref/kldxref.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 122551940ac7..6bb0469a9ff5 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -839,8 +839,8 @@ main(int argc, char *argv[]) continue; /* * Skip files that generate errors like .debug, .symbol and .pkgsave - * by generally skipping all files not ending with ".ko" or that have - * no dots in the name (like kernel). + * by generally skipping all files which neither end with ".ko" + * nor have no dots in the name (like kernel). */ dot = strrchr(p->fts_name, '.'); if (dot != NULL && strcmp(dot, ".ko") != 0) From nobody Mon Aug 12 22:36:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjTrl4D1cz5TKBb; Mon, 12 Aug 2024 22:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjTrl1sHwz4cXf; Mon, 12 Aug 2024 22:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723502183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Tg1g79avV+S396q6e+7i5vP/FWbBo+Bn/GGKdAZcvY=; b=d1lhM8bSZnBXrnQvIAdJCd5X12+LZvWkrLPIIfFKvmGKSXA9VqvSJpMk5QLjeBrJF6TnBd 0Iw8hm8eh1fRHlmm/g6FVVh66FavY9huKBerPNq/G8muNrq3Sr5S/sjx73Iib0tMQzSrnx oy3m9XuoDMoX+bfUAtoJ6AuuM3lGwuPRZ6TcQtb7peTeRj6utH6JrvvL3TA8tS+pjL7Y7L HcJbSVlemBRB21iiCBR6pxkDcsY2Lwv4VN5DOemiabuTx9J9qhARhTvSKR5TS7o4b9qWcD fA8pfuuo69Rx0bzDxRENRK/mi8Ei2z0kDhCtYHs7iL54eAAuUb3xdFS65nIQbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723502183; a=rsa-sha256; cv=none; b=iS0d/RUI2pGIu9dWSLFAdx4QR5iCaYyO23/eMVqqeYfNTQBnij8o9DeNi7we3Gw/mGEEd2 C27yafCceOsMrAw09uHP2idEi3l5IeQNgeXtcNMvBqYtKLPfDn2nCCP7wqi1imWHV6bEmY njl1mcDx0Gpm16SRllpg9f5KCwCE0wLvBiYGN6gC6dF7g0+6T0VZWy0ApFssjfMnyUmq1r sNuokMXNIuWbbEo2iGqmfl31nILTVw3trhO7QZIvZUyFGJEMhNsIAgYzjdNfGG7kS1laj8 D3nGROxqynYleRh4leye/YDaWq1SVELXehkyOP3LbfPJbg4wbrUwuG050wJyDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723502183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Tg1g79avV+S396q6e+7i5vP/FWbBo+Bn/GGKdAZcvY=; b=dPLByRnAxROwd8KajgxuUdALkWFiem/WrMgzkmJI5GJ7+ZVsDe5MfpPDRZmDUs7VpsrjMn a4tFtFWx/CR6lVtcEfQ0HK9EEYWwKL0H3kr+FiRqtNACDSqPt5BvJadaOw3UxQfK4qWn/2 VTm8RUFRVuzR4j8jF4jA2SnQdnZVOm1fu+izadlZW6wskzhA1/ylZz1tPzrVTa412t491C P+DhG9B7A1GhCidRDbbRMMpI6DcsfFyiu3tMeNRC1InB50ITX1w5aZjnJu0lGLcIO9ev1R 2Nxzbqm8woqYFfeGEESEOH+5i4fW/lD+aNEb1hO/b1De+fq974FrUn5bWGxJvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjTrl1NYGzlgV; Mon, 12 Aug 2024 22:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CMaNfm020730; Mon, 12 Aug 2024 22:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CMaNlK020727; Mon, 12 Aug 2024 22:36:23 GMT (envelope-from git) Date: Mon, 12 Aug 2024 22:36:23 GMT Message-Id: <202408122236.47CMaNlK020727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 5cf705491727 - main - jail: only chdir to user's home directory when user is specified List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cf705491727dd963485f9911ee3d52c3bf148db Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf705491727dd963485f9911ee3d52c3bf148db commit 5cf705491727dd963485f9911ee3d52c3bf148db Author: Jamie Gritton AuthorDate: 2024-08-12 22:23:28 +0000 Commit: Jamie Gritton CommitDate: 2024-08-12 22:23:28 +0000 jail: only chdir to user's home directory when user is specified jail(8) with the "exec.clean" parameter not only cleans the enviromnent variables before running commands, but also changes to the user's home directory. While this makes sense when auser is specified (via one of the exec.*_user parameters), it leads to all commands being run in the jail's /root directory even in the absence of an explicitly specified user. This can lead to problems when e.g. rc scripts are run from that non-world-readable directory, and run counter to expectations that jail startup is analogous to system startup. Restrict this behvaiour to only users exlicitly specified, either via the command line or jail parameters, but not the implicit root user. While this changes long-stand practice, it's the more intuitive action. jexec(8) has the same problem, and the same fix. PR: 277210 Reported by: johannes.kunde at gmail Differential Revision: https://reviews.freebsd.org/D46226 --- usr.sbin/jail/command.c | 2 +- usr.sbin/jail/jail.8 | 7 ++++++- usr.sbin/jexec/jexec.8 | 7 ++++++- usr.sbin/jexec/jexec.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index 60893444e9de..fe6563230bde 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -788,7 +788,7 @@ run_command(struct cfjail *j) setenv("HOME", pwd->pw_dir, 1); setenv("SHELL", *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); - if (clean && chdir(pwd->pw_dir) < 0) { + if (clean && username && chdir(pwd->pw_dir) < 0) { jail_warnx(j, "chdir %s: %s", pwd->pw_dir, strerror(errno)); exit(1); diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 2ecb711c971f..19e89ce661a9 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 24, 2024 +.Dd August 12, 2024 .Dt JAIL 8 .Os .Sh NAME @@ -873,8 +873,13 @@ are set to the target login's default values. is set to the target login. .Ev TERM is imported from the current environment. +.Ev PATH +is set to "/bin:/usr/bin". The environment variables from the login class capability database for the target login are also set. +If a user is specified (as with +.Va exec.jail_user ) , +commands are run from that (possibly jailed) user's directory. .It Va exec.jail_user The user to run commands as, when running in the jail environment. The default is to run the commands as the current user. diff --git a/usr.sbin/jexec/jexec.8 b/usr.sbin/jexec/jexec.8 index 4400cbbe56a3..431978c4d0ae 100644 --- a/usr.sbin/jexec/jexec.8 +++ b/usr.sbin/jexec/jexec.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 7, 2023 +.Dd August 12, 2024 .Dt JEXEC 8 .Os .Sh NAME @@ -55,6 +55,11 @@ The environment is discarded except for and anything from the login class capability database for the user. .Ev PATH is set to "/bin:/usr/bin". +If a user is specified (via +.Fl u +or +.Fl U ) , +commands are run from that (possibly jailed) user's directory. .It Fl u Ar username The user name from host environment as whom the .Ar command diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c index 7a32efa34031..35fd9c8d20e4 100644 --- a/usr.sbin/jexec/jexec.c +++ b/usr.sbin/jexec/jexec.c @@ -129,7 +129,7 @@ main(int argc, char *argv[]) setenv("HOME", pwd->pw_dir, 1); setenv("SHELL", *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); - if (clean && chdir(pwd->pw_dir) < 0) + if (clean && username && chdir(pwd->pw_dir) < 0) err(1, "chdir: %s", pwd->pw_dir); endpwent(); } From nobody Mon Aug 12 23:05:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjVVL09MXz5TMvm; Mon, 12 Aug 2024 23:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVVK6ms5z4fgT; Mon, 12 Aug 2024 23:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MgvnBMiwBBenR8nAOulXaHbEJh2sWXO4ocxGRi27hx0=; b=Jz8YP6rJgsIc9Nwwp6jx9WYSSihoelcC8ex0Juh1DrZdbm2Gft8VupppuKYI0hLjOHel/N YLgzNCJ19ldV/79aW2wgxmQLd0bDV/AIVhA6D1O6kVvdbQ4zMynDIg7vAAvrJIUf8kcvNp +EOAQosLRshyt3X4axU5luv5re5mUpe3Bpxo42/7jmISqHhnF6LMCB4wGkAzuIOHqoDFG6 hrr1JrvI/Sh3y8Aaz2eq9aX6Msq/6MTMnbcQ61CxT0aV36kaRKnnirZvmqVl9C+3U4fQpz jOU76ALWiRUJ39WBSxULYVPBhfNk/T7otd0hWRP6Whib5gnEwMy/bSNuXLT2OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723503929; a=rsa-sha256; cv=none; b=b1Ia/L7lqeSRLv+T7+/ZJB48Y7ffesjae62kCWBqdTNqFkILVJtkaFFt9j74hwWjtN5xhW OZcxLgt6ClcROYtLoHpNetsjm7M4GlyEZ+MCR3lvnOpKdvpYXcTOIri9xIPv3ekuZX3djK WDjBctOSnWk880A7cufW5i2wbfYzU2680G9ETOp2wRKnlG94MeE/OBeh6giM+n7vRwr48N U9oYH4YLGnR4c+pIBOr5GMRqRzmk3IllZgVpExVs5CxZPA/jNR2KIDEPYwpC6v47geW1zj PApHvLQHLzEnpmxRvhTHWHXipgAHDq5+YPNKHsp/TM0C3CWboG9Ou8snyFf0+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MgvnBMiwBBenR8nAOulXaHbEJh2sWXO4ocxGRi27hx0=; b=k43TALnreMptDW+02i9mZSndkReHS/sOmTSemX8Wp5FVLkqHUtaREGlmF8WLFz/su1iY57 n3fdzRdInMRYio2rjYQAaN4ufiFK5VUSrrRtw2a1reTSRbfbofpjQY9iwH+4glWwFt8/u/ Bp0xzEjhqKJC/6CDuiMWiqu10DusbOIeRytdZi7xZj9wO2kM7IP5+5Ibhf6YTkXhvgiknC MH2PvKWdOvnbWPryWTsgq+DI1Ls2UkXhs61R/WD2ObdRb5h0Zw9hMrJiKg0d/6j0o56Az8 i8Kwvb/ootIb9DyXYESGsCy0YjHPm6FDdONXW0/Vg9rb6S2+6ySTFMQ8VShM+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjVVK6G1ZzmT2; Mon, 12 Aug 2024 23:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CN5TQ7072034; Mon, 12 Aug 2024 23:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN5T2D072031; Mon, 12 Aug 2024 23:05:29 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:05:29 GMT Message-Id: <202408122305.47CN5T2D072031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0a8e5aaa97da - main - socket: Add macros to assert that the caller holds a socket I/O lock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a8e5aaa97dad579b5489b11a4729da354c0bd74 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a8e5aaa97dad579b5489b11a4729da354c0bd74 commit 0a8e5aaa97dad579b5489b11a4729da354c0bd74 Author: Mark Johnston AuthorDate: 2024-07-22 23:01:53 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 22:53:26 +0000 socket: Add macros to assert that the caller holds a socket I/O lock Remove some unused macros while here. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/sys/socketvar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 15d770721361..2d050707606d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -310,12 +310,14 @@ soeventmtx(struct socket *so, const sb_which which) soiolock((so), &(so)->so_snd_sx, (flags)) #define SOCK_IO_SEND_UNLOCK(so) \ soiounlock(&(so)->so_snd_sx) -#define SOCK_IO_SEND_OWNED(so) sx_xlocked(&(so)->so_snd_sx) +#define SOCK_IO_SEND_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_snd_sx, SA_LOCKED) #define SOCK_IO_RECV_LOCK(so, flags) \ soiolock((so), &(so)->so_rcv_sx, (flags)) #define SOCK_IO_RECV_UNLOCK(so) \ soiounlock(&(so)->so_rcv_sx) -#define SOCK_IO_RECV_OWNED(so) sx_xlocked(&(so)->so_rcv_sx) +#define SOCK_IO_RECV_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_rcv_sx, SA_LOCKED) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \ From nobody Mon Aug 12 23:05:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjVVM2Vkqz5TMyD; Mon, 12 Aug 2024 23:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVVM0GN0z4fSC; Mon, 12 Aug 2024 23:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3gkcH9kotKd7tGqyNugglARNl5Iv6rL6A+0/xGc0Q0=; b=xxGjwdznRI+xUv4gDX+8DBhNONbvFB8LUrASD5wchqT732IK9yG1BfOYvZbOaU0FLwBoBh XMFrwVOy019CVPvtJpO6psDzHP6J9zKnStP6JY5zKmOHHip9Fnxt6Qdz2FKbbfLG0hpH7q V7i9EH2Kd347h8sH+1gHrKv6ADVNWi2ORPakyB8TOPfiBT/JcBWZYgUXzom6PLn2SaasPk EAP6sxpVsAMKhwT2JyIRDRluIvAv3NVNktB0jEknUCdrjxbzt4LipkRoARom3NM6vbYUgT wq4L7asfHdD4A1nm3/R0h4P9mMy7FbwCMW8B5dAlfDs2TsTU9DiRZ59uoK7YhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723503931; a=rsa-sha256; cv=none; b=GN45vZhEM+a091bZQ163ckQ+daE++FjbJMeo1totVa+3a52tLCMYlgs1czPsgQOnwhf2YG +nWYXCpZwQFS+xlVE1HqZ3UMDzONrFE/g69cpBgFpusrasAnT9Y6xHz0ZRuKHOKab+Qoqx 9/YhpHYVVyintFKCONFiRNnzVocrqN2Eaig6N+Hc2Z8ruNhUcSUEMIKKjmT0jVjh0qp/Mq 66Ek1HAFfqzmk9H8RHws/D15JltkbWn6lNXf12vPwSX1TEv6XUlQAcNYmizKTmS9DmNvSL IDCHKGDa0p1GCOc0QNhaOF9hd3z2yZ8gwZLxb03T8Sa+6ZTV3nhmeWvnhWe6Hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3gkcH9kotKd7tGqyNugglARNl5Iv6rL6A+0/xGc0Q0=; b=VHKQOk54QI93g/Nib6d+rB61tX4KtmmHMc4WBUsSh9QI+pzJ76eA3mHyZ8OVJu992/XNEP sFveNynG3jPviROouqQB8ZZrw+PSwveqXNQO2wOHLr9NBNFR671iD+vvwK/R3o51ysxBSc mJpZqD7eSFe+siZ3SdOYgCRHj2p0GnTgAK3mEEx5bmzhytzrB8e44ahZt8uT2zo4Iubin7 Z3gB8bU9vMg2pVuy1F/kdisbkdxNJ0wsLndq20mfhQqrNBQwXHsXeBEV9nFFv/aBNKoxEH apmiVoFXmHkqcPdJutu/p3Vtdgk0ZjoT7jF2E9OQ8Mf6WCEZN6bFnvSUQoB3/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjVVL70JBzmT3; Mon, 12 Aug 2024 23:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CN5UrA072088; Mon, 12 Aug 2024 23:05:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN5UWk072085; Mon, 12 Aug 2024 23:05:30 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:05:30 GMT Message-Id: <202408122305.47CN5UWk072085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 07f2ed5ce882 - main - socket: Make the sopt_rights field a pointer to const List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07f2ed5ce88293b5008a27d1868f47eb8cbd25e2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=07f2ed5ce88293b5008a27d1868f47eb8cbd25e2 commit 07f2ed5ce88293b5008a27d1868f47eb8cbd25e2 Author: Mark Johnston AuthorDate: 2024-07-11 17:24:35 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 22:53:26 +0000 socket: Make the sopt_rights field a pointer to const No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/sys/sockopt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index 6cc8875a2665..bfe12d8510d7 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -51,7 +51,7 @@ struct sockopt { int sopt_name; /* third arg of [gs]etsockopt */ void *sopt_val; /* fourth arg of [gs]etsockopt */ size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */ - struct cap_rights *sopt_rights; /* Capsicum rights attached to the fd */ + const struct cap_rights *sopt_rights; /* Capsicum rights for the fd */ struct thread *sopt_td; /* calling thread or null if kernel */ }; From nobody Mon Aug 12 23:05:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjVVN4MqRz5TMt4; Mon, 12 Aug 2024 23:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVVN1QVSz4fdL; Mon, 12 Aug 2024 23:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HgPaWe6IfEFljcj4tX+/hmK7o5CKRXWvE4SK1ct9AZk=; b=g7wzWFliMAmi5UaXe52o5VgaynnWFw0AHfTrnf1m9wQUfSB+EuH+Ash7JCbOk+N0S6o7+/ oWQG870P8a2mI6PBSGCmHsWV7quCNATb9+ArMJ4nLx+RY0H1L4YoJqGfXF21pT6q9G7yaY yEaPWd0nWy1alrJwpmAVX2SXg5xEDrgSIjJp2LwTXbkgolNTXW3+EeM7feep8nWEw10GDV iPw1ELcfu+2m42UFReTfuCQ+hxtCpKoukL5HBTj/GqtsNBkOyfuC68bHSK2I/5li4WPG76 pv9PQ5setfCpdTR7AW+9kbJGyyY0CHnJUSxrelehmPQ7mqg2mAPJ3vbL9+CGOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723503932; a=rsa-sha256; cv=none; b=iaSHUG/PxvUbRIoVOk2ojdDnZUN1S1c2DDWCsk7FSiLMdWdFclzY0n0KJLUOjpUaOkqYpj nmENtcpMG8oLKOVVkaatSuiNYlUIeKim0A5s+4B9TgYPzKQaAsBSJnzOkcIsLCigkI4ed2 JFrzuviL8iYhz/0Hvu0cPsWt3ljdSlXex6STTn7npEIEPp6BlNvJvSBTyOhcvW0VKd2XJz M0IdmAEJ/N1dBGsYXoihb0B3qLtJsWlDrRSXrjjJFn7qaLSOVzSkOQlEs0utqUiGIiQf/5 WMJ5U9yCawXyi0ucyWomiFgaq51Ngr2tTQSOK2g0/Zo9w7blMklOuto9SkvBYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HgPaWe6IfEFljcj4tX+/hmK7o5CKRXWvE4SK1ct9AZk=; b=X3RoMPuxw2og9FGcCulC+LhGOb3AwGp1MekSgGDlYO40EFfbSmazb+fqV6oDFXrHDOKxjV +s7pS61ffg2mrTA+rc5Yao1FEqIClj4OOooX4Pgr33CNKHymdgS2zrgGQTnyNgPAjPckpg fjC82NDoJw3bpc0lLP5dYHO5eTGJWgJ48B2Ve4J79P9xLK9fikOY+cTR+FUiyaLTlg12pk dJliTb3mOg5MlpmF8Mf0rUeygwWET6pmN3joupmnz1cpBiqppNubbCeGyIJCmn8ApsZHev KXjxrAHXRi1Gx6YQtypx/NejChfsCkQ+JeH3Uhp1BI8PFeXQf23UHH3Yvi+Ecw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjVVN0rmDzml3; Mon, 12 Aug 2024 23:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CN5Wk3072139; Mon, 12 Aug 2024 23:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN5WeG072136; Mon, 12 Aug 2024 23:05:32 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:05:32 GMT Message-Id: <202408122305.47CN5WeG072136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fc4365853f1c - main - socket: Fix handling of listening sockets in sotoxsocket() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc4365853f1c4b572d9fd643ea336508d9a6a0f7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc4365853f1c4b572d9fd643ea336508d9a6a0f7 commit fc4365853f1c4b572d9fd643ea336508d9a6a0f7 Author: Mark Johnston AuthorDate: 2024-07-09 20:28:12 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 22:53:26 +0000 socket: Fix handling of listening sockets in sotoxsocket() A lock needs to be held to ensure that the socket does not become a listening socket while sotoxsocket() is loading fields from the socket buffers, as the memory backing the socket buffers is repurposed when transitioning to a listening socket. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/kern/uipc_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 0350a5eb4d87..9a44c1d557f0 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -4277,6 +4277,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->so_error = so->so_error; xso->so_uid = so->so_cred->cr_uid; xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0; + SOCK_LOCK(so); if (SOLISTENING(so)) { xso->so_qlen = so->sol_qlen; xso->so_incqlen = so->sol_incqlen; @@ -4289,6 +4290,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) sbtoxsockbuf(&so->so_snd, &xso->so_snd); sbtoxsockbuf(&so->so_rcv, &xso->so_rcv); } + SOCK_UNLOCK(so); } int From nobody Mon Aug 12 23:09:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjVZw5xF9z5TNPY; Mon, 12 Aug 2024 23:09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVZw3hLgz4gfZ; Mon, 12 Aug 2024 23:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723504168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCxpt0G8jN94JT8tJokYXLtVFZ58EfEUOQLwFxeMSLc=; b=s7pqtNVaOFTRBXONKMWFSyFddYeWbG7X4GNQxmluJlOs/M8zwi7ZonGMk5M8LMUkPlAMCc dKQpH3074iLT7SJlSxvhU0doq63y7vhMfvucyIsvbpgAa7F9ScCe57FdiFupsaATHk2E5L 0sWHv6hsIC0DKl9wo9U9gZNiRZRPF58EmswDc3maZsb4tOt/1nhWDuAFBlgpSoytYLui/F DNfDPX5uIMw/mrLcdSX/cutvEUYtK8EWR6LJH3GCEoeilP9ltYxWT1sBSo5aDtx7ahN7bZ 9hpfl4Gbppo52XDHQz0hoKC4zS0AB4xeFLWMfz9yrJNArxDEb5TB4kgqyxwq4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723504168; a=rsa-sha256; cv=none; b=MmH2a2372iX/bqr0EXlVa+vUVw3mWPkX+YS45qNkWRimB2RhX/djpwCrhlBigji2p52lfI a0smhD6ZgotP7Hl9y9YnLToRHU25j9z/tIJxExmBW7lwiYj2hKTohFp5nHOSgotdQFRd21 P/LhnTSVZ6505YDnyaRxAGrZb3nngpY7M5Fq7YckTaVitxukL+4EMG91VBTIGIQFUB81rG VDFtYdWGNbyvtapwyyAFgVyK2J/WmLUAFK3gARp2BavTxUSlB1uG+y8soMfzhpaNb24Lr6 CHmgjfMYsjnSyFS4AoLeU4wMj+9+VcTsV2KZZ5HLhbSyuhdH8U3cVdENkYdPQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723504168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCxpt0G8jN94JT8tJokYXLtVFZ58EfEUOQLwFxeMSLc=; b=PB4lMMIzbPYxwBle/zNVBzRAf/dtlK/bhuIBESN3WkLOvVVlLoVf+fMiYIXB7K2cwSWxTr 5/VClyf3dgTDNDIT67QHKZPfIx/xN+ge88LTaoMwlgNBT27WUUi91irZJVGEPBRADo2GcI arFpCR8TaVX/5wGVCGEXCBN90es/66T8Ch3mNBVUiu5ibAG62szIaP0l6kiRUpg56CldcC uZ89nelOD/zcguBGQyoSbq9Ny9nRqu6rvFtpqkVumc8pekAHKEzkS51NVnjPLrQfSDvrKC nYhlHUCR5+VTe23fObSRnmhY1aljy5ACiSyE1CLdRTleKDZqBmPLhKW3jXDglg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjVZw398nzmGh; Mon, 12 Aug 2024 23:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CN9Snk072758; Mon, 12 Aug 2024 23:09:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN9SVC072755; Mon, 12 Aug 2024 23:09:28 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:09:28 GMT Message-Id: <202408122309.47CN9SVC072755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 27211b7998d1 - main - mlx5: Remove a less than helpful debug print List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27211b7998d1e879f18dddc5ecc9bb9b52e5d79e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=27211b7998d1e879f18dddc5ecc9bb9b52e5d79e commit 27211b7998d1e879f18dddc5ecc9bb9b52e5d79e Author: Mark Johnston AuthorDate: 2024-08-12 16:04:53 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 23:06:01 +0000 mlx5: Remove a less than helpful debug print Reviewed by: khng Fixes: e23731db48ef9 ("mlx5en: add IPSEC_OFFLOAD support") Differential Revision: https://reviews.freebsd.org/D46273 --- sys/dev/mlx5/mlx5_core/mlx5_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 7400a8eafaa4..09b623b6fde8 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1698,7 +1698,6 @@ static int init_one(struct pci_dev *pdev, mlx5_pagealloc_init(dev); - pr_info("%s - MARK BLOCH WAS HERE\n", __func__); err = mlx5_fs_core_alloc(dev); if (err) { mlx5_core_err(dev, "Failed to alloc flow steering\n"); From nobody Mon Aug 12 23:09:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjVZx5WdBz5TNKC; Mon, 12 Aug 2024 23:09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVZx4BX5z4ghY; Mon, 12 Aug 2024 23:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723504169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evenjZ+BXkdoJGg2zN4xrlldbOHCOzohBC99ukkYEX4=; b=GaaMh1lYRulz2joVIqyL1VZm6As/tZHdFG8FcxGXCGPFhFo/0PYS8VuKf1lh21RMGSMboh 3CnZ8uNRIUzXu3XpjvAkdje+ciBRRM9W0lZRIMoSwiX3qWVH//Lmnr51J2cQARBf+G05EF fNrnc/rEXosJ/uXIsbx+tnCrP9Ap1MtTDwYaNPGXlFhYrshkLf5VwoGSNOk/nnkL3tBrxr ILqQuA3M2pgPJrJrjkspL0Vgqsab7TOS0O3si/uFPPko1yrObDvG9V4YwytX8OttnYzdX+ AAXyF0cGp8b6rkn8agqoFSZLpwia8+Gp31gp1LxRTvMYPcTM/YuYjvMgbwIs1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723504169; a=rsa-sha256; cv=none; b=KEg2yKQXKa6F2lFRWPcJbccvb3YbWNVio555QVEmWC+0cbUq5nmwbRY4VQIBkpNTgu07x5 vuo+fIUcdBbMiwcMbSAXx2xDt/UCAdyx/YQQEWfFnPNgMYtBwuiVBPIk1adWPyhHP+GVL/ Fs6hVGzRM3thy/JNi78wKb7tb7OpWipK4ngABngmt2pqkiY7CHFMByy37XiQ/fucL9hZTO XTgL0ObRiu0vzCgL5G2Tj8bA5XZiFKiWYkJzUn8F0BC4Z/27ZjkUedD5GeLw0Ploh0fJnK BuZJ23Ec3zWW2/r4EB4g9wgDxCqWFJEj2MB2kSkw6C+2jhkEBtx0yMwUQsPLDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723504169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evenjZ+BXkdoJGg2zN4xrlldbOHCOzohBC99ukkYEX4=; b=aXtAiz48SSntCKCPJbVPnTHq4V8nimkLiZ0SxVq3vFpHWONwVitMhYw27hxfr8P2bkLavw t9bcRV/OCgPBV4nFf3zzOqnGXGbjJWCUxsWmzl0hm8ahgAy9x7nCPFZopmA0oeO6id3mQv V1bqUXTlpLFQIoXd10i+upciiqUlQtBFOHaCiNflyY1NGxtnwwfikoS6XJm1ZGLJe5bVuG rEX0lfHpFXMYzZoZ0ROOAraa6LHN0FleNLVDgp92mFncYZf97cqqIBEWpys+Iqz3LYk49x mmu4WuO0jql+rBhtuZGpt5YK4r1jqzAg3fEc5HtletEMN7IHepICT8VJMNWw9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjVZx3pdfzmGj; Mon, 12 Aug 2024 23:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47CN9T17072806; Mon, 12 Aug 2024 23:09:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN9TZg072803; Mon, 12 Aug 2024 23:09:29 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:09:29 GMT Message-Id: <202408122309.47CN9TZg072803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8805377dad83 - main - dtraceall: Make dtaudit a dependency List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8805377dad832ae12aaa14ec7e584f2463681ed9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8805377dad832ae12aaa14ec7e584f2463681ed9 commit 8805377dad832ae12aaa14ec7e584f2463681ed9 Author: Mark Johnston AuthorDate: 2024-08-12 18:26:57 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 23:06:45 +0000 dtraceall: Make dtaudit a dependency Reported by: tsoome Reviewed by: tsoome Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46274 --- sys/modules/dtrace/dtraceall/dtraceall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c index 73530aeab3b6..851d33a7e518 100644 --- a/sys/modules/dtrace/dtraceall/dtraceall.c +++ b/sys/modules/dtrace/dtraceall/dtraceall.c @@ -63,6 +63,9 @@ MODULE_VERSION(dtraceall, 1); /* All the DTrace modules should be dependencies here: */ MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); +#if defined(AUDIT) +MODULE_DEPEND(dtraceall, dtaudit, 1, 1, 1); +#endif MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); #if defined(NFSCL) MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); From nobody Tue Aug 13 01:58:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjZKr5H34z5S11N; Tue, 13 Aug 2024 01:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjZKr2ZH2z536y; Tue, 13 Aug 2024 01:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723514304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+UAj2gez0yAwV7KklLlmSeCdXxhQBTZiUunpthbROA=; b=CPYvpkMdb32yx8PdQLZX5j0vuyVtK7zPoqM3wcx46ddz5fIWSOdoLzaXS8V1uHlFLc7F0G iUAZ9ETgOHDHC4Ohs0b5JCVPq7JVbl+bojiojucoDvF/8uYxQ57wCy2HJw3l6KK8vBVJtC zKoYc0IrZ2F1kF5w9vgDsKyF/5chtw9qtb3tnqt8VFjpDUWf6U9GZIOTM2p27ScHESe9Bt TNnN3H7Zt7c+C8oSKf970GU5tHFlqlmxEwWvFxVthcnGE3wcLLyRs9GHzXSb8GqXw2IwID eJc7F0DBqZBIHQ/q7obU8e66VjSFpbWWeKnSmxyXmTt7H6gn5Ir8KSN5SrdLvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723514304; a=rsa-sha256; cv=none; b=sKbUUn/znv1R0fUE0P3zg2xxUgrevny92JHbOAGJabd45GH4XwoL3k1WYWuGdxhpsYRux+ YCvGvaycfQdPOvEoHKAen4Io2ZRXEhDvgQP5K5dpZ+u85a/NqVyr/fQO6OWogLzyhxSp/z 4BlvoS930DXqOCuacwiCr+Atc6QtIbRNw2fydY0Cywh1NhNjH7frL10ujuw6HUqDCtSp9K KS3EgM7a5ke/YA4yYkupUJBD3OURIQO7yIdqweZGy5leBq6YhuL5ysB1xDvK4tCCPw3L8e VaMuXFIhHG5TFWxAiwZB6FExpjR+102izYdvDQUkklZErLO32AiSgtlXIpkjnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723514304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+UAj2gez0yAwV7KklLlmSeCdXxhQBTZiUunpthbROA=; b=mg11vGao8OkY8twKh8qY6KyIJyZSp2C1SKdBsAsxNIYx4LrthHj6iM4/Nn5mNLte8j9hO1 xpLsyQlvJ0TuD5T8a8HvjYrhkTtYBfAYWwnJXMbowB7PXk7scAU5/0iiDenj41ElANvM2g 01Fcw5oFKeIthyr0+yIsX9gwXFDtrSsJl7CEqfZY04UvOB+FGzOhGg/VPBppXf00jJ/pXR MQjl97TlmRSD7eU5avcJyxOy/Cp50hRg0ghQ28UICgIqT1GVOoJoTL+zBj5lYxLg7rWuWF tF6nQGAseud4mXeso2x1V7r4PV5U6V/WA5qo4HyiPLeM5TO0GxXSNnVf6mEVKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjZKr0RmjzrnS; Tue, 13 Aug 2024 01:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47D1wNtk058759; Tue, 13 Aug 2024 01:58:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47D1wNxB058756; Tue, 13 Aug 2024 01:58:23 GMT (envelope-from git) Date: Tue, 13 Aug 2024 01:58:23 GMT Message-Id: <202408130158.47D1wNxB058756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6df36deb8bba - main - boot: update lua linter for recent module additions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6df36deb8bba31bdaf1bc46ba07c02812decbccc Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6df36deb8bba31bdaf1bc46ba07c02812decbccc commit 6df36deb8bba31bdaf1bc46ba07c02812decbccc Author: Kyle Evans AuthorDate: 2024-08-13 01:54:27 +0000 Commit: Kyle Evans CommitDate: 2024-08-13 01:57:14 +0000 boot: update lua linter for recent module additions For modules we expect to be there, we need to --globals them in to avoid linter errors. Maybe we should switch to a different model for these to clean up our linter exceptions... 'meh'. Reported by: David Cross --- tools/boot/lua-lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boot/lua-lint.sh b/tools/boot/lua-lint.sh index d771be090c6e..60d7c567dab4 100755 --- a/tools/boot/lua-lint.sh +++ b/tools/boot/lua-lint.sh @@ -17,4 +17,4 @@ cd $(make -V SRCTOP)/stand ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ --globals io.ischar --globals printc --globals cli_execute \ --globals cli_execute_unparsed --globals try_include \ - --globals pager --std lua53 + --globals pager --globals gfx --globals hash --std lua53 From nobody Tue Aug 13 11:16:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjpkH4B8Tz5STPK; Tue, 13 Aug 2024 11:16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjpkH261Xz4m05; Tue, 13 Aug 2024 11:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723547815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KS/BpgD6TKR/nKEi4a+tZzkR+dSFFoqbZeZBfmDbbqI=; b=qp8xBZHU65MCH/WMSspGcU0n2W5HA74jsOdFx+Ddk1sDXKaFDcVsZlY6jN44Oa8ynWXh8u o+rJqianx+x3EeIOkkNUNrj7tHcc2bGyWwpeRba2na771bOxy+VtY5ODCuTaYWmcrjwmZZ 1krt6UOK623ptleVoDgivtrA3u27/ohbIMHWtDRqi9zmSDr4OP1rR4+WDOpBq52mBrP9nf Aq22UemY+Pzi8xoc6GZ/CIMq0bKCsh6vf+7e4kV4Bt9p87jp1D3w9MGp85aTo4HGKe5cDA sZ7gYjuQEQrn5FodRGti/nYXEfxu1hO72cg1J5uBqjwBUn73G8b7uH1XdrPgqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723547815; a=rsa-sha256; cv=none; b=fTAnwbOmZS6r/GWTTNlV+CFkWR+Yd3sT35EitPpqgXsnqbV4ZsPctfeM06RSU2ACcaBKAA w4kjFoJUAUseYVryyM3dP5tAQKEnuFKWy6hhVjrXarYbSIWXBi0NF4xE4UpTAahdEV6fm1 m3jMrzN/rNIrcivqcJmUkf19TvBbJCkZEaG8Dy/dH44Yk7oGJ2XaNNHBh9dvxogBHqLULr wkI4sKNab2tPbqJVuZI19PWjMnRHWDjUAD1appRJg4S5kIW+ygWvrg/7e/iLF9e2iW8zXm ik+7vPVw8o77PABpdLea90y4gt8g7lr9JGkkhpHs8zDKK2a4i2evuvW9lbw/dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723547815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KS/BpgD6TKR/nKEi4a+tZzkR+dSFFoqbZeZBfmDbbqI=; b=PCxP9sn7I/SRzzVjW2Jx4fgSBFVScem4bUs4qDq+9d9zvMrSNr4tJBF0JQwv49hqs4+CV/ FHjVsO58lv52e5k8ud2yifS5B9rllewQtUTlMrJokCBxTGo12wdWdG7kqa8uia+ObNOsll TYlhaYdpqWphnQz6GP5wPnnylM9XV5zAzq1Jt4o7L2uq9PiPYxnB3eTl+yNsl/+xjBVe0X 4lZ8DPp7poroZfkGHDFnDIqKshfiPGtbvbaMqElr4fyRMBaV1JYjQdpC99bqJQ/lFnKCIf 8pj7GSkhGnHQ8hCcuJWm/fotuiPiUNJ3bApYy9jjGo9dIK7deUDn6Dts7wIcQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjpkH1jPCz17tW; Tue, 13 Aug 2024 11:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DBGtYY008379; Tue, 13 Aug 2024 11:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DBGtJ4008376; Tue, 13 Aug 2024 11:16:55 GMT (envelope-from git) Date: Tue, 13 Aug 2024 11:16:55 GMT Message-Id: <202408131116.47DBGtJ4008376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 82e021443a76 - main - pf: cope with SCTP port re-use List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82e021443a76b1f210cfb929a495185179606868 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=82e021443a76b1f210cfb929a495185179606868 commit 82e021443a76b1f210cfb929a495185179606868 Author: Kristof Provost AuthorDate: 2024-08-12 16:18:36 +0000 Commit: Kristof Provost CommitDate: 2024-08-13 11:16:12 +0000 pf: cope with SCTP port re-use Some SCTP implementations will abort connections and then later re-use the same port numbers (i.e. both src and dst) for a new connection, before pf has fully purged the old connection. Apply the same hack we already have for similarly misbehaving TCP implementations and forcibly remove the old state so we can create a new one. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 9 +++++++ tests/sys/netpfil/pf/sctp.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 62d604260713..0a6f6b4d2c10 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6139,6 +6139,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, psrc = PF_PEER_DST; } + if ((src->state >= SCTP_SHUTDOWN_SENT || src->state == SCTP_CLOSED) && + (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && + pd->sctp_flags & PFDESC_SCTP_INIT) { + pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); + pf_unlink_state(*state); + *state = NULL; + return (PF_DROP); + } + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index d07d1122048b..95a780747d82 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -181,6 +181,64 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "reuse" "cleanup" +reuse_head() +{ + atf_set descr 'Test handling dumb clients that reuse source ports' + atf_set require.user root +} + +reuse_body() +{ + sctp_init + + j="sctp:reuse" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now do the same thing again, with the same port numbers + jexec ${j}a pfctl -ss -v + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + jexec ${j}a pfctl -ss -v +} + +reuse_cleanup() +{ + pft_cleanup +} + atf_test_case "abort_v4" "cleanup" abort_v4_head() { @@ -691,6 +749,7 @@ atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "reuse" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" From nobody Tue Aug 13 11:27:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjpyK19jvz5SVCH; Tue, 13 Aug 2024 11:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjpyK0hkyz4nxl; Tue, 13 Aug 2024 11:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723548441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gjbif4DJClhi5p7oe5bFchyUi2O0xXRIceuB2BYJrKg=; b=XJDo7HrdLUcPkcNKR2vPF2IVhgu5BCvipsxliczKuUb/seU5N6LEvI1yhIGeHyGeWh4yY3 ETfHfcnDwq9w30vTl1NZGFEominglFp7uvlActLNO71RMh1fAErWvt6oiUI3H+kohl/cYX nh5rCE8n5c1n76lR9a70Z5csBTnNsf2UZVTlk6oMY4xdGtVMTLzbfFcxcN0sjdpYGI5Y67 eQB6gLUqfr3vSzf42P2bhuqHzVJBR5QC8x5opLJ7z1LoIKjj+ub/sk335Db+0oZ5WctgIo ydRJ6c1POmAR7jNOnppO+9H4AK0ycEzkiY9jznRr0KeAqohMyJBcemnIzTwfFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723548441; a=rsa-sha256; cv=none; b=SzYBoTL9miYSukOWve1mwSYgkX9VpRrOz19OZDLQGg5f9zdJri/Kvyo3puYJMaUr79yz4X 6JgVtO7MM9tLOVl8bMgbYyb9PpydMWQhkN3lsdQQdi2XNltPMthMpie7FUNy9iXxhuO8qO TVuVtmzuW57myz/Ynl3dOfeUSJSu+fxi4MN+iyXGA5x81UmKE6aH/6wCK4LuQXICfTqSBj OwAdt6izmoIZ7Xx9VZofjoKUcFJUae+v4AwXn0aCK8YSx74ECpFW0uw53y6M2ypSBrP78V FaTxXyyjcchQh7f9P6t8Mzp2Y502qnibBnROnbB0HzH0GyB5e5hnYYsxavLkFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723548441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gjbif4DJClhi5p7oe5bFchyUi2O0xXRIceuB2BYJrKg=; b=x166DGDW01iH+vwv2DtEhtHd4jctjZ86L7VP68Mn2+70cm1skTThdNibniXKBDpCHVHaUJ Huw7VN78yymxnjbfd4BJwcc5PhZonbWMY7OTcmCWx0b/JtmK1OSMJ4h3Teu4YUW4PPyrXd CcGIfyCg8eDnrHD4zqlrMs9ttHnTurD2qLEs7dqGZWgXtykNoc8caMfXuxh8EKAkQz9YP9 cjp1k7iADVGjSZdOe3c93PWaeb1UfDY+oy+Bu6aysUy7hutqSkGsOwCrIjfJdLih0585Vu apOKxLsPGwEYS954ag3paWqlwsPNdTQPVesurAk1JlCAWAOXWopOr9aCj9o9IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjpyK09Txz182j; Tue, 13 Aug 2024 11:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DBRKSn025470; Tue, 13 Aug 2024 11:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DBRKsZ025467; Tue, 13 Aug 2024 11:27:20 GMT (envelope-from git) Date: Tue, 13 Aug 2024 11:27:20 GMT Message-Id: <202408131127.47DBRKsZ025467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2da98eef1f35 - main - pf: fix icmp-in-icmp state lookup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2da98eef1f352c496ffd458b4c68ddee972bb903 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2da98eef1f352c496ffd458b4c68ddee972bb903 commit 2da98eef1f352c496ffd458b4c68ddee972bb903 Author: Kristof Provost AuthorDate: 2024-08-12 14:07:35 +0000 Commit: Kristof Provost CommitDate: 2024-08-13 11:23:17 +0000 pf: fix icmp-in-icmp state lookup In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP error packets potentially being dropped incorrectly. Specially, it copied the ICMP header into a separate variable, not into the pf_pdesc. Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup. PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0a6f6b4d2c10..a2b152cebc77 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7133,9 +7133,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, } #ifdef INET case IPPROTO_ICMP: { - struct icmp iih; + struct icmp *iih = &pd2.hdr.icmp; - if (!pf_pull_hdr(m, off2, &iih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off2, iih, ICMP_MINLEN, NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short i" @@ -7143,12 +7143,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - icmpid = iih.icmp_id; - pf_icmp_mapping(&pd2, iih.icmp_type, + icmpid = iih->icmp_id; + pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, - pd->dir, kif, virtual_id, virtual_type, + pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); if (ret >= 0) return (ret); @@ -7162,10 +7163,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || (virtual_type == htons(ICMP_ECHO) && - nk->port[iidx] != iih.icmp_id)) + nk->port[iidx] != iih->icmp_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP_ECHO)) ? - &iih.icmp_id : NULL, + &iih->icmp_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, @@ -7181,7 +7182,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); - m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); + m_copyback(m, off2, ICMP_MINLEN, (caddr_t)iih); } return (PF_PASS); break; @@ -7189,9 +7190,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: { - struct icmp6_hdr iih; + struct icmp6_hdr *iih = &pd2.hdr.icmp6; - if (!pf_pull_hdr(m, off2, &iih, + if (!pf_pull_hdr(m, off2, iih, sizeof(struct icmp6_hdr), NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short " @@ -7199,8 +7200,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - pf_icmp_mapping(&pd2, iih.icmp6_type, + pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); @@ -7228,10 +7231,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && - nk->port[pd2.sidx] != iih.icmp6_id)) + nk->port[pd2.sidx] != iih->icmp6_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP6_ECHO_REQUEST)) - ? &iih.icmp6_id : NULL, + ? &iih->icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, @@ -7249,7 +7252,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), - (caddr_t)&iih); + (caddr_t)iih); } return (PF_PASS); break; From nobody Tue Aug 13 11:27:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjpyL1sXBz5SVMx; Tue, 13 Aug 2024 11:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjpyL1JbBz4nxn; Tue, 13 Aug 2024 11:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723548442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WR7NnXPAYSkV/8roAEZWnHPA1eh1Z+ffZCB+fMCw/FE=; b=KKBZye6xh1ny3o8siBc4TspPDg0V1W/kXUXuz5WDZMgPnByZLeO7uuM3vCN5u4qTbuMOWG pwXqY7h5ZSAOUMoQ8we5NxBw/GnQXK/r6Qn2GFGSIYMaw8dJvIqwR/LEwfHgiYCZfI+x9r 2yV5aWaz0tvENt2Tg6nGVtsz5RIQ/Pw3YnflkXekvgFOxTxIRntOWHTtAMp8ypdbLCRICC epnpOpXSfd+awvxXL54yhBkbmqgb3DHeBNxPvOIxz0y3ttzoyTwE8cD3fv3Muyp3egkbXr DMbZf1sKlr7pcoG0RXvQT6yUEYnc7GEHQzls5n5L2wp/Ya1LZgTk7sfGFJK62w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723548442; a=rsa-sha256; cv=none; b=XnXCLqwh90/KNaW9pZo4F1LzXVaF7+WrFhAfjGtyfKCF9EbwijlaOlPDSK9PV8sBnDDSgi TrPELAwjH997Dm9b9TLQF0U6nV0bjje/YQjScVhavHxY2TklbbfA6I4A1gGixSPCK1G+eB rY/2KmAgppJVnTDwogPcaeBeaYdkg14CXEtG0kziTD1/MdqkA3IEJoOklzYmu1fGAXePFx OhZ62FAXHK0TG76wI2yOTsSBH83CMU/fQcq7rmWb3N5hHQlFCYODlp6tZ26zjoaEIlXQsD /wxaJw+cni1gDr42LPYsfvcASa0d2UHtEUvyEu7GRG+MFQtEZbhyl3CMT6titw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723548442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WR7NnXPAYSkV/8roAEZWnHPA1eh1Z+ffZCB+fMCw/FE=; b=lzySP0z3G+31yQVlAjArQPHHAFR6Vk5NspiloPAKzl9vKSmvLUUE6KKSB1C42AdnM7pt7L CRQcXiqMRH0MBad7/rw+bwGK8nscgDGKd04BfevYQ8XzPjtViUnb7SuBfMUU0UTqARKBzV hKWDYNkOKGOBuGEnh1JzuhhFGPENpoXNAa7724WmqlYMZW9PmgKWyWA+7pn8gspGwRThIO rA0FXhcszuJxyHmvKfBqUnUnWCkpdJ1Vjh6D6hpqH18i3hjXNRnK1RBns8hIy0Laex/qq8 kTcOnqOfEK2aFAfydY7cht3uKkl2Q6TmxxZ2XsNuQ7Db7qEADK9gCLyuQTpvIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjpyL0wHFz18KY; Tue, 13 Aug 2024 11:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DBRMMk025526; Tue, 13 Aug 2024 11:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DBRMdH025523; Tue, 13 Aug 2024 11:27:22 GMT (envelope-from git) Date: Tue, 13 Aug 2024 11:27:22 GMT Message-Id: <202408131127.47DBRMdH025523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 34063cb71460 - main - pf tests: ensure that traceroutes using ICMP work List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34063cb714602972b6d985ad747fc8f66a8daae1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=34063cb714602972b6d985ad747fc8f66a8daae1 commit 34063cb714602972b6d985ad747fc8f66a8daae1 Author: Kristof Provost AuthorDate: 2024-08-12 10:14:43 +0000 Commit: Kristof Provost CommitDate: 2024-08-13 11:24:17 +0000 pf tests: ensure that traceroutes using ICMP work PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/icmp.sh | 65 +++++++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/icmp6.sh | 65 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp.sh b/tests/sys/netpfil/pf/icmp.sh index 72b531b08c51..16c4123b8dfe 100644 --- a/tests/sys/netpfil/pf/icmp.sh +++ b/tests/sys/netpfil/pf/icmp.sh @@ -71,7 +71,72 @@ cve_2019_5598_cleanup() pft_cleanup } +atf_test_case "ttl_exceeded" "cleanup" +ttl_exceeded_head() +{ + atf_set descr 'Test that we correctly translate TTL exceeded back' + atf_set require.user root +} + +ttl_exceeded_body() +{ + pft_init + + epair_srv=$(vnet_mkepair) + epair_int=$(vnet_mkepair) + epair_cl=$(vnet_mkepair) + + vnet_mkjail srv ${epair_srv}a + jexec srv ifconfig ${epair_srv}a 192.0.2.1/24 up + jexec srv route add default 192.0.2.2 + + vnet_mkjail int ${epair_srv}b ${epair_int}a + jexec int sysctl net.inet.ip.forwarding=1 + jexec int ifconfig ${epair_srv}b 192.0.2.2/24 up + jexec int ifconfig ${epair_int}a 203.0.113.2/24 up + + vnet_mkjail nat ${epair_int}b ${epair_cl}b + jexec nat ifconfig ${epair_int}b 203.0.113.1/24 up + jexec nat ifconfig ${epair_cl}b 198.51.100.2/24 up + jexec nat sysctl net.inet.ip.forwarding=1 + jexec nat route add default 203.0.113.2 + + vnet_mkjail cl ${epair_cl}a + jexec cl ifconfig ${epair_cl}a 198.51.100.1/24 up + jexec cl route add default 198.51.100.2 + + jexec nat pfctl -e + pft_set_rules nat \ + "nat on ${epair_int}b from 198.51.100.0/24 -> (${epair_int}b)" \ + "pass" + + # Sanity checks + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 203.0.113.1 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 203.0.113.2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 192.0.2.1 + + echo "UDP" + atf_check -s exit:0 -e ignore -o match:".*203.0.113.2.*" \ + jexec cl traceroute 192.0.2.1 + jexec nat pfctl -Fs + + echo "ICMP" + atf_check -s exit:0 -e ignore -o match:".*203.0.113.2.*" \ + jexec cl traceroute -I 192.0.2.1 +} + +ttl_exceeded_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "cve_2019_5598" + atf_add_test_case "ttl_exceeded" } diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index 35d20c83cc4f..c54b54c20a87 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -83,7 +83,72 @@ zero_id_cleanup() pft_cleanup } +atf_test_case "ttl_exceeded" "cleanup" +ttl_exceeded_head() +{ + atf_set descr 'Test that we correctly translate TTL exceeded back' + atf_set require.user root +} + +ttl_exceeded_body() +{ + pft_init + + epair_srv=$(vnet_mkepair) + epair_int=$(vnet_mkepair) + epair_cl=$(vnet_mkepair) + + vnet_mkjail srv ${epair_srv}a + jexec srv ifconfig ${epair_srv}a inet6 2001:db8:1::1/64 no_dad up + jexec srv route add -6 default 2001:db8:1::2 + + vnet_mkjail int ${epair_srv}b ${epair_int}a + jexec int sysctl net.inet6.ip6.forwarding=1 + jexec int ifconfig ${epair_srv}b inet6 2001:db8:1::2/64 no_dad up + jexec int ifconfig ${epair_int}a inet6 2001:db8:2::2/64 no_dad up + + vnet_mkjail nat ${epair_int}b ${epair_cl}b + jexec nat ifconfig ${epair_int}b inet6 2001:db8:2::1 no_dad up + jexec nat ifconfig ${epair_cl}b inet6 2001:db8:3::2/64 no_dad up + jexec nat sysctl net.inet6.ip6.forwarding=1 + jexec nat route add -6 default 2001:db8:2::2 + + vnet_mkjail cl ${epair_cl}a + jexec cl ifconfig ${epair_cl}a inet6 2001:db8:3::1/64 no_dad up + jexec cl route add -6 default 2001:db8:3::2 + + jexec nat pfctl -e + pft_set_rules nat \ + "nat on ${epair_int}b from 2001:db8:3::/64 -> (${epair_int}b:0)" \ + "pass" + + # Sanity checks + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:3::2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:2::1 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:2::2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:1::1 + + echo "UDP" + atf_check -s exit:0 -e ignore -o match:".*2001:db8:2::2.*" \ + jexec cl traceroute6 2001:db8:1::1 + jexec nat pfctl -Fs + + echo "ICMP" + atf_check -s exit:0 -e ignore -o match:".*2001:db8:2::2.*" \ + jexec cl traceroute6 -I 2001:db8:1::1 +} + +ttl_exceeded_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "zero_id" + atf_add_test_case "ttl_exceeded" } From nobody Tue Aug 13 12:15:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wjr1V6lBFz5SZN8; Tue, 13 Aug 2024 12:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wjr1V6BFXz4vvQ; Tue, 13 Aug 2024 12:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723551310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Q+ANIc9LwVNCC+bzQCJv+v3/FJXyWMbrs/uEn5vHfQ=; b=GMHGa0RZcOQGX0nRlvqJOasoVuzOVhGwOm+6s4KuiImk9j5SbLwhcLcbP3BsTL10/oRPcp 6vsm35bRa7jGs7D7IEKKjCR+p637FVSzb3qrxRM6hnwshXVVE5UnW2bbt13Tz5tnbXJDze PixU41B0HpOFBbZxFtPwftzNzDF2altf3WaatGWw6/6KcYIKok6zBeD2fVQOU5H2CaG/pp eUIt9a+yH438jNqJiNlBsdhgyX+l/9WLePShxAiLBGOjgedP2ze7M77xuJoFyMWIfVkULG zaUp7PcMvPuuqOELb/jKhcIdyCHKmJarwz//RCLAv3upazUYE6OV6NConpFCJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723551310; a=rsa-sha256; cv=none; b=P0WZ5WwYjEgvAq2JUk627WEAuA+nuE85Hqvqljk5uLpQiOqk4Ht8nKxSF1zOm9cP+NuHhP ZJn7UHSlrYIr4dz9K1VTQwzFle88gDHwvpY1UV6nobWeDkaxi2B2A1jTmzp1V+Sfqhrsah 5X0koarhvo7OzZIj+5xJULHrwQP8VCmwrBaaJQDck+rryW0bUb2jTQIRH8DGFkmK/IYn+P UMBmy4uZIwHDDwfZujZsHgfpj5CXT6/mPEFM4J+JFS2fzwRsmV7HMI/wze63OVSeGSLRFs 7iHpDghrQTMuVlAg9s1NagGiQyYjA+Ok6Ac71O6IYQsdY+asOk7ZNG+3CxASkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723551310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Q+ANIc9LwVNCC+bzQCJv+v3/FJXyWMbrs/uEn5vHfQ=; b=uGx9VUGBfS8OqEecxR93B6y0Npg/PCHifBMhCySVFdpBrWsy2nCKoNxsVOyblHptyVkI3y BMP3fYY5QzPgDmeZ/ZA9HmAK8k07EKKOZcBHCAI5GbsneOl4Em+cKCEqsTJYoS0h63LE0h N5Ft2i6/lExQ8NEUSBQzjlXAzdLyQi5+hZlOafFMaprHyRqS2agu5rKLRvKdE2LNlORK2r YzM6nVihXFzpM1job7vPX0B/rDT3D2f4B1azHs+06nF+bqndB9g+YHi6O2ij5ndpWFWVI8 UVsWfGeLZU9HK/liUYR9HqqvdI3RSqsfAcbq6Lo5JzwcR8P6djZ1y2OMkfT7bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wjr1V5nTGz18by; Tue, 13 Aug 2024 12:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DCFAvB010195; Tue, 13 Aug 2024 12:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DCFAFN010192; Tue, 13 Aug 2024 12:15:10 GMT (envelope-from git) Date: Tue, 13 Aug 2024 12:15:10 GMT Message-Id: <202408131215.47DCFAFN010192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d1deb682f2f0 - main - pf tests: Make if_enc.sh stick to utils.subr interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1deb682f2f01788f6a6a84ec24ba3d6605d000f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1deb682f2f01788f6a6a84ec24ba3d6605d000f commit d1deb682f2f01788f6a6a84ec24ba3d6605d000f Author: Igor Ostapenko AuthorDate: 2024-08-13 11:32:37 +0000 Commit: Kristof Provost CommitDate: 2024-08-13 12:14:08 +0000 pf tests: Make if_enc.sh stick to utils.subr interface Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46280 --- tests/sys/netpfil/pf/if_enc.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sys/netpfil/pf/if_enc.sh b/tests/sys/netpfil/pf/if_enc.sh index a6d258e40e33..2e9060d4aa68 100644 --- a/tests/sys/netpfil/pf/if_enc.sh +++ b/tests/sys/netpfil/pf/if_enc.sh @@ -172,10 +172,10 @@ ipfwoff_ip4_pfil_in_after_stripping_body() jexec bgw sysctl net.inet.ipsec.filtertunnel=0 jexec bgw sysctl net.enc.in.ipsec_filter_mask=2 # after stripping jexec bgw sysctl net.enc.out.ipsec_filter_mask=1 # before outer header - echo ' - rdr on enc0 proto tcp to 4.0.0.1 port 666 -> 4.0.0.44 - pass - ' | jexec bgw pfctl -ef- + jexec bgw pfctl -e + pft_set_rules bgw \ + "rdr on enc0 proto tcp to 4.0.0.1 port 666 -> 4.0.0.44" \ + "pass" # Prepare the catcher on host b echo "unexpected" > ./receiver From nobody Tue Aug 13 12:55:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WjrwB4F4Sz5Sdkp; Tue, 13 Aug 2024 12:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjrwB3mhxz41w8; Tue, 13 Aug 2024 12:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723553738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ibi2dUDbL0OrgmXhnyoDVFAKWi23jaRsmryo263R2og=; b=LMctxzKRQBrgfHfia5x4FGS4hwHfy6ng+Pz2noZl2Zu5PsPNMUyK3qwJCOG/ZPYKmhP8jo b0q18yhNNkE0GFoN0MlweaGK9sKb6YIb/V24YGHtQrjLdK/zpL08CKolf/NJpnc20DVDcg e6kiDW3cUwU5avOBp/OPv27YH817c/+ZHzB2QSKS1Kbb7qlsqc5MzdsDa1hW1F0bSxJOVr U1od5fgdiDRW1jVg5N3eWWfnYZdn1dBVSfRhoCEiz019rwc857JsjrN0JHJ5FsLNHx8NHe bbkjAf6o61AlLOE10cTOG5XP+1la/gyIOsTZEvwuxJyiUWDnRAA1A1ks7GQKOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723553738; a=rsa-sha256; cv=none; b=QM0qsOKz9qZzq4hr2bq/s/HjfyJ3nSDGHr5soiPPorTd2C3LTCXZhZi3vVPN1+pPZOunXq 18KtxHXNoyvFdmEiCB8v9eATO48PQDemxxvwfrFMfVvh0Sb5Zmg1wx9dF68EwQTy9KRsVq 9gDB1eNJgdgazX4/VYiCQJOQ49juimsRfX580CPLFVYMn12y3VRaEFIy90SfW0v9wp0weJ EZvZVGn0sXdyM5qxs5cg3s1pSRaMXrmVOY65Mafts40ZdOa8vbSim98p4G5UX/NfHp7jOz lP2Be0qxhoPPLn+4WyUeCxxX+c1f1o/nla40NLrwdscchtXo/uRw+4Kokk3EnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723553738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ibi2dUDbL0OrgmXhnyoDVFAKWi23jaRsmryo263R2og=; b=raKooAjUB3vNtQ7NrBngR2qK2bDwZnyohbrLno6ZUUf0xnieC58fjTtmnPOY7UlvqOYnjP xprJ55VX6Rduew6VDh2AGSdv0HzF/S7rOc0AMxr+FF+201nXi6lpI2+YKF6CW+NkEeknjJ Hm1feWynXmUM0JzlayqKBHogNtpxG2Yd6kKtK+Rx7tDkUDRUx1yzLgsgHtTwdGcsWVg6DJ oAxEZqmCgLM0BZzpEsANNFOeaTRWDr5FggjdvtyHOS/bryva0VYUg7uU4Xkg/KCOwZPCUM jG4LNQR6BBogrDG4jZZJ+ozyINS9eIL0j0HFpRvMuqPFb9GxsyMH194YkgkVKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WjrwB3MvVz1B36; Tue, 13 Aug 2024 12:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DCtcUC077123; Tue, 13 Aug 2024 12:55:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DCtcXf077120; Tue, 13 Aug 2024 12:55:38 GMT (envelope-from git) Date: Tue, 13 Aug 2024 12:55:38 GMT Message-Id: <202408131255.47DCtcXf077120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: d3b05d0ea10a - main - Add smbus and i2c device IDs for Meteor Lake List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d3b05d0ea10abe059dc63c6fb6ef3f061b758af2 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=d3b05d0ea10abe059dc63c6fb6ef3f061b758af2 commit d3b05d0ea10abe059dc63c6fb6ef3f061b758af2 Author: SHENG-YI HONG AuthorDate: 2024-08-13 12:22:43 +0000 Commit: Li-Wen Hsu CommitDate: 2024-08-13 12:52:19 +0000 Add smbus and i2c device IDs for Meteor Lake Reviewed by: emaste, Daniel Schaefer MFC after: 3 days Sponsored by: Framework Computer Inc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46249 --- sys/dev/ichiic/ig4_pci.c | 8 ++++++++ sys/dev/ichsmb/ichsmb_pci.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index 9f12e713cdeb..138de77c35db 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -168,6 +168,10 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_ALDERLAKE_M_I2C_3 0x54eb8086 #define PCI_CHIP_ALDERLAKE_M_I2C_4 0x54c58086 #define PCI_CHIP_ALDERLAKE_M_I2C_5 0x54c68086 +#define PCI_CHIP_METEORLAKE_M_I2C_0 0x7e788086 +#define PCI_CHIP_METEORLAKE_M_I2C_1 0x7e798086 +#define PCI_CHIP_METEORLAKE_M_I2C_2 0x7e508086 +#define PCI_CHIP_METEORLAKE_M_I2C_3 0x7e518086 struct ig4iic_pci_device { uint32_t devid; @@ -280,6 +284,10 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_ALDERLAKE_M_I2C_3, "Intel Alder Lake-M I2C Controller-3", IG4_TIGERLAKE}, { PCI_CHIP_ALDERLAKE_M_I2C_4, "Intel Alder Lake-M I2C Controller-4", IG4_TIGERLAKE}, { PCI_CHIP_ALDERLAKE_M_I2C_5, "Intel Alder Lake-M I2C Controller-5", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_0, "Intel Meteor Lake-M I2C Controller-0", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_1, "Intel Meteor Lake-M I2C Controller-1", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_2, "Intel Meteor Lake-M I2C Controller-2", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_3, "Intel Meteor Lake-M I2C Controller-3", IG4_TIGERLAKE}, }; static int diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index 675a15daaf1b..728bb942d503 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -113,6 +113,9 @@ #define ID_ALDERLAKE 0x7aa3 #define ID_ALDERLAKE2 0x51a3 #define ID_ALDERLAKE3 0x54a3 +#define ID_METEORLAKE 0x7e22 +#define ID_METEORLAKE2 0x7f23 +#define ID_METEORLAKE3 0xae22 static const struct pci_device_table ichsmb_devices[] = { { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA), @@ -215,6 +218,12 @@ static const struct pci_device_table ichsmb_devices[] = { PCI_DESCR("Intel Alder Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE3), PCI_DESCR("Intel Alder Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_METEORLAKE), + PCI_DESCR("Intel Meteor Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_METEORLAKE2), + PCI_DESCR("Intel Meteor Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_METEORLAKE3), + PCI_DESCR("Intel Meteor Lake SMBus controller") }, }; /* Internal functions */ From nobody Tue Aug 13 20:03:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk2PS0WdRz5TKlh; Tue, 13 Aug 2024 20:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk2PR4wQfz4vf5; Tue, 13 Aug 2024 20:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723579387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xx+SfBOTNG9KwqQYid5nAN30b+jaYgVMpvNB80dQIDM=; b=algABscX4BEZMQwwVPDQYvGVXooUs58B961sE2P0eGEICVvH2y3I/pbWExVFdBDZ3nX2B7 73K2Z4871i+zMfS0Ibik2k/fL2wYpqL8v+jtvzwzne2CSx7YThXG1kaoN/X6ygD9WtpAAF +FhraTSVFgh4kjgdQSdg40Z/lxzSQ0lSwcaMrdDCnQ/J3mCVMbQyro7z5DBkQK3B4sFZX1 I9ro5JMorx9b/Y5kJBr30L8qoCPLDdFC6X3PSn3Pg2KkZRELGqX1wxMbBHYRX34cn4Z4LB jxyQ3eEQkgVqWb2tbsik0Cpufv3Gb/Tx5ci4O7N/0t3Lu/iH5VV6PqFr44BsHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723579387; a=rsa-sha256; cv=none; b=NZzb0OBSBo+1kWT6SzpooJLU2kH0hOpgJ/PKTj1A+JQRiOEwFgo66s/G4W5VLQR2IPfKNY QZ+u3X3C/NGByBHIa6xfsxlTlMMY1A1mzRmKY6fgXejMJCTGoexml+Fmdig5XP8LOsmxnl hQf6dAYy9QMOYYLodmYPrjbPDIvXWleysJYNTmPZS7LY5caDTF03We3fhSm7T36dJNy0GS PUj7PvmMIcF6R9qiwCDK+60fGYYVSPh/Y15SAbYv+dkXOOLhumfV8LPCcTwbpTcQjgHq9j UFhHd90VuwGCNwBWS5/43aVLjffOIgOpqtoJscqoCU+oph1OsuqGlGbiN2Opag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723579387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xx+SfBOTNG9KwqQYid5nAN30b+jaYgVMpvNB80dQIDM=; b=ke770jn7shkcuXbM6jV7/ZIpTFsDdFtvDjb/xakOF1CnzdAVUdbGQ1q47WEGX4+neOxHrh q5ahijZEN1GaYPLUJjt2eOmcoxg7LUGHeEZy6/CO2hLLsYjLsVielZj5CkTR0WTxNdg/ow pwsz6Gw6KTyWK458iV/Y4WADtObkroqctnixvtSx8WwBOBABqFg+utEArnhu+/ybvw45mC ATeAmUMcUmKgBSXvb5/jCryhTwMePNpvI9hEtLi0wqAwnimbPPcWK6hC2WtEF5z5pVIhNv aqyPagfxXhCQAnlogX/iMgOMz2V/etNveX8/NnkYsyj/iDHtXBAz1Hp8JB09Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wk2PR4TV6zPnw; Tue, 13 Aug 2024 20:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DK37D6007905; Tue, 13 Aug 2024 20:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DK37Kr007902; Tue, 13 Aug 2024 20:03:07 GMT (envelope-from git) Date: Tue, 13 Aug 2024 20:03:07 GMT Message-Id: <202408132003.47DK37Kr007902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2777a32588e1 - main - iommu: disable dma by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2777a32588e11514a9c7a24cd2915f6d5537cd22 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2777a32588e11514a9c7a24cd2915f6d5537cd22 commit 2777a32588e11514a9c7a24cd2915f6d5537cd22 Author: Ed Maste AuthorDate: 2024-08-13 19:51:34 +0000 Commit: Ed Maste CommitDate: 2024-08-13 20:00:47 +0000 iommu: disable dma by default APIC ID 255 and above require x2APIC and DMAR interrupt remapping. FreeBSD is starting to be tested on high core count Intel systems that meet this criteria. We're going to enable DMAR by default to support this, so default hw.iommu.dma to 0 to avoid a significant performance regression. Reviewed by: kib, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42435 --- sys/dev/iommu/busdma_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index d870e2af3984..3d554249ba3f 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -963,7 +963,7 @@ iommu_init_busdma(struct iommu_unit *unit) { int error; - unit->dma_enabled = 1; + unit->dma_enabled = 0; error = TUNABLE_INT_FETCH("hw.iommu.dma", &unit->dma_enabled); if (error == 0) /* compatibility */ TUNABLE_INT_FETCH("hw.dmar.dma", &unit->dma_enabled); From nobody Tue Aug 13 20:03:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk2PT4395z5TKpZ; Tue, 13 Aug 2024 20:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk2PT2WZCz4vsR; Tue, 13 Aug 2024 20:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723579389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4ItEF9LqhOU1PHuOtvnCFXLHkLcuS8K5NZC/d2H5Fw=; b=Nx+3JTz2z9QfCm7MPqRd1sSg12L+fHyGfQH7gEag2d3ThaBmz4A+JLKitm/1a1u/CksW+9 e66LQbOojEsZx7z1gXcqrmdY99Vxe4CTuoLqyCvr5KEsNu0KCeM3VdVorOXEXXKse9Wt2C AuxUQWlxX1sjUQelAbxWjUbhk4X8xQ0nC9HcmibhPqBxGgtr11PUJraFAMiXyZI/h38rlH Fx06s7hMg0HR2v11dJcfVzKzZFSmyLMqkc0vhPUv5AYFnSnLllrEoYsNZhvOBwNrUKr1Pe VNkIe6z7jdaNIcczGGeySnQ6D9295sC1qvpyMW+qGlq8tuJ5ZgisLmwWIL426A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723579389; a=rsa-sha256; cv=none; b=M279nRFpH//e7cO6bgK8OFwcQ53Uh81z54DAIFcKb7ZMYrdW5VxioRvwtt8k/ByRa/jE38 7SsSUQs8A1cA34eOOjCYqk3cVof233uOaDccbITav5ceBfL+O5z/6Ne3HwtoldUSDeKrQM rTpt3ylS3WpCDHdQ/4WRt2U87NSD00j+rIRdCTENrqd5rIvZcHVFTqHgIhCunMHaWRG6KH SOcFRr9P5UWFC1Q5I3g8+CobbFrrCZjOpwfY6PLIwcXjyHS9Po931tF0h0hXgCs7TL7MtY bvfldorufnJcQRiLWdCtZ+RI3FZm+XqlOdA7zZT3r85ZBr70mfq6w1QtIp04nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723579389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4ItEF9LqhOU1PHuOtvnCFXLHkLcuS8K5NZC/d2H5Fw=; b=vGffaGIqmdJWmLHsSDn1q2YTe2gbaMru01nBSCmBMuIYyEEtsgaIp6nbvhLicAwiG3FnJm cMu+0CzH78We5qN6E+vLRM7XTophopOBYcMPpCDPE9jO8Az135+jva31mTlfQ6WCqeuTfq ixu33LoL3gC6tLaZmUVywmARt/TFZBGGtvDCx/QIyxu9/VPxNrXoy8Jy5l93LcfhPfJgSD v2Q2j7TmbnNf2uLx8rhlWsbAMGV0wrmOGwuk4zpliRS93fmTmWlCJoLRkUP37+MIm4GGVF 81Ox92OaDeZZELmPaS8ZD2j/aFvVfwBbZ419wiWmRAZqdwmNNs4sOVHEbTCtnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wk2PS5mzYzPN0; Tue, 13 Aug 2024 20:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DK38hd007950; Tue, 13 Aug 2024 20:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DK38FZ007947; Tue, 13 Aug 2024 20:03:08 GMT (envelope-from git) Date: Tue, 13 Aug 2024 20:03:08 GMT Message-Id: <202408132003.47DK38FZ007947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3192fc30230a - main - x86: Enable Intel DMAR by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3192fc30230ae432b80cca783abc2dbea9d3f383 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3192fc30230ae432b80cca783abc2dbea9d3f383 commit 3192fc30230ae432b80cca783abc2dbea9d3f383 Author: Ed Maste AuthorDate: 2022-09-30 18:33:41 +0000 Commit: Ed Maste CommitDate: 2024-08-13 20:02:45 +0000 x86: Enable Intel DMAR by default APIC ID 255 and above require x2APIC and DMAR interrupt remapping. FreeBSD is starting to be tested on high core count Intel systems that meet this criteria. Reviewed by: kib, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42435 --- sys/x86/iommu/intel_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 0b25620114cd..9401892aa9d6 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -159,7 +159,8 @@ dmar_count_iter(ACPI_DMAR_HEADER *dmarh, void *arg) int dmar_rmrr_enable = 1; -static int dmar_enable = 0; +static int dmar_enable = 1; + static void dmar_identify(driver_t *driver, device_t parent) { From nobody Tue Aug 13 20:28:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk2yz3LVcz5TMZM; Tue, 13 Aug 2024 20:28:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk2yy4Q0cz42PM; Tue, 13 Aug 2024 20:28:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.45 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-81f83b14d65so268649339f.1; Tue, 13 Aug 2024 13:28:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723580921; x=1724185721; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fdxacRP8n9rwR+F3DzfSPSMNeb/Nel+YjqHKL6gliUY=; b=YvFwrTc82Qzrmm2RHuCX+9jZ45j9HxBO7TUvBiR/Nd0gFC0t6MRHSJj82jEk19vukf ihhQDysUn3gLsBmErTFGyJRnPgFOQJxEWHu1mduvPEY300pQGF9Sp2jHNNITZiJmA8XO j7mNmnLDBM1adC0OlqJErPDsxpDpUuUmIEBuDLKMxGEUaTHemiQ3tdygw888tKYMwl6N lRUDRAk9w7jziR1WLm5ZMqbJuu1d6SNHpGaNxwvLyrnpQ4Zdrdgde9itXLWdmyAfdxg6 oM4ATRC0EHJoMRJH2r5nDb2MeWxqznxwqAZXDcPP8BZcayZN8EPHIp6Wfw/egPBqqwQP qK9g== X-Forwarded-Encrypted: i=1; AJvYcCVQA+GsNw89pp6RYcEheGcL8ajkPuoZoc2hL2Agj+0nvFtAYjWmRrjvWsNLItOBEfriILhLV6usXfPEMvniUDTA04SL34nMN0ygTf0JAdBou1depqHmqHz+AHKZXjPZSZLymHc7EIEy8zyzGkHxOwfitA== X-Gm-Message-State: AOJu0YwNZGSfx9CVal5cNixcIMLES6CAAN8uZpcX/jLBtgwvKnb/rwuW CrQFIdu1/12TC2ZgNUTV8ND8/VAAA+qzslv4srb0+lfPENWGjSN4rQ7oV6UHNwm3z6tiYdt9L/E QqHt9bhsxZdDKgpQte13SDAcqdaj0aA== X-Google-Smtp-Source: AGHT+IHePynSy/iM3UxHabDqFnC/xNdN6SAb4GvNeMxJ+td3k7qUuZRlEvbznCLZ4IiNMraeEgXK3ADP4AzI3rRM8dQ= X-Received: by 2002:a05:6602:3713:b0:7f9:62f1:4e12 with SMTP id ca18e2360f4ac-824dadb56f3mr65331439f.13.1723580920554; Tue, 13 Aug 2024 13:28:40 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202408132003.47DK37Kr007902@gitrepo.freebsd.org> In-Reply-To: <202408132003.47DK37Kr007902@gitrepo.freebsd.org> From: Ed Maste Date: Tue, 13 Aug 2024 16:28:29 -0400 Message-ID: Subject: Re: git: 2777a32588e1 - main - iommu: disable dma by default To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: - X-Spamd-Result: default: False [-1.93 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; NEURAL_HAM_SHORT(-0.04)[-0.035]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEFALL_USER(0.00)[carpeddiem]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_ONE(0.00)[1]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.45:from]; ARC_NA(0.00)[]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.45:from]; TO_DN_NONE(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_THREE(0.00)[3] X-Rspamd-Queue-Id: 4Wk2yy4Q0cz42PM On Tue, 13 Aug 2024 at 16:03, Ed Maste wrote: > > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2777a32588e11514a9c7a24cd2915f6d5537cd22 > > commit 2777a32588e11514a9c7a24cd2915f6d5537cd22 > Author: Ed Maste > AuthorDate: 2024-08-13 19:51:34 +0000 > Commit: Ed Maste > CommitDate: 2024-08-13 20:00:47 +0000 > > iommu: disable dma by default Note that this change is MI, while the change that followed to enable DMAR by default is x86-specific. From nobody Tue Aug 13 21:55:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk4vf0cyvz5TTtK; Tue, 13 Aug 2024 21:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk4vd6zyJz4FbF; Tue, 13 Aug 2024 21:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723586158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekhJlEhcKQjaMX7C1miQfX5Bcj9Wy6va/YjVJZ+LGlM=; b=u6f2plb/acEHimipQkFc0oToe1H/rkZsT+5+/zKEl64pvBXcliODAOsla/9r27KfNuBuA/ oHSizDGplKX9KXNT4cyyWop4z8ZXVFwRir+oWQuVHOnhfjaFRUql3U0UjXUuiuP1zQck6J qol2WqeNDR46TS4BwSmvnDQKAuePxvY+xXdeXxs6ndMPUEzKYOUunho/iEr8BtO35bX3Yz M60cuzWgLN/dWmIOBlid10aWBYib+RtCvmt3149RUzxurpTaRSmwv2AmPO3IEo3jBKtwbB JuuKIHDHA5Ke0Kz+1PFZbR/0Kb+8SnSjzb7xEr3wczUk7z/0aGPlzsbixidKqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723586158; a=rsa-sha256; cv=none; b=GEXz8R78ZgJEPDlw5Mf7zZEwodZiC1CTsbS44RWmdnKUtYrSclhEChyFjyOpwAq/HBWb9K rviiBo7b0MuZ3KwKwCT3k/j2g2G6T3aF7fyXOu3g66gssZ/qFRjD7F6kJXJ3hGm2k9QxRx BTJ7OtZFDNmmh40txiL2SxVPsF4/Bq8kn9DeOoEl188td7ROHSdzmJMgZi5JIUYjhm/JGS /BpoU5+MIuVhNIs9TRPLpn0qtSsbtt9Dohk5jF/uvpPzMDBdv6GJBQQw4FcxmUN+BU1U/d 4a4YGAyQ9U+TMmcpGS7Libg01SLE+w3zBQldVsip/VQFmM/LMPnO+pH5Vt50WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723586158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekhJlEhcKQjaMX7C1miQfX5Bcj9Wy6va/YjVJZ+LGlM=; b=L/J6RX7c+xgfJdHhyVXwoyhN5XGCH4yggWw5G1F+1k+8R79tKk5PUAm5Ckcd1MHjK0v+Us yOeFeNXGlBkHnW36tt91AY4Pqk/bQi2xM/b9rFOBIvDGchzh/czK5V9jiVM9XiNeRipbPz PJD9jJ6nUWOoiDmnZQwFGiFc6NUmRbL9leGb7pvcPNiAlE4I9/U6DnDbJtI/htoT2+i5ci r8dnSMB3CKHucBNfOm0aMyOrXiPcIuhQUuVdXsMPikc+9MuZDLXV6zt0LXAx5QF09nPvOO Jng2UZivTXS6fXYeSu5m8bKbzfnKIpz6y44XaH2PZB/9CJsHzHkcPirOPvgAJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wk4vd6XwQzSQH; Tue, 13 Aug 2024 21:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DLtvUI093213; Tue, 13 Aug 2024 21:55:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DLtv94093210; Tue, 13 Aug 2024 21:55:57 GMT (envelope-from git) Date: Tue, 13 Aug 2024 21:55:57 GMT Message-Id: <202408132155.47DLtv94093210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d40fc35f930e - main - nvme: Make is_initialized a bool List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d40fc35f930eb90c260d7a230d6cb2ffad73ffec Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d40fc35f930eb90c260d7a230d6cb2ffad73ffec commit d40fc35f930eb90c260d7a230d6cb2ffad73ffec Author: Warner Losh AuthorDate: 2024-08-13 22:42:27 +0000 Commit: Warner Losh CommitDate: 2024-08-13 22:46:41 +0000 nvme: Make is_initialized a bool is_initialized is used as a bool everywhere, and we never do any atomics with it, so make it really a bool. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 4 ++-- sys/dev/nvme/nvme_private.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 52834cb26b8e..d97575a19584 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1167,7 +1167,7 @@ fail: nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->is_initialized = 1; + ctrlr->is_initialized = true; nvme_notify_new_controller(ctrlr); TSEXIT(); } @@ -1567,7 +1567,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) taskqueue_start_threads(&ctrlr->taskqueue, 2, PI_DISK, "nvme taskq"); ctrlr->is_resetting = 0; - ctrlr->is_initialized = 0; + ctrlr->is_initialized = false; ctrlr->notification_sent = 0; TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); STAILQ_INIT(&ctrlr->fail_req); diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 05b5f3189eb2..57613242ea84 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -298,12 +298,13 @@ struct nvme_controller { void *cons_cookie[NVME_MAX_CONSUMERS]; uint32_t is_resetting; - uint32_t is_initialized; uint32_t notification_sent; bool is_failed; bool is_dying; bool isr_warned; + bool is_initialized; + STAILQ_HEAD(, nvme_request) fail_req; /* Host Memory Buffer */ From nobody Tue Aug 13 21:55:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk4vg2ppmz5TTys; Tue, 13 Aug 2024 21:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk4vg0yRqz4FsH; Tue, 13 Aug 2024 21:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723586159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiDRRltiYMzJ8RjDPGtfYFKbiiBCYAcqFx98jobW3uw=; b=GwRZgRGxQ7SmQePGrM5GbLxo8aa8fG/C83unqgNMQ46exjjsG8jTXBwLcyx1PAGPzqqzJF KTjFpnrJ/l9qDZcMDFpZbkZborPu5nO+ZllWqoBjIsLZv+nuPLYyWsu4uq/yrNCYTqga17 AA8MPP9QOBMRldcM+6jLo3UIU3geUsZexye9EX8ONI+xshKG7Ei1oJ72Tc1+jMGXjxsJ0U bMJTL/fJXpNVMNJG4LwvcA7AuLzaz2OKxtDVSq5syf9OUUrnhdRdUdg3Ip39oM+bPGs4bn piERXe47X56n3XkyvxF9i+IThqpRcHOnp5hxbMX0STVL00H1LsdcuseC1bFLMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723586159; a=rsa-sha256; cv=none; b=lD8+oOHPQdnNOUY42JVTc6LWWlYO9gDDDH7i3G2csV2UGTCOHMnAgtnID+TB3mWT411vrM rcaUI5PU6CRyDmGz8I7pqCQyIb0et9H5cErfWnRH96m/Cf8RHR44ADcJDqbItH8QFwBvNc eGromTtMieYD9fftOt9LR4yhMwx69ifQd/ckiP70aORElnIhcmLTLM13JLuljI0/i2LFr5 kjMNDRtxrtUwhAMr5wg+L0a4qeHLbw3EMBHJzPlYT94MxpXZRDOeWXcb92NywyvWyxzQI+ /2cnv0fP/MoOH/ibGlbnieMg2g3gZAcGbZ+9gdEMpqrDeM7Kz92Ra/ToeeHXhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723586159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiDRRltiYMzJ8RjDPGtfYFKbiiBCYAcqFx98jobW3uw=; b=ORBZ6Ib0jCrLIFfl2rY9B3U+ypEX95nDlSeWNsB8YWxIUwrmtvT5ohmhpCagusB2h6K2bj i8pEP2Ww94phptwV4SosDmfztpF0dQyaZNrLsf2T+jt9euMOG+F+hb7gCWpd9Yk4zZf/aQ QrcLCviZ8x5COUGpH7wBQCf4gi2XXEROEA0Ob8hK86r6/g4kNEkj4jzvu8Sq/sx0JA5yUE OHU72EA+4iWJhfwop62qJEaRy5QySglGp8jAv6+a1WKIVPYFRpaZSF+OD4cNcO7KR9VQio miBk0yPS3z5VXS0lSObXD2Gf7bJgXiJVcOX0x+KoPfKQTsA9ZtdjzuxxDjF40g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wk4vg0RwtzSZt; Tue, 13 Aug 2024 21:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DLtwT1093255; Tue, 13 Aug 2024 21:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DLtw5m093252; Tue, 13 Aug 2024 21:55:58 GMT (envelope-from git) Date: Tue, 13 Aug 2024 21:55:58 GMT Message-Id: <202408132155.47DLtw5m093252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8c44df321cf3 - main - nvme: Add a clarifying comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c44df321cf39bcba568c513dda54b75937d4556 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c44df321cf39bcba568c513dda54b75937d4556 commit 8c44df321cf39bcba568c513dda54b75937d4556 Author: Warner Losh AuthorDate: 2024-08-13 22:45:17 +0000 Commit: Warner Losh CommitDate: 2024-08-13 22:46:41 +0000 nvme: Add a clarifying comment While it is easy enough to bounce over to nvme.c from nvme_ctrlr.c to find this out, I've had to do that several times, so a little bit of context is quite helpful. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index d97575a19584..270be61e2d36 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1588,6 +1588,12 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) return (0); } +/* + * Called on detach, or on error on attach. The nvme_controller won't be used + * again once we return, so we have to tear everything down (so nothing + * references this, no callbacks, etc), but don't need to reset all the state + * since nvme_controller will be freed soon. + */ void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) { From nobody Wed Aug 14 01:17:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wk9Mv6Tz2z5SJSQ; Wed, 14 Aug 2024 01:17:15 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wk9Mv2D3Gz4dZ1; Wed, 14 Aug 2024 01:17:15 +0000 (UTC) (envelope-from nparhar@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=nSVWC8rl; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of nparhar@gmail.com designates 2607:f8b0:4864:20::632 as permitted sender) smtp.mailfrom=nparhar@gmail.com Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1fd69e44596so2961765ad.1; Tue, 13 Aug 2024 18:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723598234; x=1724203034; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=legYXNssDXpDyAYrSUoUPhiN9MCkSJp2w5uDzVzgz/Y=; b=nSVWC8rlpMReNuj7SgqxvRLGHL1dSufZQYzcD6DhxkxBTIKuuhR1E1GihjSQfz4c/9 63GEd/xBGqx8Dj2Kdw4sTbW4tJTw2xKkxl9pOVynRNSyLd+MrUHnobtGJvg3Nf78q1N+ 3KXHT9DVZiYHI7WnbBiC+ocGcM1ScPyOTgBSEIIXPezPaLPjBpqch+d4vatAJF49VdXJ 1D6EIVbjJsQ0Uyov9HTVFrGN0LskP51RVPFHII8a+JmBvoe2fYTTBIJsr6ZxkuWO1aG0 da/jRa6xINhUp6zzzyh5EWzc3kk3ru2u/CTNaO9DIvf7CResEcr+LXA/NAxTDfcXNcWF imrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723598234; x=1724203034; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=legYXNssDXpDyAYrSUoUPhiN9MCkSJp2w5uDzVzgz/Y=; b=DHi9pKFfHLRFC5+pjY1g7ArPTmu18bVb0KjD7NBGLjLZqM6c5OCY6qq7FHFtPsyFPP Op8Huysm87NWhIH5x/rd6My3Myf0a+p+98KHW6M7f0QbDAd7T+S0yKS5T10nPKtKz/Pl pboQNz71MXAhQ6r4dAE4VmlZaWLv7R69j4AKtVUFsPKuFgO2gKC6itzE+HfQTRlauw9t L/95VojFfNiVqVtAen5n6twVy+MVljfa9XulPFPPOSHDx9fn3ADH3PbThnnSOks0Vvq9 9P2QgdDNfmJzC8z43W7LgaotN6eRKgjxNvvZKOUdHi419xaF2zMJQgfjO3ka4uXOo4pc Y6Rg== X-Forwarded-Encrypted: i=1; AJvYcCVE8M+rSOkRETTnZBl3K1SAARMD83I9io07jYfGMT1P7SNPeZ4lD4TajJJWGRcJ1FpEQvbyt9AZkUfKh17EGPCwlPaH5j7BN85TJLmwoz8dnIcOAObhFk0EpW6LQ/R+fEog8e9lQ+9y9AIBL0W4dg03NToYXzhJjLK2f0Vi5n7Hasw0Osi81yN4zZg8VTQ= X-Gm-Message-State: AOJu0YwiXRltpTnX0OPsJZOYWG/QNVSp0IivuJcZAbkhOQSM+ph+67Z6 eKwwTLZdPivFXRjY3l1C84nzqJXPvCKXUGMk9pLHe8og3mJwE5iy+CM9WQ== X-Google-Smtp-Source: AGHT+IEv9kLPRZOynG1qskIR3TPiYV4A1ix0N5Yv6lW/x66yBdQmg5VFLZunOG9zmnBbB8QikdPC+g== X-Received: by 2002:a17:903:234f:b0:1fd:96c7:24f5 with SMTP id d9443c01a7336-201cbba030bmr71496995ad.5.1723598233580; Tue, 13 Aug 2024 18:17:13 -0700 (PDT) Received: from [10.192.161.10] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-201cd1aa5e2sm19416755ad.176.2024.08.13.18.17.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Aug 2024 18:17:13 -0700 (PDT) Message-ID: <58a179b1-9e92-461a-8902-31bd0a8c057e@FreeBSD.org> Date: Tue, 13 Aug 2024 18:17:12 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f44ff2aba2d6 - main - bhyve: Treat the COMMAND register for PCI passthru devices as emulated Content-Language: en-US To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202407311450.46VEoql9014730@gitrepo.freebsd.org> From: Navdeep Parhar Autocrypt: addr=np@FreeBSD.org; keydata= xsDiBEosaGcRBACOXnXquGEW53BjpMt2jViod/TUf1xgjMekcbDxqOODPeX7eYfrwJ8G6BCN OpGjBmWDu/JcNj4Z+gmTilJ6WLZQ7ecFZfEeO91pt6ys0cyWh0xfO+/mT83D7W81S/kqrJBk QbBIdV6LumevdErHo272r8RcMELC4Ru87eRtX3hmEwCgnnGNJMpQFUfYTt5XE7nY0yQoeV8D /0OcWmJbEZWxX9O7AuliCe3zd2Dw0B4LB9SZ2Dis7+gpVd3xVgYnt5wRE9kM+ThgrMA/wqr8 07qmEG6bcfUsfwwGN9YUtNF3xAN07cXTs026sCIFNZK816PrThBzCgkwR7pDpkMzGWIBr8Wi XXy0eB+JlQ6UV4PEiXuZ5ulzP0b1A/9CZm3wJfrNC0r1gMyrfVedg4zwKU997bmPLGcYs+rW XDTI9CvMseOUYn4CoDZQCp/9zxuHK+VU7Y/w0c/hVE5ERACSn4SjN2unEDstK9njZBMHEPVk Ae/YvSG5cmc97SHlVE+eu/bbLKcvFb6rRLPOaVFQJMJA2VJEGWtYhvP7Zc0fTmF2ZGVlcCBQ YXJoYXIgPG5wQEZyZWVCU0Qub3JnPsJgBBMRAgAgBQJKLGhnAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQyrIrk6yriBL0MQCfUJOiS2PbJFDeiav1ylcXXwfpggAAoJRoS7GDENGy M4BzjJ4b0ptZqTLRzsFNBEosaGcQCACFCWs47SL4DQA6bNDlVJu4w8wLf8uVOyatuGmdXX8Y /OTVQJgA3vS+ODNVJCxhKVlvhcn7bhBdGdWKS9K+lr8+eEvr4hf2bQpesoHC+uFgKyILkCBN L8raixbhysyq0pfZWWDJMyn+G42BG1yJJi+bykygdpYnbIVA8dYHmBibI8mkPKOHSohjXT1S RfGGn+l1w54OO4NlJhCXMkjTA/Z9Bt4XeaiR85uJi0UUfV8FGZHhgSvT+/P1xIvz+nytuehS P/QLXl13CtAG/nKVkAcZnsT/3NrJ4Z2r45k+c50Wrf210scAaBogrrV5eIHfNGgOANApN8+8 vj+aXO4pXRuXAAMFB/44ea8rd+P5N3OMrfuM8i91Qe1bJ+BIoroKPOr8jvCry0h3QpdfLKUN IgaqbS3JZeBJ8HHnWSGCF+o6H5gzRe1hvylPEclLPDCuPe7T746h9Mzejf2hNDJvOg+BuweD ZW4KhovVbdS+syJEvpGF4bO8qgHT2CKgruXSHbFetdQWbkM0rfMmTuo0GcR2BEVrPb/SPFv6 4ZZyAZzmnGO4vT1bzClnTzJixrDpH74M3vSEYegMB4KdbLYBi8Jx4QUKgVEhJHjJubKWX4et yU/uuehOC3xYrmr1UXvsom3U8r36Dvdo77Yr3dgDVXa7bolNx0TIhdWxZI+R4z9E75QY+/wg wkkEGBECAAkFAkosaGcCGwwACgkQyrIrk6yriBI+JQCfUxgyqGtzZvLh5Al7gsTmRc11PLwA niD3NfWGRcO2+9uxSSQqRH1ywC4n In-Reply-To: <202407311450.46VEoql9014730@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.09 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FORGED_SENDER(0.30)[np@FreeBSD.org,nparhar@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; XM_UA_NO_VERSION(0.01)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[np@FreeBSD.org,nparhar@gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::632:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4Wk9Mv2D3Gz4dZ1 On 7/31/24 7:50 AM, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f44ff2aba2d64d1d9312cb55008dc90275ccdc04 > > commit f44ff2aba2d64d1d9312cb55008dc90275ccdc04 > Author: John Baldwin > AuthorDate: 2024-07-31 14:50:33 +0000 > Commit: John Baldwin > CommitDate: 2024-07-31 14:50:33 +0000 > > bhyve: Treat the COMMAND register for PCI passthru devices as emulated > > Don't pass through writes of the command register through to the > physical device. These registers do not need to be in sync, and in > some cases (e.g. when the guest is sizing the BAR and temporarily > disables decoding), the states need to diverge. This seems to break MSI-X interrupts for a device that is passed through to a VM. That is, the device generates an interrupt but the driver in the VM never receives it. Reverting this change fixes the problem. Regards, Navdeep From nobody Wed Aug 14 13:50:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkV4x1KmRz5S9cn; Wed, 14 Aug 2024 13:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkV4x0j6nz4jTh; Wed, 14 Aug 2024 13:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723643425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thWvbhRKwCXT1b6RAy2lkTszl9ZfzEVrJQsI08dHnGw=; b=lErwiI5ppNUYRFsTebQv/VaSMdJKfP9oBj55whqHehHspixZMDxx0Q/88Fi+AMBXEkFaPf UONfxcMUM9huIFzA54sdAavtWni/wZxc54Rdyv9CYwaN7xQTMNWB27+MA6uMZsrIPcz7Xd aEcdJUahahsKKRip1MSYZYMkDFsT/iro60SOxCp8xwgrl55wBbtEaMq4dPCJxNxNrxpD1H EZuC9IvgvterABe1L8fxcBtE+KlZvt7yrzwMqRoZW6Hv5adwrFdlMl7rq4HP2SgWVxmSP5 YzSDXUBBodKKfMjJRVjCOEBsqVl2h7zG9HrW3jabxeZtzgl8V2HcIV8X4iYEDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723643425; a=rsa-sha256; cv=none; b=Gm1PRnOmtbBB8vsYZ4MajjFre6vmqJVECNNYRTFZz3DgNG6f1OOMOvv6JMdalF99bwop++ W8nwzufsf74qRclczQ5PstUJfC6G8nV5l5MS1aUodaL+b2aY+TNRtTNmpJTD6LkUo0A2rx siXcI3yx/OIDdDjOKDfwIGS0xosNIA7YjlfVsaDHay1xugrtCaucaQUduunlF3Zj00td2r cj0f3bIEqa5fcjctstmV2pv9xMiDcdyAOTuKZt3l6MlavyJD9aFC64kN67q/odhrWhUmXC OrJOwtna29ub7hiBxxl7J0FQMQLLja7laOdMYZg+Mdp2YDH3lmzmIpUKCo9o+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723643425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thWvbhRKwCXT1b6RAy2lkTszl9ZfzEVrJQsI08dHnGw=; b=gSxAxzeIfIgdKphOyl1YBYliYlyb8CIEfYKFKML3ZFSooL3wt8y/3vzjuEZ0wqBdpZ5/6E LsB7Vc9absnSlUtygGiJDYJkjMu37W4xvPqtrrdem7hSYW0M8AO2nnrUZh8uFU/O8ltea8 wtLFJUxsZAF1fymle/5Iavl77SqARhtt3+38eh4x102Xq1vzvuPEij82Ca1rQRd/y25U8+ 8OLRbG9fTvObibyYYyRKP9kenAYjz/zilszgnWSIrNF3fMj6C0+CWNefEO+2KNwDsK5HK9 A46r8EJR2xexcIweS6mAFR8AcA2d0e0f2qYM+HFM6+zZWr5FBShVL6y8rGv4cA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkV4x0DM6zwdC; Wed, 14 Aug 2024 13:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47EDoOeE010460; Wed, 14 Aug 2024 13:50:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47EDoOfp010457; Wed, 14 Aug 2024 13:50:24 GMT (envelope-from git) Date: Wed, 14 Aug 2024 13:50:24 GMT Message-Id: <202408141350.47EDoOfp010457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 89f6723288b0 - main - pf: invert direction for inner icmp state lookups List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89f6723288b0d27d3f14f93e6e83f672fa2b8aca Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=89f6723288b0d27d3f14f93e6e83f672fa2b8aca commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca Author: Kristof Provost AuthorDate: 2024-08-14 09:29:30 +0000 Commit: Kristof Provost CommitDate: 2024-08-14 12:15:07 +0000 pf: invert direction for inner icmp state lookups (e.g. traceroute with icmp) ok henning, jsing Also extend the test case to cover this scenario. PR: 280701 Obtained from: OpenBSD MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 21 +++++++++++---------- tests/sys/netpfil/pf/icmp.sh | 4 +++- tests/sys/netpfil/pf/icmp6.sh | 4 +++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a2b152cebc77..0547e29e04c2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -348,7 +348,7 @@ static int pf_test_state_udp(struct pf_kstate **, int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, int, struct pfi_kkif *, u_int16_t, u_int16_t, - int, int *, int); + int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -6639,7 +6639,8 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, + int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6676,7 +6677,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && - (((*state)->direction == direction) ? + (((!inner && (*state)->direction == direction) || + (inner && (*state)->direction != direction)) ? PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", @@ -6734,7 +6736,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, */ ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE); + PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6742,7 +6744,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 0); if (ret >= 0) return (ret); } else @@ -6826,6 +6828,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, int off2 = 0; pd2.af = pd->af; + pd2.dir = pd->dir; /* Payload packet is from the opposite direction. */ pd2.sidx = (pd->dir == PF_IN) ? 1 : 0; pd2.didx = (pd->dir == PF_IN) ? 0 : 1; @@ -7147,10 +7150,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd2.dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) return (ret); @@ -7203,10 +7205,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -7215,7 +7216,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 1); if (ret >= 0) return (ret); } else diff --git a/tests/sys/netpfil/pf/icmp.sh b/tests/sys/netpfil/pf/icmp.sh index 16c4123b8dfe..f4c8ec5e5836 100644 --- a/tests/sys/netpfil/pf/icmp.sh +++ b/tests/sys/netpfil/pf/icmp.sh @@ -108,7 +108,9 @@ ttl_exceeded_body() jexec nat pfctl -e pft_set_rules nat \ "nat on ${epair_int}b from 198.51.100.0/24 -> (${epair_int}b)" \ - "pass" + "block" \ + "pass inet proto udp" \ + "pass inet proto icmp icmp-type { echoreq }" # Sanity checks atf_check -s exit:0 -o ignore \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index c54b54c20a87..b9b60a484afc 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -120,7 +120,9 @@ ttl_exceeded_body() jexec nat pfctl -e pft_set_rules nat \ "nat on ${epair_int}b from 2001:db8:3::/64 -> (${epair_int}b:0)" \ - "pass" + "block" \ + "pass inet6 proto udp" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv, echoreq }" # Sanity checks atf_check -s exit:0 -o ignore \ From nobody Wed Aug 14 14:53:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkWVH06mzz5SGyr; Wed, 14 Aug 2024 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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkWVG6GrXz4rP8; Wed, 14 Aug 2024 14:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723647238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDUcZKxLGiSDiWqH1NUF6qT8ssRCVCioXGiOwvvOW1Q=; b=qb30N5TPHdnqwiDYqed0Q7G3QwtK8w594HqYP6q50rKJiP78KH7sJD49prRCCSjKky9ge6 zr3C7eRdpK6wdQ/jYSKC8fDBSD3wgBKJrJ/EbhzF8ei2Na842oE3ig2nv9xovlH/0cAQP8 UPKRgbGwUy69Dt1q9Un/kgYqj6TUaZwJVYrS7TP+9ZrTJ38VChSTCbYQLTnIPifKMD4Kkz Mxunr6txtghfsFyZY91QxPfWxFiaG7qNBpJ3DltLWpx85ANdUGoPnr3u4RkB7ksm2QPYps dZtMoIi7My9rkE3UQRBoPp2AP5GY9u7dRV7xKUMoFRymAaO7zWI/X7uAJWSWYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723647238; a=rsa-sha256; cv=none; b=GZAqNOt9g9o7f8GfYcjp4F8s9V7TTVJSY5tTg6gn3z9UNx04JFA53dnaavoKIVH1ESQ82F 41V0Xs1QsNv4/r8iS6kjKWi+yyht3tRdi6lFkFMfprmSBg0CC8BLcdi+a0Aib05JFz+9DF dMFogdnBYGS5viWSExOSWQv5lSvi8O0sxXpk8p8kTxcXoyqRFjRoKwB9yo14cA63IPgX4w V3F+pM8Wl0fQcDrLfylDYB/syEha7sYfakTn7/F37STkgBlYCJ/4jrG6peROO1qNOA4muK OQ5OWQX1LZcNEMZw/zEeVhavsI44sKPZTte1tAypadnAKjGAfQOtEyxlei1ZYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723647238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDUcZKxLGiSDiWqH1NUF6qT8ssRCVCioXGiOwvvOW1Q=; b=cMBJBzpdOuY99ltfzClgp6T16L89+vDjkrgsRSmcfXu+t3JWOwZpDOm1nExvS1vDhUOs6w nDfERw6GR3TwLOAyT+bSXqVIpC3mQfDFqbI/sIWFAOq15KejDBi+T/8nQiTU6jIVSKsUuP EVuRltAz7c9RvdESpM/gKGwcUPZs/UqApwlQvI1EBFWAUIssHf3WxWzOcxmNFaHDlnqb8+ yUhh8xBFeOYdDpqloGvLftqCWwa4I4KOpy5e4URUhfk/RdK5kCQgYmERhqpyLaILyjrAmi 6JjZwnFcsgdCZItAl+gpUfhiESfpDEicOXNH0W1aK4WhW4fbp62OdBXRLxJBjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkWVG5tTpzyPl; Wed, 14 Aug 2024 14:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47EErwBu021376; Wed, 14 Aug 2024 14:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47EErwY8021373; Wed, 14 Aug 2024 14:53:58 GMT (envelope-from git) Date: Wed, 14 Aug 2024 14:53:58 GMT Message-Id: <202408141453.47EErwY8021373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: c9e8a2cdba3c - main - ports(7): searchable index of all ports is at ports.freebsd.org List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9e8a2cdba3ce76f89ad1a28986974d8c23bb84e Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e8a2cdba3ce76f89ad1a28986974d8c23bb84e commit c9e8a2cdba3ce76f89ad1a28986974d8c23bb84e Author: Wolfram Schneider AuthorDate: 2024-08-14 14:53:38 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-14 14:53:38 +0000 ports(7): searchable index of all ports is at ports.freebsd.org PR: 280816 --- share/man/man7/ports.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index 911135a8b631..6b8eb27ea287 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -737,7 +737,7 @@ Additional user documentation: .It .Xr pkg 8 .It -.Lk "https://www.FreeBSD.org/ports" "Searchable index of all ports" +.Lk "https://ports.FreeBSD.org" "Searchable index of all ports" .El .Sh HISTORY The Ports Collection From nobody Wed Aug 14 15:00:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkWfM1JZmz5SHMh; Wed, 14 Aug 2024 15:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkWfL1xyJz4sff; Wed, 14 Aug 2024 15:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723647658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1y8RVISKbMzfw77s6mtcjYPGSLsbsT+Jc4popMMuOsA=; b=Y5I2yIwinrX2YRt6tUNuIYMIiU8mmlFlroJXe00IEqJI14qGgBtMuNFFXqcTuQKQXeAkCU 8CA53yR+MwyqagvyraPyi+3dL/dZUi5iiRu1o4xEsMtM2JTWg1/sFrPA3k84/d5U1musry tSt2Lq9FU8Z+dRuPJf6+v671psvyStCrByhEsbtYljoLkRFkaBIO24PkT7450JKplmRzfU hEALwHYKYlZYPk0trbTlegDw22fHAG/nxNt2QXLqtYNZs4+jO3KhSga2chRgqyb59TBwsS bUT/YfskwCIyhJFpypL3Kq3AGk+Wod7rpSfJsCHbDE5OcJrxzgh+wpExXdl4pA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723647658; a=rsa-sha256; cv=none; b=GOHFDmo95Waaz7DVbOGiIZWXYEuTJm94sE/DJdBkxd+t5Ow8Pj+BukbaKaJpoaTt6QufYN xySSgWujDW+snUj5eYgERUsJWW+JeKM2Znb7g90C9qNCk5PCOZgn1mHJ2x93pHBQ9RXGH1 WfqNw0O/o0nsVOL3o5vIxuVfCNQDcqYPzlkTyKM1ZcaYKSD2owjU2e6pD9Uy65VEHfzZ8m PnfwpAYeizUHcV6UoiQt7RHZD9C9TmDZrVdQ6GV29bbuxYQm7nhr6UmPbzyYxPF+IYifxo kEgiGVo7buVOfvqIKwhv9yJHQANjvxHUToV4vuFYFWhcGRN08x3Pp4aaB/+uMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723647658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1y8RVISKbMzfw77s6mtcjYPGSLsbsT+Jc4popMMuOsA=; b=HbkG36DddC6IkwkePce7jO04dLt8YvE1MLTqBSia4N5OEjGliCRVZcF+V1gk/LIwieXzhe D7dhqESoM8VKj9sYQJXe4/z/baTXx3ALwypMxTG4aNO2xxGw1W6KEV/gMbN0nfK0n9IgsB wnJvfczbQkn574e5PtfoEZOv/v0dgmoSOB5irxsm/AiuJAdjEPuQZTjTEa/HqNXx3D9uMt VhXSAzLu3pWmpuYGqo9wZuJ7aZ/uVfMfzi5UJO6Dwr2+Qs1GXwmTVQuwwDvs4FFSTL/sQb BfVCglidtE6CNIXBDkCiQ4ercFuHhAaJKaYOdhGUV3KuAyGH2/ymNveSpBVEAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkWfL1ZKCzyLt; Wed, 14 Aug 2024 15:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47EF0wfe032288; Wed, 14 Aug 2024 15:00:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47EF0wAa032285; Wed, 14 Aug 2024 15:00:58 GMT (envelope-from git) Date: Wed, 14 Aug 2024 15:00:58 GMT Message-Id: <202408141500.47EF0wAa032285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ca83345ab42b - main - UPDATING: Add note about DMAR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca83345ab42b18c876d63579d86df2521c7ff402 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ca83345ab42b18c876d63579d86df2521c7ff402 commit ca83345ab42b18c876d63579d86df2521c7ff402 Author: Warner Losh AuthorDate: 2024-08-14 14:52:47 +0000 Commit: Warner Losh CommitDate: 2024-08-14 15:00:37 +0000 UPDATING: Add note about DMAR DMAR crashes my laptop on boot, I had to disable it in the boot laoder. Add a note until this is handled more gracefully. Sponsored by: Netflix --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index cffafdb5d247..bbcbdad9bfd7 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20240813: + DMAR is now enabled by default on Intel. If your system crashes in the + dmar code on boot, please set 'hw.dmar.enable=0' in /boot/loader.conf + and file a bug. + 20240729: The build now defaults to WITHOUT_CLEAN - i.e., no automatic clean is performed at the beginning of buildworld or buildkernel. The From nobody Wed Aug 14 16:06:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkY6L5HlTz5SP0S; Wed, 14 Aug 2024 16:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkY6L3Jn5z51pq; Wed, 14 Aug 2024 16:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723651610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asi22Un2pIjyVvBAN4qj4efhRD1p8gIx2bO/RTusuqU=; b=yAaXXcRUYvbd/RlFezeP/EgVR/11mm7Y25PKRzjCsYJiacaD9o+vcs0TbGSV8nR1JPZ6JG dNzrA6Bae2ZNZdP6oY61s4dC7v4Zk5cKV1cmbW8ZoDG8PYsF/KmoKX4qiQ+Zz0i8tLhzq6 sKsvQF52I+PfOOr5VdHHPzSTSwlZknm2j4UhCbTSIir6OYERBb8WyXKLnkNCs95+y3c0yx 7aZeM9jgf7csv5pnHnbqaXhFokzVWj5sg/7UlHYHmnogepPYVAc6YQsRjem6+1plIhQPbz blSR9QEYyATEnywyfE3W2IEr6XObrsxCcV4UWJ/CANLg5LPEK1+RkktoDfHWlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723651610; a=rsa-sha256; cv=none; b=W1nYQ12MB+H8huU9NF7ZC1psoWcYZGKscb5Px609wRB0NHu6n6C1oucKSOajRUOnsDsFKg En25xUFy9FmHHn5zrCgyNspi5ptWNwK7nqsAPCEZtXPtKjFeHI+cMzIlY6Z/5afoH9zfOM o11fuSS0/hTDnJsLdWJmcp7+ZIFRdbPannOP3ahctY4GkB6CnOK07UsyTXsB+VBXqa9n/1 oty3GCjwKND/xMBFQ79oQPEtGy9iGSx4zCL6QTod9o6G3r4uPLmM7HetIuG6O9/rgTMa59 2hkM32MglCFw1e/WxYwTYrEzd6HLxQmS6lQ7/U+hRreBrheacT8Gyy7E5I08Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723651610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asi22Un2pIjyVvBAN4qj4efhRD1p8gIx2bO/RTusuqU=; b=CpjisFQ/j18TO/IaiN5xMM+Wt2hBxc5fFo2mjuBisMB047Dn1Zkc9RPSiLKLRULEkfG3jt f3i3yfFmdqVGF22oTytFdP1wIWYGDMJY1iuLFWI6/BLtl6j7wtO+SIe1t2o1yidcMR7qS5 ld3PZXNmhgl56wFvZBYgLO0BuMU41O/LNn3TjQUT7z+gNUM/1SwVevlYCyTEPcuRmgWRPN qR6uXdhSnRsSRVeNbmqo2UfUHq5PpHDzCuZMcpS+J1Pxr65jiJL2Xo+Da0JpFlflLBYWsh M0tFxT4IQZRzMrKJbLRtr3/DVD0QIACeNgjqmMtrLmE3nLS0zdl3gxHfikaBnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkY6L2tmbz1181; Wed, 14 Aug 2024 16:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47EG6o6M042701; Wed, 14 Aug 2024 16:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47EG6oY9042698; Wed, 14 Aug 2024 16:06:50 GMT (envelope-from git) Date: Wed, 14 Aug 2024 16:06:50 GMT Message-Id: <202408141606.47EG6oY9042698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: b458ddf27fd8 - main - zfs: fix build without MAC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b458ddf27fd87afa57575cdad68f6b4183916666 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b458ddf27fd87afa57575cdad68f6b4183916666 commit b458ddf27fd87afa57575cdad68f6b4183916666 Author: Gleb Smirnoff AuthorDate: 2024-08-14 16:06:31 +0000 Commit: Gleb Smirnoff CommitDate: 2024-08-14 16:06:31 +0000 zfs: fix build without MAC --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 8185954b3e05..d3be13abc682 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -6125,7 +6125,9 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap) error == EOPNOTSUPP) goto bad_locked_fallback; *ap->a_lenp = (size_t)len; +#ifdef MAC out_locked: +#endif if (invp != outvp) VOP_UNLOCK(invp); VOP_UNLOCK(outvp); From nobody Wed Aug 14 20:22:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkfnR4LQxz5SmN1; Wed, 14 Aug 2024 20:22:35 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkfnR3SP5z4CtM; Wed, 14 Aug 2024 20:22:35 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723666955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=9WBCZ3DYBmsDsWXdt1+VSBVKhSfVfBxi2WNdORgp/zE=; b=qydkE/rpv5oKnTZwle46jii0GyzY9oOm/rxhnG0nq7NrtOxea60kh4/zBA+7QUTdZwe0U4 dyahcHggRzU3MjIu7yHEqtNL0rCz/Y/woZH51G5M+qlKGqnqI3Lta25Pd+agCoaSxHxzom Id+rgQsiFhFkKOMbk5m1dDiqXKl5LkGLcTW1VP7KllHkMqyqztABLUEfFvpDfV2g/sOikL ntnNioAQxlhwOGkCoTF13U3cXNmTYKhDJALxxRZObPEnvWgTEUhBI6s/+r9YxIk5yVNgB1 T8Nwy7i8loPTpr173LVmSmRkP94tyFy1EA9mXCNutYq3YESLNCWAyjehqBqVew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723666955; a=rsa-sha256; cv=none; b=ilpmx7heGfGLvqXXHrhL0zEf3R2vcoiHZOeeDelebI+v/+yuQFfqNHUbiGkQ8xDgZ/LQms 2Y3fRmZWQ/5uFAYI70iZfp/EUa7wzfYbcsXIGbxNE0gvM/9FlWydS9M692aJIE7KMJ5Zff Vv3xxEqkKZUP9NZNDWVHbkeh3DZUxDkyo3keBjWkaGM3Pd99wgGQqgiZMnjGyWclZFjzwv QDvj9BtoVcn1fTWTLB0uzsPAP3BBN+rh3wv3Cyercw9LJVFLC1+ntqINlRNmAq+mcTPgjt XcpJ91Pv4/me3085mptaHZVxKhszpGgcHCuVgs0PN9v+G8x4D7GD3KQ8BLKPUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723666955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=9WBCZ3DYBmsDsWXdt1+VSBVKhSfVfBxi2WNdORgp/zE=; b=XM8L/mfWRWHfcwNm57UJt+o4KD5ylyf/vrA6+Meuaz0D51MHfeMCr6aXTEbEISqxklHijx 5bKsMPWyNaxuKkrms5me1sSodgpDie1e4kSCnGPhWR4t8ajXALqomFWrRrOtuQ6zoKU6kZ Z7uVCN+prLWsNq8sp9qtSBLlaQq5wGC9U3ONFM2quh3lSdlKY6ee2hWPXURR/uxzJC+THA PDKX0DJKz5JEpKLEd5tqZsztU9rE7odEh5AXEahHWh4AETCmk4cQE30s3MeHS/P2dSRXf7 3iEac2by4qpnMpG+lShgy9EHBqiICmYBGMpdt+gfedmrNAn44ABKuzn7GQNBUQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WkfnQ2mV5z1Nt7; Wed, 14 Aug 2024 20:22:34 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 14 Aug 2024 13:22:31 -0700 From: Gleb Smirnoff To: Mark Millard , Cy Schubert , Dennis Clarke , Marek Zarychta , Warner Losh , Mike Jakubik , Nuno Teixeira Cc: Martin Matuska , dev-commits-src-main@freebsd.org, Current FreeBSD Subject: Re: git: ce4dcb97ca43 - main - zfs: merge openzfs/zfs@9c56b8ec7 Message-ID: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240811215101.7e7b5bd5@slippy> <47f96d89-e1d1-43a8-b456-7b30240d1fad@blastwave.org> <20240811134119.91DD57F@slippy.cwsent.com> <54076f5e-cd6d-40d6-b4b7-495cf8e67572@blastwave.org> <20240811021506.04996DB@slippy.cwsent.com> M> sysctl_warn_reuse: can't re-use a leaf (kstat.zfs.zroot.dataset.objset-0x204.zil_itx_metaslab_slog_alloc)! This should fix it: https://github.com/openzfs/zfs/pull/16448 -- Gleb Smirnoff From nobody Wed Aug 14 21:57:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wkhtr3hp9z5SvPM for ; Wed, 14 Aug 2024 21:57:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic302-22.consmr.mail.ne1.yahoo.com (sonic302-22.consmr.mail.ne1.yahoo.com [66.163.186.148]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wkhtr0vnGz4NBJ for ; Wed, 14 Aug 2024 21:57:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1723672641; bh=DIixdux3nqXVzZMAsraP7g5z8Ml4MFhY54wcdFT9lLQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=SJR2tXnJtI9Cos41qV71xohM0HAcHKG8HZqYXSzLhsFM53qg8n6/PBt+c1G3B2spz0iUeqToOCsV2pbMp2voJHEPuSojNqaQHlR4SqlxDCuJYgmPOnQyehWVwUp447Wx0hnUClrUCKhfj/aoP5H0jSQ0bjNq7EGJ7I/AWLVVK1pY9czKESrLzMaXBKe1Dz8OsLcWSNJuRmWaV+d/zP6ADq2Jx62eo0N2IYpcuUUwlMQQi8jHGHcLoWGm7saXCnMNJqTsGhkpvHwd1MJloGufPnQek0WdPVUlo/eQHfRkfY5g2ybVKuJayUI+ydJ3bJZHviqEX/7AElY940VgIYiI3A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1723672641; bh=+foK2AjyGQUEj4QJ4CfzEZNpcwQdVc5P7YzH5wHO9mn=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=RoZLtE+41g6Z9Tn3J96hxgW//iU9/RUR7sfddnPs20hoQaDqRa3dRXo3dKE95GxOatNd6iKWzQfixApMPaIsSvtGUy/LyYO7T/UUGEnJo8Rhz9+oYy6xQazMy/VaNUtmt1DECcTfqPBNc4MXuIPwp9jcmmoGC3QE5cHRASWBNRHjqGqBpaRYASqhf8ULA//Wq8vJ/rF47qSVL/Eh0TAUp8b46PwnkxfjvD+PGZydJJcn+ylMgN+Td4iGwk39HrnSrSFXUZmovJbaaluFu58juNn82TjzE1OtA9K7HB9bkwjqQX+/d4zrrc9/3Whh+Aybteky7mT6vGthmGh8KryLKA== X-YMail-OSG: LDKgbSkVM1ngFeM9hrxE_sXjVUOOd1FdjBsTritaHi7fmWfgnhJOA6hK2snckPk rKf71d0hLjsXuLdZzJj5P4gtH_wfJMFhs9M2fY_TyYn1xAl4h1lVoFvMWDzk3Wcu1fdFzBm6jHHc LdLI2ivrBcS7.MTY1oBV05BkS9uVhWyxcQmgMUW0mVTPOsMg0fo_xotEJYYinsRGc6qKRZ28VMWy .vDB1CaNWpgY.defuagIns.QDmsGw7.wLPOEld8Ocefpz4amC3eNN5EDKK_sGe1LTeD_9Cs5mjie fhSnRrSyDM1kLwOep7umEyR.tZ0tjMSE_zkM75jOrQJEWFcT6iGT4ReaMNH.eJ09yW.4B5QYLz9F ToXar88H6BulCUNEP9rhviYz9HJwF1GSLnHaOgWwxGHOcQjYL3JyrQvpk6ksQBwQOY9hF71F4Pl7 sv0dLgY34CNRa2EbkaxMvL57zYRzlVqGc4oP5zBM2iqP5EpqCRycAYZwYdK4BefZjFGdwqwuh1.9 s7LULjWtX80yx.xikUz8tsNxk.vp9D_jaO95vYkEFgvx03wLLjISDO7I7mhYUIK3Kt.il.5HNpEA i.ZfVoGQ9u0cy1I98DSQFCFSiMRRi4ZEP6rddSENKdDuf.DHYc3kq0fb714DSgkelubGsoQtH6d7 YMqK.Z5AKpyx_Zj3I3bIgpDGdD3mI0hBSVugu_8wqFVguKarSox8aXNo1.7FUUnLkkVrl8EyjzoH 3bU9XINZQnCf6mlCqnETKzquulrDpaS7W3ZweyYH7.8XD8fE5EBIJJF3H_ch0THLdzdyPswCBIjp PWqN1eycA8dOB2Dr.5q67mtKLOWAN6b7m5Ncxck..lkXhTFVDgck3MYBy9mz2pPKQED5jMG75N4M I98dUZ2ulCA1.h3TZNMXEfiL6YUw6ffd6Mv8NvPVGORXnPWydBp6t3qzGqLo1lUsTSIGjbQCAWDJ JKCOJHhuXn.ze0xCUvAfIOtYUZWOrjTbSA3VU3Lk70Ju5ymPYOmv2aiSpCPv4hdR6FosCv_HxI5E 493YDkjOwGk4goxGSTgcsteEYziGk2O0f7DpHKwamIVUxdwO89gA5eNu3ccEysR0hgirEST7IrPL xo0A0tmMrXrnGfLq_x5UCkaA77xAHcigsvYZ0UNc17c_PPtlRkOwA9qBSQI8xmw0TG1UWAx8Xhc_ uxD5IGdza4jGLc.v_lKol4CcCNfzh_7EslJJuTrSXVXDBwaEK0GqAYJ1sI5hKrX2fvzzQ_oTIH1O jyUCdQQmwHgl.pmqyqEouIq9XXCIJVLf2KI2AQymy7oeNHODJZO8cLQ8ZJnkyIfwi8_uQcZrRmzH ByinHsXRe25_INgjdFPm2X0mavUu2KCearHY00DOTx8Sllosei.pA6WJfDwbs23z4g2fPcADaPuX B.nRN9G.NkliHVR9kMNuAvhNZRjE2K.PLrRRb2znL4Dg8Ntx6EPzFJZY12BCevkOAHmhUeVuvQXE oKmTkIC9cFR_Y5Ut_g7Fk7FyUTLkPJ95267uA_SHvAf_YdqKtrcGg6eMTjBnQ1KVN0R5J1CcQUgX SHx3CIp_ObwKmlx.PrSSQLK8DnjNCyvL55XOnAnuBzqsXBgMdqNsbiqLLGm9aojcVLCEXXSNT.RR c0qnnft_UWy91p2owFD2SSzizFomhaikpqEwrXfjq4aNubXnogpOBQMVcXJ6JlfPenalKVqFZYyE Qh3JyUUrGWJGPbZlzAZDDma9O8CVlkqvRXPKGbuqEjT4c1mEx1lLbpLHIU1Zf9d7gCpu4UIbDigm NdBMRwdXmhEtQh._MIVE1w_KCPqEkDq_wjfgKN6H9rgwm3Nsx5B4nqr.iOOdlxg.GdIGv_g_Uhiy UMLfyiHbEqFQgKdhgRgxfEUP58sK8aNNY9GGDWkV0piyI1KJNByI2d7qqfRKyqfZroQkYuEUFUA4 HMZJuc85yvGbfMMhYcm2Fl4pzHgxBFrpfl4POKLSkcVrrZDRSh0pStlRL8HhJiU58J23TDysnXzm j6rI7qJAEYy5JG82stkpQmMAjVm.VfRyBEGLPn7qqepeP2PjUXMUJ0vSNmjStFnejLk_B34RUINZ dEum2YnjW1cJQYY0jNhFWBU7fO1Yq0tPHD0gc2aijDnqKP9W5ctuWaJLhTdXsVjPs141CueYPjJc Ui7oiHPFjmyKLDUg51E7u53Oa10MpW9YgxgEjXW1.9vLQwxDvjqB2R8v3OR8vuufhe2PTdMxHkl_ C_Xr__GkAb2kwSj6_cdDeAD3SYQDphf8I9VT4D0lTyNsxNK5YyZHFSXOjjlQN8.UouVE23DZH.b7 mxhS5hLJFC5_5.qeN4vPFPgKzRR6lkTXgS8pxO5Pu_KyV X-Sonic-MF: X-Sonic-ID: 7cfabd10-7dc7-470c-813f-b66143ef59ee Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Wed, 14 Aug 2024 21:57:21 +0000 Received: by hermes--production-gq1-5d95dc458-kk28l (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 22b1b601f8d6bc0796aabef70de0f3a2; Wed, 14 Aug 2024 21:57:15 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: git: ce4dcb97ca43 - main - zfs: merge openzfs/zfs@9c56b8ec7 From: Mark Millard In-Reply-To: Date: Wed, 14 Aug 2024 14:57:04 -0700 Cc: Cy Schubert , Dennis Clarke , Marek Zarychta , Warner Losh , Mike Jakubik , Nuno Teixeira , Martin Matuska , dev-commits-src-main@freebsd.org, Current FreeBSD Content-Transfer-Encoding: quoted-printable Message-Id: <7A4FF937-D877-42B8-B1F7-09C6E0E1DECD@yahoo.com> References: To: Gleb Smirnoff X-Mailer: Apple Mail (2.3774.600.62) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; TAGGED_RCPT(0.00)[] X-Rspamd-Queue-Id: 4Wkhtr0vnGz4NBJ On Aug 14, 2024, at 13:22, Gleb Smirnoff wrote: > M> sysctl_warn_reuse: can't re-use a leaf = (kstat.zfs.zroot.dataset.objset-0x204.zil_itx_metaslab_slog_alloc)! >=20 > This should fix it: >=20 > https://github.com/openzfs/zfs/pull/16448 Looks like that was labeled as a duplicate of 16431 and 16431's fix has been committed to the openzfs master branch: = https://github.com/openzfs/zfs/commit/244ea5c4881f92a9d7c1fb341a49b127fda7= 539d =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Wed Aug 14 22:42:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wkjty4WW8z5Syrq; Wed, 14 Aug 2024 22:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wkjty3jtYz4XLH; Wed, 14 Aug 2024 22:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723675354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKALLBVS5wPL9ktNQT/ZwO31KtsGE6TLfEExgXXAWxI=; b=I2rtbAWSHVIv+G24Uxdskf+9hPPTI24dN73MJRmPtg5bRO+rsQazHzior0LphlPuI4nqoV khxgHoDiSZTfe+edysNDhvOBw7mSVbBLU13eKmVMfCXkT1VGkL6Gv/r7ihvhle8it6ftyh dYpgcp1B2ZTYpJJTTxUQZ4a8bft23Hj2qu+q3op++1bXAFcSCQMj0l2IWJUvahA5WEA3pn TWFqrJGsT24/t9aluswZuLCphX3c17SoBIrgAucjjLov6IdhmjDFrmpxuPModHQFc2/P43 W3wEwTiTrap4Ff+IOLMW7g9cXO27eK3DfEbWX6aVagith06eeJAB16iyW1bujw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723675354; a=rsa-sha256; cv=none; b=ZFc6AkyC4j/yIfqeqFE6U7sfWzLmahCWLedKFFh9n0Sj/q2e5iBm7RuLjhwM1iDMyLpVEe HH2KipbzZ/PTvisgB5xC1Kx4TLdEivXV40XmUnYnnIacje7WIFtpS4h8dzqKqcLX7dH256 Da1V4C5+CFOFFIvCZjgWuvzzPtmlOmNaxTGXgcbMDuAUTBE/h9WT5t/Y1ZMqt33NJNDi/F FbM+En4VdsCsUs1vqqSObuASIbhNQJoa7fLcpvzUwYPTdcqUNzv0qukdUhDwexeTzs7zEc s8u6JKM2oYvyuAn4cbButAD+d3FYZQL+vV2w/usVuqi23ULg2+P8uf9iFisU4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723675354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKALLBVS5wPL9ktNQT/ZwO31KtsGE6TLfEExgXXAWxI=; b=yedj06XEBgFibSRGJvh4dY6uME+4QXYoif0QV25nIPzp9ZMKaG4pWNSb8jJwuuSbND+JFe K9Rke7iRIJsqP1SzWBss7juUVUnHfpcTZfbxr6Giu5IGCyxY1K/A+u9rNKvHi0VkjrihFR /mwIcr3diAbIk6If0xgJej840+wuCfR7cOMJnsUvhtz4STf3fJYycNJkbf0M/nakKEjrmS klhygdtiote5kZuJ0kRUG35Fd++YzrCtSr/cPeRHXwoMGC4RaGdm7neaUoeGrtK8wuDVLy St9JcuHTV+F9P7momC5wKllzhtIN+Y/90+nY50EHNReB4/hOoUHEuzeU719gcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wkjty3K0zz1CJ8; Wed, 14 Aug 2024 22:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47EMgY5f017273; Wed, 14 Aug 2024 22:42:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47EMgYsf017270; Wed, 14 Aug 2024 22:42:34 GMT (envelope-from git) Date: Wed, 14 Aug 2024 22:42:34 GMT Message-Id: <202408142242.47EMgYsf017270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bd4f2023bb05 - main - Add missing kstats to dataset kstats List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd4f2023bb0551448674ad05b524360175776dda Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bd4f2023bb0551448674ad05b524360175776dda commit bd4f2023bb0551448674ad05b524360175776dda Author: Paul Dagnelie AuthorDate: 2024-08-14 21:18:46 +0000 Commit: Gleb Smirnoff CommitDate: 2024-08-14 22:42:00 +0000 Add missing kstats to dataset kstats Reviewed-by: Tony Nguyen Reviewed-by: Rob Norris Signed-off-by: Paul Dagnelie Closes #16431 (cherry picked from commit 244ea5c4881f92a9d7c1fb341a49b127fda7539d) --- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/contrib/openzfs/module/zfs/dataset_kstats.c b/sys/contrib/openzfs/module/zfs/dataset_kstats.c index 2ac058fd2c93..8faa6c2a2528 100644 --- a/sys/contrib/openzfs/module/zfs/dataset_kstats.c +++ b/sys/contrib/openzfs/module/zfs/dataset_kstats.c @@ -40,6 +40,9 @@ static dataset_kstat_values_t empty_dataset_kstats = { { { "zil_commit_count", KSTAT_DATA_UINT64 }, { "zil_commit_writer_count", KSTAT_DATA_UINT64 }, + { "zil_commit_error_count", KSTAT_DATA_UINT64 }, + { "zil_commit_stall_count", KSTAT_DATA_UINT64 }, + { "zil_commit_suspend_count", KSTAT_DATA_UINT64 }, { "zil_itx_count", KSTAT_DATA_UINT64 }, { "zil_itx_indirect_count", KSTAT_DATA_UINT64 }, { "zil_itx_indirect_bytes", KSTAT_DATA_UINT64 }, From nobody Thu Aug 15 07:34:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wkxj81NkQz5T7Lb; Thu, 15 Aug 2024 07:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wkxj811pxz4Xv6; Thu, 15 Aug 2024 07:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723707292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzptYA7X+uTUy3L35eBwT/wojm8ETZ8sLKSaHMjxOpU=; b=tUAO9ZXvOUvpLDTtSGSCqyE3ojUSzUohkQmm7J5akP/j5V6kruOOrUPnNSHt+MvccFgHI0 Wqg/mdgVVI7zctafMOZJ3K+fJU74JivMBXndh0UnPIR1Jcom0sV6dKO3zSKT99qBL3+d2Z 5C8iPin76AgVw5/kQH4Kye1TN950rcYeDjN6ZUMb61UXHzf+Y59GmaXbGB5Xx6R76TcQ0G V1q9jOdFCR7LjAi7h7IHO2NFtCrE2SNhI8ODaAp8u6osmNCNk0l97GTJ8/rOzQZMH+Tihn M1LycRWT+JsSUBfY1XWUsirHRoO9T8cFXgqzzJ2Qgkc/0E9UHppXqoWEuc2x6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723707292; a=rsa-sha256; cv=none; b=bt1Al/KKQZJVq0Wo3nZTye9rEqKSTg01dAdziAA4k9YQ4yYVDCz3QehKmNQCQ4DlfYr3xB 8RH9mPgIN600GoJ1e0x60pfoD9+ujAtcrvW8QC3kjkRSB9MEa6DZTPxfazoI2BhBEZ317W nkgmDcK0uk935YsOHCJ2uiQXAVde3JShLApNCK5QOOqZrmSW4Uv7sCbWrOMx50XvQAS/BL sctrbKsrqflZn4ozpeKcO8ddrVUuODk/tft1THVPwYK5ZHLDedQfbLZs9X61FCW1lRRIM6 cRBhTfUf+ufMYna5pWNF+GlBFQWZaNhRcS7Fry59/AC2BBfQg456H7YmYsMLqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723707292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzptYA7X+uTUy3L35eBwT/wojm8ETZ8sLKSaHMjxOpU=; b=yiRnnqCP1S296cJdn16ZxH60wn2dvLOxgGkJ9nI0ZkQjhWEAOGRR5Dbj/VwJl+vNZLld8t Cd1+Vj0eEIqOdFeYCgZYUEaMDboT5juluKRMubKITveC6FagL8lNg3e5RcACvvux54TvqF 60AKBqzEpuIEUzm7n1o1DbR4T7sXvH9nPCm2ByXClz6OxJO2uuAEegs061xO7bOIyIKQau BRX9zxeVoqowHEvA3crqYvuZWqw5mFRPR7WECX1/Y+UJ/pXLQZBrbXXLZVFGpGo2VssGgG JO/E+w1q8hfNCdx9pOtiLdtE1x+Izvn3N9hghDns6reF+oUJaL1EWcs54Bcnqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wkxj80X2Fz1SMY; Thu, 15 Aug 2024 07:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47F7Ypcf015271; Thu, 15 Aug 2024 07:34:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47F7YpBA015268; Thu, 15 Aug 2024 07:34:51 GMT (envelope-from git) Date: Thu, 15 Aug 2024 07:34:51 GMT Message-Id: <202408150734.47F7YpBA015268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8aaffd78c0f5 - main - Add dummymbuf module for testing purposes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8aaffd78c0f517985c12fd1e3cbceeb6c6b98ef5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8aaffd78c0f517985c12fd1e3cbceeb6c6b98ef5 commit 8aaffd78c0f517985c12fd1e3cbceeb6c6b98ef5 Author: Igor Ostapenko AuthorDate: 2024-08-14 12:45:38 +0000 Commit: Kristof Provost CommitDate: 2024-08-15 07:28:13 +0000 Add dummymbuf module for testing purposes Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45928 --- share/man/man4/Makefile | 1 + share/man/man4/dummymbuf.4 | 209 ++++++++++++++++++++ sys/conf/files | 1 + sys/modules/Makefile | 1 + sys/modules/dummymbuf/Makefile | 9 + sys/net/dummymbuf.c | 436 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 657 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4e685cac3ecf..6195211d2eb9 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -135,6 +135,7 @@ MAN= aac.4 \ ds1307.4 \ ds3231.4 \ ${_dtrace_provs} \ + dummymbuf.4 \ dummynet.4 \ edsc.4 \ ehci.4 \ diff --git a/share/man/man4/dummymbuf.4 b/share/man/man4/dummymbuf.4 new file mode 100644 index 000000000000..844a7c0565bd --- /dev/null +++ b/share/man/man4/dummymbuf.4 @@ -0,0 +1,209 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 Igor Ostapenko +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" Note: The date here should be updated whenever a non-trivial +.\" change is made to the manual page. +.Dd August 2, 2024 +.Dt DUMMYMBUF 4 +.Os +.Sh NAME +.Nm dummymbuf +.Nd "mbuf alteration pfil hooks" +.Sh SYNOPSIS +To compile the driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device dummymbuf" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dummymbuf_load="YES" +.Ed +.Sh DESCRIPTION +This module is intended to test networking code in the face of unusual mbuf +layouts. +The special +.Xr pfil 9 +hooks are provided for mbuf alteration and can be listed with +.Xr pfilctl 8 +as follows: +.Bd -literal -offset indent + Hook Type + dummymbuf:ethernet Ethernet + dummymbuf:inet6 IPv6 + dummymbuf:inet IPv4 +.Ed +.Pp +To activate a hook it must be linked to the respective +.Xr pfil 9 +head. +.Xr pfilctl 8 +can be used for the linking. +.Pp +Each time a hook is invoked it reads a single shared set of +.Sx RULES +from +.Va net.dummymbuf.rules +sysctl. +The rules are evaluated sequentially and each matching rule performs the +specified operation over the mbuf. +.Pp +After every successfully applied operation the +.Va net.dummymbuf.hits +sysctl counter is increased. +.Pp +A hook returns an altered mbuf for further processing, but it drops a packet +if rules parsing or an operation fails. +Also, the first mbuf of the original chain may be changed. +.Pp +The module is +.Xr VNET 9 +based, hence every +.Xr jail 2 +provides its own set of hooks and sysctl variables. +.Sh RULES +The set of rules is a semicolon separated list. +An empty string is treated as a parsing failure. +A rule conceptually has two parts, filter and operation, with the following +syntax: +.Bd -literal -offset indent +{inet | inet6 | ethernet} {in | out} [ ]; +.Ed +.Ss Filter +The first word of a rule matches +.Xr pfil 9 +type. +The second matches packet's direction, and the third matches the network +interface a packet is coming from. +.Ss Operation +An operation may have arguments separated from its name by space. +The available operations are: +.Bl -tag -width indent +.It pull-head +Unconditionally creates a brand new cluster-based mbuf and links it to be the +first mbuf of the original mbuf chain, with respective packet header moving. +After, the given number of bytes are pulled from the original mbuf chain. +.Pp +If it is asked to pull 0 bytes then the first mbuf of the resulting chain will +be left empty. +Asking to pull more than +.Dv MCLBYTES +is treated as an operation failure. +If a mbuf chain has less data than asked then the entire packet is pulled with +tail mbuf(s) left empty. +.Pp +As a result, only the layout of a mbuf chain is altered, its content logically +is left intact. +.El +.Sh SYSCTL VARIABLES +The following variables are available: +.Bl -tag -width indent +.It Va net.dummymbuf.rules +A string representing a single set of +.Sx RULES +shared among all +.Nm +hooks. +.It Va net.dummymbuf.hits +Number of times a rule has been applied. +It is reset to zero upon writing. +.El +.Sh EXAMPLES +As it was intended, +.Nm +can be found useful for firewall testing. +A mbuf chain could be altered before it hits a firewall to test that the latter +can handle a case respectively. +Thus, it is important to have correct sequence of hooks. +A test case should prepare and enable a firewall first to get its hooks linked. +After, the +.Xr pfilctl 8 +should be used to link +.Nm +hook(s) to put them in front of a firewall. +.Pp +The following links +.Va dummymbuf:inet6 +hook for inbound and puts it in front of other hooks: +.Bd -literal -offset indent +pfilctl link -i dummymbuf:inet6 inet6 +.Ed +.Pp +And this does the same for outbound: +.Bd -literal -offset indent +pfilctl link -o -a dummymbuf:inet6 inet6 +.Ed +.Pp +For instance, we want to test a scenario in which the very first mbuf in a +chain has zero m_len, to verify that a firewall can correctly read the +packet data despite that. +The following set of rules does it for inbound and outbound: +.Bd -literal -offset indent +sysctl net.dummymbuf.rules="inet6 in em0 pull-head 0; inet6 out em0 pull-head 0;" +.Ed +.Pp +It is encouraged to verify +.Va net.dummymbuf.hits +sysctl counter along with other test assertions to make sure that +.Nm +really does its work and there is no false positive due to misconfiguration. +It is a good idea to reset it before the action: +.Bd -literal -offset indent +sysctl net.dummymbuf.hits=0 +.Ed +.Pp +It is equally important to cleanup the things after the test case: +.Bd -literal -offset indent +pfilctl unlink -i dummymbuf:inet6 inet6 +pfilctl unlink -o dummymbuf:inet6 inet6 +sysctl net.dummymbuf.rules="" +.Ed +.Pp +If a test case operates within a temporary vnet then explicit cleanup can be +omitted, the +.Nm +facilities will vanish along with its vnet instance. +.Sh DIAGNOSTICS +.Bl -diag +.It "dummymbuf: : rule parsing failed: " +If everything looks fine then extra spaces removal may help due to the parser +is kept very simple. +.It "dummymbuf: : mbuf operation failed: " +Incorrect operation argument has been found, mbuf allocation has failed, etc. +.El +.Sh SEE ALSO +.Xr jail 2 , +.Xr pfilctl 8 , +.Xr mbuf 9 , +.Xr pfil 9 , +.Xr VNET 9 +.Sh AUTHORS +The module and this manual page were written by +.An Igor Ostapenko Aq Mt pm@igoro.pro . diff --git a/sys/conf/files b/sys/conf/files index 6e69c128ee65..df4c702540ae 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4151,6 +4151,7 @@ net/bpf_jitter.c optional bpf_jitter net/bpf_filter.c optional bpf | netgraph_bpf net/bpf_zerocopy.c optional bpf net/bridgestp.c optional bridge | if_bridge +net/dummymbuf.c optional dummymbuf net/ieee8023ad_lacp.c optional lagg net/if.c standard net/ifq.c standard diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 19c34f81851e..84d1735e8e07 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -100,6 +100,7 @@ SUBDIR= \ ${_dpdk_lpm4} \ ${_dpdk_lpm6} \ ${_dpms} \ + dummymbuf \ dummynet \ ${_dwwdt} \ ${_e6000sw} \ diff --git a/sys/modules/dummymbuf/Makefile b/sys/modules/dummymbuf/Makefile new file mode 100644 index 000000000000..aefede45dbd3 --- /dev/null +++ b/sys/modules/dummymbuf/Makefile @@ -0,0 +1,9 @@ +.PATH: ${SRCTOP}/sys/net + +KMOD= dummymbuf +SRCS= dummymbuf.c +SRCS+= opt_inet.h opt_inet6.h + +EXPORT_SYMS= YES + +.include diff --git a/sys/net/dummymbuf.c b/sys/net/dummymbuf.c new file mode 100644 index 000000000000..cb92889c5b77 --- /dev/null +++ b/sys/net/dummymbuf.c @@ -0,0 +1,436 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Igor Ostapenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* + * Separate sysctl sub-tree + */ + +SYSCTL_NODE(_net, OID_AUTO, dummymbuf, 0, NULL, + "Dummy mbuf sysctl"); + +/* + * Rules + */ + +static MALLOC_DEFINE(M_DUMMYMBUF_RULES, "dummymbuf_rules", + "dummymbuf rules string buffer"); + +#define RULES_MAXLEN 1024 +VNET_DEFINE_STATIC(char *, dmb_rules) = NULL; +#define V_dmb_rules VNET(dmb_rules) + +VNET_DEFINE_STATIC(struct sx, dmb_rules_lock); +#define V_dmb_rules_lock VNET(dmb_rules_lock) + +#define DMB_RULES_SLOCK() sx_slock(&V_dmb_rules_lock) +#define DMB_RULES_SUNLOCK() sx_sunlock(&V_dmb_rules_lock) +#define DMB_RULES_XLOCK() sx_xlock(&V_dmb_rules_lock) +#define DMB_RULES_XUNLOCK() sx_xunlock(&V_dmb_rules_lock) + +static int +dmb_sysctl_handle_rules(SYSCTL_HANDLER_ARGS) +{ + int error = 0; + char empty = '\0'; + char **rulesp = (char **)arg1; + + if (req->newptr == NULL) { + // read only + DMB_RULES_SLOCK(); + arg1 = *rulesp; + if (arg1 == NULL) { + arg1 = ∅ + arg2 = 0; + } + error = sysctl_handle_string(oidp, arg1, arg2, req); + DMB_RULES_SUNLOCK(); + } else { + // read and write + DMB_RULES_XLOCK(); + if (*rulesp == NULL) + *rulesp = malloc(arg2, M_DUMMYMBUF_RULES, M_WAITOK); + arg1 = *rulesp; + error = sysctl_handle_string(oidp, arg1, arg2, req); + DMB_RULES_XUNLOCK(); + } + + return (error); +} + +SYSCTL_PROC(_net_dummymbuf, OID_AUTO, rules, + CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(dmb_rules), RULES_MAXLEN, dmb_sysctl_handle_rules, "A", + "{inet | inet6 | ethernet} {in | out} [ ];" + " ...;"); + +/* + * Statistics + */ + +VNET_DEFINE_STATIC(counter_u64_t, dmb_hits); +#define V_dmb_hits VNET(dmb_hits) +SYSCTL_PROC(_net_dummymbuf, OID_AUTO, hits, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(dmb_hits), 0, sysctl_handle_counter_u64, + "QU", "Number of times a rule has been applied"); + +/* + * pfil(9) context + */ + +VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_inet_hook); +#define V_dmb_pfil_inet_hook VNET(dmb_pfil_inet_hook) + +VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_inet6_hook); +#define V_dmb_pfil_inet6_hook VNET(dmb_pfil_inet6_hook) + +VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_ethernet_hook); +#define V_dmb_pfil_ethernet_hook VNET(dmb_pfil_ethernet_hook) + +/* + * Logging + */ + +#define FEEDBACK(pfil_type, pfil_flags, ifp, rule, msg) \ + printf("dummymbuf: %s %b %s: %s: %.*s\n", \ + (pfil_type == PFIL_TYPE_IP4 ? "PFIL_TYPE_IP4" : \ + pfil_type == PFIL_TYPE_IP6 ? "PFIL_TYPE_IP6" : \ + pfil_type == PFIL_TYPE_ETHERNET ? "PFIL_TYPE_ETHERNET" : \ + "PFIL_TYPE_UNKNOWN"), \ + (pfil_flags), "\20\21PFIL_IN\22PFIL_OUT", \ + (ifp)->if_xname, \ + (msg), \ + (rule).syntax_len, (rule).syntax_begin \ + ) + +/* + * Internals + */ + +struct rule; +typedef struct mbuf * (*op_t)(struct mbuf *, struct rule *); +struct rule { + const char *syntax_begin; + int syntax_len; + int pfil_type; + int pfil_dir; + char ifname[IFNAMSIZ]; + op_t op; + const char *opargs; +}; + +static struct mbuf * +dmb_m_pull_head(struct mbuf *m, struct rule *rule) +{ + struct mbuf *n; + int count; + + count = (int)strtol(rule->opargs, NULL, 10); + if (count < 0 || count > MCLBYTES) + goto bad; + + if (!(m->m_flags & M_PKTHDR)) + goto bad; + if (m->m_pkthdr.len <= 0) + return (m); + if (count > m->m_pkthdr.len) + count = m->m_pkthdr.len; + + if ((n = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) + goto bad; + + m_move_pkthdr(n, m); + m_copydata(m, 0, count, n->m_ext.ext_buf); + n->m_len = count; + + m_adj(m, count); + n->m_next = m; + + return (n); + +bad: + m_freem(m); + return (NULL); +} + +static bool +read_rule(const char **cur, struct rule *rule) +{ + // {inet | inet6 | ethernet} {in | out} [ ]; + + rule->syntax_begin = NULL; + rule->syntax_len = 0; + + if (*cur == NULL) + return (false); + + // syntax_begin + while (**cur == ' ') + (*cur)++; + rule->syntax_begin = *cur; + + // syntax_len + char *delim = strchr(*cur, ';'); + if (delim == NULL) + return (false); + rule->syntax_len = (int)(delim - *cur + 1); + + // pfil_type + if (strstr(*cur, "inet6") == *cur) { + rule->pfil_type = PFIL_TYPE_IP6; + *cur += strlen("inet6"); + } else if (strstr(*cur, "inet") == *cur) { + rule->pfil_type = PFIL_TYPE_IP4; + *cur += strlen("inet"); + } else if (strstr(*cur, "ethernet")) { + rule->pfil_type = PFIL_TYPE_ETHERNET; + *cur += strlen("ethernet"); + } else { + return (false); + } + while (**cur == ' ') + (*cur)++; + + // pfil_dir + if (strstr(*cur, "in") == *cur) { + rule->pfil_dir = PFIL_IN; + *cur += strlen("in"); + } else if (strstr(*cur, "out") == *cur) { + rule->pfil_dir = PFIL_OUT; + *cur += strlen("out"); + } else { + return (false); + } + while (**cur == ' ') + (*cur)++; + + // ifname + char *sp = strchr(*cur, ' '); + if (sp == NULL || sp > delim) + return (false); + size_t len = sp - *cur; + if (len >= sizeof(rule->ifname)) + return (false); + strncpy(rule->ifname, *cur, len); + rule->ifname[len] = 0; + *cur = sp; + while (**cur == ' ') + (*cur)++; + + // opname + if (strstr(*cur, "pull-head") == *cur) { + rule->op = dmb_m_pull_head; + *cur += strlen("pull-head"); + } else { + return (false); + } + while (**cur == ' ') + (*cur)++; + + // opargs + if (*cur > delim) + return (false); + rule->opargs = *cur; + + *cur = delim + 1; + + return (true); +} + +static pfil_return_t +dmb_pfil_mbuf_chk(int pfil_type, struct mbuf **mp, struct ifnet *ifp, + int flags, void *ruleset, void *unused) +{ + struct mbuf *m = *mp; + const char *cursor; + bool parsed; + struct rule rule; + + DMB_RULES_SLOCK(); + cursor = V_dmb_rules; + while ((parsed = read_rule(&cursor, &rule))) { + if (rule.pfil_type == pfil_type && + rule.pfil_dir == (flags & rule.pfil_dir) && + strcmp(rule.ifname, ifp->if_xname) == 0) { + m = rule.op(m, &rule); + if (m == NULL) { + FEEDBACK(pfil_type, flags, ifp, rule, + "mbuf operation failed"); + break; + } + counter_u64_add(V_dmb_hits, 1); + } + if (strlen(cursor) == 0) + break; + } + if (!parsed) { + FEEDBACK(pfil_type, flags, ifp, rule, "rule parsing failed"); + m_freem(m); + m = NULL; + } + DMB_RULES_SUNLOCK(); + + if (m == NULL) { + *mp = NULL; + return (PFIL_DROPPED); + } + if (m != *mp) { + *mp = m; + return (PFIL_REALLOCED); + } + + return (PFIL_PASS); +} + +static pfil_return_t +dmb_pfil_inet_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, + void *ruleset, struct inpcb *inp) +{ + return (dmb_pfil_mbuf_chk(PFIL_TYPE_IP4, mp, ifp, flags, + ruleset, inp)); +} + +static pfil_return_t +dmb_pfil_inet6_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, + void *ruleset, struct inpcb *inp) +{ + return (dmb_pfil_mbuf_chk(PFIL_TYPE_IP6, mp, ifp, flags, + ruleset, inp)); +} + +static pfil_return_t +dmb_pfil_ethernet_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, + void *ruleset, struct inpcb *inp) +{ + return (dmb_pfil_mbuf_chk(PFIL_TYPE_ETHERNET, mp, ifp, flags, + ruleset, inp)); +} + +static void +dmb_pfil_init(void) +{ + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_modname = "dummymbuf", + .pa_flags = PFIL_IN | PFIL_OUT, + }; + +#ifdef INET + pha.pa_type = PFIL_TYPE_IP4; + pha.pa_mbuf_chk = dmb_pfil_inet_mbuf_chk; + pha.pa_rulname = "inet"; + V_dmb_pfil_inet_hook = pfil_add_hook(&pha); +#endif + +#ifdef INET6 + pha.pa_type = PFIL_TYPE_IP6; + pha.pa_mbuf_chk = dmb_pfil_inet6_mbuf_chk; + pha.pa_rulname = "inet6"; + V_dmb_pfil_inet6_hook = pfil_add_hook(&pha); +#endif + + pha.pa_type = PFIL_TYPE_ETHERNET; + pha.pa_mbuf_chk = dmb_pfil_ethernet_mbuf_chk; + pha.pa_rulname = "ethernet"; + V_dmb_pfil_ethernet_hook = pfil_add_hook(&pha); +} + +static void +dmb_pfil_uninit(void) +{ +#ifdef INET + pfil_remove_hook(V_dmb_pfil_inet_hook); +#endif + +#ifdef INET6 + pfil_remove_hook(V_dmb_pfil_inet6_hook); +#endif + + pfil_remove_hook(V_dmb_pfil_ethernet_hook); +} + +static void +vnet_dmb_init(void *unused __unused) +{ + sx_init(&V_dmb_rules_lock, "dummymbuf rules"); + V_dmb_hits = counter_u64_alloc(M_WAITOK); + dmb_pfil_init(); +} +VNET_SYSINIT(vnet_dmb_init, SI_SUB_PROTO_PFIL, SI_ORDER_ANY, + vnet_dmb_init, NULL); + +static void +vnet_dmb_uninit(void *unused __unused) +{ + dmb_pfil_uninit(); + counter_u64_free(V_dmb_hits); + sx_destroy(&V_dmb_rules_lock); + free(V_dmb_rules, M_DUMMYMBUF_RULES); +} +VNET_SYSUNINIT(vnet_dmb_uninit, SI_SUB_PROTO_PFIL, SI_ORDER_ANY, + vnet_dmb_uninit, NULL); + +static int +dmb_modevent(module_t mod __unused, int event, void *arg __unused) +{ + int error = 0; + + switch (event) { + case MOD_LOAD: + case MOD_UNLOAD: + break; + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +static moduledata_t dmb_mod = { + "dummymbuf", + dmb_modevent, + NULL +}; + +DECLARE_MODULE(dummymbuf, dmb_mod, SI_SUB_PROTO_PFIL, SI_ORDER_ANY); +MODULE_VERSION(dummymbuf, 1); From nobody Thu Aug 15 07:34:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wkxj92vKnz5T7T8; Thu, 15 Aug 2024 07:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wkxj921Ngz4Xv8; Thu, 15 Aug 2024 07:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723707293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gs+rlgyWp+21bJrvOAgmGbmjIcQxX0ekAEwfzMYar5U=; b=e4SUJVjJAfryihtNHNcEPlapdUfuKCuu7Qyo4GLtI+ltR3XQwyNpSRUiizLQLGRkFQ0tGh DiBWRfk7kaFACV+Y6Tv/HsR3TQnIrSRdFZ3TuwmHeYI1OvspC0hZWJ8lMxMpRWFYRhcBVp QUuMCnpqUlHFKuJCbj4UPOPnemFJ4uxUd7RjieDF4+Sx/5m72ev2M046qE4M7kP74I6rz0 eFxT4tL6X1GdsjEttQd+Qo0KBUWeoVLpI/LoWNp52Wefob4JnvFGs8GLJnEJi1yuspINNZ 3+W2vbUUDjqe1X7JT72qNlWRRivjRTFNWn2hHiVb2IMtp9KsPYasAodjjtQmuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723707293; a=rsa-sha256; cv=none; b=CO9Op9xvV0fjxCzhAlyI7uqfEn2RQDyvPHxCz+LSyIIcWwR1pdJVmth+bM5CfEF+3uOyuw gc2oLHzMyzdUCSXO8wNVXGzkk+SBoUUfRgbMiX31Y/NWJRz9HDvhyCMpMXpmuyUbrUEWM7 SRxQdu+mk3jcGDDAusX2ADAVYeHTCnAJhagttls9li5y71lpSagJlb7s/nV454qU4dx9al RBR1ikGCEIAKoC7Iybvn50zgEHJYBJf7KTpiDPnvhzT6GnpNBBn4d+HGuM/lvIpOjTOuVj CNBb6S3CVUOuveWMJHsel44GLY9D+zNuPDuiqtMoqnI7c9tXXjjBfBBXpuHOVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723707293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gs+rlgyWp+21bJrvOAgmGbmjIcQxX0ekAEwfzMYar5U=; b=wvj9E6Qg8AYo9DwBlCGo4e58f3peO08FdU7CMEc1M+05NWJoQTb5YaKJl5ZSP1evt3wXJm xg7d6s9TNSXqwR6re4qnLNOHV4JuGAUM/N2SkrNyki+6NNAFxD7ZTA4ooylj8+DqknDEqp j3M6y76y6+0Ozm5e945ZG1ZEMaSjHa5dG27DhkKEQ5TiPLkAPTfu2p7PQdApsfRYXAxYz5 UJr0qZmq2QniQZrGrZa8EoWyKv1p8wGf+1xEbYcY11HfIIKEKUt9qCwGVFlnkMdeMDDruD MjR0RpA5nejTaIFdWziaCnrx+lyF8MIP80gPN3pF1IVbc0j8kdbQHRog4AUMnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wkxj91F2dz1SMZ; Thu, 15 Aug 2024 07:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47F7YrFD015334; Thu, 15 Aug 2024 07:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47F7YrkV015330; Thu, 15 Aug 2024 07:34:53 GMT (envelope-from git) Date: Thu, 15 Aug 2024 07:34:53 GMT Message-Id: <202408150734.47F7YrkV015330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 09b7a038628c - main - pf tests: Add 'mbuf' test for (*m0)->m_len < sizeof(struct ip) cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09b7a038628c65cab6d6ca27f640d818af8822f5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09b7a038628c65cab6d6ca27f640d818af8822f5 commit 09b7a038628c65cab6d6ca27f640d818af8822f5 Author: Igor Ostapenko AuthorDate: 2024-08-14 12:47:28 +0000 Commit: Kristof Provost CommitDate: 2024-08-15 07:28:13 +0000 pf tests: Add 'mbuf' test for (*m0)->m_len < sizeof(struct ip) cases Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45927 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/mbuf.sh | 97 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index f4dd36d9e35d..4a16642a967b 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -24,6 +24,7 @@ ATF_TESTS_SH+= altq \ macro \ map_e \ match \ + mbuf \ modulate \ names \ nat \ diff --git a/tests/sys/netpfil/pf/mbuf.sh b/tests/sys/netpfil/pf/mbuf.sh new file mode 100644 index 000000000000..082de08b0838 --- /dev/null +++ b/tests/sys/netpfil/pf/mbuf.sh @@ -0,0 +1,97 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Igor Ostapenko +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +dummymbuf_init() +{ + if ! kldstat -q -m dummymbuf; then + atf_skip "This test requires dummymbuf" + fi +} + +atf_test_case "inet_in_mbuf_len" "cleanup" +inet_in_mbuf_len_head() +{ + atf_set descr 'Test that pf can handle inbound with the first mbuf with m_len < sizeof(struct ip)' + atf_set require.user root +} +inet_in_mbuf_len_body() +{ + pft_init + dummymbuf_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + # Set up a simple jail with one interface + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + + # Should be denied + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" + atf_check -s not-exit:0 -o ignore ping -c1 -t1 192.0.2.2 + + # Should be allowed by from/to addresses + pft_set_rules alcatraz \ + "block" \ + "pass in from 192.0.2.1 to 192.0.2.2" + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + + # Should still work for m_len=0 + jexec alcatraz pfilctl link -i dummymbuf:inet inet + jexec alcatraz sysctl net.dummymbuf.rules="inet in ${epair}b pull-head 0;" + atf_check_equal "0" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=1 + jexec alcatraz sysctl net.dummymbuf.rules="inet in ${epair}b pull-head 1;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=19 + # provided IPv4 basic header is 20 bytes long, it should impact the dst addr + jexec alcatraz sysctl net.dummymbuf.rules="inet in ${epair}b pull-head 19;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" +} +inet_in_mbuf_len_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "inet_in_mbuf_len" +} From nobody Thu Aug 15 08:31:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkyyV3kl7z5TCWL; Thu, 15 Aug 2024 08:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkyyV3FDRz4crl; Thu, 15 Aug 2024 08:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723710690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ettN/jbxW3cqqTUWpWXgNXrlnshvlT9hlFqA+Ugcik4=; b=oZTmBZSQVHSIhJqrzg+uzbJX20WrZ5yT+5otRwcW15m+2XtgUD2b8Fqm4GLRCq5K1UPEWo n4cgxRJOrROE4FVyE1GJ0sLZBwZhdk+G9A6HGtRdxJ5yype2lwRAM93qxee1spcuLFkcMa MVom8wJk8fJS3oOKl2xLYnIo94TqeRLt7n1RWlUcCC57sv0Fqg1MUJoFsgedgyXk94DgsW tPtjXOpE94ERbyrHCUlFiI0f/WbS185iM07Y1IuvdqeW5wXCPJd62OI1okzI9ZDAPXe4fZ 6S1Z38SSSiL11xS96mgzpPwWNi82IQmzsgnJ3U9nWRC7QhHhl+psUx7FD1JRfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723710690; a=rsa-sha256; cv=none; b=O0NPwX5J4IETH45/H7F4PZp/w32uyZYsLCYDhJqsrAqWq582t+QHksjqOoCfZawMGR+Yx1 SDElBOeqIiUuWYBvDCQDyNe4oOCunQdKbw9eKkVJRH59W2xjYPLfph6o11m5JJPyLX2mDu UYfOsJfGpdCTPQRFqT3vHGZUffe8IoS1Cum+E24Bw0pQKYcn7LSlUh1JGWLSNwH7Xq/g9W yw5yClFspzFwf166q62WNsPg1d5/rvLlZdn1WJ5uV+wtIeIqs59SG+lAtCZsU3kkaLyQRE U8U3Cz6ywAGu15KaHi8fWhF5SXQeDCfavs6ofaQLk/GzIW3/+mzv1O1a3zvBZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723710690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ettN/jbxW3cqqTUWpWXgNXrlnshvlT9hlFqA+Ugcik4=; b=idQvQv2v8wHW3LImnIagxhyugIvpFk2iKd3ifWw8lrV8K9Sl72EDkTCfyFH3mkY2zznbMj FHuM5hx4ewsDz4BRiMeQ6Y7PZMU4DNExeBi4K8nTIkFoN9v0gYkW17z6pL5hdekrLWq9hI pIuWKCMH7yCTMFqpZgfMaBiSKlcoUnLrAIqbc8x8ayzjX2WYKivV1oDEMnkyPp+H3UboYs DSYtXH60COb6LCUz7+/PBmhubEW2SXjk/VFNhI8YMzNFXfP138PU6idHx8WS/fUzSqA08l JuKaIS03nqnfpSsTsGuVeUkHtchlR8W2L5CzEr3Do2wzzsEnSQXvzZhfOGf5cA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkyyV2mWbzGJM; Thu, 15 Aug 2024 08:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47F8VU9I014251; Thu, 15 Aug 2024 08:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47F8VUet014248; Thu, 15 Aug 2024 08:31:30 GMT (envelope-from git) Date: Thu, 15 Aug 2024 08:31:30 GMT Message-Id: <202408150831.47F8VUet014248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6c479edc6164 - main - pf: Fix indentation in struct pf_ksrc_node List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c479edc6164fec696c534962bdda04fe21437e3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6c479edc6164fec696c534962bdda04fe21437e3 commit 6c479edc6164fec696c534962bdda04fe21437e3 Author: Kajetan Staszkiewicz AuthorDate: 2024-08-15 07:35:41 +0000 Commit: Kristof Provost CommitDate: 2024-08-15 07:36:18 +0000 pf: Fix indentation in struct pf_ksrc_node This is a purely cosmetic change to simplify future diffs. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46298 --- sys/net/pfvar.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index eecd61f960c8..eeded1e900a6 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -884,21 +884,21 @@ SLIST_HEAD(pf_krule_slist, pf_krule_item); struct pf_ksrc_node { LIST_ENTRY(pf_ksrc_node) entry; - struct pf_addr addr; - struct pf_addr raddr; + struct pf_addr addr; + struct pf_addr raddr; struct pf_krule_slist match_rules; - union pf_krule_ptr rule; - struct pfi_kkif *rkif; - counter_u64_t bytes[2]; - counter_u64_t packets[2]; - u_int32_t states; - u_int32_t conn; - struct pf_threshold conn_rate; - u_int32_t creation; - u_int32_t expire; - sa_family_t af; - u_int8_t ruletype; - struct mtx *lock; + union pf_krule_ptr rule; + struct pfi_kkif *rkif; + counter_u64_t bytes[2]; + counter_u64_t packets[2]; + u_int32_t states; + u_int32_t conn; + struct pf_threshold conn_rate; + u_int32_t creation; + u_int32_t expire; + sa_family_t af; + u_int8_t ruletype; + struct mtx *lock; }; #endif From nobody Thu Aug 15 11:06:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wl2PM6hDLz5TQGh; Thu, 15 Aug 2024 11:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wl2PM69MKz4qlB; Thu, 15 Aug 2024 11:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723719991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=feQj4IQ+h67+RefTjCJj4emoat8Cy201wxUmoVsBU2E=; b=cSA9bfmfjMciAP4bvHRD/SJ2jqpYPd/rBXLEadp0RB0d9hcZ4+7Wr3e4x9kvUeqt2gWuNr W6vQniaHeHUtRGabVY1yN0FTPu072Ag1h/bnV1hFDsO8p0fa90xXFyHtbCT83u0NB4jejy aXIfC1uE+Ythzq94yblvrXrlOKZWKXAbnPVUAyeWL/U/1Gc+4opupr3XMRXEd7/7TtbbGy UTftzb0tNDojhSbONTgigh6wYEzZqKz0KJM+yqGBL5Mu/+sNGg99tUp+f4UVHcZryrgRTP JUKQyLySpnfd9llBQ+82QaOT3bWjQKuUfMBaCHV2DNmivJCkJZny/+OYm+ddWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723719991; a=rsa-sha256; cv=none; b=MddEq5qdK633JL3TBAiyd4oUeXN9XbpwFJGJ/YRaFSNb1HEF3GgX7HEG36oQqG639j+3vg as7tBhrb9UYV1dKiwzshFvqCirrCkU7zwQPe2wbPq1aq8ZnUnBKiHivH+1WUtL4u9F96av GacxjpicvBa1RcV4grLjPwOTnumO2Va2gtn+faOC20EFokpgtpAiBUoCI+OaqNDx/DxKOE naKa+8Sg1tEYj5Eb1MJpXSAZ4FEmv1Z+7nf1thDjxAUITLv1YB1qpSvStAXeHxZ8FRdeSx Qw4aYcLWN2MQDk+8zvaHwOIyGXekD7m6IHzNFSlm7W4J58A1qtl0ypdgn/BQtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723719991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=feQj4IQ+h67+RefTjCJj4emoat8Cy201wxUmoVsBU2E=; b=oc0G0OUWOIhRcBL/uDdc7Pcg+a6j+bXs0d2Y+KWWK8H83e3NFen/oj+qX53AbA5yXxQFFF QAsqDFb2ud5+dosRcgmlpgG3w6ABmDKlXH1l6qJUHyZwan+K3femrV3GYu490aGLr9T/Cb BnHVWCA+5SazEc5N210BJTW9IeFYWsVm4MJgYSUBznUBsnhifpmWgi49O2m0KIgS9/E4GV X4TXj8jRw2qZzvP5YtHl7NRmOkpXfMr6V8xxZXsYDIUmCC4VIjHy1pv8WkfkPMcWfnM2hX 13esXtsc7aImi6X4lu+tHn67Mafy8Os5lA7c6Il3oVGs6YBIEuOFQAJrYzVIMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wl2PM5mg5zKrd; Thu, 15 Aug 2024 11:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FB6VGZ070891; Thu, 15 Aug 2024 11:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FB6Vc0070888; Thu, 15 Aug 2024 11:06:31 GMT (envelope-from git) Date: Thu, 15 Aug 2024 11:06:31 GMT Message-Id: <202408151106.47FB6Vc0070888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1fc0dac54cb4 - main - pf: Convert struct pf_addr_wrap before sending it over netlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fc0dac54cb444d6c22102d7bbc23545de459e0f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc0dac54cb444d6c22102d7bbc23545de459e0f commit 1fc0dac54cb444d6c22102d7bbc23545de459e0f Author: Kajetan Staszkiewicz AuthorDate: 2024-08-15 09:07:27 +0000 Commit: Kristof Provost CommitDate: 2024-08-15 09:11:59 +0000 pf: Convert struct pf_addr_wrap before sending it over netlink The struct pf_addr_wrap when used inside of kernel operates on pointers to tables or interfaces. When reading a ruleset the struct must contain counters calculated from the aforementioned tables and interfaces. Both the pointers and the resulting counters are stored in an union and thus can't be present in the struct at the same time. The original ioctl code handles this by making a copy of struct pf_addr_wrap for pool addresses, accessing the table or interface structures by their pointers, calculating the counter values and storing them in place of those pointers in the copy. Then this copy is sent over ioctl. Use this mechanism for netlink too. Create a copy of src/dst addresses. Use the existing function pf_addr_copyout() to convert pointers to counters both for src/dst and pool addresses. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46291 --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 3 +-- sys/netpfil/pf/pf_nl.c | 23 +++++++---------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index eeded1e900a6..863883c2d61e 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2533,6 +2533,7 @@ int pf_ioctl_get_addr(struct pfioc_pooladdr *); void pf_krule_free(struct pf_krule *); void pf_krule_clear_counters(struct pf_krule *); +void pf_addr_copyout(struct pf_addr_wrap *); #endif /* The fingerprint functions can be linked into userland programs (tcpdump) */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 959ebdf94cd4..5467ebbed2eb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -129,7 +129,6 @@ static void pf_hash_rule_addr(MD5_CTX *, struct pf_rule_addr *); static int pf_commit_rules(u_int32_t, int, char *); static int pf_addr_setup(struct pf_kruleset *, struct pf_addr_wrap *, sa_family_t); -static void pf_addr_copyout(struct pf_addr_wrap *); static void pf_src_node_copy(const struct pf_ksrc_node *, struct pf_src_node *); #ifdef ALTQ @@ -1525,7 +1524,7 @@ pf_addr_setup(struct pf_kruleset *ruleset, struct pf_addr_wrap *addr, return (error); } -static void +void pf_addr_copyout(struct pf_addr_wrap *addr) { diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 060cd5e39852..6e752159b4bd 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -416,7 +416,6 @@ static bool nlattr_add_addr_wrap(struct nl_writer *nw, int attrtype, struct pf_addr_wrap *a) { int off = nlattr_add_nested(nw, attrtype); - int num; nlattr_add_in6_addr(nw, PF_AT_ADDR, &a->v.a.addr.v6); nlattr_add_in6_addr(nw, PF_AT_MASK, &a->v.a.mask.v6); @@ -425,22 +424,10 @@ nlattr_add_addr_wrap(struct nl_writer *nw, int attrtype, struct pf_addr_wrap *a) if (a->type == PF_ADDR_DYNIFTL) { nlattr_add_string(nw, PF_AT_IFNAME, a->v.ifname); - num = 0; - if (a->p.dyn != NULL) - num = a->p.dyn->pfid_acnt4 + a->p.dyn->pfid_acnt6; - nlattr_add_u32(nw, PF_AT_DYNCNT, num); + nlattr_add_u32(nw, PF_AT_DYNCNT, a->p.dyncnt); } else if (a->type == PF_ADDR_TABLE) { - struct pfr_ktable *kt; - nlattr_add_string(nw, PF_AT_TABLENAME, a->v.tblname); - num = -1; - kt = a->p.tbl; - if ((kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && - kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) - num = kt->pfrkt_cnt; - nlattr_add_u32(nw, PF_AT_TBLCNT, num); + nlattr_add_u32(nw, PF_AT_TBLCNT, a->p.tblcnt); } nlattr_set_len(nw, off); @@ -462,9 +449,13 @@ NL_DECLARE_ATTR_PARSER(rule_addr_parser, nla_p_ruleaddr); static bool nlattr_add_rule_addr(struct nl_writer *nw, int attrtype, struct pf_rule_addr *r) { + struct pf_addr_wrap aw = {0}; int off = nlattr_add_nested(nw, attrtype); - nlattr_add_addr_wrap(nw, PF_RAT_ADDR, &r->addr); + bcopy(&(r->addr), &aw, sizeof(struct pf_addr_wrap)); + pf_addr_copyout(&aw); + + nlattr_add_addr_wrap(nw, PF_RAT_ADDR, &aw); nlattr_add_u16(nw, PF_RAT_SRC_PORT, r->port[0]); nlattr_add_u16(nw, PF_RAT_DST_PORT, r->port[1]); nlattr_add_u8(nw, PF_RAT_NEG, r->neg); From nobody Thu Aug 15 11:06:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wl2PP2KpYz5TQdj; Thu, 15 Aug 2024 11:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wl2PP02rqz4qlC; Thu, 15 Aug 2024 11:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723719993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cYpMFzdkYQo/jdogrvko7COgV1nXWAK1FnDv39jOtGk=; b=HKC+mU5DA9qYyEXjfC7nI35pSFvyRIxfjdqS9QOXI4FzEL07JrNACt2XfIwhp/JZW/1r0s 28qvpBsllHXSEsqJOrQL2bhXSr2bfIya3jwNG9FbNiafJ+UZaU70x34VkrB/sB6D30FSEU aMs86yg0rhrb5XAOvGOZwiDPhwavo6cEdbczn58DpNFaw3NMG5fEhn1zkNQFMVLW7Id7T9 GVNRIRhJgZRIZ/t9om1eKaKYqNfOOeiY3pcw+onCyup56p3NVewCM8/gj0irw8tLux+EDP b4CA7NipOLGK8Fve6rMdL2hVZBICnKhWFAamBUuGt1ZsppxsHse7TtKQhhVsxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723719993; a=rsa-sha256; cv=none; b=aWdF/o6/qLeSzxBXHO/lSuQDKD61E8Nb2HtmbS43dTZUoHAQXV0ti9z8Ih7jpFu3irZkcB GZqGykY9t8ws3pUQGAd4LMn1LYPyPARsusXc6+tEjQPOET0o8/uc2TP+MKb6WicUF431VJ siiow6khF1m3V9Kb5pOq9ynOiJU9hgyEt74lhH4Ta9SLvi6WDkRrGj1DE8tIFRGF8Cxwcv Dxms3ApXgeXWLIJUqFUQA+HBm5Gdl5/zSedfOBLshZga7J9OjPPE0cK/V2O/YkFlKy1JWa p6Wi+VW+smSrwZ+f7aZlDjo7XD7F8rY0HdRwTQr428VZYsDiXPAqDKMcSjS88g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723719993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cYpMFzdkYQo/jdogrvko7COgV1nXWAK1FnDv39jOtGk=; b=qmKace9Nn1C8p+V+eb2XFXg6dwZlrRvi1RbRs/1QTjsSp/qeP0+aVRRPm7Xu6tz7gSxJkp ywhEHhfb14gE24Cme0SQmuYJziYrI4sfdedkwQdyWXy/fHoXQFLh/NqM2dWoAFQh+7HSmX hiJF8Gu2pT8GE0IJlOca2HBPwjUjpoNwP4WTSf1wpZ83fygQOALLstaWhbj4PcPqqwPGiC bHmVrpygeBl+/MsQoDwGtd/xz3t1YHe0S+UYMreJWta9H1cnI90S5b6t2ljpBPY4u6BP62 QMPvsr4IT3mQteyHr3py+guNEBN2BrUqKqw8JXGq0txATAR7iSG6+hqSud93gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wl2PN6ln0zKrf; Thu, 15 Aug 2024 11:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FB6Wx9070952; Thu, 15 Aug 2024 11:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FB6WqQ070949; Thu, 15 Aug 2024 11:06:32 GMT (envelope-from git) Date: Thu, 15 Aug 2024 11:06:32 GMT Message-Id: <202408151106.47FB6WqQ070949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9aeee9486a07 - main - pf tests: basic test for sticky-address configuration on rules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9aeee9486a07078698d65f254d7b414abd96cfff Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9aeee9486a07078698d65f254d7b414abd96cfff commit 9aeee9486a07078698d65f254d7b414abd96cfff Author: Kristof Provost AuthorDate: 2024-08-15 09:10:09 +0000 Commit: Kristof Provost CommitDate: 2024-08-15 09:11:59 +0000 pf tests: basic test for sticky-address configuration on rules There was a bug in pf_handle_get_addr() where it confused the counter and pointer in the pf_addr_wrap.p union, causing panics. Test for this. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/route_to.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 5f47cea39b01..305ca4c8eddd 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -786,6 +786,30 @@ dummynet_double_cleanup() pft_cleanup } +atf_test_case "sticky" "cleanup" +sticky_head() +{ + atf_set descr 'Set and retrieve a rule with sticky-address' + atf_set require.user root +} + +sticky_body() +{ + pft_init + + vnet_mkjail alcatraz + + pft_set_rules alcatraz \ + "pass in quick log on n_test_h_rtr route-to (n_srv_h_rtr ) sticky-address from any to keep state" + + jexec alcatraz pfctl -qvvsr +} + +sticky_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" @@ -802,4 +826,5 @@ atf_init_test_cases() atf_add_test_case "ifbound_reply_to_rdr_dummynet" atf_add_test_case "dummynet_frag" atf_add_test_case "dummynet_double" + atf_add_test_case "sticky" } From nobody Thu Aug 15 11:41:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wl39G0ffmz5TT3Z; Thu, 15 Aug 2024 11:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wl39G065jz4vKx; Thu, 15 Aug 2024 11:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723722066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+jkQh8ciJj7dtTRceaeR/6Jpw81nJHqH2mkoJxhnosw=; b=sflDy7z4ku26Fyp+MA0l3whp/ptyhN/2VF04RMczpX4H81Q9wUYmjfKBsMKYkSVhjG/BsM H0n5CuKmX3oWHTB+8pY8q/qlu8q1bUrdIq4PXbZww6i/XPL12CyvpbZACd/VgrxFFUO54H Abq88fYsyXo/U1imIWpErShG9KoqHhpVWfPoZmyOzphkmhwfzxEQ6vSi1eiZvRDPjtaomt wf6SXPeK70erJlw2iyKjw81f711xkEDmvyTgvb+3nREP31xER+VM7wX2vRldljOfHXKqfm DpfpbGnRAqPDSLvzpsbgU4C/YywQPn7IUey0NnqbJHpY9V34mqjIU4st7QsYHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723722066; a=rsa-sha256; cv=none; b=gUo1lB5EdByUuoTsS529DR1lYwDC+ag9MrMfDIuLn1Ty77nK1Z2beaq+1CObzm39HQ4KGl 7TWf2dOPtw0LkamHlOLGzA3JrAHo1z8sMLYo7lgtS8WChR68VIt24LgpOepPDkHBy1Ya58 Z06iB8+HrKItHtMgiVTadjlPu/P262/276/AUBbjPSyHuh7neOjdJlh8ZyS+BI8U1LCUuO Rgggz62OqxrFPCDd9TNplGvpm1P2zZKzAaBX3fas5qgctzPWJAjjlNpo06nHDAbEI+fRri c1q8G6JwQZ46w9GaiII1dE2Gm1JQiq8oL/qtWW4YldE1l+ErVF3GA1QGCG9AEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723722066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+jkQh8ciJj7dtTRceaeR/6Jpw81nJHqH2mkoJxhnosw=; b=cPqxe8P3r1Ij+CKR4yjpeTXJrUHUxgsK3toMKG+E6TrSD17vJfeC6H2eVRO7IIv5K0xtOn JqGMIFdn1mg8bTNz45eJTlzvN0N2rtu1FHru2DCci4wgfnYKTLTL/v+ELBfB+8EBkywGTZ JUhI5wRqJwXfMhV8HK61U/hIKIsRZRSxqycUE6YDuKhrOwg74Z107yRtPIeOeQ+F/DomhM VIxdWzrbmYefyLlIeAFhi29U7RwcN3b6rL+HmpX99eH6L+tbSSbM9GqkvKmSDCWKyeGqak P6Ub4zxXgsLCyVMKuY+3mx3hC+HxPe32+OFzfmYgP8dPLf4iTbl8FWqNLNbo3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wl39F6qr6zKtP; Thu, 15 Aug 2024 11:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FBf5ht030697; Thu, 15 Aug 2024 11:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FBf3X8030694; Thu, 15 Aug 2024 11:41:03 GMT (envelope-from git) Date: Thu, 15 Aug 2024 11:41:03 GMT Message-Id: <202408151141.47FBf3X8030694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 29dc93491496 - main - zfs: merge openzfs/zfs@d2ccc2155 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 29dc9349149657d6f00f1f5fc3ade589525e0d38 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=29dc9349149657d6f00f1f5fc3ade589525e0d38 commit 29dc9349149657d6f00f1f5fc3ade589525e0d38 Merge: 9aeee9486a07 d2ccc2155217 Author: Martin Matuska AuthorDate: 2024-08-15 11:24:01 +0000 Commit: Martin Matuska CommitDate: 2024-08-15 11:30:31 +0000 zfs: merge openzfs/zfs@d2ccc2155 Notable upstream pull request merges: #16431 244ea5c48 Add missing kstats to dataset kstats Obtained from: OpenZFS OpenZFS commit: d2ccc2155217bfdd7e19db4480d981a8f3fad46f sys/contrib/openzfs/config/kernel-blk-queue.m4 | 28 +++++++ .../openzfs/config/kernel-make-request-fn.m4 | 21 ++++++ sys/contrib/openzfs/config/kernel-mm-page-size.m4 | 17 ----- sys/contrib/openzfs/config/kernel-mm-pagemap.m4 | 36 +++++++++ .../openzfs/config/kernel-register_sysctl_table.m4 | 59 +++++++++++++++ sys/contrib/openzfs/config/kernel.m4 | 6 ++ .../include/os/linux/kernel/linux/blkdev_compat.h | 35 +++++---- .../include/os/linux/kernel/linux/mm_compat.h | 7 ++ sys/contrib/openzfs/module/os/linux/spl/spl-proc.c | 53 ++++++++++++-- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 29 ++++++-- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 85 +++++++++++++++++----- .../functional/alloc_class/alloc_class.kshlib | 2 +- .../block_cloning/block_cloning_rlimit_fsize.ksh | 2 +- .../functional/fault/suspend_resume_single.ksh | 2 +- .../upgrade/upgrade_projectquota_001_pos.ksh | 19 ++++- sys/modules/zfs/zfs_config.h | 19 ++++- sys/modules/zfs/zfs_gitrev.h | 2 +- 17 files changed, 350 insertions(+), 72 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-mm-pagemap.m4 index 000000000000,466b6fa07d9a..466b6fa07d9a mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-mm-pagemap.m4 +++ b/sys/contrib/openzfs/config/kernel-mm-pagemap.m4 diff --cc sys/modules/zfs/zfs_config.h index 631c83fe8bab,000000000000..2508de5421df mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1239 -1,0 +1,1254 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + ++/* struct queue_limits has a features field */ ++/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ ++ +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + ++/* backing_dev_info is available through queue gendisk */ ++/* #undef HAVE_BLK_QUEUE_DISK_BDI */ ++ +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* strscpy() exists */ +/* #undef HAVE_KERNEL_STRSCPY */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + ++/* page_mapping() is available */ ++/* #undef HAVE_MM_PAGE_MAPPING */ ++ +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + ++/* proc_handler ctl_table arg is const */ ++/* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ ++ +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + ++/* register_sysctl_sz exists */ ++/* #undef HAVE_REGISTER_SYSCTL_SZ */ ++ +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the 'strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the 'strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + *** 326 LINES SKIPPED *** From nobody Thu Aug 15 13:34:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wl5hP550pz5S9vb; Thu, 15 Aug 2024 13:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wl5hP4b4pz4JsC; Thu, 15 Aug 2024 13:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723728885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EW3Dce21yklfbvrPR8mbxfcaYW7atXOojvwt54lot0w=; b=srlV97yw88drshm/SLmicXO8a/hZFSMO1fxN83YgQKgD4U8EQ3Wc2LMS0Sy7hmRy9vm6hj Rp1IX6px42xu55T/nH8h3PYREey4PAaSLiuRdXpvQG0eLOsBORLfgMyfUokW1KkJwWyi89 5rR2RJS0A7Jw0ieHkr8fCZKyP8yYuU6dPxP0vZbabyOl4RX6z55HBmMC7Tndqnb+ryz52n RmyiI7rwxkOSlGfWiuIV/O+0tEhItVo8jtdWmPJMhpEaWtlhPEktUDsE6mcXbe9X64OkRC gllRZ8DhtS08pckFRVQphDxMZ10tsPVYKbQ8n+GxhARCgg/yRWCb1i2nWq9+Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723728885; a=rsa-sha256; cv=none; b=DL5NKw69ZR7WPDVltvZw81cOGIuYDGDQwrSB6SrPkNAUDCMKNXxm6lwCkwCUg2TdrPE8LN WLhuGQL6d2KqAHfX0eize7MCQfiNPhxAGk5tP62ZIq6x/yyrFdP32FN17IL1FyuqMwry6x heeJRG4Ca7WoJ9w7JLi2yOcJyj7oXdhG1102Xo6tksQSnoa9nHM253TXyv60PdSCgCIBid CvbsieetQ8kvAHE6gLIKaINhk+jWHa5Ufgl7XmXIe351E8rj7TelewPYN30dFs4082dlSq Hcj/Fc+1HIzMSdbfxVXd0HJ7JyQT1HrWQ3VzR59JG32a438goL+eXUFEv9O7gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723728885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EW3Dce21yklfbvrPR8mbxfcaYW7atXOojvwt54lot0w=; b=iA4krkkSpFsoHfiXRWJQsVBu8ZhkzAHQwpo/qwfZDxEL2BCjQ9YJqgM1r2of2jnVY/YMI2 9phsfkc+EBdaisMrTI9TBMlc165xV2idTvWFN0iliqszRB8ewzMF/9O/SaVndWuFKmyvQX OmyyadLKBF5L5BVPo4VMMtcDUi5doh/ai15/XSdS19oGAPa/im/TLwfnjeSbWyZLPYGxzw AkLN2D19ob1MDOVzaOEQmvXsRwb8pJzJMoRF7t3qBl53vx0McwvU4aJ7gXlF55zkAI6SLv TpkOGbF7Y3nj0iHvOE2Kzk1CYtgcSBEYQn+79CQ3LSmyQcOThtdVnsuST/ZCbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wl5hP3hRkzPX8; Thu, 15 Aug 2024 13:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FDYjnE031428; Thu, 15 Aug 2024 13:34:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FDYjrf031425; Thu, 15 Aug 2024 13:34:45 GMT (envelope-from git) Date: Thu, 15 Aug 2024 13:34:45 GMT Message-Id: <202408151334.47FDYjrf031425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: 8cc528c682d7 - main - tcp cc: clean up some un-used cc_var flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cc528c682d7560303415c18274f151e415658f1 Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=8cc528c682d7560303415c18274f151e415658f1 commit 8cc528c682d7560303415c18274f151e415658f1 Author: Cheng Cui AuthorDate: 2024-08-14 19:30:10 +0000 Commit: Cheng Cui CommitDate: 2024-08-15 13:33:04 +0000 tcp cc: clean up some un-used cc_var flags Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D46299 --- sys/netinet/cc/cc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index 63381f4b5ca3..d78c61bde2fe 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -104,10 +104,10 @@ struct cc_var { #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ -#define CCF_MAX_CWND 0x0040 /* Have we reached maximum cwnd? */ -#define CCF_CHG_MAX_CWND 0x0080 /* CUBIC max_cwnd changed, for K */ -#define CCF_USR_IWND 0x0100 /* User specified initial window */ -#define CCF_USR_IWND_INIT_NSEG 0x0200 /* Convert segs to bytes on conn init */ +#define CCF_UNUSED1 0x0040 +#define CCF_UNUSED2 0x0080 +#define CCF_UNUSED3 0x0100 +#define CCF_UNUSED4 0x0200 #define CCF_HYSTART_ALLOWED 0x0400 /* If the CC supports it Hystart is allowed */ #define CCF_HYSTART_CAN_SH_CWND 0x0800 /* Can hystart when going CSS -> CA slam the cwnd */ #define CCF_HYSTART_CONS_SSTH 0x1000 /* Should hystart use the more conservative ssthresh */ From nobody Thu Aug 15 14:21:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wl6kr2wl9z5SFKg; Thu, 15 Aug 2024 14:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wl6kr0r4Hz4NF9; Thu, 15 Aug 2024 14:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723731716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5AZahXWTbqSlEcQcD04VJeFVTRUPcdj0me9zN73VcM=; b=KpcNJGn5hC+KJxSutolxt7EibL1Kj5e42WkC31EL91/gYCwPma/i1qS4jfpIKAcwIxq3pF CZxPAkr+ESC/2IYmkXvN3RZTeSaZO8LbXBavSZfyL1HRte+J3jH8Drxxrj+6mhTfR/I4yq 4K5HRtMoT1cbDq3uDSSEQf+nckwuxXa70FE+wTmuOvuituexvi503MlkoxtJBbqYWvayXh dUW5C/RreXkgg01MBLkFhUWgnYTrmEWVvS26TqXTXxsOeWCu/jPMGAXo/SO+hr7B7tt6yP 2AuKpij97NOgGlvJwQ6/nz2BFrsQIMP0Epc9TD85+082P8f02AiKB2dvYO/ESg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723731716; a=rsa-sha256; cv=none; b=eMBRlnoOnT1M0hRBH3nImzdOMcSR+32UFn+fP6OK6GqzNGuVosZidQGD2P7PrL5o7/+4pK RCrYWU8bKfBzW60MQgMI0hi0F4hRmJl7wGlZHzx/eYpjSeEFnHFNQTwfVNz5O3WJGzEH0o 8xPYBmrLlgKcigHp5BeHb6zxLCjplTd1xz3/Gmdq0JitTCH6mNGqHjsbmq3ieQKXsKoN5u j0tAybb9Aj1y8wsmelxnRDRAyulxjH440Koh/aYPXMJJFfAgL91v7z+RnhkQHzfpWGR5uG vMTCsR8lNKDfhx9T9x5ZUBlhfXZfOZju+u41HHjM6ntJP4g6LCjmdw/Udim8yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723731716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5AZahXWTbqSlEcQcD04VJeFVTRUPcdj0me9zN73VcM=; b=deJK+e7fW7ERw5qAu3JU144rcGJ7JzJWGnxhemkuzaGx50d6aaRoZfT7/Se7STvQ5Pj0eQ jVf9rwhEC0kVrxYlul4Oin8rIdxsRqREB7shBHonQJn6YAWVdXq7mzaxIKqp/GJdigkSm5 9NAPLQZdpFTCdvUouQwohVoJ/NYB8Ubc0vumi1/ZjfFwej0zzMlQb2zrBETbfXaScalR2o sSdeeP3Z/6pEmplJqxTERBdrnt/u1GtfCmXWxIUOjoCPHuE4MHiu0NQzMsdfFITLGtZkM7 uQ8R859Ivk1y3WUP/B2sMmhNCo3dpyh2wnxOg5H2W97WdwFHF7QipwFuC0a4Pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wl6kr0RmBzQnG; Thu, 15 Aug 2024 14:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FELtFC012874; Thu, 15 Aug 2024 14:21:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FELtiv012871; Thu, 15 Aug 2024 14:21:55 GMT (envelope-from git) Date: Thu, 15 Aug 2024 14:21:55 GMT Message-Id: <202408151421.47FELtiv012871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bef079254f3d - main - arm64: Clamp segment sizes properly in bounce_bus_dmamap_load_buffer() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bef079254f3dcf443a61b4c2605cc6e2dcaf043f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bef079254f3dcf443a61b4c2605cc6e2dcaf043f commit bef079254f3dcf443a61b4c2605cc6e2dcaf043f Author: Mark Johnston AuthorDate: 2024-08-15 14:17:40 +0000 Commit: Mark Johnston CommitDate: 2024-08-15 14:19:22 +0000 arm64: Clamp segment sizes properly in bounce_bus_dmamap_load_buffer() Commit 099b59515499 ("Improve loading of multipage aligned buffers.") modified bounce_bus_dmamap_load_buffer() with the assumption that busdma memory allocations are physically contiguous, which is not always true: bounce_bus_dmamem_alloc() will allocate memory with kmem_alloc_attr_domainset() in some cases, and this function is not guaranteed to return contiguous memory. The damage seems to have been mitigated for most consumers by clamping the segment size to maxsegsz, but this was removed in commit a77e1f0f81df ("busdma: better handling of small segment bouncing"); in practice, it seems busdma memory is often allocated with maxsegsz == PAGE_SIZE. In particular, after commit a77e1f0f81df I see occasional random kernel memory corruption when benchmarking TCP through mlx5 interfaces. Fix the problem by using separate flags for contiguous and non-contiguous busdma memory allocations, and using that to decide whether to clamp. Fixes: 099b59515499 ("Improve loading of multipage aligned buffers.") Fixes: a77e1f0f81df ("busdma: better handling of small segment bouncing") Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46238 --- sys/arm64/arm64/busdma_bounce.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index da605d4e21f5..abfd5c195857 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -63,7 +63,9 @@ enum { BF_COULD_BOUNCE = 0x01, BF_MIN_ALLOC_COMP = 0x02, - BF_KMEM_ALLOC = 0x04, + BF_KMEM_ALLOC_PAGES = 0x04, + BF_KMEM_ALLOC_CONTIG = 0x08, + BF_KMEM_ALLOC = BF_KMEM_ALLOC_PAGES | BF_KMEM_ALLOC_CONTIG, BF_COHERENT = 0x10, }; @@ -580,14 +582,14 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, *vaddr = kmem_alloc_attr_domainset( DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, mflags, 0ul, dmat->common.lowaddr, attr); - dmat->bounce_flags |= BF_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC_PAGES; } else { *vaddr = kmem_alloc_contig_domainset( DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, mflags, 0ul, dmat->common.lowaddr, dmat->alloc_alignment != 0 ? dmat->alloc_alignment : 1ul, dmat->common.boundary, attr); - dmat->bounce_flags |= BF_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC_CONTIG; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -856,7 +858,8 @@ bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, * Compute the segment size, and adjust counts. */ sgsize = buflen; - if ((map->flags & DMAMAP_FROM_DMAMEM) == 0) + if ((map->flags & DMAMAP_FROM_DMAMEM) == 0 || + (dmat->bounce_flags & BF_KMEM_ALLOC_CONTIG) == 0) sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); if (map->pagesneeded != 0 && From nobody Thu Aug 15 19:04:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlF1S0TXxz5Sgv5; Thu, 15 Aug 2024 19:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlF1R74HJz4qY2; Thu, 15 Aug 2024 19:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723748700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uMIFCfAvg7wDJPCxBSlyx+kCsYBxGze6/LY+UZueQ8=; b=M3Cu0GVakxTSTy9PNlpaEsCIVWlRvHvl4JNPjpDMIKMT62zj7Hyu/owWj2RyhxvA3HKU+l NElQLRkOO6FNXN2MwXKbhLJ79E3P+iO58nqn6A8AdujoefJ0MbJD0gP+T6Eek8JcwvW5OX EX0Hs5v85kS6MjvUU4yGwvnTcoJnKrtZg11jIEaRaaVbw2WT3KIgwYlGNrdg+AWDB27KEU wZBix9MzQ7Sjd68+KiEsYKTRZqeGLnsPBXaxhwBBRD0g8/G2uzy++B0TIuluqM9iVTC4+y x9JeNRQ9bWC6xBOYwRwPVItqnUf0RlYlKFRea9lTJGRHxOusy3a8OwwJIehMTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723748700; a=rsa-sha256; cv=none; b=f2xTVUAjTs5CVGJzKGimqo/ZbNOvhe4flAWyeKW0ehhSQohjIdHaLmS/s6E5yflSz+k96J LPg4ewC8G1L6C0a2UJ42IgZlpFWVVlSxKXewMvfPGetahVtVpyam+dL07ALsBmLCZIO/Mz fWOSpKaAVAFAtY52ZnmGZX+91EqE8CwnK0rKTajiI6uT8ppXAsmtmWZ/xUFaQcMaBMSG7q YFEIuE8q+TPcx0SrnQSpLNkLeIJ/f/UyaWN5HIKhci26fyV/SMrP98ei8bR5PX6BLA/yqN 3YXMVYvWs0lotUbZ6DxY3xXtND5b4DPhbH3DQP75TY5b4n923dZEOlot4YxZkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723748700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uMIFCfAvg7wDJPCxBSlyx+kCsYBxGze6/LY+UZueQ8=; b=wvl0+S3f6P3buMQjCkZaw6kjfacxe0vwq0xu9SOSj8DzFlfIUpSwtkn8LYTCMhnIBKmJsO ek18ZueaIBt5U30wehjy6S6ul1VZ4Hm3V+Z7KoqaBDWar4UbFnaHz+CQBaRmNd/CSkmyLu DjuBuFUfib/Y+DBXGYXie4xVRGqZmF1DnneKmTZBwy8M8KgwW/tsI0PaCFK0YUxASl+LhJ AwygwVOcxu8liG7XTU7RFBaQWceX9okpahkotFt7gUMI8xynr6Wn7lU5zT+wedpSUkt2+5 8YewdiQAjyyPoCBmZCx6KL/BRhuYLB8odoI7VYZ0saKp3gDzIuM3WG2z1R1cPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlF1R6gtGzZgp; Thu, 15 Aug 2024 19:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FJ4xod091842; Thu, 15 Aug 2024 19:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FJ4xin091839; Thu, 15 Aug 2024 19:04:59 GMT (envelope-from git) Date: Thu, 15 Aug 2024 19:04:59 GMT Message-Id: <202408151904.47FJ4xin091839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ef9fc9609a1f - main - sys: Mark ACL conversion routines as __result_use_check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef9fc9609a1ff53047577aa7cf51246fc04c954b Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ef9fc9609a1ff53047577aa7cf51246fc04c954b commit ef9fc9609a1ff53047577aa7cf51246fc04c954b Author: Pierre Pronchery AuthorDate: 2024-08-09 17:37:38 +0000 Commit: Ed Maste CommitDate: 2024-08-15 19:04:29 +0000 sys: Mark ACL conversion routines as __result_use_check Both acl_copy_oldacl_into_acl() and acl_copy_acl_into_oldacl() may fail in some circumstances (e.g., acl.acl_cnt exceeding the capacity of OLDACL_MAX_ENTRIES). This change marks both routines with __result_use_check, enforcing check for errors by the caller. Suggested by: markj Reviewed by: markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46254 --- sys/sys/acl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/acl.h b/sys/sys/acl.h index c119cfabef32..d4770667fcf5 100644 --- a/sys/sys/acl.h +++ b/sys/sys/acl.h @@ -309,9 +309,9 @@ void acl_nfs4_compute_inherited_acl( const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory); -int acl_copy_oldacl_into_acl(const struct oldacl *source, +int __result_use_check acl_copy_oldacl_into_acl(const struct oldacl *source, struct acl *dest); -int acl_copy_acl_into_oldacl(const struct acl *source, +int __result_use_check acl_copy_acl_into_oldacl(const struct acl *source, struct oldacl *dest); /* From nobody Thu Aug 15 19:34:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlFgM1Ltbz5SkXf; Thu, 15 Aug 2024 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlFgL6rsWz4vd6; Thu, 15 Aug 2024 19:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723750463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yFqh7ibcdH5NH+bFiTgTp/thJkIGQ+4MGMzDYxzMM9I=; b=A6Qs1wu5udY/QNX+yaGjJEyGlOMEjOlt+V0tVXg3zhFRiQrNKI6wEPc6ByiIO+0IvVmbvL TIayPydMgexzXn394V5RsXhQfPi7S2aqI1q2+8RArWpRA1BJIIJZOzVh1GPQIriEMmHsn7 5vBz97P8OtAB+QOW3xnkdpmkdQraOoLhF2OExMoLTKVi71uSs4R8mXwbcX5IpF4qlB8N/G DTboY44gf/3l+L7XyOTs6BvvdseprQUW6efEt1hGRVwpaX+6NyRanHUzr1g+cclCkN7sj6 +n4bxjji5fKBXpe+BAWESnQ4P4eqp8TqPF2WELO+yLqKrZLC6MLVxnsnmzcvhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723750463; a=rsa-sha256; cv=none; b=T/c2S4QLzYlix0Le1t+UMy21dtl1R1IZk2EmzE9H+4AvGeJddADssQJ2Fd55a0jalOmkKX tnAdDdgUExXCwvKWzJDR41CM1IWkNC2vVUHIcDj4+Ac/LEl+779Tj3phqY4YODtguLwxQV cmATiE3fX6YLxbJPDNVY4I2pCTNhGm0t2HtvACfz0Bf1/Xv1nSVDd2qx7k0KjfGsWwUCrU dEJd8aCekmwgfknZ5jwaqoSNk9yhPEMK4HF2dHcd7kB7JqwXD/lzyf49r2om5nLc3SCG3G K2bEleACqW7RCSguGlcs63SIzFMLpHHRuWJsT/cBq700VHiMDfMNu8RQrliU8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723750463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yFqh7ibcdH5NH+bFiTgTp/thJkIGQ+4MGMzDYxzMM9I=; b=UBPvy4ENyUOZ4kFlJZMrG7fRoYFdPKAcgoNR6cZtjU2d9zGKEjIA2NjZ1FPWqFfQXJC6b3 QQwjJ3+1tWukE6cEcDqYDUuCNmTu+drdU119+75x7VUYNaJrwjsohmwB0ikqHe0M7GFyaf 4Mu00VJgZ5cFj7wvBT1aTW/7sBigT5pu10L7bwTtdC+V2GLZXLkMz18w+KwvGfNMcH2O4Z Bsu7f8HKvKDhU5idDumVaYhWHf9Ec7VG0C+yNOrWPeRkxkoEDJSsmO3iMmXfFsKWTIssOV XGJwi44HAajVT5RJsp7oxd/OJm/uWBYx08Fby+2k2OyE9EnFYZ9ApYA77nlnAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlFgL6T4fzc24; Thu, 15 Aug 2024 19:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FJYMla042676; Thu, 15 Aug 2024 19:34:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FJYMuR042673; Thu, 15 Aug 2024 19:34:22 GMT (envelope-from git) Date: Thu, 15 Aug 2024 19:34:22 GMT Message-Id: <202408151934.47FJYMuR042673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 3cded0592208 - main - tmpfs: Fix OOB write when setting vfs.tmpfs.memory_percent List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cded0592208b465761af6db5b7b7c21cb5b28c3 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3cded0592208b465761af6db5b7b7c21cb5b28c3 commit 3cded0592208b465761af6db5b7b7c21cb5b28c3 Author: Jessica Clarke AuthorDate: 2024-08-15 19:33:22 +0000 Commit: Jessica Clarke CommitDate: 2024-08-15 19:33:22 +0000 tmpfs: Fix OOB write when setting vfs.tmpfs.memory_percent tmpfs_mem_percent is an int not a long, so on a 64-bit system this writes 4 bytes past the end of the variable. The read above is correct, so this was likely a copy paste error from sysctl_mem_reserved. Found by: CHERI Fixes: 636592343c3e ("tmpfs: increase memory reserve to a percent of available memory + swap") --- sys/fs/tmpfs/tmpfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 3f74c383a171..a5eb865f2996 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -428,7 +428,7 @@ sysctl_mem_percent(SYSCTL_HANDLER_ARGS) if ((unsigned) percent > 100) return (EINVAL); - *(long *)arg1 = percent; + *(int *)arg1 = percent; tmpfs_set_reserve_from_percent(); return (0); } From nobody Thu Aug 15 20:10:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlGT404tcz5SnPH; Thu, 15 Aug 2024 20:10:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlGT31fYLz41Ks; Thu, 15 Aug 2024 20:10:31 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.217.54 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-492959b906eso510918137.0; Thu, 15 Aug 2024 13:10:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723752629; x=1724357429; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fb12BNKKjdwbuTRTo9AUUp+L34hoe4Mp9DjmEpZ0+hs=; b=Sh1Wf2B7lwoBcxCyGXxKDqY6j6wEioUJFU/qs9vlHcEzKtErNgfbA1O9+Nk+34dOEH en3POigXOGxILpyhJK4J4jEWblFf9rEIPVsCax84sHYiMf8qokBzsEErbGDCkcm7YbUL FGrgjMdV2mGQXAp8GPugx/bQ2v4B6v4e17rj+2QQj99kTu+4iSNj1vBklSCXDeJ9MeN6 EtuYf/OogQeG6+oG9SoqzxkBiLDPSikirAAU4nIFe9Hav81lc3kqN/xJmXxcl78jsD+E 27HHMkoIsNQNfzg+Rfawuob01JOVUV8/FN67mOlgLCH5EZ4KuuT545JO3YS2gs5vQhdN J03A== X-Forwarded-Encrypted: i=1; AJvYcCX/9WNwjfe8cWrF00IvHD0Zt4szZ66NhgKlfnwEs0LX5AACV3jJNT82c/k9K6sAKQw9uBFGWEv0/4DAT3w5aA5A57/OjsCicgtGLaFoqRM64o+LlMtPCbOwvgnNwXOTCKvvUiXF0YLkMjUMl0t+JmWe/HBu2SzWf0A7rMY7FGobt7X/RrX9FAoDGfSsKZQ= X-Gm-Message-State: AOJu0YxH4ZyULfni8KtkICBvh6ykYvREHQCGsMr4598bYcFGSWzmUR4X CifW0KWz3OCHVdPc4zZmWsgqzo7tmrMpNC5IWxoCuf3QyYp8ox4KQash+StU4Qj3UZscqCAFuNH MhIcGi4Zaauvh/ZYrpgNiTpfi5JUjsg== X-Google-Smtp-Source: AGHT+IGfxz19J9+ulXz6mNHWKMF832zC/YWeYD5WzgQixZqLSLK+nRYdaK8YAawaYo8GDH0DxDrHp8/EKINW+EMOyvg= X-Received: by 2002:a05:6102:441f:b0:48f:ebc3:a006 with SMTP id ada2fe7eead31-4977994fd57mr1468143137.15.1723752629234; Thu, 15 Aug 2024 13:10:29 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202101170021.10H0LZEk066670@gitrepo.freebsd.org> <202101170057.10H0vqp6056258@slippy.cwsent.com> In-Reply-To: From: Alan Somers Date: Thu, 15 Aug 2024 14:10:17 -0600 Message-ID: Subject: Re: git: b7ab6832cd98 - main - cat: disable building it with Casper To: Mariusz Zaborski Cc: Cy Schubert , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.80)[-0.801]; NEURAL_HAM_SHORT(-0.70)[-0.702]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[asomers]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.217.54:from]; RCVD_IN_DNSWL_NONE(0.00)[209.85.217.54:from]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4WlGT31fYLz41Ks According to the comment, this change was supposed to be temporary. But it's been in place for 3.5 years. Can it be reverted now? On Sat, Jan 16, 2021 at 6:07=E2=80=AFPM Mariusz Zaborski wrote: > > Hello, > > Seems like your cat.o wasn't rebuild. > Did you use NO_CLEAN flag? > It seems to work on: > https://github.com/freebsd/freebsd-src/runs/1715237892 and on my > machine. > > Can you try doing: > make buildenv > cd bin/cat > make clean > make > > Thanks, > Mariusz > > On Sun, 17 Jan 2021 at 01:58, Cy Schubert wro= te: > > > > In message <202101170021.10H0LZEk066670@gitrepo.freebsd.org>, Mariusz > > Zaborski > > writes: > > > The branch main has been updated by oshogbo: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db7ab6832cd988aff7f4e46= 8e507c314d > > > d7641638 > > > > > > commit b7ab6832cd988aff7f4e468e507c314dd7641638 > > > Author: Mariusz Zaborski > > > AuthorDate: 2021-01-17 00:04:28 +0000 > > > Commit: Mariusz Zaborski > > > CommitDate: 2021-01-17 00:21:46 +0000 > > > > > > cat: disable building it with Casper > > > > > > We want to measure what are the actual cost of sandboxing cat(1). > > > > > > Requested by: mjg, cy, Mike Karels > > > Discussed with: rwatson, markj > > > --- > > > bin/cat/Makefile | 13 +++++++------ > > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > > > diff --git a/bin/cat/Makefile b/bin/cat/Makefile > > > index abfdcbcfbb2e..cce69d8aad9e 100644 > > > --- a/bin/cat/Makefile > > > +++ b/bin/cat/Makefile > > > @@ -15,11 +15,12 @@ CFLAGS+=3D-DBOOTSTRAP_CAT > > > HAS_TESTS=3D > > > SUBDIR.${MK_TESTS}+=3D tests > > > > > > -.if ${MK_CASPER} !=3D "no" && !defined(RESCUE) && !defined(BOOTSTRAP= PING) > > > -LIBADD+=3D casper > > > -LIBADD+=3D cap_fileargs > > > -LIBADD+=3D cap_net > > > -CFLAGS+=3D-DWITH_CASPER > > > -.endif > > > +# Temporary disable building cat with Casper. > > > +#.if ${MK_CASPER} !=3D "no" && !defined(RESCUE) && !defined(BOOTSTRA= PPING) > > > +#LIBADD+=3D casper > > > +#LIBADD+=3D cap_fileargs > > > +#LIBADD+=3D cap_net > > > +#CFLAGS+=3D-DWITH_CASPER > > > +#.endif > > > > > > .include > > > > > > > Hi, > > > > Almost there. > > > > ld: error: undefined symbol: cap_init > > >>> referenced by cat.c:154 (/opt/src/git-src/bin/cat/cat.c:154) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: fileargs_cinit > > >>> referenced by cat.c:158 (/opt/src/git-src/bin/cat/cat.c:158) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: cap_service_open > > >>> referenced by cat.c:131 (/opt/src/git-src/bin/cat/cat.c:131) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: cap_net_limit_init > > >>> referenced by cat.c:135 (/opt/src/git-src/bin/cat/cat.c:135) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: cap_net_limit_name2addr_family > > >>> referenced by cat.c:141 (/opt/src/git-src/bin/cat/cat.c:141) > > >>> cat.o:(main) > > --- all_subdir_kerberos5 --- > > --- libheimntlm.so.11.debug --- > > objcopy --only-keep-debug libheimntlm.so.11.full libheimntlm.so.11.debu= g > > --- libheimntlm.so.11 --- > > objcopy --strip-debug --add-gnu-debuglink=3Dlibheimntlm.so.11.debug > > libheimntlm.so.11.full libheimntlm.so.11 > > --- all_subdir_lib --- > > --- init_test --- > > (cd /opt/src/git-src/lib/csu/tests/dynamic && DEPENDFILE=3D.depend.ini= t_test > > NO_SUBDIR=3D1 make -f /opt/src/git-src/lib/csu/tests/dynamic/Makefile > > _RECURSING_PROGS=3Dt PROG=3Dinit_test ) > > --- all_subdir_bin --- > > ld: error: undefined symbol: cap_net_limit > > >>> referenced by cat.c:143 (/opt/src/git-src/bin/cat/cat.c:143) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: cap_close > > >>> referenced by cat.c:168 (/opt/src/git-src/bin/cat/cat.c:168) > > >>> cat.o:(main) > > > > ld: error: undefined symbol: fileargs_open > > >>> referenced by cat.c:263 (/opt/src/git-src/bin/cat/cat.c:263) > > >>> cat.o:(scanfiles) > > > > ld: error: undefined symbol: fileargs_realpath > > >>> referenced by cat.c:441 (/opt/src/git-src/bin/cat/cat.c:441) > > >>> cat.o:(scanfiles) > > > > ld: error: undefined symbol: cap_getaddrinfo > > >>> referenced by cat.c:444 (/opt/src/git-src/bin/cat/cat.c:444) > > >>> cat.o:(scanfiles) > > > > ld: error: undefined symbol: cap_connect > > >>> referenced by cat.c:468 (/opt/src/git-src/bin/cat/cat.c:468) > > >>> cat.o:(scanfiles) > > cc: error: linker command failed with exit code 1 (use -v to see invoca= tion) > > *** [cat.full] Error code 1 > > > > make[4]: stopped in /opt/src/git-src/bin/cat > > > > make[1]: stopped in /opt/src/git-src > > > > make: stopped in /opt/src/git-src > > exiting RC=3D2: building amd64 > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > The need of the many outweighs the greed of the few. > > > > From nobody Thu Aug 15 22:44:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlKtC0TBvz5T1rw; Thu, 15 Aug 2024 22:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlKtB6pV8z4HJR; Thu, 15 Aug 2024 22:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723761843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YkGKOwwIH/AyxaqdzMUnjTdwNSmv/ojhP3D/94L+a1o=; b=D8Jhjkmztq+hjqGzdUZzKDu/rzOVaiHwp3MLpNbRcdUjqWjfc3MX1gQFddkQjNM+FWrs+D JYYiUxYZ+lEhru6vfc+V1OAHZqVsdh1gRJ69y12LqtBLVkxpFaiXHNvQ7om1EEi5qDsRDG N9w/pzVdXM0UcXOLbwO0CYTyjpiDyc45yftBkHqtgp3KIxaQ+CTSwtOZMHifK7j6FynCDV U2P5oQWjsxerGeJCKpEe0uRJOlgXL9TUEa0DsSK87cwTo9HdjcmdsmftGTnRUb30ipeFSj z1VdFm4zx9lvVf8fk0Yk4KJjf4zq1ECa8LcHrg9xu5ptpZfNkO/Be66Qb2Hnlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723761843; a=rsa-sha256; cv=none; b=QQctlR8jFHtv0oyHn425uhmSXzOZMFfpDJ5tTYqyaYazZYIFVs1Bg8Cqmw5CE/wxMA/HGG tV/XAspeKzVV1fF51DV7WmYHp8oTUt7QI7Xbetsyy9futXjEVWkLs2P5aRZ9yflqLuWEuK OrM0DEpAOuT0Zw4i/11Yc7Cik7w5UNtSJHl+PKziT+tbyPpxSH3Ks/Z0Oj+xhEsppLT+To 8/lsIwQG2SH4T5rWqduisg+QtUZljO5MFoi2vy1IIhahN3UEHb6+dQB85bGNFa3tp8FWrM pNHkZpPH3uP3Y+TmhjHSUuIOQoi+eOvmziE3ngQ3u/M+mEmd8I9Wt51QznLUEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723761843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YkGKOwwIH/AyxaqdzMUnjTdwNSmv/ojhP3D/94L+a1o=; b=A4EDRYtJ+V+vcw3Z3qbExkqyNRRmRwmaTgI57DZkYbHIzdfWAGRp1CgUbb/nPqmDVCOzdo cf4yBYI+vLWJijMaT4V3VoUycTlrHLqQQ2MUGDtb6qvqeW4eDEssXiOVKKfXAf2G9MiJtu CO3M5ZJbU938a+PRGPt++5AFrV4hZlCmyb0bxddYJA/yKuVa2LaQPCDjGLrk68D7ERlXP0 GYTpAAjZDlSxeM41i1yeE2uazskrM+MgJR10AdFanUPuzqQ/LHuT/xoqSWviKHkawIk7VG mmfGX0zP3a1H6CculOQyly+RhIxsO6S4NLK6o/zzu/cMkvBMus53Bpts+0vc2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlKtB6HnGzhtM; Thu, 15 Aug 2024 22:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FMi2OF063886; Thu, 15 Aug 2024 22:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FMi2ju063883; Thu, 15 Aug 2024 22:44:02 GMT (envelope-from git) Date: Thu, 15 Aug 2024 22:44:02 GMT Message-Id: <202408152244.47FMi2ju063883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 82cb2a4158fa - main - Update safe_eval.sh to support --export List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82cb2a4158fa79ec230a5ab41a2f61c253e65c0b Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=82cb2a4158fa79ec230a5ab41a2f61c253e65c0b commit 82cb2a4158fa79ec230a5ab41a2f61c253e65c0b Author: Simon J. Gerraty AuthorDate: 2024-08-15 22:42:39 +0000 Commit: Simon J. Gerraty CommitDate: 2024-08-15 22:42:39 +0000 Update safe_eval.sh to support --export This update allows safe_dot --export file ... to export any variables that get set. Reviewed by: obrien --- libexec/rc/safe_eval.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/libexec/rc/safe_eval.sh b/libexec/rc/safe_eval.sh index 10b6ed09c769..0e1410b771cb 100644 --- a/libexec/rc/safe_eval.sh +++ b/libexec/rc/safe_eval.sh @@ -1,9 +1,9 @@ # SPDX-License-Identifier: BSD-2-Clause # RCSid: -# $Id: safe_eval.sh,v 1.12 2023/10/12 18:46:53 sjg Exp $ +# $Id: safe_eval.sh,v 1.16 2024/08/15 02:28:30 sjg Exp $ # -# @(#) Copyright (c) 2023 Simon J. Gerraty +# @(#) Copyright (c) 2023-2024 Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. @@ -37,14 +37,33 @@ safe_eval() { eval `cat "$@" | safe_set` } +## +# safe_eval_export [file] +# +# eval variable assignments only from file +# taking care to eliminate any shell meta chars +# export any variables thus set +# +safe_eval_export() { + eval `cat "$@" | safe_set | ${SED:-sed} 's/^\([^=]*\)=.*/&; export \1/'` +} + ## # safe_dot file [...] # # feed all "file" that exist to safe_eval # safe_dot() { - local ef= f - + eval ${local:-:} ef ex f + ef= + ex= + while : + do + case "$1" in + --export) ex=_export; shift;; + *) break;; + esac + done for f in "$@" do test -s $f || continue @@ -52,7 +71,7 @@ safe_dot() { dotted="$dotted $f" done test -z "$ef" && return 1 - safe_eval $ef + safe_eval$ex $ef return 0 } From nobody Fri Aug 16 02:06:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlQMy74KTz5TJQM; Fri, 16 Aug 2024 02:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlQMy6XLRz4Xtq; Fri, 16 Aug 2024 02:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723773998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JjNbajMk+vv4/PQ0iA51fgdOqDljwoy+kvDRURV/g2Q=; b=SoqDNf7xLFowEoxBJSl2k+irtlueJQXzxtl52NHvaFyKOwVfy+/lR5dQqijReRu5A3fv9H K6dUPUgiJOF/QBtCDiqLCyuTlD8aIDKHMLN+LeRTF5epO6qG9KVk9YI6rOSu1U86g02okg moXbZlQrGhG29gviRT3vvfEpeIAJzEhduJW6D/ZDRG8jicg90LVvjFSE1F7GbgctVWsaU6 eXkml6yCamXRPtNGO3jJTVPL15++2QvcfXNZleVadSg6lJCgqv/I6xBFbO2y6SuXJMUU5M pVLgRHLg8RryLbDgq8tNgGEVvGy2w1ArIWL6tCnee7r+srtvmpPd9k5UtchUbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723773998; a=rsa-sha256; cv=none; b=cSNdMVaghQjDu164xmMPZRctIv2bPv3kbEr3vrckMmjU0V8gwBZnTAkKVnN+Kl/DqSbfIS yPm4RwCqFSq2S82E082JH7TC1CxLqHszGEKrpBA9XT3SldmBbq+ua05dOo2ixvd7PRjIGH 2QMSB468VPEdjdr/ix87wd+xtSWjYe50zuMewbSDJYzWFv+6yM9Yd2AeSZPPG2eeDv2pQC WYj2kBY07JIwGSZ6VIJwa+QRn2d2Mze/PMX1j+rURSNplzszmaOgQLOKuCyvgtpvq/lc/W H+KBY8TKI1KYVrFyDYRZb2xIfnv3w2XZ5iz0i1cfagq+6grlKIw6Uk2k16FLfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723773998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JjNbajMk+vv4/PQ0iA51fgdOqDljwoy+kvDRURV/g2Q=; b=ZQjbmGiyo/xz63P+0G33LA1BJwrsC+RGPQCHcWVgo8wg7KWtorz8XNNzIBgVHdQyH+1ZjX XB2ff5PatHLUT2S2vTL4moqHWeZEQh3D8T5WIqSCRXL+Vs0arRWGzmEyPGazWA5hmTfFUK RoLz6Bdg1muHNcLFPB6i4jlKwAiPIqg/bU73RAe6UD+k/v8oDJxZ4l5PdpVTYPEbBqH9Dh j4Mdi6Mr6FKddfiMT13n7/PyM5cTJhyrD4vSxxE5zcJtyVRieDyiVtnZ9xX9AJtEujttYf qDhHb+maZQgUuzUoZwVg45RWo4zx0wTktRWVRZXBk+vJxGUGzeVB/6Zj/xCbMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlQMy61yJzn1r; Fri, 16 Aug 2024 02:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G26coE003479; Fri, 16 Aug 2024 02:06:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G26c14003476; Fri, 16 Aug 2024 02:06:38 GMT (envelope-from git) Date: Fri, 16 Aug 2024 02:06:38 GMT Message-Id: <202408160206.47G26c14003476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Lo Subject: git: 8b21c469dbd6 - main - ng_ubt: Add blacklist entries for MediaTek MT7925 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b21c469dbd6dd7d7222a726eed33f06162bf04f Auto-Submitted: auto-generated The branch main has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=8b21c469dbd6dd7d7222a726eed33f06162bf04f commit 8b21c469dbd6dd7d7222a726eed33f06162bf04f Author: Kevin Lo AuthorDate: 2024-08-16 02:03:19 +0000 Commit: Kevin Lo CommitDate: 2024-08-16 02:03:19 +0000 ng_ubt: Add blacklist entries for MediaTek MT7925 This controller requires firmware patch downloading to operate, block ng_ubt attachment unless operational firmware is loaded. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46302 --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 76a71e2f8d53..a63ccae3cc03 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -443,6 +443,10 @@ static const STRUCT_USB_HOST_ID ubt_ignore_devs[] = */ { USB_VPI(USB_VENDOR_INTEL2, 0x0032, 0) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0033, 0) }, + + /* MediaTek MT7925 */ + { USB_VPI(USB_VENDOR_AZUREWAVE, 0x3602, 0) }, + { USB_VPI(USB_VENDOR_AZUREWAVE, 0x3604, 0) }, }; /* List of supported bluetooth devices */ From nobody Fri Aug 16 02:30:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlQvP2Hn0z5TLCZ; Fri, 16 Aug 2024 02:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlQvP1Mclz4Zyj; Fri, 16 Aug 2024 02:30:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723775425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKni5VsFodWhs0a4FMeXxAx93k5p81+k307iEIbwRTM=; b=n9ZtynTM9Yle7/G+434DJNOy49bUbKbK3MoJsjknwAiiXugEvSoNgoaRXBVS0u9DAlBc0q /2lIIE/Gdc20YL7b/iTn5xOgqah2gOAIikKJtXWW6NKDH8z0Axfo5pX96w4X4gRS6df6T0 RpdB2x1VXLi8hX2pnjc0Ljv1j9Lke+Eh5AbSXHeASDcZBnQjXUZcLraUPZ8xuB8BrdJNEg mL0OwUZ7WE9TLqwy6Vr7P9rWFTxV68cDIp2TgiGacshDfUWXPIrRYX0bwPHvYjWJ4RID8D Ayify15e2ohbOZaEvM0wKvf057AAUPktEcPeVyMaDpZE6ijIFr4rbADggPppjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723775425; a=rsa-sha256; cv=none; b=k5B7vtoNbpEecCTEiJuyBmro9lYw9+MphiSG9dA9ON6RW91HR3+fYVZSz42ka51pnauneI XSuJ/dC1a2Jtg1XlKxrYLXVOCdMR60erfwjemvSYYiQQQ58Lq8DElKon90ZF09yzDJgcXp DMTKpCPIkf+NQ0jYFlcFYvb+dvadOOiw39am0hZ9p1PG70iYUyFFn+ktZhLFQv6dNrLZr+ uUOj5ioYCaqyBb/OSQ7x0LVstxmWzdARAGB9NEnQSh2/6L8kRl+ks6Ow5EKDCI6MBqpH/n dky2zoKBYc08p4ylDcvyvvfvzPNtXgkbh7A77yquO+lsXAcEr/b5tS5qBRu+Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723775425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKni5VsFodWhs0a4FMeXxAx93k5p81+k307iEIbwRTM=; b=EZa3oyYlSKOrvd1QhT71LIkpMaJ5r4S/XHJliAlHEwJ9lF3ixhp/JRZBBLV3vURGDcBpDF /e+olPN/nuTE+WpgZY9K9AmqR6WSOXt8y8GVK8+unDwgODFb/b+1cM/zpNx/4UZC5QtGYh vhdhRxb8jYSBFxb+Bsx+JJPIBSDqrmgCuIOpkXzXZPLz60sYZmOWhggue29lmrx+KDB9Z2 0iAJZDrPHUi5uxgQOylux0aeqjP7/J9DtS7qUK22yXyZiZToMrtY1MDiuiRvJB4DcoxqE9 l2mPAIDU1tVeLdW2q+0mpQpql1yJpzl4GMegprRBQRbziZZw5pWpeXP3mh3CKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlQvN6qZLzpG4; Fri, 16 Aug 2024 02:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G2UOsX045810; Fri, 16 Aug 2024 02:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G2UO9J045807; Fri, 16 Aug 2024 02:30:24 GMT (envelope-from git) Date: Fri, 16 Aug 2024 02:30:24 GMT Message-Id: <202408160230.47G2UO9J045807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d5507f9e4366 - main - nvme: Separate total failures from I/O failures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5507f9e436698ac17dc5ace7ef58493988a9b04 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d5507f9e436698ac17dc5ace7ef58493988a9b04 commit d5507f9e436698ac17dc5ace7ef58493988a9b04 Author: Warner Losh AuthorDate: 2024-08-14 22:55:49 +0000 Commit: Warner Losh CommitDate: 2024-08-16 02:22:18 +0000 nvme: Separate total failures from I/O failures When it's a I/O failure, we can still send admin commands. Separate out the admin failures and flag them as such so that we can still send admin commands on half-failed drives. Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in failed state) Sponsored by: Netflix --- sys/amd64/conf/IOSCHED | 2 + sys/amd64/conf/MPI3MR | 10 + sys/arm64/conf/GENERIC16K | 4 + .../linuxkpi/common/include/linux/#compiler.h# | 117 + sys/contrib/dev/iwlwifi/fw/api/soc.h | 35 + sys/contrib/zlib/contrib/asm686/README.686 | 51 + sys/contrib/zlib/contrib/asm686/match.S | 357 + sys/dev/ice/ice_sriov.c | 595 ++ sys/dev/ice/ice_sriov.h | 64 + sys/dev/mps/mpi/mpi2_pci.h | 141 + sys/dev/nvme/nvme_ctrlr.c | 46 +- sys/dev/nvme/nvme_private.h | 1 + sys/dev/nvme/nvme_qpair.c | 23 +- sys/dev/nvme/nvme_sim.c | 13 +- sys/dev/sound/pci/aureal.c | 686 ++ sys/dev/sound/pci/aureal.h | 99 + sys/dev/sound/pci/ds1-fw.h | 1602 ++++ sys/dev/sound/pci/ds1.c | 1103 +++ sys/dev/sound/pci/ds1.h | 146 + sys/dev/sound/pci/maestro.c | 2043 +++++ sys/dev/sound/pci/maestro_reg.h | 381 + sys/kern/bsduser-syscalls.c | 8712 ++++++++++++++++++++ sys/modules/sound/driver/ds1/Makefile | 8 + sys/modules/sound/driver/maestro/Makefile | 8 + 24 files changed, 16219 insertions(+), 28 deletions(-) diff --git a/sys/amd64/conf/IOSCHED b/sys/amd64/conf/IOSCHED new file mode 100644 index 000000000000..e15106bc4c1f --- /dev/null +++ b/sys/amd64/conf/IOSCHED @@ -0,0 +1,2 @@ +include "GENERIC" +options CAM_IOSCHED_DYNAMIC diff --git a/sys/amd64/conf/MPI3MR b/sys/amd64/conf/MPI3MR new file mode 100644 index 000000000000..99e5244cb49d --- /dev/null +++ b/sys/amd64/conf/MPI3MR @@ -0,0 +1,10 @@ +include GENERIC + +device mpi3mr +# All the debugging options +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed diff --git a/sys/arm64/conf/GENERIC16K b/sys/arm64/conf/GENERIC16K new file mode 100644 index 000000000000..9bf9e2dadb08 --- /dev/null +++ b/sys/arm64/conf/GENERIC16K @@ -0,0 +1,4 @@ +include "GENERIC" + +ident GENERIC_16K + diff --git a/sys/compat/linuxkpi/common/include/linux/#compiler.h# b/sys/compat/linuxkpi/common/include/linux/#compiler.h# new file mode 100644 index 000000000000..1177674aa68f --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/#compiler.h# @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_COMPILER_H_ +#define _LINUX_COMPILER_H_ + +#include + +#define __user +#define __kernel +#define __safe +#define __force +#define __nocast +#define __iomem +#define __chk_user_ptr(x) ((void)0) +#define __chk_io_ptr(x) ((void)0) +#define __builtin_warning(x, y...) (1) +#define __acquires(x) +#define __releases(x) +#define __acquire(x) do { } while (0) +#define __release(x) do { } while (0) +#define __cond_lock(x,c) (c) +#define __bitwise +#define __devinitdata +#define __deprecated +#define __init +#define __initconst +#define __devinit +#define __devexit +#define __exit +#define __rcu +#define __percpu +#define __weak __weak_symbol +#define __malloc +#define ___stringify(...) #__VA_ARGS__ +#define __stringify(...) ___stringify(__VA_ARGS__) +#define __attribute_const__ __attribute__((__const__)) +#undef __always_inline +#define __always_inline inline +#define noinline __noinline +#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#define typeof(x) __typeof(x) + +#define uninitialized_var(x) x = x +#define __maybe_unused __unused +#define __always_unused __unused +#define __must_check __result_use_check + +#define __printf(a,b) __printflike(a,b) + +#define barrier() __asm__ __volatile__("": : :"memory") + +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +/* Moved from drm_os_freebsd.h */ +#define lower_32_bits(n) ((u32)(n)) +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) +#endif + +#define ___PASTE(a,b) a##b +#define __PASTE(a,b) ___PASTE(a,b) + +#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) + +#define WRITE_ONCE(x,v) do { \ + barrier(); \ + ACCESS_ONCE(x) = (v); \ + barrier(); \ +} while (0) + +#define READ_ONCE(x) ({ \ + __typeof(x) __var = ({ \ + barrier(); \ + ACCESS_ONCE(x); \ + }); \ + barrier(); \ + __var; \ +}) + +#define lockless_dereference(p) READ_ONCE(p) + +#define _AT(T,X) ((T)(X)) + +#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) +#define __must_be_array(a) __same_type(a, &(a)[0]) + +#endif /* _LINUX_COMPILER_H_ */ diff --git a/sys/contrib/dev/iwlwifi/fw/api/soc.h b/sys/contrib/dev/iwlwifi/fw/api/soc.h new file mode 100644 index 000000000000..c5df1171462b --- /dev/null +++ b/sys/contrib/dev/iwlwifi/fw/api/soc.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* + * Copyright (C) 2012-2014, 2019-2020 Intel Corporation + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH + * Copyright (C) 2016-2017 Intel Deutschland GmbH + */ +#ifndef __iwl_fw_api_soc_h__ +#define __iwl_fw_api_soc_h__ + +#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0) +#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1) + +#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc +#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0 +#define SOC_FLAGS_LTR_APPLY_DELAY_200 1 +#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2 +#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3 + +/** + * struct iwl_soc_configuration_cmd - Set device stabilization latency + * + * @flags: soc settings flags. In VER_1, we can only set the DISCRETE + * flag, because the FW treats the whole value as an integer. In + * VER_2, we can set the bits independently. + * @latency: time for SOC to ensure stable power & XTAL + */ +struct iwl_soc_configuration_cmd { + __le32 flags; + __le32 latency; +} __packed; /* + * SOC_CONFIGURATION_CMD_S_VER_1 (see description above) + * SOC_CONFIGURATION_CMD_S_VER_2 + */ + +#endif /* __iwl_fw_api_soc_h__ */ diff --git a/sys/contrib/zlib/contrib/asm686/README.686 b/sys/contrib/zlib/contrib/asm686/README.686 new file mode 100644 index 000000000000..a0bf3bea4aff --- /dev/null +++ b/sys/contrib/zlib/contrib/asm686/README.686 @@ -0,0 +1,51 @@ +This is a patched version of zlib, modified to use +Pentium-Pro-optimized assembly code in the deflation algorithm. The +files changed/added by this patch are: + +README.686 +match.S + +The speedup that this patch provides varies, depending on whether the +compiler used to build the original version of zlib falls afoul of the +PPro's speed traps. My own tests show a speedup of around 10-20% at +the default compression level, and 20-30% using -9, against a version +compiled using gcc 2.7.2.3. Your mileage may vary. + +Note that this code has been tailored for the PPro/PII in particular, +and will not perform particuarly well on a Pentium. + +If you are using an assembler other than GNU as, you will have to +translate match.S to use your assembler's syntax. (Have fun.) + +Brian Raiter +breadbox@muppetlabs.com +April, 1998 + + +Added for zlib 1.1.3: + +The patches come from +http://www.muppetlabs.com/~breadbox/software/assembly.html + +To compile zlib with this asm file, copy match.S to the zlib directory +then do: + +CFLAGS="-O3 -DASMV" ./configure +make OBJA=match.o + + +Update: + +I've been ignoring these assembly routines for years, believing that +gcc's generated code had caught up with it sometime around gcc 2.95 +and the major rearchitecting of the Pentium 4. However, I recently +learned that, despite what I believed, this code still has some life +in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% +faster than the code produced by gcc 4.1. + +In acknowledgement of its continuing usefulness, I've altered the +license to match that of the rest of zlib. Share and Enjoy! + +Brian Raiter +breadbox@muppetlabs.com +April, 2007 diff --git a/sys/contrib/zlib/contrib/asm686/match.S b/sys/contrib/zlib/contrib/asm686/match.S new file mode 100644 index 000000000000..fa421092785d --- /dev/null +++ b/sys/contrib/zlib/contrib/asm686/match.S @@ -0,0 +1,357 @@ +/* match.S -- x86 assembly version of the zlib longest_match() function. + * Optimized for the Intel 686 chips (PPro and later). + * + * Copyright (C) 1998, 2007 Brian Raiter + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the author be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#ifndef NO_UNDERLINE +#define match_init _match_init +#define longest_match _longest_match +#endif + +#define MAX_MATCH (258) +#define MIN_MATCH (3) +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) +#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) + +/* stack frame offsets */ + +#define chainlenwmask 0 /* high word: current chain len */ + /* low word: s->wmask */ +#define window 4 /* local copy of s->window */ +#define windowbestlen 8 /* s->window + bestlen */ +#define scanstart 16 /* first two bytes of string */ +#define scanend 12 /* last two bytes of string */ +#define scanalign 20 /* dword-misalignment of string */ +#define nicematch 24 /* a good enough match size */ +#define bestlen 28 /* size of best match so far */ +#define scan 32 /* ptr to string wanting match */ + +#define LocalVarsSize (36) +/* saved ebx 36 */ +/* saved edi 40 */ +/* saved esi 44 */ +/* saved ebp 48 */ +/* return address 52 */ +#define deflatestate 56 /* the function arguments */ +#define curmatch 60 + +/* All the +zlib1222add offsets are due to the addition of fields + * in zlib in the deflate_state structure since the asm code was first written + * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). + * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). + * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + */ + +#define zlib1222add (8) + +#define dsWSize (36+zlib1222add) +#define dsWMask (44+zlib1222add) +#define dsWindow (48+zlib1222add) +#define dsPrev (56+zlib1222add) +#define dsMatchLen (88+zlib1222add) +#define dsPrevMatch (92+zlib1222add) +#define dsStrStart (100+zlib1222add) +#define dsMatchStart (104+zlib1222add) +#define dsLookahead (108+zlib1222add) +#define dsPrevLen (112+zlib1222add) +#define dsMaxChainLen (116+zlib1222add) +#define dsGoodMatch (132+zlib1222add) +#define dsNiceMatch (136+zlib1222add) + + +.file "match.S" + +.globl match_init, longest_match + +.text + +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ +.cfi_sections .debug_frame + +longest_match: + +.cfi_startproc +/* Save registers that the compiler may be using, and adjust %esp to */ +/* make room for our stack frame. */ + + pushl %ebp + .cfi_def_cfa_offset 8 + .cfi_offset ebp, -8 + pushl %edi + .cfi_def_cfa_offset 12 + pushl %esi + .cfi_def_cfa_offset 16 + pushl %ebx + .cfi_def_cfa_offset 20 + subl $LocalVarsSize, %esp + .cfi_def_cfa_offset LocalVarsSize+20 + +/* Retrieve the function arguments. %ecx will hold cur_match */ +/* throughout the entire function. %edx will hold the pointer to the */ +/* deflate_state structure during the function's setup (before */ +/* entering the main loop). */ + + movl deflatestate(%esp), %edx + movl curmatch(%esp), %ecx + +/* uInt wmask = s->w_mask; */ +/* unsigned chain_length = s->max_chain_length; */ +/* if (s->prev_length >= s->good_match) { */ +/* chain_length >>= 2; */ +/* } */ + + movl dsPrevLen(%edx), %eax + movl dsGoodMatch(%edx), %ebx + cmpl %ebx, %eax + movl dsWMask(%edx), %eax + movl dsMaxChainLen(%edx), %ebx + jl LastMatchGood + shrl $2, %ebx +LastMatchGood: + +/* chainlen is decremented once beforehand so that the function can */ +/* use the sign flag instead of the zero flag for the exit test. */ +/* It is then shifted into the high word, to make room for the wmask */ +/* value, which it will always accompany. */ + + decl %ebx + shll $16, %ebx + orl %eax, %ebx + movl %ebx, chainlenwmask(%esp) + +/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ + + movl dsNiceMatch(%edx), %eax + movl dsLookahead(%edx), %ebx + cmpl %eax, %ebx + jl LookaheadLess + movl %eax, %ebx +LookaheadLess: movl %ebx, nicematch(%esp) + +/* register Bytef *scan = s->window + s->strstart; */ + + movl dsWindow(%edx), %esi + movl %esi, window(%esp) + movl dsStrStart(%edx), %ebp + lea (%esi,%ebp), %edi + movl %edi, scan(%esp) + +/* Determine how many bytes the scan ptr is off from being */ +/* dword-aligned. */ + + movl %edi, %eax + negl %eax + andl $3, %eax + movl %eax, scanalign(%esp) + +/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ +/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ + + movl dsWSize(%edx), %eax + subl $MIN_LOOKAHEAD, %eax + subl %eax, %ebp + jg LimitPositive + xorl %ebp, %ebp +LimitPositive: + +/* int best_len = s->prev_length; */ + + movl dsPrevLen(%edx), %eax + movl %eax, bestlen(%esp) + +/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ + + addl %eax, %esi + movl %esi, windowbestlen(%esp) + +/* register ush scan_start = *(ushf*)scan; */ +/* register ush scan_end = *(ushf*)(scan+best_len-1); */ +/* Posf *prev = s->prev; */ + + movzwl (%edi), %ebx + movl %ebx, scanstart(%esp) + movzwl -1(%edi,%eax), %ebx + movl %ebx, scanend(%esp) + movl dsPrev(%edx), %edi + +/* Jump into the main loop. */ + + movl chainlenwmask(%esp), %edx + jmp LoopEntry + +.balign 16 + +/* do { + * match = s->window + cur_match; + * if (*(ushf*)(match+best_len-1) != scan_end || + * *(ushf*)match != scan_start) continue; + * [...] + * } while ((cur_match = prev[cur_match & wmask]) > limit + * && --chain_length != 0); + * + * Here is the inner loop of the function. The function will spend the + * majority of its time in this loop, and majority of that time will + * be spent in the first ten instructions. + * + * Within this loop: + * %ebx = scanend + * %ecx = curmatch + * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) + * %esi = windowbestlen - i.e., (window + bestlen) + * %edi = prev + * %ebp = limit + */ +LookupLoop: + andl %edx, %ecx + movzwl (%edi,%ecx,2), %ecx + cmpl %ebp, %ecx + jbe LeaveNow + subl $0x00010000, %edx + js LeaveNow +LoopEntry: movzwl -1(%esi,%ecx), %eax + cmpl %ebx, %eax + jnz LookupLoop + movl window(%esp), %eax + movzwl (%eax,%ecx), %eax + cmpl scanstart(%esp), %eax + jnz LookupLoop + +/* Store the current value of chainlen. */ + + movl %edx, chainlenwmask(%esp) + +/* Point %edi to the string under scrutiny, and %esi to the string we */ +/* are hoping to match it up with. In actuality, %esi and %edi are */ +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ +/* initialized to -(MAX_MATCH_8 - scanalign). */ + + movl window(%esp), %esi + movl scan(%esp), %edi + addl %ecx, %esi + movl scanalign(%esp), %eax + movl $(-MAX_MATCH_8), %edx + lea MAX_MATCH_8(%edi,%eax), %edi + lea MAX_MATCH_8(%esi,%eax), %esi + +/* Test the strings for equality, 8 bytes at a time. At the end, + * adjust %edx so that it is offset to the exact byte that mismatched. + * + * We already know at this point that the first three bytes of the + * strings match each other, and they can be safely passed over before + * starting the compare loop. So what this code does is skip over 0-3 + * bytes, as much as necessary in order to dword-align the %edi + * pointer. (%esi will still be misaligned three times out of four.) + * + * It should be confessed that this loop usually does not represent + * much of the total running time. Replacing it with a more + * straightforward "rep cmpsb" would not drastically degrade + * performance. + */ +LoopCmps: + movl (%esi,%edx), %eax + xorl (%edi,%edx), %eax + jnz LeaveLoopCmps + movl 4(%esi,%edx), %eax + xorl 4(%edi,%edx), %eax + jnz LeaveLoopCmps4 + addl $8, %edx + jnz LoopCmps + jmp LenMaximum +LeaveLoopCmps4: addl $4, %edx +LeaveLoopCmps: testl $0x0000FFFF, %eax + jnz LenLower + addl $2, %edx + shrl $16, %eax +LenLower: subb $1, %al + adcl $0, %edx + +/* Calculate the length of the match. If it is longer than MAX_MATCH, */ +/* then automatically accept it as the best possible match and leave. */ + + lea (%edi,%edx), %eax + movl scan(%esp), %edi + subl %edi, %eax + cmpl $MAX_MATCH, %eax + jge LenMaximum + +/* If the length of the match is not longer than the best match we */ +/* have so far, then forget it and return to the lookup loop. */ + + movl deflatestate(%esp), %edx + movl bestlen(%esp), %ebx + cmpl %ebx, %eax + jg LongerMatch + movl windowbestlen(%esp), %esi + movl dsPrev(%edx), %edi + movl scanend(%esp), %ebx + movl chainlenwmask(%esp), %edx + jmp LookupLoop + +/* s->match_start = cur_match; */ +/* best_len = len; */ +/* if (len >= nice_match) break; */ +/* scan_end = *(ushf*)(scan+best_len-1); */ + +LongerMatch: movl nicematch(%esp), %ebx + movl %eax, bestlen(%esp) + movl %ecx, dsMatchStart(%edx) + cmpl %ebx, %eax + jge LeaveNow + movl window(%esp), %esi + addl %eax, %esi + movl %esi, windowbestlen(%esp) + movzwl -1(%edi,%eax), %ebx + movl dsPrev(%edx), %edi + movl %ebx, scanend(%esp) + movl chainlenwmask(%esp), %edx + jmp LookupLoop + +/* Accept the current string, with the maximum possible length. */ + +LenMaximum: movl deflatestate(%esp), %edx + movl $MAX_MATCH, bestlen(%esp) + movl %ecx, dsMatchStart(%edx) + +/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ +/* return s->lookahead; */ + +LeaveNow: + movl deflatestate(%esp), %edx + movl bestlen(%esp), %ebx + movl dsLookahead(%edx), %eax + cmpl %eax, %ebx + jg LookaheadRet + movl %ebx, %eax +LookaheadRet: + +/* Restore the stack and return from whence we came. */ + + addl $LocalVarsSize, %esp + .cfi_def_cfa_offset 20 + popl %ebx + .cfi_def_cfa_offset 16 + popl %esi + .cfi_def_cfa_offset 12 + popl %edi + .cfi_def_cfa_offset 8 + popl %ebp + .cfi_def_cfa_offset 4 +.cfi_endproc +match_init: ret diff --git a/sys/dev/ice/ice_sriov.c b/sys/dev/ice/ice_sriov.c new file mode 100644 index 000000000000..c0521e667fa2 --- /dev/null +++ b/sys/dev/ice/ice_sriov.c @@ -0,0 +1,595 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright (c) 2021, Intel Corporation + * 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 Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ice_common.h" +#include "ice_sriov.h" + +/** + * ice_aq_send_msg_to_vf + * @hw: pointer to the hardware structure + * @vfid: VF ID to send msg + * @v_opcode: opcodes for VF-PF communication + * @v_retval: return error code + * @msg: pointer to the msg buffer + * @msglen: msg length + * @cd: pointer to command details + * + * Send message to VF driver (0x0802) using mailbox + * queue and asynchronously sending message via + * ice_sq_send_cmd() function + */ +enum ice_status +ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval, + u8 *msg, u16 msglen, struct ice_sq_cd *cd) +{ + struct ice_aqc_pf_vf_msg *cmd; + struct ice_aq_desc desc; + + ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf); + + cmd = &desc.params.virt; + cmd->id = CPU_TO_LE32(vfid); + + desc.cookie_high = CPU_TO_LE32(v_opcode); + desc.cookie_low = CPU_TO_LE32(v_retval); + + if (msglen) + desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); + + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); +} + +/** + * ice_aq_send_msg_to_pf + * @hw: pointer to the hardware structure + * @v_opcode: opcodes for VF-PF communication + * @v_retval: return error code + * @msg: pointer to the msg buffer + * @msglen: msg length + * @cd: pointer to command details + * + * Send message to PF driver using mailbox queue. By default, this + * message is sent asynchronously, i.e. ice_sq_send_cmd() + * does not wait for completion before returning. + */ +enum ice_status +ice_aq_send_msg_to_pf(struct ice_hw *hw, enum virtchnl_ops v_opcode, + enum ice_status v_retval, u8 *msg, u16 msglen, + struct ice_sq_cd *cd) +{ + struct ice_aq_desc desc; + + ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_pf); + desc.cookie_high = CPU_TO_LE32(v_opcode); + desc.cookie_low = CPU_TO_LE32(v_retval); + + if (msglen) + desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); + + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); +} + +/** + * ice_conv_link_speed_to_virtchnl + * @adv_link_support: determines the format of the returned link speed + * @link_speed: variable containing the link_speed to be converted + * + * Convert link speed supported by HW to link speed supported by virtchnl. + * If adv_link_support is true, then return link speed in Mbps. Else return + * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that the caller + * needs to cast back to an enum virtchnl_link_speed in the case where + * adv_link_support is false, but when adv_link_support is true the caller can + * expect the speed in Mbps. + */ +u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_speed) +{ + u32 speed; + + if (adv_link_support) + switch (link_speed) { + case ICE_AQ_LINK_SPEED_10MB: + speed = ICE_LINK_SPEED_10MBPS; + break; + case ICE_AQ_LINK_SPEED_100MB: + speed = ICE_LINK_SPEED_100MBPS; + break; + case ICE_AQ_LINK_SPEED_1000MB: + speed = ICE_LINK_SPEED_1000MBPS; + break; + case ICE_AQ_LINK_SPEED_2500MB: + speed = ICE_LINK_SPEED_2500MBPS; + break; + case ICE_AQ_LINK_SPEED_5GB: + speed = ICE_LINK_SPEED_5000MBPS; + break; + case ICE_AQ_LINK_SPEED_10GB: + speed = ICE_LINK_SPEED_10000MBPS; + break; + case ICE_AQ_LINK_SPEED_20GB: + speed = ICE_LINK_SPEED_20000MBPS; + break; + case ICE_AQ_LINK_SPEED_25GB: + speed = ICE_LINK_SPEED_25000MBPS; + break; + case ICE_AQ_LINK_SPEED_40GB: + speed = ICE_LINK_SPEED_40000MBPS; + break; + case ICE_AQ_LINK_SPEED_50GB: + speed = ICE_LINK_SPEED_50000MBPS; + break; + case ICE_AQ_LINK_SPEED_100GB: + speed = ICE_LINK_SPEED_100000MBPS; + break; + default: + speed = ICE_LINK_SPEED_UNKNOWN; + break; + } + else + /* Virtchnl speeds are not defined for every speed supported in + * the hardware. To maintain compatibility with older AVF + * drivers, while reporting the speed the new speed values are + * resolved to the closest known virtchnl speeds + */ + switch (link_speed) { + case ICE_AQ_LINK_SPEED_10MB: + case ICE_AQ_LINK_SPEED_100MB: + speed = (u32)VIRTCHNL_LINK_SPEED_100MB; + break; + case ICE_AQ_LINK_SPEED_1000MB: + case ICE_AQ_LINK_SPEED_2500MB: + case ICE_AQ_LINK_SPEED_5GB: + speed = (u32)VIRTCHNL_LINK_SPEED_1GB; + break; + case ICE_AQ_LINK_SPEED_10GB: + speed = (u32)VIRTCHNL_LINK_SPEED_10GB; + break; + case ICE_AQ_LINK_SPEED_20GB: + speed = (u32)VIRTCHNL_LINK_SPEED_20GB; + break; + case ICE_AQ_LINK_SPEED_25GB: + speed = (u32)VIRTCHNL_LINK_SPEED_25GB; + break; + case ICE_AQ_LINK_SPEED_40GB: + case ICE_AQ_LINK_SPEED_50GB: + case ICE_AQ_LINK_SPEED_100GB: + speed = (u32)VIRTCHNL_LINK_SPEED_40GB; + break; + default: + speed = (u32)VIRTCHNL_LINK_SPEED_UNKNOWN; + break; + } + + return speed; +} + +/* The mailbox overflow detection algorithm helps to check if there + * is a possibility of a malicious VF transmitting too many MBX messages to the + * PF. + * 1. The mailbox snapshot structure, ice_mbx_snapshot, is initialized during + * driver initialization in ice_init_hw() using ice_mbx_init_snapshot(). + * The struct ice_mbx_snapshot helps to track and traverse a static window of + * messages within the mailbox queue while looking for a malicious VF. + * + * 2. When the caller starts processing its mailbox queue in response to an + * interrupt, the structure ice_mbx_snapshot is expected to be cleared before + * the algorithm can be run for the first time for that interrupt. This can be + * done via ice_mbx_reset_snapshot(). + * + * 3. For every message read by the caller from the MBX Queue, the caller must + * call the detection algorithm's entry function ice_mbx_vf_state_handler(). + * Before every call to ice_mbx_vf_state_handler() the struct ice_mbx_data is + * filled as it is required to be passed to the algorithm. + * + * 4. Every time a message is read from the MBX queue, a VFId is received which + * is passed to the state handler. The boolean output is_malvf of the state + * handler ice_mbx_vf_state_handler() serves as an indicator to the caller + * whether this VF is malicious or not. + * + * 5. When a VF is identified to be malicious, the caller can send a message + * to the system administrator. The caller can invoke ice_mbx_report_malvf() + * to help determine if a malicious VF is to be reported or not. This function + * requires the caller to maintain a global bitmap to track all malicious VFs + * and pass that to ice_mbx_report_malvf() along with the VFID which was identified + * to be malicious by ice_mbx_vf_state_handler(). + * + * 6. The global bitmap maintained by PF can be cleared completely if PF is in + * reset or the bit corresponding to a VF can be cleared if that VF is in reset. + * When a VF is shut down and brought back up, we assume that the new VF + * brought up is not malicious and hence report it if found malicious. + * + * 7. The function ice_mbx_reset_snapshot() is called to reset the information + * in ice_mbx_snapshot for every new mailbox interrupt handled. + * + * 8. The memory allocated for variables in ice_mbx_snapshot is de-allocated + * when driver is unloaded. + */ +#define ICE_RQ_DATA_MASK(rq_data) ((rq_data) & PF_MBX_ARQH_ARQH_M) +/* Using the highest value for an unsigned 16-bit value 0xFFFF to indicate that + * the max messages check must be ignored in the algorithm + */ +#define ICE_IGNORE_MAX_MSG_CNT 0xFFFF + +/** + * ice_mbx_traverse - Pass through mailbox snapshot + * @hw: pointer to the HW struct + * @new_state: new algorithm state + * + * Traversing the mailbox static snapshot without checking + * for malicious VFs. + */ +static void +ice_mbx_traverse(struct ice_hw *hw, + enum ice_mbx_snapshot_state *new_state) +{ + struct ice_mbx_snap_buffer_data *snap_buf; + u32 num_iterations; + + snap_buf = &hw->mbx_snapshot.mbx_buf; + + /* As mailbox buffer is circular, applying a mask + * on the incremented iteration count. + */ + num_iterations = ICE_RQ_DATA_MASK(++snap_buf->num_iterations); + + /* Checking either of the below conditions to exit snapshot traversal: + * Condition-1: If the number of iterations in the mailbox is equal to + * the mailbox head which would indicate that we have reached the end + * of the static snapshot. + * Condition-2: If the maximum messages serviced in the mailbox for a + * given interrupt is the highest possible value then there is no need + * to check if the number of messages processed is equal to it. If not + * check if the number of messages processed is greater than or equal + * to the maximum number of mailbox entries serviced in current work item. + */ + if (num_iterations == snap_buf->head || + (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && + ++snap_buf->num_msg_proc >= snap_buf->max_num_msgs_mbx)) + *new_state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; +} + +/** + * ice_mbx_detect_malvf - Detect malicious VF in snapshot + * @hw: pointer to the HW struct + * @vf_id: relative virtual function ID + * @new_state: new algorithm state + * @is_malvf: boolean output to indicate if VF is malicious + * + * This function tracks the number of asynchronous messages + * sent per VF and marks the VF as malicious if it exceeds + * the permissible number of messages to send. + */ +static enum ice_status +ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id, + enum ice_mbx_snapshot_state *new_state, + bool *is_malvf) +{ + struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; + + if (vf_id >= snap->mbx_vf.vfcntr_len) + return ICE_ERR_OUT_OF_RANGE; + + /* increment the message count in the VF array */ + snap->mbx_vf.vf_cntr[vf_id]++; + + if (snap->mbx_vf.vf_cntr[vf_id] >= ICE_ASYNC_VF_MSG_THRESHOLD) + *is_malvf = true; + + /* continue to iterate through the mailbox snapshot */ + ice_mbx_traverse(hw, new_state); + + return ICE_SUCCESS; +} + +/** + * ice_mbx_reset_snapshot - Reset mailbox snapshot structure + * @snap: pointer to mailbox snapshot structure in the ice_hw struct + * + * Reset the mailbox snapshot structure and clear VF counter array. + */ +static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap) *** 15611 LINES SKIPPED *** From nobody Fri Aug 16 02:30:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlQvQ2lsDz5TLCb; Fri, 16 Aug 2024 02:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlQvQ0fS0z4b4X; Fri, 16 Aug 2024 02:30:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723775426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HoIo1/Bi90miv44QpPYoJ/hLZPOouYwrAq0qR5+vFfs=; b=RoeN2E6cqAg4IU+AL7zPr5lGXRdandbLipBtgK8nSrR0XC9NP4mCLINqh0BVEVQA6Q6CvS o59iCKxXTRmfCBN9Off7S8HZJ9qd0J2A4dcW7tZWfQBoHUDdUSGnDo8SM1qI75RKhpgbgK I97cwgZ7xBKF+siCj4d6A09AjIDszTgXbyuEhETTH7bc0Zln3AUeK7d3CacjcRQFOfcJeh SoPMJtbEn7qpwutspjICb6sgf75OP5oZjvVtOquuEASY6OBfxoxCknYbVVo4D1GRkZUNZX oHRRAoSVX+JQsY97bXFyuQW2Ia2LK69jK1Oc9b6LHIfrsVwgYYi7Ic/2N1ZA9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723775426; a=rsa-sha256; cv=none; b=YU7YpdySUOBSZp3UzIqr6SQPhsqizBODOmW6k73GpKuO2FxjcFH0Dkj6VKYitVTN6Xvd7r SAjEF6Yqz4dP3UsredvDbKe7Cvdo8zPR9npE8p4Fx204865Od4aiKSzaRg7o6e7a6cXbj9 23MPmYkqCxPHF865IIRWPCMwVjPhx/cvQJq1OaCveo33JJMg0XqiaktB3D7QcSiXae6Qgx klYXpoghVWxr1n33spcx14S02HxbHeG6xP87cTXH5btzvVYzjnC7WxolWrS9Kw42bHQPyZ ZS7JQ105CqkKdiGtnCiLHyUn7fN74T33U9AbQc49p6G3cQvk6LV8Wg5cBDQ3nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723775426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HoIo1/Bi90miv44QpPYoJ/hLZPOouYwrAq0qR5+vFfs=; b=fpfkCLBVvA7QAKdB2OjYPFwJT8J4/4VmXvEyNYLYwKNdjJXFGEMUsgdETP8ksFwQ4/lsI+ Qtxka6GvAZzUiKtaGFnVhgJI6ES/kLnUwPvm3S5KyYAZ0uBohuWkXSDh7tG92S9xpLteUd 1odoSHY21dK0FIEZsQs4538hnt+xF6+9WBwy4ZVLBlSnJq0NM5Y90eR2AydQ5k/PvNpbfD AIGTbF+pNtDGU9giTourizcrMqmEBEjqd/9/rbmNKsHb08l8GhtEkJDpzIJOqG7O8YlNHX rEH7/fn1vIfyzf75KBo6rI3VbCTUfztnho3zUNgFpAQHBjs9iJkXZYGz6lCrJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlQvP6s53zpBR; Fri, 16 Aug 2024 02:30:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G2UP7p045874; Fri, 16 Aug 2024 02:30:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G2UP4V045871; Fri, 16 Aug 2024 02:30:25 GMT (envelope-from git) Date: Fri, 16 Aug 2024 02:30:25 GMT Message-Id: <202408160230.47G2UP4V045871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a233cb6914e6 - main - nvmecontrol: Accept -a {1,2,3,4} for sanitize command for nvme-cli compat List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a233cb6914e68252baf143c5f1d6e01e3956e33e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a233cb6914e68252baf143c5f1d6e01e3956e33e commit a233cb6914e68252baf143c5f1d6e01e3956e33e Author: Warner Losh AuthorDate: 2024-08-15 21:10:17 +0000 Commit: Warner Losh CommitDate: 2024-08-16 02:22:31 +0000 nvmecontrol: Accept -a {1,2,3,4} for sanitize command for nvme-cli compat Linux's `nvme sanititze -a` takes a number, not a string. Accept 1-4 for compatibility so vendor's recepies are easier to implmement. Sponsored by: Netflix --- sbin/nvmecontrol/nvmecontrol.8 | 10 ++++++++++ sbin/nvmecontrol/sanitize.c | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index 713fcf092d64..cb3e8aa9080f 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -572,6 +572,16 @@ A failed sanitize operation can only be exited if it was run in the unrestricted completion mode, as provided by the .Fl U argument. +.It 1, 2, 3, 4 +nvme-cli compatible +.Fl a +values for +.Dq exitfailure , +.Dq block , +.Dq overwrite , +and +.Dq crypto +respectively. .El .It Fl c Ar passes The number of passes when performing an diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index ba89e138db83..e720c6d43497 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -130,8 +130,11 @@ sanitize(const struct cmd *f, int argc, char *argv[]) sanact = 3; else if (strcmp(opt.sanact, "crypto") == 0) sanact = 4; + else if ((sanact = (int)strtol(opt.sanact, NULL, 10) != 0) + && (sanact >= 1 && sanact <= 4)) + ; /* compat with nvme sanitize -a number */ else { - fprintf(stderr, "Incorrect Sanitize Action value\n"); + fprintf(stderr, "Incorrect Sanitize Action value: %s\n", opt.sanact); arg_help(argc, argv, f); } } From nobody Fri Aug 16 03:12:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlRqf3xwxz5HmKF; Fri, 16 Aug 2024 03:12:14 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlRqf3kcFz4fTl; Fri, 16 Aug 2024 03:12:14 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723777934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B0GLd6R/jipMdgSdxjcN1RJdeX5sOQYe12xix51UPZY=; b=ccFx3LfPOGqlCLI7kVhI2UTTd+lIeg9Qt+Wo5pbSeMf50qYxHnNjf6XLL3uYxat0xWsYAu dIybGx52engjZNaLLbv0no3OAHOU4hbFaRSmAZKCBhXO6OfOEfMmbAolCFoFa3h+lc/Cgz 3fDqGCmABdlWhUojV8n1c6FoUj9+Uda15KBGMJ6h4yYPeY5eCqKTVQDuw27xmIfAQ/bTxd EA4yYK0ryU5RVpvRKUoORC4ABbFYV4R2V35949gn2G6G7gOHucP9sI4n3O6/LCliCaA370 5vkqKg424GbeIY6Zm+qJzl+Xn8WvkOMF+dgeZ9vdH3QIZqHhOvf1hMnuzZPFrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723777934; a=rsa-sha256; cv=none; b=gRBsgoFp08KnxSgwEAkjwW3Y9blu1xBZ+TQnS829K1o+nroMOGOLg3pGP/terRSTF3p9T3 9h5hF5oGMVqkqYR4BofeKLW8PyP0ZofC8Nmyx9pxN8IKxHwc31zrYgqwCt5zbSRLE1qjB4 4xaW/RWu931EzXDYLxMW8KqlxeY4GSQeCmomSvMTPuO1D1GZR0oryK2irKerbPjzovsN15 lA9GZKV9pdnJZ9v3DuuAnsTHZrZro+jf/g7nGE2Jm2ozOyqZyqmqDlVIT50onAXRTYcc7z mqKOYqnB60c4hGyUX9GoPoopcs8s88xRRgxWK/q/eA7FNGz8AZduP75XVdqcdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723777934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B0GLd6R/jipMdgSdxjcN1RJdeX5sOQYe12xix51UPZY=; b=E98rcQi0KotTYFPwM0K+dFTQta2uUKw3l/EV1QtqQ1+cXixXNTSSdj6kl4hrD9EZA+Ro5q NiY7gAlkEh5gKFCsmAOfTNQO4dbLvZbqlWWZ/ehsHuoDL0Xv5XeC1RIpibmT37zc6GOdCC n9RzHoamYwewl/i+yrN+3B6jkmkJJM+i7sggFa1BEp1d/NugZjm8x6EWFrSIIqCx6BywO4 X1Qcl5XFUJA78JXnjUat2vCIqj60rtxaUAiFNt0WVPH9ZnZlkqbD9EzHh0JCnDDKor27r/ sRNAZGd9B9Mic9WsLhoXIqXbk+RvFPjWTLllzVL9szWO/Z46oYg726MOcjqF5g== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WlRqc0rzXz13KG; Fri, 16 Aug 2024 03:12:11 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: git: d5507f9e4366 - main - nvme: Separate total failures from I/O failures From: Zhenlei Huang In-Reply-To: <202408160230.47G2UO9J045807@gitrepo.freebsd.org> Date: Fri, 16 Aug 2024 11:12:05 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0936F9D3-86A7-46AF-83E3-3EE63C41DA67@FreeBSD.org> References: <202408160230.47G2UO9J045807@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3696.120.41.1.8) Hi Warner, I'm not sure but this change seems include lots of unintended changes ( = maybe some local WIP ) . > On Aug 16, 2024, at 10:30 AM, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd5507f9e436698ac17dc5ace7ef58493= 988a9b04 >=20 > commit d5507f9e436698ac17dc5ace7ef58493988a9b04 > Author: Warner Losh > AuthorDate: 2024-08-14 22:55:49 +0000 > Commit: Warner Losh > CommitDate: 2024-08-16 02:22:18 +0000 >=20 > nvme: Separate total failures from I/O failures >=20 > When it's a I/O failure, we can still send admin commands. Separate = out > the admin failures and flag them as such so that we can still send = admin > commands on half-failed drives. >=20 > Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in = failed state) > Sponsored by: Netflix > --- > sys/amd64/conf/IOSCHED | 2 + > sys/amd64/conf/MPI3MR | 10 + > sys/arm64/conf/GENERIC16K | 4 + > .../linuxkpi/common/include/linux/#compiler.h# | 117 + > sys/contrib/dev/iwlwifi/fw/api/soc.h | 35 + > sys/contrib/zlib/contrib/asm686/README.686 | 51 + > sys/contrib/zlib/contrib/asm686/match.S | 357 + > sys/dev/ice/ice_sriov.c | 595 ++ > sys/dev/ice/ice_sriov.h | 64 + > sys/dev/mps/mpi/mpi2_pci.h | 141 + > sys/dev/nvme/nvme_ctrlr.c | 46 +- > sys/dev/nvme/nvme_private.h | 1 + > sys/dev/nvme/nvme_qpair.c | 23 +- > sys/dev/nvme/nvme_sim.c | 13 +- > sys/dev/sound/pci/aureal.c | 686 ++ > sys/dev/sound/pci/aureal.h | 99 + > sys/dev/sound/pci/ds1-fw.h | 1602 ++++ > sys/dev/sound/pci/ds1.c | 1103 +++ > sys/dev/sound/pci/ds1.h | 146 + > sys/dev/sound/pci/maestro.c | 2043 +++++ > sys/dev/sound/pci/maestro_reg.h | 381 + > sys/kern/bsduser-syscalls.c | 8712 = ++++++++++++++++++++ > sys/modules/sound/driver/ds1/Makefile | 8 + > sys/modules/sound/driver/maestro/Makefile | 8 + > 24 files changed, 16219 insertions(+), 28 deletions(-) >=20 > diff --git a/sys/amd64/conf/IOSCHED b/sys/amd64/conf/IOSCHED > new file mode 100644 > index 000000000000..e15106bc4c1f > --- /dev/null > +++ b/sys/amd64/conf/IOSCHED > @@ -0,0 +1,2 @@ > +include "GENERIC" > +options CAM_IOSCHED_DYNAMIC > diff --git a/sys/amd64/conf/MPI3MR b/sys/amd64/conf/MPI3MR > new file mode 100644 > index 000000000000..99e5244cb49d > --- /dev/null > +++ b/sys/amd64/conf/MPI3MR > @@ -0,0 +1,10 @@ > +include GENERIC > + > +device mpi3mr > +# All the debugging options > +options DEADLKRES # Enable the deadlock resolver > +options INVARIANTS # Enable calls of extra sanity checking > +options INVARIANT_SUPPORT # Extra sanity checks of internal = structures, required by INVARIANTS > +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on = invalidation > +options WITNESS # Enable checks to detect deadlocks and cycles > +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed > diff --git a/sys/arm64/conf/GENERIC16K b/sys/arm64/conf/GENERIC16K > new file mode 100644 > index 000000000000..9bf9e2dadb08 > --- /dev/null > +++ b/sys/arm64/conf/GENERIC16K > @@ -0,0 +1,4 @@ > +include "GENERIC" > + > +ident GENERIC_16K > + > diff --git a/sys/compat/linuxkpi/common/include/linux/#compiler.h# = b/sys/compat/linuxkpi/common/include/linux/#compiler.h# > new file mode 100644 > index 000000000000..1177674aa68f > --- /dev/null > +++ b/sys/compat/linuxkpi/common/include/linux/#compiler.h# > @@ -0,0 +1,117 @@ > +/*- > + * Copyright (c) 2010 Isilon Systems, Inc. > + * Copyright (c) 2010 iX Systems, Inc. > + * Copyright (c) 2010 Panasas, Inc. > + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. > + * Copyright (c) 2015 Fran=C3=A7ois Tigeot > + * 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 unmodified, this list of conditions, and the following > + * disclaimer. > + * 2. Redistributions in binary form must reproduce the above = copyright > + * notice, this list of conditions and the following disclaimer in = the > + * documentation and/or other materials provided with the = distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS = OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED = WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE = DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES = (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS = OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON = ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR = TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE = USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > +#ifndef _LINUX_COMPILER_H_ > +#define _LINUX_COMPILER_H_ > + > +#include > + > +#define __user > +#define __kernel > +#define __safe > +#define __force > +#define __nocast > +#define __iomem > +#define __chk_user_ptr(x) ((void)0) > +#define __chk_io_ptr(x) ((void)0) > +#define __builtin_warning(x, y...) (1) > +#define __acquires(x) > +#define __releases(x) > +#define __acquire(x) do { } while (0) > +#define __release(x) do { } while (0) > +#define __cond_lock(x,c) (c) > +#define __bitwise > +#define __devinitdata > +#define __deprecated > +#define __init > +#define __initconst > +#define __devinit > +#define __devexit > +#define __exit > +#define __rcu > +#define __percpu > +#define __weak __weak_symbol > +#define __malloc > +#define ___stringify(...) #__VA_ARGS__ > +#define __stringify(...) = ___stringify(__VA_ARGS__) > +#define __attribute_const__ = __attribute__((__const__)) > +#undef __always_inline > +#define __always_inline inline > +#define noinline __noinline > +#define ____cacheline_aligned = __aligned(CACHE_LINE_SIZE) > + > +#define likely(x) __builtin_expect(!!(x), = 1) > +#define unlikely(x) __builtin_expect(!!(x), = 0) > +#define typeof(x) __typeof(x) > + > +#define uninitialized_var(x) x =3D x > +#define __maybe_unused __unused > +#define __always_unused __unused > +#define __must_check __result_use_check > + > +#define __printf(a,b) __printflike(a,b) > + > +#define barrier() __asm__ __volatile__("": = : :"memory") > + > +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >=3D 50000 > +/* Moved from drm_os_freebsd.h */ > +#define lower_32_bits(n) ((u32)(n)) > +#define upper_32_bits(n) ((u32)(((n) >> 16) >> = 16)) > +#endif > + > +#define ___PASTE(a,b) a##b > +#define __PASTE(a,b) ___PASTE(a,b) > + > +#define ACCESS_ONCE(x) (*(volatile __typeof(x) = *)&(x)) > + > +#define WRITE_ONCE(x,v) do { \ > + barrier(); \ > + ACCESS_ONCE(x) =3D (v); \ > + barrier(); \ > +} while (0) > + > +#define READ_ONCE(x) ({ \ > + __typeof(x) __var =3D ({ \ > + barrier(); \ > + ACCESS_ONCE(x); \ > + }); \ > + barrier(); \ > + __var; \ > +}) > + > +#define lockless_dereference(p) READ_ONCE(p) > + > +#define _AT(T,X) ((T)(X)) > + > +#define __same_type(a, b) = __builtin_types_compatible_p(typeof(a), typeof(b)) > +#define __must_be_array(a) __same_type(a, &(a)[0]) > + > +#endif /* _LINUX_COMPILER_H_ */ > diff --git a/sys/contrib/dev/iwlwifi/fw/api/soc.h = b/sys/contrib/dev/iwlwifi/fw/api/soc.h > new file mode 100644 > index 000000000000..c5df1171462b > --- /dev/null > +++ b/sys/contrib/dev/iwlwifi/fw/api/soc.h > @@ -0,0 +1,35 @@ > +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ > +/* > + * Copyright (C) 2012-2014, 2019-2020 Intel Corporation > + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH > + * Copyright (C) 2016-2017 Intel Deutschland GmbH > + */ > +#ifndef __iwl_fw_api_soc_h__ > +#define __iwl_fw_api_soc_h__ > + > +#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0) > +#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1) > + > +#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc > +#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0 > +#define SOC_FLAGS_LTR_APPLY_DELAY_200 1 > +#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2 > +#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3 > + > +/** > + * struct iwl_soc_configuration_cmd - Set device stabilization = latency > + * > + * @flags: soc settings flags. In VER_1, we can only set the = DISCRETE > + * flag, because the FW treats the whole value as an integer. In > + * VER_2, we can set the bits independently. > + * @latency: time for SOC to ensure stable power & XTAL > + */ > +struct iwl_soc_configuration_cmd { > + __le32 flags; > + __le32 latency; > +} __packed; /* > + * SOC_CONFIGURATION_CMD_S_VER_1 (see description above) > + * SOC_CONFIGURATION_CMD_S_VER_2 > + */ > + > +#endif /* __iwl_fw_api_soc_h__ */ > diff --git a/sys/contrib/zlib/contrib/asm686/README.686 = b/sys/contrib/zlib/contrib/asm686/README.686 > new file mode 100644 > index 000000000000..a0bf3bea4aff > --- /dev/null > +++ b/sys/contrib/zlib/contrib/asm686/README.686 > @@ -0,0 +1,51 @@ > +This is a patched version of zlib, modified to use > +Pentium-Pro-optimized assembly code in the deflation algorithm. The > +files changed/added by this patch are: > + > +README.686 > +match.S > + > +The speedup that this patch provides varies, depending on whether the > +compiler used to build the original version of zlib falls afoul of = the > +PPro's speed traps. My own tests show a speedup of around 10-20% at > +the default compression level, and 20-30% using -9, against a version > +compiled using gcc 2.7.2.3. Your mileage may vary. > + > +Note that this code has been tailored for the PPro/PII in particular, > +and will not perform particuarly well on a Pentium. > + > +If you are using an assembler other than GNU as, you will have to > +translate match.S to use your assembler's syntax. (Have fun.) > + > +Brian Raiter > +breadbox@muppetlabs.com > +April, 1998 > + > + > +Added for zlib 1.1.3: > + > +The patches come from > +http://www.muppetlabs.com/~breadbox/software/assembly.html > + > +To compile zlib with this asm file, copy match.S to the zlib = directory > +then do: > + > +CFLAGS=3D"-O3 -DASMV" ./configure > +make OBJA=3Dmatch.o > + > + > +Update: > + > +I've been ignoring these assembly routines for years, believing that > +gcc's generated code had caught up with it sometime around gcc 2.95 > +and the major rearchitecting of the Pentium 4. However, I recently > +learned that, despite what I believed, this code still has some life > +in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% > +faster than the code produced by gcc 4.1. > + > +In acknowledgement of its continuing usefulness, I've altered the > +license to match that of the rest of zlib. Share and Enjoy! > + > +Brian Raiter > +breadbox@muppetlabs.com > +April, 2007 > diff --git a/sys/contrib/zlib/contrib/asm686/match.S = b/sys/contrib/zlib/contrib/asm686/match.S > new file mode 100644 > index 000000000000..fa421092785d > --- /dev/null > +++ b/sys/contrib/zlib/contrib/asm686/match.S > @@ -0,0 +1,357 @@ > +/* match.S -- x86 assembly version of the zlib longest_match() = function. > + * Optimized for the Intel 686 chips (PPro and later). > + * > + * Copyright (C) 1998, 2007 Brian Raiter > + * > + * This software is provided 'as-is', without any express or implied > + * warranty. In no event will the author be held liable for any = damages > + * arising from the use of this software. > + * > + * Permission is granted to anyone to use this software for any = purpose, > + * including commercial applications, and to alter it and = redistribute it > + * freely, subject to the following restrictions: > + * > + * 1. The origin of this software must not be misrepresented; you = must not > + * claim that you wrote the original software. If you use this = software > + * in a product, an acknowledgment in the product documentation = would be > + * appreciated but is not required. > + * 2. Altered source versions must be plainly marked as such, and = must not be > + * misrepresented as being the original software. > + * 3. This notice may not be removed or altered from any source = distribution. > + */ > + > +#ifndef NO_UNDERLINE > +#define match_init _match_init > +#define longest_match _longest_match > +#endif > + > +#define MAX_MATCH (258) > +#define MIN_MATCH (3) > +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) > +#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) > + > +/* stack frame offsets */ > + > +#define chainlenwmask 0 /* high word: current = chain len */ > + /* low word: s->wmask = */ > +#define window 4 /* local copy of = s->window */ > +#define windowbestlen 8 /* s->window + bestlen = */ > +#define scanstart 16 /* first two bytes of = string */ > +#define scanend 12 /* last two bytes of = string */ > +#define scanalign 20 /* dword-misalignment of = string */ > +#define nicematch 24 /* a good enough match = size */ > +#define bestlen 28 /* size of best match so = far */ > +#define scan 32 /* ptr to string wanting = match */ > + > +#define LocalVarsSize (36) > +/* saved ebx 36 */ > +/* saved edi 40 */ > +/* saved esi 44 */ > +/* saved ebp 48 */ > +/* return address 52 */ > +#define deflatestate 56 /* the function = arguments */ > +#define curmatch 60 > + > +/* All the +zlib1222add offsets are due to the addition of fields > + * in zlib in the deflate_state structure since the asm code was = first written > + * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ = (-4)"). > + * (if you compile with zlib between 1.0.5 and 1.2.2.1, use = "zlib1222add equ 0"). > + * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ = 8"). > + */ > + > +#define zlib1222add (8) > + > +#define dsWSize (36+zlib1222add) > +#define dsWMask (44+zlib1222add) > +#define dsWindow (48+zlib1222add) > +#define dsPrev (56+zlib1222add) > +#define dsMatchLen (88+zlib1222add) > +#define dsPrevMatch (92+zlib1222add) > +#define dsStrStart (100+zlib1222add) > +#define dsMatchStart (104+zlib1222add) > +#define dsLookahead (108+zlib1222add) > +#define dsPrevLen (112+zlib1222add) > +#define dsMaxChainLen (116+zlib1222add) > +#define dsGoodMatch (132+zlib1222add) > +#define dsNiceMatch (136+zlib1222add) > + > + > +.file "match.S" > + > +.globl match_init, longest_match > + > +.text > + > +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ > +.cfi_sections .debug_frame > + > +longest_match: > + > +.cfi_startproc > +/* Save registers that the compiler may be using, and adjust %esp to = */ > +/* make room for our stack frame. = */ > + > + pushl %ebp > + .cfi_def_cfa_offset 8 > + .cfi_offset ebp, -8 > + pushl %edi > + .cfi_def_cfa_offset 12 > + pushl %esi > + .cfi_def_cfa_offset 16 > + pushl %ebx > + .cfi_def_cfa_offset 20 > + subl $LocalVarsSize, %esp > + .cfi_def_cfa_offset LocalVarsSize+20 > + > +/* Retrieve the function arguments. %ecx will hold cur_match = */ > +/* throughout the entire function. %edx will hold the pointer to the = */ > +/* deflate_state structure during the function's setup (before = */ > +/* entering the main loop). = */ > + > + movl deflatestate(%esp), %edx > + movl curmatch(%esp), %ecx > + > +/* uInt wmask =3D s->w_mask; = */ > +/* unsigned chain_length =3D s->max_chain_length; = */ > +/* if (s->prev_length >=3D s->good_match) { = */ > +/* chain_length >>=3D 2; = */ > +/* } = */ > +=20 > + movl dsPrevLen(%edx), %eax > + movl dsGoodMatch(%edx), %ebx > + cmpl %ebx, %eax > + movl dsWMask(%edx), %eax > + movl dsMaxChainLen(%edx), %ebx > + jl LastMatchGood > + shrl $2, %ebx > +LastMatchGood: > + > +/* chainlen is decremented once beforehand so that the function can = */ > +/* use the sign flag instead of the zero flag for the exit test. = */ > +/* It is then shifted into the high word, to make room for the wmask = */ > +/* value, which it will always accompany. = */ > + > + decl %ebx > + shll $16, %ebx > + orl %eax, %ebx > + movl %ebx, chainlenwmask(%esp) > + > +/* if ((uInt)nice_match > s->lookahead) nice_match =3D s->lookahead; = */ > + > + movl dsNiceMatch(%edx), %eax > + movl dsLookahead(%edx), %ebx > + cmpl %eax, %ebx > + jl LookaheadLess > + movl %eax, %ebx > +LookaheadLess: movl %ebx, nicematch(%esp) > + > +/* register Bytef *scan =3D s->window + s->strstart; = */ > + > + movl dsWindow(%edx), %esi > + movl %esi, window(%esp) > + movl dsStrStart(%edx), %ebp > + lea (%esi,%ebp), %edi > + movl %edi, scan(%esp) > + > +/* Determine how many bytes the scan ptr is off from being = */ > +/* dword-aligned. = */ > + > + movl %edi, %eax > + negl %eax > + andl $3, %eax > + movl %eax, scanalign(%esp) > + > +/* IPos limit =3D s->strstart > (IPos)MAX_DIST(s) ? = */ > +/* s->strstart - (IPos)MAX_DIST(s) : NIL; = */ > + > + movl dsWSize(%edx), %eax > + subl $MIN_LOOKAHEAD, %eax > + subl %eax, %ebp > + jg LimitPositive > + xorl %ebp, %ebp > +LimitPositive: > + > +/* int best_len =3D s->prev_length; = */ > + > + movl dsPrevLen(%edx), %eax > + movl %eax, bestlen(%esp) > + > +/* Store the sum of s->window + best_len in %esi locally, and in = %esi. */ > + > + addl %eax, %esi > + movl %esi, windowbestlen(%esp) > + > +/* register ush scan_start =3D *(ushf*)scan; = */ > +/* register ush scan_end =3D *(ushf*)(scan+best_len-1); = */ > +/* Posf *prev =3D s->prev; = */ > + > + movzwl (%edi), %ebx > + movl %ebx, scanstart(%esp) > + movzwl -1(%edi,%eax), %ebx > + movl %ebx, scanend(%esp) > + movl dsPrev(%edx), %edi > + > +/* Jump into the main loop. = */ > + > + movl chainlenwmask(%esp), %edx > + jmp LoopEntry > + > +.balign 16 > + > +/* do { > + * match =3D s->window + cur_match; > + * if (*(ushf*)(match+best_len-1) !=3D scan_end || > + * *(ushf*)match !=3D scan_start) continue; > + * [...] > + * } while ((cur_match =3D prev[cur_match & wmask]) > limit > + * && --chain_length !=3D 0); > + * > + * Here is the inner loop of the function. The function will spend = the > + * majority of its time in this loop, and majority of that time will > + * be spent in the first ten instructions. > + * > + * Within this loop: > + * %ebx =3D scanend > + * %ecx =3D curmatch > + * %edx =3D chainlenwmask - i.e., ((chainlen << 16) | wmask) > + * %esi =3D windowbestlen - i.e., (window + bestlen) > + * %edi =3D prev > + * %ebp =3D limit > + */ > +LookupLoop: > + andl %edx, %ecx > + movzwl (%edi,%ecx,2), %ecx > + cmpl %ebp, %ecx > + jbe LeaveNow > + subl $0x00010000, %edx > + js LeaveNow > +LoopEntry: movzwl -1(%esi,%ecx), %eax > + cmpl %ebx, %eax > + jnz LookupLoop > + movl window(%esp), %eax > + movzwl (%eax,%ecx), %eax > + cmpl scanstart(%esp), %eax > + jnz LookupLoop > + > +/* Store the current value of chainlen. = */ > + > + movl %edx, chainlenwmask(%esp) > + > +/* Point %edi to the string under scrutiny, and %esi to the string we = */ > +/* are hoping to match it up with. In actuality, %esi and %edi are = */ > +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is = */ > +/* initialized to -(MAX_MATCH_8 - scanalign). = */ > + > + movl window(%esp), %esi > + movl scan(%esp), %edi > + addl %ecx, %esi > + movl scanalign(%esp), %eax > + movl $(-MAX_MATCH_8), %edx > + lea MAX_MATCH_8(%edi,%eax), %edi > + lea MAX_MATCH_8(%esi,%eax), %esi > + > +/* Test the strings for equality, 8 bytes at a time. At the end, > + * adjust %edx so that it is offset to the exact byte that = mismatched. > + * > + * We already know at this point that the first three bytes of the > + * strings match each other, and they can be safely passed over = before > + * starting the compare loop. So what this code does is skip over 0-3 > + * bytes, as much as necessary in order to dword-align the %edi > + * pointer. (%esi will still be misaligned three times out of four.) > + * > + * It should be confessed that this loop usually does not represent > + * much of the total running time. Replacing it with a more > + * straightforward "rep cmpsb" would not drastically degrade > + * performance. > + */ > +LoopCmps: > + movl (%esi,%edx), %eax > + xorl (%edi,%edx), %eax > + jnz LeaveLoopCmps > + movl 4(%esi,%edx), %eax > + xorl 4(%edi,%edx), %eax > + jnz LeaveLoopCmps4 > + addl $8, %edx > + jnz LoopCmps > + jmp LenMaximum > +LeaveLoopCmps4: addl $4, %edx > +LeaveLoopCmps: testl $0x0000FFFF, %eax > + jnz LenLower > + addl $2, %edx > + shrl $16, %eax > +LenLower: subb $1, %al > + adcl $0, %edx > + > +/* Calculate the length of the match. If it is longer than MAX_MATCH, = */ > +/* then automatically accept it as the best possible match and leave. = */ > + > + lea (%edi,%edx), %eax > + movl scan(%esp), %edi > + subl %edi, %eax > + cmpl $MAX_MATCH, %eax > + jge LenMaximum > + > +/* If the length of the match is not longer than the best match we = */ > +/* have so far, then forget it and return to the lookup loop. = */ > + > + movl deflatestate(%esp), %edx > + movl bestlen(%esp), %ebx > + cmpl %ebx, %eax > + jg LongerMatch > + movl windowbestlen(%esp), %esi > + movl dsPrev(%edx), %edi > + movl scanend(%esp), %ebx > + movl chainlenwmask(%esp), %edx > + jmp LookupLoop > + > +/* s->match_start =3D cur_match; = */ > +/* best_len =3D len; = */ > +/* if (len >=3D nice_match) break; = */ > +/* scan_end =3D *(ushf*)(scan+best_len-1); = */ > + > +LongerMatch: movl nicematch(%esp), %ebx > + movl %eax, bestlen(%esp) > + movl %ecx, dsMatchStart(%edx) > + cmpl %ebx, %eax > + jge LeaveNow > + movl window(%esp), %esi > + addl %eax, %esi > + movl %esi, windowbestlen(%esp) > + movzwl -1(%edi,%eax), %ebx > + movl dsPrev(%edx), %edi > + movl %ebx, scanend(%esp) > + movl chainlenwmask(%esp), %edx > + jmp LookupLoop > + > +/* Accept the current string, with the maximum possible length. = */ > + > +LenMaximum: movl deflatestate(%esp), %edx > + movl $MAX_MATCH, bestlen(%esp) > + movl %ecx, dsMatchStart(%edx) > + > +/* if ((uInt)best_len <=3D s->lookahead) return (uInt)best_len; = */ > +/* return s->lookahead; = */ > + > +LeaveNow: > + movl deflatestate(%esp), %edx > + movl bestlen(%esp), %ebx > + movl dsLookahead(%edx), %eax > + cmpl %eax, %ebx > + jg LookaheadRet > + movl %ebx, %eax > +LookaheadRet: > + > +/* Restore the stack and return from whence we came. = */ > + > + addl $LocalVarsSize, %esp > + .cfi_def_cfa_offset 20 > + popl %ebx > + .cfi_def_cfa_offset 16 > + popl %esi > + .cfi_def_cfa_offset 12 > + popl %edi > + .cfi_def_cfa_offset 8 > + popl %ebp > + .cfi_def_cfa_offset 4 > +.cfi_endproc > +match_init: ret > diff --git a/sys/dev/ice/ice_sriov.c b/sys/dev/ice/ice_sriov.c > new file mode 100644 > index 000000000000..c0521e667fa2 > --- /dev/null > +++ b/sys/dev/ice/ice_sriov.c > @@ -0,0 +1,595 @@ > +/* SPDX-License-Identifier: BSD-3-Clause */ > +/* Copyright (c) 2021, Intel Corporation > + * 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 Intel Corporation nor the names of = its > + * contributors may be used to endorse or promote products = derived from > + * this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND = CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED = TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR = CONTRIBUTORS BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, = OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT = OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR = BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, = WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR = OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF = ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include "ice_common.h" > +#include "ice_sriov.h" > + > +/** > + * ice_aq_send_msg_to_vf > + * @hw: pointer to the hardware structure > + * @vfid: VF ID to send msg > + * @v_opcode: opcodes for VF-PF communication > + * @v_retval: return error code > + * @msg: pointer to the msg buffer > + * @msglen: msg length > + * @cd: pointer to command details > + * > + * Send message to VF driver (0x0802) using mailbox > + * queue and asynchronously sending message via > + * ice_sq_send_cmd() function > + */ > +enum ice_status > +ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 = v_retval, > + u8 *msg, u16 msglen, struct ice_sq_cd *cd) > +{ > + struct ice_aqc_pf_vf_msg *cmd; > + struct ice_aq_desc desc; > + > + ice_fill_dflt_direct_cmd_desc(&desc, = ice_mbx_opc_send_msg_to_vf); > + > + cmd =3D &desc.params.virt; > + cmd->id =3D CPU_TO_LE32(vfid); > + > + desc.cookie_high =3D CPU_TO_LE32(v_opcode); > + desc.cookie_low =3D CPU_TO_LE32(v_retval); > + > + if (msglen) > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > + > + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, = cd); > +} > + > +/** > + * ice_aq_send_msg_to_pf > + * @hw: pointer to the hardware structure > + * @v_opcode: opcodes for VF-PF communication > + * @v_retval: return error code > + * @msg: pointer to the msg buffer > + * @msglen: msg length > + * @cd: pointer to command details > + * > + * Send message to PF driver using mailbox queue. By default, this > + * message is sent asynchronously, i.e. ice_sq_send_cmd() > + * does not wait for completion before returning. > + */ > +enum ice_status > +ice_aq_send_msg_to_pf(struct ice_hw *hw, enum virtchnl_ops v_opcode, > + enum ice_status v_retval, u8 *msg, u16 msglen, > + struct ice_sq_cd *cd) > +{ > + struct ice_aq_desc desc; > + > + ice_fill_dflt_direct_cmd_desc(&desc, = ice_mbx_opc_send_msg_to_pf); > + desc.cookie_high =3D CPU_TO_LE32(v_opcode); > + desc.cookie_low =3D CPU_TO_LE32(v_retval); > + > + if (msglen) > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > + > + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, = cd); > +} > + > +/** > + * ice_conv_link_speed_to_virtchnl > + * @adv_link_support: determines the format of the returned link = speed > + * @link_speed: variable containing the link_speed to be converted > + * > + * Convert link speed supported by HW to link speed supported by = virtchnl. > + * If adv_link_support is true, then return link speed in Mbps. Else = return > + * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that = the caller > + * needs to cast back to an enum virtchnl_link_speed in the case = where > + * adv_link_support is false, but when adv_link_support is true the = caller can > + * expect the speed in Mbps. > + */ > +u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 = link_speed) > +{ > + u32 speed; > + > + if (adv_link_support) > + switch (link_speed) { > + case ICE_AQ_LINK_SPEED_10MB: > + speed =3D ICE_LINK_SPEED_10MBPS; > + break; > + case ICE_AQ_LINK_SPEED_100MB: > + speed =3D ICE_LINK_SPEED_100MBPS; > + break; > + case ICE_AQ_LINK_SPEED_1000MB: > + speed =3D ICE_LINK_SPEED_1000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_2500MB: > + speed =3D ICE_LINK_SPEED_2500MBPS; > + break; > + case ICE_AQ_LINK_SPEED_5GB: > + speed =3D ICE_LINK_SPEED_5000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_10GB: > + speed =3D ICE_LINK_SPEED_10000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_20GB: > + speed =3D ICE_LINK_SPEED_20000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_25GB: > + speed =3D ICE_LINK_SPEED_25000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_40GB: > + speed =3D ICE_LINK_SPEED_40000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_50GB: > + speed =3D ICE_LINK_SPEED_50000MBPS; > + break; > + case ICE_AQ_LINK_SPEED_100GB: > + speed =3D ICE_LINK_SPEED_100000MBPS; > + break; > + default: > + speed =3D ICE_LINK_SPEED_UNKNOWN; > + break; > + } > + else > + /* Virtchnl speeds are not defined for every speed = supported in > + * the hardware. To maintain compatibility with older = AVF > + * drivers, while reporting the speed the new speed = values are > + * resolved to the closest known virtchnl speeds > + */ > + switch (link_speed) { > + case ICE_AQ_LINK_SPEED_10MB: > + case ICE_AQ_LINK_SPEED_100MB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_100MB; > + break; > + case ICE_AQ_LINK_SPEED_1000MB: > + case ICE_AQ_LINK_SPEED_2500MB: > + case ICE_AQ_LINK_SPEED_5GB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_1GB; > + break; > + case ICE_AQ_LINK_SPEED_10GB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_10GB; > + break; > + case ICE_AQ_LINK_SPEED_20GB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_20GB; > + break; > + case ICE_AQ_LINK_SPEED_25GB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_25GB; > + break; > + case ICE_AQ_LINK_SPEED_40GB: > + case ICE_AQ_LINK_SPEED_50GB: > + case ICE_AQ_LINK_SPEED_100GB: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_40GB; > + break; > + default: > + speed =3D (u32)VIRTCHNL_LINK_SPEED_UNKNOWN; > + break; > + } > + > + return speed; > +} > + > +/* The mailbox overflow detection algorithm helps to check if there > + * is a possibility of a malicious VF transmitting too many MBX = messages to the > + * PF. > + * 1. The mailbox snapshot structure, ice_mbx_snapshot, is = initialized during > + * driver initialization in ice_init_hw() using = ice_mbx_init_snapshot(). > + * The struct ice_mbx_snapshot helps to track and traverse a static = window of > + * messages within the mailbox queue while looking for a malicious = VF. > + * > + * 2. When the caller starts processing its mailbox queue in response = to an > + * interrupt, the structure ice_mbx_snapshot is expected to be = cleared before > + * the algorithm can be run for the first time for that interrupt. = This can be > + * done via ice_mbx_reset_snapshot(). > + * > + * 3. For every message read by the caller from the MBX Queue, the = caller must > + * call the detection algorithm's entry function = ice_mbx_vf_state_handler(). > + * Before every call to ice_mbx_vf_state_handler() the struct = ice_mbx_data is > + * filled as it is required to be passed to the algorithm. > + * > + * 4. Every time a message is read from the MBX queue, a VFId is = received which > + * is passed to the state handler. The boolean output is_malvf of the = state > + * handler ice_mbx_vf_state_handler() serves as an indicator to the = caller > + * whether this VF is malicious or not. > + * > + * 5. When a VF is identified to be malicious, the caller can send a = message > + * to the system administrator. The caller can invoke = ice_mbx_report_malvf() > + * to help determine if a malicious VF is to be reported or not. This = function > + * requires the caller to maintain a global bitmap to track all = malicious VFs > + * and pass that to ice_mbx_report_malvf() along with the VFID which = was identified > + * to be malicious by ice_mbx_vf_state_handler(). > + * > + * 6. The global bitmap maintained by PF can be cleared completely if = PF is in > + * reset or the bit corresponding to a VF can be cleared if that VF = is in reset. > + * When a VF is shut down and brought back up, we assume that the new = VF > + * brought up is not malicious and hence report it if found = malicious. > + * > + * 7. The function ice_mbx_reset_snapshot() is called to reset the = information > + * in ice_mbx_snapshot for every new mailbox interrupt handled. > + * > + * 8. The memory allocated for variables in ice_mbx_snapshot is = de-allocated > + * when driver is unloaded. > + */ > +#define ICE_RQ_DATA_MASK(rq_data) ((rq_data) & PF_MBX_ARQH_ARQH_M) > +/* Using the highest value for an unsigned 16-bit value 0xFFFF to = indicate that > + * the max messages check must be ignored in the algorithm > + */ > +#define ICE_IGNORE_MAX_MSG_CNT 0xFFFF > + > +/** > + * ice_mbx_traverse - Pass through mailbox snapshot > + * @hw: pointer to the HW struct > + * @new_state: new algorithm state > + * > + * Traversing the mailbox static snapshot without checking > + * for malicious VFs. > + */ > +static void > +ice_mbx_traverse(struct ice_hw *hw, > + enum ice_mbx_snapshot_state *new_state) > +{ > + struct ice_mbx_snap_buffer_data *snap_buf; > + u32 num_iterations; > + > + snap_buf =3D &hw->mbx_snapshot.mbx_buf; > + > + /* As mailbox buffer is circular, applying a mask > + * on the incremented iteration count. > + */ > + num_iterations =3D ICE_RQ_DATA_MASK(++snap_buf->num_iterations); > + > + /* Checking either of the below conditions to exit snapshot = traversal: > + * Condition-1: If the number of iterations in the mailbox is = equal to > + * the mailbox head which would indicate that we have reached = the end > + * of the static snapshot. > + * Condition-2: If the maximum messages serviced in the mailbox = for a > + * given interrupt is the highest possible value then there is = no need > + * to check if the number of messages processed is equal to it. = If not > + * check if the number of messages processed is greater than or = equal > + * to the maximum number of mailbox entries serviced in current = work item. > + */ > + if (num_iterations =3D=3D snap_buf->head || > + (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && > + ++snap_buf->num_msg_proc >=3D snap_buf->max_num_msgs_mbx)) > + *new_state =3D ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; > +} > + > +/** > + * ice_mbx_detect_malvf - Detect malicious VF in snapshot > + * @hw: pointer to the HW struct > + * @vf_id: relative virtual function ID > + * @new_state: new algorithm state > + * @is_malvf: boolean output to indicate if VF is malicious > + * > + * This function tracks the number of asynchronous messages > + * sent per VF and marks the VF as malicious if it exceeds > + * the permissible number of messages to send. > + */ > +static enum ice_status > +ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id, > + enum ice_mbx_snapshot_state *new_state, > + bool *is_malvf) > +{ > + struct ice_mbx_snapshot *snap =3D &hw->mbx_snapshot; > + > + if (vf_id >=3D snap->mbx_vf.vfcntr_len) > + return ICE_ERR_OUT_OF_RANGE; > + > + /* increment the message count in the VF array */ > + snap->mbx_vf.vf_cntr[vf_id]++; > + > + if (snap->mbx_vf.vf_cntr[vf_id] >=3D ICE_ASYNC_VF_MSG_THRESHOLD) > + *is_malvf =3D true; > + > + /* continue to iterate through the mailbox snapshot */ > + ice_mbx_traverse(hw, new_state); > + > + return ICE_SUCCESS; > +} > + > +/** > + * ice_mbx_reset_snapshot - Reset mailbox snapshot structure > + * @snap: pointer to mailbox snapshot structure in the ice_hw struct > + * > + * Reset the mailbox snapshot structure and clear VF counter array. > + */ > +static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap) > *** 15611 LINES SKIPPED *** From nobody Fri Aug 16 03:28:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlSBH48tXz5HnB8 for ; Fri, 16 Aug 2024 03:28:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlSBG3dplz4gNr for ; Fri, 16 Aug 2024 03:28:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2cb5789297eso1179490a91.3 for ; Thu, 15 Aug 2024 20:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1723778900; x=1724383700; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZidV9mNcnlJ7yURE5uGPrxnxbUS+Q8S6PUqkUsxUPfY=; b=fRKmKdYvjRvuI7OYGu1JCO6/KjKzaY6pNCNl+O/ujLf/9mt0utyKKjRxXG+PPwEnZ6 u6GXti6hku8TIyOVsPyXydelrcxEolU204tSx4LiZNmHGaVxYyR12kok2OuS50y6KVHS q+joE9UWuA9kG3qDogUqgl7UQhC4mFvB98kpvhv1vTedUeRvv35RHvs/subu7JsaIYzI xhdeK8p1tfgcfYt2xaxWxo0VW/b7DIB1eVmybWozbSRa7OYf0UPQ8ixDFkAtC+8rehB1 bSQmtDx9kmCy18tDDFM5wc3JgfaL0mc8FloLgBKGDsjGZl/EBtmWaptKRHqOr7gm15nV /kIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723778900; x=1724383700; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZidV9mNcnlJ7yURE5uGPrxnxbUS+Q8S6PUqkUsxUPfY=; b=D4xpb6bh9G/4eyTBfka6qLZbiSGnb9uVETlzX1TWI3wbD5rPiEIowerPSjGjkOCsPD zqOJafREUrEb0rNuriK5OMD982j3Nm7muNGRAU1m2i0QNYgduEfAuGKRlwahkxs66DBL Ov5m1prBrreyB/1J93WnChOxc3KRjlrQ+bQazEYAU1lgQlj249mYoww21ibKEh3fECTj ZRf3h3Z2TOe6uDnzV2AdmzD/kl3IaXW606CjsfmHgh2dMnPqoIhKXBgLvcZ8+7cgqcAa a9ufo7thWvbo5p7gMbK23+jD/VVsJUZUC5xu3/9m+z+tvGFwGPNKQhSwsLB9G4THpQGT CzWg== X-Forwarded-Encrypted: i=1; AJvYcCUlWldSWxPGmpZ8wKFc7kLrH0tT2rGzGfL3qr9tBHW1elBeb6/b6aLWZP5Mx3nkSn5gl1x6s1NHDKQOuI112BcXhz1tJw==@freebsd.org X-Gm-Message-State: AOJu0Yw/DWiB3OLJ2xbKxcJ8/DgQ+1otNo2K4yKz9EBXlIgQI3RBZIOQ X7w1dvzuzZPwTCVKLwOgm7nT+rWZ8F7cgaO4LDELz2fBsrh4q62ua3RO69iz+8JELIxNero7QWn KUx5pjS2Rrw5zSWeZkZG9IYirhOhzhvZmvQEk1r6Y279zAbs7 X-Google-Smtp-Source: AGHT+IEc4YdF64pCLBiSfY8wGbMn7rA9H5peG1G/dHplfbmOqrJ6hhpoojbcuztPxKyKwdGwmNay413MmcnjcxC14Fs= X-Received: by 2002:a17:90a:8c94:b0:2d1:ca16:5555 with SMTP id 98e67ed59e1d1-2d3e03e83e5mr1777501a91.37.1723778899977; Thu, 15 Aug 2024 20:28:19 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202408160230.47G2UO9J045807@gitrepo.freebsd.org> <0936F9D3-86A7-46AF-83E3-3EE63C41DA67@FreeBSD.org> In-Reply-To: <0936F9D3-86A7-46AF-83E3-3EE63C41DA67@FreeBSD.org> From: Warner Losh Date: Thu, 15 Aug 2024 21:28:08 -0600 Message-ID: Subject: Re: git: d5507f9e4366 - main - nvme: Separate total failures from I/O failures To: Zhenlei Huang Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000014480061fc48d49" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WlSBG3dplz4gNr --000000000000014480061fc48d49 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 15, 2024, 9:12=E2=80=AFPM Zhenlei Huang wrot= e: > Hi Warner, > > I'm not sure but this change seems include lots of unintended changes ( > maybe some local WIP ) . > Git am somehow screwed me. I'll fix. Warner > On Aug 16, 2024, at 10:30 AM, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dd5507f9e436698ac17dc5ace7ef5849= 3988a9b04 > > > > commit d5507f9e436698ac17dc5ace7ef58493988a9b04 > > Author: Warner Losh > > AuthorDate: 2024-08-14 22:55:49 +0000 > > Commit: Warner Losh > > CommitDate: 2024-08-16 02:22:18 +0000 > > > > nvme: Separate total failures from I/O failures > > > > When it's a I/O failure, we can still send admin commands. Separate > out > > the admin failures and flag them as such so that we can still send > admin > > commands on half-failed drives. > > > > Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in > failed state) > > Sponsored by: Netflix > > --- > > sys/amd64/conf/IOSCHED | 2 + > > sys/amd64/conf/MPI3MR | 10 + > > sys/arm64/conf/GENERIC16K | 4 + > > .../linuxkpi/common/include/linux/#compiler.h# | 117 + > > sys/contrib/dev/iwlwifi/fw/api/soc.h | 35 + > > sys/contrib/zlib/contrib/asm686/README.686 | 51 + > > sys/contrib/zlib/contrib/asm686/match.S | 357 + > > sys/dev/ice/ice_sriov.c | 595 ++ > > sys/dev/ice/ice_sriov.h | 64 + > > sys/dev/mps/mpi/mpi2_pci.h | 141 + > > sys/dev/nvme/nvme_ctrlr.c | 46 +- > > sys/dev/nvme/nvme_private.h | 1 + > > sys/dev/nvme/nvme_qpair.c | 23 +- > > sys/dev/nvme/nvme_sim.c | 13 +- > > sys/dev/sound/pci/aureal.c | 686 ++ > > sys/dev/sound/pci/aureal.h | 99 + > > sys/dev/sound/pci/ds1-fw.h | 1602 ++++ > > sys/dev/sound/pci/ds1.c | 1103 +++ > > sys/dev/sound/pci/ds1.h | 146 + > > sys/dev/sound/pci/maestro.c | 2043 +++++ > > sys/dev/sound/pci/maestro_reg.h | 381 + > > sys/kern/bsduser-syscalls.c | 8712 > ++++++++++++++++++++ > > sys/modules/sound/driver/ds1/Makefile | 8 + > > sys/modules/sound/driver/maestro/Makefile | 8 + > > 24 files changed, 16219 insertions(+), 28 deletions(-) > > > > diff --git a/sys/amd64/conf/IOSCHED b/sys/amd64/conf/IOSCHED > > new file mode 100644 > > index 000000000000..e15106bc4c1f > > --- /dev/null > > +++ b/sys/amd64/conf/IOSCHED > > @@ -0,0 +1,2 @@ > > +include "GENERIC" > > +options CAM_IOSCHED_DYNAMIC > > diff --git a/sys/amd64/conf/MPI3MR b/sys/amd64/conf/MPI3MR > > new file mode 100644 > > index 000000000000..99e5244cb49d > > --- /dev/null > > +++ b/sys/amd64/conf/MPI3MR > > @@ -0,0 +1,10 @@ > > +include GENERIC > > + > > +device mpi3mr > > +# All the debugging options > > +options DEADLKRES # Enable the deadlock resolver > > +options INVARIANTS # Enable calls of extra sanity checking > > +options INVARIANT_SUPPORT # Extra sanity checks of internal structures= , > required by INVARIANTS > > +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on > invalidation > > +options WITNESS # Enable checks to detect deadlocks and cycles > > +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed > > diff --git a/sys/arm64/conf/GENERIC16K b/sys/arm64/conf/GENERIC16K > > new file mode 100644 > > index 000000000000..9bf9e2dadb08 > > --- /dev/null > > +++ b/sys/arm64/conf/GENERIC16K > > @@ -0,0 +1,4 @@ > > +include "GENERIC" > > + > > +ident GENERIC_16K > > + > > diff --git a/sys/compat/linuxkpi/common/include/linux/#compiler.h# > b/sys/compat/linuxkpi/common/include/linux/#compiler.h# > > new file mode 100644 > > index 000000000000..1177674aa68f > > --- /dev/null > > +++ b/sys/compat/linuxkpi/common/include/linux/#compiler.h# > > @@ -0,0 +1,117 @@ > > +/*- > > + * Copyright (c) 2010 Isilon Systems, Inc. > > + * Copyright (c) 2010 iX Systems, Inc. > > + * Copyright (c) 2010 Panasas, Inc. > > + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. > > + * Copyright (c) 2015 Fran=C3=A7ois Tigeot > > + * 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 unmodified, this list of conditions, and the following > > + * disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyrigh= t > > + * notice, this list of conditions and the following disclaimer in > the > > + * documentation and/or other materials provided with the > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS O= R > > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > DISCLAIMED. > > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING= , > BUT > > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS O= F > USE, > > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A= NY > > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE > USE OF > > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > + * > > + * $FreeBSD$ > > + */ > > +#ifndef _LINUX_COMPILER_H_ > > +#define _LINUX_COMPILER_H_ > > + > > +#include > > + > > +#define __user > > +#define __kernel > > +#define __safe > > +#define __force > > +#define __nocast > > +#define __iomem > > +#define __chk_user_ptr(x) ((void)0) > > +#define __chk_io_ptr(x) ((void)0) > > +#define __builtin_warning(x, y...) (1) > > +#define __acquires(x) > > +#define __releases(x) > > +#define __acquire(x) do { } while (0) > > +#define __release(x) do { } while (0) > > +#define __cond_lock(x,c) (c) > > +#define __bitwise > > +#define __devinitdata > > +#define __deprecated > > +#define __init > > +#define __initconst > > +#define __devinit > > +#define __devexit > > +#define __exit > > +#define __rcu > > +#define __percpu > > +#define __weak __weak_symbol > > +#define __malloc > > +#define ___stringify(...) #__VA_ARGS__ > > +#define __stringify(...) ___stringify(__VA_ARGS__) > > +#define __attribute_const__ __attribute__((__const__)= ) > > +#undef __always_inline > > +#define __always_inline inline > > +#define noinline __noinline > > +#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE= ) > > + > > +#define likely(x) __builtin_expect(!!(x), 1= ) > > +#define unlikely(x) __builtin_expect(!!(x), 0= ) > > +#define typeof(x) __typeof(x) > > + > > +#define uninitialized_var(x) x =3D x > > +#define __maybe_unused __unused > > +#define __always_unused __unused > > +#define __must_check __result_use_check > > + > > +#define __printf(a,b) __printflike(a,b) > > + > > +#define barrier() __asm__ __volatile__("": = : > :"memory") > > + > > +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >=3D 50000 > > +/* Moved from drm_os_freebsd.h */ > > +#define lower_32_bits(n) ((u32)(n)) > > +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)= ) > > +#endif > > + > > +#define ___PASTE(a,b) a##b > > +#define __PASTE(a,b) ___PASTE(a,b) > > + > > +#define ACCESS_ONCE(x) (*(volatile __typeof(x) > *)&(x)) > > + > > +#define WRITE_ONCE(x,v) do { \ > > + barrier(); \ > > + ACCESS_ONCE(x) =3D (v); \ > > + barrier(); \ > > +} while (0) > > + > > +#define READ_ONCE(x) ({ \ > > + __typeof(x) __var =3D ({ \ > > + barrier(); \ > > + ACCESS_ONCE(x); \ > > + }); \ > > + barrier(); \ > > + __var; \ > > +}) > > + > > +#define lockless_dereference(p) READ_ONCE(p) > > + > > +#define _AT(T,X) ((T)(X)) > > + > > +#define __same_type(a, b) > __builtin_types_compatible_p(typeof(a), typeof(b)) > > +#define __must_be_array(a) __same_type(a, &(a)[0]) > > + > > +#endif /* _LINUX_COMPILER_H_ */ > > diff --git a/sys/contrib/dev/iwlwifi/fw/api/soc.h > b/sys/contrib/dev/iwlwifi/fw/api/soc.h > > new file mode 100644 > > index 000000000000..c5df1171462b > > --- /dev/null > > +++ b/sys/contrib/dev/iwlwifi/fw/api/soc.h > > @@ -0,0 +1,35 @@ > > +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ > > +/* > > + * Copyright (C) 2012-2014, 2019-2020 Intel Corporation > > + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH > > + * Copyright (C) 2016-2017 Intel Deutschland GmbH > > + */ > > +#ifndef __iwl_fw_api_soc_h__ > > +#define __iwl_fw_api_soc_h__ > > + > > +#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0) > > +#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1) > > + > > +#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc > > +#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0 > > +#define SOC_FLAGS_LTR_APPLY_DELAY_200 1 > > +#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2 > > +#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3 > > + > > +/** > > + * struct iwl_soc_configuration_cmd - Set device stabilization latency > > + * > > + * @flags: soc settings flags. In VER_1, we can only set the DISCRETE > > + * flag, because the FW treats the whole value as an integer. In > > + * VER_2, we can set the bits independently. > > + * @latency: time for SOC to ensure stable power & XTAL > > + */ > > +struct iwl_soc_configuration_cmd { > > + __le32 flags; > > + __le32 latency; > > +} __packed; /* > > + * SOC_CONFIGURATION_CMD_S_VER_1 (see description above) > > + * SOC_CONFIGURATION_CMD_S_VER_2 > > + */ > > + > > +#endif /* __iwl_fw_api_soc_h__ */ > > diff --git a/sys/contrib/zlib/contrib/asm686/README.686 > b/sys/contrib/zlib/contrib/asm686/README.686 > > new file mode 100644 > > index 000000000000..a0bf3bea4aff > > --- /dev/null > > +++ b/sys/contrib/zlib/contrib/asm686/README.686 > > @@ -0,0 +1,51 @@ > > +This is a patched version of zlib, modified to use > > +Pentium-Pro-optimized assembly code in the deflation algorithm. The > > +files changed/added by this patch are: > > + > > +README.686 > > +match.S > > + > > +The speedup that this patch provides varies, depending on whether the > > +compiler used to build the original version of zlib falls afoul of the > > +PPro's speed traps. My own tests show a speedup of around 10-20% at > > +the default compression level, and 20-30% using -9, against a version > > +compiled using gcc 2.7.2.3. Your mileage may vary. > > + > > +Note that this code has been tailored for the PPro/PII in particular, > > +and will not perform particuarly well on a Pentium. > > + > > +If you are using an assembler other than GNU as, you will have to > > +translate match.S to use your assembler's syntax. (Have fun.) > > + > > +Brian Raiter > > +breadbox@muppetlabs.com > > +April, 1998 > > + > > + > > +Added for zlib 1.1.3: > > + > > +The patches come from > > +http://www.muppetlabs.com/~breadbox/software/assembly.html > > + > > +To compile zlib with this asm file, copy match.S to the zlib directory > > +then do: > > + > > +CFLAGS=3D"-O3 -DASMV" ./configure > > +make OBJA=3Dmatch.o > > + > > + > > +Update: > > + > > +I've been ignoring these assembly routines for years, believing that > > +gcc's generated code had caught up with it sometime around gcc 2.95 > > +and the major rearchitecting of the Pentium 4. However, I recently > > +learned that, despite what I believed, this code still has some life > > +in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% > > +faster than the code produced by gcc 4.1. > > + > > +In acknowledgement of its continuing usefulness, I've altered the > > +license to match that of the rest of zlib. Share and Enjoy! > > + > > +Brian Raiter > > +breadbox@muppetlabs.com > > +April, 2007 > > diff --git a/sys/contrib/zlib/contrib/asm686/match.S > b/sys/contrib/zlib/contrib/asm686/match.S > > new file mode 100644 > > index 000000000000..fa421092785d > > --- /dev/null > > +++ b/sys/contrib/zlib/contrib/asm686/match.S > > @@ -0,0 +1,357 @@ > > +/* match.S -- x86 assembly version of the zlib longest_match() functio= n. > > + * Optimized for the Intel 686 chips (PPro and later). > > + * > > + * Copyright (C) 1998, 2007 Brian Raiter > > + * > > + * This software is provided 'as-is', without any express or implied > > + * warranty. In no event will the author be held liable for any damag= es > > + * arising from the use of this software. > > + * > > + * Permission is granted to anyone to use this software for any purpos= e, > > + * including commercial applications, and to alter it and redistribute > it > > + * freely, subject to the following restrictions: > > + * > > + * 1. The origin of this software must not be misrepresented; you must > not > > + * claim that you wrote the original software. If you use this > software > > + * in a product, an acknowledgment in the product documentation > would be > > + * appreciated but is not required. > > + * 2. Altered source versions must be plainly marked as such, and must > not be > > + * misrepresented as being the original software. > > + * 3. This notice may not be removed or altered from any source > distribution. > > + */ > > + > > +#ifndef NO_UNDERLINE > > +#define match_init _match_init > > +#define longest_match _longest_match > > +#endif > > + > > +#define MAX_MATCH (258) > > +#define MIN_MATCH (3) > > +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) > > +#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) > > + > > +/* stack frame offsets */ > > + > > +#define chainlenwmask 0 /* high word: current > chain len */ > > + /* low word: s->wmask *= / > > +#define window 4 /* local copy of > s->window */ > > +#define windowbestlen 8 /* s->window + bestlen > */ > > +#define scanstart 16 /* first two bytes of > string */ > > +#define scanend 12 /* last two bytes of > string */ > > +#define scanalign 20 /* dword-misalignment of > string */ > > +#define nicematch 24 /* a good enough match > size */ > > +#define bestlen 28 /* size of best match so > far */ > > +#define scan 32 /* ptr to string wanting > match */ > > + > > +#define LocalVarsSize (36) > > +/* saved ebx 36 */ > > +/* saved edi 40 */ > > +/* saved esi 44 */ > > +/* saved ebp 48 */ > > +/* return address 52 */ > > +#define deflatestate 56 /* the function arguments > */ > > +#define curmatch 60 > > + > > +/* All the +zlib1222add offsets are due to the addition of fields > > + * in zlib in the deflate_state structure since the asm code was firs= t > written > > + * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ > (-4)"). > > + * (if you compile with zlib between 1.0.5 and 1.2.2.1, use > "zlib1222add equ 0"). > > + * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"= ). > > + */ > > + > > +#define zlib1222add (8) > > + > > +#define dsWSize (36+zlib1222add) > > +#define dsWMask (44+zlib1222add) > > +#define dsWindow (48+zlib1222add) > > +#define dsPrev (56+zlib1222add) > > +#define dsMatchLen (88+zlib1222add) > > +#define dsPrevMatch (92+zlib1222add) > > +#define dsStrStart (100+zlib1222add) > > +#define dsMatchStart (104+zlib1222add) > > +#define dsLookahead (108+zlib1222add) > > +#define dsPrevLen (112+zlib1222add) > > +#define dsMaxChainLen (116+zlib1222add) > > +#define dsGoodMatch (132+zlib1222add) > > +#define dsNiceMatch (136+zlib1222add) > > + > > + > > +.file "match.S" > > + > > +.globl match_init, longest_match > > + > > +.text > > + > > +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ > > +.cfi_sections .debug_frame > > + > > +longest_match: > > + > > +.cfi_startproc > > +/* Save registers that the compiler may be using, and adjust %esp to *= / > > +/* make room for our stack frame. *= / > > + > > + pushl %ebp > > + .cfi_def_cfa_offset 8 > > + .cfi_offset ebp, -8 > > + pushl %edi > > + .cfi_def_cfa_offset 12 > > + pushl %esi > > + .cfi_def_cfa_offset 16 > > + pushl %ebx > > + .cfi_def_cfa_offset 20 > > + subl $LocalVarsSize, %esp > > + .cfi_def_cfa_offset LocalVarsSize+20 > > + > > +/* Retrieve the function arguments. %ecx will hold cur_match *= / > > +/* throughout the entire function. %edx will hold the pointer to the *= / > > +/* deflate_state structure during the function's setup (before > */ > > +/* entering the main loop). *= / > > + > > + movl deflatestate(%esp), %edx > > + movl curmatch(%esp), %ecx > > + > > +/* uInt wmask =3D s->w_mask; = */ > > +/* unsigned chain_length =3D s->max_chain_length; > */ > > +/* if (s->prev_length >=3D s->good_match) { = */ > > +/* chain_length >>=3D 2; = */ > > +/* } *= / > > + > > + movl dsPrevLen(%edx), %eax > > + movl dsGoodMatch(%edx), %ebx > > + cmpl %ebx, %eax > > + movl dsWMask(%edx), %eax > > + movl dsMaxChainLen(%edx), %ebx > > + jl LastMatchGood > > + shrl $2, %ebx > > +LastMatchGood: > > + > > +/* chainlen is decremented once beforehand so that the function can *= / > > +/* use the sign flag instead of the zero flag for the exit test. *= / > > +/* It is then shifted into the high word, to make room for the wmask *= / > > +/* value, which it will always accompany. *= / > > + > > + decl %ebx > > + shll $16, %ebx > > + orl %eax, %ebx > > + movl %ebx, chainlenwmask(%esp) > > + > > +/* if ((uInt)nice_match > s->lookahead) nice_match =3D s->lookahead; = */ > > + > > + movl dsNiceMatch(%edx), %eax > > + movl dsLookahead(%edx), %ebx > > + cmpl %eax, %ebx > > + jl LookaheadLess > > + movl %eax, %ebx > > +LookaheadLess: movl %ebx, nicematch(%esp) > > + > > +/* register Bytef *scan =3D s->window + s->strstart; = */ > > + > > + movl dsWindow(%edx), %esi > > + movl %esi, window(%esp) > > + movl dsStrStart(%edx), %ebp > > + lea (%esi,%ebp), %edi > > + movl %edi, scan(%esp) > > + > > +/* Determine how many bytes the scan ptr is off from being *= / > > +/* dword-aligned. *= / > > + > > + movl %edi, %eax > > + negl %eax > > + andl $3, %eax > > + movl %eax, scanalign(%esp) > > + > > +/* IPos limit =3D s->strstart > (IPos)MAX_DIST(s) ? = */ > > +/* s->strstart - (IPos)MAX_DIST(s) : NIL; > */ > > + > > + movl dsWSize(%edx), %eax > > + subl $MIN_LOOKAHEAD, %eax > > + subl %eax, %ebp > > + jg LimitPositive > > + xorl %ebp, %ebp > > +LimitPositive: > > + > > +/* int best_len =3D s->prev_length; = */ > > + > > + movl dsPrevLen(%edx), %eax > > + movl %eax, bestlen(%esp) > > + > > +/* Store the sum of s->window + best_len in %esi locally, and in %esi. > */ > > + > > + addl %eax, %esi > > + movl %esi, windowbestlen(%esp) > > + > > +/* register ush scan_start =3D *(ushf*)scan; = */ > > +/* register ush scan_end =3D *(ushf*)(scan+best_len-1); > */ > > +/* Posf *prev =3D s->prev; = */ > > + > > + movzwl (%edi), %ebx > > + movl %ebx, scanstart(%esp) > > + movzwl -1(%edi,%eax), %ebx > > + movl %ebx, scanend(%esp) > > + movl dsPrev(%edx), %edi > > + > > +/* Jump into the main loop. *= / > > + > > + movl chainlenwmask(%esp), %edx > > + jmp LoopEntry > > + > > +.balign 16 > > + > > +/* do { > > + * match =3D s->window + cur_match; > > + * if (*(ushf*)(match+best_len-1) !=3D scan_end || > > + * *(ushf*)match !=3D scan_start) continue; > > + * [...] > > + * } while ((cur_match =3D prev[cur_match & wmask]) > limit > > + * && --chain_length !=3D 0); > > + * > > + * Here is the inner loop of the function. The function will spend the > > + * majority of its time in this loop, and majority of that time will > > + * be spent in the first ten instructions. > > + * > > + * Within this loop: > > + * %ebx =3D scanend > > + * %ecx =3D curmatch > > + * %edx =3D chainlenwmask - i.e., ((chainlen << 16) | wmask) > > + * %esi =3D windowbestlen - i.e., (window + bestlen) > > + * %edi =3D prev > > + * %ebp =3D limit > > + */ > > +LookupLoop: > > + andl %edx, %ecx > > + movzwl (%edi,%ecx,2), %ecx > > + cmpl %ebp, %ecx > > + jbe LeaveNow > > + subl $0x00010000, %edx > > + js LeaveNow > > +LoopEntry: movzwl -1(%esi,%ecx), %eax > > + cmpl %ebx, %eax > > + jnz LookupLoop > > + movl window(%esp), %eax > > + movzwl (%eax,%ecx), %eax > > + cmpl scanstart(%esp), %eax > > + jnz LookupLoop > > + > > +/* Store the current value of chainlen. > */ > > + > > + movl %edx, chainlenwmask(%esp) > > + > > +/* Point %edi to the string under scrutiny, and %esi to the string we > */ > > +/* are hoping to match it up with. In actuality, %esi and %edi are *= / > > +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is *= / > > +/* initialized to -(MAX_MATCH_8 - scanalign). > */ > > + > > + movl window(%esp), %esi > > + movl scan(%esp), %edi > > + addl %ecx, %esi > > + movl scanalign(%esp), %eax > > + movl $(-MAX_MATCH_8), %edx > > + lea MAX_MATCH_8(%edi,%eax), %edi > > + lea MAX_MATCH_8(%esi,%eax), %esi > > + > > +/* Test the strings for equality, 8 bytes at a time. At the end, > > + * adjust %edx so that it is offset to the exact byte that mismatched. > > + * > > + * We already know at this point that the first three bytes of the > > + * strings match each other, and they can be safely passed over before > > + * starting the compare loop. So what this code does is skip over 0-3 > > + * bytes, as much as necessary in order to dword-align the %edi > > + * pointer. (%esi will still be misaligned three times out of four.) > > + * > > + * It should be confessed that this loop usually does not represent > > + * much of the total running time. Replacing it with a more > > + * straightforward "rep cmpsb" would not drastically degrade > > + * performance. > > + */ > > +LoopCmps: > > + movl (%esi,%edx), %eax > > + xorl (%edi,%edx), %eax > > + jnz LeaveLoopCmps > > + movl 4(%esi,%edx), %eax > > + xorl 4(%edi,%edx), %eax > > + jnz LeaveLoopCmps4 > > + addl $8, %edx > > + jnz LoopCmps > > + jmp LenMaximum > > +LeaveLoopCmps4: addl $4, %edx > > +LeaveLoopCmps: testl $0x0000FFFF, %eax > > + jnz LenLower > > + addl $2, %edx > > + shrl $16, %eax > > +LenLower: subb $1, %al > > + adcl $0, %edx > > + > > +/* Calculate the length of the match. If it is longer than MAX_MATCH, > */ > > +/* then automatically accept it as the best possible match and leave. > */ > > + > > + lea (%edi,%edx), %eax > > + movl scan(%esp), %edi > > + subl %edi, %eax > > + cmpl $MAX_MATCH, %eax > > + jge LenMaximum > > + > > +/* If the length of the match is not longer than the best match we *= / > > +/* have so far, then forget it and return to the lookup loop. > */ > > + > > + movl deflatestate(%esp), %edx > > + movl bestlen(%esp), %ebx > > + cmpl %ebx, %eax > > + jg LongerMatch > > + movl windowbestlen(%esp), %esi > > + movl dsPrev(%edx), %edi > > + movl scanend(%esp), %ebx > > + movl chainlenwmask(%esp), %edx > > + jmp LookupLoop > > + > > +/* s->match_start =3D cur_match; > */ > > +/* best_len =3D len; = */ > > +/* if (len >=3D nice_match) break; = */ > > +/* scan_end =3D *(ushf*)(scan+best_len-1); = */ > > + > > +LongerMatch: movl nicematch(%esp), %ebx > > + movl %eax, bestlen(%esp) > > + movl %ecx, dsMatchStart(%edx) > > + cmpl %ebx, %eax > > + jge LeaveNow > > + movl window(%esp), %esi > > + addl %eax, %esi > > + movl %esi, windowbestlen(%esp) > > + movzwl -1(%edi,%eax), %ebx > > + movl dsPrev(%edx), %edi > > + movl %ebx, scanend(%esp) > > + movl chainlenwmask(%esp), %edx > > + jmp LookupLoop > > + > > +/* Accept the current string, with the maximum possible length. > */ > > + > > +LenMaximum: movl deflatestate(%esp), %edx > > + movl $MAX_MATCH, bestlen(%esp) > > + movl %ecx, dsMatchStart(%edx) > > + > > +/* if ((uInt)best_len <=3D s->lookahead) return (uInt)best_len; > */ > > +/* return s->lookahead; > */ > > + > > +LeaveNow: > > + movl deflatestate(%esp), %edx > > + movl bestlen(%esp), %ebx > > + movl dsLookahead(%edx), %eax > > + cmpl %eax, %ebx > > + jg LookaheadRet > > + movl %ebx, %eax > > +LookaheadRet: > > + > > +/* Restore the stack and return from whence we came. *= / > > + > > + addl $LocalVarsSize, %esp > > + .cfi_def_cfa_offset 20 > > + popl %ebx > > + .cfi_def_cfa_offset 16 > > + popl %esi > > + .cfi_def_cfa_offset 12 > > + popl %edi > > + .cfi_def_cfa_offset 8 > > + popl %ebp > > + .cfi_def_cfa_offset 4 > > +.cfi_endproc > > +match_init: ret > > diff --git a/sys/dev/ice/ice_sriov.c b/sys/dev/ice/ice_sriov.c > > new file mode 100644 > > index 000000000000..c0521e667fa2 > > --- /dev/null > > +++ b/sys/dev/ice/ice_sriov.c > > @@ -0,0 +1,595 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause */ > > +/* Copyright (c) 2021, Intel Corporation > > + * 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 i= n > the > > + * documentation and/or other materials provided with the > distribution. > > + * > > + * 3. Neither the name of the Intel Corporation nor the names of its > > + * contributors may be used to endorse or promote products derive= d > from > > + * this software without specific prior written permission. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTOR= 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 OWNER OR > CONTRIBUTORS BE > > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, O= R > > + * 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 ADVISE= D > OF THE > > + * POSSIBILITY OF SUCH DAMAGE. > > + */ > > + > > +#include "ice_common.h" > > +#include "ice_sriov.h" > > + > > +/** > > + * ice_aq_send_msg_to_vf > > + * @hw: pointer to the hardware structure > > + * @vfid: VF ID to send msg > > + * @v_opcode: opcodes for VF-PF communication > > + * @v_retval: return error code > > + * @msg: pointer to the msg buffer > > + * @msglen: msg length > > + * @cd: pointer to command details > > + * > > + * Send message to VF driver (0x0802) using mailbox > > + * queue and asynchronously sending message via > > + * ice_sq_send_cmd() function > > + */ > > +enum ice_status > > +ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 > v_retval, > > + u8 *msg, u16 msglen, struct ice_sq_cd *cd) > > +{ > > + struct ice_aqc_pf_vf_msg *cmd; > > + struct ice_aq_desc desc; > > + > > + ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf); > > + > > + cmd =3D &desc.params.virt; > > + cmd->id =3D CPU_TO_LE32(vfid); > > + > > + desc.cookie_high =3D CPU_TO_LE32(v_opcode); > > + desc.cookie_low =3D CPU_TO_LE32(v_retval); > > + > > + if (msglen) > > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > > + > > + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd)= ; > > +} > > + > > +/** > > + * ice_aq_send_msg_to_pf > > + * @hw: pointer to the hardware structure > > + * @v_opcode: opcodes for VF-PF communication > > + * @v_retval: return error code > > + * @msg: pointer to the msg buffer > > + * @msglen: msg length > > + * @cd: pointer to command details > > + * > > + * Send message to PF driver using mailbox queue. By default, this > > + * message is sent asynchronously, i.e. ice_sq_send_cmd() > > + * does not wait for completion before returning. > > + */ > > +enum ice_status > > +ice_aq_send_msg_to_pf(struct ice_hw *hw, enum virtchnl_ops v_opcode, > > + enum ice_status v_retval, u8 *msg, u16 msglen, > > + struct ice_sq_cd *cd) > > +{ > > + struct ice_aq_desc desc; > > + > > + ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_pf); > > + desc.cookie_high =3D CPU_TO_LE32(v_opcode); > > + desc.cookie_low =3D CPU_TO_LE32(v_retval); > > + > > + if (msglen) > > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > > + > > + return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd)= ; > > +} > > + > > +/** > > + * ice_conv_link_speed_to_virtchnl > > + * @adv_link_support: determines the format of the returned link speed > > + * @link_speed: variable containing the link_speed to be converted > > + * > > + * Convert link speed supported by HW to link speed supported by > virtchnl. > > + * If adv_link_support is true, then return link speed in Mbps. Else > return > > + * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that th= e > caller > > + * needs to cast back to an enum virtchnl_link_speed in the case where > > + * adv_link_support is false, but when adv_link_support is true the > caller can > > + * expect the speed in Mbps. > > + */ > > +u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 > link_speed) > > +{ > > + u32 speed; > > + > > + if (adv_link_support) > > + switch (link_speed) { > > + case ICE_AQ_LINK_SPEED_10MB: > > + speed =3D ICE_LINK_SPEED_10MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_100MB: > > + speed =3D ICE_LINK_SPEED_100MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_1000MB: > > + speed =3D ICE_LINK_SPEED_1000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_2500MB: > > + speed =3D ICE_LINK_SPEED_2500MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_5GB: > > + speed =3D ICE_LINK_SPEED_5000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_10GB: > > + speed =3D ICE_LINK_SPEED_10000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_20GB: > > + speed =3D ICE_LINK_SPEED_20000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_25GB: > > + speed =3D ICE_LINK_SPEED_25000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_40GB: > > + speed =3D ICE_LINK_SPEED_40000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_50GB: > > + speed =3D ICE_LINK_SPEED_50000MBPS; > > + break; > > + case ICE_AQ_LINK_SPEED_100GB: > > + speed =3D ICE_LINK_SPEED_100000MBPS; > > + break; > > + default: > > + speed =3D ICE_LINK_SPEED_UNKNOWN; > > + break; > > + } > > + else > > + /* Virtchnl speeds are not defined for every speed > supported in > > + * the hardware. To maintain compatibility with older AVF > > + * drivers, while reporting the speed the new speed value= s > are > > + * resolved to the closest known virtchnl speeds > > + */ > > + switch (link_speed) { > > + case ICE_AQ_LINK_SPEED_10MB: > > + case ICE_AQ_LINK_SPEED_100MB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_100MB; > > + break; > > + case ICE_AQ_LINK_SPEED_1000MB: > > + case ICE_AQ_LINK_SPEED_2500MB: > > + case ICE_AQ_LINK_SPEED_5GB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_1GB; > > + break; > > + case ICE_AQ_LINK_SPEED_10GB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_10GB; > > + break; > > + case ICE_AQ_LINK_SPEED_20GB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_20GB; > > + break; > > + case ICE_AQ_LINK_SPEED_25GB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_25GB; > > + break; > > + case ICE_AQ_LINK_SPEED_40GB: > > + case ICE_AQ_LINK_SPEED_50GB: > > + case ICE_AQ_LINK_SPEED_100GB: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_40GB; > > + break; > > + default: > > + speed =3D (u32)VIRTCHNL_LINK_SPEED_UNKNOWN; > > + break; > > + } > > + > > + return speed; > > +} > > + > > +/* The mailbox overflow detection algorithm helps to check if there > > + * is a possibility of a malicious VF transmitting too many MBX > messages to the > > + * PF. > > + * 1. The mailbox snapshot structure, ice_mbx_snapshot, is initialized > during > > + * driver initialization in ice_init_hw() using ice_mbx_init_snapshot(= ). > > + * The struct ice_mbx_snapshot helps to track and traverse a static > window of > > + * messages within the mailbox queue while looking for a malicious VF. > > + * > > + * 2. When the caller starts processing its mailbox queue in response > to an > > + * interrupt, the structure ice_mbx_snapshot is expected to be cleared > before > > + * the algorithm can be run for the first time for that interrupt. Thi= s > can be > > + * done via ice_mbx_reset_snapshot(). > > + * > > + * 3. For every message read by the caller from the MBX Queue, the > caller must > > + * call the detection algorithm's entry function > ice_mbx_vf_state_handler(). > > + * Before every call to ice_mbx_vf_state_handler() the struct > ice_mbx_data is > > + * filled as it is required to be passed to the algorithm. > > + * > > + * 4. Every time a message is read from the MBX queue, a VFId is > received which > > + * is passed to the state handler. The boolean output is_malvf of the > state > > + * handler ice_mbx_vf_state_handler() serves as an indicator to the > caller > > + * whether this VF is malicious or not. > > + * > > + * 5. When a VF is identified to be malicious, the caller can send a > message > > + * to the system administrator. The caller can invoke > ice_mbx_report_malvf() > > + * to help determine if a malicious VF is to be reported or not. This > function > > + * requires the caller to maintain a global bitmap to track all > malicious VFs > > + * and pass that to ice_mbx_report_malvf() along with the VFID which > was identified > > + * to be malicious by ice_mbx_vf_state_handler(). > > + * > > + * 6. The global bitmap maintained by PF can be cleared completely if > PF is in > > + * reset or the bit corresponding to a VF can be cleared if that VF is > in reset. > > + * When a VF is shut down and brought back up, we assume that the new = VF > > + * brought up is not malicious and hence report it if found malicious. > > + * > > + * 7. The function ice_mbx_reset_snapshot() is called to reset the > information > > + * in ice_mbx_snapshot for every new mailbox interrupt handled. > > + * > > + * 8. The memory allocated for variables in ice_mbx_snapshot is > de-allocated > > + * when driver is unloaded. > > + */ > > +#define ICE_RQ_DATA_MASK(rq_data) ((rq_data) & PF_MBX_ARQH_ARQH_M) > > +/* Using the highest value for an unsigned 16-bit value 0xFFFF to > indicate that > > + * the max messages check must be ignored in the algorithm > > + */ > > +#define ICE_IGNORE_MAX_MSG_CNT 0xFFFF > > + > > +/** > > + * ice_mbx_traverse - Pass through mailbox snapshot > > + * @hw: pointer to the HW struct > > + * @new_state: new algorithm state > > + * > > + * Traversing the mailbox static snapshot without checking > > + * for malicious VFs. > > + */ > > +static void > > +ice_mbx_traverse(struct ice_hw *hw, > > + enum ice_mbx_snapshot_state *new_state) > > +{ > > + struct ice_mbx_snap_buffer_data *snap_buf; > > + u32 num_iterations; > > + > > + snap_buf =3D &hw->mbx_snapshot.mbx_buf; > > + > > + /* As mailbox buffer is circular, applying a mask > > + * on the incremented iteration count. > > + */ > > + num_iterations =3D ICE_RQ_DATA_MASK(++snap_buf->num_iterations); > > + > > + /* Checking either of the below conditions to exit snapshot > traversal: > > + * Condition-1: If the number of iterations in the mailbox is > equal to > > + * the mailbox head which would indicate that we have reached the > end > > + * of the static snapshot. > > + * Condition-2: If the maximum messages serviced in the mailbox > for a > > + * given interrupt is the highest possible value then there is no > need > > + * to check if the number of messages processed is equal to it. I= f > not > > + * check if the number of messages processed is greater than or > equal > > + * to the maximum number of mailbox entries serviced in current > work item. > > + */ > > + if (num_iterations =3D=3D snap_buf->head || > > + (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && > > + ++snap_buf->num_msg_proc >=3D snap_buf->max_num_msgs_mbx)) > > + *new_state =3D ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; > > +} > > + > > +/** > > + * ice_mbx_detect_malvf - Detect malicious VF in snapshot > > + * @hw: pointer to the HW struct > > + * @vf_id: relative virtual function ID > > + * @new_state: new algorithm state > > + * @is_malvf: boolean output to indicate if VF is malicious > > + * > > + * This function tracks the number of asynchronous messages > > + * sent per VF and marks the VF as malicious if it exceeds > > + * the permissible number of messages to send. > > + */ > > +static enum ice_status > > +ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id, > > + enum ice_mbx_snapshot_state *new_state, > > + bool *is_malvf) > > +{ > > + struct ice_mbx_snapshot *snap =3D &hw->mbx_snapshot; > > + > > + if (vf_id >=3D snap->mbx_vf.vfcntr_len) > > + return ICE_ERR_OUT_OF_RANGE; > > + > > + /* increment the message count in the VF array */ > > + snap->mbx_vf.vf_cntr[vf_id]++; > > + > > + if (snap->mbx_vf.vf_cntr[vf_id] >=3D ICE_ASYNC_VF_MSG_THRESHOLD) > > + *is_malvf =3D true; > > + > > + /* continue to iterate through the mailbox snapshot */ > > + ice_mbx_traverse(hw, new_state); > > + > > + return ICE_SUCCESS; > > +} > > + > > +/** > > + * ice_mbx_reset_snapshot - Reset mailbox snapshot structure > > + * @snap: pointer to mailbox snapshot structure in the ice_hw struct > > + * > > + * Reset the mailbox snapshot structure and clear VF counter array. > > + */ > > +static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap) > > *** 15611 LINES SKIPPED *** > > > > --000000000000014480061fc48d49 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Aug 15, 2024, 9:12=E2=80=AFPM Zhenlei Huang &l= t;zlei@freebsd.org> wrote:
Hi Warner,

I'm not sure but this change seems include lots of unintended changes (= maybe some local WIP ) .
Git am somehow screwed me.=C2=A0 I'll fix.

Warner

> On Aug 16, 2024, at 10:30 AM, Warner Losh <imp@FreeBSD.org> wrot= e:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd5507f9e436698ac17dc5ace7ef584= 93988a9b04
>
> commit d5507f9e436698ac17dc5ace7ef58493988a9b04
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-08-14 22:55:49 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-08-16 02:22:18 +0000
>
>=C2=A0 =C2=A0 nvme: Separate total failures from I/O failures
>
>=C2=A0 =C2=A0 When it's a I/O failure, we can still send admin comm= ands. Separate out
>=C2=A0 =C2=A0 the admin failures and flag them as such so that we can s= till send admin
>=C2=A0 =C2=A0 commands on half-failed drives.
>
>=C2=A0 =C2=A0 Fixes: 9229b3105d88 (nvme: Fail passthrough commands righ= t away in failed state)
>=C2=A0 =C2=A0 Sponsored by: Netflix
> ---
> sys/amd64/conf/IOSCHED=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 2 +<= br> > sys/amd64/conf/MPI3MR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A010 +<= br> > sys/arm64/conf/GENERIC16K=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 4 +
> .../linuxkpi/common/include/linux/#compiler.h#=C2=A0 =C2=A0 =C2=A0|=C2= =A0 117 +
> sys/contrib/dev/iwlwifi/fw/api/soc.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A035 +
> sys/contrib/zlib/contrib/asm686/README.686=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A051 +
> sys/contrib/zlib/contrib/asm686/match.S=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 357 +
> sys/dev/ice/ice_sriov.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 595 ++
> sys/dev/ice/ice_sriov.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A064 +
> sys/dev/mps/mpi/mpi2_pci.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 141 +
> sys/dev/nvme/nvme_ctrlr.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A046 +-
> sys/dev/nvme/nvme_private.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 1 +
> sys/dev/nvme/nvme_qpair.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A023 +-
> sys/dev/nvme/nvme_sim.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A013 +- > sys/dev/sound/pci/aureal.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 686 ++
> sys/dev/sound/pci/aureal.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A099 +
> sys/dev/sound/pci/ds1-fw.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 1602 ++++
> sys/dev/sound/pci/ds1.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 1103 +++
> sys/dev/sound/pci/ds1.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 146 +
> sys/dev/sound/pci/maestro.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 2043 +++++
> sys/dev/sound/pci/maestro_reg.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 381 +
> sys/kern/bsduser-syscalls.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 8712 ++++++++++++++++++++
> sys/modules/sound/driver/ds1/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 8 +
> sys/modules/sound/driver/maestro/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 =C2=A0 8 +
> 24 files changed, 16219 insertions(+), 28 deletions(-)
>
> diff --git a/sys/amd64/conf/IOSCHED b/sys/amd64/conf/IOSCHED
> new file mode 100644
> index 000000000000..e15106bc4c1f
> --- /dev/null
> +++ b/sys/amd64/conf/IOSCHED
> @@ -0,0 +1,2 @@
> +include "GENERIC"
> +options CAM_IOSCHED_DYNAMIC
> diff --git a/sys/amd64/conf/MPI3MR b/sys/amd64/conf/MPI3MR
> new file mode 100644
> index 000000000000..99e5244cb49d
> --- /dev/null
> +++ b/sys/amd64/conf/MPI3MR
> @@ -0,0 +1,10 @@
> +include GENERIC
> +
> +device mpi3mr
> +# All the debugging options
> +options DEADLKRES # Enable the deadlock resolver
> +options INVARIANTS # Enable calls of extra sanity checking
> +options INVARIANT_SUPPORT # Extra sanity checks of internal structure= s, required by INVARIANTS
> +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on= invalidation
> +options WITNESS # Enable checks to detect deadlocks and cycles
> +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for spe= ed
> diff --git a/sys/arm64/conf/GENERIC16K b/sys/arm64/conf/GENERIC16K
> new file mode 100644
> index 000000000000..9bf9e2dadb08
> --- /dev/null
> +++ b/sys/arm64/conf/GENERIC16K
> @@ -0,0 +1,4 @@
> +include=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "GENERIC= "
> +
> +ident=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GENERIC_= 16K
> +
> diff --git a/sys/compat/linuxkpi/common/include/linux/#compiler.h# b/s= ys/compat/linuxkpi/common/include/linux/#compiler.h#
> new file mode 100644
> index 000000000000..1177674aa68f
> --- /dev/null
> +++ b/sys/compat/linuxkpi/common/include/linux/#compiler.h#
> @@ -0,0 +1,117 @@
> +/*-
> + * Copyright (c) 2010 Isilon Systems, Inc.
> + * Copyright (c) 2010 iX Systems, Inc.
> + * Copyright (c) 2010 Panasas, Inc.
> + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
> + * Copyright (c) 2015 Fran=C3=A7ois Tigeot
> + * 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<= br> > + *=C2=A0 =C2=A0 notice unmodified, this list of conditions, and the f= ollowing
> + *=C2=A0 =C2=A0 disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyrig= ht
> + *=C2=A0 =C2=A0 notice, this list of conditions and the following dis= claimer in the
> + *=C2=A0 =C2=A0 documentation and/or other materials provided with th= e distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY = EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR= RANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLA= IMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDIN= G, 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 TOR= T
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE = USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<= br> > + *
> + * $FreeBSD$
> + */
> +#ifndef=C2=A0 =C2=A0 =C2=A0 _LINUX_COMPILER_H_
> +#define=C2=A0 =C2=A0 =C2=A0 _LINUX_COMPILER_H_
> +
> +#include <sys/cdefs.h>
> +
> +#define __user
> +#define __kernel
> +#define __safe
> +#define __force
> +#define __nocast
> +#define __iomem
> +#define __chk_user_ptr(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((= void)0)
> +#define __chk_io_ptr(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((void)0)
> +#define __builtin_warning(x, y...)=C2=A0 =C2=A0(1)
> +#define __acquires(x)
> +#define __releases(x)
> +#define __acquire(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0do { } while (0)
> +#define __release(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0do { } while (0)
> +#define __cond_lock(x,c)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(c)
> +#define=C2=A0 =C2=A0 =C2=A0 __bitwise
> +#define __devinitdata
> +#define=C2=A0 =C2=A0 =C2=A0 __deprecated
> +#define __init
> +#define=C2=A0 =C2=A0 =C2=A0 __initconst
> +#define=C2=A0 =C2=A0 =C2=A0 __devinit
> +#define=C2=A0 =C2=A0 =C2=A0 __devexit
> +#define __exit
> +#define=C2=A0 =C2=A0 =C2=A0 __rcu
> +#define=C2=A0 =C2=A0 =C2=A0 __percpu
> +#define=C2=A0 =C2=A0 =C2=A0 __weak __weak_symbol
> +#define=C2=A0 =C2=A0 =C2=A0 __malloc
> +#define=C2=A0 =C2=A0 =C2=A0 ___stringify(...)=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#__VA_ARGS__
> +#define=C2=A0 =C2=A0 =C2=A0 __stringify(...)=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ___stringify(__VA_ARGS__)
> +#define=C2=A0 =C2=A0 =C2=A0 __attribute_const__=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0__attribute__((__const__))
> +#undef __always_inline
> +#define=C2=A0 =C2=A0 =C2=A0 __always_inline=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inline
> +#define=C2=A0 =C2=A0 =C2=A0 noinline=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __noinline
> +#define=C2=A0 =C2=A0 =C2=A0 ____cacheline_aligned=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0__aligned(CACHE_LINE_SIZE)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 likely(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__builtin_expect(!!(x),= 1)
> +#define=C2=A0 =C2=A0 =C2=A0 unlikely(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__builtin_expect(!!(x), 0)<= br> > +#define typeof(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 __typeof(x)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 uninitialized_var(x)=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 x =3D x
> +#define=C2=A0 =C2=A0 =C2=A0 __maybe_unused=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __unused
> +#define=C2=A0 =C2=A0 =C2=A0 __always_unused=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__unused
> +#define=C2=A0 =C2=A0 =C2=A0 __must_check=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __result_use_check
> +
> +#define=C2=A0 =C2=A0 =C2=A0 __printf(a,b)=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__printflike(a,b)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 barrier()=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__asm__ __volatile__(&q= uot;": : :"memory")
> +
> +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >=3D 500= 00
> +/* Moved from drm_os_freebsd.h */
> +#define=C2=A0 =C2=A0 =C2=A0 lower_32_bits(n)=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((u32)(n))
> +#define=C2=A0 =C2=A0 =C2=A0 upper_32_bits(n)=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((u32)(((n) >> 16) >> 16))
> +#endif
> +
> +#define=C2=A0 =C2=A0 =C2=A0 ___PASTE(a,b) a##b
> +#define=C2=A0 =C2=A0 =C2=A0 __PASTE(a,b) ___PASTE(a,b)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 ACCESS_ONCE(x)=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (*(volatile __typeof(x) *)&(x))
> +
> +#define=C2=A0 =C2=A0 =C2=A0 WRITE_ONCE(x,v) do {=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 \
> +=C2=A0 =C2=A0 =C2=A0barrier();=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> +=C2=A0 =C2=A0 =C2=A0ACCESS_ONCE(x) =3D (v);=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0\
> +=C2=A0 =C2=A0 =C2=A0barrier();=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> +} while (0)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 READ_ONCE(x) ({=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
> +=C2=A0 =C2=A0 =C2=A0__typeof(x) __var =3D ({=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0barrier();=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACCESS_ONCE(x);=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0\
> +=C2=A0 =C2=A0 =C2=A0});=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
> +=C2=A0 =C2=A0 =C2=A0barrier();=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> +=C2=A0 =C2=A0 =C2=A0__var;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> +})
> +
> +#define=C2=A0 =C2=A0 =C2=A0 lockless_dereference(p) READ_ONCE(p)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 _AT(T,X)=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((T)(= X))
> +
> +#define=C2=A0 =C2=A0 =C2=A0 __same_type(a, b)=C2=A0 =C2=A0 =C2=A0 =C2= =A0__builtin_types_compatible_p(typeof(a), typeof(b))
> +#define=C2=A0 =C2=A0 =C2=A0 __must_be_array(a)=C2=A0 =C2=A0 =C2=A0 __= same_type(a, &(a)[0])
> +
> +#endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* _LINUX_COMPILER_H_ */
> diff --git a/sys/contrib/dev/iwlwifi/fw/api/soc.h b/sys/contrib/dev/iw= lwifi/fw/api/soc.h
> new file mode 100644
> index 000000000000..c5df1171462b
> --- /dev/null
> +++ b/sys/contrib/dev/iwlwifi/fw/api/soc.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
> +/*
> + * Copyright (C) 2012-2014, 2019-2020 Intel Corporation
> + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
> + * Copyright (C) 2016-2017 Intel Deutschland GmbH
> + */
> +#ifndef __iwl_fw_api_soc_h__
> +#define __iwl_fw_api_soc_h__
> +
> +#define SOC_CONFIG_CMD_FLAGS_DISCRETE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 BIT(0)
> +#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY=C2=A0 =C2=A0 =C2=A0BIT(1) > +
> +#define SOC_FLAGS_LTR_APPLY_DELAY_MASK=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A00xc
> +#define SOC_FLAGS_LTR_APPLY_DELAY_NONE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A00
> +#define SOC_FLAGS_LTR_APPLY_DELAY_200=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 1
> +#define SOC_FLAGS_LTR_APPLY_DELAY_2500=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A02
> +#define SOC_FLAGS_LTR_APPLY_DELAY_1820=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A03
> +
> +/**
> + * struct iwl_soc_configuration_cmd - Set device stabilization latenc= y
> + *
> + * @flags: soc settings flags.=C2=A0 In VER_1, we can only set the DI= SCRETE
> + *=C2=A0 =C2=A0flag, because the FW treats the whole value as an inte= ger. In
> + *=C2=A0 =C2=A0VER_2, we can set the bits independently.
> + * @latency: time for SOC to ensure stable power & XTAL
> + */
> +struct iwl_soc_configuration_cmd {
> +=C2=A0 =C2=A0 =C2=A0__le32 flags;
> +=C2=A0 =C2=A0 =C2=A0__le32 latency;
> +} __packed; /*
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * SOC_CONFIGURATION_CMD_S_VER_1 (s= ee description above)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * SOC_CONFIGURATION_CMD_S_VER_2 > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +#endif /* __iwl_fw_api_soc_h__ */
> diff --git a/sys/contrib/zlib/contrib/asm686/README.686 b/sys/contrib/= zlib/contrib/asm686/README.686
> new file mode 100644
> index 000000000000..a0bf3bea4aff
> --- /dev/null
> +++ b/sys/contrib/zlib/contrib/asm686/README.686
> @@ -0,0 +1,51 @@
> +This is a patched version of zlib, modified to use
> +Pentium-Pro-optimized assembly code in the deflation algorithm. The > +files changed/added by this patch are:
> +
> +README.686
> +match.S
> +
> +The speedup that this patch provides varies, depending on whether the=
> +compiler used to build the original version of zlib falls afoul of th= e
> +PPro's speed traps. My own tests show a speedup of around 10-20% = at
> +the default compression level, and 20-30% using -9, against a version=
> +compiled using gcc 2.7.2.3. Your mileage may vary.
> +
> +Note that this code has been tailored for the PPro/PII in particular,=
> +and will not perform particuarly well on a Pentium.
> +
> +If you are using an assembler other than GNU as, you will have to
> +translate match.S to use your assembler's syntax. (Have fun.)
> +
> +Brian Raiter
> +breadbox@muppetlabs.com
> +April, 1998
> +
> +
> +Added for zlib 1.1.3:
> +
> +The patches come from
> +http://www.muppetlabs.com= /~breadbox/software/assembly.html
> +
> +To compile zlib with this asm file, copy match.S to the zlib director= y
> +then do:
> +
> +CFLAGS=3D"-O3 -DASMV" ./configure
> +make OBJA=3Dmatch.o
> +
> +
> +Update:
> +
> +I've been ignoring these assembly routines for years, believing t= hat
> +gcc's generated code had caught up with it sometime around gcc 2.= 95
> +and the major rearchitecting of the Pentium 4. However, I recently > +learned that, despite what I believed, this code still has some life<= br> > +in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%=
> +faster than the code produced by gcc 4.1.
> +
> +In acknowledgement of its continuing usefulness, I've altered the=
> +license to match that of the rest of zlib. Share and Enjoy!
> +
> +Brian Raiter
> +breadbox@muppetlabs.com
> +April, 2007
> diff --git a/sys/contrib/zlib/contrib/asm686/match.S b/sys/contrib/zli= b/contrib/asm686/match.S
> new file mode 100644
> index 000000000000..fa421092785d
> --- /dev/null
> +++ b/sys/contrib/zlib/contrib/asm686/match.S
> @@ -0,0 +1,357 @@
> +/* match.S -- x86 assembly version of the zlib longest_match() functi= on.
> + * Optimized for the Intel 686 chips (PPro and later).
> + *
> + * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs= .com>
> + *
> + * This software is provided 'as-is', without any express or = implied
> + * warranty.=C2=A0 In no event will the author be held liable for any= damages
> + * arising from the use of this software.
> + *
> + * Permission is granted to anyone to use this software for any purpo= se,
> + * including commercial applications, and to alter it and redistribut= e it
> + * freely, subject to the following restrictions:
> + *
> + * 1. The origin of this software must not be misrepresented; you mus= t not
> + *=C2=A0 =C2=A0 claim that you wrote the original software. If you us= e this software
> + *=C2=A0 =C2=A0 in a product, an acknowledgment in the product docume= ntation would be
> + *=C2=A0 =C2=A0 appreciated but is not required.
> + * 2. Altered source versions must be plainly marked as such, and mus= t not be
> + *=C2=A0 =C2=A0 misrepresented as being the original software.
> + * 3. This notice may not be removed or altered from any source distr= ibution.
> + */
> +
> +#ifndef NO_UNDERLINE
> +#define=C2=A0 =C2=A0 =C2=A0 match_init=C2=A0 =C2=A0 =C2=A0 _match_ini= t
> +#define=C2=A0 =C2=A0 =C2=A0 longest_match=C2=A0 =C2=A0_longest_match<= br> > +#endif
> +
> +#define=C2=A0 =C2=A0 =C2=A0 MAX_MATCH=C2=A0 =C2=A0 =C2=A0 =C2=A0(258)=
> +#define=C2=A0 =C2=A0 =C2=A0 MIN_MATCH=C2=A0 =C2=A0 =C2=A0 =C2=A0(3) > +#define=C2=A0 =C2=A0 =C2=A0 MIN_LOOKAHEAD=C2=A0 =C2=A0(MAX_MATCH + MI= N_MATCH + 1)
> +#define=C2=A0 =C2=A0 =C2=A0 MAX_MATCH_8=C2=A0 =C2=A0 =C2=A0((MAX_MATC= H + 7) & ~7)
> +
> +/* stack frame offsets */
> +
> +#define=C2=A0 =C2=A0 =C2=A0 chainlenwmask=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A00=C2=A0 =C2=A0 =C2=A0 =C2=A0/* high word: current chain len */=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* low word:= s->wmask=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +#define=C2=A0 =C2=A0 =C2=A0 window=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 4=C2=A0 =C2=A0 =C2=A0 =C2=A0/* local copy of s-= >window=C2=A0 =C2=A0 =C2=A0 */
> +#define=C2=A0 =C2=A0 =C2=A0 windowbestlen=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A08=C2=A0 =C2=A0 =C2=A0 =C2=A0/* s->window + bestlen=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +#define=C2=A0 =C2=A0 =C2=A0 scanstart=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A016=C2=A0 =C2=A0 =C2=A0 /* first two bytes of string= =C2=A0 =C2=A0 */
> +#define=C2=A0 =C2=A0 =C2=A0 scanend=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A012=C2=A0 =C2=A0 =C2=A0 /* last two bytes of str= ing=C2=A0 =C2=A0 =C2=A0*/
> +#define=C2=A0 =C2=A0 =C2=A0 scanalign=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A020=C2=A0 =C2=A0 =C2=A0 /* dword-misalignment of str= ing */
> +#define=C2=A0 =C2=A0 =C2=A0 nicematch=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A024=C2=A0 =C2=A0 =C2=A0 /* a good enough match size= =C2=A0 =C2=A0 =C2=A0*/
> +#define=C2=A0 =C2=A0 =C2=A0 bestlen=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A028=C2=A0 =C2=A0 =C2=A0 /* size of best match so= far=C2=A0 =C2=A0 */
> +#define=C2=A0 =C2=A0 =C2=A0 scan=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 32=C2=A0 =C2=A0 =C2=A0 /* ptr to string = wanting match=C2=A0 */
> +
> +#define=C2=A0 =C2=A0 =C2=A0 LocalVarsSize=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(36)
> +/*=C2=A0 =C2=A0saved ebx=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A036 */
> +/*=C2=A0 =C2=A0saved edi=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A040 */
> +/*=C2=A0 =C2=A0saved esi=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A044 */
> +/*=C2=A0 =C2=A0saved ebp=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A048 */
> +/*=C2=A0 =C2=A0return address=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 52 */=
> +#define=C2=A0 =C2=A0 =C2=A0 deflatestate=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 56=C2=A0 =C2=A0 =C2=A0 /* the function arguments=C2=A0 =C2=A0= =C2=A0 =C2=A0*/
> +#define=C2=A0 =C2=A0 =C2=A0 curmatch=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 60
> +
> +/* All the +zlib1222add offsets are due to the addition of fields
> + *=C2=A0 in zlib in the deflate_state structure since the asm code wa= s first written
> + * (if you compile with zlib 1.0.4 or older, use "zlib1222add eq= u (-4)").
> + * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zli= b1222add equ 0").
> + * if you compile with zlib 1.2.2.2 or later , use "zlib1222add = equ 8").
> + */
> +
> +#define zlib1222add=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (8)
> +
> +#define=C2=A0 =C2=A0 =C2=A0 dsWSize=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(36+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsWMask=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(44+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsWindow=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (48+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsPrev=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (56+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsMatchLen=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (88+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsPrevMatch=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(92+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsStrStart=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (100+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsMatchStart=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (104+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsLookahead=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(108+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsPrevLen=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(112+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsMaxChainLen=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(116+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsGoodMatch=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(132+zlib1222add)
> +#define=C2=A0 =C2=A0 =C2=A0 dsNiceMatch=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(136+zlib1222add)
> +
> +
> +.file "match.S"
> +
> +.globl=C2=A0 =C2=A0 =C2=A0 =C2=A0match_init, longest_match
> +
> +.text
> +
> +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */<= br> > +.cfi_sections=C2=A0 =C2=A0 =C2=A0 =C2=A0 .debug_frame
> +
> +longest_match:
> +
> +.cfi_startproc
> +/* Save registers that the compiler may be using, and adjust %esp to = */
> +/* make room for our stack frame.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pushl=C2=A0 =C2=A0%eb= p
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 8=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_offset ebp, -8 > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pushl=C2=A0 =C2=A0%ed= i
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 1= 2
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pushl=C2=A0 =C2=A0%es= i
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 1= 6
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pushl=C2=A0 =C2=A0%eb= x
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 2= 0
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0subl=C2=A0 =C2=A0 $Lo= calVarsSize, %esp
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset L= ocalVarsSize+20
> +
> +/* Retrieve the function arguments. %ecx will hold cur_match=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/* throughout the entire function. %edx will hold the pointer to the = */
> +/* deflate_state structure during the function's setup (before=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/* entering the main loop).=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 def= latestate(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 cur= match(%esp), %ecx
> +
> +/* uInt wmask =3D s->w_mask;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/* unsigned chain_length =3D s->max_chain_length;=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 */
> +/* if (s->prev_length >=3D s->good_match) {=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 */
> +/*=C2=A0 =C2=A0 =C2=A0chain_length >>=3D 2;=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/* }=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsP= revLen(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsG= oodMatch(%edx), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %eb= x, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsW= Mask(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsM= axChainLen(%edx), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jl=C2=A0 =C2=A0 =C2= =A0 LastMatchGood
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shrl=C2=A0 =C2=A0 $2,= %ebx
> +LastMatchGood:
> +
> +/* chainlen is decremented once beforehand so that the function can= =C2=A0 */
> +/* use the sign flag instead of the zero flag for the exit test.=C2= =A0 =C2=A0 =C2=A0*/
> +/* It is then shifted into the high word, to make room for the wmask = */
> +/* value, which it will always accompany.=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */ > +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0decl=C2=A0 =C2=A0 %eb= x
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shll=C2=A0 =C2=A0 $16= , %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0orl=C2=A0 =C2=A0 =C2= =A0%eax, %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %eb= x, chainlenwmask(%esp)
> +
> +/* if ((uInt)nice_match > s->lookahead) nice_match =3D s->lo= okahead;=C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsN= iceMatch(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsL= ookahead(%edx), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %ea= x, %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jl=C2=A0 =C2=A0 =C2= =A0 LookaheadLess
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ea= x, %ebx
> +LookaheadLess:=C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ebx, nice= match(%esp)
> +
> +/* register Bytef *scan =3D s->window + s->strstart;=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsW= indow(%edx), %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %es= i, window(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsS= trStart(%edx), %ebp
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lea=C2=A0 =C2=A0 =C2= =A0(%esi,%ebp), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ed= i, scan(%esp)
> +
> +/* Determine how many bytes the scan ptr is off from being=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/* dword-aligned.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ed= i, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0negl=C2=A0 =C2=A0 %ea= x
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0andl=C2=A0 =C2=A0 $3,= %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ea= x, scanalign(%esp)
> +
> +/* IPos limit =3D s->strstart > (IPos)MAX_DIST(s) ?=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +/*=C2=A0 =C2=A0 =C2=A0s->strstart - (IPos)MAX_DIST(s) : NIL;=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsW= Size(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0subl=C2=A0 =C2=A0 $MI= N_LOOKAHEAD, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0subl=C2=A0 =C2=A0 %ea= x, %ebp
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jg=C2=A0 =C2=A0 =C2= =A0 LimitPositive
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xorl=C2=A0 =C2=A0 %eb= p, %ebp
> +LimitPositive:
> +
> +/* int best_len =3D s->prev_length;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsP= revLen(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ea= x, bestlen(%esp)
> +
> +/* Store the sum of s->window + best_len in %esi locally, and in %= esi.=C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 %ea= x, %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %es= i, windowbestlen(%esp)
> +
> +/* register ush scan_start =3D *(ushf*)scan;=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/=
> +/* register ush scan_end=C2=A0 =C2=A0=3D *(ushf*)(scan+best_len-1);= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 */
> +/* Posf *prev =3D s->prev;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movzwl=C2=A0 (%edi), = %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %eb= x, scanstart(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movzwl=C2=A0 -1(%edi,= %eax), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %eb= x, scanend(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsP= rev(%edx), %edi
> +
> +/* Jump into the main loop.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 cha= inlenwmask(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jmp=C2=A0 =C2=A0 =C2= =A0LoopEntry
> +
> +.balign 16
> +
> +/* do {
> + *=C2=A0 =C2=A0 =C2=A0match =3D s->window + cur_match;
> + *=C2=A0 =C2=A0 =C2=A0if (*(ushf*)(match+best_len-1) !=3D scan_end ||=
> + *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*(ushf*)match !=3D scan_start) co= ntinue;
> + *=C2=A0 =C2=A0 =C2=A0[...]
> + * } while ((cur_match =3D prev[cur_match & wmask]) > limit > + *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && --chain_length !=3D 0= );
> + *
> + * Here is the inner loop of the function. The function will spend th= e
> + * majority of its time in this loop, and majority of that time will<= br> > + * be spent in the first ten instructions.
> + *
> + * Within this loop:
> + * %ebx =3D scanend
> + * %ecx =3D curmatch
> + * %edx =3D chainlenwmask - i.e., ((chainlen << 16) | wmask) > + * %esi =3D windowbestlen - i.e., (window + bestlen)
> + * %edi =3D prev
> + * %ebp =3D limit
> + */
> +LookupLoop:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0andl=C2=A0 =C2=A0 %ed= x, %ecx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movzwl=C2=A0 (%edi,%e= cx,2), %ecx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %eb= p, %ecx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jbe=C2=A0 =C2=A0 =C2= =A0LeaveNow
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0subl=C2=A0 =C2=A0 $0x= 00010000, %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0js=C2=A0 =C2=A0 =C2= =A0 LeaveNow
> +LoopEntry:=C2=A0 =C2=A0movzwl=C2=A0 -1(%esi,%ecx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %eb= x, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LookupLoop
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 win= dow(%esp), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movzwl=C2=A0 (%eax,%e= cx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 sca= nstart(%esp), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LookupLoop
> +
> +/* Store the current value of chainlen.=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ed= x, chainlenwmask(%esp)
> +
> +/* Point %edi to the string under scrutiny, and %esi to the string we= =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +/* are hoping to match it up with. In actuality, %esi and %edi are=C2= =A0 =C2=A0*/
> +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is=C2= =A0 =C2=A0*/
> +/* initialized to -(MAX_MATCH_8 - scanalign).=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 win= dow(%esp), %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 sca= n(%esp), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 %ec= x, %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 sca= nalign(%esp), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 $(-= MAX_MATCH_8), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lea=C2=A0 =C2=A0 =C2= =A0MAX_MATCH_8(%edi,%eax), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lea=C2=A0 =C2=A0 =C2= =A0MAX_MATCH_8(%esi,%eax), %esi
> +
> +/* Test the strings for equality, 8 bytes at a time. At the end,
> + * adjust %edx so that it is offset to the exact byte that mismatched= .
> + *
> + * We already know at this point that the first three bytes of the > + * strings match each other, and they can be safely passed over befor= e
> + * starting the compare loop. So what this code does is skip over 0-3=
> + * bytes, as much as necessary in order to dword-align the %edi
> + * pointer. (%esi will still be misaligned three times out of four.)<= br> > + *
> + * It should be confessed that this loop usually does not represent > + * much of the total running time. Replacing it with a more
> + * straightforward "rep cmpsb" would not drastically degrad= e
> + * performance.
> + */
> +LoopCmps:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 (%e= si,%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xorl=C2=A0 =C2=A0 (%e= di,%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LeaveLoopCmps
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 4(%= esi,%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xorl=C2=A0 =C2=A0 4(%= edi,%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LeaveLoopCmps4
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 $8,= %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LoopCmps
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jmp=C2=A0 =C2=A0 =C2= =A0LenMaximum
> +LeaveLoopCmps4:=C2=A0 =C2=A0 =C2=A0 addl=C2=A0 =C2=A0 $4, %edx
> +LeaveLoopCmps:=C2=A0 =C2=A0 =C2=A0 =C2=A0testl=C2=A0 =C2=A0$0x0000FFF= F, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jnz=C2=A0 =C2=A0 =C2= =A0LenLower
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 $2,= %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shrl=C2=A0 =C2=A0 $16= , %eax
> +LenLower:=C2=A0 =C2=A0 subb=C2=A0 =C2=A0 $1, %al
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0adcl=C2=A0 =C2=A0 $0,= %edx
> +
> +/* Calculate the length of the match. If it is longer than MAX_MATCH,= =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +/* then automatically accept it as the best possible match and leave.= =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lea=C2=A0 =C2=A0 =C2= =A0(%edi,%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 sca= n(%esp), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0subl=C2=A0 =C2=A0 %ed= i, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 $MA= X_MATCH, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jge=C2=A0 =C2=A0 =C2= =A0LenMaximum
> +
> +/* If the length of the match is not longer than the best match we=C2= =A0 =C2=A0*/
> +/* have so far, then forget it and return to the lookup loop.=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 def= latestate(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 bes= tlen(%esp), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %eb= x, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jg=C2=A0 =C2=A0 =C2= =A0 LongerMatch
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 win= dowbestlen(%esp), %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsP= rev(%edx), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 sca= nend(%esp), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 cha= inlenwmask(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jmp=C2=A0 =C2=A0 =C2= =A0LookupLoop
> +
> +/*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s->match_start =3D cur_match;= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0best_len =3D len;=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (len >=3D nice_match) break= ;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +/*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0scan_end =3D *(ushf*)(scan+best_l= en-1);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0*/
> +
> +LongerMatch: movl=C2=A0 =C2=A0 nicematch(%esp), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ea= x, bestlen(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ec= x, dsMatchStart(%edx)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %eb= x, %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jge=C2=A0 =C2=A0 =C2= =A0LeaveNow
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 win= dow(%esp), %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 %ea= x, %esi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %es= i, windowbestlen(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movzwl=C2=A0 -1(%edi,= %eax), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsP= rev(%edx), %edi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %eb= x, scanend(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 cha= inlenwmask(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jmp=C2=A0 =C2=A0 =C2= =A0LookupLoop
> +
> +/* Accept the current string, with the maximum possible length.=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +
> +LenMaximum:=C2=A0 movl=C2=A0 =C2=A0 deflatestate(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 $MA= X_MATCH, bestlen(%esp)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %ec= x, dsMatchStart(%edx)
> +
> +/* if ((uInt)best_len <=3D s->lookahead) return (uInt)best_len;= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +/* return s->lookahead;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *= /
> +
> +LeaveNow:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 def= latestate(%esp), %edx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 bes= tlen(%esp), %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 dsL= ookahead(%edx), %eax
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmpl=C2=A0 =C2=A0 %ea= x, %ebx
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jg=C2=A0 =C2=A0 =C2= =A0 LookaheadRet
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0movl=C2=A0 =C2=A0 %eb= x, %eax
> +LookaheadRet:
> +
> +/* Restore the stack and return from whence we came.=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0addl=C2=A0 =C2=A0 $Lo= calVarsSize, %esp
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 2= 0
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0popl=C2=A0 =C2=A0 %eb= x
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 1= 6
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0popl=C2=A0 =C2=A0 %es= i
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 1= 2
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0popl=C2=A0 =C2=A0 %ed= i
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 8=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0popl=C2=A0 =C2=A0 %eb= p
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cfi_def_cfa_offset 4=
> +.cfi_endproc
> +match_init:=C2=A0 ret
> diff --git a/sys/dev/ice/ice_sriov.c b/sys/dev/ice/ice_sriov.c
> new file mode 100644
> index 000000000000..c0521e667fa2
> --- /dev/null
> +++ b/sys/dev/ice/ice_sriov.c
> @@ -0,0 +1,595 @@
> +/* SPDX-License-Identifier: BSD-3-Clause */
> +/*=C2=A0 Copyright (c) 2021, Intel Corporation
> + *=C2=A0 All rights reserved.
> + *
> + *=C2=A0 Redistribution and use in source and binary forms, with or w= ithout
> + *=C2=A0 modification, are permitted provided that the following cond= itions are met:
> + *
> + *=C2=A0 =C2=A01. Redistributions of source code must retain the abov= e copyright notice,
> + *=C2=A0 =C2=A0 =C2=A0 this list of conditions and the following disc= laimer.
> + *
> + *=C2=A0 =C2=A02. Redistributions in binary form must reproduce the a= bove copyright
> + *=C2=A0 =C2=A0 =C2=A0 notice, this list of conditions and the follow= ing disclaimer in the
> + *=C2=A0 =C2=A0 =C2=A0 documentation and/or other materials provided = with the distribution.
> + *
> + *=C2=A0 =C2=A03. Neither the name of the Intel Corporation nor the n= ames of its
> + *=C2=A0 =C2=A0 =C2=A0 contributors may be used to endorse or promote= products derived from
> + *=C2=A0 =C2=A0 =C2=A0 this software without specific prior written p= ermission.
> + *
> + *=C2=A0 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTR= IBUTORS "AS IS"
> + *=C2=A0 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LI= MITED TO, THE
> + *=C2=A0 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PART= ICULAR PURPOSE
> + *=C2=A0 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CON= TRIBUTORS BE
> + *=C2=A0 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPL= ARY, OR
> + *=C2=A0 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUR= EMENT OF
> + *=C2=A0 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;= OR BUSINESS
> + *=C2=A0 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,= WHETHER IN
> + *=C2=A0 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR= OTHERWISE)
> + *=C2=A0 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF = ADVISED OF THE
> + *=C2=A0 POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "ice_common.h"
> +#include "ice_sriov.h"
> +
> +/**
> + * ice_aq_send_msg_to_vf
> + * @hw: pointer to the hardware structure
> + * @vfid: VF ID to send msg
> + * @v_opcode: opcodes for VF-PF communication
> + * @v_retval: return error code
> + * @msg: pointer to the msg buffer
> + * @msglen: msg length
> + * @cd: pointer to command details
> + *
> + * Send message to VF driver (0x0802) using mailbox
> + * queue and asynchronously sending message via
> + * ice_sq_send_cmd() function
> + */
> +enum ice_status
> +ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 = v_retval,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= u8 *msg, u16 msglen, struct ice_sq_cd *cd)
> +{
> +=C2=A0 =C2=A0 =C2=A0struct ice_aqc_pf_vf_msg *cmd;
> +=C2=A0 =C2=A0 =C2=A0struct ice_aq_desc desc;
> +
> +=C2=A0 =C2=A0 =C2=A0ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_= opc_send_msg_to_vf);
> +
> +=C2=A0 =C2=A0 =C2=A0cmd =3D &desc.params.virt;
> +=C2=A0 =C2=A0 =C2=A0cmd->id =3D CPU_TO_LE32(vfid);
> +
> +=C2=A0 =C2=A0 =C2=A0desc.cookie_high =3D CPU_TO_LE32(v_opcode);
> +=C2=A0 =C2=A0 =C2=A0desc.cookie_low =3D CPU_TO_LE32(v_retval);
> +
> +=C2=A0 =C2=A0 =C2=A0if (msglen)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0desc.flags |=3D CPU_T= O_LE16(ICE_AQ_FLAG_RD);
> +
> +=C2=A0 =C2=A0 =C2=A0return ice_sq_send_cmd(hw, &hw->mailboxq, = &desc, msg, msglen, cd);
> +}
> +
> +/**
> + * ice_aq_send_msg_to_pf
> + * @hw: pointer to the hardware structure
> + * @v_opcode: opcodes for VF-PF communication
> + * @v_retval: return error code
> + * @msg: pointer to the msg buffer
> + * @msglen: msg length
> + * @cd: pointer to command details
> + *
> + * Send message to PF driver using mailbox queue. By default, this > + * message is sent asynchronously, i.e. ice_sq_send_cmd()
> + * does not wait for completion before returning.
> + */
> +enum ice_status
> +ice_aq_send_msg_to_pf(struct ice_hw *hw, enum virtchnl_ops v_opcode,<= br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= enum ice_status v_retval, u8 *msg, u16 msglen,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= struct ice_sq_cd *cd)
> +{
> +=C2=A0 =C2=A0 =C2=A0struct ice_aq_desc desc;
> +
> +=C2=A0 =C2=A0 =C2=A0ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_= opc_send_msg_to_pf);
> +=C2=A0 =C2=A0 =C2=A0desc.cookie_high =3D CPU_TO_LE32(v_opcode);
> +=C2=A0 =C2=A0 =C2=A0desc.cookie_low =3D CPU_TO_LE32(v_retval);
> +
> +=C2=A0 =C2=A0 =C2=A0if (msglen)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0desc.flags |=3D CPU_T= O_LE16(ICE_AQ_FLAG_RD);
> +
> +=C2=A0 =C2=A0 =C2=A0return ice_sq_send_cmd(hw, &hw->mailboxq, = &desc, msg, msglen, cd);
> +}
> +
> +/**
> + * ice_conv_link_speed_to_virtchnl
> + * @adv_link_support: determines the format of the returned link spee= d
> + * @link_speed: variable containing the link_speed to be converted > + *
> + * Convert link speed supported by HW to link speed supported by virt= chnl.
> + * If adv_link_support is true, then return link speed in Mbps. Else = return
> + * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that t= he caller
> + * needs to cast back to an enum virtchnl_link_speed in the case wher= e
> + * adv_link_support is false, but when adv_link_support is true the c= aller can
> + * expect the speed in Mbps.
> + */
> +u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_s= peed)
> +{
> +=C2=A0 =C2=A0 =C2=A0u32 speed;
> +
> +=C2=A0 =C2=A0 =C2=A0if (adv_link_support)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0switch (link_speed) {=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_10MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_10MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_100MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_100MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_1000MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_1000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_2500MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_2500MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_5GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_5000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_10GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_10000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_20GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_20000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_25GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_25000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_40GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_40000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_50GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_50000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_100GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_100000MBPS;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0default:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D ICE_LINK_SPEED_UNKNOWN;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +=C2=A0 =C2=A0 =C2=A0else
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Virtchnl speeds ar= e not defined for every speed supported in
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * the hardware. To m= aintain compatibility with older AVF
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * drivers, while rep= orting the speed the new speed values are
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * resolved to the cl= osest known virtchnl speeds
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0switch (link_speed) {=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_10MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_100MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_100MB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_1000MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_2500MB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_5GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_1GB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_10GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_10GB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_20GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_20GB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_25GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_25GB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_40GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_50GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case ICE_AQ_LINK_SPEE= D_100GB:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_40GB;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0default:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0speed =3D (u32)VIRTCHNL_LINK_SPEED_UNKNOWN;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +
> +=C2=A0 =C2=A0 =C2=A0return speed;
> +}
> +
> +/* The mailbox overflow detection algorithm helps to check if there > + * is a possibility of a malicious VF transmitting too many MBX messa= ges to the
> + * PF.
> + * 1. The mailbox snapshot structure, ice_mbx_snapshot, is initialize= d during
> + * driver initialization in ice_init_hw() using ice_mbx_init_snapshot= ().
> + * The struct ice_mbx_snapshot helps to track and traverse a static w= indow of
> + * messages within the mailbox queue while looking for a malicious VF= .
> + *
> + * 2. When the caller starts processing its mailbox queue in response= to an
> + * interrupt, the structure ice_mbx_snapshot is expected to be cleare= d before
> + * the algorithm can be run for the first time for that interrupt. Th= is can be
> + * done via ice_mbx_reset_snapshot().
> + *
> + * 3. For every message read by the caller from the MBX Queue, the ca= ller must
> + * call the detection algorithm's entry function ice_mbx_vf_state= _handler().
> + * Before every call to ice_mbx_vf_state_handler() the struct ice_mbx= _data is
> + * filled as it is required to be passed to the algorithm.
> + *
> + * 4. Every time a message is read from the MBX queue, a VFId is rece= ived which
> + * is passed to the state handler. The boolean output is_malvf of the= state
> + * handler ice_mbx_vf_state_handler() serves as an indicator to the c= aller
> + * whether this VF is malicious or not.
> + *
> + * 5. When a VF is identified to be malicious, the caller can send a = message
> + * to the system administrator. The caller can invoke ice_mbx_report_= malvf()
> + * to help determine if a malicious VF is to be reported or not. This= function
> + * requires the caller to maintain a global bitmap to track all malic= ious VFs
> + * and pass that to ice_mbx_report_malvf() along with the VFID which = was identified
> + * to be malicious by ice_mbx_vf_state_handler().
> + *
> + * 6. The global bitmap maintained by PF can be cleared completely if= PF is in
> + * reset or the bit corresponding to a VF can be cleared if that VF i= s in reset.
> + * When a VF is shut down and brought back up, we assume that the new= VF
> + * brought up is not malicious and hence report it if found malicious= .
> + *
> + * 7. The function ice_mbx_reset_snapshot() is called to reset the in= formation
> + * in ice_mbx_snapshot for every new mailbox interrupt handled.
> + *
> + * 8. The memory allocated for variables in ice_mbx_snapshot is de-al= located
> + * when driver is unloaded.
> + */
> +#define ICE_RQ_DATA_MASK(rq_data) ((rq_data) & PF_MBX_ARQH_ARQH_M= )
> +/* Using the highest value for an unsigned 16-bit value 0xFFFF to ind= icate that
> + * the max messages check must be ignored in the algorithm
> + */
> +#define ICE_IGNORE_MAX_MSG_CNT=C2=A0 =C2=A0 =C2=A0 =C2=A00xFFFF
> +
> +/**
> + * ice_mbx_traverse - Pass through mailbox snapshot
> + * @hw: pointer to the HW struct
> + * @new_state: new algorithm state
> + *
> + * Traversing the mailbox static snapshot without checking
> + * for malicious VFs.
> + */
> +static void
> +ice_mbx_traverse(struct ice_hw *hw,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enum ice_mbx_snapsho= t_state *new_state)
> +{
> +=C2=A0 =C2=A0 =C2=A0struct ice_mbx_snap_buffer_data *snap_buf;
> +=C2=A0 =C2=A0 =C2=A0u32 num_iterations;
> +
> +=C2=A0 =C2=A0 =C2=A0snap_buf =3D &hw->mbx_snapshot.mbx_buf; > +
> +=C2=A0 =C2=A0 =C2=A0/* As mailbox buffer is circular, applying a mask=
> +=C2=A0 =C2=A0 =C2=A0 * on the incremented iteration count.
> +=C2=A0 =C2=A0 =C2=A0 */
> +=C2=A0 =C2=A0 =C2=A0num_iterations =3D ICE_RQ_DATA_MASK(++snap_buf-&g= t;num_iterations);
> +
> +=C2=A0 =C2=A0 =C2=A0/* Checking either of the below conditions to exi= t snapshot traversal:
> +=C2=A0 =C2=A0 =C2=A0 * Condition-1: If the number of iterations in th= e mailbox is equal to
> +=C2=A0 =C2=A0 =C2=A0 * the mailbox head which would indicate that we = have reached the end
> +=C2=A0 =C2=A0 =C2=A0 * of the static snapshot.
> +=C2=A0 =C2=A0 =C2=A0 * Condition-2: If the maximum messages serviced = in the mailbox for a
> +=C2=A0 =C2=A0 =C2=A0 * given interrupt is the highest possible value = then there is no need
> +=C2=A0 =C2=A0 =C2=A0 * to check if the number of messages processed i= s equal to it. If not
> +=C2=A0 =C2=A0 =C2=A0 * check if the number of messages processed is g= reater than or equal
> +=C2=A0 =C2=A0 =C2=A0 * to the maximum number of mailbox entries servi= ced in current work item.
> +=C2=A0 =C2=A0 =C2=A0 */
> +=C2=A0 =C2=A0 =C2=A0if (num_iterations =3D=3D snap_buf->head || > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(snap_buf->max_num_msgs_mbx <= ICE_IGNORE_MAX_MSG_CNT &&
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ++snap_buf->num_msg_proc >= =3D snap_buf->max_num_msgs_mbx))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*new_state =3D ICE_MA= L_VF_DETECT_STATE_NEW_SNAPSHOT;
> +}
> +
> +/**
> + * ice_mbx_detect_malvf - Detect malicious VF in snapshot
> + * @hw: pointer to the HW struct
> + * @vf_id: relative virtual function ID
> + * @new_state: new algorithm state
> + * @is_malvf: boolean output to indicate if VF is malicious
> + *
> + * This function tracks the number of asynchronous messages
> + * sent per VF and marks the VF as malicious if it exceeds
> + * the permissible number of messages to send.
> + */
> +static enum ice_status
> +ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enum i= ce_mbx_snapshot_state *new_state,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bool *= is_malvf)
> +{
> +=C2=A0 =C2=A0 =C2=A0struct ice_mbx_snapshot *snap =3D &hw->mbx= _snapshot;
> +
> +=C2=A0 =C2=A0 =C2=A0if (vf_id >=3D snap->mbx_vf.vfcntr_len)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ICE_ERR_OUT_OF= _RANGE;
> +
> +=C2=A0 =C2=A0 =C2=A0/* increment the message count in the VF array */=
> +=C2=A0 =C2=A0 =C2=A0snap->mbx_vf.vf_cntr[vf_id]++;
> +
> +=C2=A0 =C2=A0 =C2=A0if (snap->mbx_vf.vf_cntr[vf_id] >=3D ICE_AS= YNC_VF_MSG_THRESHOLD)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*is_malvf =3D true; > +
> +=C2=A0 =C2=A0 =C2=A0/* continue to iterate through the mailbox snapsh= ot */
> +=C2=A0 =C2=A0 =C2=A0ice_mbx_traverse(hw, new_state);
> +
> +=C2=A0 =C2=A0 =C2=A0return ICE_SUCCESS;
> +}
> +
> +/**
> + * ice_mbx_reset_snapshot - Reset mailbox snapshot structure
> + * @snap: pointer to mailbox snapshot structure in the ice_hw struct<= br> > + *
> + * Reset the mailbox snapshot structure and clear VF counter array. > + */
> +static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap)
> *** 15611 LINES SKIPPED ***



--000000000000014480061fc48d49-- From nobody Fri Aug 16 03:33:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlSJ16WDQz5HnyQ; Fri, 16 Aug 2024 03:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlSJ16Dkkz4hd0; Fri, 16 Aug 2024 03:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723779201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DsmIaOJUjbDVMra1D4A6BU3jOHMJJmYJkLIT4mAbk4w=; b=vZqtcWvATXmSgpUhnjPDOCZCD67YBdMNxLJkj0qdBl4CPWTvD6fafBYyQ+moUCRx56qdvH 86QLlGdDNGZnemQ6N4DzffJad/T3W7/WWd7GAqM88uX9N6flIhnYiEpTGV9RNitCojDWMo mHhs0zDPAwf1m0QcT4jlKwmjFSt1NZJ9P609Xc0WhOi9Q4DrNZdnjgd+gytK6+glB2/Oqv DuNPbEF4Ghc5ZLSUtQ3lBxC3ZvYgeXwDbW7vrQF1C1IAeOAoIsJMAbTrOjaspsrSmnuNHn o6UJwiZQ6QUEciIVeDSf6xKSq9s2oxh9EY12ASi2qi1XD7/QLeZsuVdFV5/Nzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723779201; a=rsa-sha256; cv=none; b=K9zJsgKYZhXoBrWkwjz3KZKBrnhdDlryflgR1wtJZECH4744tZFZyeCaNxQh+H1Okk/+R+ 0lYDxghX7CwR+EW4RLqkHe/GoM/Tuzc6tPJANJS88ihKGinSRIDnLrfaqCFoFkJG0ojHNA EcSr/V4oe/wdTEvINvWrO0yhYrIaxpLCmhUL35KwVS15BmzY3Az0uEXtYMAX29g7KOK5wt 7wHziG6jCasR+T9qJ+mXM4MM8/e1EInnC1IumdVtyQepti8hkPB4o0Ys/Crt/RV6iR2maL iHDoV2HwyCRBDhrE/8N2h+93Q3xX/omwiVU3D4RuTz8zr1jPaSMmz2u2WI0MMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723779201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DsmIaOJUjbDVMra1D4A6BU3jOHMJJmYJkLIT4mAbk4w=; b=UUCJPK58Sz88SfZxGXJR16gJLt63XoI36DHumAkfGBdafwO/3gWYtSbZJvMCIkJE3oQmj9 CknkUs2eUTwxvz43KbUl8p/zr+TcLq96neMSRoAwtB0s13Ytx/M51T4e4MzCXf8K2vq8pH VZilmT7ytL6e7BNp9r0LP03u4HUWDpg0n4cHqKpfIS67R2h9/izcPGDCFjZ9dJ1KCg0gvM oLXj+S02K4Q7LkSwVkGQ9e/bwayPOfgt5W5A6zKOrXbx5Qk88p6TuBWsO9HrMVE5ebUtnn aSZ01pql8ldjsz9xk+jC+j+Qw4HgCalINWt8uN+l9Su/MioIBNpqUBY43H1fQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlSJ15m09zqYx; Fri, 16 Aug 2024 03:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G3XL1b056373; Fri, 16 Aug 2024 03:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G3XLsY056367; Fri, 16 Aug 2024 03:33:21 GMT (envelope-from git) Date: Fri, 16 Aug 2024 03:33:21 GMT Message-Id: <202408160333.47G3XLsY056367@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ce7fac64ba50 - main - Revert "nvme: Separate total failures from I/O failures" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce7fac64ba508dee27f5fa09780debf092222cc2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ce7fac64ba508dee27f5fa09780debf092222cc2 commit ce7fac64ba508dee27f5fa09780debf092222cc2 Author: Warner Losh AuthorDate: 2024-08-16 03:29:53 +0000 Commit: Warner Losh CommitDate: 2024-08-16 03:29:53 +0000 Revert "nvme: Separate total failures from I/O failures" All kinds of crazy stuff was mixed into this commit. Revert it and do it again. This reverts commit d5507f9e436698ac17dc5ace7ef58493988a9b04. Sponsored by: Netflix --- sys/amd64/conf/IOSCHED | 2 - sys/amd64/conf/MPI3MR | 10 - sys/arm64/conf/GENERIC16K | 4 - .../linuxkpi/common/include/linux/#compiler.h# | 117 - sys/contrib/dev/iwlwifi/fw/api/soc.h | 35 - sys/contrib/zlib/contrib/asm686/README.686 | 51 - sys/contrib/zlib/contrib/asm686/match.S | 357 - sys/dev/ice/ice_sriov.c | 595 -- sys/dev/ice/ice_sriov.h | 64 - sys/dev/mps/mpi/mpi2_pci.h | 141 - sys/dev/nvme/nvme_ctrlr.c | 46 +- sys/dev/nvme/nvme_private.h | 1 - sys/dev/nvme/nvme_qpair.c | 23 +- sys/dev/nvme/nvme_sim.c | 13 +- sys/dev/sound/pci/aureal.c | 686 -- sys/dev/sound/pci/aureal.h | 99 - sys/dev/sound/pci/ds1-fw.h | 1602 ---- sys/dev/sound/pci/ds1.c | 1103 --- sys/dev/sound/pci/ds1.h | 146 - sys/dev/sound/pci/maestro.c | 2043 ----- sys/dev/sound/pci/maestro_reg.h | 381 - sys/kern/bsduser-syscalls.c | 8712 -------------------- sys/modules/sound/driver/ds1/Makefile | 8 - sys/modules/sound/driver/maestro/Makefile | 8 - 24 files changed, 28 insertions(+), 16219 deletions(-) diff --git a/sys/amd64/conf/IOSCHED b/sys/amd64/conf/IOSCHED deleted file mode 100644 index e15106bc4c1f..000000000000 --- a/sys/amd64/conf/IOSCHED +++ /dev/null @@ -1,2 +0,0 @@ -include "GENERIC" -options CAM_IOSCHED_DYNAMIC diff --git a/sys/amd64/conf/MPI3MR b/sys/amd64/conf/MPI3MR deleted file mode 100644 index 99e5244cb49d..000000000000 --- a/sys/amd64/conf/MPI3MR +++ /dev/null @@ -1,10 +0,0 @@ -include GENERIC - -device mpi3mr -# All the debugging options -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed diff --git a/sys/arm64/conf/GENERIC16K b/sys/arm64/conf/GENERIC16K deleted file mode 100644 index 9bf9e2dadb08..000000000000 --- a/sys/arm64/conf/GENERIC16K +++ /dev/null @@ -1,4 +0,0 @@ -include "GENERIC" - -ident GENERIC_16K - diff --git a/sys/compat/linuxkpi/common/include/linux/#compiler.h# b/sys/compat/linuxkpi/common/include/linux/#compiler.h# deleted file mode 100644 index 1177674aa68f..000000000000 --- a/sys/compat/linuxkpi/common/include/linux/#compiler.h# +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * Copyright (c) 2010 Isilon Systems, Inc. - * Copyright (c) 2010 iX Systems, Inc. - * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. - * Copyright (c) 2015 François Tigeot - * 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 unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ -#ifndef _LINUX_COMPILER_H_ -#define _LINUX_COMPILER_H_ - -#include - -#define __user -#define __kernel -#define __safe -#define __force -#define __nocast -#define __iomem -#define __chk_user_ptr(x) ((void)0) -#define __chk_io_ptr(x) ((void)0) -#define __builtin_warning(x, y...) (1) -#define __acquires(x) -#define __releases(x) -#define __acquire(x) do { } while (0) -#define __release(x) do { } while (0) -#define __cond_lock(x,c) (c) -#define __bitwise -#define __devinitdata -#define __deprecated -#define __init -#define __initconst -#define __devinit -#define __devexit -#define __exit -#define __rcu -#define __percpu -#define __weak __weak_symbol -#define __malloc -#define ___stringify(...) #__VA_ARGS__ -#define __stringify(...) ___stringify(__VA_ARGS__) -#define __attribute_const__ __attribute__((__const__)) -#undef __always_inline -#define __always_inline inline -#define noinline __noinline -#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) - -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#define typeof(x) __typeof(x) - -#define uninitialized_var(x) x = x -#define __maybe_unused __unused -#define __always_unused __unused -#define __must_check __result_use_check - -#define __printf(a,b) __printflike(a,b) - -#define barrier() __asm__ __volatile__("": : :"memory") - -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 -/* Moved from drm_os_freebsd.h */ -#define lower_32_bits(n) ((u32)(n)) -#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) -#endif - -#define ___PASTE(a,b) a##b -#define __PASTE(a,b) ___PASTE(a,b) - -#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) - -#define WRITE_ONCE(x,v) do { \ - barrier(); \ - ACCESS_ONCE(x) = (v); \ - barrier(); \ -} while (0) - -#define READ_ONCE(x) ({ \ - __typeof(x) __var = ({ \ - barrier(); \ - ACCESS_ONCE(x); \ - }); \ - barrier(); \ - __var; \ -}) - -#define lockless_dereference(p) READ_ONCE(p) - -#define _AT(T,X) ((T)(X)) - -#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) -#define __must_be_array(a) __same_type(a, &(a)[0]) - -#endif /* _LINUX_COMPILER_H_ */ diff --git a/sys/contrib/dev/iwlwifi/fw/api/soc.h b/sys/contrib/dev/iwlwifi/fw/api/soc.h deleted file mode 100644 index c5df1171462b..000000000000 --- a/sys/contrib/dev/iwlwifi/fw/api/soc.h +++ /dev/null @@ -1,35 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -/* - * Copyright (C) 2012-2014, 2019-2020 Intel Corporation - * Copyright (C) 2013-2015 Intel Mobile Communications GmbH - * Copyright (C) 2016-2017 Intel Deutschland GmbH - */ -#ifndef __iwl_fw_api_soc_h__ -#define __iwl_fw_api_soc_h__ - -#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0) -#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1) - -#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc -#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0 -#define SOC_FLAGS_LTR_APPLY_DELAY_200 1 -#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2 -#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3 - -/** - * struct iwl_soc_configuration_cmd - Set device stabilization latency - * - * @flags: soc settings flags. In VER_1, we can only set the DISCRETE - * flag, because the FW treats the whole value as an integer. In - * VER_2, we can set the bits independently. - * @latency: time for SOC to ensure stable power & XTAL - */ -struct iwl_soc_configuration_cmd { - __le32 flags; - __le32 latency; -} __packed; /* - * SOC_CONFIGURATION_CMD_S_VER_1 (see description above) - * SOC_CONFIGURATION_CMD_S_VER_2 - */ - -#endif /* __iwl_fw_api_soc_h__ */ diff --git a/sys/contrib/zlib/contrib/asm686/README.686 b/sys/contrib/zlib/contrib/asm686/README.686 deleted file mode 100644 index a0bf3bea4aff..000000000000 --- a/sys/contrib/zlib/contrib/asm686/README.686 +++ /dev/null @@ -1,51 +0,0 @@ -This is a patched version of zlib, modified to use -Pentium-Pro-optimized assembly code in the deflation algorithm. The -files changed/added by this patch are: - -README.686 -match.S - -The speedup that this patch provides varies, depending on whether the -compiler used to build the original version of zlib falls afoul of the -PPro's speed traps. My own tests show a speedup of around 10-20% at -the default compression level, and 20-30% using -9, against a version -compiled using gcc 2.7.2.3. Your mileage may vary. - -Note that this code has been tailored for the PPro/PII in particular, -and will not perform particuarly well on a Pentium. - -If you are using an assembler other than GNU as, you will have to -translate match.S to use your assembler's syntax. (Have fun.) - -Brian Raiter -breadbox@muppetlabs.com -April, 1998 - - -Added for zlib 1.1.3: - -The patches come from -http://www.muppetlabs.com/~breadbox/software/assembly.html - -To compile zlib with this asm file, copy match.S to the zlib directory -then do: - -CFLAGS="-O3 -DASMV" ./configure -make OBJA=match.o - - -Update: - -I've been ignoring these assembly routines for years, believing that -gcc's generated code had caught up with it sometime around gcc 2.95 -and the major rearchitecting of the Pentium 4. However, I recently -learned that, despite what I believed, this code still has some life -in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% -faster than the code produced by gcc 4.1. - -In acknowledgement of its continuing usefulness, I've altered the -license to match that of the rest of zlib. Share and Enjoy! - -Brian Raiter -breadbox@muppetlabs.com -April, 2007 diff --git a/sys/contrib/zlib/contrib/asm686/match.S b/sys/contrib/zlib/contrib/asm686/match.S deleted file mode 100644 index fa421092785d..000000000000 --- a/sys/contrib/zlib/contrib/asm686/match.S +++ /dev/null @@ -1,357 +0,0 @@ -/* match.S -- x86 assembly version of the zlib longest_match() function. - * Optimized for the Intel 686 chips (PPro and later). - * - * Copyright (C) 1998, 2007 Brian Raiter - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the author be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#ifndef NO_UNDERLINE -#define match_init _match_init -#define longest_match _longest_match -#endif - -#define MAX_MATCH (258) -#define MIN_MATCH (3) -#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) -#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) - -/* stack frame offsets */ - -#define chainlenwmask 0 /* high word: current chain len */ - /* low word: s->wmask */ -#define window 4 /* local copy of s->window */ -#define windowbestlen 8 /* s->window + bestlen */ -#define scanstart 16 /* first two bytes of string */ -#define scanend 12 /* last two bytes of string */ -#define scanalign 20 /* dword-misalignment of string */ -#define nicematch 24 /* a good enough match size */ -#define bestlen 28 /* size of best match so far */ -#define scan 32 /* ptr to string wanting match */ - -#define LocalVarsSize (36) -/* saved ebx 36 */ -/* saved edi 40 */ -/* saved esi 44 */ -/* saved ebp 48 */ -/* return address 52 */ -#define deflatestate 56 /* the function arguments */ -#define curmatch 60 - -/* All the +zlib1222add offsets are due to the addition of fields - * in zlib in the deflate_state structure since the asm code was first written - * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). - * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). - * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - */ - -#define zlib1222add (8) - -#define dsWSize (36+zlib1222add) -#define dsWMask (44+zlib1222add) -#define dsWindow (48+zlib1222add) -#define dsPrev (56+zlib1222add) -#define dsMatchLen (88+zlib1222add) -#define dsPrevMatch (92+zlib1222add) -#define dsStrStart (100+zlib1222add) -#define dsMatchStart (104+zlib1222add) -#define dsLookahead (108+zlib1222add) -#define dsPrevLen (112+zlib1222add) -#define dsMaxChainLen (116+zlib1222add) -#define dsGoodMatch (132+zlib1222add) -#define dsNiceMatch (136+zlib1222add) - - -.file "match.S" - -.globl match_init, longest_match - -.text - -/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ -.cfi_sections .debug_frame - -longest_match: - -.cfi_startproc -/* Save registers that the compiler may be using, and adjust %esp to */ -/* make room for our stack frame. */ - - pushl %ebp - .cfi_def_cfa_offset 8 - .cfi_offset ebp, -8 - pushl %edi - .cfi_def_cfa_offset 12 - pushl %esi - .cfi_def_cfa_offset 16 - pushl %ebx - .cfi_def_cfa_offset 20 - subl $LocalVarsSize, %esp - .cfi_def_cfa_offset LocalVarsSize+20 - -/* Retrieve the function arguments. %ecx will hold cur_match */ -/* throughout the entire function. %edx will hold the pointer to the */ -/* deflate_state structure during the function's setup (before */ -/* entering the main loop). */ - - movl deflatestate(%esp), %edx - movl curmatch(%esp), %ecx - -/* uInt wmask = s->w_mask; */ -/* unsigned chain_length = s->max_chain_length; */ -/* if (s->prev_length >= s->good_match) { */ -/* chain_length >>= 2; */ -/* } */ - - movl dsPrevLen(%edx), %eax - movl dsGoodMatch(%edx), %ebx - cmpl %ebx, %eax - movl dsWMask(%edx), %eax - movl dsMaxChainLen(%edx), %ebx - jl LastMatchGood - shrl $2, %ebx -LastMatchGood: - -/* chainlen is decremented once beforehand so that the function can */ -/* use the sign flag instead of the zero flag for the exit test. */ -/* It is then shifted into the high word, to make room for the wmask */ -/* value, which it will always accompany. */ - - decl %ebx - shll $16, %ebx - orl %eax, %ebx - movl %ebx, chainlenwmask(%esp) - -/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ - - movl dsNiceMatch(%edx), %eax - movl dsLookahead(%edx), %ebx - cmpl %eax, %ebx - jl LookaheadLess - movl %eax, %ebx -LookaheadLess: movl %ebx, nicematch(%esp) - -/* register Bytef *scan = s->window + s->strstart; */ - - movl dsWindow(%edx), %esi - movl %esi, window(%esp) - movl dsStrStart(%edx), %ebp - lea (%esi,%ebp), %edi - movl %edi, scan(%esp) - -/* Determine how many bytes the scan ptr is off from being */ -/* dword-aligned. */ - - movl %edi, %eax - negl %eax - andl $3, %eax - movl %eax, scanalign(%esp) - -/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ -/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ - - movl dsWSize(%edx), %eax - subl $MIN_LOOKAHEAD, %eax - subl %eax, %ebp - jg LimitPositive - xorl %ebp, %ebp -LimitPositive: - -/* int best_len = s->prev_length; */ - - movl dsPrevLen(%edx), %eax - movl %eax, bestlen(%esp) - -/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ - - addl %eax, %esi - movl %esi, windowbestlen(%esp) - -/* register ush scan_start = *(ushf*)scan; */ -/* register ush scan_end = *(ushf*)(scan+best_len-1); */ -/* Posf *prev = s->prev; */ - - movzwl (%edi), %ebx - movl %ebx, scanstart(%esp) - movzwl -1(%edi,%eax), %ebx - movl %ebx, scanend(%esp) - movl dsPrev(%edx), %edi - -/* Jump into the main loop. */ - - movl chainlenwmask(%esp), %edx - jmp LoopEntry - -.balign 16 - -/* do { - * match = s->window + cur_match; - * if (*(ushf*)(match+best_len-1) != scan_end || - * *(ushf*)match != scan_start) continue; - * [...] - * } while ((cur_match = prev[cur_match & wmask]) > limit - * && --chain_length != 0); - * - * Here is the inner loop of the function. The function will spend the - * majority of its time in this loop, and majority of that time will - * be spent in the first ten instructions. - * - * Within this loop: - * %ebx = scanend - * %ecx = curmatch - * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) - * %esi = windowbestlen - i.e., (window + bestlen) - * %edi = prev - * %ebp = limit - */ -LookupLoop: - andl %edx, %ecx - movzwl (%edi,%ecx,2), %ecx - cmpl %ebp, %ecx - jbe LeaveNow - subl $0x00010000, %edx - js LeaveNow -LoopEntry: movzwl -1(%esi,%ecx), %eax - cmpl %ebx, %eax - jnz LookupLoop - movl window(%esp), %eax - movzwl (%eax,%ecx), %eax - cmpl scanstart(%esp), %eax - jnz LookupLoop - -/* Store the current value of chainlen. */ - - movl %edx, chainlenwmask(%esp) - -/* Point %edi to the string under scrutiny, and %esi to the string we */ -/* are hoping to match it up with. In actuality, %esi and %edi are */ -/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ -/* initialized to -(MAX_MATCH_8 - scanalign). */ - - movl window(%esp), %esi - movl scan(%esp), %edi - addl %ecx, %esi - movl scanalign(%esp), %eax - movl $(-MAX_MATCH_8), %edx - lea MAX_MATCH_8(%edi,%eax), %edi - lea MAX_MATCH_8(%esi,%eax), %esi - -/* Test the strings for equality, 8 bytes at a time. At the end, - * adjust %edx so that it is offset to the exact byte that mismatched. - * - * We already know at this point that the first three bytes of the - * strings match each other, and they can be safely passed over before - * starting the compare loop. So what this code does is skip over 0-3 - * bytes, as much as necessary in order to dword-align the %edi - * pointer. (%esi will still be misaligned three times out of four.) - * - * It should be confessed that this loop usually does not represent - * much of the total running time. Replacing it with a more - * straightforward "rep cmpsb" would not drastically degrade - * performance. - */ -LoopCmps: - movl (%esi,%edx), %eax - xorl (%edi,%edx), %eax - jnz LeaveLoopCmps - movl 4(%esi,%edx), %eax - xorl 4(%edi,%edx), %eax - jnz LeaveLoopCmps4 - addl $8, %edx - jnz LoopCmps - jmp LenMaximum -LeaveLoopCmps4: addl $4, %edx -LeaveLoopCmps: testl $0x0000FFFF, %eax - jnz LenLower - addl $2, %edx - shrl $16, %eax -LenLower: subb $1, %al - adcl $0, %edx - -/* Calculate the length of the match. If it is longer than MAX_MATCH, */ -/* then automatically accept it as the best possible match and leave. */ - - lea (%edi,%edx), %eax - movl scan(%esp), %edi - subl %edi, %eax - cmpl $MAX_MATCH, %eax - jge LenMaximum - -/* If the length of the match is not longer than the best match we */ -/* have so far, then forget it and return to the lookup loop. */ - - movl deflatestate(%esp), %edx - movl bestlen(%esp), %ebx - cmpl %ebx, %eax - jg LongerMatch - movl windowbestlen(%esp), %esi - movl dsPrev(%edx), %edi - movl scanend(%esp), %ebx - movl chainlenwmask(%esp), %edx - jmp LookupLoop - -/* s->match_start = cur_match; */ -/* best_len = len; */ -/* if (len >= nice_match) break; */ -/* scan_end = *(ushf*)(scan+best_len-1); */ - -LongerMatch: movl nicematch(%esp), %ebx - movl %eax, bestlen(%esp) - movl %ecx, dsMatchStart(%edx) - cmpl %ebx, %eax - jge LeaveNow - movl window(%esp), %esi - addl %eax, %esi - movl %esi, windowbestlen(%esp) - movzwl -1(%edi,%eax), %ebx - movl dsPrev(%edx), %edi - movl %ebx, scanend(%esp) - movl chainlenwmask(%esp), %edx - jmp LookupLoop - -/* Accept the current string, with the maximum possible length. */ - -LenMaximum: movl deflatestate(%esp), %edx - movl $MAX_MATCH, bestlen(%esp) - movl %ecx, dsMatchStart(%edx) - -/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ -/* return s->lookahead; */ - -LeaveNow: - movl deflatestate(%esp), %edx - movl bestlen(%esp), %ebx - movl dsLookahead(%edx), %eax - cmpl %eax, %ebx - jg LookaheadRet - movl %ebx, %eax -LookaheadRet: - -/* Restore the stack and return from whence we came. */ - - addl $LocalVarsSize, %esp - .cfi_def_cfa_offset 20 - popl %ebx - .cfi_def_cfa_offset 16 - popl %esi - .cfi_def_cfa_offset 12 - popl %edi - .cfi_def_cfa_offset 8 - popl %ebp - .cfi_def_cfa_offset 4 -.cfi_endproc -match_init: ret diff --git a/sys/dev/ice/ice_sriov.c b/sys/dev/ice/ice_sriov.c deleted file mode 100644 index c0521e667fa2..000000000000 --- a/sys/dev/ice/ice_sriov.c +++ /dev/null @@ -1,595 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation - * 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 Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "ice_common.h" -#include "ice_sriov.h" - -/** - * ice_aq_send_msg_to_vf - * @hw: pointer to the hardware structure - * @vfid: VF ID to send msg - * @v_opcode: opcodes for VF-PF communication - * @v_retval: return error code - * @msg: pointer to the msg buffer - * @msglen: msg length - * @cd: pointer to command details - * - * Send message to VF driver (0x0802) using mailbox - * queue and asynchronously sending message via - * ice_sq_send_cmd() function - */ -enum ice_status -ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval, - u8 *msg, u16 msglen, struct ice_sq_cd *cd) -{ - struct ice_aqc_pf_vf_msg *cmd; - struct ice_aq_desc desc; - - ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf); - - cmd = &desc.params.virt; - cmd->id = CPU_TO_LE32(vfid); - - desc.cookie_high = CPU_TO_LE32(v_opcode); - desc.cookie_low = CPU_TO_LE32(v_retval); - - if (msglen) - desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); - - return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); -} - -/** - * ice_aq_send_msg_to_pf - * @hw: pointer to the hardware structure - * @v_opcode: opcodes for VF-PF communication - * @v_retval: return error code - * @msg: pointer to the msg buffer - * @msglen: msg length - * @cd: pointer to command details - * - * Send message to PF driver using mailbox queue. By default, this - * message is sent asynchronously, i.e. ice_sq_send_cmd() - * does not wait for completion before returning. - */ -enum ice_status -ice_aq_send_msg_to_pf(struct ice_hw *hw, enum virtchnl_ops v_opcode, - enum ice_status v_retval, u8 *msg, u16 msglen, - struct ice_sq_cd *cd) -{ - struct ice_aq_desc desc; - - ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_pf); - desc.cookie_high = CPU_TO_LE32(v_opcode); - desc.cookie_low = CPU_TO_LE32(v_retval); - - if (msglen) - desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); - - return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); -} - -/** - * ice_conv_link_speed_to_virtchnl - * @adv_link_support: determines the format of the returned link speed - * @link_speed: variable containing the link_speed to be converted - * - * Convert link speed supported by HW to link speed supported by virtchnl. - * If adv_link_support is true, then return link speed in Mbps. Else return - * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that the caller - * needs to cast back to an enum virtchnl_link_speed in the case where - * adv_link_support is false, but when adv_link_support is true the caller can - * expect the speed in Mbps. - */ -u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_speed) -{ - u32 speed; - - if (adv_link_support) - switch (link_speed) { - case ICE_AQ_LINK_SPEED_10MB: - speed = ICE_LINK_SPEED_10MBPS; - break; - case ICE_AQ_LINK_SPEED_100MB: - speed = ICE_LINK_SPEED_100MBPS; - break; - case ICE_AQ_LINK_SPEED_1000MB: - speed = ICE_LINK_SPEED_1000MBPS; - break; - case ICE_AQ_LINK_SPEED_2500MB: - speed = ICE_LINK_SPEED_2500MBPS; - break; - case ICE_AQ_LINK_SPEED_5GB: - speed = ICE_LINK_SPEED_5000MBPS; - break; - case ICE_AQ_LINK_SPEED_10GB: - speed = ICE_LINK_SPEED_10000MBPS; - break; - case ICE_AQ_LINK_SPEED_20GB: - speed = ICE_LINK_SPEED_20000MBPS; - break; - case ICE_AQ_LINK_SPEED_25GB: - speed = ICE_LINK_SPEED_25000MBPS; - break; - case ICE_AQ_LINK_SPEED_40GB: - speed = ICE_LINK_SPEED_40000MBPS; - break; - case ICE_AQ_LINK_SPEED_50GB: - speed = ICE_LINK_SPEED_50000MBPS; - break; - case ICE_AQ_LINK_SPEED_100GB: - speed = ICE_LINK_SPEED_100000MBPS; - break; - default: - speed = ICE_LINK_SPEED_UNKNOWN; - break; - } - else - /* Virtchnl speeds are not defined for every speed supported in - * the hardware. To maintain compatibility with older AVF - * drivers, while reporting the speed the new speed values are - * resolved to the closest known virtchnl speeds - */ - switch (link_speed) { - case ICE_AQ_LINK_SPEED_10MB: - case ICE_AQ_LINK_SPEED_100MB: - speed = (u32)VIRTCHNL_LINK_SPEED_100MB; - break; - case ICE_AQ_LINK_SPEED_1000MB: - case ICE_AQ_LINK_SPEED_2500MB: - case ICE_AQ_LINK_SPEED_5GB: - speed = (u32)VIRTCHNL_LINK_SPEED_1GB; - break; - case ICE_AQ_LINK_SPEED_10GB: - speed = (u32)VIRTCHNL_LINK_SPEED_10GB; - break; - case ICE_AQ_LINK_SPEED_20GB: - speed = (u32)VIRTCHNL_LINK_SPEED_20GB; - break; - case ICE_AQ_LINK_SPEED_25GB: - speed = (u32)VIRTCHNL_LINK_SPEED_25GB; - break; - case ICE_AQ_LINK_SPEED_40GB: - case ICE_AQ_LINK_SPEED_50GB: - case ICE_AQ_LINK_SPEED_100GB: - speed = (u32)VIRTCHNL_LINK_SPEED_40GB; - break; - default: - speed = (u32)VIRTCHNL_LINK_SPEED_UNKNOWN; - break; - } - - return speed; -} - -/* The mailbox overflow detection algorithm helps to check if there - * is a possibility of a malicious VF transmitting too many MBX messages to the - * PF. - * 1. The mailbox snapshot structure, ice_mbx_snapshot, is initialized during - * driver initialization in ice_init_hw() using ice_mbx_init_snapshot(). - * The struct ice_mbx_snapshot helps to track and traverse a static window of - * messages within the mailbox queue while looking for a malicious VF. - * - * 2. When the caller starts processing its mailbox queue in response to an - * interrupt, the structure ice_mbx_snapshot is expected to be cleared before - * the algorithm can be run for the first time for that interrupt. This can be - * done via ice_mbx_reset_snapshot(). - * - * 3. For every message read by the caller from the MBX Queue, the caller must - * call the detection algorithm's entry function ice_mbx_vf_state_handler(). - * Before every call to ice_mbx_vf_state_handler() the struct ice_mbx_data is - * filled as it is required to be passed to the algorithm. - * - * 4. Every time a message is read from the MBX queue, a VFId is received which - * is passed to the state handler. The boolean output is_malvf of the state - * handler ice_mbx_vf_state_handler() serves as an indicator to the caller - * whether this VF is malicious or not. - * - * 5. When a VF is identified to be malicious, the caller can send a message - * to the system administrator. The caller can invoke ice_mbx_report_malvf() - * to help determine if a malicious VF is to be reported or not. This function - * requires the caller to maintain a global bitmap to track all malicious VFs - * and pass that to ice_mbx_report_malvf() along with the VFID which was identified - * to be malicious by ice_mbx_vf_state_handler(). - * - * 6. The global bitmap maintained by PF can be cleared completely if PF is in - * reset or the bit corresponding to a VF can be cleared if that VF is in reset. - * When a VF is shut down and brought back up, we assume that the new VF - * brought up is not malicious and hence report it if found malicious. - * - * 7. The function ice_mbx_reset_snapshot() is called to reset the information - * in ice_mbx_snapshot for every new mailbox interrupt handled. - * - * 8. The memory allocated for variables in ice_mbx_snapshot is de-allocated - * when driver is unloaded. - */ -#define ICE_RQ_DATA_MASK(rq_data) ((rq_data) & PF_MBX_ARQH_ARQH_M) -/* Using the highest value for an unsigned 16-bit value 0xFFFF to indicate that - * the max messages check must be ignored in the algorithm - */ -#define ICE_IGNORE_MAX_MSG_CNT 0xFFFF - -/** - * ice_mbx_traverse - Pass through mailbox snapshot - * @hw: pointer to the HW struct - * @new_state: new algorithm state - * - * Traversing the mailbox static snapshot without checking - * for malicious VFs. - */ -static void -ice_mbx_traverse(struct ice_hw *hw, - enum ice_mbx_snapshot_state *new_state) -{ - struct ice_mbx_snap_buffer_data *snap_buf; - u32 num_iterations; - - snap_buf = &hw->mbx_snapshot.mbx_buf; - - /* As mailbox buffer is circular, applying a mask - * on the incremented iteration count. - */ - num_iterations = ICE_RQ_DATA_MASK(++snap_buf->num_iterations); - - /* Checking either of the below conditions to exit snapshot traversal: - * Condition-1: If the number of iterations in the mailbox is equal to - * the mailbox head which would indicate that we have reached the end - * of the static snapshot. - * Condition-2: If the maximum messages serviced in the mailbox for a - * given interrupt is the highest possible value then there is no need - * to check if the number of messages processed is equal to it. If not - * check if the number of messages processed is greater than or equal - * to the maximum number of mailbox entries serviced in current work item. - */ - if (num_iterations == snap_buf->head || - (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && - ++snap_buf->num_msg_proc >= snap_buf->max_num_msgs_mbx)) - *new_state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; -} - -/** - * ice_mbx_detect_malvf - Detect malicious VF in snapshot - * @hw: pointer to the HW struct - * @vf_id: relative virtual function ID - * @new_state: new algorithm state - * @is_malvf: boolean output to indicate if VF is malicious - * - * This function tracks the number of asynchronous messages - * sent per VF and marks the VF as malicious if it exceeds - * the permissible number of messages to send. - */ -static enum ice_status -ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id, - enum ice_mbx_snapshot_state *new_state, - bool *is_malvf) -{ - struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; - - if (vf_id >= snap->mbx_vf.vfcntr_len) - return ICE_ERR_OUT_OF_RANGE; - - /* increment the message count in the VF array */ - snap->mbx_vf.vf_cntr[vf_id]++; - - if (snap->mbx_vf.vf_cntr[vf_id] >= ICE_ASYNC_VF_MSG_THRESHOLD) - *is_malvf = true; - - /* continue to iterate through the mailbox snapshot */ - ice_mbx_traverse(hw, new_state); - - return ICE_SUCCESS; -} - -/** - * ice_mbx_reset_snapshot - Reset mailbox snapshot structure - * @snap: pointer to mailbox snapshot structure in the ice_hw struct - * - * Reset the mailbox snapshot structure and clear VF counter array. - */ -static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap) *** 15611 LINES SKIPPED *** From nobody Fri Aug 16 03:33:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlSJ33JPFz5HpHY; Fri, 16 Aug 2024 03:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlSJ317Wdz4hBD; Fri, 16 Aug 2024 03:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723779203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fCqJbz034EdmlPvzXlEu4JOUf/Ynq/IhULadP2fvxCM=; b=jnafNoVO1ooKtRclWjykq7pVTNwtn1rLrGxGbEN5NeWH5bgeogGTg5yf9HM1eilvYOUs4w VN1M9PBFHA9sxjEff++HSHT4run48XnLVleLh2UHmCz11hmHmWNA15ffp18QiVtcputcyd WxZSh82IKDm7dcdaHcqrh31VzYeepSLa6/oknHppiclE0oI5wQMU2FQZltKX68gA9IXQ+R MPPw1wLnlfytoW65fWlpcFGrjnOp26xgg8FGp32DnQnsLXKwyTfrw0jLAd7Yu0A0WeSBPd 7TeJP+YoKTBABcI+doIuyDr08AsUpadoMPPMK0qNff2FJl9v7N4GmqywbtfGgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723779203; a=rsa-sha256; cv=none; b=bfPEPrK6FmpGh9GPeDK1unRxIJWsQLLnWQbyrakhAFaVCPGwgQ6AHGsUyzZDST+yU3qWOp Fkppec/k1FLZxQ3q7l/0Peg/PuoX2bNs/PKaaz0zCtxtbURS/aOb7P1aRNOc/hb3p6blih tq2iNsQ8Png6Bb5yKIjkwAzuyT4UkF+YpVIzDAROLLKwexCbzBKtLTvfm3GTJEDUBHLTuD vm27kDYaWQg2H6ri7hNwcL7YEfQXxbyQ9sOlXY9wEaDzz0k7weHuUfRvMN10U62opYpQ4l V/EUDlO/5OW5t62GHsveU7u525BxrqEMoTKXgBlVu18J1wdxBNNTLtztxKSMxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723779203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fCqJbz034EdmlPvzXlEu4JOUf/Ynq/IhULadP2fvxCM=; b=N2+QhC70wZHqXWvdiho6UsVex68ggBIQ9Ou/I/ooig1uJzhCZT2vg2l4i9ND2XPOEygMCk S7unJxpWuUDsN01C1wemvHeUdbHieiD43rvhBIZSJDuaVHpDgEtZf6Cuw9ytK/OswhYxe5 vT3vcE9fm/2VLnyNhXRFv3fKMqIQqc/vRyHGAFQrvAMUNoKvnfOTfUxnHTrzjW3T8pXXGC ZmPHdb1nYeVhUr2fnlGlpyxqQ/TSW005kwzogvVRjFzhrMmsM3jMWtvb7Owei27LCRhek6 R28xQSxysV29BE3iV4X3Chl2DIB/GLgtJlf2QaWpf3mJIORmWM6AKDPdcWZ2Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlSJ26mwDzqfc; Fri, 16 Aug 2024 03:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G3XMmI056424; Fri, 16 Aug 2024 03:33:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G3XMMv056421; Fri, 16 Aug 2024 03:33:22 GMT (envelope-from git) Date: Fri, 16 Aug 2024 03:33:22 GMT Message-Id: <202408160333.47G3XMMv056421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3d89acf59098 - main - nvme: Separate total failures from I/O failures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d89acf59098cc7a7a118c8aed89e562f686d8ed Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3d89acf59098cc7a7a118c8aed89e562f686d8ed commit 3d89acf59098cc7a7a118c8aed89e562f686d8ed Author: Warner Losh AuthorDate: 2024-08-14 22:55:49 +0000 Commit: Warner Losh CommitDate: 2024-08-16 03:31:20 +0000 nvme: Separate total failures from I/O failures When it's a I/O failure, we can still send admin commands. Separate out the admin failures and flag them as such so that we can still send admin commands on half-failed drives. Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in failed state) Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 46 ++++++++++++++++++++++++++------------------- sys/dev/nvme/nvme_private.h | 1 + sys/dev/nvme/nvme_qpair.c | 23 +++++++++++++++-------- sys/dev/nvme/nvme_sim.c | 13 ++++++++++++- 4 files changed, 55 insertions(+), 28 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 270be61e2d36..4c1a3830aac0 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -232,7 +232,7 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller *ctrlr) } static void -nvme_ctrlr_fail(struct nvme_controller *ctrlr) +nvme_ctrlr_fail(struct nvme_controller *ctrlr, bool admin_also) { int i; @@ -242,7 +242,10 @@ nvme_ctrlr_fail(struct nvme_controller *ctrlr) * a different error, though when we fail, that hardly matters). */ ctrlr->is_failed = true; - nvme_qpair_fail(&ctrlr->adminq); + if (admin_also) { + ctrlr->is_failed_admin = true; + nvme_qpair_fail(&ctrlr->adminq); + } if (ctrlr->ioq != NULL) { for (i = 0; i < ctrlr->num_io_queues; i++) { nvme_qpair_fail(&ctrlr->ioq[i]); @@ -415,6 +418,7 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) TSENTER(); + ctrlr->is_failed_admin = true; nvme_ctrlr_disable_qpairs(ctrlr); err = nvme_ctrlr_disable(ctrlr); @@ -423,6 +427,8 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) err = nvme_ctrlr_enable(ctrlr); out: + if (err == 0) + ctrlr->is_failed_admin = false; TSEXIT(); return (err); @@ -435,11 +441,10 @@ nvme_ctrlr_reset(struct nvme_controller *ctrlr) cmpset = atomic_cmpset_32(&ctrlr->is_resetting, 0, 1); - if (cmpset == 0 || ctrlr->is_failed) + if (cmpset == 0) /* - * Controller is already resetting or has failed. Return - * immediately since there is no need to kick off another - * reset in these cases. + * Controller is already resetting. Return immediately since + * there is no need to kick off another reset. */ return; @@ -1090,7 +1095,7 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) return; if (resetting && nvme_ctrlr_identify(ctrlr) != 0) { - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, false); return; } @@ -1105,7 +1110,7 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) if (resetting) { old_num_io_queues = ctrlr->num_io_queues; if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) { - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, false); return; } @@ -1123,12 +1128,12 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) nvme_ctrlr_hmb_enable(ctrlr, true, true); if (nvme_ctrlr_create_qpairs(ctrlr) != 0) { - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, false); return; } if (nvme_ctrlr_construct_namespaces(ctrlr) != 0) { - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, false); return; } @@ -1148,8 +1153,7 @@ nvme_ctrlr_start_config_hook(void *arg) TSENTER(); if (nvme_ctrlr_hw_reset(ctrlr) != 0) { -fail: - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, true); config_intrhook_disestablish(&ctrlr->config_hook); return; } @@ -1162,13 +1166,15 @@ fail: nvme_ctrlr_construct_io_qpairs(ctrlr) == 0) nvme_ctrlr_start(ctrlr, false); else - goto fail; + nvme_ctrlr_fail(ctrlr, false); nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->is_initialized = true; - nvme_notify_new_controller(ctrlr); + if (!ctrlr->is_failed) { + ctrlr->is_initialized = true; + nvme_notify_new_controller(ctrlr); + } TSEXIT(); } @@ -1185,7 +1191,7 @@ nvme_ctrlr_reset_task(void *arg, int pending) nvme_ctrlr_start(ctrlr, true); } else { nvme_ctrlr_devctl_log(ctrlr, "RESET", "event=\"timed_out\""); - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, true); } atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); @@ -1612,7 +1618,7 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) */ gone = (nvme_mmio_read_4(ctrlr, csts) == NVME_GONE); if (gone) - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, true); else nvme_notify_fail_consumers(ctrlr); @@ -1742,7 +1748,9 @@ nvme_ctrlr_suspend(struct nvme_controller *ctrlr) int to = hz; /* - * Can't touch failed controllers, so it's already suspended. + * Can't touch failed controllers, so it's already suspended. User will + * need to do an explicit reset to bring it back, if that's even + * possible. */ if (ctrlr->is_failed) return (0); @@ -1809,7 +1817,7 @@ fail: * itself, due to questionable APIs. */ nvme_printf(ctrlr, "Failed to reset on resume, failing.\n"); - nvme_ctrlr_fail(ctrlr); + nvme_ctrlr_fail(ctrlr, true); (void)atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); return (0); } diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 57613242ea84..029c2ff97bff 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -301,6 +301,7 @@ struct nvme_controller { uint32_t notification_sent; bool is_failed; + bool is_failed_admin; bool is_dying; bool isr_warned; bool is_initialized; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 0c3a36d4d76f..fcc95bf854b9 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1046,6 +1046,7 @@ nvme_qpair_timeout(void *arg) struct nvme_tracker *tr; sbintime_t now; bool idle = true; + bool is_admin = qpair == &ctrlr->adminq; bool fast; uint32_t csts; uint8_t cfs; @@ -1057,9 +1058,10 @@ nvme_qpair_timeout(void *arg) * failure processing that races with the qpair timeout will fail * safely. */ - if (qpair->ctrlr->is_failed) { + if (is_admin ? qpair->ctrlr->is_failed_admin : qpair->ctrlr->is_failed) { nvme_printf(qpair->ctrlr, - "Failed controller, stopping watchdog timeout.\n"); + "%sFailed controller, stopping watchdog timeout.\n", + is_admin ? "Complete " : ""); qpair->timer_armed = false; return; } @@ -1329,6 +1331,7 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) { struct nvme_tracker *tr; int err = 0; + bool is_admin = qpair == &qpair->ctrlr->adminq; mtx_assert(&qpair->lock, MA_OWNED); @@ -1338,12 +1341,14 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) /* * The controller has failed, so fail the request. Note, that this races * the recovery / timeout code. Since we hold the qpair lock, we know - * it's safe to fail directly. is_failed is set when we fail the controller. - * It is only ever reset in the ioctl reset controller path, which is safe - * to race (for failed controllers, we make no guarantees about bringing - * it out of failed state relative to other commands). + * it's safe to fail directly. is_failed is set when we fail the + * controller. It is only ever reset in the ioctl reset controller + * path, which is safe to race (for failed controllers, we make no + * guarantees about bringing it out of failed state relative to other + * commands). We try hard to allow admin commands when the entire + * controller hasn't failed, only something related to I/O queues. */ - if (qpair->ctrlr->is_failed) { + if (is_admin ? qpair->ctrlr->is_failed_admin : qpair->ctrlr->is_failed) { nvme_qpair_manual_complete_request(qpair, req, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 1, ERROR_PRINT_NONE); @@ -1410,11 +1415,13 @@ nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) static void nvme_qpair_enable(struct nvme_qpair *qpair) { + bool is_admin __unused = qpair == &qpair->ctrlr->adminq; + if (mtx_initialized(&qpair->recovery)) mtx_assert(&qpair->recovery, MA_OWNED); if (mtx_initialized(&qpair->lock)) mtx_assert(&qpair->lock, MA_OWNED); - KASSERT(!qpair->ctrlr->is_failed, + KASSERT(!(is_admin ? qpair->ctrlr->is_failed_admin : qpair->ctrlr->is_failed), ("Enabling a failed qpair\n")); qpair->recovery_state = RECOVERY_NONE; diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index 2ba3df9ea6e8..8bdeb4be49f3 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -268,7 +268,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; case XPT_NVME_IO: /* Execute the requested I/O operation */ - case XPT_NVME_ADMIN: /* or Admin operation */ if (ctrlr->is_failed) { /* * I/O came in while we were failing the drive, so drop @@ -279,6 +278,18 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) } nvme_sim_nvmeio(sim, ccb); return; /* no done */ + case XPT_NVME_ADMIN: /* or Admin operation */ + if (ctrlr->is_failed_admin) { + /* + * Admin request came in when we can't send admin + * commands, so drop it. Once falure is complete, we'll + * be destroyed. + */ + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + break; + } + nvme_sim_nvmeio(sim, ccb); + return; /* no done */ default: ccb->ccb_h.status = CAM_REQ_INVALID; break; From nobody Fri Aug 16 05:01:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlVFR69fSz5HxRr; Fri, 16 Aug 2024 05:01:15 +0000 (UTC) (envelope-from oleg.nauman@gmail.com) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlVFR1Gjqz4rMl; Fri, 16 Aug 2024 05:01:15 +0000 (UTC) (envelope-from oleg.nauman@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Pkk2rXqY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of oleg.nauman@gmail.com designates 2607:f8b0:4864:20::1130 as permitted sender) smtp.mailfrom=oleg.nauman@gmail.com Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-64b417e1511so16343227b3.3; Thu, 15 Aug 2024 22:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723784474; x=1724389274; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qOnTRvCyDzCGdZdw779WjgGvGEtdXVFUoBJM+NDDgO0=; b=Pkk2rXqYftJlDy1dc9GBpPkQIsT8MjJHPCC5jleaujNjL3rVCvO5JSwnRzdmEYI1SD RW/KhZD+SSd0ORL03R1f6D0lcDWm7+AfujE2yTMYZ0KF8JaMkTfHkfJitzPvjwse95X3 5vzNuVoKR3hchv9jx7cJX4TmTdCu/PpT7V7AR9MEng02Ek3w+mxflKHOPksMYnN46xby wLN7RpH/ZxyQ14EwcACOmTw7iW3+nKk7U+m7lc6v6RqxAyDF8PaMUkbmkqB5eEfgOdP9 /oIgfKfKtfw+teq46NtZbYY67m1bkJZurmLc+jDgrG/wRAzAu8on71FoHfEynLnMDG3t dUSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723784474; x=1724389274; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qOnTRvCyDzCGdZdw779WjgGvGEtdXVFUoBJM+NDDgO0=; b=WXBhJ/JTiq+nY0j8pJBNvdRuwuZ2kVZFFtWtIGqsl7zmRpNy/bsPZ7GaBttHAZZC2k QwtPncXQ/Ts2hSyc2qw6EU0PNszXKkXi4hJsgGBD4dQyXhnEVJbPdi/Whyt7+2zRhMQn IXLeTeuSmWp+Oty7JyPkgN028BV696xsreHaLASDJGWg/I6FD5szqXGkUI1xR9TmRtM/ vp9hMkDzYTg/EAuV/7oqly+g3eH05BibfgT3paFFiqJNVWRZFwIiSHZSW5w0nCiYpcFi Pkb7h2VPLaAUheI+PE5X7a7Lr0KYUKec70mM/u1mn4HVPVJ+thRu9hGyvD2e6BcXiCN8 +KEA== X-Forwarded-Encrypted: i=1; AJvYcCUhPQ0lpDbl5wBjIKFbO7KED5NdlZaE+/XUR0TtDzyxyGI7UkPoWCSFmAvRu1YtUeHSeKEQiHuF3/jmXkYwd6x8+VFSnOHfB1uQ1GpNWS7/GQwOl9Wfd/uNlaz3W56aOGEnX5LwILl7XdUTcoOgV0+dC7LOx7WO8e8oMAYcbvEq/HDjv2FcnjpUlAC66CQ= X-Gm-Message-State: AOJu0YxCk40X1fPouVumTcAQ5W+oSgbl+WniSI3L8nFk07256fItFWA9 ugEGPvWvdDRSBNenlhyRnn9T934BoB904wQt+JPmMgRGkPVMKlhHWmPTk3QOlMMS/RD4rQDyADR ZR9n2Ste1VqEpQdtlPJkwefrYRamDPTRD X-Google-Smtp-Source: AGHT+IHOXANcrfELcgwn9GQyub+dlo6fK1ktRncHUqntLNI63TtvKboXANxu+eWWCp9GCoXmE+QfqE+o6bPMUOCxnv0= X-Received: by 2002:a05:690c:f01:b0:62f:f535:f38 with SMTP id 00721157ae682-6b1b9a64059mr25725907b3.8.1723784473709; Thu, 15 Aug 2024 22:01:13 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202407311450.46VEoql9014730@gitrepo.freebsd.org> <58a179b1-9e92-461a-8902-31bd0a8c057e@FreeBSD.org> In-Reply-To: <58a179b1-9e92-461a-8902-31bd0a8c057e@FreeBSD.org> From: Oleg Nauman Date: Fri, 16 Aug 2024 08:01:02 +0300 Message-ID: Subject: Re: git: f44ff2aba2d6 - main - bhyve: Treat the COMMAND register for PCI passthru devices as emulated To: Navdeep Parhar Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.32 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.32)[-0.318]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1130:from]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TAGGED_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4WlVFR1Gjqz4rMl Hello, I can confirm that net/wifibox fails to operate after f44ff2aba2d6 On Wed, Aug 14, 2024 at 4:17=E2=80=AFAM Navdeep Parhar wro= te: > > On 7/31/24 7:50 AM, John Baldwin wrote: > > The branch main has been updated by jhb: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Df44ff2aba2d64d1d9312cb55= 008dc90275ccdc04 > > > > commit f44ff2aba2d64d1d9312cb55008dc90275ccdc04 > > Author: John Baldwin > > AuthorDate: 2024-07-31 14:50:33 +0000 > > Commit: John Baldwin > > CommitDate: 2024-07-31 14:50:33 +0000 > > > > bhyve: Treat the COMMAND register for PCI passthru devices as emul= ated > > > > Don't pass through writes of the command register through to the > > physical device. These registers do not need to be in sync, and i= n > > some cases (e.g. when the guest is sizing the BAR and temporarily > > disables decoding), the states need to diverge. > > This seems to break MSI-X interrupts for a device that is passed through > to a VM. That is, the device generates an interrupt but the driver in > the VM never receives it. Reverting this change fixes the problem. > > Regards, > Navdeep > > From nobody Fri Aug 16 07:20:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlYLJ4rC8z5SKqr; Fri, 16 Aug 2024 07:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlYLJ2pVvz54B8; Fri, 16 Aug 2024 07:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723792840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5it9/GkKus0mcGVVHaJEAbHSfzDxe/Xh8hEUDewGpsQ=; b=QD7Qj6RgX0ISnJdfLgYwWrO6Y6olzNWs0SVByG+iQA8z/H2HGniHN8YRb0sFcy7i4Geq0B NCfEE5BBKMz/Sx8ekvH/63lDEfdLuMkjRCVZcN5QrYYdxm/FmiLIt8Bz1J8gucMdF4wnGm dYMzBJSGSIV73lW5837+ZVfPLEj5YubC2Ugyvp2JC1HU/Cfia3fd9pmCLQjRQJwMuw6yxs UDVgTiyx2HZJpMow/BMb+/rwgzJbR4f/k/Pee+xnlvo2hpuQjJWCtKGaeK4fP+tRkHUhAi +HFnqrsIrR4AyGmGGFdYDs8vHjj5toO1lugBzY8TXTujaPr/J2XQ5f/b+bm+LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723792840; a=rsa-sha256; cv=none; b=ZogHLefPmOOU5gAnHKH5HmkXe1F2hhaODLU+/fYQ2Q5U49l4oBInxswQwTyjjVmelxvXmc s9SAHsHlXAOBbEPFK/YyyRQRDRsHB56hB8ugaTFFXw/IWHcVhiPb9/HGKH2w2zHLqXLXvS ndmfBRGUusyB9yknN+Mf2JhqbJTRWZi2zyfHiUjPV5gbTRSlyUktciuOffVtRdNhMxTtDC OZwTapZ4jk37cy2P2IAjN6z8cjDDHdOcNSTdo9CgV3Z9jrNp5R4b2pvAvNUUsY3TAM2enz kEqu7OLKVK+MQndR4FCFdBoNPkmPT3BOTkmeiFk3KVbOtxn6pGvrcrIe6074mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723792840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5it9/GkKus0mcGVVHaJEAbHSfzDxe/Xh8hEUDewGpsQ=; b=FQzllBI2m+Ecbl9CxoxulE0ZWfiMNSQgGFnxcr3/rvcBOBhds9f8vqd6iJh698IyYRwGcr 8XE9nAhviwT2Wl/xrvKE/UT5KulC7r4RZwyio+fTdnuA3zADg8qu8hXfIHRdC9Mjp+6Liq dNYN4iAmsk+PhmAzC8HI73dKwVX/GKKHyjyh7Wf/ZGzhHVP3USpcj/OpIhnCb5rG90dZAa UxrZxZpWlzbGCWXIBABioOBYEVqni3QO9UGP8GRA2HLYbZhfm3JN0/NkhWF71m9lN+cvKW XKsGCA35i7UGpelkhzxY+jVhguI3mSJjrzazq0gd49PJ+xU7qA7JXBcWsJ317Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlYLJ1zV0zxVg; Fri, 16 Aug 2024 07:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G7KewJ040406; Fri, 16 Aug 2024 07:20:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G7Kexi040403; Fri, 16 Aug 2024 07:20:40 GMT (envelope-from git) Date: Fri, 16 Aug 2024 07:20:40 GMT Message-Id: <202408160720.47G7Kexi040403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 41e03b46dab4 - main - stress2: Fix warning about unused variable. Remove debug "date" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41e03b46dab43dfb30b025302ec2df52c8f34d04 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=41e03b46dab43dfb30b025302ec2df52c8f34d04 commit 41e03b46dab43dfb30b025302ec2df52c8f34d04 Author: Peter Holm AuthorDate: 2024-08-16 07:19:51 +0000 Commit: Peter Holm CommitDate: 2024-08-16 07:19:51 +0000 stress2: Fix warning about unused variable. Remove debug "date" --- tools/test/stress2/misc/sigreturn3.sh | 5 ++--- tools/test/stress2/misc/sigreturn4.sh | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/test/stress2/misc/sigreturn3.sh b/tools/test/stress2/misc/sigreturn3.sh index fbb19d87cb6e..271ade287e9a 100755 --- a/tools/test/stress2/misc/sigreturn3.sh +++ b/tools/test/stress2/misc/sigreturn3.sh @@ -56,6 +56,7 @@ cat > /tmp/$prog.c < #include #include +#include #include #include #include @@ -92,10 +93,9 @@ static void * calls(void *arg __unused) { time_t start; - int i; start = time(NULL); - for (i = 0; time(NULL) - start < 10; i++) { + while (time(NULL) - start < 10) { arc4random_buf(r, sizeof(r)); alarm(1); syscall(SYS_sigreturn, r); @@ -176,7 +176,6 @@ cc -o $prog -Wall -Wextra -O0 $prog.c -lpthread || exit 1 start=`date +%s` while [ $((`date +%s` - start)) -lt 300 ]; do ./$prog > /dev/null 2>&1 - date +%T done rm -f /tmp/$prog /tmp/$ptog.c /tmp/$prog.core exit 0 diff --git a/tools/test/stress2/misc/sigreturn4.sh b/tools/test/stress2/misc/sigreturn4.sh index f7916dc3b1ee..9e2a6a32715c 100755 --- a/tools/test/stress2/misc/sigreturn4.sh +++ b/tools/test/stress2/misc/sigreturn4.sh @@ -110,10 +110,10 @@ calls(void *arg __unused) { time_t start; ucontext_t uc; - int i, n; + int n; start = time(NULL); - for (i = 0; time(NULL) - start < 10; i++) { + while (time(NULL) - start < 10) { n = 0; if (getcontext(&uc) == -1) err(1, "getcontext"); @@ -202,7 +202,6 @@ cc -o $prog -Wall -Wextra -O0 $prog.c -lpthread || exit 1 start=`date +%s` while [ $((`date +%s` - start)) -lt 300 ]; do ./$prog > /dev/null 2>&1 - date +%T done rm -f /tmp/$prog /tmp/$ptog.c /tmp/$prog.core exit 0 From nobody Fri Aug 16 09:45:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlcYc16R6z5SYxq; Fri, 16 Aug 2024 09:45: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlcYc08zHz43dl; Fri, 16 Aug 2024 09:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723801540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zaMCn7b1YjRlPzp4ow2VOKdd0viE4sBu8pwQZgzXSWI=; b=lXR7yPY3XRKzIdQBYL58P7wo9JxAAtYey2ZcQ7J6pOZkX6ECqTOufTik6o7tcFddXBL/dU J6DeVBh3vWDGWsAWzmK5vF3rVKVnxyVXF3l0GBp94IuulVOwECwzVPNjZBpvpbpP3w5onI tJB6zqupd1jOEZqc1s75TyImMA5UUFG1EmEJZc5T7zYU3hf8il3NZNo6tP0wk5T7oKqd5b s9ph7ss2ScX7NdKKyzd0KHpcRaxL1MKU7wlKoyxBixP6zb5nlOyEXOGDvgItkWTCZA7omi Mg0KXJNfB278rCedGdehhCpYnzPfZXI0XaqN+5kbmTCdZrDZoRn7SyH90lS1+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723801540; a=rsa-sha256; cv=none; b=vgBi19BR6fXklRlpN7dqT5r5HZ31pJpJ8gNj7+3ma1nvl0dSZjlNISqsG9xnoDWJygNrH8 OXVTWJ8L9agj6S7sjolEUVAbi4ijA8cLAJGDp9Tlsv94qRxQFbns0QTHhPAK92QlNISHKk vsbdgm3Q5aJSwA5s/oFQJszUJ/VQjw6EBr8crXtAndirLieuGyWiFFO1BNEtwwyVsq7V1e nBMr41EITl6jP7ZjWaebegTPFlk1wk7J24IsFlC9xcaQyHBjFAmVFrBKB8RSe/0vzDV/16 BmRGsVd4HK+j3c1poGZaZ+10+w3HyDnmcqfBeoWi7s1Ks8ZGeO6CVKCciVzyUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723801540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zaMCn7b1YjRlPzp4ow2VOKdd0viE4sBu8pwQZgzXSWI=; b=K3IUIdYMv7K1yTnizz/9Sd/ND8zbieYv6AJphvOIdkJaGZASuRoccBD9XezBcUMTXkHTwI uy2cbxPAM69gc6OyliuOZPl741vULSv4ROg+6HDOnZpLMYLM+XBIYB6I36wHtxCIIGL4wR +Knw4TXRv/Bz3Eu/YQchxlHKOuacT2KpBOcP0MXThcXQAYD4HfEt4IKXBcA+CkOOWl0IfO ZqkmjoZDvAQoyBJ4IAJs265rt2Q6OWgnlflBYePBlZTZeIvUYdpq7YHd2B/IGUG5RsMSnB wnQ1utizLvuSNux7WOP2C5MhVGrVYD4mUJCJMhfFDjQFoxvqQIp/rQgQBt+oJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlcYb6kTRz11HL; Fri, 16 Aug 2024 09:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47G9jdFP085900; Fri, 16 Aug 2024 09:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47G9jdQU085897; Fri, 16 Aug 2024 09:45:39 GMT (envelope-from git) Date: Fri, 16 Aug 2024 09:45:39 GMT Message-Id: <202408160945.47G9jdQU085897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 788f194f6064 - main - pf: 'sticky-address' requires 'keep state' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 788f194f60641dc3cdf7084c7286d6c9683fd238 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=788f194f60641dc3cdf7084c7286d6c9683fd238 commit 788f194f60641dc3cdf7084c7286d6c9683fd238 Author: Kajetan Staszkiewicz AuthorDate: 2024-08-16 08:08:16 +0000 Commit: Kristof Provost CommitDate: 2024-08-16 09:43:00 +0000 pf: 'sticky-address' requires 'keep state' When route_to() processes a packet without state, pf_map_addr() is called for each packet. Pf_map_addr() will search for a source node and will find none since those are created only in pf_create_state(). Thus sticky address, even though requested in rule definition, will never work. Raise an error when a stateless filter rule uses sticky address to avoid confusion and to keep ruleset limitations in sync with what the pf code really does. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46310 --- sbin/pfctl/parse.y | 4 ++++ sys/netpfil/pf/pf_ioctl.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index d07a3fdc188e..724ffefcd7d9 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5388,6 +5388,10 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) problems++; } } + if (r->rpool.opts & PF_POOL_STICKYADDR && !r->keep_state) { + yyerror("'sticky-address' requires 'keep state'"); + problems++; + } return (-problems); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 5467ebbed2eb..d22ffc2245cb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2207,6 +2207,11 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, (TAILQ_FIRST(&rule->rpool.list) == NULL)) error = EINVAL; + if (rule->action == PF_PASS && rule->rpool.opts & PF_POOL_STICKYADDR && + !rule->keep_state) { + error = EINVAL; + } + if (error) { pf_free_rule(rule); rule = NULL; From nobody Fri Aug 16 17:11:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlpRs65d3z5TFSL; Fri, 16 Aug 2024 17:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlpRs5TXwz4qB7; Fri, 16 Aug 2024 17:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723828281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e6inFatD7kArxAVomzNtr02Awqy/IXHomVuu/iUkn7o=; b=N8w6vThMdcH9YEzjD1MOw+EE+FDSxgz85hROnFgyUSFiVFgcj/zUEyRh95kz70wGtv4LAP p5QflrtmhYZIATb16cn0JcEoooGeRK6F2vslYDSgYrnhqDSTKahyTLfZVJlSOd92wZVWa/ OKJnIUAU4yc5NblA6m63RDtkVxPf6tYY4hCpS2H0IWrHlHRIhrKkMmuO6u/dhWvbv6Dt63 bN9Cc1SWvgBZ6jVfkzCvcvkcUHrsKDcGW2nYMBM/3M/+nDO/0UyZ1pOG8LR+nAIf+vJgGh xb5HLwiaZZvQuBdWbufr2sOU6ocfoHkCPF0a2lUc1XFcc2bgIDrfux2AGDw4ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723828281; a=rsa-sha256; cv=none; b=n4a1WG2cJ32e3UhfSYFeSy9BuD7WSwAP77LcGBFR6GWmGYdW9Y/yLbpe9hyNzNlIkJA40K Fp/XA2ALzF9uEHOyRnWp/ts75Aaj+GTDAxE4SRPapsKd2D+1DNQOq6wOJjWm0r8sSTE+5z 1218Gs7toK95KBaHwVjshQBvzft8YcRhLvScZA743hOAW8iesFLVklu2C8NJhPy2V/A/td Ic50TlEfxR6pIjm4+p/nSEAyGbLidLaj40297O8mZ3AlaO1hN1+dePL+MvFTjK+ZbYZ4Rv +c6M+k+X2YOgxjhD+xSJs8fdNSN+nxSlYCQM8IB/cx/pjI28ShYzJgmOgNUNiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723828281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e6inFatD7kArxAVomzNtr02Awqy/IXHomVuu/iUkn7o=; b=u5Ktc+BWGH6PFZFURMtrandfZvRUCz86CJ5I+SVzARunngJQqJ5vbq6Dj2lPpuW1t/2gQr Ue7PEQXejP6EZWhoaSZEXQF8eJhkfpSruvWTDgMP3ylIKdjU6F7/oZ7gwTNgXOm7BGiNL6 XA8KgjqF/SgUzsLdLAsRYNZW11WHGjvz5zcHLB3cjpqmnhnC+CbVpqqK4witWTeQCqmKl/ 5J2qgFLxw0GW6FLEiLqyeEQrPfVq1W5xtvWQgX5uLcRGlIjDI8rpI8YMmwgsM6jNW2IlXR 5FVl3m1pjQS3afF9ODh41DzWPpp1+IObYjd4pFZnaQRg7TaD7/CR5yWOG0LvXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WlpRs50JlzFWp; Fri, 16 Aug 2024 17:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47GHBLdR046557; Fri, 16 Aug 2024 17:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47GHBLqO046554; Fri, 16 Aug 2024 17:11:21 GMT (envelope-from git) Date: Fri, 16 Aug 2024 17:11:21 GMT Message-Id: <202408161711.47GHBLqO046554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 5685098846d7 - main - unbound: Vendor import 1.21.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5685098846d7f11ad642d9804d94dc7429a7b212 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5685098846d7f11ad642d9804d94dc7429a7b212 commit 5685098846d7f11ad642d9804d94dc7429a7b212 Merge: 788f194f6064 96ef46e5cff0 Author: Cy Schubert AuthorDate: 2024-08-16 16:45:39 +0000 Commit: Cy Schubert CommitDate: 2024-08-16 17:03:34 +0000 unbound: Vendor import 1.21.0 Release notes at https://nlnetlabs.nl/news/2024/Aug/15/unbound-1.21.0-released/ MFC after: 1 week Merge commit '96ef46e5cff01648c80c09c4364d10bc6f58119d' contrib/unbound/Makefile.in | 5 +- contrib/unbound/acx_python.m4 | 2 +- contrib/unbound/cachedb/cachedb.c | 55 +- contrib/unbound/cachedb/cachedb.h | 8 + contrib/unbound/config.guess | 11 +- contrib/unbound/config.h.in | 15 + contrib/unbound/config.sub | 729 ++- contrib/unbound/configure | 290 +- contrib/unbound/configure.ac | 96 +- contrib/unbound/contrib/unbound.service.in | 4 +- .../unbound/contrib/unbound_portable.service.in | 4 +- contrib/unbound/daemon/daemon.c | 43 +- contrib/unbound/daemon/daemon.h | 14 + contrib/unbound/daemon/remote.c | 540 +- contrib/unbound/daemon/stats.c | 9 +- contrib/unbound/daemon/unbound.c | 6 +- contrib/unbound/daemon/worker.c | 11 +- contrib/unbound/dns64/dns64.c | 5 +- contrib/unbound/dnstap/dnstap.c | 45 + contrib/unbound/dnstap/dnstap.h | 8 + contrib/unbound/dnstap/dnstap.m4 | 59 +- contrib/unbound/dnstap/dtstream.c | 53 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 285 +- contrib/unbound/doc/Changelog | 267 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 14 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 66 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 59 +- contrib/unbound/dynlibmod/dynlibmod.c | 4 +- contrib/unbound/edns-subnet/subnetmod.c | 3 +- contrib/unbound/ipsecmod/ipsecmod.c | 2 +- contrib/unbound/ipset/ipset.c | 209 +- contrib/unbound/ipset/ipset.h | 6 +- contrib/unbound/iterator/iter_scrub.c | 82 + contrib/unbound/iterator/iter_utils.c | 3 +- contrib/unbound/iterator/iterator.c | 124 +- contrib/unbound/iterator/iterator.h | 6 + contrib/unbound/libunbound/context.c | 4 +- contrib/unbound/libunbound/libunbound.c | 19 +- contrib/unbound/libunbound/libworker.c | 1 + contrib/unbound/respip/respip.c | 4 +- contrib/unbound/services/authzone.c | 48 +- contrib/unbound/services/cache/dns.c | 33 +- contrib/unbound/services/cache/infra.c | 27 +- contrib/unbound/services/cache/infra.h | 2 +- contrib/unbound/services/listen_dnsport.c | 2 +- contrib/unbound/services/localzone.c | 71 +- contrib/unbound/services/localzone.h | 19 + contrib/unbound/services/mesh.c | 41 +- contrib/unbound/services/modstack.c | 78 +- contrib/unbound/services/modstack.h | 38 +- contrib/unbound/services/outside_network.c | 20 +- contrib/unbound/services/rpz.c | 41 +- contrib/unbound/sldns/parse.h | 6 +- contrib/unbound/sldns/parseutil.c | 9 + contrib/unbound/sldns/rrdef.h | 5 + contrib/unbound/sldns/wire2str.c | 6 + contrib/unbound/smallapp/unbound-anchor.c | 10 +- contrib/unbound/smallapp/unbound-checkconf.c | 9 +- .../unbound/smallapp/unbound-control-setup.sh.in | 4 + contrib/unbound/smallapp/unbound-control.c | 29 +- contrib/unbound/systemd.m4 | 14 +- .../09-unbound-control.tdir/view_local_data | 4 + .../09-unbound-control.tdir/view_local_data_remove | 4 + .../testdata/acl_interface.tdir/rpz-nx.zone | 3 + .../testdata/acl_interface.tdir/rpz-one.zone | 3 + .../testdata/acl_interface.tdir/rpz-two.zone | 3 + contrib/unbound/testdata/cachedb_val_expired.crpl | 327 + .../testdata/cookie_file.tdir/cookie_file.conf | 19 + .../testdata/cookie_file.tdir/cookie_file.dsc | 16 + .../testdata/cookie_file.tdir/cookie_file.pre | 24 + .../testdata/cookie_file.tdir/cookie_file.test | 248 + contrib/unbound/testdata/fwd_name_lookup.rpl | 152 + contrib/unbound/testdata/rpz_cname_tag.rpl | 281 + contrib/unbound/testdata/val_dname_twice.rpl | 226 + contrib/unbound/testdata/val_failure_dnskey.rpl | 348 ++ contrib/unbound/util/alloc.c | 21 + contrib/unbound/util/config_file.c | 82 +- contrib/unbound/util/config_file.h | 4 + contrib/unbound/util/configlexer.c | 6453 ++++++++++---------- contrib/unbound/util/configlexer.lex | 2 + contrib/unbound/util/configparser.c | 4701 +++++++------- contrib/unbound/util/configparser.h | 666 +- contrib/unbound/util/configparser.y | 133 +- contrib/unbound/util/data/dname.h | 2 +- contrib/unbound/util/data/msgparse.c | 50 +- contrib/unbound/util/data/msgparse.h | 5 +- contrib/unbound/util/edns.c | 186 + contrib/unbound/util/edns.h | 85 + contrib/unbound/util/fptr_wlist.c | 26 +- contrib/unbound/util/fptr_wlist.h | 16 + contrib/unbound/util/module.h | 30 +- contrib/unbound/util/net_help.c | 56 +- contrib/unbound/util/net_help.h | 17 + contrib/unbound/util/netevent.c | 21 +- contrib/unbound/util/netevent.h | 3 + contrib/unbound/util/proxy_protocol.c | 1 + contrib/unbound/util/siphash.c | 6 + contrib/unbound/util/storage/lookup3.c | 227 +- contrib/unbound/validator/autotrust.c | 3 +- contrib/unbound/validator/val_nsec.c | 12 +- contrib/unbound/validator/val_nsec.h | 4 +- contrib/unbound/validator/val_nsec3.c | 9 +- contrib/unbound/validator/val_nsec3.h | 4 +- contrib/unbound/validator/val_secalgo.c | 8 +- contrib/unbound/validator/val_sigcrypt.c | 19 +- contrib/unbound/validator/val_sigcrypt.h | 12 +- contrib/unbound/validator/val_utils.c | 82 +- contrib/unbound/validator/val_utils.h | 26 +- contrib/unbound/validator/validator.c | 129 +- lib/libunbound/config.h | 15 +- 116 files changed, 11672 insertions(+), 6800 deletions(-) diff --cc contrib/unbound/smallapp/unbound-control-setup.sh.in index eaf1d082cb76,f74b0105afee..f74b0105afee mode 100755,100644..100755 --- a/contrib/unbound/smallapp/unbound-control-setup.sh.in +++ b/contrib/unbound/smallapp/unbound-control-setup.sh.in diff --cc contrib/unbound/testdata/09-unbound-control.tdir/view_local_data index 000000000000,7958d139be99..7958d139be99 mode 000000,100644..100644 --- a/contrib/unbound/testdata/09-unbound-control.tdir/view_local_data +++ b/contrib/unbound/testdata/09-unbound-control.tdir/view_local_data diff --cc contrib/unbound/testdata/09-unbound-control.tdir/view_local_data_remove index 000000000000,fd5e37f2e4e3..fd5e37f2e4e3 mode 000000,100644..100644 --- a/contrib/unbound/testdata/09-unbound-control.tdir/view_local_data_remove +++ b/contrib/unbound/testdata/09-unbound-control.tdir/view_local_data_remove diff --cc contrib/unbound/testdata/acl_interface.tdir/rpz-nx.zone index 000000000000,a5c828d18eec..a5c828d18eec mode 000000,100644..100644 --- a/contrib/unbound/testdata/acl_interface.tdir/rpz-nx.zone +++ b/contrib/unbound/testdata/acl_interface.tdir/rpz-nx.zone diff --cc contrib/unbound/testdata/acl_interface.tdir/rpz-one.zone index 000000000000,f5dabab659ab..f5dabab659ab mode 000000,100644..100644 --- a/contrib/unbound/testdata/acl_interface.tdir/rpz-one.zone +++ b/contrib/unbound/testdata/acl_interface.tdir/rpz-one.zone diff --cc contrib/unbound/testdata/acl_interface.tdir/rpz-two.zone index 000000000000,9578dde8f928..9578dde8f928 mode 000000,100644..100644 --- a/contrib/unbound/testdata/acl_interface.tdir/rpz-two.zone +++ b/contrib/unbound/testdata/acl_interface.tdir/rpz-two.zone diff --cc contrib/unbound/testdata/cachedb_val_expired.crpl index 000000000000,4a51e8272379..4a51e8272379 mode 000000,100644..100644 --- a/contrib/unbound/testdata/cachedb_val_expired.crpl +++ b/contrib/unbound/testdata/cachedb_val_expired.crpl diff --cc contrib/unbound/testdata/cookie_file.tdir/cookie_file.conf index 000000000000,25dd93f52667..25dd93f52667 mode 000000,100644..100644 --- a/contrib/unbound/testdata/cookie_file.tdir/cookie_file.conf +++ b/contrib/unbound/testdata/cookie_file.tdir/cookie_file.conf diff --cc contrib/unbound/testdata/cookie_file.tdir/cookie_file.dsc index 000000000000,4f321bd2ef96..4f321bd2ef96 mode 000000,100644..100644 --- a/contrib/unbound/testdata/cookie_file.tdir/cookie_file.dsc +++ b/contrib/unbound/testdata/cookie_file.tdir/cookie_file.dsc diff --cc contrib/unbound/testdata/cookie_file.tdir/cookie_file.pre index 000000000000,61da5425a447..61da5425a447 mode 000000,100644..100644 --- a/contrib/unbound/testdata/cookie_file.tdir/cookie_file.pre +++ b/contrib/unbound/testdata/cookie_file.tdir/cookie_file.pre diff --cc contrib/unbound/testdata/cookie_file.tdir/cookie_file.test index 000000000000,7da4fa657bb8..7da4fa657bb8 mode 000000,100644..100644 --- a/contrib/unbound/testdata/cookie_file.tdir/cookie_file.test +++ b/contrib/unbound/testdata/cookie_file.tdir/cookie_file.test diff --cc contrib/unbound/testdata/fwd_name_lookup.rpl index 000000000000,dbcfffba524a..dbcfffba524a mode 000000,100644..100644 --- a/contrib/unbound/testdata/fwd_name_lookup.rpl +++ b/contrib/unbound/testdata/fwd_name_lookup.rpl diff --cc contrib/unbound/testdata/rpz_cname_tag.rpl index 000000000000,fb782b685ac7..fb782b685ac7 mode 000000,100644..100644 --- a/contrib/unbound/testdata/rpz_cname_tag.rpl +++ b/contrib/unbound/testdata/rpz_cname_tag.rpl diff --cc contrib/unbound/testdata/val_dname_twice.rpl index 000000000000,bc84bf91c18d..bc84bf91c18d mode 000000,100644..100644 --- a/contrib/unbound/testdata/val_dname_twice.rpl +++ b/contrib/unbound/testdata/val_dname_twice.rpl diff --cc contrib/unbound/testdata/val_failure_dnskey.rpl index 000000000000,3f25f15b2062..3f25f15b2062 mode 000000,100644..100644 --- a/contrib/unbound/testdata/val_failure_dnskey.rpl +++ b/contrib/unbound/testdata/val_failure_dnskey.rpl diff --cc contrib/unbound/util/config_file.c index f16d1c2ddb84,000000000000..de3c5375b4c0 mode 100644,000000..100644 --- a/contrib/unbound/util/config_file.c +++ b/contrib/unbound/util/config_file.c @@@ -1,2763 -1,0 +1,2797 @@@ +/* + * util/config_file.c - reads and stores the config file for unbound. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER 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. + */ + +/** + * \file + * + * This file contains functions for the config file. + */ + +#include "config.h" +#include +#include ++#include +#ifdef HAVE_TIME_H +#include +#endif +#include "util/log.h" +#include "util/configyyrename.h" +#include "util/config_file.h" +#include "configparser.h" +#include "util/net_help.h" +#include "util/data/msgparse.h" +#include "util/module.h" +#include "util/regional.h" +#include "util/fptr_wlist.h" +#include "util/data/dname.h" +#include "util/random.h" +#include "util/rtt.h" +#include "services/cache/infra.h" +#include "sldns/wire2str.h" +#include "sldns/parseutil.h" +#include "iterator/iterator.h" +#ifdef HAVE_GLOB_H +# include +#endif +#ifdef CLIENT_SUBNET +#include "edns-subnet/edns-subnet.h" +#endif +#ifdef HAVE_PWD_H +#include +#endif + +/** from cfg username, after daemonize setup performed */ +uid_t cfg_uid = (uid_t)-1; +/** from cfg username, after daemonize setup performed */ +gid_t cfg_gid = (gid_t)-1; +/** for debug allow small timeout values for fast rollovers */ +int autr_permit_small_holddown = 0; +/** size (in bytes) of stream wait buffers max */ +size_t stream_wait_max = 4 * 1024 * 1024; +size_t http2_query_buffer_max = 4 * 1024 * 1024; +size_t http2_response_buffer_max = 4 * 1024 * 1024; + +/** global config during parsing */ +struct config_parser_state* cfg_parser = 0; + +/** init ports possible for use */ +static void init_outgoing_availports(int* array, int num); + +/** init cookie with random data */ +static void init_cookie_secret(uint8_t* cookie_secret, size_t cookie_secret_len); + +struct config_file* +config_create(void) +{ + struct config_file* cfg; + cfg = (struct config_file*)calloc(1, sizeof(struct config_file)); + if(!cfg) + return NULL; + /* the defaults if no config is present */ + cfg->verbosity = 1; + cfg->stat_interval = 0; + cfg->stat_cumulative = 0; + cfg->stat_extended = 0; + cfg->stat_inhibit_zero = 1; + cfg->num_threads = 1; + cfg->port = UNBOUND_DNS_PORT; + cfg->do_ip4 = 1; + cfg->do_ip6 = 1; + cfg->do_udp = 1; + cfg->do_tcp = 1; + cfg->tcp_reuse_timeout = 60 * 1000; /* 60s in milisecs */ + cfg->max_reuse_tcp_queries = 200; + cfg->tcp_upstream = 0; + cfg->udp_upstream_without_downstream = 0; + cfg->tcp_mss = 0; + cfg->outgoing_tcp_mss = 0; + cfg->tcp_idle_timeout = 30 * 1000; /* 30s in millisecs */ + cfg->tcp_auth_query_timeout = 3 * 1000; /* 3s in millisecs */ + cfg->do_tcp_keepalive = 0; + cfg->tcp_keepalive_timeout = 120 * 1000; /* 120s in millisecs */ + cfg->sock_queue_timeout = 0; /* do not check timeout */ + cfg->ssl_service_key = NULL; + cfg->ssl_service_pem = NULL; + cfg->ssl_port = UNBOUND_DNS_OVER_TLS_PORT; + cfg->ssl_upstream = 0; + cfg->tls_cert_bundle = NULL; + cfg->tls_win_cert = 0; + cfg->tls_use_sni = 1; + cfg->https_port = UNBOUND_DNS_OVER_HTTPS_PORT; + if(!(cfg->http_endpoint = strdup("/dns-query"))) goto error_exit; + cfg->http_max_streams = 100; + cfg->http_query_buffer_size = 4*1024*1024; + cfg->http_response_buffer_size = 4*1024*1024; + cfg->http_nodelay = 1; + cfg->use_syslog = 1; + cfg->log_identity = NULL; /* changed later with argv[0] */ + cfg->log_time_ascii = 0; + cfg->log_queries = 0; + cfg->log_replies = 0; + cfg->log_tag_queryreply = 0; + cfg->log_local_actions = 0; + cfg->log_servfail = 0; + cfg->log_destaddr = 0; +#ifndef USE_WINSOCK +# ifdef USE_MINI_EVENT + /* select max 1024 sockets */ + cfg->outgoing_num_ports = 960; + cfg->num_queries_per_thread = 512; +# else + /* libevent can use many sockets */ + cfg->outgoing_num_ports = 4096; + cfg->num_queries_per_thread = 1024; +# endif + cfg->outgoing_num_tcp = 10; + cfg->incoming_num_tcp = 10; +#else + cfg->outgoing_num_ports = 48; /* windows is limited in num fds */ + cfg->num_queries_per_thread = 24; + cfg->outgoing_num_tcp = 2; /* leaves 64-52=12 for: 4if,1stop,thread4 */ + cfg->incoming_num_tcp = 2; +#endif + cfg->stream_wait_size = 4 * 1024 * 1024; + cfg->edns_buffer_size = 1232; /* from DNS flagday recommendation */ + cfg->msg_buffer_size = 65552; /* 64 k + a small margin */ + cfg->msg_cache_size = 4 * 1024 * 1024; + cfg->msg_cache_slabs = 4; + cfg->jostle_time = 200; + cfg->rrset_cache_size = 4 * 1024 * 1024; + cfg->rrset_cache_slabs = 4; + cfg->host_ttl = 900; + cfg->bogus_ttl = 60; + cfg->min_ttl = 0; + cfg->max_ttl = 3600 * 24; + cfg->max_negative_ttl = 3600; + cfg->min_negative_ttl = 0; + cfg->prefetch = 0; + cfg->prefetch_key = 0; + cfg->deny_any = 0; + cfg->infra_cache_slabs = 4; + cfg->infra_cache_numhosts = 10000; + cfg->infra_cache_min_rtt = 50; + cfg->infra_cache_max_rtt = 120000; + cfg->infra_keep_probing = 0; + cfg->delay_close = 0; + cfg->udp_connect = 1; + if(!(cfg->outgoing_avail_ports = (int*)calloc(65536, sizeof(int)))) + goto error_exit; + init_outgoing_availports(cfg->outgoing_avail_ports, 65536); + if(!(cfg->username = strdup(UB_USERNAME))) goto error_exit; +#ifdef HAVE_CHROOT + if(!(cfg->chrootdir = strdup(CHROOT_DIR))) goto error_exit; +#endif + if(!(cfg->directory = strdup(RUN_DIR))) goto error_exit; + if(!(cfg->logfile = strdup(""))) goto error_exit; + if(!(cfg->pidfile = strdup(PIDFILE))) goto error_exit; + if(!(cfg->target_fetch_policy = strdup("3 2 1 0 0"))) goto error_exit; + cfg->fast_server_permil = 0; + cfg->fast_server_num = 3; + cfg->donotqueryaddrs = NULL; + cfg->donotquery_localhost = 1; + cfg->root_hints = NULL; + cfg->use_systemd = 0; + cfg->do_daemonize = 1; + cfg->if_automatic = 0; + cfg->if_automatic_ports = NULL; + cfg->so_rcvbuf = 0; + cfg->so_sndbuf = 0; + cfg->so_reuseport = REUSEPORT_DEFAULT; + cfg->ip_transparent = 0; + cfg->ip_freebind = 0; + cfg->ip_dscp = 0; + cfg->num_ifs = 0; + cfg->ifs = NULL; + cfg->num_out_ifs = 0; + cfg->out_ifs = NULL; + cfg->stubs = NULL; + cfg->forwards = NULL; + cfg->auths = NULL; +#ifdef CLIENT_SUBNET + cfg->client_subnet = NULL; + cfg->client_subnet_zone = NULL; + cfg->client_subnet_opcode = LDNS_EDNS_CLIENT_SUBNET; + cfg->client_subnet_always_forward = 0; + cfg->max_client_subnet_ipv4 = 24; + cfg->max_client_subnet_ipv6 = 56; + cfg->min_client_subnet_ipv4 = 0; + cfg->min_client_subnet_ipv6 = 0; + cfg->max_ecs_tree_size_ipv4 = 100; + cfg->max_ecs_tree_size_ipv6 = 100; +#endif + cfg->views = NULL; + cfg->acls = NULL; + cfg->tcp_connection_limits = NULL; + cfg->harden_short_bufsize = 1; + cfg->harden_large_queries = 0; + cfg->harden_glue = 1; + cfg->harden_dnssec_stripped = 1; + cfg->harden_below_nxdomain = 1; + cfg->harden_referral_path = 0; + cfg->harden_algo_downgrade = 0; + cfg->harden_unknown_additional = 0; + cfg->use_caps_bits_for_id = 0; + cfg->caps_whitelist = NULL; + cfg->private_address = NULL; + cfg->private_domain = NULL; + cfg->unwanted_threshold = 0; + cfg->hide_identity = 0; + cfg->hide_version = 0; + cfg->hide_trustanchor = 0; + cfg->hide_http_user_agent = 0; + cfg->identity = NULL; + cfg->version = NULL; + cfg->http_user_agent = NULL; + cfg->nsid_cfg_str = NULL; + cfg->nsid = NULL; + cfg->nsid_len = 0; + cfg->auto_trust_anchor_file_list = NULL; + cfg->trust_anchor_file_list = NULL; + cfg->trust_anchor_list = NULL; + cfg->trusted_keys_file_list = NULL; + cfg->trust_anchor_signaling = 1; + cfg->root_key_sentinel = 1; + cfg->domain_insecure = NULL; + cfg->val_date_override = 0; + cfg->val_sig_skew_min = 3600; /* at least daylight savings trouble */ + cfg->val_sig_skew_max = 86400; /* at most timezone settings trouble */ + cfg->val_max_restart = 5; + cfg->val_clean_additional = 1; + cfg->val_log_level = 0; + cfg->val_log_squelch = 0; + cfg->val_permissive_mode = 0; + cfg->aggressive_nsec = 1; + cfg->ignore_cd = 0; + cfg->disable_edns_do = 0; + cfg->serve_expired = 0; + cfg->serve_expired_ttl = 0; + cfg->serve_expired_ttl_reset = 0; + cfg->serve_expired_reply_ttl = 30; + cfg->serve_expired_client_timeout = 0; + cfg->ede_serve_expired = 0; + cfg->serve_original_ttl = 0; + cfg->zonemd_permissive_mode = 0; + cfg->add_holddown = 30*24*3600; + cfg->del_holddown = 30*24*3600; + cfg->keep_missing = 366*24*3600; /* one year plus a little leeway */ + cfg->permit_small_holddown = 0; + cfg->key_cache_size = 4 * 1024 * 1024; + cfg->key_cache_slabs = 4; + cfg->neg_cache_size = 1 * 1024 * 1024; + cfg->local_zones = NULL; + cfg->local_zones_nodefault = NULL; +#ifdef USE_IPSET + cfg->local_zones_ipset = NULL; +#endif + cfg->local_zones_disable_default = 0; + cfg->local_data = NULL; + cfg->local_zone_overrides = NULL; + cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; + cfg->python_script = NULL; + cfg->dynlib_file = NULL; + cfg->remote_control_enable = 0; + cfg->control_ifs.first = NULL; + cfg->control_ifs.last = NULL; + cfg->control_port = UNBOUND_CONTROL_PORT; + cfg->control_use_cert = 1; + cfg->minimal_responses = 1; + cfg->rrset_roundrobin = 1; + cfg->unknown_server_time_limit = 376; + cfg->discard_timeout = 1900; /* msec */ + cfg->wait_limit = 1000; + cfg->wait_limit_cookie = 10000; + cfg->wait_limit_netblock = NULL; + cfg->wait_limit_cookie_netblock = NULL; + cfg->max_udp_size = 1232; /* value taken from edns_buffer_size */ + if(!(cfg->server_key_file = strdup(RUN_DIR"/unbound_server.key"))) + goto error_exit; + if(!(cfg->server_cert_file = strdup(RUN_DIR"/unbound_server.pem"))) + goto error_exit; + if(!(cfg->control_key_file = strdup(RUN_DIR"/unbound_control.key"))) + goto error_exit; + if(!(cfg->control_cert_file = strdup(RUN_DIR"/unbound_control.pem"))) + goto error_exit; + +#ifdef CLIENT_SUBNET + if(!(cfg->module_conf = strdup("subnetcache validator iterator"))) goto error_exit; +#else + if(!(cfg->module_conf = strdup("validator iterator"))) goto error_exit; +#endif + if(!(cfg->val_nsec3_key_iterations = + strdup("1024 150 2048 150 4096 150"))) goto error_exit; +#if defined(DNSTAP_SOCKET_PATH) + if(!(cfg->dnstap_socket_path = strdup(DNSTAP_SOCKET_PATH))) + goto error_exit; +#endif + cfg->dnstap_bidirectional = 1; + cfg->dnstap_tls = 1; + cfg->disable_dnssec_lame_check = 0; + cfg->ip_ratelimit_cookie = 0; + cfg->ip_ratelimit = 0; + cfg->ratelimit = 0; + cfg->ip_ratelimit_slabs = 4; + cfg->ratelimit_slabs = 4; + cfg->ip_ratelimit_size = 4*1024*1024; + cfg->ratelimit_size = 4*1024*1024; + cfg->ratelimit_for_domain = NULL; + cfg->ratelimit_below_domain = NULL; + cfg->ip_ratelimit_factor = 10; + cfg->ratelimit_factor = 10; + cfg->ip_ratelimit_backoff = 0; + cfg->ratelimit_backoff = 0; + cfg->outbound_msg_retry = 5; + cfg->max_sent_count = 32; + cfg->max_query_restarts = 11; + cfg->qname_minimisation = 1; + cfg->qname_minimisation_strict = 0; + cfg->shm_enable = 0; + cfg->shm_key = 11777; + cfg->edns_client_strings = NULL; + cfg->edns_client_string_opcode = 65001; + cfg->dnscrypt = 0; + cfg->dnscrypt_port = 0; + cfg->dnscrypt_provider = NULL; + cfg->dnscrypt_provider_cert = NULL; + cfg->dnscrypt_provider_cert_rotated = NULL; + cfg->dnscrypt_secret_key = NULL; + cfg->dnscrypt_shared_secret_cache_size = 4*1024*1024; + cfg->dnscrypt_shared_secret_cache_slabs = 4; + cfg->dnscrypt_nonce_cache_size = 4*1024*1024; + cfg->dnscrypt_nonce_cache_slabs = 4; + cfg->pad_responses = 1; + cfg->pad_responses_block_size = 468; /* from RFC8467 */ + cfg->pad_queries = 1; + cfg->pad_queries_block_size = 128; /* from RFC8467 */ +#ifdef USE_IPSECMOD + cfg->ipsecmod_enabled = 1; + cfg->ipsecmod_ignore_bogus = 0; + cfg->ipsecmod_hook = NULL; + cfg->ipsecmod_max_ttl = 3600; + cfg->ipsecmod_whitelist = NULL; + cfg->ipsecmod_strict = 0; +#endif + cfg->do_answer_cookie = 0; + memset(cfg->cookie_secret, 0, sizeof(cfg->cookie_secret)); + cfg->cookie_secret_len = 16; + init_cookie_secret(cfg->cookie_secret, cfg->cookie_secret_len); ++ cfg->cookie_secret_file = NULL; +#ifdef USE_CACHEDB + if(!(cfg->cachedb_backend = strdup("testframe"))) goto error_exit; + if(!(cfg->cachedb_secret = strdup("default"))) goto error_exit; + cfg->cachedb_no_store = 0; + cfg->cachedb_check_when_serve_expired = 1; +#ifdef USE_REDIS + if(!(cfg->redis_server_host = strdup("127.0.0.1"))) goto error_exit; + cfg->redis_server_path = NULL; + cfg->redis_server_password = NULL; + cfg->redis_timeout = 100; + cfg->redis_server_port = 6379; + cfg->redis_expire_records = 0; + cfg->redis_logical_db = 0; +#endif /* USE_REDIS */ +#endif /* USE_CACHEDB */ +#ifdef USE_IPSET + cfg->ipset_name_v4 = NULL; + cfg->ipset_name_v6 = NULL; +#endif + cfg->ede = 0; + return cfg; +error_exit: + config_delete(cfg); + return NULL; +} + +struct config_file* config_create_forlib(void) +{ + struct config_file* cfg = config_create(); + if(!cfg) return NULL; + /* modifications for library use, less verbose, less memory */ + free(cfg->chrootdir); + cfg->chrootdir = NULL; + cfg->verbosity = 0; + cfg->outgoing_num_ports = 16; /* in library use, this is 'reasonable' + and probably within the ulimit(maxfds) of the user */ + cfg->outgoing_num_tcp = 2; + cfg->msg_cache_size = 1024*1024; + cfg->msg_cache_slabs = 1; + cfg->rrset_cache_size = 1024*1024; + cfg->rrset_cache_slabs = 1; + cfg->infra_cache_slabs = 1; + cfg->use_syslog = 0; + cfg->key_cache_size = 1024*1024; + cfg->key_cache_slabs = 1; + cfg->neg_cache_size = 100 * 1024; + cfg->donotquery_localhost = 0; /* allow, so that you can ask a + forward nameserver running on localhost */ + cfg->val_log_level = 2; /* to fill why_bogus with */ + cfg->val_log_squelch = 1; + cfg->minimal_responses = 0; + cfg->harden_short_bufsize = 1; + return cfg; +} + +/** check that the value passed is >= 0 */ +#define IS_NUMBER_OR_ZERO \ + if(atoi(val) == 0 && strcmp(val, "0") != 0) return 0 +/** check that the value passed is > 0 */ +#define IS_NONZERO_NUMBER \ + if(atoi(val) == 0) return 0 +/** check that the value passed is not 0 and a power of 2 */ +#define IS_POW2_NUMBER \ + if(atoi(val) == 0 || !is_pow2((size_t)atoi(val))) return 0 +/** check that the value passed is yes or no */ +#define IS_YES_OR_NO \ + if(strcmp(val, "yes") != 0 && strcmp(val, "no") != 0) return 0 +/** put integer_or_zero into variable */ +#define S_NUMBER_OR_ZERO(str, var) if(strcmp(opt, str) == 0) \ + { IS_NUMBER_OR_ZERO; cfg->var = atoi(val); } +/** put integer_nonzero into variable */ +#define S_NUMBER_NONZERO(str, var) if(strcmp(opt, str) == 0) \ + { IS_NONZERO_NUMBER; cfg->var = atoi(val); } +/** put integer_or_zero into unsigned */ +#define S_UNSIGNED_OR_ZERO(str, var) if(strcmp(opt, str) == 0) \ + { IS_NUMBER_OR_ZERO; cfg->var = (unsigned)atoi(val); } +/** put integer_or_zero into size_t */ +#define S_SIZET_OR_ZERO(str, var) if(strcmp(opt, str) == 0) \ + { IS_NUMBER_OR_ZERO; cfg->var = (size_t)atoi(val); } +/** put integer_nonzero into size_t */ +#define S_SIZET_NONZERO(str, var) if(strcmp(opt, str) == 0) \ + { IS_NONZERO_NUMBER; cfg->var = (size_t)atoi(val); } +/** put yesno into variable */ +#define S_YNO(str, var) if(strcmp(opt, str) == 0) \ + { IS_YES_OR_NO; cfg->var = (strcmp(val, "yes") == 0); } +/** put memsize into variable */ +#define S_MEMSIZE(str, var) if(strcmp(opt, str)==0) \ + { return cfg_parse_memsize(val, &cfg->var); } +/** put pow2 number into variable */ +#define S_POW2(str, var) if(strcmp(opt, str)==0) \ + { IS_POW2_NUMBER; cfg->var = (size_t)atoi(val); } +/** put string into variable */ +#define S_STR(str, var) if(strcmp(opt, str)==0) \ + { free(cfg->var); return (cfg->var = strdup(val)) != NULL; } +/** put string into strlist */ +#define S_STRLIST(str, var) if(strcmp(opt, str)==0) \ + { return cfg_strlist_insert(&cfg->var, strdup(val)); } +/** put string into strlist if not present yet*/ +#define S_STRLIST_UNIQ(str, var) if(strcmp(opt, str)==0) \ + { if(cfg_strlist_find(cfg->var, val)) { return 0;} \ + return cfg_strlist_insert(&cfg->var, strdup(val)); } +/** append string to strlist */ +#define S_STRLIST_APPEND(str, var) if(strcmp(opt, str)==0) \ + { return cfg_strlist_append(&cfg->var, strdup(val)); } + +int config_set_option(struct config_file* cfg, const char* opt, + const char* val) +{ + char buf[64]; + if(!opt) return 0; + if(opt[strlen(opt)-1] != ':' && strlen(opt)+2stat_interval = 0; + else if(atoi(val) == 0) + return 0; + else cfg->stat_interval = atoi(val); + } else if(strcmp(opt, "num-threads:") == 0) { + /* not supported, library must have 1 thread in bgworker */ + return 0; + } else if(strcmp(opt, "outgoing-port-permit:") == 0) { + return cfg_mark_ports(val, 1, + cfg->outgoing_avail_ports, 65536); + } else if(strcmp(opt, "outgoing-port-avoid:") == 0) { + return cfg_mark_ports(val, 0, + cfg->outgoing_avail_ports, 65536); + } else if(strcmp(opt, "local-zone:") == 0) { + return cfg_parse_local_zone(cfg, val); + } else if(strcmp(opt, "val-override-date:") == 0) { + if(strcmp(val, "") == 0 || strcmp(val, "0") == 0) { + cfg->val_date_override = 0; + } else if(strlen(val) == 14) { + cfg->val_date_override = cfg_convert_timeval(val); + return cfg->val_date_override != 0; + } else { + if(atoi(val) == 0) return 0; + cfg->val_date_override = (uint32_t)atoi(val); + } + } else if(strcmp(opt, "local-data-ptr:") == 0) { + char* ptr = cfg_ptr_reverse((char*)opt); + return cfg_strlist_insert(&cfg->local_data, ptr); + } else if(strcmp(opt, "logfile:") == 0) { + cfg->use_syslog = 0; + free(cfg->logfile); + return (cfg->logfile = strdup(val)) != NULL; + } + else if(strcmp(opt, "log-time-ascii:") == 0) + { IS_YES_OR_NO; cfg->log_time_ascii = (strcmp(val, "yes") == 0); + log_set_time_asc(cfg->log_time_ascii); } + else S_SIZET_NONZERO("max-udp-size:", max_udp_size) + else S_YNO("use-syslog:", use_syslog) + else S_STR("log-identity:", log_identity) + else S_YNO("extended-statistics:", stat_extended) + else S_YNO("statistics-inhibit-zero:", stat_inhibit_zero) + else S_YNO("statistics-cumulative:", stat_cumulative) + else S_YNO("shm-enable:", shm_enable) + else S_NUMBER_OR_ZERO("shm-key:", shm_key) + else S_YNO("do-ip4:", do_ip4) + else S_YNO("do-ip6:", do_ip6) + else S_YNO("do-udp:", do_udp) + else S_YNO("do-tcp:", do_tcp) + else S_YNO("prefer-ip4:", prefer_ip4) + else S_YNO("prefer-ip6:", prefer_ip6) + else S_YNO("tcp-upstream:", tcp_upstream) + else S_YNO("udp-upstream-without-downstream:", + udp_upstream_without_downstream) + else S_NUMBER_NONZERO("tcp-mss:", tcp_mss) + else S_NUMBER_NONZERO("outgoing-tcp-mss:", outgoing_tcp_mss) + else S_NUMBER_NONZERO("tcp-auth-query-timeout:", tcp_auth_query_timeout) + else S_NUMBER_NONZERO("tcp-idle-timeout:", tcp_idle_timeout) + else S_NUMBER_NONZERO("max-reuse-tcp-queries:", max_reuse_tcp_queries) + else S_NUMBER_NONZERO("tcp-reuse-timeout:", tcp_reuse_timeout) + else S_YNO("edns-tcp-keepalive:", do_tcp_keepalive) + else S_NUMBER_NONZERO("edns-tcp-keepalive-timeout:", tcp_keepalive_timeout) + else S_NUMBER_OR_ZERO("sock-queue-timeout:", sock_queue_timeout) + else S_YNO("ssl-upstream:", ssl_upstream) + else S_YNO("tls-upstream:", ssl_upstream) + else S_STR("ssl-service-key:", ssl_service_key) + else S_STR("tls-service-key:", ssl_service_key) + else S_STR("ssl-service-pem:", ssl_service_pem) + else S_STR("tls-service-pem:", ssl_service_pem) + else S_NUMBER_NONZERO("ssl-port:", ssl_port) + else S_NUMBER_NONZERO("tls-port:", ssl_port) + else S_STR("ssl-cert-bundle:", tls_cert_bundle) + else S_STR("tls-cert-bundle:", tls_cert_bundle) + else S_YNO("tls-win-cert:", tls_win_cert) + else S_YNO("tls-system-cert:", tls_win_cert) + else S_STRLIST("additional-ssl-port:", tls_additional_port) + else S_STRLIST("additional-tls-port:", tls_additional_port) + else S_STRLIST("tls-additional-ports:", tls_additional_port) + else S_STRLIST("tls-additional-port:", tls_additional_port) + else S_STRLIST_APPEND("tls-session-ticket-keys:", tls_session_ticket_keys) + else S_STR("tls-ciphers:", tls_ciphers) + else S_STR("tls-ciphersuites:", tls_ciphersuites) + else S_YNO("tls-use-sni:", tls_use_sni) + else S_NUMBER_NONZERO("https-port:", https_port) + else S_STR("http-endpoint:", http_endpoint) + else S_NUMBER_NONZERO("http-max-streams:", http_max_streams) + else S_MEMSIZE("http-query-buffer-size:", http_query_buffer_size) + else S_MEMSIZE("http-response-buffer-size:", http_response_buffer_size) + else S_YNO("http-nodelay:", http_nodelay) + else S_YNO("http-notls-downstream:", http_notls_downstream) + else S_YNO("interface-automatic:", if_automatic) + else S_STR("interface-automatic-ports:", if_automatic_ports) + else S_YNO("use-systemd:", use_systemd) + else S_YNO("do-daemonize:", do_daemonize) + else S_NUMBER_NONZERO("port:", port) + else S_NUMBER_NONZERO("outgoing-range:", outgoing_num_ports) + else S_SIZET_OR_ZERO("outgoing-num-tcp:", outgoing_num_tcp) + else S_SIZET_OR_ZERO("incoming-num-tcp:", incoming_num_tcp) + else S_MEMSIZE("stream-wait-size:", stream_wait_size) + else S_SIZET_NONZERO("edns-buffer-size:", edns_buffer_size) + else S_SIZET_NONZERO("msg-buffer-size:", msg_buffer_size) + else S_MEMSIZE("msg-cache-size:", msg_cache_size) + else S_POW2("msg-cache-slabs:", msg_cache_slabs) + else S_SIZET_NONZERO("num-queries-per-thread:",num_queries_per_thread) + else S_SIZET_OR_ZERO("jostle-timeout:", jostle_time) + else S_MEMSIZE("so-rcvbuf:", so_rcvbuf) + else S_MEMSIZE("so-sndbuf:", so_sndbuf) + else S_YNO("so-reuseport:", so_reuseport) + else S_YNO("ip-transparent:", ip_transparent) + else S_YNO("ip-freebind:", ip_freebind) + else S_NUMBER_OR_ZERO("ip-dscp:", ip_dscp) + else S_MEMSIZE("rrset-cache-size:", rrset_cache_size) + else S_POW2("rrset-cache-slabs:", rrset_cache_slabs) + else S_YNO("prefetch:", prefetch) + else S_YNO("prefetch-key:", prefetch_key) + else S_YNO("deny-any:", deny_any) + else if(strcmp(opt, "cache-max-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->max_ttl = atoi(val); MAX_TTL=(time_t)cfg->max_ttl;} + else if(strcmp(opt, "cache-max-negative-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->max_negative_ttl = atoi(val); MAX_NEG_TTL=(time_t)cfg->max_negative_ttl;} + else if(strcmp(opt, "cache-min-negative-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->min_negative_ttl = atoi(val); MIN_NEG_TTL=(time_t)cfg->min_negative_ttl;} + else if(strcmp(opt, "cache-min-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->min_ttl = atoi(val); MIN_TTL=(time_t)cfg->min_ttl;} + else if(strcmp(opt, "infra-cache-min-rtt:") == 0) { + IS_NUMBER_OR_ZERO; cfg->infra_cache_min_rtt = atoi(val); + RTT_MIN_TIMEOUT=cfg->infra_cache_min_rtt; + } + else if(strcmp(opt, "infra-cache-max-rtt:") == 0) { + IS_NUMBER_OR_ZERO; cfg->infra_cache_max_rtt = atoi(val); + RTT_MAX_TIMEOUT=cfg->infra_cache_max_rtt; + USEFUL_SERVER_TOP_TIMEOUT = RTT_MAX_TIMEOUT; + BLACKLIST_PENALTY = USEFUL_SERVER_TOP_TIMEOUT*4; + } + else S_YNO("infra-keep-probing:", infra_keep_probing) + else S_NUMBER_OR_ZERO("infra-host-ttl:", host_ttl) + else S_POW2("infra-cache-slabs:", infra_cache_slabs) + else S_SIZET_NONZERO("infra-cache-numhosts:", infra_cache_numhosts) + else S_NUMBER_OR_ZERO("delay-close:", delay_close) + else S_YNO("udp-connect:", udp_connect) + else S_STR("chroot:", chrootdir) + else S_STR("username:", username) + else S_STR("directory:", directory) + else S_STR("pidfile:", pidfile) + else S_YNO("hide-identity:", hide_identity) + else S_YNO("hide-version:", hide_version) + else S_YNO("hide-trustanchor:", hide_trustanchor) + else S_YNO("hide-http-user-agent:", hide_http_user_agent) + else S_STR("identity:", identity) + else S_STR("version:", version) + else S_STR("http-user-agent:", http_user_agent) + else if(strcmp(opt, "nsid:") == 0) { + free(cfg->nsid_cfg_str); + if (!(cfg->nsid_cfg_str = strdup(val))) + return 0; + /* Empty string is just validly unsetting nsid */ + if (*val == 0) { + free(cfg->nsid); + cfg->nsid = NULL; + cfg->nsid_len = 0; + return 1; + } + cfg->nsid = cfg_parse_nsid(val, &cfg->nsid_len); + return cfg->nsid != NULL; + } + else S_STRLIST("root-hints:", root_hints) + else S_STR("target-fetch-policy:", target_fetch_policy) + else S_YNO("harden-glue:", harden_glue) + else S_YNO("harden-short-bufsize:", harden_short_bufsize) + else S_YNO("harden-large-queries:", harden_large_queries) + else S_YNO("harden-dnssec-stripped:", harden_dnssec_stripped) + else S_YNO("harden-below-nxdomain:", harden_below_nxdomain) + else S_YNO("harden-referral-path:", harden_referral_path) + else S_YNO("harden-algo-downgrade:", harden_algo_downgrade) + else S_YNO("harden-unknown-additional:", harden_unknown_additional) + else S_YNO("use-caps-for-id:", use_caps_bits_for_id) + else S_STRLIST("caps-whitelist:", caps_whitelist) + else S_SIZET_OR_ZERO("unwanted-reply-threshold:", unwanted_threshold) + else S_STRLIST("private-address:", private_address) + else S_STRLIST("private-domain:", private_domain) + else S_YNO("do-not-query-localhost:", donotquery_localhost) + else S_STRLIST("do-not-query-address:", donotqueryaddrs) + else S_STRLIST("auto-trust-anchor-file:", auto_trust_anchor_file_list) + else S_STRLIST("trust-anchor-file:", trust_anchor_file_list) + else S_STRLIST("trust-anchor:", trust_anchor_list) + else S_STRLIST("trusted-keys-file:", trusted_keys_file_list) + else S_YNO("trust-anchor-signaling:", trust_anchor_signaling) + else S_YNO("root-key-sentinel:", root_key_sentinel) + else S_STRLIST("domain-insecure:", domain_insecure) + else S_NUMBER_OR_ZERO("val-bogus-ttl:", bogus_ttl) + else S_YNO("val-clean-additional:", val_clean_additional) + else S_NUMBER_OR_ZERO("val-log-level:", val_log_level) + else S_YNO("val-log-squelch:", val_log_squelch) + else S_YNO("log-queries:", log_queries) + else S_YNO("log-replies:", log_replies) + else S_YNO("log-tag-queryreply:", log_tag_queryreply) + else S_YNO("log-local-actions:", log_local_actions) + else S_YNO("log-servfail:", log_servfail) + else S_YNO("log-destaddr:", log_destaddr) + else S_YNO("val-permissive-mode:", val_permissive_mode) + else S_YNO("aggressive-nsec:", aggressive_nsec) + else S_YNO("ignore-cd-flag:", ignore_cd) + else S_YNO("disable-edns-do:", disable_edns_do) + else if(strcmp(opt, "serve-expired:") == 0) + { IS_YES_OR_NO; cfg->serve_expired = (strcmp(val, "yes") == 0); + SERVE_EXPIRED = cfg->serve_expired; } + else if(strcmp(opt, "serve-expired-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->serve_expired_ttl = atoi(val); SERVE_EXPIRED_TTL=(time_t)cfg->serve_expired_ttl;} + else S_YNO("serve-expired-ttl-reset:", serve_expired_ttl_reset) + else if(strcmp(opt, "serve-expired-reply-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->serve_expired_reply_ttl = atoi(val); SERVE_EXPIRED_REPLY_TTL=(time_t)cfg->serve_expired_reply_ttl;} + else S_NUMBER_OR_ZERO("serve-expired-client-timeout:", serve_expired_client_timeout) + else S_YNO("ede:", ede) + else S_YNO("ede-serve-expired:", ede_serve_expired) + else S_YNO("serve-original-ttl:", serve_original_ttl) + else S_STR("val-nsec3-keysize-iterations:", val_nsec3_key_iterations) + else S_YNO("zonemd-permissive-mode:", zonemd_permissive_mode) + else S_UNSIGNED_OR_ZERO("add-holddown:", add_holddown) + else S_UNSIGNED_OR_ZERO("del-holddown:", del_holddown) + else S_UNSIGNED_OR_ZERO("keep-missing:", keep_missing) + else if(strcmp(opt, "permit-small-holddown:") == 0) + { IS_YES_OR_NO; cfg->permit_small_holddown = (strcmp(val, "yes") == 0); + autr_permit_small_holddown = cfg->permit_small_holddown; } + else S_MEMSIZE("key-cache-size:", key_cache_size) + else S_POW2("key-cache-slabs:", key_cache_slabs) + else S_MEMSIZE("neg-cache-size:", neg_cache_size) + else S_YNO("minimal-responses:", minimal_responses) + else S_YNO("rrset-roundrobin:", rrset_roundrobin) + else S_NUMBER_OR_ZERO("unknown-server-time-limit:", unknown_server_time_limit) + else S_NUMBER_OR_ZERO("discard-timeout:", discard_timeout) + else S_NUMBER_OR_ZERO("wait-limit:", wait_limit) + else S_NUMBER_OR_ZERO("wait-limit-cookie:", wait_limit_cookie) + else S_STRLIST("local-data:", local_data) + else S_YNO("unblock-lan-zones:", unblock_lan_zones) + else S_YNO("insecure-lan-zones:", insecure_lan_zones) + else S_YNO("control-enable:", remote_control_enable) + else S_STRLIST_APPEND("control-interface:", control_ifs) + else S_NUMBER_NONZERO("control-port:", control_port) + else S_STR("server-key-file:", server_key_file) + else S_STR("server-cert-file:", server_cert_file) + else S_STR("control-key-file:", control_key_file) + else S_STR("control-cert-file:", control_cert_file) + else S_STR("module-config:", module_conf) + else S_STRLIST("python-script:", python_script) + else S_STRLIST("dynlib-file:", dynlib_file) + else S_YNO("disable-dnssec-lame-check:", disable_dnssec_lame_check) +#ifdef CLIENT_SUBNET + /* Can't set max subnet prefix here, since that value is used when + * generating the address tree. */ + /* No client-subnet-always-forward here, module registration depends on + * this option. */ +#endif +#ifdef USE_DNSTAP + else S_YNO("dnstap-enable:", dnstap) + else S_YNO("dnstap-bidirectional:", dnstap_bidirectional) + else S_STR("dnstap-socket-path:", dnstap_socket_path) + else S_STR("dnstap-ip:", dnstap_ip) + else S_YNO("dnstap-tls:", dnstap_tls) + else S_STR("dnstap-tls-server-name:", dnstap_tls_server_name) + else S_STR("dnstap-tls-cert-bundle:", dnstap_tls_cert_bundle) + else S_STR("dnstap-tls-client-key-file:", dnstap_tls_client_key_file) + else S_STR("dnstap-tls-client-cert-file:", *** 3999 LINES SKIPPED *** From nobody Fri Aug 16 20:16:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WltYk0fWFz5TVS4; Fri, 16 Aug 2024 20:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WltYj5265z46KW; Fri, 16 Aug 2024 20:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723839401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oFH3qfbn/M5LFWbFWjty5ZsMrrEWZe71OkAjAkE9sfk=; b=AlPHlcSNhJpnq/cniLSUBuHWIZxeLy8t9K6MslpDo/dp9Ui1WyJ7lyDr97XSAnHAfqq+Fw 4UDJATuKqW2WFnn2P2I0Qp0es275X5m8KR1PiHWB6rQWxlwMSgk7UoF0Jg8Za9jNnnri8f TBvWIAQCgQiq6Yy2JdHvsV3nCYXAZsWZvoKgA3EBOJqYZKNsxLzKNPX3xZut52HQZO80sA nUZVfxuA85DPAw9RxcRblp2uH0EREQDcgSuyta7b3AB++z7zEO4Q8jhXmFLl2GdRwx5jyo W6RoI/yldzoVyGURmZANBZlaXDLFoM5qTuitEsmK7jh0DMNsMDIxN3rLNZjcHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723839401; a=rsa-sha256; cv=none; b=xfccFqua9lmg5hRR7f5Q5g9N2HYum53CiR9K8za+1zK7042WGMKIRwolFxQniz6uuVFqg9 fmuBfcrY2v4HmCCXrUgVTOeCRN9KvU+oOIalz4I5y0GoHNyMZKF9gndogknlzyAffDml6T Vkj4mlz3zNGMG2svIQBRIJDmA8CZFw9vC4gAP+Sg5bsLcrRd6nFxaGoG6KzECesG3ZW01d ZUsgMYejD+95uaY6CC/UyQJYf9JOz5cg/+qU7Y5IgaDDL8zGVRFUzQWHAHszXqtwtBtZOh U/YBlgJfk4Jci22eEuFpLeYi+d5+Vf/EnO3KrLhopxDHQxqdwsrPlXa7mDCKgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723839401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oFH3qfbn/M5LFWbFWjty5ZsMrrEWZe71OkAjAkE9sfk=; b=EGXTcsnmLEHX5AmymO9Jos+NEiGohFYBvdKq4NE4k996NHLP+nqSdgC36lOF8AxbDwVlf6 9cilBPKAxmfUpyn+8MwsOtsAAOLY+1WCwmw6jacI3WofMKUE1YgAaqrU5D43/a5WKVmxZO gboiviQnbrKYtz6owqs3NJMWJWCTwb4fgimMGBD7wLuoUOYru3b3SaV7OjadqshUwZCtR8 u7wIOHuaWif7XrCnNCqJGby4dPu52fgkkx/kOVeZKyOvCY2Eo8mAiNroJEqrmlJBPfay8d 1/29r4t6ho4bhTKyVGlYMt79MKuu+XyjiIJ0hQyfq6ri1ZErjafL6jtUnPISYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WltYj4VnqzLJT; Fri, 16 Aug 2024 20:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47GKGfkc054933; Fri, 16 Aug 2024 20:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47GKGfpY054930; Fri, 16 Aug 2024 20:16:41 GMT (envelope-from git) Date: Fri, 16 Aug 2024 20:16:41 GMT Message-Id: <202408162016.47GKGfpY054930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 35399f68c8e8 - main - safe_dot check file is a file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35399f68c8e8a9b3bb4905057ca59766751766f3 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=35399f68c8e8a9b3bb4905057ca59766751766f3 commit 35399f68c8e8a9b3bb4905057ca59766751766f3 Author: Simon J. Gerraty AuthorDate: 2024-08-16 20:15:20 +0000 Commit: Simon J. Gerraty CommitDate: 2024-08-16 20:15:20 +0000 safe_dot check file is a file Since we are being paranoid, check that each arg to safe_dot is actually a file as well as non-empty. Check for white-space in filenames - these require special handling. --- libexec/rc/safe_eval.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libexec/rc/safe_eval.sh b/libexec/rc/safe_eval.sh index 0e1410b771cb..d03eacbdff72 100644 --- a/libexec/rc/safe_eval.sh +++ b/libexec/rc/safe_eval.sh @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-2-Clause # RCSid: -# $Id: safe_eval.sh,v 1.16 2024/08/15 02:28:30 sjg Exp $ +# $Id: safe_eval.sh,v 1.20 2024/08/16 00:57:58 sjg Exp $ # # @(#) Copyright (c) 2023-2024 Simon J. Gerraty # @@ -54,9 +54,10 @@ safe_eval_export() { # feed all "file" that exist to safe_eval # safe_dot() { - eval ${local:-:} ef ex f + eval ${local:-:} ef ex f rc ef= ex= + rc=1 while : do case "$1" in @@ -66,11 +67,20 @@ safe_dot() { done for f in "$@" do - test -s $f || continue + test -s "$f" -a -f "$f" || continue + : check for space or tab in "$f" + case "$f" in + *[[:space:]]*|*" "*|*" "*) # we cannot do this efficiently + dotted="$dotted $f" + safe_eval$ex "$f" + rc=$? + continue + ;; + esac ef="${ef:+$ef }$f" dotted="$dotted $f" done - test -z "$ef" && return 1 + test -z "$ef" && return $rc safe_eval$ex $ef return 0 } From nobody Sat Aug 17 00:41:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wm0Rn1lsjz5TrRp; Sat, 17 Aug 2024 00:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wm0Rn1JWRz4Yv2; Sat, 17 Aug 2024 00:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723855317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxrPj+oRNqlVbTSEVVfg18w8WPNYog+ebYjjvNiKqng=; b=hBAV0grombJ4KCviG3N8lUYyXyUCNF7+Rrw7OS0n87HCO/swfciniwmIioF7llvsz0/2Rj hL4DSR5isBGqagbLxmiGhMdlGNVlCIokSE2KpPeeci7xoCduwhQ6RjuAtJ9ZaCKSdhBKgh x+d0EnpM6T6En56l221Vnv3zhA21HtyS5RBq9Q5bHnlew6QRKksQT4cu2fxv9+vOhIcR7I jdMibWfccVOnJVn7fd4iEr6hSblXQ/HWN33l150+nLJPjqq3M8Y2pXiTrqpVOEsy/iG5KK P4ahboCeIj79Y7JvRkWiXej1kHZMfPSdzvE9M1gcbOL9u7vRQROBrXGwhID9DA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723855317; a=rsa-sha256; cv=none; b=sX++hFInLRECuzaJycHcNTrbRAPul0TFAOoeOpdfXQdgzm2z3LnkuklEnlbDd9nM3YOn9H EV2fn5plbo2eEMIbA1tKU1eq7lCpyy36l+Mh0313u3hTOMrvNMTfUpvr4pMFP16pV3e+zx rgAXdBfkBCxV3mIshAoigkiJTSAMVsgC8iyRoHpWg6z2tW8BiK5q089hzI9bN4B/hk8iO3 oBztfR7w0Y6a7LdiAqTKVpqDcNWBn1nJmlGPsaDNDmg1R6A8u1gewGIuzeHtBemnGdUPkS Efh5nhvr9YIODo1NZa9iMwGJGdVRJOWOM18iQQ6mymxpvkEz1/BUgk5YOXEEhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723855317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxrPj+oRNqlVbTSEVVfg18w8WPNYog+ebYjjvNiKqng=; b=KvRCiRqXmVmEgq09O1Z5QXElnhtAAzujp57vxHLiWIJnHxVnP6lBAIlrjbXQPXfXpYrFXG VVERedzKLDVxyzdlxM3tlVaDLft5HLq2Vt2znfCaz4TTVr0c1vHLM49joEvgR10rb2slfo qep7X1z4Pk1cVxQZqVvOjxwiUyfn7ot71P4CRWgQZIFzpyd8VSOSN7MHeo0Q9i8Bq2CCje BYKeUhfuqNc7/giAO/VTH9gph+mf0uaWEJDtNa6Wy4wmMK9LJkgspAe/GKV+F5qTrJBg2H +Ec3NDJKAK3nWGnq4nUae9Q2pP+jvFzKeLWLtV+BZ5fdfuyZiMqAQljIu4f6kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wm0Rn0s6RzSlm; Sat, 17 Aug 2024 00:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47H0fvc1006937; Sat, 17 Aug 2024 00:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47H0fvv0006934; Sat, 17 Aug 2024 00:41:57 GMT (envelope-from git) Date: Sat, 17 Aug 2024 00:41:57 GMT Message-Id: <202408170041.47H0fvv0006934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 10d5b43424da - main - nfsproto.h: Define the new mode_umask attribute List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10d5b43424da7fadfbdcc41bbffe40d130af1e1d Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=10d5b43424da7fadfbdcc41bbffe40d130af1e1d commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d Author: Rick Macklem AuthorDate: 2024-08-17 00:40:52 +0000 Commit: Rick Macklem CommitDate: 2024-08-17 00:40:52 +0000 nfsproto.h: Define the new mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds the attribute number to nfsproto.h. Future patches will add optional support for the attribute. This patch does not cause any semantics change. MFC after: 2 weeks --- sys/fs/nfs/nfsproto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index ca9c732b6a43..0268940fd8a6 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1004,7 +1004,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_SPACEFREED 78 #define NFSATTRBIT_CHANGEATTRTYPE 79 #define NFSATTRBIT_SECLABEL 80 -/* Not sure what attribute bit #81 is? */ +#define NFSATTRBIT_MODEUMASK 81 #define NFSATTRBIT_XATTRSUPPORT 82 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 @@ -1088,7 +1088,7 @@ struct nfsv3_sattr { #define NFSATTRBM_SPACEFREED 0x00004000 #define NFSATTRBM_CHANGEATTRTYPE 0x00008000 #define NFSATTRBM_SECLABEL 0x00010000 -/* Not sure what attribute bit#81/0x00020000 is? */ +#define NFSATTRBM_MODEUMASK 0x00020000 #define NFSATTRBM_XATTRSUPPORT 0x00040000 #define NFSATTRBIT_MAX 83 From nobody Sat Aug 17 06:38:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wm8M93hb8z5SPPs; Sat, 17 Aug 2024 06:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wm8M932lvz45L1; Sat, 17 Aug 2024 06:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723876709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HytcDEQSqeo9IDqk2bOEDAWAKOspCq6HRNTxbevENhA=; b=doCL2WktkPTWUqkO8gUMkKp/RH4RpgQO7rkgchoVon7git2weTMfJM0zPHYGJUuy0b0nzo 3xkuVjem0LW5+v0A0xdmciujYrP6CxWbTcn0eYTg3jc1NoRLXEYpVORykpyJv002ZNFDBa 3zvKuh2PEvHJLcBh5zK7sfnsULEQbUrU/3pqr3nWMlg1mRdoLUBncvub3fBBc73Rw28xWb 1GBEuvWytkCpzrpVpsz96Dm1KONlNajzeL8epBR6EtSrMzSQ3ywNlvMqmQlC173jlyTJyf mnSRodYG678dKOsC/1LGdnhy5r/LmYV1pvPVxFl1FrgwLGwFABMs1OTdKe1fOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723876709; a=rsa-sha256; cv=none; b=ri4budb8xrgL2bwT3OjhKV4oMs2QcOKZLweciROwQ92rSgwfQetp6Y0R71jQTrNQl+UaXm VTaPc+onRd/N3FHV5pJ5d4h/6fWq/w0Ipb9eT//qcHuR5FZoe1Y4ceND0A+pq9NMxWuEJt HY9/ieHTiwvESCZXuVsEmDzTt8UPWKb9hwmTaknUy7V4vPX8NZbNSRdEA1A3o03QK/ZoK+ s99RgR8QkcT6kAdvi0IL7T77LZhhIMwk2ElIQoF3VJYdmO5wWip1jwX3PP12YY5jhNxMqj I1Q4sPia1cXSjBOym64RQc+y2Xg12wTHWJkCl2xmBCqsdURBFI+D3QAgMHHhhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723876709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HytcDEQSqeo9IDqk2bOEDAWAKOspCq6HRNTxbevENhA=; b=ullnurgaPZPRjd7TS5XMTXDNtQ3vM9Kcr8c8EG4RCFx41NXGrzYeneSfXh7snVQpIKNQm6 DDkb3WDHL3yg94OFJ0GFY86/UMcBfcy7FNq5LMc8BkOgx5lFX7LWbT01aiK4sj2PraCLyT kWQgouvGHF54jTZdcgIXBc6FAw8AROX0p9Ks/xFes+Fi5wib2r+A14pnb9KiQd/osbVGvI X1aA9iyXEeathk9Xe2L6C3ZTsAZHs/cSRVXWPvbtsIQdVZALl3USEwlS6N0dpxs/Dqi4Td v3YkzDvxYJuH2ENqSTbIFNEMHY/4Y/2T7NcxNGxL5FNAVsUH7m+Kngqqy6Gc3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wm8M92PbKzfPL; Sat, 17 Aug 2024 06:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47H6cTC5006979; Sat, 17 Aug 2024 06:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47H6cT60006976; Sat, 17 Aug 2024 06:38:29 GMT (envelope-from git) Date: Sat, 17 Aug 2024 06:38:29 GMT Message-Id: <202408170638.47H6cT60006976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf Author: Peter Holm AuthorDate: 2024-08-17 06:37:34 +0000 Commit: Peter Holm CommitDate: 2024-08-17 06:37:34 +0000 stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped --- tools/test/stress2/misc/buildkernel.sh | 1 + tools/test/stress2/misc/buildworld.sh | 1 + tools/test/stress2/misc/buildworld2.sh | 1 + tools/test/stress2/misc/buildworld3.sh | 1 + tools/test/stress2/misc/buildworld4.sh | 1 + tools/test/stress2/misc/crossmp3.sh | 1 + tools/test/stress2/misc/crossmp4.sh | 1 + tools/test/stress2/misc/crossmp5.sh | 1 + tools/test/stress2/misc/crossmp8.sh | 1 + tools/test/stress2/misc/gnop4.sh | 3 +++ tools/test/stress2/misc/tmpfs13.sh | 1 + tools/test/stress2/misc/zzbuildworld.sh | 1 + 12 files changed, 14 insertions(+) diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh index 849a09b81439..e0aa85617f9b 100755 --- a/tools/test/stress2/misc/buildkernel.sh +++ b/tools/test/stress2/misc/buildkernel.sh @@ -49,6 +49,7 @@ chmod 0777 $TMPDIR log=$mntpoint/log p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap p=`jot -r 1 1 $p` echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" \ "TARGET=amd64 TARGET_ARCH=amd64" diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh index 595b387c90ae..3b362ec7041a 100755 --- a/tools/test/stress2/misc/buildworld.sh +++ b/tools/test/stress2/misc/buildworld.sh @@ -55,6 +55,7 @@ mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh index 9c1eed97b7ea..3653cb1db5b4 100755 --- a/tools/test/stress2/misc/buildworld2.sh +++ b/tools/test/stress2/misc/buildworld2.sh @@ -46,6 +46,7 @@ mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \ > /dev/null & sleep $((20 * 60)) diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh index 0c660cae8eae..e3bce2764c0c 100755 --- a/tools/test/stress2/misc/buildworld3.sh +++ b/tools/test/stress2/misc/buildworld3.sh @@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap su $testuser -c \ "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null" & diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh index 6c15a72a9dcb..d1d162120952 100755 --- a/tools/test/stress2/misc/buildworld4.sh +++ b/tools/test/stress2/misc/buildworld4.sh @@ -50,6 +50,7 @@ mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 16 ] && p=16 # Arbitrary cap [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4)) p=`jot -r 1 1 $p` echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 "\ diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh index 5eecb936e900..32c625a1e4ad 100755 --- a/tools/test/stress2/misc/crossmp3.sh +++ b/tools/test/stress2/misc/crossmp3.sh @@ -41,6 +41,7 @@ CONT=/tmp/crossmp3.continue if [ $# -eq 0 ]; then N=`sysctl -n hw.ncpu` + [ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2)) size=$((usermem / 1024 / 1024 / N)) diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh index e22f969b72bb..21d22bee69e5 100755 --- a/tools/test/stress2/misc/crossmp4.sh +++ b/tools/test/stress2/misc/crossmp4.sh @@ -40,6 +40,7 @@ . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 - 2)) diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh index 038dea7ebe4f..6e504d9f20ad 100755 --- a/tools/test/stress2/misc/crossmp5.sh +++ b/tools/test/stress2/misc/crossmp5.sh @@ -33,6 +33,7 @@ . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / N)) diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh index e877dfaf6d1c..eec5ba9bc7c1 100755 --- a/tools/test/stress2/misc/crossmp8.sh +++ b/tools/test/stress2/misc/crossmp8.sh @@ -41,6 +41,7 @@ CONT=/tmp/crossmp8.continue N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / N)) diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh index f938dd3b790b..1b4da74266f6 100755 --- a/tools/test/stress2/misc/gnop4.sh +++ b/tools/test/stress2/misc/gnop4.sh @@ -34,6 +34,8 @@ # https://people.freebsd.org/~pho/stress/log/kostik1017.txt # Fixed by r322175 +# Seen with p=513: Threads stuck in "ffsrca" + . ../default.cfg gigs=9 @@ -62,6 +64,7 @@ cd $mntpoint/src export MAKEOBJDIRPREFIX=$mntpoint/obj p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Temporary work around timeout 10m \ make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh index 29b44cbc9ad4..231c42033f9d 100755 --- a/tools/test/stress2/misc/tmpfs13.sh +++ b/tools/test/stress2/misc/tmpfs13.sh @@ -40,6 +40,7 @@ . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / 2)) diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh index 2104eb156c86..e1bf867d8d5f 100755 --- a/tools/test/stress2/misc/zzbuildworld.sh +++ b/tools/test/stress2/misc/zzbuildworld.sh @@ -44,6 +44,7 @@ top=$mntpoint export MAKEOBJDIRPREFIX=$top/obj export log=$top/buildworld.`date +%Y%m%dT%H%M` n=$((`sysctl -n hw.ncpu` + 1)) +[ $n -gt 32 ] && n=32 # Arbitrary cap cd $src make -j$n buildworld > $log 2>&1 && s=0 ||s=1 grep '\*\*\*' $log && s=2 From nobody Sat Aug 17 08:38:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WmC2374WPz5SbJJ; Sat, 17 Aug 2024 08:38:51 +0000 (UTC) (envelope-from SRS0=TCzz=PQ=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WmC234MTdz4HGq; Sat, 17 Aug 2024 08:38:51 +0000 (UTC) (envelope-from SRS0=TCzz=PQ=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Sat, 17 Aug 2024 10:38:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1723883924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=mJGnhTdgZtZZYvA8sT7RFamUYLmgnrEcpWNrSAahfyI=; b=QR1ssmHpnVKVLnIQetQOaSySaXfjcoCn6V0uAu/K8i0Z096SB4E0qSLPRi4vKgEfSBoeKA KrU9vHCQFZwc0Sc//WdSEcvxLOQ65y8hGUQ6ew1+G8Z4Ci/G26J5ks+3ofFYV2CzM5IoIV Zpl6fn+OGsTry44lRW3aG4uNNZY4tErbU6VPEoo3ePJOMYp7NQW8fwToqBAWQDOy0nH1KG 4MtpH0qNPWUaCvwgVfP1QdYwEMWMfIYIiuIJLjyPEn2U6Uce35e2RGhrjI5ovbdaA5DvMl Xrt/mNWQhwXU2bWgQzUJPFIYYr5lc8uZGcnYMTPrmG3MNtRCnWMeY9MkQ4nl6g== From: Ronald Klop To: Peter Holm Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <1938701047.3129.1723883923856@localhost> In-Reply-To: <202408170638.47H6cT60006976@gitrepo.freebsd.org> Subject: Re: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3128_445269149.1723883923849" X-Mailer: Realworks (716.31) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] X-Rspamd-Queue-Id: 4WmC234MTdz4HGq ------=_Part_3128_445269149.1723883923849 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Interesting. Why the cap? Can you explain what happened in the tests? Regards, Ronald. Van: Peter Holm Datum: 17 augustus 2024 08:38 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped > > > The branch main has been updated by pho: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > > commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > Author: Peter Holm > AuthorDate: 2024-08-17 06:37:34 +0000 > Commit: Peter Holm > CommitDate: 2024-08-17 06:37:34 +0000 > > stress2: Some tests use hw.ncpu to scale the load. Tests on a box with > a large number of CPUs show that this number needs to be capped > --- > tools/test/stress2/misc/buildkernel.sh | 1 + > tools/test/stress2/misc/buildworld.sh | 1 + > tools/test/stress2/misc/buildworld2.sh | 1 + > tools/test/stress2/misc/buildworld3.sh | 1 + > tools/test/stress2/misc/buildworld4.sh | 1 + > tools/test/stress2/misc/crossmp3.sh | 1 + > tools/test/stress2/misc/crossmp4.sh | 1 + > tools/test/stress2/misc/crossmp5.sh | 1 + > tools/test/stress2/misc/crossmp8.sh | 1 + > tools/test/stress2/misc/gnop4.sh | 3 +++ > tools/test/stress2/misc/tmpfs13.sh | 1 + > tools/test/stress2/misc/zzbuildworld.sh | 1 + > 12 files changed, 14 insertions(+) > > diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh > index 849a09b81439..e0aa85617f9b 100755 > --- a/tools/test/stress2/misc/buildkernel.sh > +++ b/tools/test/stress2/misc/buildkernel.sh > @@ -49,6 +49,7 @@ chmod 0777 $TMPDIR > log=$mntpoint/log > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > p=`jot -r 1 1 $p` > echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" > "TARGET=amd64 TARGET_ARCH=amd64" > diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh > index 595b387c90ae..3b362ec7041a 100755 > --- a/tools/test/stress2/misc/buildworld.sh > +++ b/tools/test/stress2/misc/buildworld.sh > @@ -55,6 +55,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null > > diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh > index 9c1eed97b7ea..3653cb1db5b4 100755 > --- a/tools/test/stress2/misc/buildworld2.sh > +++ b/tools/test/stress2/misc/buildworld2.sh > @@ -46,6 +46,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 > > /dev/null & > sleep $((20 * 60)) > diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh > index 0c660cae8eae..e3bce2764c0c 100755 > --- a/tools/test/stress2/misc/buildworld3.sh > +++ b/tools/test/stress2/misc/buildworld3.sh > @@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX > chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > su $testuser -c > "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null" & > diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh > index 6c15a72a9dcb..d1d162120952 100755 > --- a/tools/test/stress2/misc/buildworld4.sh > +++ b/tools/test/stress2/misc/buildworld4.sh > @@ -50,6 +50,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 16 ] && p=16 # Arbitrary cap > [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4)) > p=`jot -r 1 1 $p` > echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 " > diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh > index 5eecb936e900..32c625a1e4ad 100755 > --- a/tools/test/stress2/misc/crossmp3.sh > +++ b/tools/test/stress2/misc/crossmp3.sh > @@ -41,6 +41,7 @@ > CONT=/tmp/crossmp3.continue > if [ $# -eq 0 ]; then > N=`sysctl -n hw.ncpu` > + [ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh > index e22f969b72bb..21d22bee69e5 100755 > --- a/tools/test/stress2/misc/crossmp4.sh > +++ b/tools/test/stress2/misc/crossmp4.sh > @@ -40,6 +40,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 - 2)) > diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh > index 038dea7ebe4f..6e504d9f20ad 100755 > --- a/tools/test/stress2/misc/crossmp5.sh > +++ b/tools/test/stress2/misc/crossmp5.sh > @@ -33,6 +33,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh > index e877dfaf6d1c..eec5ba9bc7c1 100755 > --- a/tools/test/stress2/misc/crossmp8.sh > +++ b/tools/test/stress2/misc/crossmp8.sh > @@ -41,6 +41,7 @@ > > CONT=/tmp/crossmp8.continue > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh > index f938dd3b790b..1b4da74266f6 100755 > --- a/tools/test/stress2/misc/gnop4.sh > +++ b/tools/test/stress2/misc/gnop4.sh > @@ -34,6 +34,8 @@ > # https://people.freebsd.org/~pho/stress/log/kostik1017.txt > # Fixed by r322175 > > +# Seen with p=513: Threads stuck in "ffsrca" > + > . ../default.cfg > > gigs=9 > @@ -62,6 +64,7 @@ cd $mntpoint/src > export MAKEOBJDIRPREFIX=$mntpoint/obj > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Temporary work around > timeout 10m > make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null > diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh > index 29b44cbc9ad4..231c42033f9d 100755 > --- a/tools/test/stress2/misc/tmpfs13.sh > +++ b/tools/test/stress2/misc/tmpfs13.sh > @@ -40,6 +40,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / 2)) > diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh > index 2104eb156c86..e1bf867d8d5f 100755 > --- a/tools/test/stress2/misc/zzbuildworld.sh > +++ b/tools/test/stress2/misc/zzbuildworld.sh > @@ -44,6 +44,7 @@ top=$mntpoint > export MAKEOBJDIRPREFIX=$top/obj > export log=$top/buildworld.`date +%Y%m%dT%H%M` > n=$((`sysctl -n hw.ncpu` + 1)) > +[ $n -gt 32 ] && n=32 # Arbitrary cap > cd $src > make -j$n buildworld > $log 2>&1 && s=0 ||s=1 > grep '***' $log && s=2 > > > > > ------=_Part_3128_445269149.1723883923849 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Interesting. Why the cap?
Can you explain what happened in the tests?

Regards,
Ronald.

Van: Peter Holm <pho@FreeBSD.org>
Datum: 17 augustus 2024 08:38
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped

The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf

commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf
Author:     Peter Holm
AuthorDate: 2024-08-17 06:37:34 +0000
Commit:     Peter Holm
CommitDate: 2024-08-17 06:37:34 +0000

    stress2: Some tests use hw.ncpu to scale the load. Tests on a box with
    a large number of CPUs show that this number needs to be capped
---
 tools/test/stress2/misc/buildkernel.sh  | 1 +
 tools/test/stress2/misc/buildworld.sh   | 1 +
 tools/test/stress2/misc/buildworld2.sh  | 1 +
 tools/test/stress2/misc/buildworld3.sh  | 1 +
 tools/test/stress2/misc/buildworld4.sh  | 1 +
 tools/test/stress2/misc/crossmp3.sh     | 1 +
 tools/test/stress2/misc/crossmp4.sh     | 1 +
 tools/test/stress2/misc/crossmp5.sh     | 1 +
 tools/test/stress2/misc/crossmp8.sh     | 1 +
 tools/test/stress2/misc/gnop4.sh        | 3 +++
 tools/test/stress2/misc/tmpfs13.sh      | 1 +
 tools/test/stress2/misc/zzbuildworld.sh | 1 +
 12 files changed, 14 insertions(+)

diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh
index 849a09b81439..e0aa85617f9b 100755
--- a/tools/test/stress2/misc/buildkernel.sh
+++ b/tools/test/stress2/misc/buildkernel.sh
@@ -49,6 +49,7 @@ chmod 0777 $TMPDIR
 log=$mntpoint/log
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 p=`jot -r 1 1 $p`
 echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint"
     "TARGET=amd64 TARGET_ARCH=amd64"
diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh
index 595b387c90ae..3b362ec7041a 100755
--- a/tools/test/stress2/misc/buildworld.sh
+++ b/tools/test/stress2/misc/buildworld.sh
@@ -55,6 +55,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 timeout 20m make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null
 
diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh
index 9c1eed97b7ea..3653cb1db5b4 100755
--- a/tools/test/stress2/misc/buildworld2.sh
+++ b/tools/test/stress2/misc/buildworld2.sh
@@ -46,6 +46,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 make -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64
     > /dev/null &
 sleep $((20 *  60))
diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh
index 0c660cae8eae..e3bce2764c0c 100755
--- a/tools/test/stress2/misc/buildworld3.sh
+++ b/tools/test/stress2/misc/buildworld3.sh
@@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX
 chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 su $testuser -c
     "make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null" &
diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh
index 6c15a72a9dcb..d1d162120952 100755
--- a/tools/test/stress2/misc/buildworld4.sh
+++ b/tools/test/stress2/misc/buildworld4.sh
@@ -50,6 +50,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 16 ] && p=16  # Arbitrary cap
 [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4))
 p=`jot -r 1 1 $p`
 echo "make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 "
diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh
index 5eecb936e900..32c625a1e4ad 100755
--- a/tools/test/stress2/misc/crossmp3.sh
+++ b/tools/test/stress2/misc/crossmp3.sh
@@ -41,6 +41,7 @@
 CONT=/tmp/crossmp3.continue
 if [ $# -eq 0 ]; then
    N=`sysctl -n hw.ncpu`
+   [ $N -gt 32 ] && N=32  # Arbitrary cap
    usermem=`sysctl -n hw.usermem`
    [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2))
    size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh
index e22f969b72bb..21d22bee69e5 100755
--- a/tools/test/stress2/misc/crossmp4.sh
+++ b/tools/test/stress2/misc/crossmp4.sh
@@ -40,6 +40,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 - 2))
diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh
index 038dea7ebe4f..6e504d9f20ad 100755
--- a/tools/test/stress2/misc/crossmp5.sh
+++ b/tools/test/stress2/misc/crossmp5.sh
@@ -33,6 +33,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh
index e877dfaf6d1c..eec5ba9bc7c1 100755
--- a/tools/test/stress2/misc/crossmp8.sh
+++ b/tools/test/stress2/misc/crossmp8.sh
@@ -41,6 +41,7 @@
 
 CONT=/tmp/crossmp8.continue
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh
index f938dd3b790b..1b4da74266f6 100755
--- a/tools/test/stress2/misc/gnop4.sh
+++ b/tools/test/stress2/misc/gnop4.sh
@@ -34,6 +34,8 @@
 # https://people.freebsd.org/~pho/stress/log/kostik1017.txt
 # Fixed by r322175
 
+# Seen with p=513: Threads stuck in "ffsrca"
+
 . ../default.cfg
 
 gigs=9
@@ -62,6 +64,7 @@ cd $mntpoint/src
 export MAKEOBJDIRPREFIX=$mntpoint/obj
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Temporary work around
 timeout 10m
     make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null
diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh
index 29b44cbc9ad4..231c42033f9d 100755
--- a/tools/test/stress2/misc/tmpfs13.sh
+++ b/tools/test/stress2/misc/tmpfs13.sh
@@ -40,6 +40,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / 2))
diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh
index 2104eb156c86..e1bf867d8d5f 100755
--- a/tools/test/stress2/misc/zzbuildworld.sh
+++ b/tools/test/stress2/misc/zzbuildworld.sh
@@ -44,6 +44,7 @@ top=$mntpoint
 export MAKEOBJDIRPREFIX=$top/obj
 export log=$top/buildworld.`date +%Y%m%dT%H%M`
 n=$((`sysctl -n hw.ncpu` + 1))
+[ $n -gt 32 ] && n=32  # Arbitrary cap
 cd $src
 make -j$n buildworld > $log 2>&1 && s=0 ||s=1
 grep  '***' $log && s=2





------=_Part_3128_445269149.1723883923849-- From nobody Sat Aug 17 11:24:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WmGj157Ytz5SrCl; Sat, 17 Aug 2024 11:24:21 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WmGj14Fw4z4Tn9; Sat, 17 Aug 2024 11:24:21 +0000 (UTC) (envelope-from pho@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723893861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5jQE4G3C1c0lrAhrFPEaR5E5VTVncBYw4S6Y54F7yvA=; b=IGFjfaVNDxNW9oELAddOjFsIZx1Vp3qVo2k/YmeOjgmgQrX++jWYRaUH7O2+qMYHfmkAYt fiahZV9roPPG4OgBHP2EyOqVp+VOKgfIfr13GEEXYAAVQ/zeIcGpEz6+euXIRSOUCN+zai K4r4vQIEtMa8BrkFnplWGSReyLsyJHTlmr9xERINtpcdumt66SFacq4uYCr3KaF3KuwkU8 b48vkyOF4220O95iCzYF1SkjaFT7V2SBVWmiDMbxI4D42qH+kbGu8G6rQfmr2I8p5qYaP9 F4E3jp0yLhgQ9Ekwlr+ow0bw2XTxaEh29JAyeRtbmYtuh3c++snaNz6qBsfwng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723893861; a=rsa-sha256; cv=none; b=WNs3cdmExOCSQszYqTuWXncvwbxOKgLrJpX4SIZ2mwLKOfcAXQSU0fsEHFQjF5loM8Cj9s 7Gwjbfpv/8jvuHhNoV4aVvZQfraTaRpGCrMCsF7Jd3lnmT5ZlSf0GngWf7XiiRw5v4UmG/ pmZgBzrLfi8jChR/1Wocu4Ed+DgqjUcTju9x6CIDpx/QE2uMuKqQDzLCuccP2RDMxBh8al f7jyaSo8y6Hxj9zz95+jCSafb2X9ntPiDdCslcRcIGgIgba8xJE+b9Op3L31ruYrtV1gxg upICPThiNjvw7TeXu4wCMrs4ZBH6619hPTyeu0ScJZGHD8o4ZO8ftz1PVaehxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723893861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5jQE4G3C1c0lrAhrFPEaR5E5VTVncBYw4S6Y54F7yvA=; b=AdiLYyL5irvhodbfqTYGh+7T3XvWByB/9nU+Fb2fBoPO3p4AF7OpGrNcBEs+kzwmRc6L7H jUcdZDRwUwyg9ikdIp9qfltKlqcVXObuw9g7I/PzQTrDFbjyqY2RDBhN5qvzsdlXG7GXFv PuSa/rJ3oAD3Xv6DUMOMVUBCpyNKTKOU828n0IG/0WRedNORX8tRM6onIGcgAKB6nzNxQo FdAJf0h1huaOihGaVIkNMeX+1lw2zPM4XukqUSGiXWyy61+q7MdijGbr8+dTKB7W3wq7Q8 5fg7G7zVR/DOUB2tmcS5+sJN9AEAPBtS0YlApkM1o5U9xthx1mKGq4ALgSi0JQ== Received: from Peters-Air (c-x5996a268.customers.hiper-net.dk [89.150.162.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: pho) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WmGj05lX0zTy3; Sat, 17 Aug 2024 11:24:20 +0000 (UTC) (envelope-from pho@FreeBSD.org) Date: Sat, 17 Aug 2024 13:24:16 +0200 From: Peter Holm To: Ronald Klop Cc: Peter Holm , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped Message-ID: References: <202408170638.47H6cT60006976@gitrepo.freebsd.org> <1938701047.3129.1723883923856@localhost> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1938701047.3129.1723883923856@localhost> On Sat, Aug 17, 2024 at 10:38:43AM +0200, Ronald Klop wrote: > Interesting. Why the cap? > Can you explain what happened in the tests? > The main reason was that the tests took too long to run. For the test using parallel make, I suspect disk saturation is the cause. - Peter > Regards, > Ronald. > > Van: Peter Holm > Datum: 17 augustus 2024 08:38 > Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org > Onderwerp: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped > > > > > > > The branch main has been updated by pho: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > > > > commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > > Author: Peter Holm AuthorDate: 2024-08-17 06:37:34 +0000 > > Commit: Peter Holm CommitDate: 2024-08-17 06:37:34 +0000 > > > > stress2: Some tests use hw.ncpu to scale the load. Tests on a box with > > a large number of CPUs show that this number needs to be capped > > --- > > tools/test/stress2/misc/buildkernel.sh | 1 + > > tools/test/stress2/misc/buildworld.sh | 1 + > > tools/test/stress2/misc/buildworld2.sh | 1 + > > tools/test/stress2/misc/buildworld3.sh | 1 + > > tools/test/stress2/misc/buildworld4.sh | 1 + > > tools/test/stress2/misc/crossmp3.sh | 1 + > > tools/test/stress2/misc/crossmp4.sh | 1 + > > tools/test/stress2/misc/crossmp5.sh | 1 + > > tools/test/stress2/misc/crossmp8.sh | 1 + > > tools/test/stress2/misc/gnop4.sh | 3 +++ > > tools/test/stress2/misc/tmpfs13.sh | 1 + > > tools/test/stress2/misc/zzbuildworld.sh | 1 + > > 12 files changed, 14 insertions(+) > > > > diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh > > index 849a09b81439..e0aa85617f9b 100755 > > --- a/tools/test/stress2/misc/buildkernel.sh > > +++ b/tools/test/stress2/misc/buildkernel.sh > > @@ -49,6 +49,7 @@ chmod 0777 $TMPDIR > > log=$mntpoint/log > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 32 ] && p=32 # Arbitrary cap > > p=`jot -r 1 1 $p` > > echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" > > "TARGET=amd64 TARGET_ARCH=amd64" > > diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh > > index 595b387c90ae..3b362ec7041a 100755 > > --- a/tools/test/stress2/misc/buildworld.sh > > +++ b/tools/test/stress2/misc/buildworld.sh > > @@ -55,6 +55,7 @@ mkdir $TMPDIR > > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 32 ] && p=32 # Arbitrary cap > > timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > > TARGET_ARCH=amd64 > /dev/null > > diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh > > index 9c1eed97b7ea..3653cb1db5b4 100755 > > --- a/tools/test/stress2/misc/buildworld2.sh > > +++ b/tools/test/stress2/misc/buildworld2.sh > > @@ -46,6 +46,7 @@ mkdir $TMPDIR > > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 32 ] && p=32 # Arbitrary cap > > make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 > > > /dev/null & > > sleep $((20 * 60)) > > diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh > > index 0c660cae8eae..e3bce2764c0c 100755 > > --- a/tools/test/stress2/misc/buildworld3.sh > > +++ b/tools/test/stress2/misc/buildworld3.sh > > @@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX > > chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 32 ] && p=32 # Arbitrary cap > > su $testuser -c "make -i -j $p buildworld DESTDIR=$mntpoint > > TARGET=amd64 TARGET_ARCH=amd64 > /dev/null" & > > diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh > > index 6c15a72a9dcb..d1d162120952 100755 > > --- a/tools/test/stress2/misc/buildworld4.sh > > +++ b/tools/test/stress2/misc/buildworld4.sh > > @@ -50,6 +50,7 @@ mkdir $TMPDIR > > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 16 ] && p=16 # Arbitrary cap > > [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4)) > > p=`jot -r 1 1 $p` > > echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 " > > diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh > > index 5eecb936e900..32c625a1e4ad 100755 > > --- a/tools/test/stress2/misc/crossmp3.sh > > +++ b/tools/test/stress2/misc/crossmp3.sh > > @@ -41,6 +41,7 @@ > > CONT=/tmp/crossmp3.continue > > if [ $# -eq 0 ]; then > > N=`sysctl -n hw.ncpu` > > + [ $N -gt 32 ] && N=32 # Arbitrary cap > > usermem=`sysctl -n hw.usermem` > > [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2)) > > size=$((usermem / 1024 / 1024 / N)) > > diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh > > index e22f969b72bb..21d22bee69e5 100755 > > --- a/tools/test/stress2/misc/crossmp4.sh > > +++ b/tools/test/stress2/misc/crossmp4.sh > > @@ -40,6 +40,7 @@ > > . ../default.cfg > > N=`sysctl -n hw.ncpu` > > +[ $N -gt 32 ] && N=32 # Arbitrary cap > > usermem=`sysctl -n hw.usermem` > > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > > size=$((usermem / 1024 / 1024 - 2)) > > diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh > > index 038dea7ebe4f..6e504d9f20ad 100755 > > --- a/tools/test/stress2/misc/crossmp5.sh > > +++ b/tools/test/stress2/misc/crossmp5.sh > > @@ -33,6 +33,7 @@ > > . ../default.cfg > > N=`sysctl -n hw.ncpu` > > +[ $N -gt 32 ] && N=32 # Arbitrary cap > > usermem=`sysctl -n hw.usermem` > > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > > size=$((usermem / 1024 / 1024 / N)) > > diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh > > index e877dfaf6d1c..eec5ba9bc7c1 100755 > > --- a/tools/test/stress2/misc/crossmp8.sh > > +++ b/tools/test/stress2/misc/crossmp8.sh > > @@ -41,6 +41,7 @@ > > CONT=/tmp/crossmp8.continue > > N=`sysctl -n hw.ncpu` > > +[ $N -gt 32 ] && N=32 # Arbitrary cap > > usermem=`sysctl -n hw.usermem` > > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > > size=$((usermem / 1024 / 1024 / N)) > > diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh > > index f938dd3b790b..1b4da74266f6 100755 > > --- a/tools/test/stress2/misc/gnop4.sh > > +++ b/tools/test/stress2/misc/gnop4.sh > > @@ -34,6 +34,8 @@ > > # https://people.freebsd.org/~pho/stress/log/kostik1017.txt > > # Fixed by r322175 > > +# Seen with p=513: Threads stuck in "ffsrca" > > + > > . ../default.cfg > > gigs=9 > > @@ -62,6 +64,7 @@ cd $mntpoint/src > > export MAKEOBJDIRPREFIX=$mntpoint/obj > > p=$((`sysctl -n hw.ncpu`+ 1)) > > +[ $p -gt 32 ] && p=32 # Temporary work around > > timeout 10m make -i -j $p buildworld DESTDIR=$mntpoint > > TARGET=amd64 TARGET_ARCH=amd64 > /dev/null > > diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh > > index 29b44cbc9ad4..231c42033f9d 100755 > > --- a/tools/test/stress2/misc/tmpfs13.sh > > +++ b/tools/test/stress2/misc/tmpfs13.sh > > @@ -40,6 +40,7 @@ > > . ../default.cfg > > N=`sysctl -n hw.ncpu` > > +[ $N -gt 32 ] && N=32 # Arbitrary cap > > usermem=`sysctl -n hw.usermem` > > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > > size=$((usermem / 1024 / 1024 / 2)) > > diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh > > index 2104eb156c86..e1bf867d8d5f 100755 > > --- a/tools/test/stress2/misc/zzbuildworld.sh > > +++ b/tools/test/stress2/misc/zzbuildworld.sh > > @@ -44,6 +44,7 @@ top=$mntpoint > > export MAKEOBJDIRPREFIX=$top/obj > > export log=$top/buildworld.`date +%Y%m%dT%H%M` > > n=$((`sysctl -n hw.ncpu` + 1)) > > +[ $n -gt 32 ] && n=32 # Arbitrary cap > > cd $src > > make -j$n buildworld > $log 2>&1 && s=0 ||s=1 > > grep '***' $log && s=2 > > > > > > > > > > From nobody Sat Aug 17 18:34:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WmSFF18rxz5TV4b; Sat, 17 Aug 2024 18:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WmSFF0FJ1z45y4; Sat, 17 Aug 2024 18:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723919665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jz6DOZwI7r7ZkuALj1RSHtW2IDHxDP3al3ccv4EIwwU=; b=qIMZCf+nmFEtkKc3AdGCxsnGhBFOeSKwDtYKyF/kejL6et1jjq5xL9WAysvBp6Ecd8ozqg k/tS/3v/NACwBlR5QTg7PyezsfClYFEm8Vy1m1ABD1jAIlZ1Gu0bkoBfR7qXN2TDvnE2kQ 3Ewetbe3pqllIJRkbyOj0JqBtJYgoxdb0f0zPpB92kqqou+WEwlEoywTMHJyqAaoy4oR7l tHw+UNnNMyIdu04wK2xxHzqUN+VETLQqaQoqVwzKNYUc+Ic9eHK6mToedpIutnf5UGLcZe vSYz7hSba7TbWploQO4b4FvX4vOWqD/7L4kDhITc8HWe5DjNHvqmAvsnS8UEmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723919665; a=rsa-sha256; cv=none; b=BFUmTX/KDmzeZXZszOhdYBpZwAqDriBz/rRLuLT8eSIthqvFXmG1KpvlYL6Sbsh6cKfgOS M5aU87Zx6yquxj7YWBiGtMLgkNgVV7OjwUGzKga9eXx458bjiVCTz4EUVOeV3B+IniLdgu ESMkUVne3GqfpTRmtflcP0TWKnODsZgu2+z9X/6rqqI0wcXdUshyUJ995sS/KWRAgzEZGT 49KhYnNalNk8XxCDwvVZKNuph5WLhX4pUkMu0Ez/nyYx9LY++EruGG3cYjOGMEfQ7WjwwS dDqQ3PjIFLudLI8I+NeykGpohu8OrFZdGr/JVqHxVxwbRuvSNQ2ei2k2q3GvRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723919665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jz6DOZwI7r7ZkuALj1RSHtW2IDHxDP3al3ccv4EIwwU=; b=Gvo+rRQaGgCNe+/hcczXn1t/hXKmnxlomT231jgRv+BWLYvUs0siWvek+grKBZI1w0EjtQ iEYu0OY8TN5zO+oBEdWz+qNxVNnMP8aH2bBdNUGKzznqqvzUUley0C9QOzVZ9sbxNNIHs+ 45k8kp0THqXbxwv2d/TT1czkKkCjvR8FMa1X127HWRSPJmxGEPioAxmUEpGwyyy9LIRoh/ 23DSL03a0idteO5MKCs3I0jyAeDIBQ0gYA2IGsCESMiaXS+tO43wnP4VA1ThTbAQr8QEMc JMfmJaVuAwLLDa/Q1Wo7A3qtAU6QdEexTNfkPZWj1dcUd0GaxLkZELaDPJkS0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WmSFD6ppJz10wB; Sat, 17 Aug 2024 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47HIYOTm022344; Sat, 17 Aug 2024 18:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47HIYO5R022341; Sat, 17 Aug 2024 18:34:24 GMT (envelope-from git) Date: Sat, 17 Aug 2024 18:34:24 GMT Message-Id: <202408171834.47HIYO5R022341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: b5332809c633 - main - cxgbe/iw_cxgbe: Fix typo in assertion. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5332809c633e7e37715f7823a8a8ee9799910a4 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b5332809c633e7e37715f7823a8a8ee9799910a4 commit b5332809c633e7e37715f7823a8a8ee9799910a4 Author: Navdeep Parhar AuthorDate: 2024-07-22 17:19:58 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-17 17:38:36 +0000 cxgbe/iw_cxgbe: Fix typo in assertion. eanbled -> enabled MFC after: 3 days --- sys/dev/cxgbe/iw_cxgbe/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/device.c b/sys/dev/cxgbe/iw_cxgbe/device.c index 279bdb20d511..209d12767a1c 100644 --- a/sys/dev/cxgbe/iw_cxgbe/device.c +++ b/sys/dev/cxgbe/iw_cxgbe/device.c @@ -284,7 +284,7 @@ c4iw_activate(struct adapter *sc) } if (uld_active(sc, ULD_IWARP)) { - KASSERT(0, ("%s: RDMA already eanbled on sc %p", __func__, sc)); + KASSERT(0, ("%s: RDMA already enabled on sc %p", __func__, sc)); return (0); } From nobody Sat Aug 17 18:34:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WmSFG29LZz5TTx9; Sat, 17 Aug 2024 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WmSFG1h4Pz461M; Sat, 17 Aug 2024 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723919666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UGyfQIIAXny18HNwVBsxomGEYWcqHUpRpHCQjMTi2M=; b=LukUd1+P+xhxM3+1JTokzSMumTiuBNGRTg7fF4RNRWQYmzkW3Zpp454eFoq7tvklYvN2Bw HayZmctHrCaCQqLI7982lIL/gUGGv42FRxKD038U0Id83b80YyhHqdtODziDni6bilT15v Ncvo5bRBplZhXpshfi/kBmSyi/zX6DYw6yLNQIQ3RF+l1aSos4D6IA3n4Iv4uY9gcOrUli FkLtBMdNBLucH+N1Z+zfj81qfdlsJdMiSICc7Vvjh2nDp6VCa/B3F3ro3V22IEPPUowz1Z aLicEQpY82F++9AUJh9QKvrDbOa168FsHdayYPqifE08GgPKAfX0YJgqPJnscA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723919666; a=rsa-sha256; cv=none; b=g7zGUoY0nlf4PAk2rqJ8Md4E8rH06K25oSeWopDL9FMTm+p5RVGO8C3mBxnb1U2FmyaLWw DM1kEhcFoJpUunPlXbfRGQgz0KC+azFNPcGXwwXF21VgG4bLxk30ofhBwdCSOlpeOwfMCE 77AJM3t40NpRNy+NterlpLI5ontBYfHxlITUWABRLdXDwm/4t2XN8rgNmXKr1/3xuKdjdR 0K5yBQfgT7DuELs5gE/bq9yOBRk9vVnkIGdIgm8d9uac/WWvCTzNHQVjkyY9UcAKGut2Sc jTLrvIVIBvZaoHSWLxk+sHAqQqs0Bv+uyh7hJWeYf7Yfs+qXf72bxK0cY/0kKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723919666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UGyfQIIAXny18HNwVBsxomGEYWcqHUpRpHCQjMTi2M=; b=AfFjfbqL2j8aSAMBkqYa6/dXRUBHFFwp09EDth8ZOOaUOhyBWrrpCU4oEcAq6rhFXu9b3K bOAeyFrlw/UED1xPyfAxsNTTgnQWWcsPpwpUTQw3P79adq1pVBOqEiMCH4uLev2FZrhd72 yfWM83u3tDYGwcs8WtYGgachbK3v2ixbx+OQF7f6dH0pugAedWNPd62cH+Q5PRV5xbxijb 0+jEGlPoUGhB5anMqtx+5Iq6HH94Gf9x2C0jDw/nBUW6/ayfW0MVebsbYRaygWiCeYRAu+ Yn7L4AMAiHncD4LgsbwRxwZxKxHFRjBlGT46wJ40c+fUoUNtZWFy0qq/Mu3JpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WmSFG15NJz11GZ; Sat, 17 Aug 2024 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47HIYQ6C022399; Sat, 17 Aug 2024 18:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47HIYQFr022396; Sat, 17 Aug 2024 18:34:26 GMT (envelope-from git) Date: Sat, 17 Aug 2024 18:34:26 GMT Message-Id: <202408171834.47HIYQFr022396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 0a9d1da6e6ce - main - cxgbe(4): Stop work request queues in a reliable manner. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a9d1da6e6cede5e9c0ff63240d724049ad72b5b Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=0a9d1da6e6cede5e9c0ff63240d724049ad72b5b commit 0a9d1da6e6cede5e9c0ff63240d724049ad72b5b Author: Navdeep Parhar AuthorDate: 2024-07-31 19:27:18 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-17 18:23:32 +0000 cxgbe(4): Stop work request queues in a reliable manner. Clear the EQ_HW_ALLOCATED flag with the wrq lock held and discard all work requests, pending or new, when it's not set. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 5 ++++- sys/dev/cxgbe/t4_main.c | 20 +++++++++++++++++++- sys/dev/cxgbe/t4_sge.c | 15 ++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 0d731e736823..3922bd3909fe 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1561,7 +1561,10 @@ t4_wrq_tx(struct adapter *sc, struct wrqe *wr) struct sge_wrq *wrq = wr->wrq; TXQ_LOCK(wrq); - t4_wrq_tx_locked(sc, wrq, wr); + if (__predict_true(wrq->eq.flags & EQ_HW_ALLOCATED)) + t4_wrq_tx_locked(sc, wrq, wr); + else + free(wr, M_CXGBE); TXQ_UNLOCK(wrq); } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 795c8d7e2e37..57c1eeceab22 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2060,7 +2060,9 @@ stop_lld(struct adapter *sc) } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, k, ofld_txq) { + TXQ_LOCK(&ofld_txq->wrq); ofld_txq->wrq.eq.flags &= ~EQ_HW_ALLOCATED; + TXQ_UNLOCK(&ofld_txq->wrq); } #endif for_each_rxq(vi, k, rxq) { @@ -2078,7 +2080,9 @@ stop_lld(struct adapter *sc) if (sc->flags & FULL_INIT_DONE) { /* Control queue */ wrq = &sc->sge.ctrlq[i]; + TXQ_LOCK(wrq); wrq->eq.flags &= ~EQ_HW_ALLOCATED; + TXQ_UNLOCK(wrq); quiesce_wrq(wrq); } } @@ -7047,8 +7051,22 @@ quiesce_txq(struct sge_txq *txq) static void quiesce_wrq(struct sge_wrq *wrq) { + struct wrqe *wr; - /* XXXTX */ + TXQ_LOCK(wrq); + while ((wr = STAILQ_FIRST(&wrq->wr_list)) != NULL) { + STAILQ_REMOVE_HEAD(&wrq->wr_list, link); +#ifdef INVARIANTS + wrq->nwr_pending--; + wrq->ndesc_needed -= howmany(wr->wr_len, EQ_ESIZE); +#endif + free(wr, M_CXGBE); + } + MPASS(wrq->nwr_pending == 0); + MPASS(wrq->ndesc_needed == 0); + wrq->nwr_pending = 0; + wrq->ndesc_needed = 0; + TXQ_UNLOCK(wrq); } static void diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index b4eb0701821a..bc81a0251deb 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -2921,6 +2921,10 @@ start_wrq_wr(struct sge_wrq *wrq, int len16, struct wrq_cookie *cookie) MPASS(ndesc > 0 && ndesc <= SGE_MAX_WR_NDESC); EQ_LOCK(eq); + if (__predict_false((eq->flags & EQ_HW_ALLOCATED) == 0)) { + EQ_UNLOCK(eq); + return (NULL); + } if (TAILQ_EMPTY(&wrq->incomplete_wrs) && !STAILQ_EMPTY(&wrq->wr_list)) drain_wrq_wr_list(sc, wrq); @@ -3016,7 +3020,10 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq_cookie *cookie) F_FW_WR_EQUEQ); } - ring_eq_db(wrq->adapter, eq, ndesc); + if (__predict_true(eq->flags & EQ_HW_ALLOCATED)) + ring_eq_db(wrq->adapter, eq, ndesc); + else + IDXINCR(eq->dbidx, ndesc, eq->sidx); } else { MPASS(IDXDIFF(next->pidx, pidx, eq->sidx) == ndesc); next->pidx = pidx; @@ -3852,6 +3859,8 @@ alloc_ctrlq(struct adapter *sc, int idx) if (!(ctrlq->eq.flags & EQ_HW_ALLOCATED)) { MPASS(ctrlq->eq.flags & EQ_SW_ALLOCATED); + MPASS(ctrlq->nwr_pending == 0); + MPASS(ctrlq->ndesc_needed == 0); rc = alloc_eq_hwq(sc, NULL, &ctrlq->eq); if (rc != 0) { @@ -4554,6 +4563,7 @@ free_wrq(struct adapter *sc, struct sge_wrq *wrq) { free_eq(sc, &wrq->eq); MPASS(wrq->nwr_pending == 0); + MPASS(wrq->ndesc_needed == 0); MPASS(TAILQ_EMPTY(&wrq->incomplete_wrs)); MPASS(STAILQ_EMPTY(&wrq->wr_list)); bzero(wrq, sizeof(*wrq)); @@ -4848,6 +4858,9 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) } if (!(eq->flags & EQ_HW_ALLOCATED)) { + MPASS(eq->flags & EQ_SW_ALLOCATED); + MPASS(ofld_txq->wrq.nwr_pending == 0); + MPASS(ofld_txq->wrq.ndesc_needed == 0); rc = alloc_eq_hwq(sc, vi, eq); if (rc != 0) { CH_ERR(vi, "failed to create hw ofld_txq%d: %d\n", idx,