From nobody Mon Jun 2 05:29:38 2025 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 4b9j8L65Wrz5xWHM; Mon, 02 Jun 2025 05:29: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 4b9j8L5TtSz43YX; Mon, 02 Jun 2025 05:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748842178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wIxigdy/C8LeLwoofqsK7bFoyRWUkAeSMo1CyFAOec=; b=wNSugDWE1s6rrSJMqeC4kfwNjsoLBn7YY8jZxx6rw4ymHAQ2hETxnE+xEUTc6f0GjftHvF 7AzthwlA3stFvNCDfuBRFyAe3894yeMq+65M+3sbQdowxCs7PXqOmuRx1UxTy4atSxh9HD Vv5eA5gILR9foqz/j8jKIlX5FPvzODfJ20d2f6pog4QRiHNGXCnvXNMPzxBheU+9ljxYu9 lq9TFouxsM7uR1Z63wPKF1QBoXSlL2BDdg+3UNJb3ZX7hfR2RUGu/WGelSbRkTduhLEGjM Lkvp9PbfIMwcYP/RmXYrBcTuOWHzbGOsOXDhrBYm/cGwHtJ4o96Gfs+ddY8YsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748842178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wIxigdy/C8LeLwoofqsK7bFoyRWUkAeSMo1CyFAOec=; b=g8DTf1qEl27YGDrK3uO+rRYIK6/YsyvQ+8r0cmMIfEGLs4b0UfKGCtvV4lnobf49ZmGXqe v38RXYMh8fM0j6reL/Y1FaUUs/LNRlMntU+ozExqJyr6YoG/g8kh8hz+UBz4DGo4K44HFL 7+4kvimM4UspqKhyBGQGWLzFl8PxrkpvUvcY8NDPXEbdgmOaIWy4T1h4EXT+y58I4nUDuW uHzxWuPiIqrsYCi54jBqT8CwwRrh2RcQoqXSNqJh/OHE4rhFmQyV9U2EIlNbOVfRwN5esF sBw29CmWYsWKYTUAjPGu8i4ixqLymVrpKrGK2el1+oSTFbn77NoeBothgyN6bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748842178; a=rsa-sha256; cv=none; b=XrErAT3ayMmuuhqUZaMDNYZGv2SNemE+EaBVjZjmDOiluAUCBKmlnSmEg7kvYtRLlWnvlv AaP2FuT+tP1XAjVv5XZO/gNz/pB+LCetr+jba7+M37+DRRkOTsnAkzxSy8fOYa8qnNGnuI 3ZDFUz7s5lsFa6muQ43/LsEo4UkQv7IWOqyQrpbh6p/X/0cnIcVwp0ybnfODCZ76t6ybT/ d5x5nudJBjnppUkpXpDxkTT+wS09Sqr+vXhiHJxu2ru8b1hX/JiAOIv4/1KqaaZiGXpdP8 uBiRnXJz6+4yXf5b4QuUQLacip26zoTVKUe6PrY0iu5biHZkh5uOsi0X9DKkIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9j8L51BxzwGb; Mon, 02 Jun 2025 05:29: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 5525Tc3u017211; Mon, 2 Jun 2025 05:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5525Tcce017208; Mon, 2 Jun 2025 05:29:38 GMT (envelope-from git) Date: Mon, 2 Jun 2025 05:29:38 GMT Message-Id: <202506020529.5525Tcce017208@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: f9890204b5db - main - install: must set netproto for tftp:// 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: f9890204b5dbb46940d120a629ca90fbf15c499a Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f9890204b5dbb46940d120a629ca90fbf15c499a commit f9890204b5dbb46940d120a629ca90fbf15c499a Author: Simon J. Gerraty AuthorDate: 2025-06-02 05:28:21 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-02 05:28:21 +0000 install: must set netproto for tftp:// tftp_open requires netproto is NET_TFTP Reviewed by: stevek --- stand/common/install.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/common/install.c b/stand/common/install.c index b827b1fe9da2..249eca1648f3 100644 --- a/stand/common/install.c +++ b/stand/common/install.c @@ -212,6 +212,7 @@ install(char *pkgname) if (i == 4 && !strncasecmp(pkgname, "tftp", i)) { devname = "net0"; devnamelen = 4; + netproto = NET_TFTP; proto = &tftp_fsops; } else if (i == 4 && !strncasecmp(pkgname, "file", i)) { currdev = getenv("currdev"); From nobody Mon Jun 2 05:49:56 2025 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 4b9jbm3z7Sz5xX6m; Mon, 02 Jun 2025 05:49: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 4b9jbm3NYKz3F7C; Mon, 02 Jun 2025 05:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748843396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ng66EkmYEsDvDQXNTA4PPLN1hElRB+UGTYjbUZksn8s=; b=R6SUafn1DLUNxe492F0YEy/jUl+28qqt44VlUHNVnqtwMFsl+n/gDyIk+zYAs9Z0sc6o0H qudj+2qhvVOu83A7bONevGjgjpwDKW0Mcivn9DwYbc4UuJwMEOECNfFwZC+gKn3Oy8k9YX n7nha6Dxpa15oB9DgO2uKrEDYiRoNXabBlhi3nmjmBrkg+/5JXWMZt7XcVhpx9Cjb7EK03 ceqGsYGQhXSXCulAYZNp2JdweduSgo7pRwxT5j971AQ3BWtkhv75H6uk4USVPcW/O5DIUr q4oeZyrc8TQxzJ1yU6n3j1sXesXAbLmUwHs7X1YoJGUaHJSIyBZApn/ZZ91WLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748843396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ng66EkmYEsDvDQXNTA4PPLN1hElRB+UGTYjbUZksn8s=; b=JeoGPUdKVYCL5hecb3qAtguFljaRwKuVGyedqzDHw43ovpHKBXOD87gzQwl5kJJDYgdXEj RvwrAZttUB9Acha8f6Glo+/r1/ke78YNAYCRPZk7LWEIbguXyO1rB+zbW7wRp/94iz6SEV fhKoj2BMrLynRLLaqDDtJ9e5IwdfzAmXFmaKaDRzldMYZz3RL0rkIa8VJcP631k0Npg2Td ajLBA4VzkmZgFISBzbToRNfqjykFTjH/JLL3E5T+ytubvYZq0KRZ6+tVPBAGcUSOsyXNYs yzE1T1Q1Qox3buPcptncsqQyQ7PTKNJLeq38dgtRxx2ysTPL3Irte0/J7LnPdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748843396; a=rsa-sha256; cv=none; b=qgv9gKvX4AgAjUJUxrgQ7n/cCOFq9woupMiLFP0hUa6OMez8hEcAEJ7K48tx3QEDZBppQl g0PsvU3a+ObkE0YxZF5w+qRAvC3nGWe9ynHDoUQVpI25dN/W6AXdbvAsLV1peYfD6tU4bF HJYlLumr6kg14b0UGoWgjee9KSM2RDIKrnBnETS1kEs+bjOHtSAtELCwfbx23jbSqfdvMU iGshQFWMufgh9tVHMTfpshJibn/3sV+yixGiS5Z0pYYikQQGckwLKwJiL46hUjDV/+Tw5E qG9jFzz9Sl3K47wYKxR/qS+7gb98O4xK2G/rJl76Wf+NdMrRtAzKObEf8kyncQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9jbm2vq8zwVP; Mon, 02 Jun 2025 05:49: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 5525nuRT055001; Mon, 2 Jun 2025 05:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5525nuDu054998; Mon, 2 Jun 2025 05:49:56 GMT (envelope-from git) Date: Mon, 2 Jun 2025 05:49:56 GMT Message-Id: <202506020549.5525nuDu054998@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: 61d77e6c0095 - main - loader: allow for exceptions to restricted settings. 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: 61d77e6c009544d1489078c16a5d22b27d25c91b Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=61d77e6c009544d1489078c16a5d22b27d25c91b commit 61d77e6c009544d1489078c16a5d22b27d25c91b Author: Simon J. Gerraty AuthorDate: 2025-06-02 05:48:43 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-02 05:48:43 +0000 loader: allow for exceptions to restricted settings. We restrict what an unverified loader.conf etc can set, and the same restrictions are applied to interactive input. We need to allow for exceptions (eg boot_verbose). It is best if any allowed settings match up to '='. If we do not allow it to be set, do not allow it to be unset Reviewed by: stevek Sponsored by: Juniper Networks, Inc. --- stand/common/commands.c | 95 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 73 insertions(+), 22 deletions(-) diff --git a/stand/common/commands.c b/stand/common/commands.c index 95d12ad95973..19452047a0ca 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -291,6 +291,63 @@ command_show(int argc, char *argv[]) return (CMD_OK); } +#ifdef LOADER_VERIEXEC +static int +is_restricted_var(const char *var) +{ + /* + * We impose restrictions if input is not verified + * allowing for exceptions. + * These entries should include the '=' + */ + const char *allowed[] = { + "boot_function=", + "boot_phase=", + "boot_recover_cli=", + "boot_recover_volume=", + "boot_safe=", + "boot_set=", + "boot_single=", + "boot_verbose=", + NULL, + }; + const char *restricted[] = { + "boot", + "init", + "loader.ve.", + "rootfs", + "secur", + "vfs.", + NULL, + }; + const char **cp; + int ok = -1; + +#ifdef LOADER_VERIEXEC_TESTING + printf("Checking: %s\n", var); +#endif + for (cp = restricted; *cp; cp++) { + if (strncmp(var, *cp, strlen(*cp)) == 0) { + ok = 0; + break; + } + } + if (!ok) { + /* + * Check for exceptions. + * These should match up to '='. + */ + for (cp = allowed; *cp; cp++) { + if (strncmp(var, *cp, strlen(*cp)) == 0) { + ok = 1; + break; + } + } + } + return (ok == 0); +} +#endif + COMMAND_SET(set, "set", "set a variable", command_set); static int @@ -303,32 +360,14 @@ command_set(int argc, char *argv[]) return (CMD_ERROR); } else { #ifdef LOADER_VERIEXEC - /* - * Impose restrictions if input is not verified - */ - const char *restricted[] = { - "boot", - "init", - "loader.ve.", - "rootfs", - "secur", - "vfs.", - NULL, - }; - const char **cp; int ves; ves = ve_status_get(-1); if (ves == VE_UNVERIFIED_OK) { -#ifdef LOADER_VERIEXEC_TESTING - printf("Checking: %s\n", argv[1]); -#endif - for (cp = restricted; *cp; cp++) { - if (strncmp(argv[1], *cp, strlen(*cp)) == 0) { - printf("Ignoring restricted variable: %s\n", - argv[1]); - return (CMD_OK); - } + if (is_restricted_var(argv[1])) { + printf("Ignoring restricted variable: %s\n", + argv[1]); + return (CMD_OK); } } #endif @@ -351,6 +390,18 @@ command_unset(int argc, char *argv[]) command_errmsg = "wrong number of arguments"; return (CMD_ERROR); } else { +#ifdef LOADER_VERIEXEC + int ves; + + ves = ve_status_get(-1); + if (ves == VE_UNVERIFIED_OK) { + if (is_restricted_var(argv[1])) { + printf("Ignoring restricted variable: %s\n", + argv[1]); + return (CMD_OK); + } + } +#endif if ((err = unsetenv(argv[1])) != 0) { command_errmsg = strerror(err); return (CMD_ERROR); From nobody Mon Jun 2 09:33:14 2025 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 4b9pYR3j1lz5xnKK; Mon, 02 Jun 2025 09:33: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 4b9pYR0cQGz46Pf; Mon, 02 Jun 2025 09:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748856795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckVQY4Ah0Q8o0zZNHZzfD/XpitPMfSdkk+8aGU8o3nE=; b=Mn7wwWy1osDO0EDQSs0uAj3GZfAQbhb0CKAyRMM5dKF0DBbPenZdsq6fE06RQ4P9akjq8U CVcKjH6vIRw/AXHKHYnruUUI9H2iN/RmEOTvaHejrbpKQzyEpa6hlNREssTNQ0A5sTVTJp BnvpaJZspNDNjsZMA5yvmnLlL3T1RF5viWL4EWUrlu/1Q4Xaqz1WOkcHi/NkVVqkhASseI U5c432VQOpk4t8sA/icOnAHvU01Vj6m70Z32HE183YBm+BbR9PYMzj3e/7jGwOabyYRLhs YwAZ5Zqzr0BkzgDwD7n/AjDwEEWAfv6R1vqlfBpk8/e/TMBjNXyHKZQ/9ds+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748856795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckVQY4Ah0Q8o0zZNHZzfD/XpitPMfSdkk+8aGU8o3nE=; b=PzSpRmYMKbrhk9vkUq4r7aNRYWADORYA6IJUCvtTemHchNW9jezCAYdCzMYs96Bm6O/cHu 8XQ2K0mx2xKJEu8o00cVadPLA7/0Nk3Q9jBam7a8FJkb9nqGVOb95YORnZLkqc5h8xahNZ yBFP3sN/W92S53IZbrE45PkdzVVMEXOd9c9WTgu1bIr9q14bPG3cj/Vco/xegLgJB87SXE wbLoKWfKNhuufmXo9grHpECLufNy+fxA/usW3D1n/XNNX0wtQpdgkNSuUZcdj80uKDY0fN iRJOnA8b/8Lhn6+ezLrlqVPpzdfCijuno8uAHB6swVfQZW33VaGdYc8UrR36Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748856795; a=rsa-sha256; cv=none; b=DqA9brA5LDmcbxJNQSDS1nwsia4C3NixX6d3g+B0SVlti+wHN7Lj4Au3Hr/Na1iyCZjDib d/e7tQlwy/Buq1MiyntSC9FrS/hHNnWSaQdJf6jjoCKkOzoiB/4lUhU4hTvNpndVcJlQYu CbvcgruDa88qjD1PTfBax09UOe7s9wnR40zjBs6dgRbyd5+ruAePlTE+AyIM5bmii6U2mR tc8+QNyouLBTjDffjyUkfmerjJu4RjfyZaRZvdwAl9TKewOgTBZLRtHMopm9qXbcxnFSY2 SPzoAEpRx7u96kHeabKOx6zU8oVyWSjgNPwbvB7lZWmRaK03b164VbUW7ux22g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9pYR0BxBz13TN; Mon, 02 Jun 2025 09:33: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 5529XEOO083104; Mon, 2 Jun 2025 09:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5529XEpk083101; Mon, 2 Jun 2025 09:33:14 GMT (envelope-from git) Date: Mon, 2 Jun 2025 09:33:14 GMT Message-Id: <202506020933.5529XEpk083101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 1e0743f54d2d - main - glob: Add blocks support 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: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e0743f54d2d3624cd4de2167d373aa38597778e Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=1e0743f54d2d3624cd4de2167d373aa38597778e commit 1e0743f54d2d3624cd4de2167d373aa38597778e Author: Bojan Novković AuthorDate: 2025-05-23 13:26:04 +0000 Commit: Bojan Novković CommitDate: 2025-06-02 09:32:50 +0000 glob: Add blocks support This change introduces the `glob_b` function which takes a block instead of a function pointer. Relnotes: yes Sponsored by: Klara, Inc. Inspired by: https://github.com/apple-oss-distributions/Libc Differential Revision: https://reviews.freebsd.org/D50485 --- include/glob.h | 16 +++++++++-- lib/libc/gen/Makefile.inc | 1 + lib/libc/gen/Symbol.map | 1 + lib/libc/gen/glob.3 | 66 ++++++++++++++++++++++++++++++++++++++------ lib/libc/gen/glob.c | 70 +++++++++++++++++++++++++++++++++++++---------- 5 files changed, 128 insertions(+), 26 deletions(-) diff --git a/include/glob.h b/include/glob.h index dc86cdf99929..cbe99bfef6ed 100644 --- a/include/glob.h +++ b/include/glob.h @@ -50,8 +50,15 @@ typedef struct { size_t gl_offs; /* Reserved at beginning of gl_pathv. */ int gl_flags; /* Copy of flags parameter to glob. */ char **gl_pathv; /* List of paths matching pattern. */ - /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); + /* Copy of error callback parameter to glob. */ + union { + int (*gl_errfunc)(const char *, int); +#ifdef __BLOCKS__ + int (^gl_errblk)(const char *, int); +#else + void *gl_errblk; +#endif + }; /* * Alternate filesystem access methods for glob; replacement @@ -90,6 +97,7 @@ typedef struct { #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ #define GLOB_LIMIT 0x1000 /* limit number of returned paths */ +#define _GLOB_ERR_BLOCK 0x08000000 /* (internal) error callback is a block */ /* source compatibility, these are the old names */ #define GLOB_MAXPATH GLOB_LIMIT @@ -99,6 +107,10 @@ typedef struct { __BEGIN_DECLS int glob(const char * __restrict, int, int (*)(const char *, int), glob_t * __restrict); +#ifdef __BLOCKS__ +int glob_b(const char * __restrict, int, + int (^)(const char *, int), glob_t * __restrict); +#endif void globfree(glob_t *); __END_DECLS diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 302fd3a004d1..74b18b44e575 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -172,6 +172,7 @@ SRCS+= \ .if ${COMPILER_FEATURES:Mblocks} CFLAGS.fts.c= -fblocks +CFLAGS.glob.c= -fblocks .endif CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20 diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 2ddca1f20e00..afc277822787 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -459,6 +459,7 @@ FBSD_1.8 { aio_write2; execvpe; fts_open_b; + glob_b; psiginfo; rtld_get_var; rtld_set_var; diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3 index 006e8decb3db..9f15b2edb63a 100644 --- a/lib/libc/gen/glob.3 +++ b/lib/libc/gen/glob.3 @@ -27,11 +27,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 20, 2011 +.Dd June 02, 2025 .Dt GLOB 3 .Os .Sh NAME .Nm glob , +.Nm glob_b, .Nm globfree .Nd generate pathnames matching a pattern .Sh LIBRARY @@ -39,7 +40,9 @@ .Sh SYNOPSIS .In glob.h .Ft int -.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob" +.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *epath, int errno)" "glob_t * restrict pglob" +.Ft int +.Fn glob_b "const char * restrict pattern" "int flags" "int (^errblk)(const char *epath, int errno)" "glob_t * restrict pglob" .Ft void .Fn globfree "glob_t *pglob" .Sh DESCRIPTION @@ -272,10 +275,24 @@ is .Pf non- Dv NULL , .Fn glob calls -.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) , +.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) . +This may be unintuitive: a pattern like +.Ql */Makefile +will try to +.Xr stat 2 +.Ql foo/Makefile +even if +.Ql foo +is not a directory, resulting in a +call to +.Fa errfunc . +The error routine can suppress this action by testing for +.Er ENOENT +and +.Er ENOTDIR ; however, the .Dv GLOB_ERR -flag will cause an immediate +flag will still cause an immediate return when this happens. .Pp If @@ -307,16 +324,27 @@ or returns zero, the error is ignored. .Pp The +.Fn glob_b +function is like +.Fn glob +except that the error callback is a block pointer instead of a function +pointer. +.Pp +The .Fn globfree function frees any space associated with .Fa pglob from a previous call(s) to -.Fn glob . +.Fn glob +or +.Fn glob_b . .Sh RETURN VALUES On successful completion, .Fn glob -returns zero. -In addition the fields of +and +.Fn glob_b +return zero. +In addition, the fields of .Fa pglob contain the values described below: .Bl -tag -width GLOB_NOCHECK @@ -324,12 +352,16 @@ contain the values described below: contains the total number of matched pathnames so far. This includes other matches from previous invocations of .Fn glob +or +.Fn glob_b . if .Dv GLOB_APPEND was specified. .It Fa gl_matchc contains the number of matched pathnames in the current invocation of -.Fn glob . +.Fn glob +or +.Fn glob_b . .It Fa gl_flags contains a copy of the .Fa flags @@ -352,6 +384,8 @@ are undefined. .Pp If .Fn glob +or +.Fn glob_b terminates due to an error, it sets errno and returns one of the following non-zero constants, which are defined in the include file @@ -397,6 +431,14 @@ g.gl_pathv[0] = "ls"; g.gl_pathv[1] = "-l"; execvp("ls", g.gl_pathv); .Ed +.Sh CAVEATS +The +.Fn glob +and +.Fn glob_b +functions +will not match filenames that begin with a period +unless this is specifically requested (e.g., by ".*"). .Sh SEE ALSO .Xr sh 1 , .Xr fnmatch 3 , @@ -435,6 +477,10 @@ and .Fn globfree functions first appeared in .Bx 4.4 . +The +.Fn glob_b +function first appeared in +.Fx 15.0 . .Sh BUGS Patterns longer than .Dv MAXPATHLEN @@ -442,7 +488,9 @@ may cause unchecked errors. .Pp The .Fn glob -argument +and +.Fn glob_b +functions may fail and set errno for any of the errors specified for the library routines .Xr stat 2 , diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 7a988196549a..1ac919edaa12 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -88,8 +88,11 @@ #include #include +#include "block_abi.h" #include "collate.h" +typedef DECLARE_BLOCK(int, glob_b_block, const char*, int); + /* * glob(3) expansion limits. Stop the expansion if any of these limits * is reached. This caps the runtime in the face of DoS attacks. See @@ -179,9 +182,8 @@ static int err_aborted(glob_t *, int, char *); static void qprintf(const char *, Char *); #endif -int -glob(const char * __restrict pattern, int flags, - int (*errfunc)(const char *, int), glob_t * __restrict pglob) +static int +__glob(const char *pattern, glob_t *pglob) { struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; @@ -192,25 +194,23 @@ glob(const char * __restrict pattern, int flags, int too_long; patnext = pattern; - if (!(flags & GLOB_APPEND)) { + if (!(pglob->gl_flags & GLOB_APPEND)) { pglob->gl_pathc = 0; pglob->gl_pathv = NULL; - if (!(flags & GLOB_DOOFFS)) + if (!(pglob->gl_flags & GLOB_DOOFFS)) pglob->gl_offs = 0; } - if (flags & GLOB_LIMIT) { + if (pglob->gl_flags & GLOB_LIMIT) { limit.l_path_lim = pglob->gl_matchc; if (limit.l_path_lim == 0) limit.l_path_lim = GLOB_LIMIT_PATH; } - pglob->gl_flags = flags & ~GLOB_MAGCHAR; - pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; bufnext = patbuf; bufend = bufnext + MAXPATHLEN - 1; too_long = 1; - if (flags & GLOB_NOESCAPE) { + if (pglob->gl_flags & GLOB_NOESCAPE) { memset(&mbs, 0, sizeof(mbs)); while (bufnext <= bufend) { clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); @@ -250,15 +250,45 @@ glob(const char * __restrict pattern, int flags, return (err_nomatch(pglob, &limit, pattern)); *bufnext = EOS; - if (flags & GLOB_BRACE) + if (pglob->gl_flags & GLOB_BRACE) return (globexp0(patbuf, pglob, &limit, pattern)); else return (glob0(patbuf, pglob, &limit, pattern)); } +int +glob(const char * __restrict pattern, int flags, + int (*errfunc)(const char *, int), glob_t * __restrict pglob) +{ + int rv; + + pglob->gl_flags = flags & ~(GLOB_MAGCHAR | _GLOB_ERR_BLOCK); + pglob->gl_errfunc = errfunc; + rv = __glob(pattern, pglob); + pglob->gl_errfunc = NULL; + + return (rv); +} + +int +glob_b(const char * __restrict pattern, int flags, + glob_b_block block, glob_t * __restrict pglob) +{ + int rv; + + pglob->gl_flags = flags & ~GLOB_MAGCHAR; + pglob->gl_flags |= _GLOB_ERR_BLOCK; + pglob->gl_errblk = block; + rv = __glob(pattern, pglob); + pglob->gl_errblk = NULL; + + return (rv); +} + static int globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, - const char *origpat) { + const char *origpat) +{ int rv; size_t oldpathc; @@ -724,7 +754,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_last, return (GLOB_NOSPACE); } *pathend = EOS; - if (pglob->gl_errfunc != NULL && + if ((pglob->gl_errfunc != NULL || pglob->gl_errblk != NULL) && g_Ctoc(pathbuf, buf, sizeof(buf))) { errno = E2BIG; return (GLOB_NOSPACE); @@ -1085,10 +1115,20 @@ err_nomatch(glob_t *pglob, struct glob_limit *limit, const char *origpat) { } static int -err_aborted(glob_t *pglob, int err, char *buf) { - if ((pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, err)) || - (pglob->gl_flags & GLOB_ERR)) +err_aborted(glob_t *pglob, int err, char *buf) +{ + int rv = 0; + + if ((pglob->gl_flags & _GLOB_ERR_BLOCK) != 0) { + if (pglob->gl_errblk != NULL) + rv = CALL_BLOCK(pglob->gl_errblk, buf, errno); + } else if (pglob->gl_errfunc != NULL) { + rv = pglob->gl_errfunc(buf, errno); + } + /* GLOB_ERR is allowed to override the error callback function. */ + if (rv != 0 || pglob->gl_flags & GLOB_ERR) { return (GLOB_ABORTED); + } return (0); } From nobody Mon Jun 2 09:33:16 2025 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 4b9pYS45Pqz5xnHW; Mon, 02 Jun 2025 09:33: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 4b9pYS1Yx1z46G2; Mon, 02 Jun 2025 09:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748856796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lc7hrGnF/GhhV5NWDowAoGDtSI50aMAGD9qM55Rl1o0=; b=olk0cEi69qIB1R7iOKG67csaE5on6EpfOrhgget79pK/n8SeYUGZo6e3nciqlOFQKP/r71 damjfray8kt3viR5DbymozQjKTBWDcW6tM2GQ8xGQAyiBl5eJ2EjgFR15X+bqj4zKfMeh0 4ULcA6OVgYgRBC9lrZqU+Jzp5DGg5c2ZqN+fLTmBlhhW7hzpYpl9/hrZWTLja3iqu2m8fz vm2XSrh4jPS6ZU18qTCnRr5XrmIoiyjfIiu/Hp73ksMCbO/Oiw970uPuo2Pv/9HcJ+vmW/ A2nZKPbIXM+m4h+KVVVkactlKor2m/qQyR2cnMy8ntDONe4TFrJgzWp45RQG4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748856796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lc7hrGnF/GhhV5NWDowAoGDtSI50aMAGD9qM55Rl1o0=; b=bJCaK5SElMkVJSaVIgh9K0zyD1gr9VaC7giFHuF5ek98Sgv7skJ0yXGHkk2rWDer68HA2K jzI6EidNf1jehMYAY15J8rmOvSPf0MO8vIMuT3vDzdNteCS3bYxW7PmOZZN9nWwdcc8wdI bU5LC/AiAboQtfcnTSbiJccnidbw14+ocGk63TUQirZvsxRIg5KAoHWm5P2RWkiwkMDWgD 6FESuiod9EqU5QT8ua/OekhPNE/RIBOolXTi/Kkmfi8QqXJSOrzAUn9OIxrGwaemqocGQD uY/BPVfo+wNoCpdy1IeWEqVWXXCvjkXXyv9W/zGO4sYC1PDS7F4zhhdeRDEYRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748856796; a=rsa-sha256; cv=none; b=GFN2jgOGg4hmoIU8KFbctRmkCra09PFg1A19/G+PiN3N5qQJiq1dUZ5YZWD4D78Uw1dYMf s/iwfwsoLvv3FBAJHS6LMUbjPDleW7TfkdxGtOvDkcezN0+jImOsR19grxxV5yBS2YBHMN x+9PRfJUEP6tovyMIwJZOpnRGkulHtP8znJTN0TePtLvwGFVrMhqyHAnNkYQ41FdX0Cog9 hH0vfwqAVieEOU9JqI/tK0h9Mb7BDLYaucwh/AqkeLipUVdIY3znSqNrwIfUCBKpgxA9H1 aHuQQCzSTo2AKmbBz1Ft7G/aukkY0STmrtD4Y/eSuqYiuikSuYkBa0He5hG3ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9pYS17mZz13lX; Mon, 02 Jun 2025 09:33: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 5529XGsB083143; Mon, 2 Jun 2025 09:33:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5529XGe2083140; Mon, 2 Jun 2025 09:33:16 GMT (envelope-from git) Date: Mon, 2 Jun 2025 09:33:16 GMT Message-Id: <202506020933.5529XGe2083140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 4d7c31bca252 - main - glob2_test: Add tests for error callback functions and blocks 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: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d7c31bca252fbbd0808875cf0ad87fc0d91278f Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=4d7c31bca252fbbd0808875cf0ad87fc0d91278f commit 4d7c31bca252fbbd0808875cf0ad87fc0d91278f Author: Bojan Novković AuthorDate: 2025-05-23 13:26:34 +0000 Commit: Bojan Novković CommitDate: 2025-06-02 09:32:55 +0000 glob2_test: Add tests for error callback functions and blocks This change adds tests that check basic callback functionality for blocks and function pointers. The tests also make sure that GLOB_ERR overrides the callback's return value. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50486 --- lib/libc/tests/gen/Makefile | 5 ++- lib/libc/tests/gen/glob2_test.c | 60 ++++++++++++++++++++++++++++++++++- lib/libc/tests/gen/glob_blocks_test.c | 49 ++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 2 deletions(-) diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index 2aff14f078bc..006512d30dc4 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -15,6 +15,9 @@ ATF_TESTS_C+= ftw_test ATF_TESTS_C+= getentropy_test ATF_TESTS_C+= getmntinfo_test ATF_TESTS_C+= glob2_test +.if ${COMPILER_FEATURES:Mblocks} +ATF_TESTS_C+= glob_blocks_test +.endif ATF_TESTS_C+= makecontext_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test @@ -97,7 +100,7 @@ TESTS_SUBDIRS= execve TESTS_SUBDIRS+= posix_spawn # Tests that require blocks support -.for t in fts_blocks_test +.for t in fts_blocks_test glob_blocks_test CFLAGS.${t}.c+= -fblocks LIBADD.${t}+= BlocksRuntime .endfor diff --git a/lib/libc/tests/gen/glob2_test.c b/lib/libc/tests/gen/glob2_test.c index 8f69c36fece7..45d17b063593 100644 --- a/lib/libc/tests/gen/glob2_test.c +++ b/lib/libc/tests/gen/glob2_test.c @@ -25,6 +25,8 @@ */ #include +#include + #include #include #include @@ -36,6 +38,8 @@ #include +static int glob_callback_invoked; + /* * Derived from Russ Cox' pathological case test program used for the * https://research.swtch.com/glob article. @@ -102,10 +106,64 @@ ATF_TC_BODY(glob_pathological_test, tc) } } +ATF_TC(glob_period); +ATF_TC_HEAD(glob_period, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test behaviour when matching files that start with a period" + "(documented in the glob(3) CAVEATS section)."); +} +ATF_TC_BODY(glob_period, tc) +{ + int i; + glob_t g; + + atf_utils_create_file(".test", ""); + glob(".", 0, NULL, &g); + ATF_REQUIRE_MSG(g.gl_matchc == 1, + "glob(3) shouldn't match files starting with a period when using '.'"); + for (i = 0; i < g.gl_matchc; i++) + printf("%s\n", g.gl_pathv[i]); + glob(".*", 0, NULL, &g); + ATF_REQUIRE_MSG(g.gl_matchc == 3 && strcmp(g.gl_pathv[2], ".test") == 0, + "glob(3) should match files starting with a period when using '.*'"); +} + +static int +errfunc(const char *path, int err) +{ + ATF_REQUIRE_STREQ(path, "test/"); + ATF_REQUIRE(err == EACCES); + glob_callback_invoked = 1; + /* Suppress EACCES errors. */ + return (0); +} + +ATF_TC_WITHOUT_HEAD(glob_callback_test); +ATF_TC_BODY(glob_callback_test, tc) +{ + int rv; + glob_t g; + + glob_callback_invoked = 0; + ATF_REQUIRE_EQ(0, mkdir("test", 0007)); + rv = glob("test/*", 0, errfunc, &g); + ATF_REQUIRE_MSG(glob_callback_invoked == 1, + "glob(3) failed to invoke callback function"); + ATF_REQUIRE_MSG(rv == GLOB_NOMATCH, + "error callback function failed to suppress EACCES"); + + /* GLOB_ERR should ignore the suppressed error. */ + rv = glob("test/*", GLOB_ERR, errfunc, &g); + ATF_REQUIRE_MSG(rv == GLOB_ABORTED, + "GLOB_ERR didn't override error callback function"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, glob_pathological_test); - + ATF_TP_ADD_TC(tp, glob_period); + ATF_TP_ADD_TC(tp, glob_callback_test); return (atf_no_error()); } diff --git a/lib/libc/tests/gen/glob_blocks_test.c b/lib/libc/tests/gen/glob_blocks_test.c new file mode 100644 index 000000000000..a20aad17ce31 --- /dev/null +++ b/lib/libc/tests/gen/glob_blocks_test.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include +#include + +#include + +static int glob_callback_invoked; + +ATF_TC_WITHOUT_HEAD(glob_b_callback_test); +ATF_TC_BODY(glob_b_callback_test, tc) +{ + int rv; + glob_t g; + + glob_callback_invoked = 0; + ATF_REQUIRE_EQ(0, mkdir("test", 0007)); + int (^errblk)(const char *, int) = + ^(const char *path, int err) { + ATF_REQUIRE_STREQ(path, "test/"); + ATF_REQUIRE(err == EACCES); + glob_callback_invoked = 1; + /* Suppress EACCES errors. */ + return (0); + }; + + rv = glob_b("test/*", 0, errblk, &g); + ATF_REQUIRE_MSG(glob_callback_invoked == 1, + "glob(3) failed to invoke callback block"); + ATF_REQUIRE_MSG(rv == GLOB_NOMATCH, + "error callback function failed to suppress EACCES"); + + /* GLOB_ERR should ignore the suppressed error. */ + rv = glob_b("test/*", GLOB_ERR, errblk, &g); + ATF_REQUIRE_MSG(rv == GLOB_ABORTED, + "GLOB_ERR didn't override error callback block"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, glob_b_callback_test); + return (atf_no_error()); +} From nobody Mon Jun 2 10:42:00 2025 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 4b9r4m2j5kz5xs7G; Mon, 02 Jun 2025 10:42: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 4b9r4m1jpSz3gSH; Mon, 02 Jun 2025 10:42:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748860920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vmTswQHAYJdR1jU8xNnErb1tVHP4zeNIf6CYOldpwM8=; b=a06devoQAYcpRlyqTPA93z6GzXGxdM+5L1ikGL05ZSk+jCOavWVgZGaBrhRKQjjnjorWIs 8KB9UtBtrWoyxSJq2snVjCCJv//MLeiz8pzVHxMdBy8QEPKndm9tJiURHCgQcCSDbIAZL7 AWQk677Nw82NdTINe7wZpTgfT+qlG8w5/i+CHbkRwFTQRlPSGCRmbrQGzzIPjZZ/0p4bfZ pYJ+8td7cgLuFYzoIlGRd7g7QTpuwfrIN7ElJD8VCJhFM6NWBwI/rUaOxsbET4clHgIT4t yZc/75OYohfU5ls2IG/CykCJEgg2TNigz5gK1MTMPxjTmBMqApGI2SOabQHudQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748860920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vmTswQHAYJdR1jU8xNnErb1tVHP4zeNIf6CYOldpwM8=; b=MocwYzDaoGRQY+yY5nNFh+723vTOHocBm/Yr3gGRPEuTdVr+ZLETRih9Tkc4B5pWUEzoZN dK7/I7QWsEYWt6+cfoounCInQZt2lFIqxAamVT2wrgI/Zt1PzQLUTi/BIZzBIoE4alte1V X0ZCT92KveewQ2obovtROhyk1S4NfHiMvezDQtVlhCqgISzhQ49Ia0AGi9kDQ6rnLQc/KP fW97sIa/kgCSUEPOQtjvRGYgwJoXJcxZuKkifzMeH2PrnHSwbka7TYlVyfsoD9mQO4LS/n El7G+cVmGAC6pUATsGOVK/Fx3vHJWus+AruSm/fmojE7g0bNUdr/TDf2ZfhMaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748860920; a=rsa-sha256; cv=none; b=LcNTeXvCp7RIQJ+14U6QLcTL1YiWhl1bFUunReGaYgli6StTfnMCnpgvCFhSlwWAw3oP+N Yi0BXjZi0ureI/ZhAc7WsTs1hqXI/Q65jFT2xMsaJ0wvZfYFyNFdkXBeMmMu2izbM+7WmW CL0KuLEXy7T559ScwxPlM28nyFMBjVLw8EYAmTtRq54mmofdBzeu55V1zzH1i4hGY3Fbfp tKt62g7WXq7ochGAj6zzyETI/8l02JaDmqJ56wjwVimjuqNnjCaRjta2jh8refKLTA1pDl fwUUZitY7eZn3uTphXDcvEFaVLKvRYG4wWCODlYGZdBpBhoufgQ3fxnE4tdqIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9r4m197pz14WG; Mon, 02 Jun 2025 10:42:00 +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 552Ag0qT012378; Mon, 2 Jun 2025 10:42:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552Ag0TJ012375; Mon, 2 Jun 2025 10:42:00 GMT (envelope-from git) Date: Mon, 2 Jun 2025 10:42:00 GMT Message-Id: <202506021042.552Ag0TJ012375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 2aeac25bcb72 - main - arm64: Add a function to restrict the ID registers 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2aeac25bcb72723d436721ab97bb2fd6df3dfb9b Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2aeac25bcb72723d436721ab97bb2fd6df3dfb9b commit 2aeac25bcb72723d436721ab97bb2fd6df3dfb9b Author: Andrew Turner AuthorDate: 2025-06-02 09:56:59 +0000 Commit: Andrew Turner CommitDate: 2025-06-02 09:56:59 +0000 arm64: Add a function to restrict the ID registers This will be used when we need to restrict the register values, e.g. when an erratum is present that means we need to disable a feature we will need to remove some fields from these registers. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50572 --- sys/arm64/arm64/identcpu.c | 131 ++++++++++++++++++++++++++++++++------------- sys/arm64/include/cpu.h | 1 + 2 files changed, 94 insertions(+), 38 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index fe10e0eb551a..6dc9c447ee29 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -51,6 +51,9 @@ static MALLOC_DEFINE(M_IDENTCPU, "CPU ID", "arm64 CPU identification memory"); struct cpu_desc; +#ifdef INVARIANTS +static bool hwcaps_set = false; +#endif static void print_cpu_midr(struct sbuf *sb, u_int cpu); static void print_cpu_features(u_int cpu, struct cpu_desc *desc, @@ -2594,13 +2597,62 @@ update_special_reg_field(uint64_t user_reg, u_int type, uint64_t value, return (user_reg); } +static void +clear_set_special_reg_idx(int idx, uint64_t clear, uint64_t set) +{ + const struct mrs_field *fields; + uint64_t k_old, k_new; + uint64_t f_old, f_new; + uint64_t l_old, l_new; + + MPASS(idx < nitems(user_regs)); + + k_old = CPU_DESC_FIELD(kern_cpu_desc, idx); + k_new = (k_old & ~clear) | set; + + f_old = CPU_DESC_FIELD(user_cpu_desc, idx); + f_new = (f_old & ~clear) | set; + + l_old = CPU_DESC_FIELD(l_user_cpu_desc, idx); + l_new = (l_old & ~clear) | set; + + fields = user_regs[idx].fields; + for (int j = 0; fields[j].type != 0; j++) { + u_int type; + + /* Update the FreeBSD userspace ID register view */ + type = ((fields[j].type & MRS_FREEBSD) != 0) ? + fields[j].type : + (MRS_EXACT | (fields[j].type & MRS_SAFE_MASK)); + f_new = update_special_reg_field(f_new, + type, f_old, fields[j].width, fields[j].shift, + fields[j].sign); + + /* Update the Linux userspace ID register view */ + type = ((fields[j].type & MRS_LINUX) != 0) ? + fields[j].type : + (MRS_EXACT | (fields[j].type & MRS_SAFE_MASK)); + l_new = update_special_reg_field(l_new, + type, l_old, fields[j].width, fields[j].shift, + fields[j].sign); + + /* Update the kernel ID register view */ + k_new = update_special_reg_field(k_new, + fields[j].type, k_old, fields[j].width, + fields[j].shift, fields[j].sign); + } + + CPU_DESC_FIELD(kern_cpu_desc, idx) = k_new; + CPU_DESC_FIELD(user_cpu_desc, idx) = f_new; + CPU_DESC_FIELD(l_user_cpu_desc, idx) = l_new; +} + void update_special_regs(u_int cpu) { struct cpu_desc *desc; - const struct mrs_field *fields; - uint64_t l_user_reg, user_reg, kern_reg, value; - int i, j; + uint64_t value; + int i; if (cpu == 0) { /* Create a user visible cpu description with safe values */ @@ -2618,44 +2670,42 @@ update_special_regs(u_int cpu) for (i = 0; i < nitems(user_regs); i++) { value = CPU_DESC_FIELD(*desc, i); if (cpu == 0) { - kern_reg = value; - user_reg = value; - l_user_reg = value; - } else { - kern_reg = CPU_DESC_FIELD(kern_cpu_desc, i); - user_reg = CPU_DESC_FIELD(user_cpu_desc, i); - l_user_reg = CPU_DESC_FIELD(l_user_cpu_desc, i); + CPU_DESC_FIELD(kern_cpu_desc, i) = value; + CPU_DESC_FIELD(user_cpu_desc, i) = value; + CPU_DESC_FIELD(l_user_cpu_desc, i) = value; } - fields = user_regs[i].fields; - for (j = 0; fields[j].type != 0; j++) { - u_int type; - - /* Update the FreeBSD userspace ID register view */ - type = ((fields[j].type & MRS_FREEBSD) != 0) ? - fields[j].type : - (MRS_EXACT | (fields[j].type & MRS_SAFE_MASK)); - user_reg = update_special_reg_field(user_reg, - type, value, fields[j].width, fields[j].shift, - fields[j].sign); - - /* Update the Linux userspace ID register view */ - type = ((fields[j].type & MRS_LINUX) != 0) ? - fields[j].type : - (MRS_EXACT | (fields[j].type & MRS_SAFE_MASK)); - l_user_reg = update_special_reg_field(l_user_reg, - type, value, fields[j].width, fields[j].shift, - fields[j].sign); - - /* Update the kernel ID register view */ - kern_reg = update_special_reg_field(kern_reg, - fields[j].type, value, fields[j].width, - fields[j].shift, fields[j].sign); - } + clear_set_special_reg_idx(i, UINT64_MAX, value); + } +} + +/* + * Updates a special register in all views. This creates a copy of the + * register then clears it and sets new bits. It will then compare this + * with the old version as if it was the ID register for a new CPU. + * + * It is intended to let code that disables features, e.g. due to errata, + * to clear the user visible field. + * + * This needs to be called before the HWCAPs are set. If called from a CPU + * feature handler this safe to call from CPU_FEAT_EARLY_BOOT. It also needs + * to be before link_elf_late_ireloc is called. As this is called after the + * HWCAPs are set the check for these is enough. + */ +void +update_special_reg(u_int reg, uint64_t clear, uint64_t set) +{ + MPASS(hwcaps_set == false); + /* There is no locking here, so we only support changing this on CPU0 */ + /* TODO: Add said locking */ + MPASS(PCPU_GET(cpuid) == 0); + + for (int i = 0; i < nitems(user_regs); i++) { + if (user_regs[i].reg != reg) + continue; - CPU_DESC_FIELD(kern_cpu_desc, i) = kern_reg; - CPU_DESC_FIELD(user_cpu_desc, i) = user_reg; - CPU_DESC_FIELD(l_user_cpu_desc, i) = l_user_reg; + clear_set_special_reg_idx(i, clear, set); + return; } } @@ -2757,6 +2807,11 @@ identify_cpu_sysinit(void *dummy __unused) prev_desc = desc; } +#ifdef INVARIANTS + /* Check we dont update the special registers after this point */ + hwcaps_set = true; +#endif + /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ parse_cpu_features(true, &user_cpu_desc, &elf_hwcap, &elf_hwcap2); parse_cpu_features(true, &l_user_cpu_desc, &linux_elf_hwcap, diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 91ed3634c6d8..df38c69fdb30 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -232,6 +232,7 @@ void ptrauth_mp_start(uint64_t); /* Functions to read the sanitised view of the special registers */ void update_special_regs(u_int); +void update_special_reg(u_int reg, uint64_t, uint64_t); bool extract_user_id_field(u_int, u_int, uint8_t *); bool get_kernel_reg(u_int, uint64_t *); bool get_kernel_reg_masked(u_int, uint64_t *, uint64_t); From nobody Mon Jun 2 10:42:01 2025 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 4b9r4n5lFVz5xsDB; Mon, 02 Jun 2025 10:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9r4n2VrVz3gbk; Mon, 02 Jun 2025 10:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748860921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNZVG0Bj7jp9eAKTU/SUZko6piaxsE2H9fHd99ddPd8=; b=xFZHQM93hmkxbsV2en/TUMSj9HI9424ooGc0G8gTXkOyEDRJ2aNrJxxJh3QRkPtA3eDClU OHaTmFYQtoJBmzmoQigP0FLj5tWI75Hk8jf89LBvtEuASQLXp0aNeIIVt6BP/8AOTUjIFP YUJWr9Ai4BjVvY52Bh4gUfXZY6x3JtcnHfvYW9VcoSAGVw/sBjYImqBI2lKZCYE9Ze5MhV HlsnQVJnu482toU7t886W3iejPtzqwy1R2n/8xBXBaL11BE+yYY9xm58mGxiXuRzaQTvTl K1MnyUbtfaqbCag50juxkaKN3Na/1iwza3vY6TpNFD26V+xjW/gDGfZtI/HYhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748860921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNZVG0Bj7jp9eAKTU/SUZko6piaxsE2H9fHd99ddPd8=; b=aa1kbenccjHDgw4RmmQSRfc9Ic3JOW70/SOjwDFeywVAEMHHqiHVuHMculsNl9ijoLDw6G hVUgz1oYznEOUIkKYqSdfgwQpqokZrG8Rpw3v/zyEu6nSfYS5EEVeZBoLL6Mby4Eb7kLMW DjN+Rw++UfkfcCeq6Xw7sKTgBvgqk9nQXenCYARcKxuOlEVA7X1jKBwVFtqyit+pUxwXqZ nRNkp3T40TwSi2IvM9yY8/rYpljBR7wMAblLT+Ih3RPK3CaA3wzpQNau5TGXSlF3PUx4uX fMdgatIvgxrQXnfCfAVGO8Udhmtq6zi+wkxIT03jW0IZa2w2fGXU9dgLO5yU7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748860921; a=rsa-sha256; cv=none; b=nDYvYzjJRhgeghbRpytSf4VeHoEmodElKEQ2MBARe+9A5NfUqH+Hm2rWc7AqzNdMMe4HXS A4tXXP77GCKq4IPP4c2iWNqgTKPAApeCE6AvRRyaXvJfb1Kg6mKnDAsLbuibbsjTWnOSMY MlZftq6brOhB7idPOoBLBRmgKn8+gsaRRmguKpLcxlcEawY1BRu/k2KKJ+lXghehvsCsBy lQmdbg659R8lvFpuQSxm5M43kkk9+pUnGhUjiUGQHD7uK81TNw/Ed4n/YoS7ZKbsI1rvjZ wbl3CnZbKjuGSZ7xTQfuwzK6mWxarA59ICWFu246fwbJ+dmU+SIeUAS/K+GcmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9r4n25zPz151t; Mon, 02 Jun 2025 10:42:01 +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 552Ag1NM012414; Mon, 2 Jun 2025 10:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552Ag1Og012412; Mon, 2 Jun 2025 10:42:01 GMT (envelope-from git) Date: Mon, 2 Jun 2025 10:42:01 GMT Message-Id: <202506021042.552Ag1Og012412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 89bb17ec3b02 - main - arm64: Mask out the PAC ID fields when disabled 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89bb17ec3b0260fa0d9c30a23b7e5f73fc5917f4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=89bb17ec3b0260fa0d9c30a23b7e5f73fc5917f4 commit 89bb17ec3b0260fa0d9c30a23b7e5f73fc5917f4 Author: Andrew Turner AuthorDate: 2025-06-02 09:57:44 +0000 Commit: Andrew Turner CommitDate: 2025-06-02 09:57:44 +0000 arm64: Mask out the PAC ID fields when disabled When we disable PAC we need to mask out the ID registers for userspace. Call update_special_reg to mask them out so userspace gets a correct view of the registers and hwcaps. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50573 --- sys/arm64/arm64/ptrauth.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/ptrauth.c b/sys/arm64/arm64/ptrauth.c index 7ef958b2e03c..dd36e66c85bb 100644 --- a/sys/arm64/arm64/ptrauth.c +++ b/sys/arm64/arm64/ptrauth.c @@ -97,14 +97,14 @@ ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) if (!pac_enable) { if (boothowto & RB_VERBOSE) printf("Pointer authentication is disabled\n"); - return (false); + goto out; } if (!get_kernel_reg(ID_AA64ISAR1_EL1, &isar1)) - return (false); + goto out; if (ptrauth_disable()) - return (false); + goto out; /* * This assumes if there is pointer authentication on the boot CPU @@ -113,6 +113,12 @@ ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) */ return (ID_AA64ISAR1_APA_VAL(isar1) > 0 || ID_AA64ISAR1_API_VAL(isar1) > 0); + +out: + update_special_reg(ID_AA64ISAR1_EL1, ID_AA64ISAR1_API_MASK | + ID_AA64ISAR1_APA_MASK | ID_AA64ISAR1_GPA_MASK | + ID_AA64ISAR1_GPI_MASK, 0); + return (false); } static void From nobody Mon Jun 2 10:41:59 2025 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 4b9r4w2fLMz5xsDK; Mon, 02 Jun 2025 10:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_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 4b9r4v61jZz3h6D; Mon, 02 Jun 2025 10:42:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 552Afxxx098843; Mon, 2 Jun 2025 13:42:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 552Afxxx098843 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 552Afx1p098842; Mon, 2 Jun 2025 13:41:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 2 Jun 2025 13:41:59 +0300 From: Konstantin Belousov To: Bojan =?utf-8?B?Tm92a292acSH?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1e0743f54d2d - main - glob: Add blocks support Message-ID: References: <202506020933.5529XEpk083101@gitrepo.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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202506020933.5529XEpk083101@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4b9r4v61jZz3h6D 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:6939, ipnet:2001:470::/32, country:US] On Mon, Jun 02, 2025 at 09:33:14AM +0000, Bojan Novković wrote: > The branch main has been updated by bnovkov: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1e0743f54d2d3624cd4de2167d373aa38597778e > > commit 1e0743f54d2d3624cd4de2167d373aa38597778e > Author: Bojan Novković > AuthorDate: 2025-05-23 13:26:04 +0000 > Commit: Bojan Novković > CommitDate: 2025-06-02 09:32:50 +0000 > > glob: Add blocks support > > This change introduces the `glob_b` function which takes a block instead > of a function pointer. > > Relnotes: yes > Sponsored by: Klara, Inc. > Inspired by: https://github.com/apple-oss-distributions/Libc > Differential Revision: https://reviews.freebsd.org/D50485 > --- > include/glob.h | 16 +++++++++-- > lib/libc/gen/Makefile.inc | 1 + > lib/libc/gen/Symbol.map | 1 + > lib/libc/gen/glob.3 | 66 ++++++++++++++++++++++++++++++++++++++------ > lib/libc/gen/glob.c | 70 +++++++++++++++++++++++++++++++++++++---------- > 5 files changed, 128 insertions(+), 26 deletions(-) > > diff --git a/include/glob.h b/include/glob.h > index dc86cdf99929..cbe99bfef6ed 100644 > --- a/include/glob.h > +++ b/include/glob.h > @@ -50,8 +50,15 @@ typedef struct { > size_t gl_offs; /* Reserved at beginning of gl_pathv. */ > int gl_flags; /* Copy of flags parameter to glob. */ > char **gl_pathv; /* List of paths matching pattern. */ > - /* Copy of errfunc parameter to glob. */ > - int (*gl_errfunc)(const char *, int); > + /* Copy of error callback parameter to glob. */ > + union { > + int (*gl_errfunc)(const char *, int); > +#ifdef __BLOCKS__ > + int (^gl_errblk)(const char *, int); > +#else > + void *gl_errblk; > +#endif > + }; > > /* > * Alternate filesystem access methods for glob; replacement > @@ -90,6 +97,7 @@ typedef struct { > #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ > #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ > #define GLOB_LIMIT 0x1000 /* limit number of returned paths */ > +#define _GLOB_ERR_BLOCK 0x08000000 /* (internal) error callback is a block */ > > /* source compatibility, these are the old names */ > #define GLOB_MAXPATH GLOB_LIMIT > @@ -99,6 +107,10 @@ typedef struct { > __BEGIN_DECLS > int glob(const char * __restrict, int, > int (*)(const char *, int), glob_t * __restrict); > +#ifdef __BLOCKS__ > +int glob_b(const char * __restrict, int, > + int (^)(const char *, int), glob_t * __restrict); > +#endif glob.h is POSIX header, the non-standard prototype visibility must be limited. From nobody Mon Jun 2 12:56:40 2025 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 4b9v486g2vz5y27R; Mon, 02 Jun 2025 12:56: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 4b9v485kn9z3wQk; Mon, 02 Jun 2025 12:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748869000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXAuuQgPQ/U6Hwu/fUXX+pOREfXM8pKAlJtDKTepUms=; b=ckSlMCuPOoa3E2xfm2n+8z7+8UbPXVtk3Rj+IGJDY8TKE93m00wMMWTUtdb/U9o8RLQ7Bx XNYszHIGdALueO9SidMXQMcAgdwzf/bruiz6+P18/mBR8jVYa1htjpJw4uzeBDlzld236T QOaYmhpooD4TenHuFrVt+WYo0Pj3ZY/E9KMiMvqGZ30uncvcTO7mGFCJ48malP3OkAAI1N OsYH2NWiZ7PgB4vq/UBbIPnMuTiXYjv7SRUVa9vCagFjsrb/7e3t4fhbJwrst3Up0KI6sI o9JPuPg0TuQ/OrCp5v8H8iSfr/WPpVQSrndInzOYKQfOvDYPHlBbljVAG50/DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748869000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXAuuQgPQ/U6Hwu/fUXX+pOREfXM8pKAlJtDKTepUms=; b=UdyvQqqOErPOQaaA7qXSwl9TwLnnT3Jz2lhWPRU64O7LklG+6qzb9gTn65fcZbDslXiXTj N57m6ATd3zOPX7JwC//MxnB13te3jj6YjS0pUjDj3g2LCmLsaKT+Ma+NfTx61fzsRsWToT wDNs8Pm1c8l6OpvuACCV2j39WzT/UKXjSHtM8+sSTzd7NhdIjNQYRMw1vO4V2F8y2hGITb 62TO4wvhXk88BOO7xpb9YH2tdMyiGA7TPKaqZTHOQ7UCYXME7b+bWQyazZzd+m2L/f1CvK dAC40iU71PksHCxAxGfn69t755PY8mLEPWEQ96plF4d9G9IcZZpdZNlVEka2IQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748869000; a=rsa-sha256; cv=none; b=vQA/Vwc6rWKLd5oYM1T+si/B/3Q+BZ1t2EVQTRBrkPMlU5+Ik0FOrnnDSxogsRJ9R1jnPo UHC9tZ0jSMbrkJgajM3cICAgHdym5w5S18ROYfIVMFW8Nv7nKaeQn5uF2nexXcuFHw4lCe izPT0snx/JrP9qdr+QrzU3RcUfA9zVXlERz1GZNf3IRT/izqIdAqROw3Bo9Vj/JiDIebak ypjJSUtjmU3lSLLKYy7c4nCPWkxodxBBTaFEsTwDRqpIU31AYCMcnBmPKUrQlza+rI16c6 uKTZ3j3Db3WSgz5eviULMEGY05KzteABjejoeORrw6yo9HE7CzBrZlRvyQ67Eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9v485GdYz18GY; Mon, 02 Jun 2025 12:56: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 552CueWR058919; Mon, 2 Jun 2025 12:56:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552CueJW058916; Mon, 2 Jun 2025 12:56:40 GMT (envelope-from git) Date: Mon, 2 Jun 2025 12:56:40 GMT Message-Id: <202506021256.552CueJW058916@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: 331f2c1c4658 - main - libarchive: fix duplicate entry in tests Makefile 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: 331f2c1c46584510fa9104c86f31f44ece3838c5 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=331f2c1c46584510fa9104c86f31f44ece3838c5 commit 331f2c1c46584510fa9104c86f31f44ece3838c5 Author: Martin Matuska AuthorDate: 2025-06-02 12:55:00 +0000 Commit: Martin Matuska CommitDate: 2025-06-02 12:56:05 +0000 libarchive: fix duplicate entry in tests Makefile Reported by: des MFC after: 2 weeks (together with 2e113ef82) --- lib/libarchive/tests/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index fb20d954537e..07c5fe24dd30 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -493,7 +493,6 @@ ${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm64.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_powerpc.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_riscv.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_sparc.7z.uu -${PACKAGE}FILES+= test_read_format_7zip_lzma2_powerpc.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_malformed.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_malformed2.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_packinfo_digests.7z.uu From nobody Mon Jun 2 15:13:19 2025 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 4b9y5q1Mp4z5wx9c; Mon, 02 Jun 2025 15:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9y5q15XKz40w1; Mon, 02 Jun 2025 15:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748877199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMra9dXvQlS8AqKmkx4+lXBjMp4q2lh8ABX2VBLHOms=; b=g6tjp2SkrfVXdI2s/e32OSjONnl96maXL6cHQYM3sRlf5fPU+g1OOx3q/ZzAMlUdfMgzKl LeWJXnJUWO5NZzr2X4CyyXPQg8+brqMV8oBlDntZJCHVEpATGiIM6Ri8VjjFI+TNAWIIAE sOG1C4haStD2Hqh/Pw3EP+ZfXC/g3A19fta2vpGwLtAMy63Q/ljrW2xWGcwvj82KPZtQSm cBZQY/Za8Ps21JR1BUK11ZjVi+H5Gow0islyxUTabsUXH+iv+diBQZLEbymCeIsBt2S99y LW6L3tJ6riI28sHpO2WCOlm9vBCl8uZUgf7xBfYQ4j8kgPgjVsWYBXclx0+jiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748877199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMra9dXvQlS8AqKmkx4+lXBjMp4q2lh8ABX2VBLHOms=; b=HODblJPA2E1UaT0Yu+gVRZLiiVcx9nbqAzZ2yGOTXC3Ne3/4+wtuVxYKKRQ5SmzYVdX0w6 sHXFI3QiCnmS2J0/9s/WjzjcUqhWIVeX3xYgX7tMLqzlY8aQcy9rijOw4Tav6wc+LuWhve 2k62dvcUYAkUtJnlGUkR30KyDKuVh+sVnNBQqC5NVwTZivyZr5iEGgKB26PDhYfzB4N2rw 1N6R+IZg7oB/zQ1m/2/I0SvX5qQ/54dgn/pMPBd9a8ttrFR+cL27yt7q1/gr7ha0Jmwqy8 wYlqsoRVQnjBAwlqgy34stgpjmCvMu4fmeQ0OlgYq+zZBBco8AboXurPVIOqkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748877199; a=rsa-sha256; cv=none; b=TqOZKadz9ub7vULhGhUyX/BcvSrPI9/2EM6v8SpViCcx4YtMUOSyWIxSENRLbMjO59y+19 iWAecuRcGomEL/A1ZtJoNPnSjAHQLmOeZFCtUlTs23b2OeD3aMxmzpN4I3Xer6IDfWwc7I HY8hdFwP69oPymgySDFBEfFpMyWTbojrC9/KxNQWdLolZ+hlZLDEBMCfI8sJqv1idha5RM YemDfkl8a0EFtkqPvWWewDeZiLF9eTLOxQ6aHIH0dt82ksVYKZzNhOTZZGJ+rWz96bWGWe m/LEeVmz3Y8/WyX2DLJ+ASSAH5FOiHFq4NnrSRbpTzicmny0zWyxU4vnUYhaoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9y5q0g8jz1DB4; Mon, 02 Jun 2025 15:13:19 +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 552FDJa9019624; Mon, 2 Jun 2025 15:13:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FDJS4019621; Mon, 2 Jun 2025 15:13:19 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:13:19 GMT Message-Id: <202506021513.552FDJS4019621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f2a587b8b777 - main - cam nvme: Move opcode and status code tables from CTL to base CAM 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2a587b8b7779ac3adce38c5f34e08ddaef39cfb Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a587b8b7779ac3adce38c5f34e08ddaef39cfb commit f2a587b8b7779ac3adce38c5f34e08ddaef39cfb Author: John Baldwin AuthorDate: 2025-06-02 15:05:26 +0000 Commit: John Baldwin CommitDate: 2025-06-02 15:05:26 +0000 cam nvme: Move opcode and status code tables from CTL to base CAM This adds support for decoding admin opcodes to the existing opcode decoding and also removes one of the duplicate NVMe opcode string tables. - Add nvme_opcode_sbuf and nvme_cpl_sbuf which are CCB type-independent and handle the guts of the CTL-specific routines. - Use nvme_opcode_sbuf to decode the opcode in nvme_command_sbuf. - Add nvme_status_sbuf to decode the CPL/CQE in a ccb_nvmeio. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50631 --- sys/cam/ctl/ctl_nvme_all.c | 220 +---------------------------------- sys/cam/nvme/nvme_all.c | 282 +++++++++++++++++++++++++++++++++++++++------ sys/cam/nvme/nvme_all.h | 3 + 3 files changed, 254 insertions(+), 251 deletions(-) diff --git a/sys/cam/ctl/ctl_nvme_all.c b/sys/cam/ctl/ctl_nvme_all.c index 739efadf5614..2d868ff24833 100644 --- a/sys/cam/ctl/ctl_nvme_all.c +++ b/sys/cam/ctl/ctl_nvme_all.c @@ -14,231 +14,21 @@ #include #endif -#include +#include +#include #include #include -/* XXX: This duplicates lists in nvme_qpair.c. */ - -#define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x - -static const char *admin_opcode[256] = { - OPC_ENTRY(DELETE_IO_SQ), - OPC_ENTRY(CREATE_IO_SQ), - OPC_ENTRY(GET_LOG_PAGE), - OPC_ENTRY(DELETE_IO_CQ), - OPC_ENTRY(CREATE_IO_CQ), - OPC_ENTRY(IDENTIFY), - OPC_ENTRY(ABORT), - OPC_ENTRY(SET_FEATURES), - OPC_ENTRY(GET_FEATURES), - OPC_ENTRY(ASYNC_EVENT_REQUEST), - OPC_ENTRY(NAMESPACE_MANAGEMENT), - OPC_ENTRY(FIRMWARE_ACTIVATE), - OPC_ENTRY(FIRMWARE_IMAGE_DOWNLOAD), - OPC_ENTRY(DEVICE_SELF_TEST), - OPC_ENTRY(NAMESPACE_ATTACHMENT), - OPC_ENTRY(KEEP_ALIVE), - OPC_ENTRY(DIRECTIVE_SEND), - OPC_ENTRY(DIRECTIVE_RECEIVE), - OPC_ENTRY(VIRTUALIZATION_MANAGEMENT), - OPC_ENTRY(NVME_MI_SEND), - OPC_ENTRY(NVME_MI_RECEIVE), - OPC_ENTRY(CAPACITY_MANAGEMENT), - OPC_ENTRY(LOCKDOWN), - OPC_ENTRY(DOORBELL_BUFFER_CONFIG), - OPC_ENTRY(FABRICS_COMMANDS), - OPC_ENTRY(FORMAT_NVM), - OPC_ENTRY(SECURITY_SEND), - OPC_ENTRY(SECURITY_RECEIVE), - OPC_ENTRY(SANITIZE), - OPC_ENTRY(GET_LBA_STATUS), -}; - -static const char *nvm_opcode[256] = { - OPC_ENTRY(FLUSH), - OPC_ENTRY(WRITE), - OPC_ENTRY(READ), - OPC_ENTRY(WRITE_UNCORRECTABLE), - OPC_ENTRY(COMPARE), - OPC_ENTRY(WRITE_ZEROES), - OPC_ENTRY(DATASET_MANAGEMENT), - OPC_ENTRY(VERIFY), - OPC_ENTRY(RESERVATION_REGISTER), - OPC_ENTRY(RESERVATION_REPORT), - OPC_ENTRY(RESERVATION_ACQUIRE), - OPC_ENTRY(RESERVATION_RELEASE), - OPC_ENTRY(COPY), -}; - void ctl_nvme_command_string(struct ctl_nvmeio *ctnio, struct sbuf *sb) { - const char *s, *type; - - if (ctnio->io_hdr.io_type == CTL_IO_NVME_ADMIN) { - s = admin_opcode[ctnio->cmd.opc]; - type = "ADMIN"; - } else { - s = nvm_opcode[ctnio->cmd.opc]; - type = "NVM"; - } - if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, ctnio->cmd.opc); - else - sbuf_printf(sb, "%s", s); + nvme_opcode_sbuf(ctnio->io_hdr.io_type == CTL_IO_NVME_ADMIN, + ctnio->cmd.opc, sb); } -#define SC_ENTRY(x) [NVME_SC_ ## x] = #x - -static const char *generic_status[256] = { - SC_ENTRY(SUCCESS), - SC_ENTRY(INVALID_OPCODE), - SC_ENTRY(INVALID_FIELD), - SC_ENTRY(COMMAND_ID_CONFLICT), - SC_ENTRY(DATA_TRANSFER_ERROR), - SC_ENTRY(ABORTED_POWER_LOSS), - SC_ENTRY(INTERNAL_DEVICE_ERROR), - SC_ENTRY(ABORTED_BY_REQUEST), - SC_ENTRY(ABORTED_SQ_DELETION), - SC_ENTRY(ABORTED_FAILED_FUSED), - SC_ENTRY(ABORTED_MISSING_FUSED), - SC_ENTRY(INVALID_NAMESPACE_OR_FORMAT), - SC_ENTRY(COMMAND_SEQUENCE_ERROR), - SC_ENTRY(INVALID_SGL_SEGMENT_DESCR), - SC_ENTRY(INVALID_NUMBER_OF_SGL_DESCR), - SC_ENTRY(DATA_SGL_LENGTH_INVALID), - SC_ENTRY(METADATA_SGL_LENGTH_INVALID), - SC_ENTRY(SGL_DESCRIPTOR_TYPE_INVALID), - SC_ENTRY(INVALID_USE_OF_CMB), - SC_ENTRY(PRP_OFFET_INVALID), - SC_ENTRY(ATOMIC_WRITE_UNIT_EXCEEDED), - SC_ENTRY(OPERATION_DENIED), - SC_ENTRY(SGL_OFFSET_INVALID), - SC_ENTRY(HOST_ID_INCONSISTENT_FORMAT), - SC_ENTRY(KEEP_ALIVE_TIMEOUT_EXPIRED), - SC_ENTRY(KEEP_ALIVE_TIMEOUT_INVALID), - SC_ENTRY(ABORTED_DUE_TO_PREEMPT), - SC_ENTRY(SANITIZE_FAILED), - SC_ENTRY(SANITIZE_IN_PROGRESS), - SC_ENTRY(SGL_DATA_BLOCK_GRAN_INVALID), - SC_ENTRY(NOT_SUPPORTED_IN_CMB), - SC_ENTRY(NAMESPACE_IS_WRITE_PROTECTED), - SC_ENTRY(COMMAND_INTERRUPTED), - SC_ENTRY(TRANSIENT_TRANSPORT_ERROR), - - SC_ENTRY(LBA_OUT_OF_RANGE), - SC_ENTRY(CAPACITY_EXCEEDED), - SC_ENTRY(NAMESPACE_NOT_READY), - SC_ENTRY(RESERVATION_CONFLICT), - SC_ENTRY(FORMAT_IN_PROGRESS), -}; - -static const char *command_specific_status[256] = { - SC_ENTRY(COMPLETION_QUEUE_INVALID), - SC_ENTRY(INVALID_QUEUE_IDENTIFIER), - SC_ENTRY(MAXIMUM_QUEUE_SIZE_EXCEEDED), - SC_ENTRY(ABORT_COMMAND_LIMIT_EXCEEDED), - SC_ENTRY(ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED), - SC_ENTRY(INVALID_FIRMWARE_SLOT), - SC_ENTRY(INVALID_FIRMWARE_IMAGE), - SC_ENTRY(INVALID_INTERRUPT_VECTOR), - SC_ENTRY(INVALID_LOG_PAGE), - SC_ENTRY(INVALID_FORMAT), - SC_ENTRY(FIRMWARE_REQUIRES_RESET), - SC_ENTRY(INVALID_QUEUE_DELETION), - SC_ENTRY(FEATURE_NOT_SAVEABLE), - SC_ENTRY(FEATURE_NOT_CHANGEABLE), - SC_ENTRY(FEATURE_NOT_NS_SPECIFIC), - SC_ENTRY(FW_ACT_REQUIRES_NVMS_RESET), - SC_ENTRY(FW_ACT_REQUIRES_RESET), - SC_ENTRY(FW_ACT_REQUIRES_TIME), - SC_ENTRY(FW_ACT_PROHIBITED), - SC_ENTRY(OVERLAPPING_RANGE), - SC_ENTRY(NS_INSUFFICIENT_CAPACITY), - SC_ENTRY(NS_ID_UNAVAILABLE), - SC_ENTRY(NS_ALREADY_ATTACHED), - SC_ENTRY(NS_IS_PRIVATE), - SC_ENTRY(NS_NOT_ATTACHED), - SC_ENTRY(THIN_PROV_NOT_SUPPORTED), - SC_ENTRY(CTRLR_LIST_INVALID), - SC_ENTRY(SELF_TEST_IN_PROGRESS), - SC_ENTRY(BOOT_PART_WRITE_PROHIB), - SC_ENTRY(INVALID_CTRLR_ID), - SC_ENTRY(INVALID_SEC_CTRLR_STATE), - SC_ENTRY(INVALID_NUM_OF_CTRLR_RESRC), - SC_ENTRY(INVALID_RESOURCE_ID), - SC_ENTRY(SANITIZE_PROHIBITED_WPMRE), - SC_ENTRY(ANA_GROUP_ID_INVALID), - SC_ENTRY(ANA_ATTACH_FAILED), - - SC_ENTRY(CONFLICTING_ATTRIBUTES), - SC_ENTRY(INVALID_PROTECTION_INFO), - SC_ENTRY(ATTEMPTED_WRITE_TO_RO_PAGE), -}; - -static const char *media_error_status[256] = { - SC_ENTRY(WRITE_FAULTS), - SC_ENTRY(UNRECOVERED_READ_ERROR), - SC_ENTRY(GUARD_CHECK_ERROR), - SC_ENTRY(APPLICATION_TAG_CHECK_ERROR), - SC_ENTRY(REFERENCE_TAG_CHECK_ERROR), - SC_ENTRY(COMPARE_FAILURE), - SC_ENTRY(ACCESS_DENIED), - SC_ENTRY(DEALLOCATED_OR_UNWRITTEN), -}; - -static const char *path_related_status[256] = { - SC_ENTRY(INTERNAL_PATH_ERROR), - SC_ENTRY(ASYMMETRIC_ACCESS_PERSISTENT_LOSS), - SC_ENTRY(ASYMMETRIC_ACCESS_INACCESSIBLE), - SC_ENTRY(ASYMMETRIC_ACCESS_TRANSITION), - SC_ENTRY(CONTROLLER_PATHING_ERROR), - SC_ENTRY(HOST_PATHING_ERROR), - SC_ENTRY(COMMAND_ABORTED_BY_HOST), -}; - void ctl_nvme_status_string(struct ctl_nvmeio *ctnio, struct sbuf *sb) { - const char *s, *type; - uint16_t status; - - status = le16toh(ctnio->cpl.status); - switch (NVME_STATUS_GET_SCT(status)) { - case NVME_SCT_GENERIC: - s = generic_status[NVME_STATUS_GET_SC(status)]; - type = "GENERIC"; - break; - case NVME_SCT_COMMAND_SPECIFIC: - s = command_specific_status[NVME_STATUS_GET_SC(status)]; - type = "COMMAND SPECIFIC"; - break; - case NVME_SCT_MEDIA_ERROR: - s = media_error_status[NVME_STATUS_GET_SC(status)]; - type = "MEDIA ERROR"; - break; - case NVME_SCT_PATH_RELATED: - s = path_related_status[NVME_STATUS_GET_SC(status)]; - type = "PATH RELATED"; - break; - case NVME_SCT_VENDOR_SPECIFIC: - s = NULL; - type = "VENDOR SPECIFIC"; - break; - default: - s = "RESERVED"; - type = NULL; - break; - } - - if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, NVME_STATUS_GET_SC(status)); - else - sbuf_printf(sb, "%s", s); - if (NVME_STATUS_GET_M(status) != 0) - sbuf_printf(sb, " M"); - if (NVME_STATUS_GET_DNR(status) != 0) - sbuf_printf(sb, " DNR"); + nvme_cpl_sbuf(&ctnio->cpl, sb); } diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c index a3c3d676b349..3f264e2ff6eb 100644 --- a/sys/cam/nvme/nvme_all.c +++ b/sys/cam/nvme/nvme_all.c @@ -60,6 +60,168 @@ #include #endif +/* XXX: This duplicates lists in nvme_qpair.c. */ + +#define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x + +static const char *admin_opcode[256] = { + OPC_ENTRY(DELETE_IO_SQ), + OPC_ENTRY(CREATE_IO_SQ), + OPC_ENTRY(GET_LOG_PAGE), + OPC_ENTRY(DELETE_IO_CQ), + OPC_ENTRY(CREATE_IO_CQ), + OPC_ENTRY(IDENTIFY), + OPC_ENTRY(ABORT), + OPC_ENTRY(SET_FEATURES), + OPC_ENTRY(GET_FEATURES), + OPC_ENTRY(ASYNC_EVENT_REQUEST), + OPC_ENTRY(NAMESPACE_MANAGEMENT), + OPC_ENTRY(FIRMWARE_ACTIVATE), + OPC_ENTRY(FIRMWARE_IMAGE_DOWNLOAD), + OPC_ENTRY(DEVICE_SELF_TEST), + OPC_ENTRY(NAMESPACE_ATTACHMENT), + OPC_ENTRY(KEEP_ALIVE), + OPC_ENTRY(DIRECTIVE_SEND), + OPC_ENTRY(DIRECTIVE_RECEIVE), + OPC_ENTRY(VIRTUALIZATION_MANAGEMENT), + OPC_ENTRY(NVME_MI_SEND), + OPC_ENTRY(NVME_MI_RECEIVE), + OPC_ENTRY(CAPACITY_MANAGEMENT), + OPC_ENTRY(LOCKDOWN), + OPC_ENTRY(DOORBELL_BUFFER_CONFIG), + OPC_ENTRY(FABRICS_COMMANDS), + OPC_ENTRY(FORMAT_NVM), + OPC_ENTRY(SECURITY_SEND), + OPC_ENTRY(SECURITY_RECEIVE), + OPC_ENTRY(SANITIZE), + OPC_ENTRY(GET_LBA_STATUS), +}; + +static const char *nvm_opcode[256] = { + OPC_ENTRY(FLUSH), + OPC_ENTRY(WRITE), + OPC_ENTRY(READ), + OPC_ENTRY(WRITE_UNCORRECTABLE), + OPC_ENTRY(COMPARE), + OPC_ENTRY(WRITE_ZEROES), + OPC_ENTRY(DATASET_MANAGEMENT), + OPC_ENTRY(VERIFY), + OPC_ENTRY(RESERVATION_REGISTER), + OPC_ENTRY(RESERVATION_REPORT), + OPC_ENTRY(RESERVATION_ACQUIRE), + OPC_ENTRY(RESERVATION_RELEASE), + OPC_ENTRY(COPY), +}; + +#define SC_ENTRY(x) [NVME_SC_ ## x] = #x + +static const char *generic_status[256] = { + SC_ENTRY(SUCCESS), + SC_ENTRY(INVALID_OPCODE), + SC_ENTRY(INVALID_FIELD), + SC_ENTRY(COMMAND_ID_CONFLICT), + SC_ENTRY(DATA_TRANSFER_ERROR), + SC_ENTRY(ABORTED_POWER_LOSS), + SC_ENTRY(INTERNAL_DEVICE_ERROR), + SC_ENTRY(ABORTED_BY_REQUEST), + SC_ENTRY(ABORTED_SQ_DELETION), + SC_ENTRY(ABORTED_FAILED_FUSED), + SC_ENTRY(ABORTED_MISSING_FUSED), + SC_ENTRY(INVALID_NAMESPACE_OR_FORMAT), + SC_ENTRY(COMMAND_SEQUENCE_ERROR), + SC_ENTRY(INVALID_SGL_SEGMENT_DESCR), + SC_ENTRY(INVALID_NUMBER_OF_SGL_DESCR), + SC_ENTRY(DATA_SGL_LENGTH_INVALID), + SC_ENTRY(METADATA_SGL_LENGTH_INVALID), + SC_ENTRY(SGL_DESCRIPTOR_TYPE_INVALID), + SC_ENTRY(INVALID_USE_OF_CMB), + SC_ENTRY(PRP_OFFET_INVALID), + SC_ENTRY(ATOMIC_WRITE_UNIT_EXCEEDED), + SC_ENTRY(OPERATION_DENIED), + SC_ENTRY(SGL_OFFSET_INVALID), + SC_ENTRY(HOST_ID_INCONSISTENT_FORMAT), + SC_ENTRY(KEEP_ALIVE_TIMEOUT_EXPIRED), + SC_ENTRY(KEEP_ALIVE_TIMEOUT_INVALID), + SC_ENTRY(ABORTED_DUE_TO_PREEMPT), + SC_ENTRY(SANITIZE_FAILED), + SC_ENTRY(SANITIZE_IN_PROGRESS), + SC_ENTRY(SGL_DATA_BLOCK_GRAN_INVALID), + SC_ENTRY(NOT_SUPPORTED_IN_CMB), + SC_ENTRY(NAMESPACE_IS_WRITE_PROTECTED), + SC_ENTRY(COMMAND_INTERRUPTED), + SC_ENTRY(TRANSIENT_TRANSPORT_ERROR), + + SC_ENTRY(LBA_OUT_OF_RANGE), + SC_ENTRY(CAPACITY_EXCEEDED), + SC_ENTRY(NAMESPACE_NOT_READY), + SC_ENTRY(RESERVATION_CONFLICT), + SC_ENTRY(FORMAT_IN_PROGRESS), +}; + +static const char *command_specific_status[256] = { + SC_ENTRY(COMPLETION_QUEUE_INVALID), + SC_ENTRY(INVALID_QUEUE_IDENTIFIER), + SC_ENTRY(MAXIMUM_QUEUE_SIZE_EXCEEDED), + SC_ENTRY(ABORT_COMMAND_LIMIT_EXCEEDED), + SC_ENTRY(ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED), + SC_ENTRY(INVALID_FIRMWARE_SLOT), + SC_ENTRY(INVALID_FIRMWARE_IMAGE), + SC_ENTRY(INVALID_INTERRUPT_VECTOR), + SC_ENTRY(INVALID_LOG_PAGE), + SC_ENTRY(INVALID_FORMAT), + SC_ENTRY(FIRMWARE_REQUIRES_RESET), + SC_ENTRY(INVALID_QUEUE_DELETION), + SC_ENTRY(FEATURE_NOT_SAVEABLE), + SC_ENTRY(FEATURE_NOT_CHANGEABLE), + SC_ENTRY(FEATURE_NOT_NS_SPECIFIC), + SC_ENTRY(FW_ACT_REQUIRES_NVMS_RESET), + SC_ENTRY(FW_ACT_REQUIRES_RESET), + SC_ENTRY(FW_ACT_REQUIRES_TIME), + SC_ENTRY(FW_ACT_PROHIBITED), + SC_ENTRY(OVERLAPPING_RANGE), + SC_ENTRY(NS_INSUFFICIENT_CAPACITY), + SC_ENTRY(NS_ID_UNAVAILABLE), + SC_ENTRY(NS_ALREADY_ATTACHED), + SC_ENTRY(NS_IS_PRIVATE), + SC_ENTRY(NS_NOT_ATTACHED), + SC_ENTRY(THIN_PROV_NOT_SUPPORTED), + SC_ENTRY(CTRLR_LIST_INVALID), + SC_ENTRY(SELF_TEST_IN_PROGRESS), + SC_ENTRY(BOOT_PART_WRITE_PROHIB), + SC_ENTRY(INVALID_CTRLR_ID), + SC_ENTRY(INVALID_SEC_CTRLR_STATE), + SC_ENTRY(INVALID_NUM_OF_CTRLR_RESRC), + SC_ENTRY(INVALID_RESOURCE_ID), + SC_ENTRY(SANITIZE_PROHIBITED_WPMRE), + SC_ENTRY(ANA_GROUP_ID_INVALID), + SC_ENTRY(ANA_ATTACH_FAILED), + + SC_ENTRY(CONFLICTING_ATTRIBUTES), + SC_ENTRY(INVALID_PROTECTION_INFO), + SC_ENTRY(ATTEMPTED_WRITE_TO_RO_PAGE), +}; + +static const char *media_error_status[256] = { + SC_ENTRY(WRITE_FAULTS), + SC_ENTRY(UNRECOVERED_READ_ERROR), + SC_ENTRY(GUARD_CHECK_ERROR), + SC_ENTRY(APPLICATION_TAG_CHECK_ERROR), + SC_ENTRY(REFERENCE_TAG_CHECK_ERROR), + SC_ENTRY(COMPARE_FAILURE), + SC_ENTRY(ACCESS_DENIED), + SC_ENTRY(DEALLOCATED_OR_UNWRITTEN), +}; + +static const char *path_related_status[256] = { + SC_ENTRY(INTERNAL_PATH_ERROR), + SC_ENTRY(ASYMMETRIC_ACCESS_PERSISTENT_LOSS), + SC_ENTRY(ASYMMETRIC_ACCESS_INACCESSIBLE), + SC_ENTRY(ASYMMETRIC_ACCESS_TRANSITION), + SC_ENTRY(CONTROLLER_PATHING_ERROR), + SC_ENTRY(HOST_PATHING_ERROR), + SC_ENTRY(COMMAND_ABORTED_BY_HOST), +}; + void nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid, uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, @@ -106,44 +268,19 @@ nvme_print_ident_short(const struct nvme_controller_data *cdata, sbuf_putc(sb, '>'); } -/* XXX need to do nvme admin opcodes too, but those aren't used yet by nda */ -static const char * -nvme_opc2str[] = { - "FLUSH", - "WRITE", - "READ", - "RSVD-3", - "WRITE_UNCORRECTABLE", - "COMPARE", - "RSVD-6", - "RSVD-7", - "WRITE_ZEROES", - "DATASET_MANAGEMENT", - "RSVD-a", - "RSVD-b", - "RSVD-c", - "RESERVATION_REGISTER", - "RESERVATION_REPORT", - "RSVD-f", - "RSVD-10", - "RESERVATION_ACQUIRE", - "RSVD-12", - "RSVD-13", - "RSVD-14", - "RESERVATION_RELEASE", -}; - const char * nvme_op_string(const struct nvme_command *cmd, int admin) { + const char *s; - if (admin) { - return "ADMIN"; - } else { - if (cmd->opc >= nitems(nvme_opc2str)) - return "UNKNOWN"; - return nvme_opc2str[cmd->opc]; - } + if (admin) + s = admin_opcode[cmd->opc]; + else + s = nvm_opcode[cmd->opc]; + if (s == NULL) + return ("UNKNOWN"); + else + return (s); } const char * @@ -170,6 +307,24 @@ nvme_cmd_string(const struct nvme_command *cmd, char *cmd_string, size_t len) return(sbuf_data(&sb)); } +void +nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb) +{ + const char *s, *type; + + if (admin) { + s = admin_opcode[opc]; + type = "ADMIN"; + } else { + s = nvm_opcode[opc]; + type = "NVM"; + } + if (s == NULL) + sbuf_printf(sb, "%s:0x%02x", type, opc); + else + sbuf_printf(sb, "%s", s); +} + void nvme_cmd_sbuf(const struct nvme_command *cmd, struct sbuf *sb) { @@ -193,12 +348,67 @@ int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb) { - sbuf_printf(sb, "%s. NCB: ", nvme_op_string(&nvmeio->cmd, - nvmeio->ccb_h.func_code == XPT_NVME_ADMIN)); + nvme_opcode_sbuf(nvmeio->ccb_h.func_code == XPT_NVME_ADMIN, + nvmeio->cmd.opc, sb); + sbuf_cat(sb, ". NCB: "); nvme_cmd_sbuf(&nvmeio->cmd, sb); return(0); } +void +nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) +{ + const char *s, *type; + uint16_t status; + + status = le16toh(cpl->status); + switch (NVME_STATUS_GET_SCT(status)) { + case NVME_SCT_GENERIC: + s = generic_status[NVME_STATUS_GET_SC(status)]; + type = "GENERIC"; + break; + case NVME_SCT_COMMAND_SPECIFIC: + s = command_specific_status[NVME_STATUS_GET_SC(status)]; + type = "COMMAND SPECIFIC"; + break; + case NVME_SCT_MEDIA_ERROR: + s = media_error_status[NVME_STATUS_GET_SC(status)]; + type = "MEDIA ERROR"; + break; + case NVME_SCT_PATH_RELATED: + s = path_related_status[NVME_STATUS_GET_SC(status)]; + type = "PATH RELATED"; + break; + case NVME_SCT_VENDOR_SPECIFIC: + s = NULL; + type = "VENDOR SPECIFIC"; + break; + default: + s = "RESERVED"; + type = NULL; + break; + } + + if (s == NULL) + sbuf_printf(sb, "%s:0x%02x", type, NVME_STATUS_GET_SC(status)); + else + sbuf_printf(sb, "%s", s); + if (NVME_STATUS_GET_M(status) != 0) + sbuf_printf(sb, " M"); + if (NVME_STATUS_GET_DNR(status) != 0) + sbuf_printf(sb, " DNR"); +} + +/* + * nvme_status_sbuf() returns 0 for success and -1 for failure. + */ +int +nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb) +{ + nvme_cpl_sbuf(&nvmeio->cpl, sb); + return (0); +} + #ifdef _KERNEL const void * nvme_get_identify_cntrl(struct cam_periph *periph) diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h index 2b6732fe7c74..a32668ddc1fb 100644 --- a/sys/cam/nvme/nvme_all.h +++ b/sys/cam/nvme/nvme_all.h @@ -44,8 +44,11 @@ void nvme_print_ident_short(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); const char *nvme_op_string(const struct nvme_command *, int admin); const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); +void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); +void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); +int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); const void *nvme_get_identify_cntrl(struct cam_periph *); const void *nvme_get_identify_ns(struct cam_periph *); From nobody Mon Jun 2 15:13:20 2025 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 4b9y5r5c3pz5wx7s; Mon, 02 Jun 2025 15:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9y5r2Wb1z40sD; Mon, 02 Jun 2025 15:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748877200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QhCZ5Mq2WvelkDkvqqBZ5PeuYXuTBUTsmG7K71vFkDs=; b=waluwrvHzA/WRS9tXE4v0qIi5tnDIztz0HyHNLiatTMjRbh0EfFfNFzjMwWEftera5NT6P ePITZyzt3xIqFCBSG/zEdIP04VRRyAnAjpVZR6q0xsYvfd7lm09a7KM4biTVVv1BkavpcC cAgtOT/hOqcrI/eDKB/JqfnkhCc386QWkvTr+uzafNwMX8gBP401mJl8xngNB3AGOu/bRN zfn2a6zBVr/JzC7SvLNdzxfGjpB6YIv8cQ3ISfiKH4tp8SwErA6VS47OcfFU6Vg0Dtpx6d xEf5TfVLR0HfwEa+MXWHpVgs0pqONDkKRCXf43E6SF30zh+Kt4MEIBlznwx7BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748877200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QhCZ5Mq2WvelkDkvqqBZ5PeuYXuTBUTsmG7K71vFkDs=; b=cOqdc5vTWOoK/GFS2KLIX6AzxldOntvdZbsnOb3tvE+DwicudA8jFjYQ47EKFG1LMHRWUg 50/qiI46KZOD/NepqE60EoMYaWgWaTJGvMVTrH+jx/7eMLY9w8ee8qF5nQq2au4sLHSNBO bvUtTIpSEkyR1GGHzF/DgZXUSV5k7frgwNCKuoUE4KMOnVBl4Canzw7iTh0LbmR616d0uf Qy4kVZDqZaCJEn/wyq5EXeNH73HrgNXFtLKH4xZB8+6F4loTmwtoq77YMpYAIndJljV1sx Lrnnb8lGc6im1YS26kiHtEXcHKeZTMsndTZg26wrrujbp3ToGfAhDrY29f2Yfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748877200; a=rsa-sha256; cv=none; b=SGpf99hatr8YrTnJf9Z0vRAirg7rbdAIYLCxcT9A1u2/5u/KJgV5ADH33K4HZUNm0ld+qq /2RW9Zw25lDb+QSDPi/4i5yeMJ+jIC96BlJoyCo2dolzabCf9p7xXoWd8n0I0rLoHUVUAd 2ERrWaqhJNZxVOSraSkvD56KRB5u7eLsIFgsaSH4JE2AUx0zEB8V2H74fYre1SvPhVW7DF VadBJnt/HttD4eNunFXN2akw7XTmCGu1l4T+tG4llkF6AFLZqMBigwf4z4w349lP1eIJYC CRVPQ6UTAcNmNJzWXrNHrKP9eA74E2pGwGpdyf+aIbg9BK/WtL15cnQZ/Wy7ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9y5r1nq5z1CpD; Mon, 02 Jun 2025 15:13:20 +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 552FDK4e019660; Mon, 2 Jun 2025 15:13:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FDK8p019657; Mon, 2 Jun 2025 15:13:20 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:13:20 GMT Message-Id: <202506021513.552FDK8p019657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 353cfc483dd2 - main - cam nvme: Decode NVMe status for NVMe command 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 353cfc483dd246091c92b22f214fd16eb5de4e3b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=353cfc483dd246091c92b22f214fd16eb5de4e3b commit 353cfc483dd246091c92b22f214fd16eb5de4e3b Author: John Baldwin AuthorDate: 2025-06-02 15:05:43 +0000 Commit: John Baldwin CommitDate: 2025-06-02 15:05:43 +0000 cam nvme: Decode NVMe status for NVMe command failures Similar to ATA and SCSI, log the command status (in this case the status code from the CQE) on the console for failed NVMe commands. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50632 --- sys/cam/cam.c | 28 ++++++++++++++++++++++++++++ sys/cam/cam.h | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/sys/cam/cam.c b/sys/cam/cam.c index d9cff3468da0..917197542edc 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -380,6 +380,20 @@ cam_error_string(struct cam_device *device, union ccb *ccb, char *str, break; } break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + switch (proto_flags & CAM_EPF_LEVEL_MASK) { + case CAM_EPF_NONE: + break; + case CAM_EPF_ALL: + case CAM_EPF_NORMAL: + case CAM_EPF_MINIMAL: + proto_flags |= CAM_ENF_PRINT_STATUS; + /* FALLTHROUGH */ + default: + break; + } + break; default: break; } @@ -494,6 +508,20 @@ cam_error_string(struct cam_device *device, union ccb *ccb, char *str, ccb->smpio.smp_response[2]); } /* There is no SMP equivalent to SCSI sense. */ + break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != + CAM_NVME_STATUS_ERROR) + break; + + if (proto_flags & CAM_ESF_PRINT_STATUS) { + sbuf_cat(&sb, path_str); + sbuf_cat(&sb, "NVMe status: "); + nvme_status_sbuf(&ccb->nvmeio, &sb); + sbuf_putc(&sb, '\n'); + } + break; default: break; diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 963c9798ddbc..83c1fc7b35ca 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -350,6 +350,11 @@ typedef enum { CAM_EAF_PRINT_RESULT = 0x20 } cam_error_ata_flags; +typedef enum { + CAM_ENF_PRINT_NONE = 0x00, + CAM_ENF_PRINT_STATUS = 0x10, +} cam_error_nvme_flags; + typedef enum { CAM_STRVIS_FLAG_NONE = 0x00, CAM_STRVIS_FLAG_NONASCII_MASK = 0x03, From nobody Mon Jun 2 15:30:33 2025 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 4b9yTj3Wc4z5wxwx; Mon, 02 Jun 2025 15:30: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 4b9yTj2vqpz47Vk; Mon, 02 Jun 2025 15:30:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I6d3/VFzUuuycr89dkr6Kp2cawsZtoifBv1UJbkUHbA=; b=Fx3C7damoNbUtWV8YU1zZavYicLZKLmbv/a//g+I5tSQletUva2/0NcMLFxXn324AhKnKQ SkYev/zYj85qt1AOEO4eHqCzdBPA27H3GU3/tpRpGnat84xGYM1xF3pLKG8edhbroTnmwQ 9HjdtZeEN9slRCdwnhkV+7a1VmcpojwvzYyDSCoZbk90cvhfxU5RYMqMuPt6TYqmGhu7Vv J2FkIeH6fxY47n7vIl9JHvSWF7aqWh3s/tXSZLKanzy1wDSTJTHO13mcz3ZOYUjau+TTKy P83opvs+sy6qlq7LrGeWvEeBbHfFUvt+57AmHuxKGK8XPrXKlU/uKo8+2YeE8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I6d3/VFzUuuycr89dkr6Kp2cawsZtoifBv1UJbkUHbA=; b=lYIIb8uDoqfLbzCgdvMKMq090A37FCdjMTBYLGI3KRm9QNsepmYCD0nLxU0dyj/OKALTYh /0PbbgFIE1Cmn7vCJxuWbiL+DaC+vGG8/bYsbGyNQ/CDK/YoQTXlrNld8siRp5MNnEq3rX 0hYT82qQlwwyycTI/amQkJWwgaPHezcc6q3XPd+hFawv/Ua+Mro+C1bObfmnVGrScYuhP4 XTA7ApLmGBxLxQe6sS+JlAxEZUAvAZJ5PlOvVdlY355AF/ShtKCSsVgwQ9E7H9s9COX0Hc hc/+UiHXh0b5K2Fkcm481GygIC5pCVRS7f6dkP6aSxDaLqJC+zia0yc33DkPWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748878233; a=rsa-sha256; cv=none; b=o6Cq1Ka6neDOf2VMl8iaDEfi+lPsuJEeCrKpSsPhVVkYS7KAcB61Jojz5x6vGiV/u3AvlF 1iEK9WCVXOyKsCxWHKlBux8GUMnbvNGp3sYhCF1pW+ZWQOubCrW9QxE0f0m6Hv32k36Ahj Gn8fOGZ8ynAOdtKfx82ohXASgNMktuWIqbKF90ShVQ1c+kfJUYXDqyt4/YbiiPA+3zK6JY TYcc4kN8MgY5/XQakRKmT++AAH2dFpCcnB+LudGTreBvrg0b7+dn9POMftqimIEmCZa4Gy 7zmFPVeMvR24bc7muILDKS3Rtz8ucNbRIsFvJ3H1mw+EAUMRTp81ze5TmWWPAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9yTj2BW5z1CmG; Mon, 02 Jun 2025 15:30:33 +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 552FUXcw049662; Mon, 2 Jun 2025 15:30:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FUXbF049659; Mon, 2 Jun 2025 15:30:33 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:30:33 GMT Message-Id: <202506021530.552FUXbF049659@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: 3495832877ca - main - pf: convert NAT rule handling to PF_TEST_ATTRIB as well 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: 3495832877caebdf2f6f0a01a3b1f43a80351a55 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3495832877caebdf2f6f0a01a3b1f43a80351a55 commit 3495832877caebdf2f6f0a01a3b1f43a80351a55 Author: Kristof Provost AuthorDate: 2025-05-23 15:22:14 +0000 Commit: Kristof Provost CommitDate: 2025-06-02 15:30:18 +0000 pf: convert NAT rule handling to PF_TEST_ATTRIB as well We previously made this change in the filter rules, apply it to the NAT rules as well. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50580 --- sys/netpfil/pf/pf_lb.c | 108 ++++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 43edfc806c1c..00f25c29e23c 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -128,6 +128,14 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, return (res); } +#define PF_TEST_ATTRIB(t, a)\ + do { \ + if (t) { \ + r = a; \ + goto nextrule; \ + } \ + } while (0) + struct pf_krule * pf_match_translation(struct pf_pdesc *pd, int rs_num, struct pf_kanchor_stackframe *anchor_stack) @@ -153,60 +161,60 @@ pf_match_translation(struct pf_pdesc *pd, } pf_counter_u64_add(&r->evaluations, 1); - if (pfi_kkif_match(r->kif, pd->kif) == r->ifnot) - r = r->skip[PF_SKIP_IFP]; - else if (r->direction && r->direction != pd->dir) - r = r->skip[PF_SKIP_DIR]; - else if (r->af && r->af != pd->af) - r = r->skip[PF_SKIP_AF]; - else if (r->proto && r->proto != pd->proto) - r = r->skip[PF_SKIP_PROTO]; - else if (PF_MISMATCHAW(&src->addr, &pd->nsaddr, pd->af, - src->neg, pd->kif, M_GETFIB(pd->m))) - r = r->skip[src == &r->src ? PF_SKIP_SRC_ADDR : - PF_SKIP_DST_ADDR]; - else if (src->port_op && !pf_match_port(src->port_op, - src->port[0], src->port[1], pd->nsport)) - r = r->skip[src == &r->src ? PF_SKIP_SRC_PORT : - PF_SKIP_DST_PORT]; - else if (dst != NULL && + PF_TEST_ATTRIB(pfi_kkif_match(r->kif, pd->kif) == r->ifnot, + r->skip[PF_SKIP_IFP]); + PF_TEST_ATTRIB(r->direction && r->direction != pd->dir, + r->skip[PF_SKIP_DIR]); + PF_TEST_ATTRIB(r->af && r->af != pd->af, + r->skip[PF_SKIP_AF]); + PF_TEST_ATTRIB(r->proto && r->proto != pd->proto, + r->skip[PF_SKIP_PROTO]); + PF_TEST_ATTRIB(PF_MISMATCHAW(&src->addr, &pd->nsaddr, pd->af, + src->neg, pd->kif, M_GETFIB(pd->m)), + r->skip[src == &r->src ? PF_SKIP_SRC_ADDR : + PF_SKIP_DST_ADDR]); + PF_TEST_ATTRIB(src->port_op && !pf_match_port(src->port_op, + src->port[0], src->port[1], pd->nsport), + r->skip[src == &r->src ? PF_SKIP_SRC_PORT : + PF_SKIP_DST_PORT]); + PF_TEST_ATTRIB(dst != NULL && PF_MISMATCHAW(&dst->addr, &pd->ndaddr, pd->af, dst->neg, NULL, - M_GETFIB(pd->m))) - r = r->skip[PF_SKIP_DST_ADDR]; - else if (xdst != NULL && PF_MISMATCHAW(xdst, &pd->ndaddr, pd->af, - 0, NULL, M_GETFIB(pd->m))) - r = TAILQ_NEXT(r, entries); - else if (dst != NULL && dst->port_op && + M_GETFIB(pd->m)), + r->skip[PF_SKIP_DST_ADDR]); + PF_TEST_ATTRIB(xdst != NULL && PF_MISMATCHAW(xdst, &pd->ndaddr, pd->af, + 0, NULL, M_GETFIB(pd->m)), + TAILQ_NEXT(r, entries)); + PF_TEST_ATTRIB(dst != NULL && dst->port_op && !pf_match_port(dst->port_op, dst->port[0], - dst->port[1], pd->ndport)) - r = r->skip[PF_SKIP_DST_PORT]; - else if (r->match_tag && !pf_match_tag(pd->m, r, &tag, - pd->pf_mtag ? pd->pf_mtag->tag : 0)) - r = TAILQ_NEXT(r, entries); - else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != + dst->port[1], pd->ndport), + r->skip[PF_SKIP_DST_PORT]); + PF_TEST_ATTRIB(r->match_tag && !pf_match_tag(pd->m, r, &tag, + pd->pf_mtag ? pd->pf_mtag->tag : 0), + TAILQ_NEXT(r, entries)); + PF_TEST_ATTRIB(r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match(pf_osfp_fingerprint(pd, - &pd->hdr.tcp), r->os_fingerprint))) - r = TAILQ_NEXT(r, entries); - else { - if (r->tag) - tag = r->tag; - if (r->rtableid >= 0) - rtableid = r->rtableid; - if (r->anchor == NULL) { - rm = r; - if (rm->action == PF_NONAT || - rm->action == PF_NORDR || - rm->action == PF_NOBINAT) { - rm = NULL; - } - break; - } else - pf_step_into_anchor(anchor_stack, &asd, - &ruleset, rs_num, &r, NULL); + &pd->hdr.tcp), r->os_fingerprint)), + TAILQ_NEXT(r, entries)); + if (r->tag) + tag = r->tag; + if (r->rtableid >= 0) + rtableid = r->rtableid; + if (r->anchor == NULL) { + rm = r; + if (rm->action == PF_NONAT || + rm->action == PF_NORDR || + rm->action == PF_NOBINAT) { + rm = NULL; + } + break; + } else { + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, rs_num, &r, NULL); } - if (r == NULL) - pf_step_out_of_anchor(anchor_stack, &asd, &ruleset, - rs_num, &r, NULL, NULL); +nextrule: + if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, &ruleset, + rs_num, &r, NULL, NULL)) + break; } if (tag > 0 && pf_tag_packet(pd, tag)) From nobody Mon Jun 2 15:30:34 2025 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 4b9yTk4VZNz5wy9N; Mon, 02 Jun 2025 15:30: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 4b9yTk3431z47FF; Mon, 02 Jun 2025 15:30:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=otcDU2O2kTxwVADWnKjlHQBa1LD/8Ku2IC6ydrlk8No=; b=w6rRLc7bKNVQnWuP3E20FRixpDGM+oCAJjJxFz3FoLfubCuoFL5yTiyQ9qQtQ53huSeo6l 8KVPqQ1x10nYs117Kllsvaz5WMj9VYxKeVqY2esiiwF9PR+Rw5F063c+7cQPAKElQ3AQ4U jHgUzbRYJHBbUsgjh7uvtdSq3liGjcx48XuxjPNWYAHCQxIp6GgPh+L0RC/4pYKeXAw/Oo +K/7JuwCif3GBtDpedBH51NUGOUggg5WpKULRnLQuNBqYIAW7wS0tYr+KDR0OeKbowpJxm +Xjl8HoevUpUFawPlJkNxOezZD/R9L30SWkAoUHnZywlFKnj18hXMgnEsLaE4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=otcDU2O2kTxwVADWnKjlHQBa1LD/8Ku2IC6ydrlk8No=; b=HHXkpQ427ItPN4gmCCkoJ0FzDHkTiryGucRlm/+V5sl0hq9Ao7U40WRJ47lnxYUFQvLHoc Wg3OkTtr6cS5DjMIdpNPLAVXhKeYJ3x7kb5uje5UIaP3/75xPxqZWuv1vcUr9UkMDY69pP jOVYmG5aEJeyyDkGi7NFXJKrK1LZuPGmrIN4OsSGfXNjZk5/pOedP+6I7H+wHGv+pyolTP W87twmjLTrcqOuNSNyDQM8r9HLuH6f97gvOn3Y1FDEogXE8ijbYHO1HDgSPbXMaUci2LGB vZa1E+QSdFQBYu27Kq5R7JdY6QdS1XhvhlwTtXkpaV3U7xanA0oebB0UJNHRrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748878234; a=rsa-sha256; cv=none; b=FL/mvgmr10Q4pxfu9N7Sfyok5Ih6aoVibRRtefaVgO98nCLjqtx0eUkT/9kN2rrCnHnN7Y HF/a9xrA+Rr0uKqO0GuXErz1E+5DZF6M58waqcBoP2C/hDL4GJkNxRkmWVoVw/3SLcCldH 384IALBDIdhisQ2RVhNGrR0O3PjMFOro58+m/RWkK+4lodRDs5WrGAp+G0ntQyFbgiWnAt 2KeQAxvQK2QjQAvbuaqd5KC/NHleipLwplU42B7S9T3jhQ0SL62+osEb9WNUtKCIfakRDX qEsAOy1Hjf+pgeRoQG6A8ML2J5Gfckdh9L2hHLw0TXU2e7kG0f0TnhiYMzubDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9yTk2PSNz1DDb; Mon, 02 Jun 2025 15:30: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 552FUYKj049696; Mon, 2 Jun 2025 15:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FUYTC049693; Mon, 2 Jun 2025 15:30:34 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:30:34 GMT Message-Id: <202506021530.552FUYTC049693@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: fe96610ba943 - main - pf: rework anchor handling to recurse 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: fe96610ba94332c7c4c59f3f82920d1ef1177bf2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fe96610ba94332c7c4c59f3f82920d1ef1177bf2 commit fe96610ba94332c7c4c59f3f82920d1ef1177bf2 Author: Kristof Provost AuthorDate: 2025-05-22 10:02:49 +0000 Commit: Kristof Provost CommitDate: 2025-06-02 15:30:18 +0000 pf: rework anchor handling to recurse - percpu anchor stacks we actually don't need to pre-allocate per_anchor_stack[], if we use a 'natural' recursion, when doing anchor tree traversal. O.K. mikeb@, mpi@ Extended because FreeBSD pf still has separate NAT rules processing, which also needed this change. Obtained from: OpenBSD, sashan , e236f0fa7b Obtained from: OpenBSD, sashan , 5e4ad307dc Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50579 --- sys/net/pfvar.h | 51 ++++- sys/netpfil/pf/pf.c | 557 ++++++++++++++++++++++++------------------------- sys/netpfil/pf/pf_lb.c | 146 +++++++++---- 3 files changed, 422 insertions(+), 332 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 82d74e08c14f..b3e3260d80a6 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1151,6 +1151,45 @@ struct pf_kstate { * Try to not grow the struct beyond that. */ _Static_assert(sizeof(struct pf_kstate) <= 384, "pf_kstate size crosses 384 bytes"); + +enum pf_test_status { + PF_TEST_FAIL = -1, + PF_TEST_OK, + PF_TEST_QUICK +}; + +struct pf_test_ctx { + enum pf_test_status test_status; + struct pf_pdesc *pd; + struct pf_rule_actions act; + uint8_t icmpcode; + uint8_t icmptype; + int icmp_dir; + int state_icmp; + int tag; + int rewrite; + u_short reason; + struct pf_src_node *sns[PF_SN_MAX]; + struct pf_krule_slist rules; + struct pf_krule *nr; + struct pf_krule *tr; + struct pf_krule **rm; + struct pf_krule *a; + struct pf_krule **am; + struct pf_kruleset **rsm; + struct pf_kruleset *arsm; + struct pf_kruleset *aruleset; + struct pf_state_key *sk; + struct pf_state_key *nk; + struct tcphdr *th; + struct pf_udp_mapping *udp_mapping; + struct pf_kpool *nat_pool; + uint16_t virtual_type; + uint16_t virtual_id; + int depth; +}; + +#define PF_ANCHOR_STACK_MAX 32 #endif /* @@ -1411,7 +1450,6 @@ RB_PROTOTYPE(pf_kanchor_node, pf_kanchor, entry_node, pf_kanchor_compare); PFR_TFLAG_REFDANCHOR | \ PFR_TFLAG_COUNTERS) -struct pf_kanchor_stackframe; struct pf_keth_anchor_stackframe; struct pfr_table { @@ -2678,12 +2716,8 @@ int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); #ifdef _KERNEL void pf_print_host(struct pf_addr *, u_int16_t, sa_family_t); -void pf_step_into_anchor(struct pf_kanchor_stackframe *, int *, - struct pf_kruleset **, int, struct pf_krule **, - struct pf_krule **); -int pf_step_out_of_anchor(struct pf_kanchor_stackframe *, int *, - struct pf_kruleset **, int, struct pf_krule **, - struct pf_krule **, int *); +enum pf_test_status pf_step_into_anchor(struct pf_test_ctx *, struct pf_krule *); +int pf_match_rule(struct pf_test_ctx *, struct pf_kruleset *); void pf_step_into_keth_anchor(struct pf_keth_anchor_stackframe *, int *, struct pf_keth_ruleset **, struct pf_keth_rule **, struct pf_keth_rule **, @@ -2706,8 +2740,7 @@ int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); u_short pf_get_translation(struct pf_pdesc *, int, struct pf_state_key **, struct pf_state_key **, - struct pf_kanchor_stackframe *, struct pf_krule **, - struct pf_udp_mapping **udp_mapping); + struct pf_test_ctx *, struct pf_udp_mapping **udp_mapping); u_short pf_get_transaddr(struct pf_pdesc *, struct pf_state_key **, struct pf_state_key **, struct pf_krule *, struct pf_udp_mapping **, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5c572dfcd425..a5f51d69ab2b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4629,13 +4629,6 @@ pf_tag_packet(struct pf_pdesc *pd, int tag) return (0); } -#define PF_ANCHOR_STACKSIZE 32 -struct pf_kanchor_stackframe { - struct pf_kruleset *rs; - struct pf_krule *r; /* XXX: + match bit */ - struct pf_kanchor *child; -}; - /* * XXX: We rely on malloc(9) returning pointer aligned addresses. */ @@ -4649,80 +4642,42 @@ struct pf_kanchor_stackframe { ((uintptr_t)(f)->r | PF_ANCHORSTACK_MATCH); \ } while (0) -void -pf_step_into_anchor(struct pf_kanchor_stackframe *stack, int *depth, - struct pf_kruleset **rs, int n, struct pf_krule **r, struct pf_krule **a) +enum pf_test_status +pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) { - struct pf_kanchor_stackframe *f; + enum pf_test_status rv; PF_RULES_RASSERT(); - if (*depth >= PF_ANCHOR_STACKSIZE) { + if (ctx->depth >= PF_ANCHOR_STACK_MAX) { printf("%s: anchor stack overflow on %s\n", - __func__, (*r)->anchor->name); - *r = TAILQ_NEXT(*r, entries); - return; - } else if (*depth == 0 && a != NULL) - *a = *r; - f = stack + (*depth)++; - f->rs = *rs; - f->r = *r; - if ((*r)->anchor_wildcard) { - struct pf_kanchor_node *parent = &(*r)->anchor->children; - - if ((f->child = RB_MIN(pf_kanchor_node, parent)) == NULL) { - *r = NULL; - return; - } - *rs = &f->child->ruleset; - } else { - f->child = NULL; - *rs = &(*r)->anchor->ruleset; + __func__, r->anchor->name); + return (PF_TEST_FAIL); } - *r = TAILQ_FIRST((*rs)->rules[n].active.ptr); -} -int -pf_step_out_of_anchor(struct pf_kanchor_stackframe *stack, int *depth, - struct pf_kruleset **rs, int n, struct pf_krule **r, struct pf_krule **a, - int *match) -{ - struct pf_kanchor_stackframe *f; - struct pf_krule *fr; - int quick = 0; - - PF_RULES_RASSERT(); + ctx->depth++; - do { - if (*depth <= 0) - break; - f = stack + *depth - 1; - fr = PF_ANCHOR_RULE(f); - if (f->child != NULL) { - f->child = RB_NEXT(pf_kanchor_node, - &fr->anchor->children, f->child); - if (f->child != NULL) { - *rs = &f->child->ruleset; - *r = TAILQ_FIRST((*rs)->rules[n].active.ptr); - if (*r == NULL) - continue; - else - break; + if (r->anchor_wildcard) { + struct pf_kanchor *child; + rv = PF_TEST_OK; + RB_FOREACH(child, pf_kanchor_node, &r->anchor->children) { + rv = pf_match_rule(ctx, &child->ruleset); + if ((rv == PF_TEST_QUICK) || (rv == PF_TEST_FAIL)) { + /* + * we either hit a rule qith quick action + * (more likely), or hit some runtime + * error (e.g. pool_get() faillure). + */ + break; } } - (*depth)--; - if (*depth == 0 && a != NULL) - *a = NULL; - *rs = f->rs; - if (match != NULL && *match > *depth) { - *match = *depth; - if (f->r->quick) - quick = 1; - } - *r = TAILQ_NEXT(fr, entries); - } while (*r == NULL); + } else { + rv = pf_match_rule(ctx, &r->anchor->ruleset); + } - return (quick); + ctx->depth--; + + return (rv); } struct pf_keth_anchor_stackframe { @@ -4749,7 +4704,7 @@ pf_step_into_keth_anchor(struct pf_keth_anchor_stackframe *stack, int *depth, if (match) *match = 0; - if (*depth >= PF_ANCHOR_STACKSIZE) { + if (*depth >= PF_ANCHOR_STACK_MAX) { printf("%s: anchor stack overflow on %s\n", __func__, (*r)->anchor->name); *r = TAILQ_NEXT(*r, entries); @@ -5240,7 +5195,7 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) int asd = 0, match = 0; int tag = -1; uint8_t action; - struct pf_keth_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; + struct pf_keth_anchor_stackframe anchor_stack[PF_ANCHOR_STACK_MAX]; MPASS(kif->pfik_ifp->if_vnet == curvnet); NET_EPOCH_ASSERT(); @@ -5495,12 +5450,11 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) return (action); } -#define PF_TEST_ATTRIB(t, a)\ - do { \ - if (t) { \ - r = a; \ - goto nextrule; \ - } \ +#define PF_TEST_ATTRIB(t, a) \ + if (t) { \ + r = a; \ + continue; \ + } else do { \ } while (0) static __inline u_short @@ -5555,132 +5509,18 @@ pf_rule_apply_nat(struct pf_pdesc *pd, struct pf_state_key **skp, return (PFRES_MAX); } -static int -pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, - struct pf_pdesc *pd, struct pf_krule **am, - struct pf_kruleset **rsm, u_short *reason, struct inpcb *inp) +enum pf_test_status +pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) { - struct pf_krule *nr = NULL; - struct pf_krule *r, *a = NULL; - struct pf_kruleset *ruleset = NULL; - struct pf_krule_slist match_rules; struct pf_krule_item *ri; - struct tcphdr *th = &pd->hdr.tcp; - struct pf_state_key *sk = NULL, *nk = NULL; + struct pf_krule *r; + struct pf_pdesc *pd = ctx->pd; u_short transerror; - int rewrite = 0; - int tag = -1; - int asd = 0; - int match = 0; - int state_icmp = 0, icmp_dir; - int action = PF_PASS; - u_int16_t virtual_type, virtual_id; - u_int16_t bproto_sum = 0, bip_sum = 0; - u_int8_t icmptype = 0, icmpcode = 0; - struct pf_kanchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; - struct pf_udp_mapping *udp_mapping = NULL; - struct pf_kpool *nat_pool = NULL; - - PF_RULES_RASSERT(); - - PF_ACPY(&pd->nsaddr, pd->src, pd->af); - PF_ACPY(&pd->ndaddr, pd->dst, pd->af); - - SLIST_INIT(&match_rules); - - if (inp != NULL) { - INP_LOCK_ASSERT(inp); - pd->lookup.uid = inp->inp_cred->cr_uid; - pd->lookup.gid = inp->inp_cred->cr_groups[0]; - pd->lookup.done = 1; - } - - if (pd->ip_sum) - bip_sum = *pd->ip_sum; - - switch (pd->virtual_proto) { - case IPPROTO_TCP: - bproto_sum = th->th_sum; - pd->nsport = th->th_sport; - pd->ndport = th->th_dport; - break; - case IPPROTO_UDP: - bproto_sum = pd->hdr.udp.uh_sum; - pd->nsport = pd->hdr.udp.uh_sport; - pd->ndport = pd->hdr.udp.uh_dport; - break; - case IPPROTO_SCTP: - pd->nsport = pd->hdr.sctp.src_port; - pd->ndport = pd->hdr.sctp.dest_port; - break; -#ifdef INET - case IPPROTO_ICMP: - MPASS(pd->af == AF_INET); - icmptype = pd->hdr.icmp.icmp_type; - icmpcode = pd->hdr.icmp.icmp_code; - state_icmp = pf_icmp_mapping(pd, icmptype, - &icmp_dir, &virtual_id, &virtual_type); - if (icmp_dir == PF_IN) { - pd->nsport = virtual_id; - pd->ndport = virtual_type; - } else { - pd->nsport = virtual_type; - pd->ndport = virtual_id; - } - break; -#endif /* INET */ -#ifdef INET6 - case IPPROTO_ICMPV6: - MPASS(pd->af == AF_INET6); - icmptype = pd->hdr.icmp6.icmp6_type; - icmpcode = pd->hdr.icmp6.icmp6_code; - state_icmp = pf_icmp_mapping(pd, icmptype, - &icmp_dir, &virtual_id, &virtual_type); - if (icmp_dir == PF_IN) { - pd->nsport = virtual_id; - pd->ndport = virtual_type; - } else { - pd->nsport = virtual_type; - pd->ndport = virtual_id; - } - - break; -#endif /* INET6 */ - default: - pd->nsport = pd->ndport = 0; - break; - } - pd->osport = pd->nsport; - pd->odport = pd->ndport; - - r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_FILTER].active.ptr); - - /* check packet for BINAT/NAT/RDR */ - transerror = pf_get_translation(pd, pd->off, &sk, &nk, anchor_stack, - &nr, &udp_mapping); - switch (transerror) { - default: - /* A translation error occurred. */ - REASON_SET(reason, transerror); - goto cleanup; - case PFRES_MAX: - /* No match. */ - break; - case PFRES_MATCH: - KASSERT(sk != NULL, ("%s: null sk", __func__)); - KASSERT(nk != NULL, ("%s: null nk", __func__)); - if (nr->log) { - PFLOG_PACKET(nr->action, PFRES_MATCH, nr, a, - ruleset, pd, 1, NULL); - } - - rewrite += pf_translate_compat(pd, sk, nk, nr, virtual_type); - nat_pool = &(nr->rdr); - } + r = TAILQ_FIRST(ruleset->rules[PF_RULESET_FILTER].active.ptr); while (r != NULL) { - if (pd->related_rule) { - *rm = pd->related_rule; + if (ctx->pd->related_rule) { + *ctx->rm = ctx->pd->related_rule; break; } pf_counter_u64_add(&r->evaluations, 1); @@ -5714,7 +5554,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, break; case IPPROTO_TCP: - PF_TEST_ATTRIB((r->flagset & tcp_get_flags(th)) != r->flags, + PF_TEST_ATTRIB((r->flagset & tcp_get_flags(ctx->th)) + != r->flags, TAILQ_NEXT(r, entries)); /* FALLTHROUGH */ case IPPROTO_SCTP: @@ -5744,10 +5585,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, case IPPROTO_ICMP: case IPPROTO_ICMPV6: /* icmp only. type always 0 in other cases */ - PF_TEST_ATTRIB(r->type && r->type != icmptype + 1, + PF_TEST_ATTRIB(r->type && r->type != ctx->icmptype + 1, TAILQ_NEXT(r, entries)); /* icmp only. type always 0 in other cases */ - PF_TEST_ATTRIB(r->code && r->code != icmpcode + 1, + PF_TEST_ATTRIB(r->code && r->code != ctx->icmpcode + 1, TAILQ_NEXT(r, entries)); break; @@ -5762,8 +5603,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, PF_TEST_ATTRIB(r->prob && r->prob <= arc4random(), TAILQ_NEXT(r, entries)); - PF_TEST_ATTRIB(r->match_tag && !pf_match_tag(pd->m, r, &tag, - pd->pf_mtag ? pd->pf_mtag->tag : 0), + PF_TEST_ATTRIB(r->match_tag && !pf_match_tag(pd->m, r, + &ctx->tag, pd->pf_mtag ? pd->pf_mtag->tag : 0), TAILQ_NEXT(r, entries)); PF_TEST_ATTRIB((r->rcv_kif && pf_match_rcvif(pd->m, r) == r->rcvifnot), @@ -5773,21 +5614,21 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, TAILQ_NEXT(r, entries)); PF_TEST_ATTRIB(r->os_fingerprint != PF_OSFP_ANY && (pd->virtual_proto != IPPROTO_TCP || !pf_osfp_match( - pf_osfp_fingerprint(pd, th), + pf_osfp_fingerprint(pd, ctx->th), r->os_fingerprint)), TAILQ_NEXT(r, entries)); /* FALLTHROUGH */ if (r->tag) - tag = r->tag; + ctx->tag = r->tag; if (r->anchor == NULL) { if (r->action == PF_MATCH) { /* * Apply translations before increasing counters, * in case it fails. */ - transerror = pf_rule_apply_nat(pd, &sk, &nk, r, - &nr, &udp_mapping, virtual_type, &rewrite, - &nat_pool); + transerror = pf_rule_apply_nat(pd, &ctx->sk, &ctx->nk, r, + &ctx->nr, &ctx->udp_mapping, ctx->virtual_type, + &ctx->rewrite, &ctx->nat_pool); switch (transerror) { case PFRES_MATCH: /* Translation action found in rule and applied successfully */ @@ -5796,16 +5637,16 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, break; default: /* Translation action found in rule but failed to apply */ - REASON_SET(reason, transerror); - goto cleanup; + REASON_SET(&ctx->reason, transerror); + return (PF_TEST_FAIL); } ri = malloc(sizeof(struct pf_krule_item), M_PF_RULE_ITEM, M_NOWAIT | M_ZERO); if (ri == NULL) { - REASON_SET(reason, PFRES_MEMORY); - goto cleanup; + REASON_SET(&ctx->reason, PFRES_MEMORY); + return (PF_TEST_FAIL); } ri->r = r; - SLIST_INSERT_HEAD(&match_rules, ri, entry); + SLIST_INSERT_HEAD(&ctx->rules, ri, entry); pf_counter_u64_critical_enter(); pf_counter_u64_add_protected(&r->packets[pd->dir == PF_OUT], 1); pf_counter_u64_add_protected(&r->bytes[pd->dir == PF_OUT], pd->tot_len); @@ -5813,36 +5654,183 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(r->action, PFRES_MATCH, r, - a, ruleset, pd, 1, NULL); + ctx->a, ruleset, pd, 1, NULL); } else { - match = asd; - *rm = r; - *am = a; - *rsm = ruleset; + /* + * found matching r + */ + *ctx->rm = r; + /* + * anchor, with ruleset, where r belongs to + */ + *ctx->am = ctx->a; + /* + * ruleset where r belongs to + */ + *ctx->rsm = ruleset; + /* + * ruleset, where anchor belongs to. + */ + ctx->arsm = ctx->aruleset; } if (pd->act.log & PF_LOG_MATCHES) - pf_log_matches(pd, r, a, ruleset, &match_rules); - if (r->quick) + pf_log_matches(pd, r, ctx->a, ruleset, &ctx->rules); + if (r->quick) { + ctx->test_status = PF_TEST_QUICK; break; - r = TAILQ_NEXT(r, entries); - } else - pf_step_into_anchor(anchor_stack, &asd, - &ruleset, PF_RULESET_FILTER, &r, &a); -nextrule: - if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, - &ruleset, PF_RULESET_FILTER, &r, &a, &match)) - break; + } + } else { + ctx->a = r; /* remember anchor */ + ctx->aruleset = ruleset; /* and its ruleset */ + if (ctx->a->quick) + ctx->test_status = PF_TEST_QUICK; + if (pf_step_into_anchor(ctx, r) != PF_TEST_OK) { + break; + } + } + r = TAILQ_NEXT(r, entries); + } + + return (ctx->test_status); +} + +static int +pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, + struct pf_pdesc *pd, struct pf_krule **am, + struct pf_kruleset **rsm, u_short *reason, struct inpcb *inp) +{ + struct pf_krule *r = NULL; + struct pf_kruleset *ruleset = NULL; + struct pf_krule_item *ri; + struct pf_test_ctx ctx; + u_short transerror; + int action = PF_PASS; + u_int16_t bproto_sum = 0, bip_sum = 0; + enum pf_test_status rv; + + PF_RULES_RASSERT(); + + bzero(&ctx, sizeof(ctx)); + ctx.tag = -1; + ctx.pd = pd; + ctx.rm = rm; + ctx.am = am; + ctx.rsm = rsm; + ctx.th = &pd->hdr.tcp; + ctx.reason = *reason; + SLIST_INIT(&ctx.rules); + + PF_ACPY(&pd->nsaddr, pd->src, pd->af); + PF_ACPY(&pd->ndaddr, pd->dst, pd->af); + + if (inp != NULL) { + INP_LOCK_ASSERT(inp); + pd->lookup.uid = inp->inp_cred->cr_uid; + pd->lookup.gid = inp->inp_cred->cr_groups[0]; + pd->lookup.done = 1; + } + + if (pd->ip_sum) + bip_sum = *pd->ip_sum; + + switch (pd->virtual_proto) { + case IPPROTO_TCP: + bproto_sum = ctx.th->th_sum; + pd->nsport = ctx.th->th_sport; + pd->ndport = ctx.th->th_dport; + break; + case IPPROTO_UDP: + bproto_sum = pd->hdr.udp.uh_sum; + pd->nsport = pd->hdr.udp.uh_sport; + pd->ndport = pd->hdr.udp.uh_dport; + break; + case IPPROTO_SCTP: + pd->nsport = pd->hdr.sctp.src_port; + pd->ndport = pd->hdr.sctp.dest_port; + break; +#ifdef INET + case IPPROTO_ICMP: + MPASS(pd->af == AF_INET); + ctx.icmptype = pd->hdr.icmp.icmp_type; + ctx.icmpcode = pd->hdr.icmp.icmp_code; + ctx.state_icmp = pf_icmp_mapping(pd, ctx.icmptype, + &ctx.icmp_dir, &ctx.virtual_id, &ctx.virtual_type); + if (ctx.icmp_dir == PF_IN) { + pd->nsport = ctx.virtual_id; + pd->ndport = ctx.virtual_type; + } else { + pd->nsport = ctx.virtual_type; + pd->ndport = ctx.virtual_id; + } + break; +#endif /* INET */ +#ifdef INET6 + case IPPROTO_ICMPV6: + MPASS(pd->af == AF_INET6); + ctx.icmptype = pd->hdr.icmp6.icmp6_type; + ctx.icmpcode = pd->hdr.icmp6.icmp6_code; + ctx.state_icmp = pf_icmp_mapping(pd, ctx.icmptype, + &ctx.icmp_dir, &ctx.virtual_id, &ctx.virtual_type); + if (ctx.icmp_dir == PF_IN) { + pd->nsport = ctx.virtual_id; + pd->ndport = ctx.virtual_type; + } else { + pd->nsport = ctx.virtual_type; + pd->ndport = ctx.virtual_id; + } + + break; +#endif /* INET6 */ + default: + pd->nsport = pd->ndport = 0; + break; } - r = *rm; - a = *am; - ruleset = *rsm; + pd->osport = pd->nsport; + pd->odport = pd->ndport; - REASON_SET(reason, PFRES_MATCH); + /* check packet for BINAT/NAT/RDR */ + transerror = pf_get_translation(pd, pd->off, &ctx.sk, &ctx.nk, &ctx, + &ctx.udp_mapping); + switch (transerror) { + default: + /* A translation error occurred. */ + REASON_SET(&ctx.reason, transerror); + goto cleanup; + case PFRES_MAX: + /* No match. */ + break; + case PFRES_MATCH: + KASSERT(ctx.sk != NULL, ("%s: null sk", __func__)); + KASSERT(ctx.nk != NULL, ("%s: null nk", __func__)); + if (ctx.nr->log) { + PFLOG_PACKET(ctx.nr->action, PFRES_MATCH, ctx.nr, ctx.a, + ruleset, pd, 1, NULL); + } + + ctx.rewrite += pf_translate_compat(pd, ctx.sk, ctx.nk, ctx.nr, ctx.virtual_type); + ctx.nat_pool = &(ctx.nr->rdr); + } + + ruleset = &pf_main_ruleset; + rv = pf_match_rule(&ctx, ruleset); + if (rv == PF_TEST_FAIL) { + /* + * Reason has been set in pf_match_rule() already. + */ + goto cleanup; + } + + r = *ctx.rm; /* matching rule */ + ctx.a = *ctx.am; /* rule that defines an anchor containing 'r' */ + ruleset = *ctx.rsm; /* ruleset of the anchor defined by the rule 'a' */ + ctx.aruleset = ctx.arsm; /* ruleset of the 'a' rule itself */ + + REASON_SET(&ctx.reason, PFRES_MATCH); /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - transerror = pf_rule_apply_nat(pd, &sk, &nk, r, &nr, &udp_mapping, - virtual_type, &rewrite, &nat_pool); + transerror = pf_rule_apply_nat(pd, &ctx.sk, &ctx.nk, r, &ctx.nr, &ctx.udp_mapping, + ctx.virtual_type, &ctx.rewrite, &ctx.nat_pool); switch (transerror) { case PFRES_MATCH: /* Translation action found in rule and applied successfully */ @@ -5851,31 +5839,31 @@ nextrule: break; default: /* Translation action found in rule but failed to apply */ - REASON_SET(reason, transerror); + REASON_SET(&ctx.reason, transerror); goto cleanup; } if (r->log) { - if (rewrite) + if (ctx.rewrite) m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); - PFLOG_PACKET(r->action, *reason, r, a, ruleset, pd, 1, NULL); + PFLOG_PACKET(r->action, ctx.reason, r, ctx.a, ruleset, pd, 1, NULL); } if (pd->act.log & PF_LOG_MATCHES) - pf_log_matches(pd, r, a, ruleset, &match_rules); + pf_log_matches(pd, r, ctx.a, ruleset, &ctx.rules); if (pd->virtual_proto != PF_VPROTO_FRAGMENT && (r->action == PF_DROP) && ((r->rule_flag & PFRULE_RETURNRST) || (r->rule_flag & PFRULE_RETURNICMP) || (r->rule_flag & PFRULE_RETURN))) { - pf_return(r, nr, pd, th, bproto_sum, - bip_sum, reason, r->rtableid); + pf_return(r, ctx.nr, pd, ctx.th, bproto_sum, + bip_sum, &ctx.reason, r->rtableid); } if (r->action == PF_DROP) goto cleanup; - if (tag > 0 && pf_tag_packet(pd, tag)) { - REASON_SET(reason, PFRES_MEMORY); + if (ctx.tag > 0 && pf_tag_packet(pd, ctx.tag)) { + REASON_SET(&ctx.reason, PFRES_MEMORY); goto cleanup; } if (pd->act.rtableid >= 0) @@ -5890,31 +5878,32 @@ nextrule: */ pd->act.rt = r->rt; /* Don't use REASON_SET, pf_map_addr increases the reason counters */ - *reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, + ctx.reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, &pd->act.rt_kif, NULL, &sn, &snh, &(r->route), PF_SN_ROUTE); - if (*reason != 0) + if (ctx.reason != 0) goto cleanup; } if (pd->virtual_proto != PF_VPROTO_FRAGMENT && - (!state_icmp && (r->keep_state || nr != NULL || + (!ctx.state_icmp && (r->keep_state || ctx.nr != NULL || (pd->flags & PFDESC_TCP_NORM)))) { bool nat64; - action = pf_create_state(r, nr, a, pd, nk, sk, - &rewrite, sm, tag, bproto_sum, bip_sum, - &match_rules, udp_mapping, nat_pool, reason); - sk = nk = NULL; + action = pf_create_state(r, ctx.nr, ctx.a, pd, ctx.nk, ctx.sk, + &ctx.rewrite, sm, ctx.tag, bproto_sum, bip_sum, + &ctx.rules, ctx.udp_mapping, ctx.nat_pool, &ctx.reason); + ctx.sk = ctx.nk = NULL; if (action != PF_PASS) { - pf_udp_mapping_release(udp_mapping); - if (r->log || (nr != NULL && nr->log) || - *reason == PFRES_MEMORY) + pf_udp_mapping_release(ctx.udp_mapping); + if (r->log || (ctx.nr != NULL && ctx.nr->log) || + ctx.reason == PFRES_MEMORY) pd->act.log |= PF_LOG_FORCE; if (action == PF_DROP && (r->rule_flag & PFRULE_RETURN)) - pf_return(r, nr, pd, th, - bproto_sum, bip_sum, reason, + pf_return(r, ctx.nr, pd, ctx.th, + bproto_sum, bip_sum, &ctx.reason, pd->act.rtableid); + *reason = ctx.reason; return (action); } @@ -5922,69 +5911,73 @@ nextrule: if (nat64) { int ret; - if (sk == NULL) - sk = (*sm)->key[pd->dir == PF_IN ? PF_SK_STACK : PF_SK_WIRE]; - if (nk == NULL) - nk = (*sm)->key[pd->dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK]; + if (ctx.sk == NULL) + ctx.sk = (*sm)->key[pd->dir == PF_IN ? PF_SK_STACK : PF_SK_WIRE]; + if (ctx.nk == NULL) + ctx.nk = (*sm)->key[pd->dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK]; if (pd->dir == PF_IN) { - ret = pf_translate(pd, &sk->addr[pd->didx], - sk->port[pd->didx], &sk->addr[pd->sidx], - sk->port[pd->sidx], virtual_type, - icmp_dir); + ret = pf_translate(pd, &ctx.sk->addr[pd->didx], + ctx.sk->port[pd->didx], &ctx.sk->addr[pd->sidx], + ctx.sk->port[pd->sidx], ctx.virtual_type, + ctx.icmp_dir); } else { - ret = pf_translate(pd, &sk->addr[pd->sidx], - sk->port[pd->sidx], &sk->addr[pd->didx], - sk->port[pd->didx], virtual_type, - icmp_dir); + ret = pf_translate(pd, &ctx.sk->addr[pd->sidx], + ctx.sk->port[pd->sidx], &ctx.sk->addr[pd->didx], + ctx.sk->port[pd->didx], ctx.virtual_type, + ctx.icmp_dir); } if (ret < 0) goto cleanup; - rewrite += ret; + ctx.rewrite += ret; - if (rewrite && sk->af != nk->af) + if (ctx.rewrite && ctx.sk->af != ctx.nk->af) action = PF_AFRT; } } else { - while ((ri = SLIST_FIRST(&match_rules))) { - SLIST_REMOVE_HEAD(&match_rules, entry); + while ((ri = SLIST_FIRST(&ctx.rules))) { + SLIST_REMOVE_HEAD(&ctx.rules, entry); free(ri, M_PF_RULE_ITEM); } - uma_zfree(V_pf_state_key_z, sk); - uma_zfree(V_pf_state_key_z, nk); - sk = nk = NULL; - pf_udp_mapping_release(udp_mapping); + uma_zfree(V_pf_state_key_z, ctx.sk); + uma_zfree(V_pf_state_key_z, ctx.nk); + ctx.sk = ctx.nk = NULL; + pf_udp_mapping_release(ctx.udp_mapping); } /* copy back packet headers if we performed NAT operations */ - if (rewrite) + if (ctx.rewrite) m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) && pd->dir == PF_OUT && - V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, pd->m)) + V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, pd->m)) { /* * We want the state created, but we dont * want to send this in case a partner * firewall has to know about it to allow * replies through it. */ + *reason = ctx.reason; return (PF_DEFER); + } + *reason = ctx.reason; return (action); cleanup: - while ((ri = SLIST_FIRST(&match_rules))) { - SLIST_REMOVE_HEAD(&match_rules, entry); + while ((ri = SLIST_FIRST(&ctx.rules))) { + SLIST_REMOVE_HEAD(&ctx.rules, entry); free(ri, M_PF_RULE_ITEM); } - uma_zfree(V_pf_state_key_z, sk); - uma_zfree(V_pf_state_key_z, nk); - pf_udp_mapping_release(udp_mapping); + uma_zfree(V_pf_state_key_z, ctx.sk); + uma_zfree(V_pf_state_key_z, ctx.nk); + pf_udp_mapping_release(ctx.udp_mapping); + *reason = ctx.reason; return (PF_DROP); } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 00f25c29e23c..ed87aa2cec4d 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -75,8 +75,9 @@ VNET_DEFINE_STATIC(int, pf_rdr_srcport_rewrite_tries) = 16; static uint64_t pf_hash(struct pf_addr *, struct pf_addr *, struct pf_poolhashkey *, sa_family_t); -struct pf_krule *pf_match_translation(struct pf_pdesc *, - int, struct pf_kanchor_stackframe *); +struct pf_krule *pf_match_translation(int, struct pf_test_ctx *); +static enum pf_test_status pf_step_into_translation_anchor(int, struct pf_test_ctx *, + struct pf_krule *); static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, struct pf_addr *, uint16_t *, uint16_t, uint16_t, struct pf_ksrc_node **, struct pf_srchash **, @@ -128,25 +129,21 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, return (res); } -#define PF_TEST_ATTRIB(t, a)\ - do { \ - if (t) { \ - r = a; \ - goto nextrule; \ - } \ +#define PF_TEST_ATTRIB(t, a) \ + if (t) { \ + r = a; \ + continue; \ + } else do { \ } while (0) -struct pf_krule * -pf_match_translation(struct pf_pdesc *pd, - int rs_num, struct pf_kanchor_stackframe *anchor_stack) +static enum pf_test_status +pf_match_translation_rule(int rs_num, struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) { - struct pf_krule *r, *rm = NULL; - struct pf_kruleset *ruleset = NULL; - int tag = -1; + struct pf_krule *r; + struct pf_pdesc *pd = ctx->pd; int rtableid = -1; - int asd = 0; - r = TAILQ_FIRST(pf_main_ruleset.rules[rs_num].active.ptr); + r = TAILQ_FIRST(ruleset->rules[rs_num].active.ptr); while (r != NULL) { struct pf_rule_addr *src = NULL, *dst = NULL; struct pf_addr_wrap *xdst = NULL; @@ -188,7 +185,7 @@ pf_match_translation(struct pf_pdesc *pd, !pf_match_port(dst->port_op, dst->port[0], dst->port[1], pd->ndport), r->skip[PF_SKIP_DST_PORT]); - PF_TEST_ATTRIB(r->match_tag && !pf_match_tag(pd->m, r, &tag, + PF_TEST_ATTRIB(r->match_tag && !pf_match_tag(pd->m, r, &ctx->tag, pd->pf_mtag ? pd->pf_mtag->tag : 0), TAILQ_NEXT(r, entries)); PF_TEST_ATTRIB(r->os_fingerprint != PF_OSFP_ANY && (pd->proto != @@ -196,33 +193,101 @@ pf_match_translation(struct pf_pdesc *pd, &pd->hdr.tcp), r->os_fingerprint)), TAILQ_NEXT(r, entries)); if (r->tag) - tag = r->tag; + ctx->tag = r->tag; if (r->rtableid >= 0) rtableid = r->rtableid; if (r->anchor == NULL) { - rm = r; - if (rm->action == PF_NONAT || - rm->action == PF_NORDR || - rm->action == PF_NOBINAT) { - rm = NULL; + if (r->action == PF_NONAT || + r->action == PF_NORDR || + r->action == PF_NOBINAT) { + *ctx->rm = NULL; + } else { + /* + * found matching r + */ + ctx->tr = r; + /* + * anchor, with ruleset, where r belongs to + */ + *ctx->am = ctx->a; + /* + * ruleset where r belongs to + */ + *ctx->rsm = ruleset; + /* + * ruleset, where anchor belongs to. + */ + ctx->arsm = ctx->aruleset; } - break; *** 122 LINES SKIPPED *** From nobody Mon Jun 2 15:30:35 2025 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 4b9yTm0cDCz5wyDQ; Mon, 02 Jun 2025 15:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9yTl5Qphz47Py; Mon, 02 Jun 2025 15:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g3Odz5MoetP7klza5VPGLdZqzPpXmV7mZm5KtV9vnYQ=; b=jn2tJg+cWNC8s5b5W/zbh64YbnKvJY4kci6hSSH5fwnQlYm6LNb1sxVwtOqK/Bgp35VWNN ajAshKzSEuRYxFh4E8Po16ldYKYBnuKuEkQMt0PtmHzl0+JurGTZQjT1XmLyBuD8JcVqJn xUNyIIb8/gN+9tTH8BGQNGaFhc4hf3zLvH9kKDoM0JMq5ZVQnUCRq5BCerf1NRDk+BIXch RPUEyS+wencXuT0FZISJQZ1aEpxefYbBfkldQYu1Px6j0htU84FBJ6JoFPhK+Uu5x1vHEu 4Pfqhu6df5TXvoIdx3LFn9eaelesG7LqkN1YPLQM9T7Zjsx9PFERcleh/kZXEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g3Odz5MoetP7klza5VPGLdZqzPpXmV7mZm5KtV9vnYQ=; b=eYsyw0Z7ERBfrKXxEwbV4oPATK3XoJMS5Rc2tD/mroqoA5WJHss6/4v1PRdzlI30S7PN4H JQ34fMrSqtN81g51axXpVZDj3D7Oq5JmDL7wmGDByESmDLYdCYSgjOR/zIx5/6y7lsCUaP G+5QOuEX9RsA5f7Q6wi+7Ehb1KJ35ZZwZGzZbMxhPbeylrGrtBhcgW8SyRkJxlJNOxPC5x nNKwRKnIQfyhhYhwQw5wGoaRNquP00EhMpuOIDipbz/y3xTmXqKOPsLy37sOfq/U9tykIz RMZnU0t2LjH+2XqNODt0NSQBsNo10cTFUsDSsiqX9bdTesTtQ8MOFweiI82l5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748878235; a=rsa-sha256; cv=none; b=wkKdx6AJDJ6epYPVapFPiXr96BRWUo8Dp9gfBPrILtuSCZF1FflSQ2/OZWvB7WitHjtHQi Fw75FVhjVkWmBLMpMikuz9XJ4/tHjMh2bWVRCLWyCIS8Uj0bFr9kCNjVv7zIyd3jT4EiPk lmO8HzK9VArlu3Q2fK/1fRrZsCW8Be1ZasXY6e8AZ9VU9O1C/FO5KFOJcT8NicUePDYerA BpxgcfNyniRL05fuqAyem9xKSZqYlcyhzILoYW+nGbGR7Jh8K3C60DJds1TYoPFvA7xol0 9LfxQtukqfgQuGUSHpPnRllrIyp5w4mWPf9snh0n3DChO6Wxm+n1nprd2zZFIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9yTl2lv8z1DDc; Mon, 02 Jun 2025 15:30:35 +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 552FUZsg049912; Mon, 2 Jun 2025 15:30:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FUZF4049884; Mon, 2 Jun 2025 15:30:35 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:30:35 GMT Message-Id: <202506021530.552FUZF4049884@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: 1e4c562fdfb2 - main - pf: remove unused argument from pf_get_translation() 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: 1e4c562fdfb211c6f23179dba3952757ed7b8ee3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4c562fdfb211c6f23179dba3952757ed7b8ee3 commit 1e4c562fdfb211c6f23179dba3952757ed7b8ee3 Author: Kristof Provost AuthorDate: 2025-06-02 08:23:43 +0000 Commit: Kristof Provost CommitDate: 2025-06-02 15:30:18 +0000 pf: remove unused argument from pf_get_translation() No functional change. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 2 +- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b3e3260d80a6..c77744d55314 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2739,7 +2739,7 @@ u_short pf_map_addr_sn(u_int8_t, struct pf_krule *, int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); u_short pf_get_translation(struct pf_pdesc *, - int, struct pf_state_key **, struct pf_state_key **, + struct pf_state_key **, struct pf_state_key **, struct pf_test_ctx *, struct pf_udp_mapping **udp_mapping); u_short pf_get_transaddr(struct pf_pdesc *, struct pf_state_key **, struct pf_state_key **, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a5f51d69ab2b..7fb544460b02 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5789,7 +5789,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pd->odport = pd->ndport; /* check packet for BINAT/NAT/RDR */ - transerror = pf_get_translation(pd, pd->off, &ctx.sk, &ctx.nk, &ctx, + transerror = pf_get_translation(pd, &ctx.sk, &ctx.nk, &ctx, &ctx.udp_mapping); switch (transerror) { default: diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index ed87aa2cec4d..697f680c97bf 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -843,7 +843,7 @@ done: } u_short -pf_get_translation(struct pf_pdesc *pd, int off, +pf_get_translation(struct pf_pdesc *pd, struct pf_state_key **skp, struct pf_state_key **nkp, struct pf_test_ctx *ctx, struct pf_udp_mapping **udp_mapping) { From nobody Mon Jun 2 15:30:36 2025 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 4b9yTn3yM1z5wyDS; Mon, 02 Jun 2025 15:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9yTm75L6z47W4; Mon, 02 Jun 2025 15:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2D/7KvBd2gH7qkOpHNT29jsUZlBOkk0yZNRgQuKJWg=; b=Dd+KXjDdnldotJaYNgAPRgc4Rxs0qAD1JjNvPgmKiGk1zRcctbYVL4K5LZkcO0aGDba9g6 N9jUlO8QUKJIBgOObNnZpOQy1sMqROizzL+fQ8LrXyn60o+pQVRt10dPhD2T2fpFD0xkKp 1LfDRl2VUBiW124yFepwHfr29R5ULhoT4mcn7W57kKrUqvLwhWI9iTfCE+44mQCDwNCMBr /tK+hjMAlhMs6PyQAIy+HvScqASYzSteumvDei6UX16vKfc53VGwyrXmqEAfDpeJMTdIrU YOYSneYqTzp16Q2d52D0jNNmX6d2t7Mds41bn1zXpdZagX+S9CRDfq7Cj39w8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748878237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2D/7KvBd2gH7qkOpHNT29jsUZlBOkk0yZNRgQuKJWg=; b=Id8F9EA/4crnkDVxLt7uvRJXskDwr/slAT5elahTasjR+gTXTdBSrabusJXH94crSkDoTg Nvz2MoY7+fi5bHO6zK6xIDiI5GMpBaqQiv7wVoSgEk3Vc3UK3yN8iU+jr8vCFYCDOeTJ/T UtCOQ6ORX/nQaf3LoteDBgVRburWO77BViOBdiNP5FOqcj+xBdTThwYdi4/ODZPSp3p3IY Sef3/KIiJWS1wNqhRULisx8TNQiW9IENKJAFiq1VWIBXJIrU2pobk5NI5s2fy+dLE0CjWl mRYn1kCEbYK7MvjmACQPrtreW0tnsAK3DnARx7TNh6aP77H/ST4/nXcMt5MxCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748878237; a=rsa-sha256; cv=none; b=rNTNKoCctHpYiDxkDELCd8rbI0dBSAPiTUYx/TQYkQY5oOMTY498bj6PTVkFRVoE4Qfx5h MBE5LUZ4Bczf0bXj2pakyfyaraPpBn1y0maVbsufaOIqqYi+95sYYu72OLSbHKE3y5M2cP YaMweeqYz0LXoKUe6w8CgQnQagJD3I6U0qIPdHoM+MVPtQASOsii+Vwb33SzHRMKiRCjsj YWXeqIIRjn+TlCxgqkJLKZyjwcKRjSl6Lx2AEFStdjrPXEiBA7ZnJHsXR0CxEtM37zlx70 4sEWexDAKtn+fdrQWaPaTc2xDQHSC8GU0SjVBJD+aXYfUpSSTisnd8pAkJip3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b9yTm3WRvz1DDd; Mon, 02 Jun 2025 15:30:36 +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 552FUaLe050722; Mon, 2 Jun 2025 15:30:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552FUaoV050718; Mon, 2 Jun 2025 15:30:36 GMT (envelope-from git) Date: Mon, 2 Jun 2025 15:30:36 GMT Message-Id: <202506021530.552FUaoV050718@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: ab239dfb225b - main - pf: use struct pf_test_ctx as function argument 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: ab239dfb225b35972e20dc599258fc32d4e73ad5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab239dfb225b35972e20dc599258fc32d4e73ad5 commit ab239dfb225b35972e20dc599258fc32d4e73ad5 Author: Kristof Provost AuthorDate: 2025-06-02 09:06:20 +0000 Commit: Kristof Provost CommitDate: 2025-06-02 15:30:18 +0000 pf: use struct pf_test_ctx as function argument Use the struct rather than passing individual fields as arguments. No functional change. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 13 ++--- sys/netpfil/pf/pf.c | 149 ++++++++++++++++++++++--------------------------- sys/netpfil/pf/pf_lb.c | 46 ++++++++------- 3 files changed, 94 insertions(+), 114 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index c77744d55314..6209a93dd995 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2738,16 +2738,11 @@ u_short pf_map_addr_sn(u_int8_t, struct pf_krule *, struct pf_kpool *, pf_sn_types_t); int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); -u_short pf_get_translation(struct pf_pdesc *, - struct pf_state_key **, struct pf_state_key **, - struct pf_test_ctx *, struct pf_udp_mapping **udp_mapping); -u_short pf_get_transaddr(struct pf_pdesc *, - struct pf_state_key **, struct pf_state_key **, - struct pf_krule *, struct pf_udp_mapping **, +u_short pf_get_translation(struct pf_test_ctx *); +u_short pf_get_transaddr(struct pf_test_ctx *, + struct pf_krule *, u_int8_t, struct pf_kpool *); -int pf_translate_compat(struct pf_pdesc *, - struct pf_state_key *, struct pf_state_key *, - struct pf_krule *, u_int16_t); +int pf_translate_compat(struct pf_test_ctx *); int pf_state_key_setup(struct pf_pdesc *, u_int16_t, u_int16_t, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7fb544460b02..4451cca76842 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -343,12 +343,9 @@ static int pf_test_eth_rule(int, struct pfi_kkif *, static int pf_test_rule(struct pf_krule **, struct pf_kstate **, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **, u_short *, struct inpcb *); -static int pf_create_state(struct pf_krule *, struct pf_krule *, - struct pf_krule *, struct pf_pdesc *, - struct pf_state_key *, struct pf_state_key *, int *, - struct pf_kstate **, int, u_int16_t, u_int16_t, - struct pf_krule_slist *, struct pf_udp_mapping *, - struct pf_kpool *, u_short *); +static int pf_create_state(struct pf_krule *, + struct pf_test_ctx *, + struct pf_kstate **, u_int16_t, u_int16_t); static int pf_state_key_addr_setup(struct pf_pdesc *, struct pf_state_key_cmp *, int); static int pf_tcp_track_full(struct pf_kstate *, @@ -5458,49 +5455,46 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) } while (0) static __inline u_short -pf_rule_apply_nat(struct pf_pdesc *pd, struct pf_state_key **skp, - struct pf_state_key **nkp, struct pf_krule *r, struct pf_krule **nr, - struct pf_udp_mapping **udp_mapping, u_int16_t virtual_type, int *rewrite, - struct pf_kpool **nat_pool) +pf_rule_apply_nat(struct pf_test_ctx *ctx, struct pf_krule *r) { + struct pf_pdesc *pd = ctx->pd; u_short transerror; u_int8_t nat_action; if (r->rule_flag & PFRULE_AFTO) { /* Don't translate if there was an old style NAT rule */ - if (*nr != NULL) + if (ctx->nr != NULL) return (PFRES_TRANSLATE); /* pass af-to rules, unsupported on match rules */ KASSERT(r->action != PF_MATCH, ("%s: af-to on match rule", __func__)); /* XXX I can imagine scenarios where we have both NAT and RDR source tracking */ - *nat_pool = &(r->nat); - (*nr) = r; + ctx->nat_pool = &(r->nat); + ctx->nr = r; pd->naf = r->naf; - if (pf_get_transaddr_af(*nr, pd) == -1) { + if (pf_get_transaddr_af(ctx->nr, pd) == -1) { return (PFRES_TRANSLATE); } return (PFRES_MATCH); } else if (r->rdr.cur || r->nat.cur) { /* Don't translate if there was an old style NAT rule */ - if (*nr != NULL) + if (ctx->nr != NULL) return (PFRES_TRANSLATE); /* match/pass nat-to/rdr-to rules */ - (*nr) = r; + ctx->nr = r; if (r->nat.cur) { nat_action = PF_NAT; - *nat_pool = &(r->nat); + ctx->nat_pool = &(r->nat); } else { nat_action = PF_RDR; - *nat_pool = &(r->rdr); + ctx->nat_pool = &(r->rdr); } - transerror = pf_get_transaddr(pd, skp, nkp, *nr, udp_mapping, - nat_action, *nat_pool); + transerror = pf_get_transaddr(ctx, ctx->nr, + nat_action, ctx->nat_pool); if (transerror == PFRES_MATCH) { - (*rewrite) += pf_translate_compat(pd, *skp, *nkp, *nr, - virtual_type); + ctx->rewrite += pf_translate_compat(ctx); return(PFRES_MATCH); } return (transerror); @@ -5626,9 +5620,7 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) * Apply translations before increasing counters, * in case it fails. */ - transerror = pf_rule_apply_nat(pd, &ctx->sk, &ctx->nk, r, - &ctx->nr, &ctx->udp_mapping, ctx->virtual_type, - &ctx->rewrite, &ctx->nat_pool); + transerror = pf_rule_apply_nat(ctx, r); switch (transerror) { case PFRES_MATCH: /* Translation action found in rule and applied successfully */ @@ -5789,8 +5781,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pd->odport = pd->ndport; /* check packet for BINAT/NAT/RDR */ - transerror = pf_get_translation(pd, &ctx.sk, &ctx.nk, &ctx, - &ctx.udp_mapping); + transerror = pf_get_translation(&ctx); switch (transerror) { default: /* A translation error occurred. */ @@ -5807,7 +5798,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, ruleset, pd, 1, NULL); } - ctx.rewrite += pf_translate_compat(pd, ctx.sk, ctx.nk, ctx.nr, ctx.virtual_type); + ctx.rewrite += pf_translate_compat(&ctx); ctx.nat_pool = &(ctx.nr->rdr); } @@ -5829,8 +5820,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - transerror = pf_rule_apply_nat(pd, &ctx.sk, &ctx.nk, r, &ctx.nr, &ctx.udp_mapping, - ctx.virtual_type, &ctx.rewrite, &ctx.nat_pool); + transerror = pf_rule_apply_nat(&ctx, r); switch (transerror) { case PFRES_MATCH: /* Translation action found in rule and applied successfully */ @@ -5889,9 +5879,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, (pd->flags & PFDESC_TCP_NORM)))) { bool nat64; - action = pf_create_state(r, ctx.nr, ctx.a, pd, ctx.nk, ctx.sk, - &ctx.rewrite, sm, ctx.tag, bproto_sum, bip_sum, - &ctx.rules, ctx.udp_mapping, ctx.nat_pool, &ctx.reason); + action = pf_create_state(r, &ctx, sm, bproto_sum, bip_sum); ctx.sk = ctx.nk = NULL; if (action != PF_PASS) { pf_udp_mapping_release(ctx.udp_mapping); @@ -5983,13 +5971,10 @@ cleanup: } static int -pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, - struct pf_pdesc *pd, struct pf_state_key *nk, struct pf_state_key *sk, - int *rewrite, struct pf_kstate **sm, int tag, u_int16_t bproto_sum, - u_int16_t bip_sum, struct pf_krule_slist *match_rules, - struct pf_udp_mapping *udp_mapping, struct pf_kpool *nat_pool, - u_short *reason) +pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, + struct pf_kstate **sm, u_int16_t bproto_sum, u_int16_t bip_sum) { + struct pf_pdesc *pd = ctx->pd; struct pf_kstate *s = NULL; struct pf_ksrc_node *sns[PF_SN_MAX] = { NULL }; /* @@ -6007,14 +5992,14 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (r->max_states && (counter_u64_fetch(r->states_cur) >= r->max_states)) { counter_u64_add(V_pf_status.lcounters[LCNT_STATES], 1); - REASON_SET(reason, PFRES_MAXSTATES); + REASON_SET(&ctx->reason, PFRES_MAXSTATES); goto csfailed; } /* src node for limits */ if ((r->rule_flag & PFRULE_SRCTRACK) && (sn_reason = pf_insert_src_node(sns, snhs, r, pd->src, pd->af, NULL, NULL, PF_SN_LIMIT)) != 0) { - REASON_SET(reason, sn_reason); + REASON_SET(&ctx->reason, sn_reason); goto csfailed; } /* src node for route-to rule */ @@ -6023,30 +6008,30 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, (sn_reason = pf_insert_src_node(sns, snhs, r, pd->src, pd->af, &pd->act.rt_addr, pd->act.rt_kif, PF_SN_ROUTE)) != 0) { - REASON_SET(reason, sn_reason); + REASON_SET(&ctx->reason, sn_reason); goto csfailed; } } /* src node for translation rule */ - if (nr != NULL) { - KASSERT(nat_pool != NULL, ("%s: nat_pool is NULL", __func__)); - if ((nat_pool->opts & PF_POOL_STICKYADDR) && - (sn_reason = pf_insert_src_node(sns, snhs, nr, - &sk->addr[pd->sidx], pd->af, &nk->addr[1], NULL, + if (ctx->nr != NULL) { + KASSERT(ctx->nat_pool != NULL, ("%s: nat_pool is NULL", __func__)); + if ((ctx->nat_pool->opts & PF_POOL_STICKYADDR) && + (sn_reason = pf_insert_src_node(sns, snhs, ctx->nr, + &ctx->sk->addr[pd->sidx], pd->af, &ctx->nk->addr[1], NULL, PF_SN_NAT)) != 0 ) { - REASON_SET(reason, sn_reason); + REASON_SET(&ctx->reason, sn_reason); goto csfailed; } } s = pf_alloc_state(M_NOWAIT); if (s == NULL) { - REASON_SET(reason, PFRES_MEMORY); + REASON_SET(&ctx->reason, PFRES_MEMORY); goto csfailed; } s->rule = r; - s->nat_rule = nr; - s->anchor = a; - memcpy(&s->match_rules, match_rules, sizeof(s->match_rules)); + s->nat_rule = ctx->nr; + s->anchor = ctx->a; + memcpy(&s->match_rules, &ctx->rules, sizeof(s->match_rules)); memcpy(&s->act, &pd->act, sizeof(struct pf_rule_actions)); if (pd->act.allow_opts) @@ -6056,15 +6041,15 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (pd->flags & PFDESC_TCP_NORM) /* Set by old-style scrub rules */ s->state_flags |= PFSTATE_SCRUB_TCP; if ((r->rule_flag & PFRULE_PFLOW) || - (nr != NULL && nr->rule_flag & PFRULE_PFLOW)) + (ctx->nr != NULL && ctx->nr->rule_flag & PFRULE_PFLOW)) s->state_flags |= PFSTATE_PFLOW; s->act.log = pd->act.log & PF_LOG_ALL; s->sync_state = PFSYNC_S_NONE; s->state_flags |= pd->act.flags; /* Only needed for pfsync and state export */ - if (nr != NULL) - s->act.log |= nr->log & PF_LOG_ALL; + if (ctx->nr != NULL) + s->act.log |= ctx->nr->log & PF_LOG_ALL; switch (pd->proto) { case IPPROTO_TCP: s->src.seqlo = ntohl(th->th_seq); @@ -6077,7 +6062,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->src.seqdiff = 1; pf_change_proto_a(pd->m, &th->th_seq, &th->th_sum, htonl(s->src.seqlo + s->src.seqdiff), 0); - *rewrite = 1; + ctx->rewrite = 1; } else s->src.seqdiff = 0; if (tcp_get_flags(th) & TH_SYN) { @@ -6128,12 +6113,12 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (pd->proto == IPPROTO_TCP) { if (s->state_flags & PFSTATE_SCRUB_TCP && pf_normalize_tcp_init(pd, th, &s->src)) { - REASON_SET(reason, PFRES_MEMORY); + REASON_SET(&ctx->reason, PFRES_MEMORY); goto csfailed; } if (s->state_flags & PFSTATE_SCRUB_TCP && s->src.scrub && - pf_normalize_tcp_stateful(pd, reason, th, s, - &s->src, &s->dst, rewrite)) { + pf_normalize_tcp_stateful(pd, &ctx->reason, th, s, + &s->src, &s->dst, &ctx->rewrite)) { /* This really shouldn't happen!!! */ DPFPRINTF(PF_DEBUG_URGENT, ("%s: tcp normalize failed on first " @@ -6151,25 +6136,26 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, /* * sk/nk could already been setup by pf_get_translation(). */ - if (sk == NULL && nk == NULL) { + if (ctx->sk == NULL && ctx->nk == NULL) { MPASS(pd->sport == NULL || (pd->osport == *pd->sport)); MPASS(pd->dport == NULL || (pd->odport == *pd->dport)); - if (pf_state_key_setup(pd, pd->nsport, pd->ndport, &sk, &nk)) { + if (pf_state_key_setup(pd, pd->nsport, pd->ndport, + &ctx->sk, &ctx->nk)) { goto csfailed; } } else - KASSERT((sk != NULL && nk != NULL), ("%s: nr %p sk %p, nk %p", - __func__, nr, sk, nk)); + KASSERT((ctx->sk != NULL && ctx->nk != NULL), ("%s: nr %p sk %p, nk %p", + __func__, ctx->nr, ctx->sk, ctx->nk)); /* Swap sk/nk for PF_OUT. */ if (pf_state_insert(BOUND_IFACE(s, pd), pd->kif, - (pd->dir == PF_IN) ? sk : nk, - (pd->dir == PF_IN) ? nk : sk, s)) { - REASON_SET(reason, PFRES_STATEINS); + (pd->dir == PF_IN) ? ctx->sk : ctx->nk, + (pd->dir == PF_IN) ? ctx->nk : ctx->sk, s)) { + REASON_SET(&ctx->reason, PFRES_STATEINS); goto drop; } else *sm = s; - sk = nk = NULL; + ctx->sk = ctx->nk = NULL; STATE_INC_COUNTERS(s); @@ -6183,12 +6169,12 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, } } - if (tag > 0) - s->tag = tag; + if (ctx->tag > 0) + s->tag = ctx->tag; if (pd->proto == IPPROTO_TCP && (tcp_get_flags(th) & (TH_SYN|TH_ACK)) == TH_SYN && r->keep_state == PF_STATE_SYNPROXY) { pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_SRC); - pf_undo_nat(nr, pd, bip_sum); + pf_undo_nat(ctx->nr, pd, bip_sum); s->src.seqhi = arc4random(); /* Find mss option */ int rtid = M_GETFIB(pd->m); @@ -6200,22 +6186,22 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, TH_SYN|TH_ACK, 0, s->src.mss, 0, M_SKIP_FIREWALL, 0, 0, pd->act.rtableid); - REASON_SET(reason, PFRES_SYNPROXY); + REASON_SET(&ctx->reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } - s->udp_mapping = udp_mapping; + s->udp_mapping = ctx->udp_mapping; return (PF_PASS); csfailed: - while ((ri = SLIST_FIRST(match_rules))) { - SLIST_REMOVE_HEAD(match_rules, entry); + while ((ri = SLIST_FIRST(&ctx->rules))) { + SLIST_REMOVE_HEAD(&ctx->rules, entry); free(ri, M_PF_RULE_ITEM); } - uma_zfree(V_pf_state_key_z, sk); - uma_zfree(V_pf_state_key_z, nk); + uma_zfree(V_pf_state_key_z, ctx->sk); + uma_zfree(V_pf_state_key_z, ctx->nk); for (pf_sn_types_t sn_type=0; sn_typepd; + struct pf_state_key *nk = ctx->nk; struct tcphdr *th = &pd->hdr.tcp; int rewrite = 0; - KASSERT(sk != NULL, ("%s: null sk", __func__)); - KASSERT(nk != NULL, ("%s: null nk", __func__)); + KASSERT(ctx->sk != NULL, ("%s: null sk", __func__)); + KASSERT(ctx->nk != NULL, ("%s: null nk", __func__)); switch (pd->proto) { case IPPROTO_TCP: @@ -6418,7 +6405,7 @@ pf_translate_compat(struct pf_pdesc *pd, struct pf_state_key *sk, PF_ACPY(&pd->ndaddr, pd->dst, pd->af); } - if (virtual_type == htons(ICMP_ECHO) && + if (ctx->virtual_type == htons(ICMP_ECHO) && nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, pd->nsport, diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 697f680c97bf..4a40ef6b845a 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -843,20 +843,18 @@ done: } u_short -pf_get_translation(struct pf_pdesc *pd, - struct pf_state_key **skp, struct pf_state_key **nkp, - struct pf_test_ctx *ctx, struct pf_udp_mapping **udp_mapping) +pf_get_translation(struct pf_test_ctx *ctx) { struct pf_krule *r = NULL; u_short transerror; PF_RULES_RASSERT(); - KASSERT(*skp == NULL, ("*skp not NULL")); - KASSERT(*nkp == NULL, ("*nkp not NULL")); + KASSERT(ctx->sk == NULL, ("*skp not NULL")); + KASSERT(ctx->nk == NULL, ("*nkp not NULL")); ctx->nr = NULL; - if (pd->dir == PF_OUT) { + if (ctx->pd->dir == PF_OUT) { r = pf_match_translation(PF_RULESET_BINAT, ctx); if (r == NULL) r = pf_match_translation(PF_RULESET_NAT, ctx); @@ -876,7 +874,7 @@ pf_get_translation(struct pf_pdesc *pd, return (PFRES_MAX); } - transerror = pf_get_transaddr(pd, skp, nkp, r, udp_mapping, r->action, &(r->rdr)); + transerror = pf_get_transaddr(ctx, r, r->action, &(r->rdr)); if (transerror == PFRES_MATCH) ctx->nr = r; @@ -884,11 +882,10 @@ pf_get_translation(struct pf_pdesc *pd, } u_short -pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, - struct pf_state_key **nkp, struct pf_krule *r, - struct pf_udp_mapping **udp_mapping, uint8_t nat_action, - struct pf_kpool *rpool) +pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, + uint8_t nat_action, struct pf_kpool *rpool) { + struct pf_pdesc *pd = ctx->pd; struct pf_addr *naddr; struct pf_ksrc_node *sn = NULL; struct pf_srchash *sh = NULL; @@ -900,13 +897,14 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, KASSERT(r != NULL, ("r is NULL")); KASSERT(!(r->rule_flag & PFRULE_AFTO), ("AFTO rule")); - if (*skp == NULL && *nkp == NULL) { - if (pf_state_key_setup(pd, pd->nsport, pd->ndport, skp, nkp)) + if (ctx->sk == NULL && ctx->nk == NULL) { + if (pf_state_key_setup(pd, pd->nsport, pd->ndport, &ctx->sk, + &ctx->nk)) return (PFRES_MEMORY); } - naddr = &(*nkp)->addr[1]; - nportp = &(*nkp)->port[1]; + naddr = &ctx->nk->addr[1]; + nportp = &ctx->nk->port[1]; switch (nat_action) { case PF_NAT: @@ -919,7 +917,7 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, } if (rpool->mape.offset > 0) { if (pf_get_mape_sport(pd, r, naddr, nportp, &sn, - &sh, udp_mapping, rpool)) { + &sh, &ctx->udp_mapping, rpool)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: MAP-E port allocation (%u/%u/%u)" " failed\n", @@ -930,7 +928,7 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, goto notrans; } } else if (pf_get_sport(pd, r, naddr, nportp, low, high, &sn, - &sh, rpool, udp_mapping, PF_SN_NAT)) { + &sh, rpool, &ctx->udp_mapping, PF_SN_NAT)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", rpool->proxy_port[0], rpool->proxy_port[1])); @@ -1077,7 +1075,7 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, key.port[0] = htons(tmp); if (!pf_find_state_all_exists(&key, PF_OUT)) { /* Update the source port. */ - (*nkp)->port[0] = htons(tmp); + ctx->nk->port[0] = htons(tmp); goto out; } } @@ -1087,7 +1085,7 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, key.port[0] = htons(tmp); if (!pf_find_state_all_exists(&key, PF_OUT)) { /* Update the source port. */ - (*nkp)->port[0] = htons(tmp); + ctx->nk->port[0] = htons(tmp); goto out; } } @@ -1105,7 +1103,7 @@ pf_get_transaddr(struct pf_pdesc *pd, struct pf_state_key **skp, out: DPFPRINTF(PF_DEBUG_MISC, ("pf: RDR source port allocation %u->%u\n", - ntohs(pd->nsport), ntohs((*nkp)->port[0]))); + ntohs(pd->nsport), ntohs(ctx->nk->port[0]))); break; } default: @@ -1113,15 +1111,15 @@ out: } /* Return success only if translation really happened. */ - if (bcmp(*skp, *nkp, sizeof(struct pf_state_key_cmp))) { + if (bcmp(ctx->sk, ctx->nk, sizeof(struct pf_state_key_cmp))) { return (PFRES_MATCH); } reason = PFRES_MAX; notrans: - uma_zfree(V_pf_state_key_z, *nkp); - uma_zfree(V_pf_state_key_z, *skp); - *skp = *nkp = NULL; + uma_zfree(V_pf_state_key_z, ctx->nk); + uma_zfree(V_pf_state_key_z, ctx->sk); + ctx->sk = ctx->nk = NULL; return (reason); } From nobody Mon Jun 2 16:14:54 2025 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 4b9zSx0DCBz5x2Nt; Mon, 02 Jun 2025 16:14:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b9zSw5bKhz3FMq; Mon, 02 Jun 2025 16:14:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748880896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlInqm/ihSsGhvgUU+Dq8MWo23yMXjWvoRZoX+d94TM=; b=WXH63E95Yb1CEuBXBLr5SOmYj1wQCeZMERmw4XpA2tTmoP9I7aE603PE0RUqDN7qtvx77/ YFCK/DNmZr+LoGDbp2NalCfXY/k3S0kgqUMc7hXWDTSnl3ofkVlcgRA5QXAeaY6CXle7EK nBr38662ySoEcmwxVvGE08nmzXTHh+Ev3WvWms2a+g9VRiJF9Bu4x+XJBvS855j9j/aTIo FQxIoimhb1tmgAauTVBY3FqwZk7kTEfOT2mVuxhOVcU/rECMGLBloihL3QRczuK3OMLkoC wvlUSThWvFzA/8+mSm9LlMWpCAHF7TJ2LCQVE5SS1z64lksDxB/jNQj/81YgQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748880896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlInqm/ihSsGhvgUU+Dq8MWo23yMXjWvoRZoX+d94TM=; b=GBml4xaAfsXmbkva+nflOZfURVux++lpUVRN+70fbBk/3Ur1MkJwwBGfx1+41WcQUuiXBu p5i+3a2BgZF8DcjbVs+V2/mGFd68Iq5zRUWhthvowwWlS38Bv7ydQPuHQ2NR1h0mhEY1AA /A464Vadp6QU3EssJ4MvrL28eRzkU2jUi3nrkGZrily4hUeJSYymhXkjEYmTbbBJxVrri4 UUwh0yFedAexc1BNGFFRwi75H+btXOFIXv8D2tHYyviL9mkz3na/6gVyKJ16rvIbguNdDh 46PgJBQerlfz1ja/Jnx/E88oObvKYmo2EPLK44vAWqDZ/Hr/pjmHTxao17WwgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748880896; a=rsa-sha256; cv=none; b=ZIJYA5zuvWopyC4x8azBgSPqQfZX4JtnWeTWcJ+sPyUbRzkr4yyStSARu3kTLwwhrextc4 8S2pYauqcqEqx+SgA2VGzd7RsZ/zWNH/0Bw91ZQWHtknnmzq866Ka8/qg/z1Mt296jp8QQ M/WbCllcdQ33Uj7tOXHvoUqUvpIG1GkXlqhh52lVv0lOsl7KYlMIV7ONCXnxN8ed0UZm64 NEw9N13yGsGbq9hIFmyNk6gmlG0Poc6cVJSO6X3myfOdhSlFtkkcf8BupcM0Kie/mWd+O8 KIEXgMwd6LtubQwrIZZlmdME00xuSyWx5JZxV+AcVVD2bLpoG/oJYTE8J1Eb4A== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4b9zSw2S7szHd3; Mon, 02 Jun 2025 16:14:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> Date: Mon, 2 Jun 2025 11:14:54 -0500 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: 61d77e6c0095 - main - loader: allow for exceptions to restricted settings. To: "Simon J. Gerraty" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506020549.5525nuDu054998@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: <202506020549.5525nuDu054998@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/2/25 00:49, Simon J. Gerraty wrote: > The branch main has been updated by sjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=61d77e6c009544d1489078c16a5d22b27d25c91b > > commit 61d77e6c009544d1489078c16a5d22b27d25c91b > Author: Simon J. Gerraty > AuthorDate: 2025-06-02 05:48:43 +0000 > Commit: Simon J. Gerraty > CommitDate: 2025-06-02 05:48:43 +0000 > > loader: allow for exceptions to restricted settings. > > We restrict what an unverified loader.conf etc can set, > and the same restrictions are applied to interactive input. > We need to allow for exceptions (eg boot_verbose). > It is best if any allowed settings match up to '='. > > If we do not allow it to be set, do not allow it to be unset > > Reviewed by: stevek > Sponsored by: Juniper Networks, Inc. > --- Long-term, we should probably work out something that can work for lualoader, too. We use setenv() there directly rather than adding a layer of indirection through the command-line parser. Thanks, Kyle Evans From nobody Mon Jun 2 17:30:09 2025 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 4bB17j4ys1z5x70G; Mon, 02 Jun 2025 17:30: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 4bB17j4NPKz3sBK; Mon, 02 Jun 2025 17:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748885409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=egWw5f96evml1H3FnPWVsn1Doj5B2vrw0MHfxSC5GR4=; b=pQ8EKKQquYnOL2kK1VAR4As0pdkahjzn7BYSPxtZaZIjD+jZUd0F3O4jgAkPFsvRVqAapS kjBIxF+xJebGGtiPfmDB8rvYFmuziV7jr9oQl5rhpv3Yd8Zwr5exhtTzFFa1jcjqVFda5V Ylr5TogkhWl0eVVp2iCn8Y2OhrJmjGVj+YiPei/gPP8cN4MpLonG8BOW1c3aA2wX53trhN tcNb26GJpBznDD5LzaDP3nORbziVK24MK44qRx1/KYat9Z1Sfct6dWxQB+VBEYZxNH81Dw DNyqor2YRp3xuLLI7EeiWhqEUVnnC1n4CoLXuogtO4Z1Twwj8cmFwb/cSh2/WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748885409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=egWw5f96evml1H3FnPWVsn1Doj5B2vrw0MHfxSC5GR4=; b=GlZlvoaCJHLtaTPYYSAoBHvKnCQOknM8zW1qyMvKDwX0GxYaNy9CKEtHxP/zz5gBrQ8HQL s1/KCvq9gkE9Zf5kEH1RoWDaV/Q9ViYnBl7rwfypl6czUSERQW3lvXkHyxjAHcw1Fj0UsS MGILpeWJuqX4od3q4LTMMSDc0ymWYxnkKqnkkmJcEM9D0QQ5SesphE4tsbORJx3GvO2DBh N0xMeW6qElDDs83BkP7o7mMTksW4+m5BUg+1sEqoVKM0wKmLxffhYUcnS/Iic1GxQephGj 0k/3c4S7X/IsEYKuaga6ZsUc98u4Mzyo10MkQwc3pYi0fs8veZWoazX/tztJ3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748885409; a=rsa-sha256; cv=none; b=p0/GNs2f3fTG8homGfjBvPWieC55aSGbT8wpwCeBxCzjzDFll/3/H2wOGHsNdk395N2Y+Z MAyMWdlEG/20+Y1LUbnZoiTJDJlzn9HkdP/buIg00II5/Y3E1cia5BEFXM8klpg6Gcvu6O 7D7+5NtpzdkmfnsDUuGylsHuuoJmOLow5nFqkTSxB2oCTqeVpigHYvJGlZa/sL0s/TsR4z 0g0IYbCWO8VxcyYdmdzdEMIIBDbsYkrj2/MeWPYfacpLgxCXlCEhwOa2eCK7Be3z6fCBIo 3cN/ycvqjqcRc+JvhYul/39Bl+AzEI1H9QxJ29NAJgFuYuyPYpAh6wqMNc80dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bB17j3mxNz1HTG; Mon, 02 Jun 2025 17:30:09 +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 552HU9x1071730; Mon, 2 Jun 2025 17:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552HU9jU071725; Mon, 2 Jun 2025 17:30:09 GMT (envelope-from git) Date: Mon, 2 Jun 2025 17:30:09 GMT Message-Id: <202506021730.552HU9jU071725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Krzysztof Galazka Subject: git: 0fed8828c95a - main - ice(4): Update E830-XXV device ids 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: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fed8828c95a9d2cbcb43147ff851ca6f2c21d0f Auto-Submitted: auto-generated The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=0fed8828c95a9d2cbcb43147ff851ca6f2c21d0f commit 0fed8828c95a9d2cbcb43147ff851ca6f2c21d0f Author: Krzysztof Galazka AuthorDate: 2025-06-02 17:19:21 +0000 Commit: Krzysztof Galazka CommitDate: 2025-06-02 17:19:47 +0000 ice(4): Update E830-XXV device ids Device ID for E830-XXV adapters was changed from 12D3 to 12DE. Update driver accordingly and bump version number. Also remove subdevice id for E830-XXV-4 for OCP 3.0, which was cancelled. Signed-off-by: Krzysztof Galazka Approved by: kbowling (mentor), erj (mentor) Tested by: Gowthamkumar K S MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50327 --- sys/dev/ice/ice_devids.h | 2 +- sys/dev/ice/ice_drv_info.h | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index 9b142a1110b2..3f91e9dfbcaf 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -61,7 +61,7 @@ /* Intel(R) Ethernet Controller E830-C for SFP */ #define ICE_DEV_ID_E830C_SFP 0x12DA /* Intel(R) Ethernet Controller E830-L for SFP */ -#define ICE_DEV_ID_E830_L_SFP 0x12DE +#define ICE_DEV_ID_E830_L_SFP 0x12DE /* Intel(R) Ethernet Controller E810-C for backplane */ #define ICE_DEV_ID_E810C_BACKPLANE 0x1591 /* Intel(R) Ethernet Controller E810-C for QSFP */ diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 80b517bb5b08..2a51a7394424 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.43.2-k"; +const char ice_driver_version[] = "1.43.3-k"; const uint8_t ice_major_version = 1; const uint8_t ice_minor_version = 43; -const uint8_t ice_patch_version = 2; +const uint8_t ice_patch_version = 3; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.43.2-k") + PVID(vendor, devid, name " - 1.43.3-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.43.2-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.43.3-k") /** * @var ice_vendor_info_array @@ -200,17 +200,6 @@ static const pci_vendor_info_t ice_vendor_info_array[] = { "Intel(R) Ethernet Network Adapter E830-CC-Q1 for OCP 3.0"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_QSFP56, "Intel(R) Ethernet Connection E830-CC for QSFP56"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP, - ICE_INTEL_VENDOR_ID, 0x0001, 0, - "Intel(R) Ethernet Network Adapter E830-XXV-2 for OCP 3.0"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP, - ICE_INTEL_VENDOR_ID, 0x0003, 0, - "Intel(R) Ethernet Network Adapter E830-XXV-2"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP, - ICE_INTEL_VENDOR_ID, 0x0004, 0, - "Intel(R) Ethernet Network Adapter E830-XXV-4 for OCP 3.0"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP, - "Intel(R) Ethernet Connection E830-CC for SFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_BACKPLANE, "Intel(R) Ethernet Connection E830-C for backplane"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_QSFP, @@ -221,6 +210,12 @@ static const pci_vendor_info_t ice_vendor_info_array[] = { "Intel(R) Ethernet Connection E830-L for backplane"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_QSFP, "Intel(R) Ethernet Connection E830-L for QSFP"), + PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_SFP, + ICE_INTEL_VENDOR_ID, 0x0001, 0, + "Intel(R) Ethernet Network Adapter E830-XXV-2 for OCP 3.0"), + PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_SFP, + ICE_INTEL_VENDOR_ID, 0x0003, 0, + "Intel(R) Ethernet Network Adapter E830-XXV-2"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_SFP, "Intel(R) Ethernet Connection E830-L for SFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_BACKPLANE, From nobody Mon Jun 2 17:37:34 2025 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 4bB1JV3yLTz5x7Y9 for ; Mon, 02 Jun 2025 17:37:46 +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 4bB1JV3TvMz3xf9 for ; Mon, 02 Jun 2025 17:37:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-312150900afso4850205a91.1 for ; Mon, 02 Jun 2025 10:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1748885865; x=1749490665; 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=PNpWa7Cz+PR2mVxhLS3mEt+U1XAWTpWeB3g4MhzmAUE=; b=1AVaLYzcgzOQch8lAwdjRBwXIaConOJtFr2qv7UbGm51CEEETTUb0YXYlGOrV0RcJf 2dm+bBZSVgoIMALBKyYkPNR59BMbJ3pWfliy9EU/q3fSI+6q60Ep+d/kT+J+pO+lyJII Pv5ve7IMaGw/IHm2a1/Dm3aNi/kb4m/Ycpf4JKldEOVWTxmYPSVLDUzFqzY16ReLWAcl 0PrxQayDxni2qByddGEvS3x4fRZyDiDhvAuSYG/9EGqFAt6s1MIaKrYxgytVuCjl7723 wOMHvWMD0vzEnTDd2NQ9t04O6KlPtzKHBNrGo2eBtIw+Y7hu1Qg4yaqWquTowBH7QNLV X2Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748885865; x=1749490665; 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=PNpWa7Cz+PR2mVxhLS3mEt+U1XAWTpWeB3g4MhzmAUE=; b=dIN4ZppR1VOXALhnVPmxOxlLUAPV6Rig76O+F7Rr7fKNC9nZhaKAFpxjslPx1ZDQRk t7frH/QOvMGSsCKHfQ0lz+8qaz1f3Rb0cfIw1D2kn6UNKIw+rKEmKL5mEm5VI6rSIgMp GuvcQigZyVL5DLv1vfh2dvZMReQiYPDZWyCqsfCNgfrRY4C6en9YaPmivVK3+zT79EHX B/9warf2DKgHWY7K2Y5oxHblHeDC2DCzgOB3tLBh5yQ9yY3VauBb/rceoV2hkp6Modb0 n0MEi7RyJNViW2REOoegLPSDgyLSHoKmhLs+LmW3IZoFgXra0yFc6woiNX/OEZg8cSM2 JOug== X-Forwarded-Encrypted: i=1; AJvYcCXJe12PxecVD/Ca1S8ubwZlITsCSjHhbjWqlBaNGEPRYI3PlhicIadXAnvB9W/URE/ekmYYHFeMuy30HkV264KSieM5Tg==@freebsd.org X-Gm-Message-State: AOJu0YwtBS/5F0LMVQpYCdlXpClJcqejnd12LAxGbXP0F3i2/enSFgW1 uWBZ+iifrLCp/NV14W+V2Pdr55Qatsur3HLW3K242FStXeEH0wxLhB0Sh8x9o89SQwH22rYdME8 cynX2IQ+wX09k6rWLTgTrJmv+TN3rqWbxNizBMjUD4waubdpBFK4xT7E= X-Gm-Gg: ASbGncuF9U219CwzekfjaxjJ2TmUcbdR+owhwY+oKeU+TiK2i4WkH4C4F0bDm+QJ7Js ulUNPqg/3ILIk3uu7sFYYKK0N51+sFv8kkng096h4P0Z8WeOiuY/OvcKJUlHcoc5zdfJp520cCB WZ124OYMt7dzN7TnbBNpn+64vlFHdLm5Jh X-Google-Smtp-Source: AGHT+IFqT7t/89JlaovDlIX0x9sUNZ6zXI0wiGe5fYxrJnFKsv9XES7z3xsReSv/b5e+P4JRRYxEcH9346e/4SnO8Uk= X-Received: by 2002:a17:90a:ec84:b0:311:f684:d3cd with SMTP id 98e67ed59e1d1-3127c6d7105mr17136987a91.12.1748885865262; Mon, 02 Jun 2025 10:37:45 -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: <202506020549.5525nuDu054998@gitrepo.freebsd.org> <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> In-Reply-To: <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> From: Warner Losh Date: Mon, 2 Jun 2025 11:37:34 -0600 X-Gm-Features: AX0GCFuYCkYv0PV0Ueo6ZBroYgOBgzR3pieGlzSgkISE8zfsDHUXCckxaarBbew Message-ID: Subject: Re: git: 61d77e6c0095 - main - loader: allow for exceptions to restricted settings. To: Kyle Evans Cc: "Simon J. Gerraty" , 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-Rspamd-Queue-Id: 4bB1JV3TvMz3xf9 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] On Mon, Jun 2, 2025 at 10:14=E2=80=AFAM Kyle Evans wro= te: > > On 6/2/25 00:49, Simon J. Gerraty wrote: > > The branch main has been updated by sjg: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D61d77e6c009544d1489078c1= 6a5d22b27d25c91b > > > > commit 61d77e6c009544d1489078c16a5d22b27d25c91b > > Author: Simon J. Gerraty > > AuthorDate: 2025-06-02 05:48:43 +0000 > > Commit: Simon J. Gerraty > > CommitDate: 2025-06-02 05:48:43 +0000 > > > > loader: allow for exceptions to restricted settings. > > > > We restrict what an unverified loader.conf etc can set, > > and the same restrictions are applied to interactive input. > > We need to allow for exceptions (eg boot_verbose). > > It is best if any allowed settings match up to '=3D'. > > > > If we do not allow it to be set, do not allow it to be unset > > > > Reviewed by: stevek > > Sponsored by: Juniper Networks, Inc. > > --- > Long-term, we should probably work out something that can work for > lualoader, too. We use setenv() there directly rather than adding a > layer of indirection through the command-line parser. Yea, I'd rather this be a property of the env variable than having lists li= ke this anyway. And that would solve another problem I have from time to time which is needing to have an always existing env variable with a default, bu= t overridable value. In these cases, you have to set that up in code, and it'= s a bit of a bother. If we do it right, we could have a three-fer: works with lua, works to set certain things immutable after a time and also lets us initialize th= ings. Though getting the details right so that we can set these in loader.conf, but then not set them on the command line is the most likely use case, and I thought for that use case we did the right thing in lualoader. no? Warner From nobody Mon Jun 2 20:32:14 2025 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 4bB59q1RLlz5xKpq; Mon, 02 Jun 2025 20: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 4bB59q0tQlz4C8g; Mon, 02 Jun 2025 20: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=1748896335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myhfhbL+OWcVvrJ8V3isvu4cmsDLQmGaFzQK/XoWcSE=; b=e0dHblr3pQsl21IK6Y3ZDNBlNJv7O5o1gbEaMkqKiPGSLuUKX4+omYbX/CM2NWgEPWRnBz 9/006ge9EtH6HIt8g7+OU8ANfWGKOMXhQjiO/4WQccnlzAoxpTLhYuLroxex0cDadfY2Vf rY2X2JY0ztPaGjPbpBA/DNviaiwGgM7SbcfGwjuurXa8pGc+B+vrSoTIWdo6VhD27fI+0Y d8hThuLJey71qatqGOqP6Utx9Ve0PJxAzV+QJ6ZniSvWjl4vaBONcJKjA3OowK1Hcpmg/I 4SiFtdb7YiNCWj7NksX6MlUCAedy3bfKSrltjGIc3NZ9DigxrmZvG/a/wP5g4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748896335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myhfhbL+OWcVvrJ8V3isvu4cmsDLQmGaFzQK/XoWcSE=; b=opDN7mNAyHX3ll5Xfyk90bKKB6RhXt26I8XQgNBxETPi4A90HhiLYLtyvhBlutHDAmOOyi 2pWvu/YasthzBHkxczUlampWBgpMdpPGxwQNKfl8ZIG41pRrtyOK3uL8KctTPIgcvHOi/O Gvv4CtU30p5sMsnIF+FWdaZzut6qg6MCet169fh58PLmaTP7PYLBsk+W/d23kZbdXoH5vR OJWt0CVttuHMQndOtbalo/Mhgru3enz7y++AHrJS3aJ9BGML/8kR61z5muMYosJcvk3aJq OOW77Rc5qeWv+p4HA9UuYxaXBFqlfBtujDktYeW+qQ/OJLBBhe7E060rTBYMlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748896335; a=rsa-sha256; cv=none; b=Z8eyTd2hXtC67ZTx2twra+99ncMQwgn61wH85mFUD3vniUquXC8NULHuwWDqqA/BAeWM8b v84h+BcA/xuhhyac4PI1o2KdGUprutwREB1x0neBTXFOQxIHvgVEoR3BOBunnnroKgcovY ZJ28TkiVkppx/16+F7+I2jXUKxszoEWldND/4RgA6wiyTXJSOXEtQXLtDO99v+y47PBkd6 0iQ50kwZ47NRpUs0YbDbjHRz0BxHcClZ/P652Z+gtPRlpT0Re4EpADI+RgeUZjJJICPU2G OAefwYapJfwTKpM17AP1YWAmUJHsSZJYPiDuwmrkT4JIM8MpnLs+kzrpYPbSWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bB59q0Qgvz1N3C; Mon, 02 Jun 2025 20: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 552KWEmp020349; Mon, 2 Jun 2025 20:32:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552KWE9s020346; Mon, 2 Jun 2025 20:32:14 GMT (envelope-from git) Date: Mon, 2 Jun 2025 20:32:14 GMT Message-Id: <202506022032.552KWE9s020346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: e3307d05311e - main - mlx.4: Improve specificity for apropos + hw notes 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: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3307d05311e8c042e7e7ea2157fc51f50297369 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=e3307d05311e8c042e7e7ea2157fc51f50297369 commit e3307d05311e8c042e7e7ea2157fc51f50297369 Author: Alexander Ziaee AuthorDate: 2025-06-02 20:31:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-02 20:31:16 +0000 mlx.4: Improve specificity for apropos + hw notes + There are decades of SCSIs, these are Ultra-SCSI + Remove generalizations from the end of HARDWARE + Tag SPDX MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50545 --- share/man/man4/mlx.4 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index 7cb3e9a98c1d..a5443f308088 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 David O'Brien .\" Copyright (c) 2000 Jeroen Ruigrok van der Werven .\" Copyright (c) 2000 Michael Smith @@ -23,12 +25,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 10, 2025 +.Dd May 27, 2025 .Dt MLX 4 .Os .Sh NAME .Nm mlx -.Nd Mylex DAC-family RAID driver +.Nd Mylex DAC-family Ultra-SCSI RAID driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,9 +52,9 @@ The driver provides support for Mylex DAC-family PCI to SCSI RAID controllers, including versions relabeled by Digital/Compaq. .Sh HARDWARE -Controllers supported by the +The .Nm -driver include: +driver supports the following Ultra-SCSI RAID controllers: .Pp .Bl -bullet -compact .It @@ -79,13 +81,6 @@ Mylex eXtremeRAID 1100 (DAC1164P) RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) .El -.Pp -All major firmware revisions (2.x, 3.x, 4.x and 5.x) are supported, however -it is always advisable to upgrade to the most recent firmware -available for the controller. -.Pp -Compatible Mylex controllers not listed should work, but have not been -verified. .Sh DIAGNOSTICS .Ss Controller initialisation phase .Bl -diag From nobody Mon Jun 2 20:49:53 2025 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 4bB5Z92VCZz5xN1p; Mon, 02 Jun 2025 20:49: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 4bB5Z91fRVz3DPD; Mon, 02 Jun 2025 20:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748897393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hP5azJk+vTNEu/Lw75i8ztDBiw382AOqFVVRTO+n3hY=; b=K/ebcZGSKyiMSfwkI7aeS2rWrNzUawka+rCmh5ghHliEt8B/7hpT+z9gC3xqy+TtM3iZiq PjzHJwTi9p+pUfGlTkup4se6lI4LJm1RXdjcAlJtkU+XQ0aulkYcSAOQKbMxtjXLdiVwcI CmC5CQai3PEYX91Yh+gTC9vuAsp0sNh6sTfTPaTeXaXnIrun/c98Wv3NQqiqgTZDKFMPmC mJzHf6y7DbppY79U37w9fpS5rYPVbiJEqhS1j/N9HYCwj4xMfEFBfusEG3Yv+RjcHGVSpP XgwChAyz9nSmYKydN4ztNwlpubXecF5np5NGABoiXrZIoEx9shHY0W1kbjengw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748897393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hP5azJk+vTNEu/Lw75i8ztDBiw382AOqFVVRTO+n3hY=; b=vZXaE5MP7e7DY+EiweXly96xUlNQ3LXmZLq4h87mNWrWoLyuf79s/KiBOIm/D875mtVjU0 2tTvM4sIFm/tX8jRoWEYTrAZ8y3DAiScDjirqxmXyXq+KcdB+gf88GjiHazPp4j+jiZv68 KwroG6J2rkrKnuUJC2l5vhoFeNxkJWPWCRT5nmwVtpvUcF4f8cLMgdZEKxaE7CYwsoga+i HSOLJ4e24JHLA1YZDAF/2gZh12c/36vAqi/STKnGA4SdBSjVCdywTP54JRMviQS7JamCxy 7jTI0Oqn6nXNs63ucPAyIotAMnjo8+QJjUTZoRHsz19Htgdv6/c3gtb8Dvv5Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748897393; a=rsa-sha256; cv=none; b=QE556sf3+5w93uMtaEo4LlJ/KbpRewwinQgKgJ+OZZmKLd7wYPeRQUI2dG9yEHBA+40V9A 31kDfq7qVjrlvNmbtqv4xno9RQ8f7Zn8tr2l4BJjAv/sxew/fTBzwMdcHLtfvF05utqaBN 3PysjQRasoCYJa7A0UTTC8v3ve8TbR/Q/flHDILGefck4d8xnIOgLcZuvf5VkVnboHkqfW IsFZmkd2+356gWSK8fLo8+WiZtXw+4fP3IgPnyHMT0PEADCloZuj3DdnlpF2QxRf7jQSSc WAS2UuKW9xFCfK2av138/7l53KTgvjY8poqEvVTCScK6kF5FKZfI/A5gLILCqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bB5Z916Tqz1N2y; Mon, 02 Jun 2025 20:49: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 552KnrBC045636; Mon, 2 Jun 2025 20:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552Knrgm045633; Mon, 2 Jun 2025 20:49:53 GMT (envelope-from git) Date: Mon, 2 Jun 2025 20:49:53 GMT Message-Id: <202506022049.552Knrgm045633@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: d8773fdcbfa3 - main - sockets: gc SB_STOP flag 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: d8773fdcbfa363da3e14ec3661b565edbfce03e0 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d8773fdcbfa363da3e14ec3661b565edbfce03e0 commit d8773fdcbfa363da3e14ec3661b565edbfce03e0 Author: Gleb Smirnoff AuthorDate: 2025-06-02 20:47:25 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-02 20:49:41 +0000 sockets: gc SB_STOP flag This flag was used when unix(4) sockets were serviced by the generic socket buffer code and it was needed to signal fullness of a receive buffer into send buffer of the peer. --- sys/sys/sockbuf.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index dbf5c1ff956d..7f6234ade6f4 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -46,7 +46,7 @@ #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ -#define SB_STOP 0x1000 /* backpressure indicator */ +/* was SB_STOP 0x1000 */ #define SB_AIO_RUNNING 0x2000 /* AIO operation running */ #define SB_SPLICED 0x4000 /* socket buffer is spliced; previously used for SB_TLS_IFNET */ @@ -303,9 +303,6 @@ sbspace(struct sockbuf *sb) SOCKBUF_LOCK_ASSERT(sb); #endif - if (sb->sb_flags & SB_STOP) - return(0); - bleft = sb->sb_hiwat - sb->sb_ccc; mleft = sb->sb_mbmax - sb->sb_mbcnt; From nobody Mon Jun 2 20:58:34 2025 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 4bB5mX2NMvz5xNrb for ; Mon, 02 Jun 2025 20:58:52 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 4bB5mX06W0z3LvP for ; Mon, 02 Jun 2025 20:58:46 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-4a42cb03673so66524581cf.3 for ; Mon, 02 Jun 2025 13:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1748897926; x=1749502726; 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=ExFl2vVn4CmaJL3n9d8s3P+JaXbVJxf+YURy7ZEMpN8=; b=LWowDfiHJtGI4wdhbNVMMZysFdF4lWKRjjS+MG8APC5AXTw9UHj0nx24WQo5TWM3ku 3GAC4aavvGCrJ364vafJ+quR0r5QAoAfFBlzGofgpYhRrnaJG3IaAryCzv5rNMTjAWPj LXecR0QznI9ZoHGGYPT2HHP5pLkkaibwBklzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748897926; x=1749502726; 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=ExFl2vVn4CmaJL3n9d8s3P+JaXbVJxf+YURy7ZEMpN8=; b=k2L/UGGzCKRlWTqHpnJkB0H2dcs9BJ/96+tTueCtGRMeR0gam0qNn0fDH+O9Cldk5n /fqU8qpcCksMFJPb3nd/ME7Sws8fBDi54ZZ4WpSg/kYaVgZYfUkLHjHVcy2NYKdImHiL EicF2dcZwL/gEivT6rsqbep6kasYLuYwl+diQEqSu23jHo6N6J3J1Zz9q9W6oD1hVvDg TEskH5acM+SzZrk0jDvViBVTKxKkk9Eh41bN5LxWWIAcTB72SfnhPIew+xIDXAgXWfdW pw0+T9zk1/NYne3M6hGZxzyL0DwtcVpBwrUIdsL5obqQKUbr9I64xcJC+lXdIUD3giGI gJ9Q== X-Forwarded-Encrypted: i=1; AJvYcCWkLJRVg78acHqQQ65O4IJDoFnz7np81ZRVOyFoO71RaPJVIwzhg2uw4Y1sYD6IzVFSW14AjtnaXMY/4UxikWVn48aRGA==@freebsd.org X-Gm-Message-State: AOJu0YwIWQeLgDI7I8YJJbjW8LTu8JW8jzJcuxnVY6zT0NQ7qOrD8GoE HmZ0cBXw3thhV2/5//yEImdy75HobzOk34WSnIxmw1Gx4eRo0D4br1uqqaG6mHZ2ml8jgVubvAR Bh9NVIZUH/pyCpKwCuVkxSxoV+TUezc2NrSlyL8TO X-Gm-Gg: ASbGncv71GmKN1qifuo+2ZgSW7S7Y16m46d/v17QJYW9kj9pUmm9njWUGRYgHPLzAZQ hWqKDqToCC1iGptzLcAtkYjo5kfYKaUJoauPIO5xY2M+ffYJ5poBdVwnUPYzEk06I0/aPbds4RA TzguIvFw5hH8O/cUUpON337FMPoJMSCSRoBQ== X-Google-Smtp-Source: AGHT+IFwJR2ZVMH5FA3R73Rlkd16fb+WCYdb8vFuBIdRb3dwAmdixuIcGrXSkYGOxDri8qghe62BuEzoVzvFD/yh40E= X-Received: by 2002:a05:622a:5814:b0:4a4:396e:3b37 with SMTP id d75a77b69052e-4a44000cafbmr306396231cf.4.1748897925883; Mon, 02 Jun 2025 13:58:45 -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: <202506022032.552KWE9s020346@gitrepo.freebsd.org> In-Reply-To: <202506022032.552KWE9s020346@gitrepo.freebsd.org> From: Kevin Bowling Date: Mon, 2 Jun 2025 13:58:34 -0700 X-Gm-Features: AX0GCFvWjWOzyQ6jjuU_Ly1dZJ51GsB3nYJFcgotVWaTvj0LH97uZc_RhY2x4rk Message-ID: Subject: Re: git: e3307d05311e - main - mlx.4: Improve specificity for apropos + hw notes To: Alexander Ziaee Cc: 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-Rspamd-Queue-Id: 4bB5mX06W0z3LvP 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] On Mon, Jun 2, 2025 at 1:32=E2=80=AFPM Alexander Ziaee = wrote: > > The branch main has been updated by ziaee: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3De3307d05311e8c042e7e7ea215= 7fc51f50297369 > > commit e3307d05311e8c042e7e7ea2157fc51f50297369 > Author: Alexander Ziaee > AuthorDate: 2025-06-02 20:31:14 +0000 > Commit: Alexander Ziaee > CommitDate: 2025-06-02 20:31:16 +0000 > > mlx.4: Improve specificity for apropos + hw notes > > + There are decades of SCSIs, these are Ultra-SCSI I guess it's become deep arcana at this point but https://www.kernel.org/doc/Documentation/blockdev/README.DAC960 has a breakdown of the chipsets, it looks like Fast/Wide (pre-Ultra) to Ultra2 are supported by this driver. > + Remove generalizations from the end of HARDWARE > + Tag SPDX > > MFC after: 3 days > Reviewed by: mhorne > Approved by: mhorne (mentor) > Differential Revision: https://reviews.freebsd.org/D50545 > --- > share/man/man4/mlx.4 | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 > index 7cb3e9a98c1d..a5443f308088 100644 > --- a/share/man/man4/mlx.4 > +++ b/share/man/man4/mlx.4 > @@ -1,4 +1,6 @@ > .\" > +.\" SPDX-License-Identifier: BSD-2-Clause > +.\" > .\" Copyright (c) 2003 David O'Brien > .\" Copyright (c) 2000 Jeroen Ruigrok van der Werven > .\" Copyright (c) 2000 Michael Smith > @@ -23,12 +25,12 @@ > .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US= E OF > .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd January 10, 2025 > +.Dd May 27, 2025 > .Dt MLX 4 > .Os > .Sh NAME > .Nm mlx > -.Nd Mylex DAC-family RAID driver > +.Nd Mylex DAC-family Ultra-SCSI RAID driver > .Sh SYNOPSIS > To compile this driver into the kernel, > place the following lines in your > @@ -50,9 +52,9 @@ The > driver provides support for Mylex DAC-family PCI to SCSI RAID controller= s, > including versions relabeled by Digital/Compaq. > .Sh HARDWARE > -Controllers supported by the > +The > .Nm > -driver include: > +driver supports the following Ultra-SCSI RAID controllers: > .Pp > .Bl -bullet -compact > .It > @@ -79,13 +81,6 @@ Mylex eXtremeRAID 1100 (DAC1164P) > RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB > cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) > .El > -.Pp > -All major firmware revisions (2.x, 3.x, 4.x and 5.x) are supported, howe= ver > -it is always advisable to upgrade to the most recent firmware > -available for the controller. > -.Pp > -Compatible Mylex controllers not listed should work, but have not been > -verified. > .Sh DIAGNOSTICS > .Ss Controller initialisation phase > .Bl -diag From nobody Mon Jun 2 21:09:38 2025 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 4bB6130ZHyz5xPLj for ; Mon, 02 Jun 2025 21:09:43 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [IPv6:2a0c:5a00:149::26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bB6124zLpz3WY0; Mon, 02 Jun 2025 21:09:42 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1uMCPb-003BRU-0g; Mon, 02 Jun 2025 23:09:39 +0200 Received: from [10.9.9.127] (helo=rmmprod05.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1uMCPa-0008O2-3U; Mon, 02 Jun 2025 23:09:38 +0200 Received: from mail by rmmprod05.runbox with local (Exim 4.86_2) (envelope-from ) id 1uMCPa-0001zo-27; Mon, 02 Jun 2025 23:09:38 +0200 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 Received: from [Authenticated alias (960477)] by runbox.com with http (RMM6); Mon, 02 Jun 2025 21:09:38 GMT From: "Alexander Ziaee" To: "Kevin Bowling" , "Alexander Ziaee" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" Subject: Re: git: e3307d05311e - main - mlx.4: Improve specificity for apropos + hw notes Date: Mon, 02 Jun 2025 21:09:38 +0000 (UTC) X-RMM-Aliasid: 960477 X-Mailer: RMM6 In-Reply-To: Message-Id: X-Rspamd-Queue-Id: 4bB6124zLpz3WY0 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:50304, ipnet:2a0c:5a00::/29, country:NO] On 2025-06-02 16:58 -04:00 EDT, "Kevin Bowling" = wrote: > On Mon, Jun 2, 2025 at 1:32=E2=80=AFPM Alexander Ziaee wrote: >> >> The branch main has been updated by ziaee: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3De3307d05311e8c042e7e7ea21= 57fc51f50297369 >> >> commit e3307d05311e8c042e7e7ea2157fc51f50297369 >> Author: Alexander Ziaee >> AuthorDate: 2025-06-02 20:31:14 +0000 >> Commit: Alexander Ziaee >> CommitDate: 2025-06-02 20:31:16 +0000 >> >> mlx.4: Improve specificity for apropos + hw notes >> >> + There are decades of SCSIs, these are Ultra-SCSI >=20 > I guess it's become deep arcana at this point but > https://www.kernel.org/doc/Documentation/blockdev/README.DAC960 has a > breakdown of the chipsets, it looks like Fast/Wide (pre-Ultra) to > Ultra2 are supported by this driver. Wow, thank you! I think deep arcana, while rarely useful, is really helpful= to put in the manual since it's so hard to find. After dinner I will write= something and throw another review up. >> + Remove generalizations from the end of HARDWARE >> + Tag SPDX >> >> MFC after: 3 days >> Reviewed by: mhorne >> Approved by: mhorne (mentor) >> Differential Revision: https://reviews.freebsd.org/D50545 >> --- >> share/man/man4/mlx.4 | 17 ++++++----------- >> 1 file changed, 6 insertions(+), 11 deletions(-) >> >> diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 >> index 7cb3e9a98c1d..a5443f308088 100644 >> --- a/share/man/man4/mlx.4 >> +++ b/share/man/man4/mlx.4 >> @@ -1,4 +1,6 @@ >> .\" >> +.\" SPDX-License-Identifier: BSD-2-Clause >> +.\" >> .\" Copyright (c) 2003 David O'Brien >> .\" Copyright (c) 2000 Jeroen Ruigrok van der Werven >> .\" Copyright (c) 2000 Michael Smith >> @@ -23,12 +25,12 @@ >> .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE U= SE OF >> .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> .\" >> -.Dd January 10, 2025 >> +.Dd May 27, 2025 >> .Dt MLX 4 >> .Os >> .Sh NAME >> .Nm mlx >> -.Nd Mylex DAC-family RAID driver >> +.Nd Mylex DAC-family Ultra-SCSI RAID driver >> .Sh SYNOPSIS >> To compile this driver into the kernel, >> place the following lines in your >> @@ -50,9 +52,9 @@ The >> driver provides support for Mylex DAC-family PCI to SCSI RAID controlle= rs, >> including versions relabeled by Digital/Compaq. >> .Sh HARDWARE >> -Controllers supported by the >> +The >> .Nm >> -driver include: >> +driver supports the following Ultra-SCSI RAID controllers: >> .Pp >> .Bl -bullet -compact >> .It >> @@ -79,13 +81,6 @@ Mylex eXtremeRAID 1100 (DAC1164P) >> RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB >> cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) >> .El >> -.Pp >> -All major firmware revisions (2.x, 3.x, 4.x and 5.x) are supported, how= ever >> -it is always advisable to upgrade to the most recent firmware >> -available for the controller. >> -.Pp >> -Compatible Mylex controllers not listed should work, but have not been >> -verified. >> .Sh DIAGNOSTICS >> .Ss Controller initialisation phase >> .Bl -diag >=20= From nobody Mon Jun 2 23:33:01 2025 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 4bB9BQ1sgDz5xZ0s; Mon, 02 Jun 2025 23:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bB9BQ18hnz3tRD; Mon, 02 Jun 2025 23:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748907182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghH6ofmbMXxzeqZH3LOtVl6tazuFMTjPBbzuW5B0UrE=; b=EqJYIqtT5po+URcWlV6XDucMGjzlZ3Sq1tm3cW+hAsfK55OUW36OQcvHJqkKM9wHCWfFb/ TXzFZKySZvedX5xQGMHNgOstdNqoyTCkhLq4Z5qDZclP6BglvC/8nwud+87pwac5Ahms9/ mYc3CISYdtg9dtMgegM1S//ckIvQJIpR4gWcg0uFpawsGO9LsZCc1C+3hwM2rI6Dct+xTx 2LmjRQWors7ou7j1X4xRX4ySHRLlkO0zmEVi5eG2vqUzQl1+YzAPYZeOx4XPza7ernYEFB 1WjYsi5BEI+WRCmwmY/GtaEyt8pNd2rJAAj+UsC8yoxWs+ZE3YLr4CQaJCLC0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748907182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghH6ofmbMXxzeqZH3LOtVl6tazuFMTjPBbzuW5B0UrE=; b=PJkTyQbOzVJDiUKqc5zXKKTxwprA0u+3E3G8K2++oZm8drF2Z2Pc7jUd/YYyRKkEE0hPFH 9DDGbvFf3oWiwhFsqzROHrzP1uv7rSPfjxZoZpXEHi1H4AO5qwwkqx9Cyzc8cCMIXDm842 bXB9CjCNNXcpPyzwVT+25YQj5dyqUCsbfXcj9Ll1R0iyF097HiM/lkSKWWfvb9tvTGpMH2 YL13J3TWPu6Uy6MEQF3nQCRqK3VNeuuDhtvYDIHnxWELaMIGfYriu02gDqH2UvFzXWvV/D vN1uq3gobHoVIRaQ2xfO7nfI+lkYFZSaVwAvdp5hbfEt3dsHnPTs6CCsHCQLYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748907182; a=rsa-sha256; cv=none; b=cYViUSv7aLUqS8H8u3CEHemlFgZ5RW/rOewEYH/xaOoqinypeAcAjd9G0Y77GnlibQnfma 79GHMRSSKtj0Totow25pJxv/f5Z8DrMP1v5WUvn94//gs9T8/hcod3HN9vM4XyeGE+DOFK uYvc/c89zwuH7YUqo7tyZQEsZeBZRtbKBEEMuVjbpGzoMLVZNMprEg24Os+hIDFirUSVb7 vkJAkjEvNBNVIflvCMmaAUcrHQub3TSegJDlJd11/R++NYBbkqVB/geXKiY761NTsjkaos gRAiJK6eu8xI10IwzGbji1gTWKI3w0+8HIciG0I1DwA6RQQnRzHwerimRjQF8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bB9BQ0WVdz1SWl; Mon, 02 Jun 2025 23:33: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 552NX1tE061537; Mon, 2 Jun 2025 23:33:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 552NX1uN061534; Mon, 2 Jun 2025 23:33:01 GMT (envelope-from git) Date: Mon, 2 Jun 2025 23:33:01 GMT Message-Id: <202506022333.552NX1uN061534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel 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: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e698e4a537736f6a7dd9a386e00997d7fb08e83f Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=e698e4a537736f6a7dd9a386e00997d7fb08e83f commit e698e4a537736f6a7dd9a386e00997d7fb08e83f Author: Robert Clausecker AuthorDate: 2025-06-02 22:54:32 +0000 Commit: Robert Clausecker CommitDate: 2025-06-02 23:27:00 +0000 lib/libmd: disable SHA1 AVX2 kernel Seems like there is a bug lurking somewhere in the code. This was not caught during my testing. Disable the affected kernel for now while I figure out what is wrong with it. To reproduce, run jot -s '' -b 'a' -n 1000000 | sha1 This should yield 34aa973cd4c4daa4f61eeb2bdbad27316534016f, but gives fe161a71d7941e3d63a9cacadc4f20716a721944 with the broken code. Only the amd64/avx2 kernel is affected, the others seem to operate correctly. Reported by: olivier Fixes: 8b4684afcde3930eb49490f0b8431c4cb2ad9a46 --- lib/libmd/amd64/sha1dispatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libmd/amd64/sha1dispatch.c b/lib/libmd/amd64/sha1dispatch.c index 86509195d56e..6c4d43b95ac9 100644 --- a/lib/libmd/amd64/sha1dispatch.c +++ b/lib/libmd/amd64/sha1dispatch.c @@ -47,8 +47,10 @@ DEFINE_UIFUNC(, void, sha1_block, (SHA1_CTX *, const void *, size_t)) { if (cpu_stdext_feature & CPUID_STDEXT_SHA) return (_libmd_sha1block_shani); +#if 0 if ((cpu_stdext_feature & AVX2_STDEXT_NEEDED) == AVX2_STDEXT_NEEDED) return (sha1block_avx2_wrapper); +#endif else return (_libmd_sha1block_scalar); } From nobody Tue Jun 3 00:12:15 2025 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 4bBB3g3g5Fz5xc27; Tue, 03 Jun 2025 00:12: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 4bBB3g2y4pz3WZH; Tue, 03 Jun 2025 00:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748909535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qLEIfgyI5MYFGa9o2xI0Nu9AgrCF0gMQ0tzEGNrNy/Y=; b=JJCAMF0vx39w1/SuJkq0c4a6parz0Pb/khLA22efndWkZMwFhPyyA2ryuwhxP00rWBZsHM 7RSRGDl/nTN9omZeRTW2jUFCBRgZEnIuGmXIh27LSUaGSc3gPEX4a1fg9GMzkDoq2/gJvk u9WI4B9W+duL7ISOnEmOPdr6+fzN88QlXPHupCu44/vdy2uaOkNZd/lVDmLp6EyTUUGIhh HncOMTv/xXpkR4svloba8/vxU1XMkqruspC6ZRnX+yJTkLcmv6QO/oZN9MlUCZ8brPB+ZU GuMhfAvmNtWrLazCABohfJsHA8FZp9fGQSL59p0uTgRJPsKolKRxBXWAuEIEBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748909535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qLEIfgyI5MYFGa9o2xI0Nu9AgrCF0gMQ0tzEGNrNy/Y=; b=mpR5kUvxCqOSLPRlAFsZtK966Vbqb9j1Y2ERbQakaV3zH4C58Fd3Me2hAUtGRqBVzmfBn8 GeXr4TodExtPQ/DKGrPr8cELGJGKo7CzIAAS01g/s0YxETKf+mI/iEidYiRsnGv684HDNM LH5KdotdCGT4ADsXaknTV0EtAc1Qnh3P7uI0qUemF4DaD0DilRP3bObTNrYb4rYERBdbiC YXOjZeAgd5QShMOokeNd7L5x7i7h8aj9Zp7BX7V/xTYgR56bq0fuPHsKDiOO0FtTlQmLcx AaL9YhhrccvJtsznscysnXkXSQUqHn9MXPxmufOINzS53mk34LIhcGUGJIJQUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748909535; a=rsa-sha256; cv=none; b=hRuFv9VFJijzHWxgroXhIShYcGgezZkCW99SP4L60XO7wEMmdc1PLKmBra14/9wbCHW2Qf 1Tv+wxSx+RkbgAYFXKAmlL6PgpQcinFHdyeSNSoU++iftGffSBQT0DLqQGhfYKwaiptp9x 6yOUPLzZyqsUUvBsH7wobb0StduXq7Lu2me1tWFc/PzMWBs2YhOZsR1CJUIPRJTMKQzRWV pacejD/l+daaQm3MZ3kE09XqzDuNxvg13k5YTCVhBb0d3t2K0k4B+EUoEGD+/8xM04Qqsv zW01ZiF8PyxCM7QM2k0bk7rILHBV62SNjrs/JRQ4JYQXPkFIV3VxfTgPMJVgiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBB3g2Rpyzkl; Tue, 03 Jun 2025 00:12: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 5530CFIu035444; Tue, 3 Jun 2025 00:12:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5530CFm0035441; Tue, 3 Jun 2025 00:12:15 GMT (envelope-from git) Date: Tue, 3 Jun 2025 00:12:15 GMT Message-Id: <202506030012.5530CFm0035441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 36fcd52c2bd5 - main - net80211: fix TKIP trailer trimming w/ no rx parameters given 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36fcd52c2bd5a8a4b3d584564852f417fb83e762 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=36fcd52c2bd5a8a4b3d584564852f417fb83e762 commit 36fcd52c2bd5a8a4b3d584564852f417fb83e762 Author: Adrian Chadd AuthorDate: 2025-06-02 00:11:40 +0000 Commit: Adrian Chadd CommitDate: 2025-06-03 00:11:59 +0000 net80211: fix TKIP trailer trimming w/ no rx parameters given Previous work made trimming the TKIP trailer an optional thing based on what the driver indicated it did with the received frame. However, for drivers that aren't populating an RX frame with an rx status - notably iwn(4) - exposed this bug. If the driver doesn't expose any RX status then just restore the previous behaviour. This matches what was done in the CCMP code in ccmp_decap(). Locally tested: * iwn(4), STA mode, CCMP + TKIP groupwise network Differential Revision: https://reviews.freebsd.org/D50638 Fixes: 731ff40069d28 MFC after: 3 days Reviewed by: bz --- sys/net80211/ieee80211_crypto_tkip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 7169f3e87a68..1d368cf11eb9 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -370,7 +370,7 @@ finish: /* * Strip the ICV if hardware has not done so already. */ - if (rxs != NULL && (rxs->c_pktflags & IEEE80211_RX_F_ICV_STRIP) == 0) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_ICV_STRIP) == 0) m_adj(m, -tkip.ic_trailer); return 1; From nobody Tue Jun 3 00:17:26 2025 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 4bBB9k2JB2z5xcVs for ; Tue, 03 Jun 2025 00:17:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 4bBB9j6nnPz3cMG for ; Tue, 03 Jun 2025 00:17:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-3ddb6a3a789so3137825ab.2 for ; Mon, 02 Jun 2025 17:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1748909848; x=1749514648; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4nY1oB9NbiSm1TC3qPL/O6qP1H2wCOPh3Xk4hGpTWV4=; b=QemnVusXrTrq9IH75AJ4t0v3n1MNxuVxYmLPOvY1wXJK3r8iZvlYbonJliUb3Q0pHV 7G4LcSFqIL4snh3PR05c2p+TaOu4W/SP/fLtuKIYAC8WTx+mRZ7GtJ+5Te9LJOUX2ci7 tP9EhbCzn+q2IseKcPyNOAHLvr1qgLF2N0LIkvqpelaPSMKDyEFYQ3Kw+HcTU26Q3NtN KXJtSqlbK3zLz/l8rObMnqi7FOL+udqeXllCjgPkqonxZbo/O87sCN5evBfVAaRltneD azavx9WanRECliR0spMkG9g5/NaJF9VbIvVzC8YzM0BXgMBPCO6KTd6YZGBf6nITZo9o SVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748909848; x=1749514648; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4nY1oB9NbiSm1TC3qPL/O6qP1H2wCOPh3Xk4hGpTWV4=; b=c0uCEBtXlsyOsgdyJ9wYUs278+vVRCAH3+JQFRzZO4Nl1k7ern5/d5ZyGrHNtXF66a 0H8ZSq3wXqvvJoyGSoZMZCKqcqvWnqd9RLfuwamhtEek4uZ0F/GVLJYqUvvABZXPKYmV +vevn2mPl29jfViY7CHlVfBHhe4Ok9uLiAB7GtvNSC1bR16FO9/Bpd2U2f5NGWLQJVEC cDLeXew5wuntxwK8kn7zh4RY7RpMfnXCv/CSCXopoO5R1uTLbFD/ABaQOUM0i6vrw5F4 uM5D7aaRpxrx0yS8xxpZ0Tyq+wOPgmlV9OXSxw1uIR4sA2zvmZQKvqNBnSMOaFegOHq4 7iag== X-Forwarded-Encrypted: i=1; AJvYcCWzqXZ2cLvZap8B0nFhI+KwW0VxdTqHQEWQwK2sX0KvTli5kzD+qREXZ6uW5u+qJCpuiDPFPYCxw5L83PID8vxbi8fOuQ==@freebsd.org X-Gm-Message-State: AOJu0YxpLzS+rXzdVgq9GgFB49HcqK3xtRen2r3D53qPuY6aJwcdA3Ns OjmyHxT0EJVcjyG2/4AZeUI2s+Pz68TenAT5pITjER0Wb1y0v+XLhYrvp79HrLVGmNEBY2Bpn0Q 6i2gaJdA= X-Gm-Gg: ASbGncvpU2xgDS0dXuDUdLEYyQBzWmoKOiVCTcNEaRxmJ0i7kh4RJgeYO95VHsSFjoL Ld3k55tYGktpkTXjMg/mnTZwfr0tsanDykkjo6nALwsX1Fi7iqcrPmAs3/Qvqh1JU0V+ySYVnzq k3Ik8W2Y9IfBPDE83yVY9ABYjc5jj5yN/zn8ejHt9S1dvD4tGA5cZwp8eoEe07Ndqtno5ac7HeI T3MX2uuZpQbKH8teWltPOxkpK2BSN6QoCnbz8xNO+3246i5VmRLQYLwCqWJFJ0+RpNrevZrz7Kg M0KIpq6Z2XT+yzz/W/ENVTn2fOuH/EC43A== X-Google-Smtp-Source: AGHT+IFo0O3cAAxoQc9cZEz6UoD8mbkGLRZl6Wcjagbg5BbHXem+2WZhz/Zek2Gyco3DGgZAhtc/Sg== X-Received: by 2002:a05:6e02:1a67:b0:3dc:8a5f:7cc2 with SMTP id e9e14a558f8ab-3dd99b13d5cmr155233365ab.0.1748909848107; Mon, 02 Jun 2025 17:17:28 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4fdd7efc6cbsm2001311173.111.2025.06.02.17.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jun 2025 17:17:27 -0700 (PDT) Date: Tue, 3 Jun 2025 00:17:26 +0000 From: Shawn Webb To: Robert Clausecker Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.2-STABLE-HBSD FreeBSD 14.2-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202506022333.552NX1uN061534@gitrepo.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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7vlczqi2qndlalfv" Content-Disposition: inline In-Reply-To: <202506022333.552NX1uN061534@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bBB9j6nnPz3cMG 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] --7vlczqi2qndlalfv Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel MIME-Version: 1.0 On Mon, Jun 02, 2025 at 11:33:01PM +0000, Robert Clausecker wrote: > The branch main has been updated by fuz: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De698e4a537736f6a7dd9a386e0= 0997d7fb08e83f >=20 > commit e698e4a537736f6a7dd9a386e00997d7fb08e83f > Author: Robert Clausecker > AuthorDate: 2025-06-02 22:54:32 +0000 > Commit: Robert Clausecker > CommitDate: 2025-06-02 23:27:00 +0000 >=20 > lib/libmd: disable SHA1 AVX2 kernel > =20 > Seems like there is a bug lurking somewhere in the code. This was not > caught during my testing. Disable the affected kernel for now while I > figure out what is wrong with it. > =20 > To reproduce, run > =20 > jot -s '' -b 'a' -n 1000000 | sha1 > =20 > This should yield 34aa973cd4c4daa4f61eeb2bdbad27316534016f, but gives > fe161a71d7941e3d63a9cacadc4f20716a721944 with the broken code. Only = the > amd64/avx2 kernel is affected, the others seem to operate correctly. Out of curiosity, how would one best determine whether they're affected? Would it be a part of the CPU features shown in /var/run/dmesg.boot? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --7vlczqi2qndlalfv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmg+PxEACgkQ/y5nonf4 4fpiPA/+KrXy/8eXPiOJ8ICCPzYr/dhR3n+nk9mCLYlgc3lxTeA4xvhatBc8K9mY XYa6IRCQV4eDrF/6D4yap4YCjrxQUdB+hs9vszU/vMQdoaQJBgaMlW8q3ED7l0dz 3kVp8qT05pg7KhoHXkxlWyRimPxOfWOZ81m1Gp3083/Ji7IfttSR5rDQg6uH+6Nh ly+ZA+WryAqHq+jfDvPt6xbgPQjXKz4fPjNZ3gotVd7D0SU3S/9wfdJ09bwOY1VX kruJ/tNwkVMONAr+mvzwoFG8JQ8G+cmn4/pvT4QPRLe0cNzXsq78qt+0OicsKFxA 6R8CvqQ7+mjng2zOserfbP8tL4JKNGh9r6sn/nl8XpRYa17P8WyDtJ2UJfgl4oMa H7RXvmRH6WubSoQ4p0dY/nD2m7/A0ifRUJjdMC0wLKFeLywDuXIPrq3D4yml0iEv m3VIO1NtoPWBVMzzBtlqlhG09euuIIMG+MCNDu4C8v3p40n81kQ0JFpmK7ddD2MC fYIIkcfKDu8Xyql2wY6PddVi6SpD+6Ne1Zgc6dSqXpsatXC87+WOV6g5JkBpRjZ8 XMN4IjJlPKmTBVDHRI09Pa4O4dSiHyiKcAQeUIXOPyVI4wg8geTlEdkOXlKI7TZ8 zW7CDUHFLjbK7PdK0EIKNyZre/X6r3fU+dignbKOhmVVsbDge/4= =FCgL -----END PGP SIGNATURE----- --7vlczqi2qndlalfv-- From nobody Tue Jun 3 00:19:55 2025 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 4bBBDZ4qHmz5xcV4 for ; Tue, 03 Jun 2025 00:19:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 4bBBDY60qLz3gkY for ; Tue, 03 Jun 2025 00:19:57 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b="WWvp8/5F"; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::12e as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org; dmarc=none Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-3dda38ce673so7452895ab.2 for ; Mon, 02 Jun 2025 17:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1748909997; x=1749514797; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IS2BB9nMaCmx9XeVsLqrfjJBlHpHjfdU2vMwjZmFKiw=; b=WWvp8/5FdzlfTUoJmDCuCBoyWHRu2+RONEqN67l05f11VX+Ubu5I+d+rSrt6I6YGdn kCnTyKknEmPpiwXwhuEqYyWrEXE4u1pU0miVyiLU41Y/tw5JYKdZd72dnioDIDYWmPYb dRbJGr/lASRzgYRAAKDtKRIrT7h/bsvnRRgJrs8r2fuY6yDzCT2BNldwozVJbNmg44+X 9T75ionYXGXYCiR7jg2UjtKPS3pkoCUGuc/XqbbldMzcsh96UxNMJ73ythXkCzNYBS0K A7rUhUP+VcCBOfobuxx7kMm/Bw6Msi/GHRCCHGOlKdjmefP86mZ3p8sylrVVbQZ+UBTs ik9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748909997; x=1749514797; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IS2BB9nMaCmx9XeVsLqrfjJBlHpHjfdU2vMwjZmFKiw=; b=gcTaTxIt3ZmWlT5lkbXIWzDa+yPirvUp8D8L+3kOZbnPH+MzF1ZDPtxpMiCCVvfshR l5oWPZV1UhR8Z9UTeka0o40cforaAYEj86s6rLrDPJ6ilez9W4UDZbTeFDPtPmtMLsBw OP6cqMvBbYHPa/nxrxzBZ0qzRzJeZVa/M4g/oH1LtrQuBIJs9OtdVz6dju3dWH6bB9Yw PZ+QuKhfdRJ/t67pJllNdoRD+7Kh+iejpQ8EYXct9DivZdkCzxYP7E6Id3fuIhFmyjNN HuZOuxZTjjLugdvjWakgaHKLR4F7g1tB8zBeet86jowcQARLViMILUJ9VFFOwgQzcZgJ Gajw== X-Forwarded-Encrypted: i=1; AJvYcCWTMem0472Et6NaCoKucPx4uWvyjWId+m6PAaBcHEIB+hhzNnrjRNivyqbgvSiy4Hfbpz2CFFpTpuc61Uh+mOmup7e25A==@freebsd.org X-Gm-Message-State: AOJu0YxmQ3sQEry/02qrsNJ3L/LVunp8J4yqrN5f3sk1aFi1LN3ZeYWa T2x3a2Nra9dMCXlRG5/fPnflrRCStcsGBC1pQ/rAaQsKoNA9M9pGtqDudw9MruiIUl0YlIK+qZH GAhl/S74= X-Gm-Gg: ASbGncsqZHX12SP3PPArIGdJGdSHweNBoubqkhPObuig2Z2kcgkjFQo7k4HhfFo6MEc EyQY8L5qSP4l048vsA++oYTAbNhza6d+HYQ70oXZ+ZhcLhiIWtlYqKHBDu129GiOY/7O+g/LuXz az8rCAhLk475hE19RBNZzVFUKkut4qkAMuqoeHLtlU16IyMX4z1U8uCKrVKZAuHmpxtqdN2eSkQ eqT6AcT53GnJLYqy/GO//mto4gFAZcPzfDip8t5bfVJj1mLOWFf1C8VyB71VQqQTzwLsOllb2J/ TegabR9Yc/a3ekWxk1J4j+Ru/0aTITs9cA== X-Google-Smtp-Source: AGHT+IFLruzpAU1IqqaE24aM4HVEXMpVbBd7wFEw9lWUjqnHbZ3/jMeLtXym61S8/skMMSrhrl10og== X-Received: by 2002:a05:6e02:1b04:b0:3dd:b808:be59 with SMTP id e9e14a558f8ab-3ddb808bff4mr2306945ab.21.1748909996948; Mon, 02 Jun 2025 17:19:56 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3dd93528842sm23040585ab.10.2025.06.02.17.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jun 2025 17:19:56 -0700 (PDT) Date: Tue, 3 Jun 2025 00:19:55 +0000 From: Shawn Webb To: Robert Clausecker Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.2-STABLE-HBSD FreeBSD 14.2-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202506022333.552NX1uN061534@gitrepo.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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tbp6yw7zahhtp2wx" Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-3.50 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-0.90)[-0.902]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.42)[-0.416]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_MEDIUM(-0.09)[-0.087]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; DKIM_TRACE(0.00)[hardenedbsd.org:+] X-Rspamd-Queue-Id: 4bBBDY60qLz3gkY X-Spamd-Bar: --- --tbp6yw7zahhtp2wx Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel MIME-Version: 1.0 On Tue, Jun 03, 2025 at 12:17:26AM +0000, Shawn Webb wrote: > On Mon, Jun 02, 2025 at 11:33:01PM +0000, Robert Clausecker wrote: > > The branch main has been updated by fuz: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3De698e4a537736f6a7dd9a386= e00997d7fb08e83f > >=20 > > commit e698e4a537736f6a7dd9a386e00997d7fb08e83f > > Author: Robert Clausecker > > AuthorDate: 2025-06-02 22:54:32 +0000 > > Commit: Robert Clausecker > > CommitDate: 2025-06-02 23:27:00 +0000 > >=20 > > lib/libmd: disable SHA1 AVX2 kernel > > =20 > > Seems like there is a bug lurking somewhere in the code. This was = not > > caught during my testing. Disable the affected kernel for now whil= e I > > figure out what is wrong with it. > > =20 > > To reproduce, run > > =20 > > jot -s '' -b 'a' -n 1000000 | sha1 > > =20 > > This should yield 34aa973cd4c4daa4f61eeb2bdbad27316534016f, but giv= es > > fe161a71d7941e3d63a9cacadc4f20716a721944 with the broken code. Onl= y the > > amd64/avx2 kernel is affected, the others seem to operate correctly. >=20 > Out of curiosity, how would one best determine whether they're > affected? Would it be a part of the CPU features shown in > /var/run/dmesg.boot? Nevermind, running your reproducer above is sufficient. And, it appears that one of my Intel laptops is affected. I do see the following line in /var/run/dmesg.boot: Structured Extended Features=3D0x1407a9 Sorry for the noise. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --tbp6yw7zahhtp2wx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmg+P6oACgkQ/y5nonf4 4frqphAAh35OmZ/GeNkxX/f8rui/i9HNZtJGvPdnwKgsmMGc28tGxj1BEWPsOPBu RJ/bfVpPPco4X6TTtnz77ZOKq26LRzz8dBRkfm7lMnIVIVCs9d2FdM3BGkYE9Vbp klJOJ6SpIFYcIHEvaYnBWe7DiFHw5xi2OnCZ8388TA2kHE9Me+35QzSazSgC5nn9 8Ab/JOSpSWNhXKGT0xU+JHoIBDipkrNmx7k43CU7n3KRI0B970rjQGxLxPI+BeDl 8edotGpLe7IYHoeAq/6TqsiszaIGDPP5sm3yu5MhqPlid1qmNIMoav3I0T2+wn4k +VwyWhCPcZzXsiSIbRtNWC9tecUGe1AKv4Hez2nywOncHsg+mG+F6uTIlJvoLUwU cQSCHqOLphlRYrxVZsBZoaGV8XV4jLghQgARYV2uWzNv84TiPkYAB8Bfz0O7sXhi i1RINxzxZrvUlWa3srZpAzL5rYOcpF30i7xTJ6agD+FSf3SfWEddcrGppdkaqpgi 71pJdz5UCLe1S/tzmgqaQ+Oc1mMC5+b8ujDsog5+Z9+T1Ea5+AEQOm4mdgJ+XtP2 5q8hfJ/VTU5NS5SfI9mqEXV1iRLA0m28l9xVUsFkVVhvI+pKaatgZjaArwt4o82m g+xBKoQgCI8UsaUHnvjZlL4dIWTxPhNqhmJKnWJJbV+RT/qGLwU= =+V2e -----END PGP SIGNATURE----- --tbp6yw7zahhtp2wx-- From nobody Tue Jun 3 00:59:46 2025 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 4bBC6W3jM6z5xfsM; Tue, 03 Jun 2025 00:59:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBC6W0l81z4Mmp; Tue, 03 Jun 2025 00:59:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748912387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lhK9NyfRgZZubGxqZjzKPPJqMuQS312LGJKx21+2Nts=; b=sgBQft8uxARoXP5Gf7dQFvn6e9u7CYE7ArtY/0M3y5FObfH5inSlQC2tPBSbbmPAlr6eUu htj6x+VffpsdicLgWSjf7kh0UcriUMHr+UOpuM2OlvoUUpvgQS7beJspVR6Tj8ByGchEEr yXHDsuZc54C2lZPGRtGGrGvAhfbGgF5qmpcy9gb1luw4V/LmFfbSBKsG/il1k+xEQAoowp eYfAMX4FtQ4Y2dwHB4wPzvmTKrEAFhHRB7nVM0m9FQxfsJ9z3N4TBJcq0DyFo2aXx337BT StAD8rK0lpk0fMVhAZ2M+VB5O0MRXUvoYoRQvhvvinw4p1oTUuZOLsDlY1pMBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748912387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lhK9NyfRgZZubGxqZjzKPPJqMuQS312LGJKx21+2Nts=; b=XkQGg+ZmD9C4SvsuPJI59prZBaK76YGYpbpWyqSIjCLV0y4a85Pjh1ctPafcor6vEt+bXx s5kBenevFp9x3cF3Vszc5R5s1iTBMAIp5P2HiVu6+q2VWnIlqj2Pz2IdbijkY4iKiZgsIT dywHYDLhW1unuSJfgUfG8t/qMctx0K0PEuc5VXjLbVyJT2EeajFi7BCIzm5utRyw5dfEyy +rBHXUzi5d7Crf9Je0Uwhd9rKy2kHhxq65lebaq8JJRGMqNyKCUYBUCoOd3OPM5BYSg/VC on1Ozvc620eWgHRj/hAxhCAMMjYOL7HKcywFWPBQg3JBbkXV+4f0Y2CS6VaEKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748912387; a=rsa-sha256; cv=none; b=btxU22WZfjaZPRZAHSV7RYaazc7ITPDL6s58L7qFb5Qzskeo7RacGyQ2xPr6Dy5I9G6VlP DoLOljU1pbmCO0EdTFCAXNMVQn3OJ8QCx1GoAesCSnNmyLFuM+cX/8uwuaCaV1+jSLk41E rsPtjs44rBMktVezlXrxWWjPty6F7qbm1no9zb5ppIz+Rmaqi1OnQsJ7lpi6/HxqxLjt0O uNoXbVhwjnjRlK7d+l938VIwRoKyQvZuFL9ykacxqfQCkWiFf++embIXEjNnxIq4KLwnB5 ctUaq68x+4hzY7CmKkBnl8MZ734D/+5pakAaNhf4jBgVjYhN9WxtilbHMHI3sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBC6W00kpz1kC; Tue, 03 Jun 2025 00:59:46 +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 5530xkNb012576; Tue, 3 Jun 2025 00:59:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5530xkrV012573; Tue, 3 Jun 2025 00:59:46 GMT (envelope-from git) Date: Tue, 3 Jun 2025 00:59:46 GMT Message-Id: <202506030059.5530xkrV012573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jes=C3=BAs?= Daniel Colmenares Oviedo Subject: git: 9fa8ba74acd6 - main - committers-ports: add myself (dtxdf@) with acm@ as mentor 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: dtxdf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fa8ba74acd6668b9dab532f5d234a3f8cf1570d Auto-Submitted: auto-generated The branch main has been updated by dtxdf: URL: https://cgit.FreeBSD.org/src/commit/?id=9fa8ba74acd6668b9dab532f5d234a3f8cf1570d commit 9fa8ba74acd6668b9dab532f5d234a3f8cf1570d Author: Jesús Daniel Colmenares Oviedo AuthorDate: 2025-06-03 00:59:18 +0000 Commit: Jesús Daniel Colmenares Oviedo CommitDate: 2025-06-03 00:59:18 +0000 committers-ports: add myself (dtxdf@) with acm@ as mentor Approved by: acm (mentor) --- share/misc/committers-ports.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index 58840655413c..7bb3d936e5e5 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -183,6 +183,7 @@ demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] diizzy [label="Daniel Engberg\ndiizzy@FreeBSD.org\n2021/07/06"] dmgk [label="Dmitri Goutnik\ndmgk@FreeBSD.org\n2019/09/15"] driesm [label="Dries Michiels\ndriesm@FreeBSD.org\n2021/11/06"] +dtxdf [label="Jesús Daniel Colmenares Oviedo\ndtxdf@FreeBSD.org\n2025/06/02"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] @@ -319,6 +320,8 @@ zirias [label="Felix Palmen\nzirias@FreeBSD.org\n2022/08/02"] "0mp" -> driesm "0mp" -> nc +acm -> dtxdf + adamw -> ahze adamw -> jylefort adamw -> ler From nobody Tue Jun 3 01:51:44 2025 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 4bBDGS5Sgvz5xnfn; Tue, 03 Jun 2025 01:51:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBDGS4d5lz3xrr; Tue, 03 Jun 2025 01:51:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748915504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xTmWZQdHbGfBbp7LzIZvzlYCIJEd2xN0gci99IkOIVg=; b=KG8iqxD+BcSUKo8ZVmQNQ3boZNxXBHqe6nKbJfJp1BnD4Rk4HFPoJBnpw2kxPUwhFtR4pW 9Fn2WXV+vYz2qM7amolEa0QzBveYlIqHOzsD2CifTcNvyckwnKn+3KxWzHxF/CyCKwHYR/ WI4v7IwkqDPTriLgGx6uZz3yTvOk5ahPuW/z8tQzkZyogxPTAo5cCidvRIhj13FCIdlOW/ xJGFaZEbpiJX7wTDLgWdtK6mFzsPQ/6fYzGJnUlvO4Nmv7RAUHiEgY2K5Jd9wBn6OtE/Dk mPS6JMTskWvWIG29xCBwsMmNw1ToEUjEP2vjjFX6wo4HaYHZEOqc5OqGRi33pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748915504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xTmWZQdHbGfBbp7LzIZvzlYCIJEd2xN0gci99IkOIVg=; b=OZ/nWi89M6l2+lKby56g9IzAl3uGG4R2sKXhW0lG+DJr6YUQfHjGuwZqXff9exu7rOS4qw PQhbT3g+qO4H20jSAZzQGAYRJB3Ff1MogWqwqOQ5vFrpVcw/iqfhyut0Swc66p40dWsWCV 3Wd1QFbDuuOJghrqmy5GJmIlGle043OMTfmTTtFT/zS9N0z1xDQjYnUyEKpWKXWt+DRTk7 hMR2OAZk8LAF2B8vYqceRXITvvsjA6XV0SHMo9o3V/cSqKIEhdgz+Db+yiMfShZKnh/taq un912ddjgeCTMUTKeMt0WIsZQVY4xMgeL8Yd6/mF7zQiBR7Z/1BIrGW/YwCQTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748915504; a=rsa-sha256; cv=none; b=SkodYYFXLho/muhKQUMNkPGm2r6inL4E1s8KiEwUnUfl2LoIowpZDWQnVX189lzu3fGcK1 rss+Qhf+lJFGgTcWSHwHziNv0Z4ZZBGrqY0ICGTpK59C9RjjE0Zg5hu36xCHio+KJmLki3 rr4sJrLHJuepZxJa//fpXDl07umz1XEBxkcivo0go9UDWZQUtVsjdwhJsABES8reKchMuv t+JTr2+RsfwIhhv6srQ7L9VPz415M/o9Ditjv4cNY9b/ul8iPG99vcFagwybQsYcODVAGx hg01TllQF3rQps32UPyXyx4JpHyq1/2fPR6NCuJWV6nJiLw8CdN9WlZJ96UR/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBDGS43m4z3G6; Tue, 03 Jun 2025 01:51:44 +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 5531piM7020798; Tue, 3 Jun 2025 01:51:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5531pias020795; Tue, 3 Jun 2025 01:51:44 GMT (envelope-from git) Date: Tue, 3 Jun 2025 01:51:44 GMT Message-Id: <202506030151.5531pias020795@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: 207f3b2b25ea - main - libmd: Fix amd64 AVX2 SHA-1 transcription errors 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: 207f3b2b25eaa0f9d32699e664b139e5e40e5450 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=207f3b2b25eaa0f9d32699e664b139e5e40e5450 commit 207f3b2b25eaa0f9d32699e664b139e5e40e5450 Author: Jessica Clarke AuthorDate: 2025-06-03 01:46:57 +0000 Commit: Jessica Clarke CommitDate: 2025-06-03 01:46:57 +0000 libmd: Fix amd64 AVX2 SHA-1 transcription errors This source was manually transcribed from Go's assembly syntax into FreeBSD's. Some differences exist (e.g. around stack frame allocation, but also some upstream LEAL instructions were replaced with ADDL here as getting the 64-bit super-registers of 32-bit isn't so doable, unlike Go) that were intended, but a few errors crept in. Fix these, found by comparing post-processed disassembly[1] (handling the ADDL difference above, and due to Go's assembler not optimising VP[X]OR encoding by commuting operands when it would give rise to a 2-byte VEX prefix) of a built copy of the corresponding Go source against ours. [1] In Vim: %g/\/s/\(%ymm\([89]\|1[0-5]\)\), %ymm\([0-7]\), %ymm/%ymm\3, \1, %ymm/g (to commute the VP[X]OR operands as LLVM does) %s/\\([[:space:]]\+\)(%r\(..\),%r\(..\)), %e\2/addl\1%e\3, %e\2/ (to convert LEAL to ADDL in the cases we do) %s/%e12\>/%r12d/g (as the previous conversion turns %r12 into %e12 not %r12d) Fixes: 8b4684afcde3 ("lib/libmd: add optimised SHA1 implementations for amd64") --- lib/libmd/amd64/sha1block.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libmd/amd64/sha1block.S b/lib/libmd/amd64/sha1block.S index 0307dcdece32..f1291ef2647a 100644 --- a/lib/libmd/amd64/sha1block.S +++ b/lib/libmd/amd64/sha1block.S @@ -1220,7 +1220,7 @@ END(_libmd_sha1block_scalar) .macro calc116 calc_f2_pre 0x130, %eax, %edx, %edi - precalc37 %ymm5 + precalc36 %ymm5 calc_f2_post %eax, %ecx, %ebx, %edi .endm @@ -1354,7 +1354,7 @@ END(_libmd_sha1block_scalar) .endm .macro calc139 - calc_f2_pre 0x1cc, %edx, %ecx, %eax + calc_f2_pre 0x1dc, %edx, %ecx, %eax precalc35 %ymm14 calc_f2_post %edx, %ebx, %esi, %eax .endm @@ -1586,7 +1586,7 @@ ENTRY(_libmd_sha1block_avx2) add $128, %r10 // move to the next even-64-byte block cmp %r11, %r10 // is the current block the last one? - cmovae %r10, %r8 // signal the last iteration smartly + cmovae %r8, %r10 // signal the last iteration smartly calc60 calc61 From nobody Tue Jun 3 04:07:34 2025 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 4bBHHC0LWyz5xxYn; Tue, 03 Jun 2025 04:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHB6lzMz3hYD; Tue, 03 Jun 2025 04:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPs2wHm2SQxFXpRFwtgNC773TLo58Aq3eWitTEAaQ00=; b=bHsK0Vxiv5NTOPOQ+dLZRjXV4Am2l3vxBcHmLovmD7w8te+gBzU1+IDcXth1CgSEVEKZ7P iPw6VsDITcsSmqT2LDuMA2YYgKQFJ/s8vXrhivVezVwh1IFTJHGRfOnk2uCxtE+ng6asY3 I7frMRj2xcE5p9bDnfLPYGDScKZ0uuwnE2OeGDsdsHh+BbBs6QgOIdj5VoIHH5sk82yTMz uQ9ckfEKzG9VJkr3ugYH0+QvpjejsL/EaFiAd+376I7pshVfSK861snLkFVJ/SS/kAVrkq ohB5fIaOm8c1Nj5ZEUcE3v5h36p63dVn3eMNgEfVeSd2cFxN8dA+bHBi5v9pzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPs2wHm2SQxFXpRFwtgNC773TLo58Aq3eWitTEAaQ00=; b=YVYXKvhiHHmVQJbXUShlOMDss58o2aA7Z/1qHq/eDRoesxLiMAkum1wTf+K9OD0S/CqDT8 8sZK0U0UO3tlH/718D2Gwcy/x5cb6QtKZ1iJjXavU/ZklHxXuJisVNlQ+hKDucIAMmQTBf osu61T2/v2y5VWibdE2/6XByx5y6sbh492z6e8q6T4F3J//tx+Wgy+ZGAeCaw5YP53K+cJ Xa80UHB+uV/f2gIQCgcxFisOY8t56pWJjCr/gLPi3vVI3GlsnQeywkq717/Z7B/bhwfYQO jnrGbVka09hu6Q32z1MB0YWH+rLKWhEkIC/5CWYjQjIKGpqYkyVv76WnvDYMvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923655; a=rsa-sha256; cv=none; b=cjUC8hLSOCS/ftThkj15hWM7VOD9DfA/ompSVMTKhJkocbfxWTxP1425aE6YCgkdyxEtoP 2igy990o4OmWlK0pd2+BQn+p6vY3odFdArzxielfPhSyqfxCk+v+YjrOMEUgVx8KiCYhrW 1HBqqqEg1udCSdTJDXsRkZM7Q/VJQLp7bZpaRMmaPBjnDdWoePDtdE9WnH64G9vxR478iW 0Eo2fJsqQNjcxumABOexvCzkX0kFCTXRD/doWJqoBKzgZ1veVRUrNN1hwVCE/nnfOyGVZg Ch74G3H1e54fffb9SJVg+jJc13/YziI1eApzWTJbsDpw2v+oyx4NbjYu13mxtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHB69jyz6pp; Tue, 03 Jun 2025 04:07: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 55347Ymf071028; Tue, 3 Jun 2025 04:07:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347YiF071025; Tue, 3 Jun 2025 04:07:34 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:34 GMT Message-Id: <202506030407.55347YiF071025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b3a93154db74 - main - Extract exterr_to_ue() 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3a93154db74e44d44d0210c728e12c713393a50 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b3a93154db74e44d44d0210c728e12c713393a50 commit b3a93154db74e44d44d0210c728e12c713393a50 Author: Konstantin Belousov AuthorDate: 2025-05-31 21:08:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:43:58 +0000 Extract exterr_to_ue() Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/kern/sys_generic.c | 28 +++++++++++++++++++--------- sys/sys/exterrvar.h | 2 ++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 91bf3e93fa7c..ec61d0bdc541 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2202,6 +2202,23 @@ file_kcmp_generic(struct file *fp1, struct file *fp2, struct thread *td) return (kcmp_cmp((uintptr_t)fp1->f_data, (uintptr_t)fp2->f_data)); } +int +exterr_to_ue(struct thread *td, struct uexterror *ue) +{ + if ((td->td_pflags2 & TDP2_EXTERR) == 0) + return (ENOENT); + + memset(ue, 0, sizeof(*ue)); + ue->error = td->td_kexterr.error; + ue->cat = td->td_kexterr.cat; + ue->src_line = td->td_kexterr.src_line; + ue->p1 = td->td_kexterr.p1; + ue->p2 = td->td_kexterr.p2; + if (td->td_kexterr.msg != NULL) + strlcpy(ue->msg, td->td_kexterr.msg, sizeof(ue->msg)); + return (0); +} + void exterr_copyout(struct thread *td) { @@ -2215,18 +2232,11 @@ exterr_copyout(struct thread *td) uloc = (char *)td->td_exterr_ptr + __offsetof(struct uexterror, error); - if ((td->td_pflags2 & TDP2_EXTERR) == 0) { + error = exterr_to_ue(td, &ue); + if (error != 0) { ue.error = 0; sz = sizeof(ue.error); } else { - memset(&ue, 0, sizeof(ue)); - ue.error = td->td_kexterr.error; - ue.cat = td->td_kexterr.cat; - ue.src_line = td->td_kexterr.src_line; - ue.p1 = td->td_kexterr.p1; - ue.p2 = td->td_kexterr.p2; - if (td->td_kexterr.msg != NULL) - strlcpy(ue.msg, td->td_kexterr.msg, sizeof(ue.msg)); sz = sizeof(ue) - __offsetof(struct uexterror, error); } error = copyout(&ue.error, uloc, sz); diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 5f55e377239a..3fe2c7446ed1 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -62,6 +62,8 @@ struct uexterror { #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) +int exterr_to_ue(struct thread *td, struct uexterror *ue); + #else /* _KERNEL */ __BEGIN_DECLS From nobody Tue Jun 3 04:07:35 2025 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 4bBHHD4MtJz5xxYq; Tue, 03 Jun 2025 04:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHD0Mvgz3hHv; Tue, 03 Jun 2025 04:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq1xbd4bDwLLfuYKKqy6Jy2kojStxvjPJcqDIvP1BGI=; b=anLdnybh8cup5vfVu8FT/JVNW8pF3S1zszxf8yJy2Jp5GH5xW6HC1zPIcXvuQ4hDIN6cVS e+Rube2y7EHvCiZwlO6tKS1Y+CUVwPJlRPviBQC17A604E8pHaN7Cs/F08hM3FfA8Mc51t DjWhFcHT4U2PHX8mMBDILYHT+mbpKch76lA2vkxUCZZx06R54iwnZOgoRXB8EKp/8URur6 LPpBik//qsAtqDbh3OkPRAiZFNHDBD5Zd15hACpHtMeQG4mo5Yr4drEvbvdd8BRQWdzZhr GtYE4aAT0FwAwCF+KECWih1WCHdan7BAZKVyfSnIecpVkP3xj/4l0rHX7NxxSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq1xbd4bDwLLfuYKKqy6Jy2kojStxvjPJcqDIvP1BGI=; b=mW/Xq0OndoKARJpqG5RiARaFGwznCnJbJBeBgKgmNlSt94IqPEoX4kGBwL6MbGVoXDWa// JU8t8j0X4IriU2KFk5K7jYKEEMAq41izJi5twskQyd7ivTJqHTQUu1dcfdYO9jDizAlqgC g7W76MoqpV47Qz54QS2qedZJSwLMEmTpGFJ97vvitJnl4XIf6QoHuSdZr9T1Wk709Ddvqg Eqs3oyCJQMGw953zrc0dKL5x2IeXAeasrpVX1Xiat96azorSMVk9DkggCb1wrees9PAZSC wifHNjaCJ5ljaprmADesKFeeH7s8bkTxDaW4HJWozUODQmD1lwjygtsDgNEqvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923656; a=rsa-sha256; cv=none; b=CYAgH+KjOVZ/RGzNl2tMyK2/6eVN499qvqJKAaW+exOdCOE9EtveZpeo5ASD4R+IRr9ygL BKlry/v06wrbS4DurQA/BaOzRN9ULaRO1kkYTReeg5/DekYuzUQDr9tBELazbjrKgiqyE/ +646rxTqCXhpT4JpEUuiAXYIewYhpm/EIPmAY6lLXyIZWfEZpgSKC55CA0e4PMiB0XGeWw cdJ/ewtwAB5y7DIYMtMmdO08BvL222gsFAclCU5WgUmLjfx1Kse6FsQlOlseXgd9SA3yb1 jYDBlFxs86kKF9lVp5ZJcyxmoc8rq5iV6PloQPxdzxM/PSmYT4/qXwdZI5iNaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHC74jkz76Z; Tue, 03 Jun 2025 04:07:35 +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 55347ZKu071065; Tue, 3 Jun 2025 04:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347ZTr071062; Tue, 3 Jun 2025 04:07:35 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:35 GMT Message-Id: <202506030407.55347ZTr071062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e5586b32d2dc - main - exterr: move the definition of user-visible struct uexterror into sys/_uexterror.h 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5586b32d2dc5c6112fdc9557c92cd57fc60b0a4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5586b32d2dc5c6112fdc9557c92cd57fc60b0a4 commit e5586b32d2dc5c6112fdc9557c92cd57fc60b0a4 Author: Konstantin Belousov AuthorDate: 2025-05-31 21:39:08 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:43:58 +0000 exterr: move the definition of user-visible struct uexterror into sys/_uexterror.h Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/sys/_uexterror.h | 27 +++++++++++++++++++++++++++ sys/sys/exterrvar.h | 15 +++------------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/sys/sys/_uexterror.h b/sys/sys/_uexterror.h new file mode 100644 index 000000000000..2bbeb3e4186f --- /dev/null +++ b/sys/sys/_uexterror.h @@ -0,0 +1,27 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 The FreeBSD Foundation + * All rights reserved. + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + */ + +#ifndef _SYS__UEXTERROR_H_ +#define _SYS__UEXTERROR_H_ + +#include + +struct uexterror { + __uint32_t ver; + __uint32_t error; + __uint32_t cat; + __uint32_t src_line; + __uint64_t p1; + __uint64_t p2; + __uint64_t rsrv1[4]; + char msg[128]; +}; + +#endif diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 3fe2c7446ed1..2fb4c494d158 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -12,19 +12,8 @@ #define _SYS_EXTERRVAR_H_ #include +#include #include -#include - -struct uexterror { - uint32_t ver; - uint32_t error; - uint32_t cat; - uint32_t src_line; - uint64_t p1; - uint64_t p2; - uint64_t rsrv1[4]; - char msg[128]; -}; #define UEXTERROR_MAXLEN 256 @@ -66,6 +55,8 @@ int exterr_to_ue(struct thread *td, struct uexterror *ue); #else /* _KERNEL */ +#include + __BEGIN_DECLS int exterrctl(u_int op, u_int flags, void *ptr); __END_DECLS From nobody Tue Jun 3 04:07:37 2025 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 4bBHHF4sz4z5xxtx; Tue, 03 Jun 2025 04:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHF1B7bz3hTW; Tue, 03 Jun 2025 04:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJZ55D7OLrbtODvyjRDzdyFowGFk2HoNzbaqNkfz8i0=; b=eVqhPHEKrmQf0vkMqI4JCkDEpnx4KAEjpcqFjcXCHY0nFKqxrXSj8c1gHXow2t1LTYksTT CZ62WjiTqCGYdNOXwbJylBkJJQZK9EOVvivtYwHS6M2+vvod/MQyz2j1UVqJdhnLIIkLNP Kr1B3JQDyBXJF+NVe3GFb4W2BTgXlLbqF0YxrHKuFvYlnZB7N+OObLcT3+H60jSvfa3hd9 LnBsR7Yq9nsDoXMt4PyIgU4qkAmStYnJGblWkwGNov74DHqPJWFKUDdu38cqAg6TbUJ9e7 eyTRXGGAalJrfXlzUPE60i4P41s8Vk520/wbsRr+lmE3qS92kuWMukq1hXknQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJZ55D7OLrbtODvyjRDzdyFowGFk2HoNzbaqNkfz8i0=; b=DXLonwUoSFs2YFgmURZXtvDiTGXoosih47XPqnOinxT3tv8b3VL1kQoh2wYLbdiyKYtt9F zmbyj3owk2+qI5hwd8YYaie9FiYa9Aci3MjYeNY2fdNk8rvN383zRc6l2A5593qGbOdImb 9prouBmzHy6yS2bKK7g2obuafrQOeuOLKbUmZnxAuaquYYbBy/RbcSpVITyEY53RS44nIZ j6IP7+xu05q3OL4o8QLbWhcdFVlmsrRAKQWrXW7I6QXUqdP2qnFbf0b6r7BEfBqgPDraOH tx1M7++jtEsk6wGtuF8GIbTNI5VuxJZYU+sn3KvMQtxmabICITAQPKNlLgoG1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923657; a=rsa-sha256; cv=none; b=IgYaEIqulJt2hWiUURCC3f2IV7Jg7YrZYHSmXUzSdzpQi4yBx88fz0uc58MZhTl/B/ioLm rhnnaJ8hgw+YG1P5X8OgLjXyr7dELJPFhBOdFi25ERACEnERuHmfbv4fJ1FdREpKl5vMmr K/nU7Djh154ldM1iyhSA2B0zdwTswxnPxUwU/L9Z0wALLL6CjDnJzeewyMddPIqCDAG3F0 +ZYzDYAcvWtghPOR12ZTeu2h4rGox96A9vgHogE8Maq33noKRdpOZWrYA26mmLJgVC226f uJwH7M9I0/B04a7s04kDcKmTRe5+wsYUqWgOP6PNl8ymIxp/9DNvz6aO6hu4JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHF0f22z6pq; Tue, 03 Jun 2025 04:07:37 +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 55347b8u071105; Tue, 3 Jun 2025 04:07:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347bmc071102; Tue, 3 Jun 2025 04:07:37 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:37 GMT Message-Id: <202506030407.55347bmc071102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 765150dd4d05 - main - struct uexterror: add flags, bump exterr version 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 765150dd4d05425f599c5ec0543071d77f399ea5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=765150dd4d05425f599c5ec0543071d77f399ea5 commit 765150dd4d05425f599c5ec0543071d77f399ea5 Author: Konstantin Belousov AuthorDate: 2025-06-03 02:45:47 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 struct uexterror: add flags, bump exterr version This is ABI breaking change, which only affects HEAD, and which result is non-functional extended error reporting for older world (with previous uexterror layout/previous version). No intention of providing the compat shims. Requested by: brooks Sponsored by: The FreeBSD Foundation --- sys/sys/_uexterror.h | 2 ++ sys/sys/exterrvar.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/sys/_uexterror.h b/sys/sys/_uexterror.h index 2bbeb3e4186f..7951b2c5b26d 100644 --- a/sys/sys/_uexterror.h +++ b/sys/sys/_uexterror.h @@ -18,6 +18,8 @@ struct uexterror { __uint32_t error; __uint32_t cat; __uint32_t src_line; + __uint32_t flags; + __uint32_t rsrv0; __uint64_t p1; __uint64_t p2; __uint64_t rsrv1[4]; diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 2fb4c494d158..7e842f553866 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -17,7 +17,7 @@ #define UEXTERROR_MAXLEN 256 -#define UEXTERROR_VER 0x10010001 +#define UEXTERROR_VER 0x10010002 #define EXTERRCTL_ENABLE 1 #define EXTERRCTL_DISABLE 2 From nobody Tue Jun 3 04:07:38 2025 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 4bBHHG6Pt1z5xxfJ; Tue, 03 Jun 2025 04:07: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 4bBHHG2QB4z3hbx; Tue, 03 Jun 2025 04:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BqIKVKSQ4WVtDknhZt+dXXaJ23Jc4jidUqrbJ2lpH4=; b=POxEc18pmSswcJd5a0t4b+4JPoRLnOW32PrrsRDTRs3v/aNVoHqgq9j4jOa4HheJldV52u OUE5irLSUFAPqwTxpENlEItrHvKFkfZTWAH3vgPQOn9eQKLvtEhojfkbONFrBGtwhKr8sH lDDEGy0JtMrhrdW9oyOX13p1oJStUcBa20AgPpP6Fba/fiLaf4i3XBAV2a6vjNzho0h51l TdK6VvUnnMS/zYMUTT0hi4Ss0YeGohZO/PPsHwPSf8ZrlCel472zcx2vIiSvUy0Utz3CeL PXCpEwLrWJsh9lFXislX2KxpkxEJOtza19dLas6crKpvpDHnjPi0AZJGo4pKhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BqIKVKSQ4WVtDknhZt+dXXaJ23Jc4jidUqrbJ2lpH4=; b=jroi+3A7sdh5baUj8UCP6ClTr0Fmpv1O7j+6QsO8vEul+T3XpIUEy6MJddMJrHdKetii89 QceogJKul+t1uTk3Tia1SgxhqUJbvBw55fYrEUBLFtG03sQQSmrwSHsbI3dt0/CjHR3+JQ iEElU6SqPIZ7P1noVTQW+51890guqFxKfndxYCnERJJpQd5NRan3TK64BnCa5D/+OmQ0eg lGMfTnE9TsRhqv4HpSsZPzGuduIYV/IzWDR1mS7FidsRUPBHnXjz3+Pk+PpvP6ymSI27LZ 7qsodufcCcPzx5nk54WIXkhAEEN9dlmPCCg1U/7vFc0IIkCfUZWO9F7WsyblMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923658; a=rsa-sha256; cv=none; b=iRngtVb0PE1+iYAsZSrD8vDbvRcfal5uv3WBt0FKopVIKzaLMLbn+xjs146G/bhz7FwUGn L8LjqaJyxNaMTdGC0Yrog/QuvMYIge5T7/J4xeJUseDYdZ1FZvR/idailnRUtVG+ihAuLu 5tkV8vAehQ7ulGeOjHI3sCAdSvUe1Ws2HtsTumgPiZGdazl6KeXK+ftB/SJHBdxdspAu9j pw06fVOiVLsAjPiL7+Xxi8fcwnqhXt9dZMBPEfHq9Y08mIj81w7qjOBGy1TDIN+4Gg9gQO okhAw4k3vR1Fl8u6i2WtpXrYzFN4/JsJZswFgWDMnsPSm9hdFnbdtezWB3BkrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHG1wTkz7GX; Tue, 03 Jun 2025 04:07: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 55347cdA071140; Tue, 3 Jun 2025 04:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347cD5071137; Tue, 3 Jun 2025 04:07:38 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:38 GMT Message-Id: <202506030407.55347cD5071137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ac1a57f6c325 - main - ktrace: define user interface for tracing extended errors 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac1a57f6c325cf5d66a82256de42fdae49121466 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac1a57f6c325cf5d66a82256de42fdae49121466 commit ac1a57f6c325cf5d66a82256de42fdae49121466 Author: Konstantin Belousov AuthorDate: 2025-05-31 21:11:47 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 ktrace: define user interface for tracing extended errors Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/sys/ktrace.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 6608b9250da4..dba650c72494 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -36,6 +36,7 @@ #include #include #include +#include #include /* @@ -272,6 +273,14 @@ struct ktr_struct_array { */ #define KTR_ENVS 17 +/* + * KTR_EXTERR - extended error reported + */ +#define KTR_EXTERR 18 +struct ktr_exterr { + struct uexterror ue; +}; + /* * KTR_DROP - If this bit is set in ktr_type, then at least one event * between the previous record and this record was dropped. @@ -306,6 +315,7 @@ struct ktr_struct_array { #define KTRFAC_STRUCT_ARRAY (1< To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6abe7e2a929c - main - exterr: add category for ktrace 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6abe7e2a929cd463075c5daa62f400abeff9e326 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6abe7e2a929cd463075c5daa62f400abeff9e326 commit 6abe7e2a929cd463075c5daa62f400abeff9e326 Author: Konstantin Belousov AuthorDate: 2025-05-31 21:40:29 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 exterr: add category for ktrace The only purpose of this category is to allow inclusion of sys/exterrvar.h into kern/kern_ktrace.c. The ktrace facility is not supposed to generate extended errors by itself. Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/kern/kern_ktrace.c | 2 ++ sys/sys/exterr_cat.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 7a5846de9f6a..973f19d1d060 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -34,9 +34,11 @@ #include #include "opt_ktrace.h" +#define EXTERR_CATEGORY EXTERR_KTRACE #include #include #include +#include #include #include #include diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index d16faa9cc2e5..adb474e84c1b 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -13,6 +13,8 @@ #define EXTERR_CAT_MMAP 1 #define EXTERR_CAT_FILEDESC 2 +#define EXTERR_KTRACE 3 /* To allow inclusion of this + file into kern_ktrace.c */ #endif From nobody Tue Jun 3 04:07:40 2025 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 4bBHHK1LqKz5xxyt; Tue, 03 Jun 2025 04:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHJ3pjGz3hcV; Tue, 03 Jun 2025 04:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kdSkXi5N0fh83HRrRzlAuSj9NGVu8NX3BfZvxHSSKl4=; b=daMZfILuBWKalJPd9Bf811N6G+r2wlFUMFzhJTLkPiSQW1BlYyS0MLfV4ZVu0C094IIcLL gkUwClVGRbMWch5DOS9gLeiodDUVxB8T725SnenDPl14KAvto5whgP19ZxnWguZtWlB2ow LLONKMkyQF9C+PnvW9DROShDhifn1gV2uCl482yBQkSwOwZKkrNjE9nLFALIOBwx4B7IOd Plck1bMPxDrWvLry3wmbjWaldae976jRn2ggiRQqAUkpqSy9RgYa9yGM0yN+VS0cwjXwjz LkPfVdZAWyyyCH9Z1LvmqiqyxbtH5RMYsGVFngv5QKxAmm/EFPa5gZ7j1DgHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kdSkXi5N0fh83HRrRzlAuSj9NGVu8NX3BfZvxHSSKl4=; b=slRJnuozhc29AanTdrr3S2uRr0raZNVdMalWWt8+cujfpDl442YF0VEaoC/UYf2N5CSyS4 bcK7F7SsXp+RbDlScahBfmdEeKwB6HQ0zLPVUqHxQUAnd/PV15T7tHRLkx2tg5IhKqhT2U Ct88ESSCI0IeOhmyToWXLmOHzhy2WPKno7FwwN/Iexvpf2LCNqBh8D2lTQ8gmHov7t/1Nh UHGfJrhCI+jnnMcR1doEjxJzVe9LgJwkLQcNO7O5UUbGWqUEQUImPv7guERqhy5otYpRFp q+DOv0jxGlPEkSh/f91bGxJxNaM+hu3sq/rwBzWtUa2k2LRjhFffp9L27SaU8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923660; a=rsa-sha256; cv=none; b=aimzpTieDgNbQZ80Uc/r+nvB6XuMTU/dSQ19toP40b5MR4CBDKwamAGaAWp0fYzoYWaOsh 7JuMJwDYYCyb9Rx5G2ogWQ/NkUqBu4AM3Mc0/vYTvfgGkANBRHv/67ZvW/n2RxNtD+Mt72 UWxFr3dHv6BEI+xz9K+9mFnGlY9uY3xepGvMz4sbPQ8jg2LdPoCq0P0VMVgPKnonV++Xj+ zZaPMGyS1ZfTYp1aeIR0V5ElPX1zJ1z+0QfhL8wfYD+UvRoTmvjQkzn0AzGv9lVUM5CFpO MrRZMmysxenWv5x5GN8YrfbiBfFroB14BaoeqVZ8qcOVuJV8y9gCFlzSMZLqZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHJ3MbFz7C1; Tue, 03 Jun 2025 04:07: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 55347ewc071208; Tue, 3 Jun 2025 04:07:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347esq071205; Tue, 3 Jun 2025 04:07:40 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:40 GMT Message-Id: <202506030407.55347esq071205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6d43260d49e6 - main - ktrace: generate events on extended errors 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d43260d49e6af7de43a0a3181178d7a3ee20613 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6d43260d49e6af7de43a0a3181178d7a3ee20613 commit 6d43260d49e6af7de43a0a3181178d7a3ee20613 Author: Konstantin Belousov AuthorDate: 2025-05-31 21:42:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 ktrace: generate events on extended errors The ktrexterr() function is provided unconditionally, to mitigate the issue of missed include of "opt_ktrace.h" before using exterrvar.h otherwise. Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/kern/kern_ktrace.c | 29 +++++++++++++++++++++++++++++ sys/sys/exterrvar.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 973f19d1d060..96ab5c26973f 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -106,6 +106,7 @@ struct ktr_request { struct ktr_fault ktr_fault; struct ktr_faultend ktr_faultend; struct ktr_struct_array ktr_struct_array; + struct ktr_exterr ktr_exterr; } ktr_data; STAILQ_ENTRY(ktr_request) ktr_list; }; @@ -128,6 +129,7 @@ static const int data_lengths[] = { [KTR_STRUCT_ARRAY] = sizeof(struct ktr_struct_array), [KTR_ARGS] = 0, [KTR_ENVS] = 0, + [KTR_EXTERR] = sizeof(struct ktr_exterr), }; static STAILQ_HEAD(, ktr_request) ktr_free; @@ -1035,8 +1037,35 @@ ktrfaultend(int result) ktr_enqueuerequest(td, req); ktrace_exit(td); } + +void +ktrexterr(struct thread *td) +{ + struct ktr_request *req; + struct ktr_exterr *ktre; + + if (!KTRPOINT(td, KTR_EXTERR)) + return; + + req = ktr_getrequest(KTR_EXTERR); + if (req == NULL) + return; + ktre = &req->ktr_data.ktr_exterr; + if (exterr_to_ue(td, &ktre->ue) == 0) + ktr_enqueuerequest(td, req); + else + ktr_freerequest(req); + ktrace_exit(td); +} #endif /* KTRACE */ +#ifndef KTRACE +void +ktrexterr(struct thread *td __unused) +{ +} +#endif + /* Interface and common routines */ #ifndef _SYS_SYSPROTO_H_ diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 7e842f553866..4b168446e23b 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -46,12 +46,14 @@ _Td->td_kexterr.p1 = (uintptr_t)pp1; \ _Td->td_kexterr.p2 = (uintptr_t)pp2; \ _Td->td_kexterr.src_line = __LINE__; \ + ktrexterr(_Td); \ } \ } while (0) #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) int exterr_to_ue(struct thread *td, struct uexterror *ue); +void ktrexterr(struct thread *td); #else /* _KERNEL */ From nobody Tue Jun 3 04:07:41 2025 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 4bBHHL18xbz5xxv2; Tue, 03 Jun 2025 04:07: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 4bBHHK4rsYz3hrD; Tue, 03 Jun 2025 04:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eW0jmIqz9ZatsBHa1aLBkh4t+CI337xtZeD1YCkofkI=; b=jy2ddShHxOZEZSfwikxG3oV8XW93d6drEM/jlOb/Eny7EJzxi9hpbaumnqxOcrr4T8b5F2 VJPzNmfGeRydL6s5VWI2GFwxWv7nOoCSfackbdDYog6lKwqQUw3yXdLp/+tihOURQh67hN VojkR+wO4R73AygtlXrb1NGMSSZ2wVe/0SeIONFXy+Tf4A9titkSZEplaN9F7iyCqnCoM/ /mzHzGdgwIdEWowfmN3smpLRiSiFiXr0ak78t+QkVUCm6lB6zG4042A9ejLyTjRvEc1iMG iDAgJfcFZhPrlWnTP5Q3OnCNdO08mU/7YT0OOHD3wIu8CirDr5m3kIiibizlsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eW0jmIqz9ZatsBHa1aLBkh4t+CI337xtZeD1YCkofkI=; b=IsE3tgLIpaUzJthkAur8RyEg2WAERlSEBAZ0NAn25wDON1kthNe8Av1GRV0V5Q8K3RwzLz Hl25CqbQFAn/Mm9kizObpkOwFZCy+nlh6iGdlbhkVwDJ6HxB1xU6zHuKT6q1CASZC7LFrQ dgg5SAadNZ+HzaYNFcjGJpNyzheuwjJzLEF7gLDPOwvfT82U8ye4+mQh4fcaBQg32JaGNR FFSLqOiWO2yETZgXQ0TyEnAvmxoQZ9wDBdQcgrtUNLWvcxRVGzf6KmsEkbU7vWXF90lBCB 6Jwoo/MzsFw+2G40VwzA1Wr/QEGzPN1LiOcZizvsItKTM8kPN4Xh1mbTwytGTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923661; a=rsa-sha256; cv=none; b=WtCorWZo+4zAoaa+DVEouoD6q+vsS1Ve1W17Cpu3S3uJw00zCCW7TcefbbesGjprLM1Edp SyRQ38uXD81GrIJHy8+ruvSpx+CsjRw++u0hMCiEVN+l8TSMunzXKvVwi65UwbTzjgzIq0 hmCIIrXymnfg0CojaiH4jBBUisLuUys9TsQOq8NyUcsSp0tVRwIqU7rM2UhyAgusT7znLc dudT/clpV/uSQWHBIeIOVA0TWOQv020eRzjurjZ4e07rLhAuxXYxgrFgaXx+r+eCdHl/Uu OSyyMQC3SYeH6ojOPwmJ+Y4ThCoJYaVrUfrD2xn3DH28+tAuAd7qYhCZFtI+5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHK4N8Yz7GZ; Tue, 03 Jun 2025 04:07: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 55347fma071242; Tue, 3 Jun 2025 04:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347f70071239; Tue, 3 Jun 2025 04:07:41 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:41 GMT Message-Id: <202506030407.55347f70071239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 96f4be881e8e - main - ktrace(1): teach about KTR_EXTERR 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96f4be881e8e9e0cb9a6ad2cd9f17f4440983600 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=96f4be881e8e9e0cb9a6ad2cd9f17f4440983600 commit 96f4be881e8e9e0cb9a6ad2cd9f17f4440983600 Author: Konstantin Belousov AuthorDate: 2025-05-31 22:04:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 ktrace(1): teach about KTR_EXTERR Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- usr.bin/ktrace/ktrace.1 | 6 +++++- usr.bin/ktrace/ktrace.h | 2 +- usr.bin/ktrace/subr.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index c2f046dc5287..f526072965b6 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -150,9 +150,13 @@ arguments trace .Xr execve 2 environment variables +.It Cm x +trace +.Xr exterr 2 +extended errors reports from kernel .It Cm + trace the default set of trace points - -.Cm a, c , e, i , n , s , t , u , y +.Cm a, c , e, i , n , s , t , u , x, y .El .It Ar command Execute diff --git a/usr.bin/ktrace/ktrace.h b/usr.bin/ktrace/ktrace.h index d6da094f33a2..96c288047d30 100644 --- a/usr.bin/ktrace/ktrace.h +++ b/usr.bin/ktrace/ktrace.h @@ -32,7 +32,7 @@ #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_USER | \ KTRFAC_STRUCT | KTRFAC_SYSCTL | KTRFAC_STRUCT_ARRAY | \ - KTRFAC_ARGS | KTRFAC_ENVS) + KTRFAC_ARGS | KTRFAC_ENVS | KTRFAC_EXTERR) #define PROC_ABI_POINTS (KTRFAC_PROCCTOR | KTRFAC_PROCDTOR) diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index 1db4c214414b..422a37bb413d 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -87,6 +87,8 @@ getpoints(char *s) case 'e': facs |= KTRFAC_ENVS; break; + case 'x': + facs |= KTRFAC_EXTERR; case '+': facs |= DEF_POINTS; break; From nobody Tue Jun 3 04:07:42 2025 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 4bBHHM01F6z5xxZ0; Tue, 03 Jun 2025 04:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHL5qMhz3hcx; Tue, 03 Jun 2025 04:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zwe4uJTNEJ1N5p889g8WFhk3k0VgMgprEU+Vpc0j5ps=; b=sBHxIKs/c31yukX/bClP8r9c7tLi9O6gQ5okwwWCy/DhuIkX5XZPCiD30/b/sIQPsGkv+x H5HrVfMpODBrXxAqxZCGTLkkISUusJMFj3oMQCA+WTdx/g6KFtDUOHS4zDkavFKGYfbIZ2 MgHo6IqQwml5JysXpXCtbUsW/qZdtTg5B4NBTNjV1Wq4nDICBCWWLQ8M26utij/oUnFY1u zRY6YZQ1wWU88QVysmXtnBoaSHuxkV3QqBugTfrVqPPkjUiuQM4DaLQ4e6xXpY5FW9v85Z m6CCOMkSb7Pz9eg1GInBvNt9ZLhV4QYHaOv121c7k+9inOdChNkUu+gM6rtRIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zwe4uJTNEJ1N5p889g8WFhk3k0VgMgprEU+Vpc0j5ps=; b=pOLLe2zxuDn/BNKNQSf0FzHQhBO+VARy2s3LKtEb1o2Ovm171Qi6s20e+QGCK4PmWocMU9 OLfPjoj4jgABNOS7knts2+yeE1m7VzxevYoUMERUPDbccVruLsINJ5gOTF0UhOIVRQLwHQ aKmKXM08KuNWjcJYfGTuX3aFJbyhzG/4pjKI0GAcx7mhmtpWm+wBFMMpfHiwg+TOWOUl8f iH0j/QnuwngyU79vorhB0ITColF52ZxDtV6n0j3HaucCYcHr2yuY5exfhcRkPuOB0rq9ss fzbID7PYAZnj1TM0C30LTZxyhspqxpvMVLLvYzVOFxNbg1VAxl5kGOHcaxhPVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923662; a=rsa-sha256; cv=none; b=k5kaRHkS0MS4LZs822VkJ78OwRrXdAj33QJw59gNgM2uEpAr6Tm/rxpQsTQRarzAQ4rLy2 BDP5Ceqtvw+0UdokcbBmfmDDnhmcCBGZoL0vl/I6T3TJlQVSvLF2M2GshfMLPERlVPdbpW l8onSH5IdnODYLfBS7yvOsttRyJaFppNj4HqwBceZpvTReh1m+qM+5II047f1RyScKcVOX laN7Oa4WipcPCNBsN/Q5W4WJQoA+F7e3RrcuVuU1VOMpR0ORBkQ8WgmUi+0+IFbmFQ+lmI fsMeEMYZUorfOPHYEE3dlkxu6/tvUL0Bk0X8FASzmFk8LHgUpkuXE4JnxL5cSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHL5KJTz7Jx; Tue, 03 Jun 2025 04:07:42 +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 55347gs3071280; Tue, 3 Jun 2025 04:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347gTU071277; Tue, 3 Jun 2025 04:07:42 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:42 GMT Message-Id: <202506030407.55347gTU071277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9a0360355792 - main - kdump(1): pretty-print KTR_EXTERR 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a036035579236c16699ca801d280096bb512b47 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9a036035579236c16699ca801d280096bb512b47 commit 9a036035579236c16699ca801d280096bb512b47 Author: Konstantin Belousov AuthorDate: 2025-05-31 22:05:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 kdump(1): pretty-print KTR_EXTERR Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- usr.bin/kdump/kdump.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 48f645c339b9..7dbf2ba05955 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -119,6 +119,7 @@ void ktrbitset(char *, struct bitset *, size_t); void ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, int *resnarg, char *resc, u_int sv_flags); void ktrexecve(char *, int); +void ktrexterr(struct ktr_exterr *); void usage(void); #define TIMESTAMP_NONE 0x0 @@ -521,6 +522,9 @@ main(int argc, char *argv[]) case KTR_ENVS: ktrexecve(m, ktrlen); break; + case KTR_EXTERR: + ktrexterr((struct ktr_exterr *)m); + break; default: printf("\n"); break; @@ -711,6 +715,9 @@ dumpheader(struct ktr_header *kth, u_int sv_flags) case KTR_ENVS: type = "ENVS"; break; + case KTR_EXTERR: + type = "EERR"; + break; default: sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; @@ -2420,6 +2427,17 @@ bad_size: return; } +void +ktrexterr(struct ktr_exterr *ke) +{ + struct uexterror *ue; + + ue = &ke->ue; + printf("{ errno %d category %u (src line %u) p1 %#jx p2 %#jx %s }\n", + ue->error, ue->cat, ue->src_line, + (uintmax_t)ue->p1, (uintmax_t)ue->p2, ue->msg); +} + void usage(void) { From nobody Tue Jun 3 04:07:43 2025 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 4bBHHN50w7z5xxr9; Tue, 03 Jun 2025 04:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHN03kpz3hgS; Tue, 03 Jun 2025 04:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrWMEYoW036pp6UZAbwN2LDErmOLuFzf/ExsBZTGuKI=; b=LAjYxIpkUFF4r/Lp88it+mzu4UHvw0s5PgxknzR/Z6gb/2xlofvgPQQajr8K3W8VcPa+lN E9os3w26NiIWxYfDiw97J+xuK7vieMGG4hXSF7wS3Y7NsCtMGFqJEq8D+InjDI03XgW6VH 7p2aWxY8X2ZwZ9fXE+S2joF1VBpIgMM0Mt8dxPlfAr39jDXcZHdDwHU8S7AbDg6znmaJC6 yw5y/70Plf0PqzfRJaj7xIoec4Gt2hVKaup2/DGa5jyuKlnaAdsifoI0N5sp66txVXilue TesjDqo5kjYiJui0hWEoHS/XtFigsIOHAPBmHhsCLTKRxTaRaJ9VpjXemAe1YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrWMEYoW036pp6UZAbwN2LDErmOLuFzf/ExsBZTGuKI=; b=aca/ydDVI76GII1ySWFnqfKbSV4sRcOvESXn61t6rmyIyTv+S8MbZ16Vu7vcTCUy5zzspr EosfcEZ1XhupZZjXYQBoRXd+29/7+19OE72D/XB8509TWxAyEyB6ig6hjgKQG5XgK+VtFK DoEme6y3RX14iBKfQD7I/oBjrrzOaNQzYMP5y4vc0QOu2qlYiJfe6+eT/mKSXXoU59ASYr k1Uunua9w0FDsVsUGYnkh6F2sG/PVK12SF9+epVUvoSLlsefpW0bErL5WnZjRtMr3q2gKf N20ltGs9XolrWEFGNEG/Npw2tRAivAgV8A5d2p0pk9h90wSaW6x9ZtirZLBDMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923664; a=rsa-sha256; cv=none; b=ea/PYwXL+cV2/GLbfJl4VYIwYXrWnfC8FCjdMevlnkO5jI3ovzUfkw3oJsHAWL9UgHnnQW u9dHneEmOODpHT9YXnNyoVECH2ZyIZ4UvW3rvGyK5PAWQWShey1hF147LA+JA+lWr/82Ml fYF2QtdBMY8Xpxq5xm78tYeFgljOLNVvQjlET70xgH7u0DHtKhP/XBt/BaoDripTLLOOY6 Z5bnYk/JIRL4U7pBEj6x4dg/6UimTWbG70yDAw4VJ9gmJGR8J0lJOxPByZOr2KHCycOYKf 3xYczM+ZeI2yWixY9okuAYQB4OQGaHdaUxkUE2xqxXusAOyzVUf2RGmwyyL+7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHM6PYsz6YW; Tue, 03 Jun 2025 04:07:43 +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 55347hPr071315; Tue, 3 Jun 2025 04:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347hP2071312; Tue, 3 Jun 2025 04:07:43 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:43 GMT Message-Id: <202506030407.55347hP2071312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: de6012c48e21 - main - kdump: staticise functions in kdump.c 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de6012c48e213b655bb5cee03b866ab26fa10417 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de6012c48e213b655bb5cee03b866ab26fa10417 commit de6012c48e213b655bb5cee03b866ab26fa10417 Author: Konstantin Belousov AuthorDate: 2025-05-31 22:35:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 kdump: staticise functions in kdump.c Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- usr.bin/kdump/kdump.c | 132 +++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 7dbf2ba05955..d45a0cba2005 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -87,40 +87,40 @@ #include #endif -int fetchprocinfo(struct ktr_header *, u_int *); -u_int findabi(struct ktr_header *); -int fread_tail(void *, int, int); -void dumpheader(struct ktr_header *, u_int); -void dumptimeval(struct ktr_header_v0 *kth); -void dumptimespec(struct ktr_header *kth); -void ktrsyscall(struct ktr_syscall *, u_int); -void ktrsysret(struct ktr_sysret *, u_int); -void ktrnamei(char *, int); -void hexdump(char *, int, int); -void visdump(char *, int, int); -void ktrgenio(struct ktr_genio *, int); -void ktrpsig(struct ktr_psig *); -void ktrcsw(struct ktr_csw *); -void ktrcsw_old(struct ktr_csw_old *); -void ktruser(int, void *); -void ktrcaprights(cap_rights_t *); -void ktritimerval(struct itimerval *it); -void ktrsockaddr(struct sockaddr *); -void ktrsplice(struct splice *); -void ktrstat(struct stat *); -void ktrstruct(char *, size_t); -void ktrcapfail(struct ktr_cap_fail *); -void ktrfault(struct ktr_fault *); -void ktrfaultend(struct ktr_faultend *); -void ktrkevent(struct kevent *); -void ktrpollfd(struct pollfd *); -void ktrstructarray(struct ktr_struct_array *, size_t); -void ktrbitset(char *, struct bitset *, size_t); -void ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, +static int fetchprocinfo(struct ktr_header *, u_int *); +static u_int findabi(struct ktr_header *); +static int fread_tail(void *, int, int); +static void dumpheader(struct ktr_header *, u_int); +static void dumptimeval(struct ktr_header_v0 *kth); +static void dumptimespec(struct ktr_header *kth); +static void ktrsyscall(struct ktr_syscall *, u_int); +static void ktrsysret(struct ktr_sysret *, u_int); +static void ktrnamei(char *, int); +static void hexdump(char *, int, int); +static void visdump(char *, int, int); +static void ktrgenio(struct ktr_genio *, int); +static void ktrpsig(struct ktr_psig *); +static void ktrcsw(struct ktr_csw *); +static void ktrcsw_old(struct ktr_csw_old *); +static void ktruser(int, void *); +static void ktrcaprights(cap_rights_t *); +static void ktritimerval(struct itimerval *it); +static void ktrsockaddr(struct sockaddr *); +static void ktrsplice(struct splice *); +static void ktrstat(struct stat *); +static void ktrstruct(char *, size_t); +static void ktrcapfail(struct ktr_cap_fail *); +static void ktrfault(struct ktr_fault *); +static void ktrfaultend(struct ktr_faultend *); +static void ktrkevent(struct kevent *); +static void ktrpollfd(struct pollfd *); +static void ktrstructarray(struct ktr_struct_array *, size_t); +static void ktrbitset(char *, struct bitset *, size_t); +static void ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, int *resnarg, char *resc, u_int sv_flags); -void ktrexecve(char *, int); -void ktrexterr(struct ktr_exterr *); -void usage(void); +static void ktrexecve(char *, int); +static void ktrexterr(struct ktr_exterr *); +static void usage(void); #define TIMESTAMP_NONE 0x0 #define TIMESTAMP_ABSOLUTE 0x1 @@ -535,7 +535,7 @@ main(int argc, char *argv[]) return 0; } -int +static int fread_tail(void *buf, int size, int num) { int i; @@ -547,7 +547,7 @@ fread_tail(void *buf, int size, int num) return (i); } -int +static int fetchprocinfo(struct ktr_header *kth, u_int *flags) { struct proc_info *pi; @@ -582,7 +582,7 @@ fetchprocinfo(struct ktr_header *kth, u_int *flags) return (0); } -u_int +static u_int findabi(struct ktr_header *kth) { struct proc_info *pi; @@ -595,7 +595,7 @@ findabi(struct ktr_header *kth) return (0); } -void +static void dumptimeval(struct ktr_header_v0 *kth) { static struct timeval prevtime, prevtime_e; @@ -629,7 +629,7 @@ dumptimeval(struct ktr_header_v0 *kth) } } -void +static void dumptimespec(struct ktr_header *kth) { static struct timespec prevtime, prevtime_e; @@ -663,7 +663,7 @@ dumptimespec(struct ktr_header *kth) } } -void +static void dumpheader(struct ktr_header *kth, u_int sv_flags) { static char unknown[64]; @@ -833,7 +833,7 @@ print_signal(int signo) printf("SIG %d", signo); } -void +static void ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) { int narg = ktr->ktr_narg; @@ -869,7 +869,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) putchar('\n'); } -void +static void ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, int *resnarg, char *resc, u_int sv_flags) { @@ -1626,7 +1626,7 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, *resnarg = narg; } -void +static void ktrsysret(struct ktr_sysret *ktr, u_int sv_flags) { register_t ret = ktr->ktr_retval; @@ -1659,13 +1659,13 @@ ktrsysret(struct ktr_sysret *ktr, u_int sv_flags) putchar('\n'); } -void +static void ktrnamei(char *cp, int len) { printf("\"%.*s\"\n", len, cp); } -void +static void ktrexecve(char *m, int len) { int i = 0; @@ -1680,7 +1680,7 @@ ktrexecve(char *m, int len) printf("\n"); } -void +static void hexdump(char *p, int len, int screenwidth) { int n, i; @@ -1726,7 +1726,7 @@ hexdump(char *p, int len, int screenwidth) printf("\n"); } -void +static void visdump(char *dp, int datalen, int screenwidth) { int col = 0; @@ -1772,7 +1772,7 @@ visdump(char *dp, int datalen, int screenwidth) printf("\"\n"); } -void +static void ktrgenio(struct ktr_genio *ktr, int len) { int datalen = len - sizeof (struct ktr_genio); @@ -1810,7 +1810,7 @@ ktrgenio(struct ktr_genio *ktr, int len) visdump(dp, datalen, screenwidth); } -void +static void ktrpsig(struct ktr_psig *psig) { const char *str; @@ -1831,21 +1831,21 @@ ktrpsig(struct ktr_psig *psig) putchar('\n'); } -void +static void ktrcsw_old(struct ktr_csw_old *cs) { printf("%s %s\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel"); } -void +static void ktrcsw(struct ktr_csw *cs) { printf("%s %s \"%s\"\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel", cs->wmesg); } -void +static void ktruser(int len, void *p) { unsigned char *cp; @@ -1865,7 +1865,7 @@ ktruser(int len, void *p) printf("\n"); } -void +static void ktrcaprights(cap_rights_t *rightsp) { @@ -1881,7 +1881,7 @@ ktrtimeval(struct timeval *tv) printf("{%ld, %ld}", (long)tv->tv_sec, tv->tv_usec); } -void +static void ktritimerval(struct itimerval *it) { @@ -1892,7 +1892,7 @@ ktritimerval(struct itimerval *it) printf(" }\n"); } -void +static void ktrsockaddr(struct sockaddr *sa) { /* @@ -1967,7 +1967,7 @@ ktrsockaddr(struct sockaddr *sa) printf(" }\n"); } -void +static void ktrsplice(struct splice *sp) { printf("struct splice { fd=%d, max=%#jx, idle=%jd.%06jd }\n", @@ -1975,7 +1975,7 @@ ktrsplice(struct splice *sp) (intmax_t)sp->sp_idle.tv_usec); } -void +static void ktrstat(struct stat *statp) { char mode[12], timestr[PATH_MAX + 4]; @@ -2080,7 +2080,7 @@ ktrstat(struct stat *statp) printf(" }\n"); } -void +static void ktrbitset(char *name, struct bitset *set, size_t setlen) { int i, maxi, c = 0; @@ -2104,7 +2104,7 @@ ktrbitset(char *name, struct bitset *set, size_t setlen) printf(" ]\n"); } -void +static void ktrstruct(char *buf, size_t buflen) { char *name, *data; @@ -2181,7 +2181,7 @@ invalid: printf("invalid record\n"); } -void +static void ktrcapfail(struct ktr_cap_fail *ktr) { union ktr_cap_data *kcd = &ktr->cap_data; @@ -2256,7 +2256,7 @@ ktrcapfail(struct ktr_cap_fail *ktr) printf("\n"); } -void +static void ktrfault(struct ktr_fault *ktr) { @@ -2265,7 +2265,7 @@ ktrfault(struct ktr_fault *ktr) printf("\n"); } -void +static void ktrfaultend(struct ktr_faultend *ktr) { const char *str; @@ -2278,7 +2278,7 @@ ktrfaultend(struct ktr_faultend *ktr) printf("\n"); } -void +static void ktrkevent(struct kevent *kev) { @@ -2309,7 +2309,7 @@ ktrkevent(struct kevent *kev) printf(", data=%#jx, udata=%p }", (uintmax_t)kev->data, kev->udata); } -void +static void ktrpollfd(struct pollfd *pfd) { @@ -2321,7 +2321,7 @@ ktrpollfd(struct pollfd *pfd) printf("}"); } -void +static void ktrstructarray(struct ktr_struct_array *ksa, size_t buflen) { struct kevent kev; @@ -2427,7 +2427,7 @@ bad_size: return; } -void +static void ktrexterr(struct ktr_exterr *ke) { struct uexterror *ue; @@ -2438,7 +2438,7 @@ ktrexterr(struct ktr_exterr *ke) (uintmax_t)ue->p1, (uintmax_t)ue->p2, ue->msg); } -void +static void usage(void) { fprintf(stderr, "usage: kdump [-dEnlHRrSsTA] [-f trfile] " From nobody Tue Jun 3 04:07:44 2025 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 4bBHHP3SR2z5xxrB; Tue, 03 Jun 2025 04:07: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 4bBHHP0wpCz3hql; Tue, 03 Jun 2025 04:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V2poVpIsYMEmXGYigWU9z4y/wDbvYJGzohIk/D3Wazk=; b=YyJsNK5FKZzknbjVvL5I/PeVFITh27B/y36WE1/YpZBV/CXkSLO/72iDWTCC+mljbHjBKe hCQ2YzGHy87UKQhE3ADJoZXWg3LzrpRTRaszPiQwZGkAxA/+hQYHwHWKyIXPpxQu+rlzFl WaSWknvkg9ywZDNqXhiaS/QkGV49d81EDbbERiZnjhaW4OsdiosgXQOU4rwfAyc4MaQFit /Az1mBOhdeLimU8kQxdJMjTQQrfdFs4/4VRT8xq65hEgFfyR0R/MSlrnm83Nj21A5dAcZA cAlWaHsoJOb2+4WRdx6xO3BJQ4C9DhkMfflv3L27Tjekqh1pogGYimSq9O3FEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V2poVpIsYMEmXGYigWU9z4y/wDbvYJGzohIk/D3Wazk=; b=bi7zF1yd0QGOvnq5zHwcg3o7g0mpHR2Dgu1782sNp1Z6cyNQ+BKWCgM/gdVsBXhKyBF5c4 dZ8VyIdwisYqK5LM+YhkDI2h8wOnk2GF+kK1GBDhd1qsT8R2ur73M3+zsSiBc2xvnCDADo lM1+6YBE0y7o32ejiy9Bn85hbue9rjHVGBCCPNkAZcNIPfHXeNNObIHB4rSd4DRGPtPSMy hrf9hnjt9K0ylUWbB86dBWR5tqqXcucY6NeTVcdr4UiN2xdM7YnFr9eX72pirOlgpdVd2a doqtqw/jQszeie93yqgXXmpCvInyC333/S6O5hQPfw6INN80R7os93PERY8tPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923665; a=rsa-sha256; cv=none; b=oClK+WWb0je5cgk8ZLoZcW/Ht2OR1IudE/91ga2CNwbFFJgsBNU0RrX7/OFoFa+RcUHqGP Ax443JJG5fu4p79JryLNdNKwIqvoFWgYOXRZdUPSdKEONwkyi6abRto3hCbR2mqP0ezh7h EQxJVsR8ezY8FGSpFVkCUZ94Y2plGWf5FfujkbCpRBDxFJ3adXy0HwNkSiHYQBMaP7g1Du Fsgd5kM4TRymEg0WembF6PEg/fg78z2/OQx13nvB7LzKNJsNr0uvQ3lAzS02GbgwknKnLx 2l8Di5WtVJgTVRZ8P60BRfYLXGlPY2Fj78M/HsBtG9IZhHpHANevqG8+xjQqHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHP05VPz6rx; Tue, 03 Jun 2025 04:07: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 55347iWS071351; Tue, 3 Jun 2025 04:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347iAF071348; Tue, 3 Jun 2025 04:07:44 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:44 GMT Message-Id: <202506030407.55347iAF071348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e26f3836d4e1 - main - kdump(1): Use static array for header types string literals 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e26f3836d4e129c77e28854e9f84874a92723ac2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e26f3836d4e129c77e28854e9f84874a92723ac2 commit e26f3836d4e129c77e28854e9f84874a92723ac2 Author: Konstantin Belousov AuthorDate: 2025-05-31 22:51:20 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 kdump(1): Use static array for header types string literals Also change sprintf() to snprintf(). Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- usr.bin/kdump/kdump.c | 73 +++++++++++++++++---------------------------------- 1 file changed, 24 insertions(+), 49 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index d45a0cba2005..a8f3df14f304 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -663,6 +663,25 @@ dumptimespec(struct ktr_header *kth) } } +static const char * const hdr_names[] = { + [KTR_SYSCALL] = "CALL", + [KTR_SYSRET] = "RET ", + [KTR_NAMEI] = "NAMI", + [KTR_GENIO] = "GIO ", + [KTR_PSIG] = "PSIG", + [KTR_CSW] = "CSW ", + [KTR_USER] = "USER", + [KTR_STRUCT] = "STRU", + [KTR_STRUCT_ARRAY] = "STRU", + [KTR_SYSCTL] = "SCTL", + [KTR_CAPFAIL] = "CAP ", + [KTR_FAULT] = "PFLT", + [KTR_FAULTEND] = "PRET", + [KTR_ARGS] = "ARGS", + [KTR_ENVS] = "ENVS", + [KTR_EXTERR] = "EERR", +}; + static void dumpheader(struct ktr_header *kth, u_int sv_flags) { @@ -671,56 +690,12 @@ dumpheader(struct ktr_header *kth, u_int sv_flags) const char *arch; const char *type; - switch (kth->ktr_type) { - case KTR_SYSCALL: - type = "CALL"; - break; - case KTR_SYSRET: - type = "RET "; - break; - case KTR_NAMEI: - type = "NAMI"; - break; - case KTR_GENIO: - type = "GIO "; - break; - case KTR_PSIG: - type = "PSIG"; - break; - case KTR_CSW: - type = "CSW "; - break; - case KTR_USER: - type = "USER"; - break; - case KTR_STRUCT: - case KTR_STRUCT_ARRAY: - type = "STRU"; - break; - case KTR_SYSCTL: - type = "SCTL"; - break; - case KTR_CAPFAIL: - type = "CAP "; - break; - case KTR_FAULT: - type = "PFLT"; - break; - case KTR_FAULTEND: - type = "PRET"; - break; - case KTR_ARGS: - type = "ARGS"; - break; - case KTR_ENVS: - type = "ENVS"; - break; - case KTR_EXTERR: - type = "EERR"; - break; - default: - sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); + if (kth->ktr_type < 0 || (size_t)kth->ktr_type >= nitems(hdr_names)) { + snprintf(unknown, sizeof(unknown), "UNKNOWN(%d)", + kth->ktr_type); type = unknown; + } else { + type = hdr_names[kth->ktr_type]; } /* From nobody Tue Jun 3 04:07:46 2025 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 4bBHHQ2jpcz5xy2d; Tue, 03 Jun 2025 04:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBHHQ1JlCz3hrH; Tue, 03 Jun 2025 04:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lyke2UoBP1gwziSua7WRpp+SdlfUpMxJvvTXD8YaUK0=; b=ngSlNIauEfSWYz+2xBsNMp2unUkQZClvMZehwuQvO7PXIU2l8nG7Av84uldQxW3wDt2zkC jacwCDBBYeyebSeUQBc2+y+/ChelaUzcgaOrAXIQAzj0WTtCEfc8fkY80yQ1reqY6hw0QR gN3UVuY5esvXHYgSEAd5EjkDIudF/djBTQUHUkB16A+ORL7tktdW8cmCs+kPjKv1uMqBhP W7OCl8skjT0VYvsAlHxv207GrbG1EFIIshdE6ZqbjVTj2h02b5+qfucbesRSuEAMY9vnIk eHmAwtg6O7QeHeG4UaZFXIP7ucH1AYEzvdB3BOCQebyk8faRDGoJW1Cnp5oUDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748923666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lyke2UoBP1gwziSua7WRpp+SdlfUpMxJvvTXD8YaUK0=; b=Wf6WVuX7dn26UcYKggd6R2vfxm0kDFNjiH8MibxBw5A21j/VEOXsvfSLwBSq7JnQQPM3Xg 4fmPw3jK3IPSpsJU2IHnS0f7JQ+H57zb657nUApxwhPEEKieSXALk+Jzma/CxNmoYnnTnZ etEpEPuKeDLCiK8hffLZFWxO3mKMDtWIN1/rzMBWNK+U+IuDzENXyGNcxVnNXfkYyH7/fr RTwluW3hRo7FyYoC57oeer33EMl0/mIRpf07s7g8dE2koTFsdg6BMdz9vd/aV7hmktsrAV GflqL6odF65muwCQMBbZvKl/Poh2OgnaQJzmGjwTHMzf+fqpznYrUbgDwjjQYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748923666; a=rsa-sha256; cv=none; b=bpDR83Iyjy+RGAMc5uJXL9pDwnQP0INl3j+v1E8KWrsy0D97A0dhBlWte8aV8L4fooYwjd zDf98OTTHG0DAhiJmzQxCijHRtqm91SyxG/8jc4Q90LujpOJB3wvzyBGPqqNo5do9Vij2x lXG/uv/MQ0R0JpDNYQoBU1HmSHStE9FCiSnYlDrCSZnyorAHJcB+Lb6PnFwGVzALHNTYRc WUxUQlRH26ALXqIO0ted4gvNvJHnAwnYQNQpmfM65wEPIcRMNNauNlCqsHvjg1kSCmMvMo eSRBvTjG8y3IPXmVDziWmV3tAZqJtMUwJFVSJSskBSgkcjmLBBVHUHx/51tDog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBHHQ0rqGz7Gb; Tue, 03 Jun 2025 04:07:46 +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 55347kDZ071385; Tue, 3 Jun 2025 04:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55347k8a071382; Tue, 3 Jun 2025 04:07:46 GMT (envelope-from git) Date: Tue, 3 Jun 2025 04:07:46 GMT Message-Id: <202506030407.55347k8a071382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2a35b00732d9 - main - kern/kern_ktrace.c: normalize includes 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a35b00732d948ee57ad86d571d6af1533b721f0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2a35b00732d948ee57ad86d571d6af1533b721f0 commit 2a35b00732d948ee57ad86d571d6af1533b721f0 Author: Konstantin Belousov AuthorDate: 2025-06-01 00:45:21 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-03 02:47:38 +0000 kern/kern_ktrace.c: normalize includes Remove unneeded sys/cdefs.h and sys/param.h. Order. Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633 --- sys/kern/kern_ktrace.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 96ab5c26973f..15a8a4ab4fa4 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -31,17 +31,16 @@ * SUCH DAMAGE. */ -#include #include "opt_ktrace.h" #define EXTERR_CATEGORY EXTERR_KTRACE -#include -#include #include +#include #include #include #include #include +#include #include #include #include @@ -50,16 +49,15 @@ #include #include #include -#include -#include #include #include -#include #include #include #include #include #include +#include +#include #include From nobody Tue Jun 3 04:51:21 2025 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 4bBJH65BBRz5y1Q0; Tue, 03 Jun 2025 04:52:34 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBJH62WpKz4MfD; Tue, 03 Jun 2025 04:52:34 +0000 (UTC) (envelope-from sjg@juniper.net) Authentication-Results: mx1.freebsd.org; none Received: from pps.filterd (m0108163.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5533IEEK010191; Mon, 2 Jun 2025 21:52:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= cc:content-id:content-type:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=PPS1017; bh=N5CxEwtr+i9Ri /P177jpOg3WCVKVY9SNi9e/7616sGg=; b=YVmxUDH5RHyNjtyEJ0oUxfOJgs795 JViQtxFq+InQ4VMv2uNdRQguzOyyI6T3UJvPyDP1JOARNg2ChWpT4ycuVQ313+Re JWMgAu1L80YmVDBbg0IVMk21Z2Hn196W2eR1xcWpiOeiTdz9RdXpJaklKsLjT7Uw jVK8LfRf3rl3XPVQSFj6XnujrOPxcNgchwgiRq4EUcbe0AMee0k2mbcs82moqh2b RaeEJxseFcxt3feDpdbjaJzBb/3QGbHeiL3Nx6WPWTxmy1FLMww0Blp6aDwF1STO KFdjMJ8VhAIaBe9l7bL/wZW8NRgyiBnZtEQkgiTBgvlpTsiEmwlFFlAbg== Received: from cy7pr03cu001.outbound.protection.outlook.com (mail-westcentralusazon11022143.outbound.protection.outlook.com [40.93.200.143]) by mx0b-00273201.pphosted.com (PPS) with ESMTPS id 471g9g97vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Jun 2025 21:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YAi3yHsOVZwBzBLsz91YPMGQqkFGZHJDv/LVWRKNapFYGZCYoXo6OvF8/9IlQdP4+VEBqOKagJxuLAcAlorBhuUA85yG0UbhxmgtfBHSYY3TZZpILKmdYH35BzajDB+X2pPribqpaPk1xdx86SwaQ7x/zpQ/kYqco7RHiLMHtWRloYEtU66m1H7ksd8ob5vU/RTCHd8AlCYhCTfKMTj5QrurwFGgknb0RATv1/6++sjkDxwaXLE/a2cyjKLRoiFceSf5A+fA9Lrr5E/TzrbKzv00GWQOqBOnKRZoUKGE5Di1vbxB3xXLo25qmCm2Qonzl/DPv5nziFS/kDrM6gPAig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N5CxEwtr+i9Ri/P177jpOg3WCVKVY9SNi9e/7616sGg=; b=ux2LP+HDWnAolxcHSAY8t7qxFBS7gQ1EioyDylO1f7Cifp1TlTm3xYfB9SM71kGhweCwLAS224DyOeCWJqdDS7/mODiI1t0HYl1yNw7ejubY8lYoeknwokQrzyvYx7FYARrSIN7OVVybaCu/bquvHhkPoXjHyIjvkVd0mUH+wDszgRA0GmLccGYPFHVx/QqjmIa5YZETFfUaI0ikaCITEx9H5BsmxD5L71Oope8TS4bPmgmlXfce/oYY3q968ZM/aUjLiVbDNjNX3SG8aS2+EUp7jO8ix4ED/8J0OqDDIGt+3ii1JapOerOSlbC7oE468mBevAHaTl30Fc7vUm6B1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.15) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N5CxEwtr+i9Ri/P177jpOg3WCVKVY9SNi9e/7616sGg=; b=E8w6tUe0QXx14L3Z9qSCr4dQNhdo02yoirw/51g3/QqlGwKxbgBQE5IeQMflGqjUjVyuLotJwQyXLyv4AEfVHB4QdStgNKgsQg707vHn1uRxFtP+tlPGiNAibS2WFa+l60T/WXmvRP11RhwQhyrMqgJ3DImrNQCZppmwhqEZxe4= Received: from CY5PR19CA0120.namprd19.prod.outlook.com (2603:10b6:930:64::10) by CY8PR05MB9524.namprd05.prod.outlook.com (2603:10b6:930:9f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.37; Tue, 3 Jun 2025 04:52:29 +0000 Received: from DS3PEPF000099D6.namprd04.prod.outlook.com (2603:10b6:930:64:cafe::1f) by CY5PR19CA0120.outlook.office365.com (2603:10b6:930:64::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8792.19 via Frontend Transport; Tue, 3 Jun 2025 04:52:29 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.15) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from p-exchfe-eqx-02.jnpr.net (66.129.239.15) by DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8792.29 via Frontend Transport; Tue, 3 Jun 2025 04:52:29 +0000 Received: from p-exchbe-eqx-01.jnpr.net (10.104.9.14) by p-exchfe-eqx-02.jnpr.net (10.104.9.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Mon, 2 Jun 2025 23:52:28 -0500 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchbe-eqx-01.jnpr.net (10.104.9.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Mon, 2 Jun 2025 23:52:28 -0500 Received: from kaos.jnpr.net (10.104.20.6) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Mon, 2 Jun 2025 23:52:28 -0500 Received: by kaos.jnpr.net (Postfix, from userid 1377) id 1E2367DD8F; Mon, 02 Jun 2025 21:51:21 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 1A5707DBE6; Mon, 02 Jun 2025 21:51:21 -0700 (PDT) To: Kyle Evans CC: , , , Subject: Re: git: 61d77e6c0095 - main - loader: allow for exceptions to restricted settings. In-Reply-To: <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> References: <202506020549.5525nuDu054998@gitrepo.freebsd.org> <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> Comments: In-reply-to: Kyle Evans message dated "Mon, 02 Jun 2025 11:14:54 -0500." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 30.1 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-ID: <73229.1748926281.1@kaos.jnpr.net> Date: Mon, 2 Jun 2025 21:51:21 -0700 Message-ID: <74857.1748926281@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|CY8PR05MB9524:EE_ X-MS-Office365-Filtering-Correlation-Id: a87702a0-ddbe-48f6-2df7-08dda25a71ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CeTpEfHI2TQhRhxvIoE/M4PQM2Yuh6+QTQ0rFT2TB/430d99jWD5/iYOS5VD?= =?us-ascii?Q?irvtVU31/R8L2n/+0inMh91jY4UESVYKCmMPx3S1U9Rtkb26qX5yargUdSey?= =?us-ascii?Q?xMq2PSExKsZxSrqA9reQP3CIbyvcXvfMHLw/6/wm4xy2XlEncvrr5EgqWQ6h?= =?us-ascii?Q?0chyC3XUa8LzhpyJWcRHqO8DC0JLbuQYe4SRmdHvAe4Av/l6WoZ/lu/5G5ft?= =?us-ascii?Q?MlL4J5xxCxeqnZKWjwVRtPPJC5oSaNMSqWdcDWtRmr6REGFB/yeYgRacxdYe?= =?us-ascii?Q?XiVCnTpRR74kB6XQPFec5vAO9VPaCtkb9W8uEMnXvLtGGrzv9hCIEu8oPf8K?= =?us-ascii?Q?W1Z1YeD2HYtk0qowUCATqlSPQpOxfgMg2S5AyvzWEYF4SNMeqv2OmLTSS48E?= =?us-ascii?Q?WjVgdL64ooOq4qZBgDA05fletFj5MToN8HQn32WDBzMzGMOPUiO1s3Gxzkeq?= =?us-ascii?Q?LcsOLUM9uzjERgI5Kep9PmEI8C2OOQFBj3tkpJOPcTiyk0F+Tq5PHiQTOzDt?= =?us-ascii?Q?I5fmFBzTve+bm/Gycx8YfzFICWwq2W6YxSfYNd39JJ8A075AOcXdeWwDkPMK?= =?us-ascii?Q?zO9cJigXBH0whATifAEKfw+JlaLCQl4IXL/oKs9yYhnsKwmVoBWylJDO1pj8?= =?us-ascii?Q?ShCC9bkwVDd40iYVKHBLWFRipZwSp07WfX5HFvXS79IW3LwYQxZ4LAc5eCL7?= =?us-ascii?Q?9HfQaAXAcPlJGTajim2xms2XszO74WmQXNhwK/WgsKAZ0vvas6P1lFeHzjr1?= =?us-ascii?Q?2ua8lXBOqVsLaOoQMDhrfwXfyVuO2zQaCDkkakWCO+NHBoyFB5tkW7Ueykno?= =?us-ascii?Q?XABah4oArRZzIlb0zixg5m1VjBTHtN/OFC3QzZmiX6xmNaBGMMtWEfFCIUvp?= =?us-ascii?Q?eFBAICimw5cSPj8HcvAL7zKIq8XvJLTodC5tJNsB83E8oouEszSsa5iXOjcV?= =?us-ascii?Q?pWH3yBHZwhAxeG2sHgJkbawy6KoVFa1xAd1aXitzjolnZ62tSpNwQpTQs0/l?= =?us-ascii?Q?gZNdTME6Y1G+5nlwfjkCUXnXQUMwp5zVEYFTvNbtPVoqkzBtOSLSySJr0Ueh?= =?us-ascii?Q?BNQjpi6i1t5POXEaRekDfsUiWJddLvqNnXzn1fJB6s0oNPcKsekqTKAhBpUs?= =?us-ascii?Q?YrO3Vc58dMmL5tfvmI5Tn1L3wsIRQPsA4JLFd05hZr9k+Bdd1tI5LXxBszug?= =?us-ascii?Q?JJE52t3Yjv7FDVR6WcpUKmiex27PqLTxkdz0aD+tlMFlyL4chpQoHro1Do4V?= =?us-ascii?Q?FG2APZvmfJs2ptegA3j1VIsKY+PZpgjHuAOnINIpywFCiR5Lz5gCfogBxHJs?= =?us-ascii?Q?weSYB2siWEtOpNvfwqCfvUo+KFSFoiPJHtHEIsJiyoRXNrPx8y3KMPQ4804o?= =?us-ascii?Q?rC040jSVpTj9ZmYcQTaH+VNnBtuPUj6ExgVIl0uCxmvFPdyBBmPAdlWrs3ly?= =?us-ascii?Q?HfVYPAHf3cvS+kJ5qJiojS3lKK3ZKOQpIKcvlsnWQG9/BJTcxMmcsANMMHdf?= =?us-ascii?Q?SgCqiE4cC1BNbJ1JVht3xpUPwq/BhPFAwbZV?= X-Forefront-Antispam-Report: CIP:66.129.239.15;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-02.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2025 04:52:29.3581 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a87702a0-ddbe-48f6-2df7-08dda25a71ae X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.15];Helo=[p-exchfe-eqx-02.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR05MB9524 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjAzMDAzOSBTYWx0ZWRfX4GfwrhYlyGev HPoXZ+GxuSNdgF2IT3Hmy+nCtz3mYFWzpY69/4+2Egu01Dr1hVou9IoYa8CBMtlsSBFdasM+O6g c0lgz9p2H3HGc57FBe66fH58Uo51cugxuWUt05Dkh/sLsnaI4sTlzaBbqM7YrUwdSZmz2u6kn63 yde9dvT/pHpV2tMXZJkHGJ5wiD66RYdnatF920VQoGuOZeGigd5h3k3A++3DRmwr3Q6/uSRjS8B /YiM5UFGhhNRQvGT4+3eZ5vDlTCocws/pkm3YCWKaWHv6Ne6mou6E/zhls1xs9v0M0o00OPSkCi K12xZ4dDQeKc8N3GbmVoBBdDiT4Er0nWkVkJyIflM2/oq93nLYneH0JrQLBhRPZUmVIUvJBt2jy mu6TAq4qGigcg91RJVD8qFoJ2jOP7ug2pui3BmwicHdHZQZD7M4SA7X4moyiNSzMGDG8XLW7 X-Authority-Analysis: v=2.4 cv=T4WMT+KQ c=1 sm=1 tr=0 ts=683e7f91 cx=c_pps a=XzbKjAwluEe2BiTfzbY/Fg==:117 a=YQU41r7WENJiSYrYYNJVsQ==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=h8e1o3o8w34MuCiiGQrqVE4VwXA=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=s63m1ICgrNkA:10 a=rhJc5-LppCAA:10 a=6I5d2MoRAAAA:8 a=oCoyOCdvH2_wyBxJuYwA:9 a=CjuIK1q_8ugA:10 a=ZXulRonScM0A:10 X-Proofpoint-GUID: x0iyNGgW5jQ125Dog0qV1ULuB37YnlVi X-Proofpoint-ORIG-GUID: x0iyNGgW5jQ125Dog0qV1ULuB37YnlVi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-03_01,2025-06-02_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 bulkscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 mlxlogscore=890 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506030039 X-Rspamd-Queue-Id: 4bBJH62WpKz4MfD 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:22843, ipnet:67.231.152.0/24, country:US] Kyle Evans wrote: > > loader: allow for exceptions to restricted settings. > > > > We restrict what an unverified loader.conf etc can set, > > and the same restrictions are applied to interactive input. > > We need to allow for exceptions (eg boot_verbose). > > It is best if any allowed settings match up to '='. > > > > If we do not allow it to be set, do not allow it to be unset > > > > Reviewed by: stevek > > Sponsored by: Juniper Networks, Inc. > > --- > Long-term, we should probably work out something that can work for > lualoader, too. We use setenv() there directly rather than adding a > layer of indirection through the command-line parser. Ideally this sort of list should be configurable via a .4th or .lua file (verified of course ;-) But if you use setenv directly - that would have to be where the restrictions are implemented? Indirection can solve many problems. From nobody Tue Jun 3 04:57:02 2025 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 4bBJPk0NBNz5y1pR; Tue, 03 Jun 2025 04:58:18 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBJPj5r1Xz3C2b; Tue, 03 Jun 2025 04:58:17 +0000 (UTC) (envelope-from sjg@juniper.net) Authentication-Results: mx1.freebsd.org; none Received: from pps.filterd (m0108163.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5533r4Qj010403; Mon, 2 Jun 2025 21:58:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= cc:content-id:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS1017; bh=H4gJmxW/b9LnX5mzA/KAhQ8XiEbiRaYIXqO/5CvVJ/Y=; b=LJHJ Z2zks2ugJcfbFuLA0gFyggdbQwf1+OXgRCtZM/8j9XOkHqzjfjK0W4KgViGKggvS L1TEGVSD7+UD2q+1gH8DjqJbszOZVZzZRWVu724qjN6H2vvkmqSUjElnUqkpdy5y itayhqgAIfurKWUmhDvPE1xDBy4nrwJ40ibxAYBIRmAewqyiPK9/sdIiFEcYysVB 78i2pawgBwyQH8aPPobpnagdaBd4LmP5Hh3+Dyc2hwtgOHB9HTZV8Pu4WNYAciuX /9dlXGGaBdmFu7/CoJkI+nB+jwzKMy8YR77qJ0coik1arPRMMI+yq2J7jmlfSKlt ClCXW/tsq7x3sYlkfw== Received: from cy7pr03cu001.outbound.protection.outlook.com (mail-westcentralusazon11022095.outbound.protection.outlook.com [40.93.200.95]) by mx0b-00273201.pphosted.com (PPS) with ESMTPS id 471g9g9840-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Jun 2025 21:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ng/0gIC8j5oKNT2rYWOLp9iimUkpKhUKLWy6Mnp6W9ZvusXASvu9DkIp3EKrEs4P2uXDc8KC9kVLAiTJ1+P55cOL6zoPFbfDiA9SiBiVNpGGnhN4JJmRMJWLB0kYQ3bj/y7DTzOYXJp/YegZdxSLdvHXzCey3WhVftZoyyTNMcV1kd2HwbSpPx1k8KL4x74lYA3XQf0+ihMRBAnTrkQypjLp+CBcXeOFEQDpjpiylsIMRXb41cCQA3kqiQaMXVbF/n+dN5qz8iGpX7/emZ+HObZx1ELfIzrvD4WT7CTysixhv3kFy3LIFgneR9cndVa2uTDdQxkG0gponpwcZdyx6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H4gJmxW/b9LnX5mzA/KAhQ8XiEbiRaYIXqO/5CvVJ/Y=; b=fOdA2bTuLXlo9HRVpyOKAHrmELnxa6JLBMLXrH+fctkDcaHCqeYtaGPAQ3lFxq0bFnl4aDcE2lt7pOmfDLhF4n4/bs/VwlB9u7hLJCV+AYfMZlHFd3xCSH8zMuQXb1c7vQP0S8JpMPBSeP7NWA5aQ1zP3Jgw7/cxeBrRHY46WJiCtMwlgBjBSHrZYl83tCV6L4fMTORV/K4EGGlxFvDFGmotOmmCP0OuYnDNlEr8qJsVckgAMX8/0nwX5oUvo5KxTwBd9gAKnV3HZd5iTow971FFbJroH4208yGHLNjEK/qhXm2JUQP7eUKe+Fjyp+TuolQX1fvIdRAoHS8eI5MaLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.14) smtp.rcpttodomain=bsdimp.com smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H4gJmxW/b9LnX5mzA/KAhQ8XiEbiRaYIXqO/5CvVJ/Y=; b=BLCzChzEmsiAmnb6s5Gjo8UvzPnVETorfN03o/UQXGykeIH0DcmqLJanpSOKdf3JOg2itrkh0yJzE5z7+AyJWbJYrjNg/Fs3ga1VlhAVXOHGDhmJOdRdkOYUdSJrqe+vVc3gcIC0cehlzX9ZqHWxtD3xpSCWmDnWMvIxRXePqRo= Received: from DS7PR03CA0123.namprd03.prod.outlook.com (2603:10b6:5:3b4::8) by DS7PR05MB10115.namprd05.prod.outlook.com (2603:10b6:8:e9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8792.33; Tue, 3 Jun 2025 04:58:11 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:3b4:cafe::4a) by DS7PR03CA0123.outlook.office365.com (2603:10b6:5:3b4::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.19 via Frontend Transport; Tue, 3 Jun 2025 04:58:11 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.14) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.14 as permitted sender) Received: from p-exchfe-eqx-01.jnpr.net (66.129.239.14) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8792.29 via Frontend Transport; Tue, 3 Jun 2025 04:58:11 +0000 Received: from p-exchbe-eqx-01.jnpr.net (10.104.9.14) by p-exchfe-eqx-01.jnpr.net (10.104.9.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Mon, 2 Jun 2025 23:58:10 -0500 Received: from p-exchbe-eqx-01.jnpr.net (10.104.9.14) by p-exchbe-eqx-01.jnpr.net (10.104.9.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Mon, 2 Jun 2025 23:58:10 -0500 Received: from kaos.jnpr.net (10.104.20.6) by p-exchbe-eqx-01.jnpr.net (10.104.9.14) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Mon, 2 Jun 2025 23:58:10 -0500 Received: by kaos.jnpr.net (Postfix, from userid 1377) id D66247DE14; Mon, 02 Jun 2025 21:57:02 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id D59CC7DD90; Mon, 02 Jun 2025 21:57:02 -0700 (PDT) To: Warner Losh CC: Kyle Evans , , , , Subject: Re: git: 61d77e6c0095 - main - loader: allow for exceptions to restricted settings. In-Reply-To: References: <202506020549.5525nuDu054998@gitrepo.freebsd.org> <24533e37-2396-40ef-ba84-a5339b811527@FreeBSD.org> Comments: In-reply-to: Warner Losh message dated "Mon, 02 Jun 2025 11:37:34 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 30.1 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-ID: <59440.1748926622.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Mon, 2 Jun 2025 21:57:02 -0700 Message-ID: <60026.1748926622@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|DS7PR05MB10115:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c30a3f7-e96e-44ce-1969-08dda25b3d6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?D77wSWyVQEz9KweV2VYbJz/Ofc9kErwLKpAbyanLHvp6bZ25yE92b2xB6vJD?= =?us-ascii?Q?4bizSdVt/mDV+3E6LJObDwuDTacxuu2ePYdObzH/YMGnIMGZkQD7pSZxJVvq?= =?us-ascii?Q?YZGFKYe9cg4plvk9m936uB+Z8/DLBUoAfqASa4P+KRQfEJUiQzj+XgsKfgHo?= =?us-ascii?Q?rBCVR+t9gu1Luu0nCexD2Ujb8zGAEbM9DftN1JII+epsUZ0uaGqS/KdacREl?= =?us-ascii?Q?G7qngXTldIvRjZ+dh5KrJ4MnMSbIRaKdfl04jsQK74gg+MfiKSvTzeAmihaC?= =?us-ascii?Q?rvpL/ekZX3T3usTuszuIIhl2zNNmgYA8qTT3gTvtgqsptnFwET2K2/wNdhNA?= =?us-ascii?Q?99aS/uNe8F9s4XdifPADt9KIpN1DbsMGdzcMfXcT8+/eK8zd6zuqv6T+TuS6?= =?us-ascii?Q?7B7b0LrUanZrDTyHxmFsohxkvc292PLaWgE4fX4aRSsLUwR12Xc59hwBUVu2?= =?us-ascii?Q?qEJlQFmpt6rVFS6XvxyJv9EJpebYdzq5DN/fX7sttoAdT8Y3Ki9kfrM0mWpb?= =?us-ascii?Q?xYlJKUtN7LojP2wnzc4Nnuyi19CPcQ7HYWh9o3cwVW6S7Tyntk+oETB5HIVi?= =?us-ascii?Q?r/mLdeDod8qOOcEJP6bGA1sVVbfWontm9ufWQ+/j9aAgrCrjz7bfZu87vmzA?= =?us-ascii?Q?n+s24+p38GmC1D94kzlxOeB+meHkTfXTd9xb9hJwVQQ7fR/uPpSGbiWqBl9p?= =?us-ascii?Q?MfDDEyqfxaPpYzdBPA8oyQQMPSEotIcghrNGfUfyEJxHsKqwBOmKnNq1VIau?= =?us-ascii?Q?BDX4uZPcNM01MxpVGBxdF7V/cIDfRloYnSlenRht6j+sAizdQcYmYvmsS/f0?= =?us-ascii?Q?PXKASueZFho+i68U5N4ADFFtE6cm50D3FVOdyDlFSQKbYOxCwbCWR3Lzx2Qd?= =?us-ascii?Q?C48wFEblCMu5/61hCTwnD0DIXFZ2CQ6yHJ2UEAISHWbz2HLAsDSqk+Kol8GX?= =?us-ascii?Q?vN2NOK2wymeeJ4M+g1VABbOEIg+U7bJQTSZEiPybvWQkT2Emt+eK4lICqmdt?= =?us-ascii?Q?LRW5+lJMM15kPETzflDK/y2sT65No5m/iDVFE0VVziKC/1/N3VJ1scBLEUVb?= =?us-ascii?Q?N2MBwYv1vLNlljo/7kqXpNaUXfCdYrxJNuuOAaHNfBq7i2p9Hdu52IH8548W?= =?us-ascii?Q?wjOu06RvN10izUocGURx+Gel48pXuiYA5/kLhSN21DUk4QFmHG3M+u0826Jt?= =?us-ascii?Q?8zOiT0GFr1hMxouroyLvWG0EEdwRh14H9cIgKCjPrR8xNlc61JBaA2onPPnJ?= =?us-ascii?Q?Ssnrtyy8RSqsAw5RP8VM2S9tbHYBJFFlprr+6zMOyrwgD4hANGEvgSaPhdPF?= =?us-ascii?Q?D9dK+XBK+5zoIQxkRN6YxXIDKkZD6BBGQUwVj5GfHnWmntzDNXiqyHvdJ6eF?= =?us-ascii?Q?B54x7132w8hWOdpxS90p49w5yzQYZJtWrRGKjBRyh6nMvNt0CFcoH47adkCw?= =?us-ascii?Q?vo3JdGO8QcOt8le0fNiOh1Gd21eIXrLN2sCYh+nxuTuyaDy+Y5Cs15M+uck9?= =?us-ascii?Q?nS0VysVNcLbaTgT1mvnrl1e9qUft/A5Im6T5?= X-Forefront-Antispam-Report: CIP:66.129.239.14;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-01.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014)(7053199007);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2025 04:58:11.1926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c30a3f7-e96e-44ce-1969-08dda25b3d6e X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.14];Helo=[p-exchfe-eqx-01.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR05MB10115 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjAzMDAzOSBTYWx0ZWRfX/5kq7QZ7tRUu zRhVkle7tcVLd3bAFtJwPDjFUJ2MGPbFDdY+EBn/nmhNO1uT5V2Fg6qSwhtwV23gefLh4iFw1H2 Z77mLWT2hM6GF9P5Br1pRw1YMdVQpgWKe5IOjeeVrCYvWD2ZJUmOaDYoZXi0+MA6ckjnEnEctw+ PYbiENfmeMtic6RaGa5qnpKD1/dUlunG0QAqtCnkARi7OS5fvy5VLDaR0EpzedmywEeohNPdNtF 4x8fBt7qxtKjCBMArNqfAj/c+9TXQ+ymjGLB4N4KJRZDduaaSO3XlGe7nAsncUxcNFSmDF5/fFy oVCaSABxB3V9dgpiyhVvH32kLbZ1etAFQmFmmgqe16stCWajdAsS1wSPOvF8kchOkDEJOypwe6r VJQ0/O7hhwfahtXlviaAPACMVWN+pK8h7Q0I8IBGEZ0PBkjflmGd3Xshl+gmmsRqdgNp+Hfu X-Authority-Analysis: v=2.4 cv=T4WMT+KQ c=1 sm=1 tr=0 ts=683e80e8 cx=c_pps a=capY3lJrs95JDvUMoegEZA==:117 a=f/rncuQqEjTEF/G1odkJ9w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=h8e1o3o8w34MuCiiGQrqVE4VwXA=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=s63m1ICgrNkA:10 a=rhJc5-LppCAA:10 a=7Qk2ozbKAAAA:8 a=sJrp7ZUEwkj3m_kaO3gA:9 a=CjuIK1q_8ugA:10 a=1lyxoWkJIXJV6VJUPhuM:22 X-Proofpoint-GUID: P9LevOH-6m3RqfF52rqpps-tIoNj7twB X-Proofpoint-ORIG-GUID: P9LevOH-6m3RqfF52rqpps-tIoNj7twB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-03_01,2025-06-02_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 bulkscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 mlxlogscore=630 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506030039 X-Rspamd-Queue-Id: 4bBJPj5r1Xz3C2b 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:22843, ipnet:67.231.152.0/24, country:US] Warner Losh wrote: > > Long-term, we should probably work out something that can work for > > lualoader, too. We use setenv() there directly rather than adding a > > layer of indirection through the command-line parser. > = > Yea, I'd rather this be a property of the env variable than having lists= like > this anyway. And that would solve another problem I have from time to > time As in noting where it can be set? > which is needing to have an always existing env variable with a default,= but > overridable value. In these cases, you have to set that up in code, and = it's a > bit of a bother. If we do it right, we could have a three-fer: works > with lua, works > to set certain things immutable after a time and also lets us initialize= things. > Though getting the details right so that we can set these in > loader.conf, but then > not set them on the command line is the most likely use case, and I > thought for that > use case we did the right thing in lualoader. no? > = > Warner From nobody Tue Jun 3 09:01:31 2025 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 4bBPpX5nTTz5xKMk; Tue, 03 Jun 2025 09:01:40 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (fuz.su [IPv6:2001:41d0:8:e508::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "fuz.su", Issuer "fuz.su" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBPpX3282z3Mf9; Tue, 03 Jun 2025 09:01:40 +0000 (UTC) (envelope-from fuz@fuz.su) Authentication-Results: mx1.freebsd.org; none Received: from fuz.su (localhost [127.0.0.1]) by fuz.su (8.18.1/8.18.1) with ESMTPS id 55391VRN074745 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 3 Jun 2025 11:01:31 +0200 (CEST) (envelope-from fuz@fuz.su) Received: (from fuz@localhost) by fuz.su (8.18.1/8.18.1/Submit) id 55391VYi074744; Tue, 3 Jun 2025 11:01:31 +0200 (CEST) (envelope-from fuz) Date: Tue, 3 Jun 2025 11:01:31 +0200 From: Robert Clausecker To: Shawn Webb Cc: Robert Clausecker , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e698e4a53773 - main - lib/libmd: disable SHA1 AVX2 kernel Message-ID: References: <202506022333.552NX1uN061534@gitrepo.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: X-Rspamd-Queue-Id: 4bBPpX3282z3Mf9 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:16276, ipnet:2001:41d0::/32, country:FR] Hi Shawn, Am Tue, Jun 03, 2025 at 12:17:26AM +0000 schrieb Shawn Webb: > On Mon, Jun 02, 2025 at 11:33:01PM +0000, Robert Clausecker wrote: > > The branch main has been updated by fuz: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e698e4a537736f6a7dd9a386e00997d7fb08e83f > > > > commit e698e4a537736f6a7dd9a386e00997d7fb08e83f > > Author: Robert Clausecker > > AuthorDate: 2025-06-02 22:54:32 +0000 > > Commit: Robert Clausecker > > CommitDate: 2025-06-02 23:27:00 +0000 > > > > lib/libmd: disable SHA1 AVX2 kernel > > > > Seems like there is a bug lurking somewhere in the code. This was not > > caught during my testing. Disable the affected kernel for now while I > > figure out what is wrong with it. > > > > To reproduce, run > > > > jot -s '' -b 'a' -n 1000000 | sha1 > > > > This should yield 34aa973cd4c4daa4f61eeb2bdbad27316534016f, but gives > > fe161a71d7941e3d63a9cacadc4f20716a721944 with the broken code. Only the > > amd64/avx2 kernel is affected, the others seem to operate correctly. > > Out of curiosity, how would one best determine whether they're > affected? Would it be a part of the CPU features shown in > /var/run/dmesg.boot? You were affected if you had AVX2 but not SHA in your CPU features in /var/run/dmesg.boot. Thankfully, jrtc27@ seems to have found the transcription errors in the code (see commit 207f3b2b25eaa0f9d32699e664b139e5e40e5450), so if that's all that was wrong with it, I should be able to reenable it soon. Yours, Robert Clausecker -- () ascii ribbon campaign - for an encoding-agnostic world /\ - against html email - against proprietary attachments From nobody Tue Jun 3 11:25:17 2025 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 4bBT0F2l94z5xWFj; Tue, 03 Jun 2025 11:25:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBT0F25D2z3gxM; Tue, 03 Jun 2025 11:25:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748949917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x82GnL63bY+4fOafFmHb2Dv+9qnPnKzDPqUIvZhW7kc=; b=VXscBeygg33WjjODT5GJXvzkCl5dgBUAaheYXImwklixO29K+3szUNgaN28GWJ5/fBuCJz lm4jA2/1QeZY+i2MFJGX/ke8poswNPfIqUD6GkaN4F4PHxlMPsqj/CWDETqT0YABv/3tjx R2TZuXiACYwl4FkJWU9rhhx+2OS5LCDbBKuG27ZqEEJVcM7Z8M5SSJzbEpMcidG3ljtPGh GO5BLCWHXMvR5lgcbqUEduUUGFHiXiWOE/hWqikyfxp8YLD2n4pWcjGzS3KBhfjjXOKfgD fcHWr11Hu0YNyC05bEdLHoC+AwKY+yczAVn+3bssJahuZeXJ7gO9XnS8OU+bgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748949917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x82GnL63bY+4fOafFmHb2Dv+9qnPnKzDPqUIvZhW7kc=; b=foyNFNk9ZKUZQpFoqjPj3mnJFN/6x7pXL3OUDFMa1JQYX6erOLlEGz4g2hbCcQI031bhLB PkFUpXt47X5loRH1mcwPngin37Y8IJq3N8WHno4Ij8VjlK5QOqTuK14Ql9jWoz0Ii65tPN g1T6dGInNjCSWQaLwEgw60cjX8zWdGqggKM/h/dwLj9IGTs6HKsiEO6GI2yzc3XoH6G/8R O080ZcQGx5WZiSr/7DJK4wfF/79AprzBoLlm2Fg8r4ySxnl5UlISu7u+eqRhMbTBzCM4Qe QxQBmhuZKynnsLwytc+KY7MxAFe4+4L/YpTTzrGMtxguOS9vj7iNeycotMfX/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748949917; a=rsa-sha256; cv=none; b=Jz9KQfQg+ssTnspYExDJfoTw3MtvuM4rBxAuMNRl6NJqY2S6IB6rfq3RCrIKxjEsSZ/kUZ S6D9ta898La0kb98Sh8V5Odd09T+XLPE0bcuy+6vOiB/0NwCw69EMhyImSpq0Mp5/KblWj DyhcK+qFZT8J2WYHTIW4pb9i/OH0PwTDNprFgxu6+OqfBkZJVGKjgFCqR9CLOxZTt+F9sM 8VOUsRYttPx/nJFrTcKdSfWrh6o8eE0RWpXBlMP5vgNM+BIvwoEXmwdROZtJyjKNHLRp7u L0meR814tKiSEItf0y1DiLjyWFR+EQJzwNk28Sg2ie21B5yurS2KsvFPL+YzmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBT0F1D0Kzcy2; Tue, 03 Jun 2025 11:25:17 +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 553BPHfZ094139; Tue, 3 Jun 2025 11:25:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553BPHor094136; Tue, 3 Jun 2025 11:25:17 GMT (envelope-from git) Date: Tue, 3 Jun 2025 11:25:17 GMT Message-Id: <202506031125.553BPHor094136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9a139facd06e - main - pseudofs: enhance KASSERT with more information 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a139facd06e4a1159a9c2cb992d04bcf1079e7e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9a139facd06e4a1159a9c2cb992d04bcf1079e7e commit 9a139facd06e4a1159a9c2cb992d04bcf1079e7e Author: Bjoern A. Zeeb AuthorDate: 2025-06-03 11:20:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 11:25:00 +0000 pseudofs: enhance KASSERT with more information Add the name and type information to a KASSERT for 'homonymous siblings'. Without this (or a core file) we do not even know which entry to look for. This should make reporting and debugging a tad more simple. Prompted by: PR 287165 --- sys/fs/pseudofs/pseudofs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index eb4ca8a82456..d8dbf7117d13 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -124,7 +124,8 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) ("%s(): nested process directories", __func__)); for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0, - ("%s(): homonymous siblings", __func__)); + ("%s(): homonymous siblings: '%s' type %d", __func__, + pn->pn_name, pn->pn_type)); if (pn->pn_type == pfstype_procdir) KASSERT(iter->pn_type != pfstype_procdir, ("%s(): sibling process directories", __func__)); From nobody Tue Jun 3 12:03:34 2025 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 4bBTrR0LM1z5xXgn; Tue, 03 Jun 2025 12:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBTrQ6kM2z4B88; Tue, 03 Jun 2025 12:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748952215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYC4Zn14ax8QXoq/7bsf7PF/d4LfFzQdnwcesat0o5E=; b=pqYwKcCSgVgqABVtt0NuDc5wlYdX6UfRwkPU+2MHolvjdjgg6Ds3pEWscRPjrDi+BD5B/w RDOi+danBJRTR/MNGFyaXyYUlNCV+B55ILP/d7qV51aasAhJCNDpp0oD5fwxn0Wp0YWDlS KDTrcYvjeVCSLsR77X5SZumZuNWLNuo1bxhljqmuzB31PjTXg1cfepdNOqShbuiOBhF9cR 1bUEw+om6vaLk1jBxVXcLQ8VR0W3r6CPxIU8bBMoKUsqvImYP1i+e7ruOTcCFYFjKOjza1 tx43CL58A9Avmp6T0jDyRzeROifpOUeeQxDpJwEq1AAy771zhHmQ/R3lkmMBXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748952215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYC4Zn14ax8QXoq/7bsf7PF/d4LfFzQdnwcesat0o5E=; b=OmKxBiLXaIEQRY7afbuCWfuzEmXlOLJHqeL57OlglvEaYr3dVs+VRYoLLKKskmEmPPF+R6 XGrV1DwFW30UgymDV2zgfodE1Cz6YK2CUDjcPH8UDjQCtFQfWYO4GWqfG+L0ITLW+9d355 2TK+C8tCmOb7teBQHfjL/ooghLPNAk0xtoU/pHf+ePzB+lQsXh2BKducm92I66i7F/F8/c R7SGdKXcX0jVYoh9CsIrqZEOWELRzNxGurOSj91lcl2Hhthc8Clo79pQE1e4pIeaFYOAOt 5AyV5sZ+ZoNaR/izwvcfPHDnFqQTXvc9d3/wnuQQ45aBdWYvMR20BCOuvc7M5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748952215; a=rsa-sha256; cv=none; b=FSh/Sq/Xvk04rJ2OuS9b2P2adLjx3WmjGAUBfprd7gu2ljaIoCPuNNekxntg5rT3cfUtEK S2RJaYYhstXYLuk/Mldiz+mA99dDC8qMy2z0G0x8FrhlpioUa5n9W0KXm0nDyTvvNlXg49 3rXiDaH9RWTfpYrCbnPZiiMhBSrxlet8dT3t+Tc4v7xjZNkqG7z9/e9/FDF/GdpF1aYTKr zKEyK8EmRnp/GpqX/qeRfBnhyxb+Jb8xtCU6Plc4j5KkEwT6f5JeqClmCtQgOCn3jHZ/qj vK994bbj3ir0Dn1Hlm1u7k8Kyyvgd8KW7mDmBcZdHY4/9WasiOyGxXzDVw6QtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBTrQ6Hg6zf5j; Tue, 03 Jun 2025 12:03: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 553C3YLN069074; Tue, 3 Jun 2025 12:03:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553C3YXg069071; Tue, 3 Jun 2025 12:03:34 GMT (envelope-from git) Date: Tue, 3 Jun 2025 12:03:34 GMT Message-Id: <202506031203.553C3YXg069071@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: ac4c4c2739a8 - main - release: Remove stray review reference 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: ac4c4c2739a8fadd328707baec11c8443e2fa2dc Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ac4c4c2739a8fadd328707baec11c8443e2fa2dc commit ac4c4c2739a8fadd328707baec11c8443e2fa2dc Author: Ed Maste AuthorDate: 2025-06-03 12:02:03 +0000 Commit: Ed Maste CommitDate: 2025-06-03 12:03:16 +0000 release: Remove stray review reference release/Makefile.oracle had a stray reference to the Phabricator review in a comment. --- release/Makefile.oracle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.oracle b/release/Makefile.oracle index b4f3bbdf86f2..3573f29b96c1 100644 --- a/release/Makefile.oracle +++ b/release/Makefile.oracle @@ -1,4 +1,4 @@ -#D48382 +# # Makefile for preparing & uploading Oracle Cloud images from existing # .raw files created by cloudware-release. # From nobody Tue Jun 3 14:21:05 2025 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 4bBXv6302pz5xhwg; Tue, 03 Jun 2025 14:21: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 4bBXv611wfz3xd3; Tue, 03 Jun 2025 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748960466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BG8aYmnxfia0v+8M+CB//Wo5TKZiUIYyIzS1rnrOylo=; b=oO5A4wC5rxdq9eIFSBygTIL+s2sUV2fy97H61/RK3FZiqME8AN1PK1kQc5tZB7rCqfFILO SqN+yz/2wLMgzK4Bcuh/tgX4Qqsx8nFRDJVFvcXCfL81ioxF2Kf/YM0tyo6cH66WBQ4w/F KhEdhp5phlpv9WGPMSGtUO/CJnu+nSXNAPYn5mog4Qqk/ZNtx0EJyQEP9vsHNxmGD8Xt55 uzAMm3UXZqtUawT2+UPI5nlFC41Rw9730tixp7XOxjxsDRTA0Cs1qeuzt9e7PfhRylwSUC nfPuFk2KfibXsMQ2bsXuiOCOX24CMyWkpWQsl72pgdHwfKL+OokVA1B4R3k6Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748960466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BG8aYmnxfia0v+8M+CB//Wo5TKZiUIYyIzS1rnrOylo=; b=MUUY5z2lXXJB4yiPC4ylScq9ZOn1ckIyDkJE2AhUxolCGxVO1eGbRiii8iEuVecFp2ENnd LLGP/G552F48/sR8TvHi3M8Q0wssdd5Nq4WK8gAtStnWSqBCIeXOAaJdID0iiQKvq80s8f wIM7M+VfZL6iTzUq53s3W7ufVB6Go11JuIbrNy6lXtKLHRt+4uNKx5hQiorWf5bCyzRbwq xm9E0NmOT7+T+lxTCOTJXttu54Ihez8/000g4h2gCil8j3F0tgOChqfD8uk0VRxLcxYtTd GsyOd5iNrzY4HqZodNr6ymxBIDj55xaHe0DlpyGzZE4kfafwl8hfy2aLUO7Dfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748960466; a=rsa-sha256; cv=none; b=uQnjsNcvCn5jrDgT/d9/Uti1k9oZLGzYDZ5fC8X9yXm+PpWp4BOyObjTc/+syiLBcRBkPA S3zx1mV7MmcwiGrwGyeHnCofG1l8npfhzIfco/JvGu9hdY8+Atv0ZSS/TzMlqf/8I3i5e4 T2zQ9w6kvpKRJQRqqxur+mFDaKrCMqqDUadaQNlVgV45dzb7IBMwnaZSL9ekQuw80C3qlm Kr3WdWcDh9MkaJrwbL6X7TfdrZHuAoDbAaixlVXl4ZZKWMuuOALKreNFIqONeS43bWloTO QaEy5mcuiDdNTaPlmR/t3/EsbmimfaWrIz4pm2We2lhzk/jiUYOr4Ud3fdWpwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBXv60TJxzhk5; Tue, 03 Jun 2025 14:21:06 +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 553EL5U7024732; Tue, 3 Jun 2025 14:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553EL52R024729; Tue, 3 Jun 2025 14:21:05 GMT (envelope-from git) Date: Tue, 3 Jun 2025 14:21:05 GMT Message-Id: <202506031421.553EL52R024729@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: 680f1a39ee4b - main - libc: Allow more complex expressions for CALL_BLOCK first argument 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: 680f1a39ee4b6cd2fb4dcf3de195bd58626b9525 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=680f1a39ee4b6cd2fb4dcf3de195bd58626b9525 commit 680f1a39ee4b6cd2fb4dcf3de195bd58626b9525 Author: Jessica Clarke AuthorDate: 2025-06-03 14:19:04 +0000 Commit: Jessica Clarke CommitDate: 2025-06-03 14:19:04 +0000 libc: Allow more complex expressions for CALL_BLOCK first argument For the case where the compiler supports blocks we only allow the first expression to have an operator if it has as high precedence as a function call, which for blocks effectively means member access and subscripting only, not even a dereference nor a cast. Parenthesise this, as is the case for the missing compiler support case, so that it's more general. --- lib/libc/include/block_abi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/include/block_abi.h b/lib/libc/include/block_abi.h index e04998d6148d..cf670c6c079e 100644 --- a/lib/libc/include/block_abi.h +++ b/lib/libc/include/block_abi.h @@ -37,7 +37,7 @@ * compilers that support blocks and exposing the ABI in the source for other * compilers. */ -#define CALL_BLOCK(name, ...) name(__VA_ARGS__) +#define CALL_BLOCK(name, ...) (name)(__VA_ARGS__) #else // !__BLOCKS__ #define DECLARE_BLOCK(retTy, name, argTys, ...)\ struct {\ From nobody Tue Jun 3 14:21:07 2025 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 4bBXv75h8Pz5xj0S; Tue, 03 Jun 2025 14:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBXv71N7yz3xrh; Tue, 03 Jun 2025 14:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748960467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yxACp3Uf0Qvj67UQqy4GhodFa5nlUfPTOkS+KskVd8M=; b=PMRKF+wLQaQXDP0+tRNrZD4JuYOdEAfQvA0f7IyB2u7xSOePxSioxDy6uN94rc2KP1DgvC pSl3SgZpBAsl3vI0QuNmcEWudTa/fY9BSM4r0Z9W/WI03PqhW5sW7QS7XrmPTPuDq8/ixt YD+oWAjoTbRY4//ph1YBxm0m99SOWrYF67AOIswBSOywHk3YZoVJOJCu5loPpPTw8OPWET 6CBeklVgFXGngFCkqNiXUz5btqMDOeNOLwOE61v6X1sw8gvZlRZWSu4z+285qjswP5AZd/ mq4DtQB0TBpA/F7F1IPPthBuvIBGF0hE4TNJoUFHxKVuZffAms/Wmd48YXorfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748960467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yxACp3Uf0Qvj67UQqy4GhodFa5nlUfPTOkS+KskVd8M=; b=VISbxSP4ktpaxqJrN3yb6OJ5az0+sF1MpHO+YScDsvgYaoWBjXCXdjQlNfrmyQniVPGcq3 Sm+rUS4+XLJYLTFd9zpBR7SvAisnI9gnY7cfrv729wcy2PkqcHPfTaN3N7tj8Py7eNbBGy hYBvPo7FzbR/IOmyHIzYFhDMl0GjiO8acGQeoebGup7D3nQgndqeyqKj6xK1znce6H8nFo BldiJKWSyClXUC9/Fo9/DGcMjICSgbHZg67o4gpAc9wvr/hjNbTUiZNmXp+5sCYbE2Sn44 /dhUjUmKZuJXiMoGF2Fydpd29IbhYRx/KuJGm9zwhwOtOn4/NCNmyfD+py2G/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748960467; a=rsa-sha256; cv=none; b=dI/bigIIYxLFHEqD0tF2iKHQgL+2HwNPbQnOkDYFLXTAhsHNHvEw1ynKieXoifYI0shs+L vK9uE6v495xJjguSZ//QBBhGh9MyNQlgG1OrbIQD/g6uODMGYaLP9tkcFZ4bgLqocOVsfW mTiEIgBjbnNcu3Yr5akRVP+hDeJDrq5BSi/jkB1sScn8YIPzDyhh9HH0tqBszYFxo9OeOx fI/5HKXWeX6j3cOCUa6iW6w+ASdNmjJA8mPEa98ZvkKUmH/ydR0RdxSCCFe1tM4YpmRIIS X9sibAJk474xwQWVyKIqzq0GBw5QTJOgtQmitGw2yyMiO6izOHpJ4C0DvlhOUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBXv70hnhzhcl; Tue, 03 Jun 2025 14:21: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 553EL7wu024765; Tue, 3 Jun 2025 14:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553EL7wr024762; Tue, 3 Jun 2025 14:21:07 GMT (envelope-from git) Date: Tue, 3 Jun 2025 14:21:07 GMT Message-Id: <202506031421.553EL7wr024762@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: 786ced56a434 - main - libc: Fix glob.c build with GCC 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: 786ced56a43443400c12b73323a9f1da7b3db2ba Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=786ced56a43443400c12b73323a9f1da7b3db2ba commit 786ced56a43443400c12b73323a9f1da7b3db2ba Author: Jessica Clarke AuthorDate: 2025-06-03 14:19:04 +0000 Commit: Jessica Clarke CommitDate: 2025-06-03 14:19:04 +0000 libc: Fix glob.c build with GCC We don't expose the dummy struct pointer in the header file, so gl_errblk is just a void * when lacking compiler support for blocks and we need to cast to the former for CALL_BLOCK to work. If blocks support is present this should be a redundant cast to the type that gl_errblk already is. Fixes: 1e0743f54d2d ("glob: Add blocks support") --- lib/libc/gen/glob.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 1ac919edaa12..921db0a7b5a8 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -1121,7 +1121,8 @@ err_aborted(glob_t *pglob, int err, char *buf) if ((pglob->gl_flags & _GLOB_ERR_BLOCK) != 0) { if (pglob->gl_errblk != NULL) - rv = CALL_BLOCK(pglob->gl_errblk, buf, errno); + rv = CALL_BLOCK((glob_b_block)pglob->gl_errblk, buf, + errno); } else if (pglob->gl_errfunc != NULL) { rv = pglob->gl_errfunc(buf, errno); } From nobody Tue Jun 3 15:48:19 2025 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 4bBZql67Pmz5xnZQ; Tue, 03 Jun 2025 15:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBZql2JYJz4GZf; Tue, 03 Jun 2025 15:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748965699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1RXiEbiO2wv1KdXERC079BYdWEVOHDlD6ywq+aM5y8=; b=NuCyTOUC83r12VvO1iA59v/2BVbPRVRkFsftra40EMrW3mqsy6DcUIqjsz9BvvBNwXMJY0 srHR0EVcQjetmWXuuGqXWoeEMFyLwTgvS9FHjGutg1f69mSgP7SFZWZY1lbP6AKkf8hdcT biq+qN5XpElnZKMk98JOZsXUH3cTj2DSyN11Qo7R/gBb3L6oaW1JKXPpwLwMmZSQKg1fX9 ozWRJKY7/zPmlwKECY+AMWuz/RL3cRoILfaksL3ZXSqG88rVVR/VnkyFBDEBSQyW0fPaho 5RE3SAjdHXe4xIG5n8rTrpyDl4A/ApPC72VcQ+58QmPUMRk8sNx5UvbRGJRNFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748965699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1RXiEbiO2wv1KdXERC079BYdWEVOHDlD6ywq+aM5y8=; b=jlpVtmsoMqSmTFBwp075wtsRrlZ5w0URlK165Q7YMKRAVIP4sYPMUQzfxjLV7DcYr7q0At xUqnbNTYO9qnykRv7HtIh4ozxkOWeExChpyA0pc9ThQUyEO0GP0rD2XQN6YIJBpqqe9xaR M68eRK7tFh/OE1FHTcJ6JQ5J34Da16z6rwAetQQY9UXfN6tA8m6gHfW2HPk8DXhZ5PKSIS aMOTVc/IM1iCfofJP7k+uKK66ZGDTu0O2H/kvjInsbxKBqtk2+j0BblygxFspcySP7CfLg hqDv8WFJSAN5f5AvNlGPR8WH4uGay3gTKW1DvJfxE+Y11u9ENKaQPQ7lTx+MzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748965699; a=rsa-sha256; cv=none; b=NIuFSYSKCmtLf95hDuDnRxsTdIGZGrd5UyNCJgP+aqJlzwiudSayjStbm80LMN/FNWEjQh kcDL+FcT02nAPDjxY72XNiO2Da3K9GqyLX4kcn+uTNiyVPo95SWl9hU03L7pj11jcsIGpc zf9QbMTpQ+SKqt8octP8sAvtFUjSCY5uJgq0zC6iZl5fndLgKGlXZFlnxasVNugdAcoFg9 Xo8G8JGbj7DhIGAuJbccGGceuEnS0Mb0jbEhU69XSW6yORHcd5G8GTSxQjJ7vUObl28O8l yRVXQTiCacoLJacjvHHUT4WU/3IqH3ZrikK3FQydg8ZBJOiNhZZcfByaxEheOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBZql1sLHzlbn; Tue, 03 Jun 2025 15:48:19 +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 553FmJYH081619; Tue, 3 Jun 2025 15:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553FmJOs081616; Tue, 3 Jun 2025 15:48:19 GMT (envelope-from git) Date: Tue, 3 Jun 2025 15:48:19 GMT Message-Id: <202506031548.553FmJOs081616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: db6f6cc583bd - main - pkg.conf: add valid configurations for kmods for all branches 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db6f6cc583bde6c21618ab4a4ab926f9d57b1641 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=db6f6cc583bde6c21618ab4a4ab926f9d57b1641 commit db6f6cc583bde6c21618ab4a4ab926f9d57b1641 Author: Baptiste Daroussin AuthorDate: 2025-06-03 14:20:20 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-03 15:48:15 +0000 pkg.conf: add valid configurations for kmods for all branches MFC After: 1 week Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D50668 --- usr.sbin/pkg/FreeBSD.conf.latest | 2 +- usr.sbin/pkg/FreeBSD.conf.quarterly | 2 +- usr.sbin/pkg/FreeBSD.conf.quarterly-release | 23 +++++++++++++++++++++++ usr.sbin/pkg/Makefile | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pkg/FreeBSD.conf.latest b/usr.sbin/pkg/FreeBSD.conf.latest index 2175a3387437..8c68118c4938 100644 --- a/usr.sbin/pkg/FreeBSD.conf.latest +++ b/usr.sbin/pkg/FreeBSD.conf.latest @@ -15,7 +15,7 @@ FreeBSD: { enabled: yes } FreeBSD-kmods: { - url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly b/usr.sbin/pkg/FreeBSD.conf.quarterly index bd0ee13b9b43..884226fc02d1 100644 --- a/usr.sbin/pkg/FreeBSD.conf.quarterly +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly @@ -15,7 +15,7 @@ FreeBSD: { enabled: yes } FreeBSD-kmods: { - url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly-release b/usr.sbin/pkg/FreeBSD.conf.quarterly-release new file mode 100644 index 000000000000..bd0ee13b9b43 --- /dev/null +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly-release @@ -0,0 +1,23 @@ +# +# To disable a repository, instead of modifying or removing this file, +# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.: +# +# mkdir -p /usr/local/etc/pkg/repos +# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf +# echo "FreeBSD-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf +# + +FreeBSD: { + url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} +FreeBSD-kmods: { + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile index 2fa0dbb053ad..0420065bb7eb 100644 --- a/usr.sbin/pkg/Makefile +++ b/usr.sbin/pkg/Makefile @@ -6,7 +6,7 @@ BRANCH?= ${_BRANCH} PKGCONFBRANCH?= latest .else . if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*} -PKGCONFBRANCH?= quarterly +PKGCONFBRANCH?= quarterly-release . else . if ${MACHINE} != "amd64" && ${MACHINE} != "i386" && ${MACHINE} != "arm64" PKGCONFBRANCH?= quarterly From nobody Tue Jun 3 16:46:03 2025 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 4bBc6M4vCKz5xsBw; Tue, 03 Jun 2025 16:46: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 4bBc6M3xScz3k29; Tue, 03 Jun 2025 16:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748969163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BL/z8GDZdRpLR87unzKfbYusGfu+nzMZ6vSfQxHDhRc=; b=xoj56dupSUYvRoPIZWINxeJ5s1XZySGfDG/KCQGlwOKI2m4Rh9KrbcsW6IzxbVmDif2RL2 hbwyuvk9H79WrSZFB3q78qhXOm3Nb70rkRfM4r9XXoX4abzazWOpnSyjWiVU8Oz93nhNS1 Le08tkY17Zle8pt47CECiacnXgeW/BziTp3HrK+eemixr3FV/gLUoQOd2fSK5ndX5W0khs xXWIJxIU6RjSnvRh50M8pW5UVg4yy2o96aboznqzLzo2Rf/oL5w0OplpH3t0f56OHDwok/ MO1uqKK0NsdFecjCu3AnqDl6cvhIxHFxJxoDbvfk/vg5cjztzOF00/6QD3DOMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748969163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BL/z8GDZdRpLR87unzKfbYusGfu+nzMZ6vSfQxHDhRc=; b=K3EFnQv767GyBaGmsYpstdV7VX+hD3XXDDKIRx6kyfY35SJBnxlAHz+OqHQZXjkofbrQiD n2UhsbTkR2bxXUvXNbz5gMjnYQEYjBdfWj+oNzF7e9f6PAeLGqrD7M5ydwSXJl89IMUhD6 feDgm/DeqdMtqhmYCE608SmuKQ8ONyw1jiQ1py5VyFofSwzz05J90D5nfrpJEzCtuMo96Q 7LcrRSXJi5bDJPHCALj+LaX/MXiQYDxQTpdrdws77vm9rMif2D8qLsd1zx7ZHwV1T2+mWA LmBjKcGChl5HoQ9QRVcz00WjgoFs2xI+4s5u4viHNJkbc6xCCOdi5BtulI4mYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748969163; a=rsa-sha256; cv=none; b=rZ8960VIHp3VOt6dtRTg10cCnSVXEdmMeJVUhaqJjSUHqGo4AatXJPJYyQqf+OAEYQphuM q5dkw0YRIpDnnllFyxucWwfQudC3C7A8T4qJ3/si9IpTTSZvwBTrmyDPgj4QTW09zdqM8m 3pgW8+I6NmeCfQTGnIUnwraeCqh1ZigVpP3ssh5IfPHM1n2bV2/nWiLRcfopQdwG/XlDoI ZibyVzzbpm5iSF0KGzJOnqF+3rKeJABQbdXmNiBYefiK73NyOtTqFOhBLEpCYgobOxq4jh AVp+2XX4vDT0+H+BLrTMQ49zrXhQ5J3l3SIyA63Z9aFSTWKGgZWcsR+27rn4IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBc6M36Przn8K; Tue, 03 Jun 2025 16:46:03 +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 553Gk3jC093946; Tue, 3 Jun 2025 16:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Gk3Qk093943; Tue, 3 Jun 2025 16:46:03 GMT (envelope-from git) Date: Tue, 3 Jun 2025 16:46:03 GMT Message-Id: <202506031646.553Gk3Qk093943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 03ad449f6cbd - main - newfs: enable newfs to run on plain files without a bsdlabel 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: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03ad449f6cbd17995111891b438fdc97c50f0f51 Auto-Submitted: auto-generated The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=03ad449f6cbd17995111891b438fdc97c50f0f51 commit 03ad449f6cbd17995111891b438fdc97c50f0f51 Author: Robert Wing AuthorDate: 2025-06-03 16:47:11 +0000 Commit: Robert Wing CommitDate: 2025-06-03 16:47:11 +0000 newfs: enable newfs to run on plain files without a bsdlabel For awhile now it's been possible to newfs a plain file...however, newfs errors out when the file doesn't have a bsdlabel - this commit changes that. Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D50562 --- sbin/newfs/newfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 9c45c9150955..78a297e6074a 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -342,6 +342,11 @@ main(int argc, char *argv[]) } pp = NULL; lp = getdisklabel(); + /* + * set filesystem size from file size when a bsdlabel isn't present + */ + if (lp == NULL && is_file) + fssize = mediasize / sectorsize; if (lp != NULL) { if (!is_file) /* already set for files */ part_name = special[strlen(special) - 1]; @@ -431,7 +436,7 @@ getdisklabel(void) bootarea + (0 /* labeloffset */ + 1 /* labelsoffset */ * sectorsize), &lab, MAXPARTITIONS)) - errx(1, "no valid label found"); + return (NULL); lp = &lab; return &lab; From nobody Tue Jun 3 16:51:06 2025 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 4bBcDB4tV9z5xsZR; Tue, 03 Jun 2025 16:51: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 4bBcDB4H8nz3nhT; Tue, 03 Jun 2025 16:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748969466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJSxhqzBV5PRARil6681JNoxYouCsT1zojfPesuPezw=; b=GnlkEY3yJ9N5jMzH38Egww/azXREF0pk3jd7KWvOq3HMn6cU567dKkCvwwVGy+TnrvdjJX azbbZkXAMIYhUtOWN6+E76xXngweRUDGXAs9ceoMe2EfZ/Wu73iEdKD9LXN7nctrvKgZWi nnt6kxJT1rWl9RWQwtjVqWA0qQBcu+g2CIKj8Tfs8kdtx/Q7GE4MQQWw40rjGBEnl9bKb2 LqciTgqBP1XOOzDDXBuSOuNAi9awiq3RdopRnxWIrR2dnOkBsTocETCrfPFk0ukw/6oEM6 wbc4RDS+AeP80eGo/yHLvMC/DEeAwJ72IPUmuHyrwpyYJ9F7xCKhSqby+hHeMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748969466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJSxhqzBV5PRARil6681JNoxYouCsT1zojfPesuPezw=; b=nG3cUc3d0Rdc9xBASjnghFKRqfMB24r9hkdtGfflI7D4Uzq2l1gfEmkrjaNLQcxGNaQcch 87eE+kK+ngffieOh2vF0GvRpaoktdiqGjJsBDkFaoMn+RlXJ7rWZ6Zf8vMuXOuRHKs3JBf mUN10NIoRLMBsX8/0KwR0sPG8Qv3//Y/t0fwGHZ/VszuhJmrz/q+hg69yC/lGiXU8SbQr+ uIXjL4HK58BRLRY00aqcRGz1TrtYN+gqNz6RmreoDDbGdASd/a9JdytRzAvNj9j8s5tIIu lZCHLK72AlMY1GqOBw14Ijgcay1fX/uf/ASsTatsvviAfocOmAfipIbSyieWBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748969466; a=rsa-sha256; cv=none; b=x0A1N3mEOzBp14tOC4rqclXu7q408NFEg0RHX/dR9gJZtOymCTGi70Cf+dSDC0ocPY4D4g XWe38OiVCmCCDei9h3uowVVAH4pDM3oFMircMRk7vEUb7NKBNRh6xKTDnahVFAwv5pA/bo lKCL1HV7CMyH4MZHseJrYhmg5FfHJ7ho4fFKNb60xqV/c/leCM5FGc6qbKXLw++azNN04I PPli30bvckDeKXxdYM3gGNJBFiweP5c9C/63PX9OxVk3X1BelQkPXyHgAHJZkvuOm5bEXa s6ByHEVB6eEbpWDYhVTppIwAl780HOAWZ9MTVKxdzKVAljmBOyAeX95OLJPuIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBcDB3tKhzmTV; Tue, 03 Jun 2025 16:51:06 +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 553Gp67L007923; Tue, 3 Jun 2025 16:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Gp62D007920; Tue, 3 Jun 2025 16:51:06 GMT (envelope-from git) Date: Tue, 3 Jun 2025 16:51:06 GMT Message-Id: <202506031651.553Gp62D007920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 44a4ae3ad72d - main - newfs: don't warn() when newfs'ing plain 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: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44a4ae3ad72dd0d4e6e78f586a679d632cc4dbfd Auto-Submitted: auto-generated The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=44a4ae3ad72dd0d4e6e78f586a679d632cc4dbfd commit 44a4ae3ad72dd0d4e6e78f586a679d632cc4dbfd Author: Robert Wing AuthorDate: 2025-06-03 16:50:58 +0000 Commit: Robert Wing CommitDate: 2025-06-03 16:50:58 +0000 newfs: don't warn() when newfs'ing plain file Differential Revision: https://reviews.freebsd.org/D50561 --- sbin/newfs/newfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 78a297e6074a..418319d1cd3a 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -327,7 +327,6 @@ main(int argc, char *argv[]) if (fstat(disk.d_fd, &st) < 0) err(1, "%s", special); if ((st.st_mode & S_IFMT) != S_IFCHR) { - warn("%s: not a character-special device", special); is_file = 1; /* assume it is a file */ if (sectorsize == 0) sectorsize = 512; From nobody Tue Jun 3 18:37:37 2025 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 4bBfb60clyz5y12v; Tue, 03 Jun 2025 18:37: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 4bBfb528NGz3b70; Tue, 03 Jun 2025 18:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=okTNHgpc0AF/cc96wXpKVo/wd6nxliQH1+tUVlmPyXg=; b=PanwupGQnNSJjByN9AGaPs2ddz6EEpYz6S5tlGBp3HQn+Pjeb/+9yQjLMPXt+i+bolH5Bs 1eQX86GyQ9b6Oz8gNDFYM2N0XGmmpeUWCMnE97wJ+/BTy49DicPjIEhxBaPZRB4tr4bC/b 6H3Rd1kbI7ydA7XJmif2In0QYGTRhajlFzGcxVzzugqVW0wDgFZ6H2yjZXa1XAX3h1Pl9W 7XdW3fE3ezqv/AycinlYCES7h7Nr2Tnf+37NBHDrzKeeBdScMBxhUSSnwkT/gXZMIFkrgn 9GAJxR9PS+uWLK7gjn6s3VM/RMwIZL5ZFfg+VmOlC2yW8YXrj8R+QaQ3wl107g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=okTNHgpc0AF/cc96wXpKVo/wd6nxliQH1+tUVlmPyXg=; b=o94YI3cCeYVm6VlXFs4Oqdzwbrjq2kkgWYBOcp+XCzBCb20WoG/glQp4WucmwPp+KP+vaS 27M/zC5R+Ueu/ZKwIG2manaIu6ZQ2B42y281ToPsqinw0dPPQSTniuzIOD9w4ZgRlKaziD 0nB/g/IkzuszlPUDnbng/CziZWKGH8orvmDxxaPmGZpw2s3fn7WeGBUe8sRnsAGLqctDDb 2MgrYm9dvkI98m/EUxTbI/ubW+9RAIZ2wKPYXS9mXym4r7o5Ow0Qdg++I146QJWBUBbVUQ ewVm+I8Ad6f2ON+n47VjR0qBw9ylLc6E5W91a6Nph9Jkuxj/aMQg1uQb31P54A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975857; a=rsa-sha256; cv=none; b=VuAZ8JBeiItzP2SRNY/eJC5/JoXDRQ1j6zXb128a8he2ZpcWXzfmNahyMPiJBOmZ0w+6m8 Z4zKTl30K18vChRMbGr/MIjJGasx8qWCpm/53Qg/sITc9IWtBlmxpeQDEHVviA7349IZFQ 6yE7uvL7MJLfDWquyLlos7OCD4RBUmC46PRgaub+1k9Hmd35TCJMo6oVVhuhoW2fcvlTUG 6it5N97coRmJ4p+GCgDkXxSXC3ONmPBPKcAzAxKprY5Ok9VLG434gQxKuB1MFIiM8u0viC Z0boNOXASPSgALmdbGFzGcq4Fi0oklTTa69dCeZAoPcHuBWmJMLcj7TI38s7Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb51fV6zqqb; Tue, 03 Jun 2025 18:37:37 +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 553Ibbmd000337; Tue, 3 Jun 2025 18:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IbbVZ000334; Tue, 3 Jun 2025 18:37:37 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:37 GMT Message-Id: <202506031837.553IbbVZ000334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f99d393f7f78 - main - LinuxKPI: add missing bus_dmamap_sync() calls or exclude them 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f99d393f7f787ff080c12b92243adcc310ac7c58 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f99d393f7f787ff080c12b92243adcc310ac7c58 commit f99d393f7f787ff080c12b92243adcc310ac7c58 Author: Bjoern A. Zeeb AuthorDate: 2024-05-21 22:32:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:09 +0000 LinuxKPI: add missing bus_dmamap_sync() calls or exclude them Rename linux_dma_unmap() to lkpi_dma_unmap(), and linux_dma_map_phys() to lkpi_dma_map_phys() so that we get the full set of function arguments (direction and attributes were missing). Leave the old functions as wrappers as they are called from drm-kmod linuxkpi/bsd still, and leaving them also allows us to MFC this change. Add missing bus_dmamap_sync() calls. Rather than inlining them in each inline function push them down to the actual implementation. From there do not inline them either but call the appropriate function dealing with the sync so that we do not have the same code splattered in many places. Adhere to the DMA_ATTR_SKIP_CPU_SYNC attribute and skip synching when requested. A previous, less complete version of this change already allowed me to load firmware on arm64 for iwlwifi (again). There are four more places which are not currently done as the functions which came with an OFED sync a long time ago seem to be unused these days. Leaving a pr_debug("TODO") call there. Also dma_[un]map_resource() when brought in from drm-kmod/linuxkpi/bsd (D30933) should be adjusted to pass the full arguments as the amdgpu callers are requesting to skip synching. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45294 --- .../linuxkpi/common/include/linux/dma-mapping.h | 50 ++++++++++++---------- sys/compat/linuxkpi/common/src/linux_pci.c | 49 ++++++++++++++++++--- 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 84f0361de765..09d5e4b6bc22 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -96,13 +96,17 @@ void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); void *linuxkpi_dmam_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); -dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); -void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); +dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); /* backward compat */ +dma_addr_t lkpi_dma_map_phys(struct device *, vm_paddr_t, size_t, + enum dma_data_direction, unsigned long); +void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); /* backward compat */ +void lkpi_dma_unmap(struct device *, dma_addr_t, size_t, + enum dma_data_direction, unsigned long); int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, - int nents, enum dma_data_direction dir __unused, + int nents, enum dma_data_direction direction, unsigned long attrs __unused); void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, - int nents __unused, enum dma_data_direction dir __unused, + int nents __unused, enum dma_data_direction direction, unsigned long attrs __unused); void linuxkpi_dma_sync(struct device *, dma_addr_t, size_t, bus_dmasync_op_t); @@ -173,16 +177,17 @@ dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_addr) { - linux_dma_unmap(dev, dma_addr, size); + lkpi_dma_unmap(dev, dma_addr, size, DMA_BIDIRECTIONAL, 0); kmem_free(cpu_addr, size); } static inline dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, - size_t size, enum dma_data_direction dir, unsigned long attrs) + size_t size, enum dma_data_direction direction, unsigned long attrs) { - return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); + return (lkpi_dma_map_phys(dev, page_to_phys(page) + offset, size, + direction, attrs)); } /* linux_dma_(un)map_sg_attrs does not support attrs yet */ @@ -197,7 +202,8 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) { - return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); + return (lkpi_dma_map_phys(dev, page_to_phys(page) + offset, size, + direction, 0)); } static inline void @@ -205,7 +211,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction) { - linux_dma_unmap(dev, dma_address, size); + lkpi_dma_unmap(dev, dma_address, size, direction, 0); } static inline void @@ -263,28 +269,33 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma, linuxkpi_dma_sync(dev, dma, size, op); } +/* (20250329) These four seem to be unused code. */ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, - unsigned long offset, size_t size, int direction) + unsigned long offset, size_t size, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, - unsigned long offset, size_t size, int direction) + unsigned long offset, size_t size, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } #define DMA_MAPPING_ERROR (~(dma_addr_t)0) @@ -306,24 +317,17 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev, static inline dma_addr_t _dma_map_single_attrs(struct device *dev, void *ptr, size_t size, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { - dma_addr_t dma; - - dma = linux_dma_map_phys(dev, vtophys(ptr), size); - if (!dma_mapping_error(dev, dma)) - dma_sync_single_for_device(dev, dma, size, direction); - - return (dma); + return (lkpi_dma_map_phys(dev, vtophys(ptr), size, + direction, attrs)); } static inline void _dma_unmap_single_attrs(struct device *dev, dma_addr_t dma, size_t size, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { - - dma_sync_single_for_cpu(dev, dma, size, direction); - linux_dma_unmap(dev, dma, size); + lkpi_dma_unmap(dev, dma, size, direction, attrs); } static inline size_t diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 5cf7c601d615..fe99c0ecf050 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1530,17 +1530,34 @@ linux_dma_map_phys_common(struct device *dev __unused, vm_paddr_t phys, #endif dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +lkpi_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len, + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; + dma_addr_t dma; priv = dev->dma_priv; - return (linux_dma_map_phys_common(dev, phys, len, priv->dmat)); + dma = linux_dma_map_phys_common(dev, phys, len, priv->dmat); + if (dma_mapping_error(dev, dma)) + return (dma); + + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0) + dma_sync_single_for_device(dev, dma, len, direction); + + return (dma); +} + +/* For backward compat only so we can MFC this. Remove before 15. */ +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + return (lkpi_dma_map_phys(dev, phys, len, DMA_NONE, 0)); } #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) void -linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +lkpi_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len, + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; struct linux_dma_obj *obj; @@ -1557,6 +1574,10 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); + + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0) + dma_sync_single_for_cpu(dev, dma_addr, len, direction); + bus_dmamap_unload(obj->dmat, obj->dmamap); bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); @@ -1565,11 +1586,19 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) } #else void -linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +lkpi_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len, + enum dma_data_direction direction, unsigned long attrs) { } #endif +/* For backward compat only so we can MFC this. Remove before 15. */ +void +linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +{ + lkpi_dma_unmap(dev, dma_addr, len, DMA_NONE, 0); +} + void * linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) @@ -1671,7 +1700,7 @@ linuxkpi_dma_sync(struct device *dev, dma_addr_t dma_addr, size_t size, int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; struct scatterlist *sg; @@ -1705,6 +1734,9 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, sg_dma_address(sg) = seg.ds_addr; } + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) != 0) + goto skip_sync; + switch (direction) { case DMA_BIDIRECTIONAL: bus_dmamap_sync(priv->dmat, sgl->dma_map, BUS_DMASYNC_PREWRITE); @@ -1718,6 +1750,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, default: break; } +skip_sync: DMA_PRIV_UNLOCK(priv); @@ -1727,7 +1760,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents __unused, enum dma_data_direction direction, - unsigned long attrs __unused) + unsigned long attrs) { struct linux_dma_priv *priv; @@ -1735,6 +1768,9 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, DMA_PRIV_LOCK(priv); + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) != 0) + goto skip_sync; + switch (direction) { case DMA_BIDIRECTIONAL: bus_dmamap_sync(priv->dmat, sgl->dma_map, BUS_DMASYNC_POSTREAD); @@ -1749,6 +1785,7 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, default: break; } +skip_sync: bus_dmamap_unload(priv->dmat, sgl->dma_map); bus_dmamap_destroy(priv->dmat, sgl->dma_map); From nobody Tue Jun 3 18:37:38 2025 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 4bBfb70w4Vz5y12w; Tue, 03 Jun 2025 18:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfb62y2Yz3Zsx; Tue, 03 Jun 2025 18:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSs1LVVc9/Y96GD6clgpsm7VJZ1IxvU8F1OQJ+D3W2g=; b=OXgQrxanCdmaVOYzR+cvTVt7k49AqvISXZgbljEUtSA2SePt3dJyn6bPR03GAQQtTWWJRT YLGs/PKR7UpTgi8EUcJOQicz0rAYzPvk1yO0DY6GipVWeOL5E4/aYd+5RehwlM7U4FepPV JuxOI9ggypFl1zEAgZZjWpcjSzX8me6pDuEmmuj0sDHCsJ4RgDpzlf3mSHkqF41sPpyjcj CgmYLmuMGvxWRwiRE8B0MRy668v2ruVuG4nXLUJSJ1X5LogqkaPqT1Y1WAegjXU0QgPvJ8 YF+3d5FZ1uKTDKyB/+KHSKRtOHPVDI4AmlAanKe0dAoar1R9yumUs48ondy8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSs1LVVc9/Y96GD6clgpsm7VJZ1IxvU8F1OQJ+D3W2g=; b=FH79Tduv7IiBBARQt15HQRDX7sSPxeW3hvfoqkmc1e7VU7uOvM2GTa08mEVUl0/0Uepqvs 0akpeRUQPWSYh/bBGINmYBnXJBkZLLkGJ0beBKT1XvD4eZ/Mbw65mU5VRXOqzcmaUuV5km 3z9JNo4D0HTQj3BholtzOWDFZqSdZ+qoZbHKlEYttpow0iljILS9tzSzrOySLRbylEMR8o o0xykcMn43hYrfWrKrWdnOEWCuXqy8S8FhhSVllPqfcI2pf6JjBZWffjpfWkawoCAUQ5JO DjSmLe8HZr7oCh/TnUF8zbg2WaWuKNzhRxxb4IyW8/l76roMJiEhG6zhjMvrDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975858; a=rsa-sha256; cv=none; b=V4DDzrmQTkqyetzz7I4bhHfgQ1vM0+3cK6RcvcGECCbuYwae/I5jBnmIOcHJaxYh5D//HK zByGx9MCMaV45dLr32wVxPybA9ujmyoIe9lPkPy4Odt7ZcXPbtfMTzoJPIObiCI7Bh1oL3 r37zsMvupDVFCm/le3E0wW08hyJoA2bsUpQj7HiIwR/1Yz3ng4YAmKNvfqn8qUcIZHcSiM vHvKlBU665BLoz/Lemty8aTb8z8HDUmlr6NQ+Mu50bxTRRBrgyCZh6270DUO5plVjYkNNW PB9ViPkOZX3vFRyF6zdcS/XRbNkpL+T5MbnXKX2/UtvmL3rCcKxs7Stm4oCnHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb62W5Yzqqc; Tue, 03 Jun 2025 18:37: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 553IbchJ000374; Tue, 3 Jun 2025 18:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibcj2000371; Tue, 3 Jun 2025 18:37:38 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:38 GMT Message-Id: <202506031837.553Ibcj2000371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a02180cf60a6 - main - LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a02180cf60a6a0102669b678e9c81ad9f1aa4d91 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a02180cf60a6a0102669b678e9c81ad9f1aa4d91 commit a02180cf60a6a0102669b678e9c81ad9f1aa4d91 Author: Bjoern A. Zeeb AuthorDate: 2025-04-01 14:51:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:09 +0000 LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions dma_map_resource() and dma_unmap_resource() functions are used to map and unmap of memory-mapped IO resources so they can be accessed by the device. Required by drm-kmod v5.5 to be built. While for drm-kmod 6.6-lts only amdgpu uses these in one place and the code apparently has not been exercised a lot it has been around like this for years. With changing the underlying implementations bring it into the tree; should we find errors with it they can also be fixed here. Bump __FreeBSD version to be able to detect this change. Obtained from: D30933 (by wulf) Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49625 --- UPDATING | 4 ++++ sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 ++++++++++++++ sys/sys/param.h | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 53ce5a4b3095..bee8b348f113 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,10 @@ 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".) +20250603: + LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. + Bump _FreeBSD_version to 1500045 to be able to detect this change. + 20250527: The CAM target layer userland, i.e. ctld(8), ctladm(8) and ctlstat(8), has moved to the new FreeBSD-ctl package. If you use pkgbase and you diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 09d5e4b6bc22..2d8e1196d3d3 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -214,6 +214,20 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, lkpi_dma_unmap(dev, dma_address, size, direction, 0); } +static inline dma_addr_t +dma_map_resource(struct device *dev, phys_addr_t paddr, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + return (lkpi_dma_map_phys(dev, paddr, size, direction, attrs)); +} + +static inline void +dma_unmap_resource(struct device *dev, dma_addr_t dma, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + lkpi_dma_unmap(dev, dma, size, direction, attrs); +} + static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma, size_t size, enum dma_data_direction direction) diff --git a/sys/sys/param.h b/sys/sys/param.h index 0a08d4740593..98fb0aeacef0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500044 +#define __FreeBSD_version 1500045 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Tue Jun 3 18:37:39 2025 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 4bBfb82L1Qz5y0qX; Tue, 03 Jun 2025 18:37: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 4bBfb74Bw1z3bG5; Tue, 03 Jun 2025 18:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5QaxZJ1+y1jJHoBeLiEzHQ+Iq9WLsZtTpadgfb0tNV8=; b=fgPm4ORAZi7LBK0l9LhugXIXfRbgQaG1ygaZMF29HkclPAlfZRuME3QFQh+y3b2sSm7e3K 38y0iOWn7I+9t/Bff5fFaRucOXC0E0ycHrZdHEgdJ8+jWFYgTnVMEY7kaK+faJeYG/Bqgb NSQaLWNIHrt+/XxOmBLUcRG2RSbtAiyGh2RQl1zjVuQEgc7JNf36hQSWA2kXDw1A6maFRm kA1AI4jt3IW/gcIP7u4+yXhbm82U57qxEZp0eVQ+eAOzqxdJJnuThBA66faUZiyOsWejDk lBHkKK+N8+ZHywrVUiQKhcMkSXRczdB9UOLH5arCqw3VzzogOnEDRt8xWtKRtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5QaxZJ1+y1jJHoBeLiEzHQ+Iq9WLsZtTpadgfb0tNV8=; b=PBH4DlaequLB6/K+TspQBquwkNYsiXifvs3fR9e0XFIyvD4ELnHHNo8fIyirAuVgvxl0X2 LFjaCedCazEobsoVIGD4vYHzj9ufmC8U3NVxnHyLgrIaFn3dF0ReUeXi3KaQtz5l5f+Adw s7VY2/hBaaPgiz42S+UDIeq3HeSu6j38lFsUVJ8CUHGciE9O/ymHUXFpEY040px0jTzulB /2CFkq0QC8k9Zx24LUbKnTuxjPzI8dtPVFq0CFhsY8Bby5xIET9/ksUfX6v/VVMmdmpfvU FegJ0clxCICPgaDVxbTP26aARI8Vjz0kUuluyeCQT3VND5m4w4btujx+/D/Vzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975859; a=rsa-sha256; cv=none; b=Fiev3VWv1xHaye8u1w7XRoeKqBMLbtStcI88IQQcsk2PlUfqnLxnI2NrNC0797WQ9wZSD3 my84Iu5iMiEFpd89SiPH1h4YEgwnAXLtrcrc7OWcnDtrO+NX6lmCwLpYYMGOyoZyiEEN8b bcuyD/2aegUHTBgFjfRyBrZCcrKHyGrMkEk/qcmMhLgYYC/7SYhPo4Njk99/MazdXz28mo mJknBVD07x6/5a6LWqk7tGuxvDys+C8oFMP+XebqXhmbwxmfdWkumEmn8qgxD6PwAG78C9 yUEuiP2VbsruySNu3BAULzejKh2Mzrx/V703adHj+5Xaz4EuPYhGyflGEZQ8KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb73SqZzr0p; Tue, 03 Jun 2025 18:37: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 553Ibd8G000411; Tue, 3 Jun 2025 18:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibdu5000408; Tue, 3 Jun 2025 18:37:39 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:39 GMT Message-Id: <202506031837.553Ibdu5000408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9df0d1f3d1f3 - main - LinuxKPI: 802.11: ensure bandwidth <= channel bandwidth 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9df0d1f3d1f3dd8823800210dd49e40170d5abd8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9df0d1f3d1f3dd8823800210dd49e40170d5abd8 commit 9df0d1f3d1f3dd8823800210dd49e40170d5abd8 Author: Bjoern A. Zeeb AuthorDate: 2025-04-23 23:15:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:09 +0000 LinuxKPI: 802.11: ensure bandwidth <= channel bandwidth While we could select our own channel width and station bandwidth indepedent of net80211 that is not a good idea and will lead to trouble. Make sure the station bandwidth we select does not exceed the bandwidth of the channel we are tuned into. Now that VHT160 work we may locally disable it (-vht160) and the AP may still support it but we would be on a 80Mhz channel. Or we do support VHT160 but the AP does not. Again we would be on a 80Mhz channel and not support 160Mhz. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 42d23629bc0f..197604e04490 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -522,6 +522,7 @@ static void lkpi_sta_sync_vht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_node *ni) { + enum ieee80211_sta_rx_bw bw; uint32_t width; int rx_nss; uint16_t rx_mcs_map; @@ -545,19 +546,38 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta, if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) goto skip_bw; + bw = sta->deflink.bandwidth; width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); switch (width) { + /* Deprecated. */ case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ: - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + bw = IEEE80211_STA_RX_BW_160; break; default: /* Check if we do support 160Mhz somehow after all. */ if ((sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) != 0) - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + bw = IEEE80211_STA_RX_BW_160; else - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; + bw = IEEE80211_STA_RX_BW_80; } + /* + * While we can set what is possibly supported we also need to be + * on a channel which supports that bandwidth; e.g., we can support + * VHT160 but the AP only does VHT80. + * Further ni_chan will also have filtered out what we disabled + * by configuration. + * Once net80211 channel selection is fixed for 802.11-2020 and + * VHT160 we can possibly spare ourselves the above. + */ + if (bw == IEEE80211_STA_RX_BW_160 && + !IEEE80211_IS_CHAN_VHT160(ni->ni_chan) && + !IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) + bw = IEEE80211_STA_RX_BW_80; + if (bw == IEEE80211_STA_RX_BW_80 && + !IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + bw = sta->deflink.bandwidth; + sta->deflink.bandwidth = bw; skip_bw: rx_nss = 0; From nobody Tue Jun 3 18:37:40 2025 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 4bBfb91zDWz5y19F; Tue, 03 Jun 2025 18:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfb84pnlz3bG9; Tue, 03 Jun 2025 18:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mOikNk8b2G1bdDCWFH/qqWGQwRS8nJlo1kL6Aus/ufE=; b=sCGTQkYpiXO5+fK3p1p0gDOAzZfKLedPuRbKH/y3aSr4luzBI3w5qWJEkLC4z2GkColpbG /HLCPzjVCTZ6gdhQPF0u/NjN2W425BF1xHoYmQE8YxvY0uF3IEQ7sE2HrfUd5rwlDwqEcm ueQlWhymepWbYt7T0pIcA/Nf5CWM1xmLbTbG1kX0y3omS3JGOPNwJ5W2+DMQT05/eUPSxR fXPSswBCywZ9aUlKOraunS7o9cPT/QypLykVYTCzWZCSX+qDZX8slhrKd/+x5z8obYbq6/ 9U9n8hStvUx9oR9VmkZcqoQt8j6QsUgBn/9QJZ7Op7nMuEREUfSGJO7O0Kfejg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mOikNk8b2G1bdDCWFH/qqWGQwRS8nJlo1kL6Aus/ufE=; b=ZoCzxF1nG7UasskaoY+rUSZl8UqA2xJfN2++rJxWk7lYVUl0WnPSSU6MMzFCfmO+j+JqI8 XXW+X4Ch1sBUFLccywO/Jin+KCxxTOGrPZFUQxVo3zTXZGIxG6r4d+DKJZX1GwwwDA2Gnd DgXYH0f//VooqCiEoPX/E/mkTduggQvHCWkkiP5q35nEOpIt1qw5qM7MPC1SMjufzDoThU k7hHQyiWHplaGCFWP8j01oSUgfdrh1JltygI9Gcfom9WzlKWnnNH3XrwkmLaC59wm97CL1 Qfqk2y5sOcKm/9B+qGzv5fHNPQ6076+qIYrply1msWPh3CALCp3bAdUvw9Rj0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975860; a=rsa-sha256; cv=none; b=wG0AukjtMnDQ5eXpj/YcB5lpQ5rNiZagnhQtuM0QnrWHNuf+sbWno2OWsZa8RrtlflK+EQ nPwzrWbTk4wQZVDEGtwlS8KdCM6SGp/smePYFbZ9uocwSP8iqnZ8hTIjDTQveWc03NXCPY 0oLj7cZysw8c3Ml1TnLBGa0rGTW9KpbJd4V6chJKVmlQof7JnUxRA2nF1CGIz2rVFDDXBH vBI15oID9HHJOXFcOxuMH+wAIMGaXHgXdgzo6dleZGWKEznIuRUUUhpGrvvqWNf4NgAH5n if0v89mHi2ZdXb8MCwvF6U0XClIYYLAOGMhwlvVx2IdhpjE3AjSj3dutD9Wgfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb84B0yzqnK; Tue, 03 Jun 2025 18:37: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 553IbePM000448; Tue, 3 Jun 2025 18:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IbeDB000445; Tue, 3 Jun 2025 18:37:40 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:40 GMT Message-Id: <202506031837.553IbeDB000445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 02382a0ac822 - main - LinuxKPI: 802.11: switch to m_get3() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02382a0ac822b88e17d86643e27964eba18479e0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=02382a0ac822b88e17d86643e27964eba18479e0 commit 02382a0ac822b88e17d86643e27964eba18479e0 Author: Bjoern A. Zeeb AuthorDate: 2025-04-30 22:06:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:09 +0000 LinuxKPI: 802.11: switch to m_get3() Start using m_get3() instead of m_get2() as we may get up to 11K frames and m_get2() only gives us up to MJUMPAGESIZE (8K). Sponsored by: The FreeBSD Foundation MFC after: 3 days Discovered by: adrian with rtwn(4) [see D50049]. --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 197604e04490..e92656ed41c5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6810,7 +6810,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, * For now do the data copy; we can later improve things. Might even * have an mbuf backing the skb data then? */ - m = m_get2(skb->len, M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get3(skb->len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { counter_u64_add(ic->ic_ierrors, 1); goto err; From nobody Tue Jun 3 18:37:42 2025 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 4bBfbC15H2z5y1F5; Tue, 03 Jun 2025 18:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfbB6shsz3bGX; Tue, 03 Jun 2025 18:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WPDODTclQ7AQguijT609US4jQ4Su/f/YdqtzsmsRPp4=; b=oK6fz61I9dz3WNfnmoi7lve9rKe8LkvNyKb3Ik044GpraG8JzE0wRoFWzQpfwocCYlP/Uy 4rmKuN0nHXOAS1K5hBlZmQUPAaV2AnXnWBMfE0QskREtRW5IKCDOqdJkfmdyTUe994efzB 81rhOWPY8EF413G4Mxj8+mvdSGLjnNcH4XbLvmcPICn/2ryXVYXF3cRoKvSuog30vkmYq/ dktHePrjEK8dV8otP0/gJ9su0lRbWaWcasO4MSD7FBZPdYz5jJGaGua9qgt3xeCbhXcIKe wu6FYCQq1U0d4woqeTz4sAV1B1Y/BnxgDQsg3GkDSoK5B0fopDZTYh2VToh3dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WPDODTclQ7AQguijT609US4jQ4Su/f/YdqtzsmsRPp4=; b=VWN7JJlkqFOBYiJgALpJPM+rq57LlMsxy8uVFIy4NBHDlYXamjSHrA/2Ng1yBoWBDlRl6l ovr3W36loyVSI34uDKhyZiATYaVXISrwsphyUnpnpj8wav9DMY5djXPZhojpvhcv4urwax 4MKoZnnB8GdwzW6V2bRUmdjXY/dfvwN2z6Aku/lN1WEe+SXiuK2hFxPLKKZC6d9d+Oa1dL sTGB74A2UiCuRBnUO3UTGcXHy+ciJ4bSuc99rxgLb9OBcFeC/tQCtL/FGZivL08DHVeu/8 huiYv0r4ZjDqK4TjH6WjgGS3FpeIhxD3nam2d6Sn7NsrQq7Z3fbcmwgUQHwLwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975863; a=rsa-sha256; cv=none; b=MDHE1zEAE0tsrY7efSBfPVbCV1P2lkUO/ujDrAedoICfuynS80W6+ugqouSlbxFgGhHBr4 uoIvZJ9ci9htz81bdk0gLZSlznEteNxoi7v40Prdu7Dzq/xxwEJJfEh57saLyvm+AbY4ZL t9HtbFYI1KdiHXIsmj4cTY/BL9wshNjGYfEZYVChbCrIQ91EuoaY9C5ZTfnRbP9QbGLAsD JSkcHg4Jvb3ejg78rGvSysKwOy1D/NfFsiQEhP8bGOgx8X2wy7IcLy9dLgwYfwzz+RnDUt Jv4Gjv8ohs6VFIZtTb3uu5qXEx4k4fYY//OSJWuI74Z0obvlNnCf0ITMd2VaCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfbB5yqHzqWV; Tue, 03 Jun 2025 18:37:42 +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 553IbgrS000532; Tue, 3 Jun 2025 18:37:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IbgGu000529; Tue, 3 Jun 2025 18:37:42 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:42 GMT Message-Id: <202506031837.553IbgGu000529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4b6b9c1368b3 - main - LinuxKPI: netdev features style, annotate, and add %b decoding mask 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b6b9c1368b346f7093153d14e7931403ac3202d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4b6b9c1368b346f7093153d14e7931403ac3202d commit 4b6b9c1368b346f7093153d14e7931403ac3202d Author: Bjoern A. Zeeb AuthorDate: 2025-05-10 01:41:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +0000 LinuxKPI: netdev features style, annotate, and add %b decoding mask Start to sort through the netdevice features to match them with FreeBSD. Annotate them a bit more verbose though the names are pretty telling already. While here adjust style(9) as well. Lastly add the bit definitions for use with printf(9) %b as names read easier than bitmasks. We will use that in LinuxKPI 802.11. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- .../common/include/linux/netdev_features.h | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/netdev_features.h b/sys/compat/linuxkpi/common/include/linux/netdev_features.h index 51d2586e8aac..fae82776b071 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdev_features.h +++ b/sys/compat/linuxkpi/common/include/linux/netdev_features.h @@ -33,16 +33,20 @@ typedef uint32_t netdev_features_t; -#define NETIF_F_HIGHDMA BIT(0) -#define NETIF_F_SG BIT(1) -#define NETIF_F_IP_CSUM BIT(2) -#define NETIF_F_IPV6_CSUM BIT(3) -#define NETIF_F_TSO BIT(4) -#define NETIF_F_TSO6 BIT(5) -#define NETIF_F_RXCSUM BIT(6) -#define NETIF_F_HW_CSUM BIT(7) -#define NETIF_F_HW_TC BIT(8) +#define NETIF_F_HIGHDMA BIT(0) /* Can DMA to high memory. */ +#define NETIF_F_SG BIT(1) /* Can do scatter/gather I/O. */ +#define NETIF_F_IP_CSUM BIT(2) /* Can csum TCP/UDP on IPv4. */ +#define NETIF_F_IPV6_CSUM BIT(3) /* Can csum TCP/UDP on IPv6. */ +#define NETIF_F_TSO BIT(4) /* Can do TCP over IPv4 segmentation. */ +#define NETIF_F_TSO6 BIT(5) /* Can do TCP over IPv6 segmentation. */ +#define NETIF_F_RXCSUM BIT(6) /* Can do receive csum offload. */ +#define NETIF_F_HW_CSUM BIT(7) /* Can csum packets (which?). */ +#define NETIF_F_HW_TC BIT(8) /* Can offload TC. */ -#define NETIF_F_CSUM_MASK (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM) +#define NETIF_F_CSUM_MASK (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM) + +#define NETIF_F_BITS \ + "\20\1HIGHDMA\2SG\3IP_CSUM\4IPV6_CSUM\5TSO\6TSO6\7RXCSUM" \ + "\10HW_CSUM\11HW_TC" #endif /* _LINUXKPI_LINUX_NETDEV_FEATURES_H_ */ From nobody Tue Jun 3 18:37:41 2025 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 4bBfbB2RSpz5y0kK; Tue, 03 Jun 2025 18:37: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 4bBfb959G5z3bNH; Tue, 03 Jun 2025 18:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNhB26176RMGX6Sr+xP4EO8GZpXOv/HR4sFRvv9AURY=; b=gW+D3EklYK26dJuWaLT/hmojBL+5ek7zzklGkuriwu5ph+l0alrBK7/kMZJIwaFo+4Ttit fLqJkKSY/KmM9JTOAYOKUNnDAPwhER8VRkGebTV7p4dgaiBZKPvbFPii3VnI8nkIMpaqar jbhte9VXWfLkJuBA9rNszHyHBqZ85fqrcnxCQ1hfr3/hIpxMAFfjWdC1RqsbCASOlKvlDy endMV7JGzJfnmSmj+ahlUEEv0OGrvWZ78joZTVkRFmQZup7IybtRqgXApRBjm8IkJmQb49 jNBY8yQsOFhDfQvkwJMnKJeIFhYB0z9NezWqmncj23GNoTUNiOY6/VP4dZEGuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNhB26176RMGX6Sr+xP4EO8GZpXOv/HR4sFRvv9AURY=; b=yT1DN1Oo/XeK7+ojK656agHVSYT8CBx7yHzrt0DFxccvEidHWzK34VNovrNXW4cZxo6nTl 0xNSk5binHIZIyKk+6wAvtghlMrvv78945R+obcztkonjly6cjMFOUsKVVtoW0DznaFvm8 6+uM5MTE5egGVG2zxy/zQV43Wfgyhh/KczA5zZgU3IOZuT36Dwl4t13aqR764UN2KUDEYc abGQhiAt6jsyad4w5IqRj4QMd4bCpUNbY9eYuFKsa2kSMJ5Za3MGAYi3PE8fN5z9ksDXgD /VrKhEajP+ATNddllnKN9z3EcGSfTjQlamFaxyVTqwwE9r3qEO00eMz2hV0h8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975861; a=rsa-sha256; cv=none; b=QKHXSXtCy4q6JmKA0l4DvXvohisvKJ2pQUMAE1P31t03iIRAik8nE6VEz2TWUZsDEQ10Ju /+Vcj5qyB8fTckyd4OOpCEFlSdl90TcRtVLJAfB+W6zZ05zB/7/36ygA2//VcHC+rzYlbo XzuCJ+wi8ULMelh010db2OUiyy0O8YRTiDyXkVZr+9tZImR1ud2SuTLlsvTSMDLeh4fomK wTNlG6BjHTwlfzdcVhvssXzORUym/OZNhwT2rMAhYv7hTRnROrtYYBpAk5r14g5X5gg9JR gUjjJjAhgOGgkiL34+BI8tId7DiA0M+kc7p5yx1142oy00FQfpZcRDCkrjNd1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb94kjkzqWT; Tue, 03 Jun 2025 18:37: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 553IbfYk000492; Tue, 3 Jun 2025 18:37:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibfxg000489; Tue, 3 Jun 2025 18:37:41 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:41 GMT Message-Id: <202506031837.553Ibfxg000489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 36ca21722c27 - main - LinuxKPI: skbuff: make csum_unfold return __wsum 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36ca21722c2700e00e41444a29aeabf246eea90d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=36ca21722c2700e00e41444a29aeabf246eea90d commit 36ca21722c2700e00e41444a29aeabf246eea90d Author: Bjoern A. Zeeb AuthorDate: 2025-05-10 01:39:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +0000 LinuxKPI: skbuff: make csum_unfold return __wsum Given the internal field now stores a __wsum csum (after we added the type) also make sure csum_unfold() returns a __wsum. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 59481c7db234 --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 8fe6bf158bc6..422bf99929c2 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1046,7 +1046,7 @@ skb_orphan(struct sk_buff *skb) SKB_TODO(); } -static inline __sum16 +static inline __wsum csum_unfold(__sum16 sum) { return (sum); From nobody Tue Jun 3 18:37:43 2025 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 4bBfbD5Xv5z5y0qg; Tue, 03 Jun 2025 18:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfbD03phz3bZQ; Tue, 03 Jun 2025 18:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41SdlEIKzSLrfJLguaPtzHYRuZvC8ujNu/u8rz096FU=; b=f9AVzjzHSkr92e2P8dFpU5kgWZRpHAmdnwcWAUIUqZCfJpE3w0EuSrMRtv7QFS3ZIoi4fm 8nEw6ybyEbkQVgC7Vi76E2YUuE5v8lGn2wEe4rHe7d2hWz3aPOIGKvnNim9+j5s/lE1KGR 5ODb/8oGQ4vIQb+eTWyqYGlNnBsNOmDiahE8lnd7I7xdFwRcoRXHJFmneXAgd2D/bYd6dp yMz3ETyLsBfba8dgRvaW0RZtx7fPmnck0YaQLXmubfR8qRpAvCGJPjt3A1yQIDILGeBeHj PXOFWFoR4pCvcr3pVapB590JVen7ySu93DYarhV9cbil8Isf7IieKyPZjRhRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41SdlEIKzSLrfJLguaPtzHYRuZvC8ujNu/u8rz096FU=; b=PN2p3msy3YAEmXbYaDEh5nUKrHXpPIa9FwI2CAgItz72ewBr2wwBrKi97fAjQFIscLgshr Mqg+NBTgyIAxLnToyC9D4cbz1ur5Lh0gIFWYezjo1/dNPe6KzclUaqaumWBGBlADimS6qb 1E2WQEGE6nRVRLLm2czh9ig2MJS/ZzWpPQrOIKunf4q7hRDuQs5v3u8uJYYER8o+X9Q5ZB 3Gq7TgjeMvd3SdqeZ6nDxRiTy6emUcKlNOlKcpXqNYOvxmBFJJmasGPOeU8RU8vcqkPMM/ B+JuSRaxK+VtFLtZ5nkzL7lSo6U8oAv7Eyk/X9dboZJ99NDIxaLqdR8DuMYMAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975864; a=rsa-sha256; cv=none; b=AInDwR7EWGm8xs21FZaHZknHfY+PfFJ3kFon60l4HNHwx2ymx5hwHDM+67JG29XPcH+3Ak xnUAPyb52yJZBEufJqVQghb5uBFNK9v3HPT08SGAGz3M2H4rH0EzqRsGZqV+jlnoa9F+gc eQNr9oldRbGr3pm/14WMNz/q5BPUFzKsrsmMlyHz99PPeBi7rK9qwj4swADPcPizNwTPmj Op92XiJH92QutnMD1CayI14tYbROiRQ6Uo3N01eIrntGr2ACi2h0wEnNsvDF+g/yAsH7MD bVslvJNC0DXSu8JzcsapVSpwn4pHvjn3WufvaQg5akWNWzXJFwX2vJ8FLGoPfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfbC6d21zqZC; Tue, 03 Jun 2025 18:37:43 +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 553IbhGF000568; Tue, 3 Jun 2025 18:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IbhLv000565; Tue, 3 Jun 2025 18:37:43 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:43 GMT Message-Id: <202506031837.553IbhLv000565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 34c150cc5fdb - main - LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34c150cc5fdb3c599bb6ff14eb56afee00c45258 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=34c150cc5fdb3c599bb6ff14eb56afee00c45258 commit 34c150cc5fdb3c599bb6ff14eb56afee00c45258 Author: Bjoern A. Zeeb AuthorDate: 2025-05-14 00:30:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +0000 LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function We set rx_nss to at least 1 and the sync functions for HT and VHT are careful not to set it to 0. Rather than relying on that and any possible future call to lkpi_sta_sync_from_ni() migrate the MAX() call into the sync function after each standard level went through to make sure that at the end we at least have rx_nss set to 1. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e92656ed41c5..d424bb6c8d44 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -619,6 +619,13 @@ lkpi_sta_sync_from_ni(struct ieee80211_hw *hw, struct ieee80211_vif *vif, #if defined(LKPI_80211_VHT) lkpi_sta_sync_vht_from_ni(vif, sta, ni); #endif + + /* + * Ensure rx_nss is at least 1 as otherwise drivers run into + * unexpected problems. + */ + sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); + /* * We are also called from node allocation which net80211 * can do even on `ifconfig down`; in that case the chanctx @@ -2938,7 +2945,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } - sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); IMPROVE("Is this the right spot, has net80211 done all updates already?"); lkpi_sta_sync_from_ni(hw, vif, sta, ni, true); From nobody Tue Jun 3 18:37:45 2025 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 4bBfbF32QQz5y1Bb; Tue, 03 Jun 2025 18:37: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 4bBfbF146Vz3bH9; Tue, 03 Jun 2025 18:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL5F2AdF7sbTMN+KOyR3GVo8BcYCOnJjK2lp8VzZS8o=; b=SlrHusNnOGaKv1YUt08+5fn5M4biXQpZzkmsjym1v2aQFgLsHl2xUyv3gwd4556O6uVlpo OsiozJHWQyNw2Kvp5tr5bnw9Ibfdj2mVZpwevJhvnFzKq9bA0xj1ig81dZln1rkeEmSrZ3 18w8XoUAvMarHfpGzgYWbuFYGI9DeYVL6V39zlJjsEgDH02BllZmXf5YqzOysqbuM9aj2+ du0TvkRN1VZK/6YKv4dt01fK1AQYDV3PAksLct72LDPsYQbFC6tiz5N1D7BmhBHOfx+Iau TS2j2b14gCtHlq+QB43C788h8+Bl13FjUvLkYJKg3WEGOOhdiEsmdd8DLC3kZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL5F2AdF7sbTMN+KOyR3GVo8BcYCOnJjK2lp8VzZS8o=; b=gwQYabDcxnj0uFPo6UInD1Rc7vr7s2MxGTpcoznjY3jBQJUXwQsCcJpJOpU67S4BcvaUax E7HiWjfJWeHNokh7QA3lDzjEBbcVx+Kzq6we1ncNKFZ22eJzaw2dpUq9an3gM8ZHeu6bKT 6zQ2vTzt7EO6Qch+8fyog3YN4/mxwiruGGAb5rN8x3vw66dF+jL0A5VZ9whcw1zGPApzKh R0Jk08FW7At7zMWN7yiMRdGcT2ZQkD3o3oq6B9Rj5iiprtMghIVopOPWNKMGPLWepBaDpp a0cudxTX6aMZytfVWoA+j2yte/+j33lgFoBTr9EvLRODqgHk45+WS6YqzgLnug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975865; a=rsa-sha256; cv=none; b=kvWq7QhIC60tL1CTtvToxWuNHflX2LzEcMCiExqFH7zNZm7I4LUHNev+kT/WIojpcMfD5Q o88D4BMmD+MqZVjkyKCI6/u7lHPXy0c8Jjs4oghHfjHWpUlTxdc55RDQZ1dE4PLnFfGhvM xeAN1TBJnmopa4ssS0/9Pc7vQI96NJmqG5jrUPIokoNEkGfUZOTvCBUNlAs7r6QuE1llG1 u7J9v3f+GsGMtdB7oQrVmRrWS1YbTJpiwwp2FEetk0eO3suxtHu4zIEa6qJdyjMwJp9fN0 XpxaWtCKfnAVqQ9IU7INU8Wcm+gjvU4z673a4cqmaK0mjwPogxrZT81hGIkGZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfbF0WqWzr0q; Tue, 03 Jun 2025 18:37: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 553IbjRx000604; Tue, 3 Jun 2025 18:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibjgm000601; Tue, 3 Jun 2025 18:37:45 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:45 GMT Message-Id: <202506031837.553Ibjgm000601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d87ee937ed85 - main - LinuxKPI: 802.11: use macros for locking 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d87ee937ed852cd22eac808bc8fcf7b0e34c9ec1 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d87ee937ed852cd22eac808bc8fcf7b0e34c9ec1 commit d87ee937ed852cd22eac808bc8fcf7b0e34c9ec1 Author: Bjoern A. Zeeb AuthorDate: 2025-05-25 16:44:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +0000 LinuxKPI: 802.11: use macros for locking Rather than using inline functions use macros so we know where we are taking the lock in the code rather than only recording the inline function location. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 1e4f917a2796..7849c77062dc 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1408,20 +1408,11 @@ wiphy_dev(struct wiphy *wiphy) return (wiphy->dev); } -#define wiphy_dereference(wiphy, p) \ - rcu_dereference_check(p, lockdep_is_held(&(wiphy)->mtx)) +#define wiphy_dereference(_w, p) \ + rcu_dereference_check(p, lockdep_is_held(&(_w)->mtx)) -static __inline void -wiphy_lock(struct wiphy *wiphy) -{ - mutex_lock(&wiphy->mtx); -} - -static __inline void -wiphy_unlock(struct wiphy *wiphy) -{ - mutex_unlock(&wiphy->mtx); -} +#define wiphy_lock(_w) mutex_lock(&(_w)->mtx) +#define wiphy_unlock(_w) mutex_unlock(&(_w)->mtx) static __inline void wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, From nobody Tue Jun 3 18:37:46 2025 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 4bBfbG5kXhz5y1Bh; Tue, 03 Jun 2025 18:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfbG2wx8z3bbB; Tue, 03 Jun 2025 18:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7iCoNpkRGyi9z1/BJZq/sFfKd2cRNx9KnReFy+218I=; b=lEzKUyX5LiBH9sHvXNlvua4fSZem2+WE7+PtyBwi1fpaTxCIMJGkkPZdCmWuYdyxHklSFy dECrfMBBrAwPllA7umvQMMTtZ9aI9Sjh8BKPt5/0gdyoPbLiwEw0W2jcyEi7LNcUiTrVas reeZURLtfdZ47zGoEP6OWQQ1GIgkZB5y2z1/DvqWXrG3pU2VixPGGb8jC7m+bxuWS7fVdW kXf59/rQ6fSErYynQx9NOy3YFifAASBuR8ns4V7S40JQsSLGmkR7FjXWEOFK/BxGKwRMxw uMxdlflLcjPNA9DADdFohTehASswta7YR/jQT5gydZBNRIvcDD419Jty/z/Kaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7iCoNpkRGyi9z1/BJZq/sFfKd2cRNx9KnReFy+218I=; b=q8APrYrbheG2keMmvBsVnnvQM++h54nDYEQB98UGvCIz7R4ho/KUxQp0YCI7ZVc6FwjVMz b99p33VM1chDuda+in7Nlycm8Mvstbd3YkE/LOJjgZQibhAFHzDNiCqfEvVKsPA04YCQDU 9nK4Aj3byzoDM1Z7nX8nLQMSiS2AbBJkx+DWLelYNFlufd+HEMdFp+4hbMe9zlWF4YL8BK IkdvlbeJp45v8wRvsVduj8xNLufvjFS9InWubT5WVxd7Bv868YYc+/b86QRDJh+IHhHwPL R2wMxQqU/pT3yc3/pI5o5aiOoNeuXvJe6mQ8heH9zqbVpKyR1TR33tP+R4ORyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975866; a=rsa-sha256; cv=none; b=gJlKM9P3iuPmvdTtvRfwTFB+2N/QZofaTbBNnFcEJCSto5Jf1c/GlNPNZzaBZAnM6bGDt8 ajPBXXI4vYO2NiIQAp8Or0dA6FGMyUe969EDCm3t8ldY6ohTKP6Nc/W/3QbLB9Uc5kpczN HEDDe3UINZVAtYfyi1WzT2dTwKek0FQg8IHimw0sUIuLWXBAsX6dkH3OHi5xbt8oTnlBXe 0J+qxOiFeqTm/oeApgRyyk2f+sI3zw2Xmvw3Ztw+CIO42DWByyo8vt/93grdk17sRTtybS TsmHKHper0Jgd4BQxNpGUAdV0iea57nxW8GlbJcuErxbm947cJbZWt5e0uLL2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfbG1W2gzqkk; Tue, 03 Jun 2025 18:37:46 +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 553Ibk3h000641; Tue, 3 Jun 2025 18:37:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibkvo000638; Tue, 3 Jun 2025 18:37:46 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:46 GMT Message-Id: <202506031837.553Ibkvo000638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 84c5998ccb0b - main - LinuxKPI: skbuff: add dummy skb_copy_header() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84c5998ccb0b3e8a401d1f2b5a32649e88847d63 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=84c5998ccb0b3e8a401d1f2b5a32649e88847d63 commit 84c5998ccb0b3e8a401d1f2b5a32649e88847d63 Author: Bjoern A. Zeeb AuthorDate: 2024-07-29 16:09:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +0000 LinuxKPI: skbuff: add dummy skb_copy_header() There's one case which needs skb_copy_header(); add a dummy function for now until we get to the code which uses it to test an implementation. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 422bf99929c2..c8ad90281e34 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1001,6 +1001,13 @@ skb_get_queue_mapping(struct sk_buff *skb) return (skb->qmap); } +static inline void +skb_copy_header(struct sk_buff *to, const struct sk_buff *from) +{ + SKB_TRACE2(to, from); + SKB_TODO(); +} + static inline bool skb_header_cloned(struct sk_buff *skb) { From nobody Tue Jun 3 18:37:47 2025 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 4bBfbH5bmlz5y0t3; Tue, 03 Jun 2025 18:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfbH37vBz3bgX; Tue, 03 Jun 2025 18:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55rJfN3uxG8ZrY4aU6TADMJt+Vk7JcxojgsN7OsiMWw=; b=HTZW0mvjfMYWnoDORDEbdWAvltEPKtYiHyZOa/B1IASO7COknXO8cI6pfRT+4gLSfW6u/R GEFXFd/KHyZFVm+hR3QIIfttxYdJhjnCNy1DHW9KTN7ePHQxm7uwy0RwLScgajoEpFxOP6 SlHr3lzJ2wDITgsDP4bP6S9/lfik6fBuiuaslLXxztGyoD4+UlRcRobwLN6gouhQPotdE2 GrnM7Wu42GIqsn318uyG2zelQvRahtlb6ZCIdjsz2Pe1ulQ9qhUs+UvDnqT3H2behbb5kF cZ7tPBYkAhf5lEmm1rS9XHyv6EgsRaoHIqUGN8+3gWNRHDEI+34+1O7KRmfFbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55rJfN3uxG8ZrY4aU6TADMJt+Vk7JcxojgsN7OsiMWw=; b=G+mD+4PCbevP6EBDierO0sAkq+2r8D/orXgc4R6cpzTxEgoFJ7BM8uRO3Nue3YbHQUnZdx Q3avIw3J9H5BfFGDpkqFZ+WmcJtc7oEo1LD8hvqh8rCt12tqKx1k1XqZvViOwqQkh7FXqi B9T2myCH8ptVqq65AuWP3OvsIOPZ6mlvbmPBN5n0NwYVNxDcmc2GpqK6/fthMt13zrpKHu X9HXTC3RhAIDQBrp5CCAIO2sD34yuckvOgIkxNApikJ98Ccl2TnaqeYXh+cbxgHjAfxYyz RDAMJdKGTFPFAjkyycKCCwwnTzgREq1GFKsfokGeKQeaScFxpSSN1Hqx4Ig9cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975867; a=rsa-sha256; cv=none; b=HjASz+H3ikOuYdIo47Y5MO2PdBGxmHDMZHEYLopajUSJKtH+uCjT05CNh4Bo9Idf1Um0Kz jK9QVzRZsv09XmKlteBuXsNyD3d8fgLheBzygZwRTPzuykIwXAR21f0Vs4R9amnvl3ESFv Tc0L5gnPi6LvRBHeKwxOrM4cQOsvPZ3h/JsGI+Bl3WZe1ElpBJdfPBzKJc4+TB4ox7Cdxd 94+sKmF3JcAKRDQpEwDn/CeTKdMig0+lHIACHE9OEwl7AXuCtgT5JFhEWrQA6BJ2wp+yDG cDQT+iBdgSfe1gKf5OghqsTjHAGfNR2q77xSApuxmE/LvOCQkTsp6aTB10pZXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfbH2gJszqCw; Tue, 03 Jun 2025 18:37:47 +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 553Iblwt000683; Tue, 3 Jun 2025 18:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IblJ4000680; Tue, 3 Jun 2025 18:37:47 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:47 GMT Message-Id: <202506031837.553IblJ4000680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9cac7351868d - main - LinuxKPI: 802.11: add ieee80211_purge_tx_queue() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9cac7351868d0e896a648ffe354b001ced55acfa Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9cac7351868d0e896a648ffe354b001ced55acfa commit 9cac7351868d0e896a648ffe354b001ced55acfa Author: Bjoern A. Zeeb AuthorDate: 2025-05-26 00:31:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:11 +0000 LinuxKPI: 802.11: add ieee80211_purge_tx_queue() Add ieee80211_purge_tx_queue() dummy function needed by rtw88 SDIO. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index f8eb180d63a1..6ce6a6384c12 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2025 The FreeBSD Foundation - * Copyright (c) 2020-2022 Bjoern A. Zeeb + * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -1454,6 +1454,13 @@ ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, linuxkpi_ieee80211_handle_wake_tx_queue(hw, txq); } +static inline void +ieee80211_purge_tx_queue(struct ieee80211_hw *hw, + struct sk_buff_head *skbs) +{ + TODO(); +} + /* -------------------------------------------------------------------------- */ static __inline uint8_t From nobody Tue Jun 3 18:46:00 2025 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 4bBfmn10l6z5y1Mk; Tue, 03 Jun 2025 18:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfmn01hgz3njH; Tue, 03 Jun 2025 18:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748976361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rDhYOSnrz6Bh2y+68q0U8ECSzCZ475WwbTpndkRSXCE=; b=t3otzvGctKD65TLjT62Hxnp32HuSbI4zDAPpEvznogIMKkZoEdyRGJuUI4LRLIGHAYABFN POLIbACHjqMZSeu4RdEMcqWR80TlW4TclgF2gMJIcbggfLq4VFV5YC+XmHFY83EuwpR2rb I2Tq6neRmV2qCeM54TUF4ITzmnkuCoWACsksV6k9a6c0+zkTFFx5kyzigGDfol38QY6fDv r+DvxqaEwSgnGcOa2U2QxVgOIiejqokGCwAiibmA0dKBCAP4P5cUmURfVUlgR3al1SxW/N D2+oTqj3Ba6/LsXuWwHhZ1zSYiZ24QulkC0MVbxM+/S52fNvf877J4AKAjkZMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748976361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rDhYOSnrz6Bh2y+68q0U8ECSzCZ475WwbTpndkRSXCE=; b=F90QjDy08HjpmUJoGYRdm0KMRy0w0GoNrbD3l0rL8DaFNUp4Udh0q0bC1E7o8RBBYSYqj0 xQotOg9e/mOlmSZsf0eaJqut/7b6BLOKzVJgvUPyJlJij5sPLj7Lh7eh3GzCdIfpzRblkT ZFGyRjHoonjRbOTm8vAsCs950RJ3ttKtmntK8kojdVaWVKqRDIkjgYyd0tVupc6gtOGmi/ keqBFApvrdIWXFoUTwxmEC0NILRMqQheUvyHsufXYeXjAH6i3Fe50w8Hff1zNHGyfPF33q OyTq8x8GFfn/YPPP/BfU5zcQL7yISbmzwW13WGAgP3d/nUMO8Nzci2JuLxu+zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748976361; a=rsa-sha256; cv=none; b=DawtW33TGev8oUM7MFQL1jDbNlxn/I3gxfANm3RDyPUUmzMDqZBB5O5qIRtlltWwc3ubl3 n72I+0EEuYDxDqX7x5WOcf9dLwywiuK2e10FfLULDTrGEl4FR6vWHszwL1c3H4RzMdRZ9O ZFmHOYcPnxTQeYaATQpt/ClJ3fwJYGNgnSm1lRJO0PHRQmlWUDZBjJ2JzIClutyARyGsuZ t1xdYkXMQbcrsOPKpxXZ4JYSYf6gOH98FUXu7I4Vo8rMYZ+NX0+/hea8mQSwK2Nv5FU0V/ pe7jvcwXBJWv3y29S1kWhBa4KnbnJrkkqcwP2G0h8k4F/qObSRdP+9CTc9QRkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfmm6YphzrDX; Tue, 03 Jun 2025 18:46:00 +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 553Ik0QO019229; Tue, 3 Jun 2025 18:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ik0KT019226; Tue, 3 Jun 2025 18:46:00 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:46:00 GMT Message-Id: <202506031846.553Ik0KT019226@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: e578e6507c00 - main - linuxkpi: Improve LKPI_80211_TRACE_MO message 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: e578e6507c005a883354cc14837eb2e6e3f653d1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e578e6507c005a883354cc14837eb2e6e3f653d1 commit e578e6507c005a883354cc14837eb2e6e3f653d1 Author: Ed Maste AuthorDate: 2025-06-03 14:09:57 +0000 Commit: Ed Maste CommitDate: 2025-06-03 18:45:35 +0000 linuxkpi: Improve LKPI_80211_TRACE_MO message The message used to have a prefix of the function and line, followed by `:_` and the supplied message. Commit 3206587a20de ("LinuxKPI: 802.11: improve scan handling") changed the prefix to add the CPU, tid, and ticks. `_` and the caller-supplied message were joined to the ticks value, resulting in a somewhat odd message. Instead use `: ` to separate them. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50667 --- sys/compat/linuxkpi/common/src/linux_80211_macops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index b7e232da48b0..78b2120f2d8c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -40,7 +40,7 @@ #ifdef LINUXKPI_DEBUG_80211 #define LKPI_80211_TRACE_MO(fmt, ...) \ if (linuxkpi_debug_80211 & D80211_TRACE_MO) \ - printf("LKPI_80211_TRACE_MO %s:%d: %d %d %lu_" fmt "\n", \ + printf("LKPI_80211_TRACE_MO %s:%d: %d %d %lu: " fmt "\n", \ __func__, __LINE__, curcpu, curthread->td_tid, \ jiffies, __VA_ARGS__) #else From nobody Tue Jun 3 19:24:04 2025 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 4bBgcj0tJSz5y3Vq; Tue, 03 Jun 2025 19:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBgcj0QZlz4Nyy; Tue, 03 Jun 2025 19:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748978645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mARqf7kCyb/fC+8P2QZ3oTSCYsejs8IRfuGJCnNjJEE=; b=cEWnxCeLx8FBmA/Ty/pZO0Xzh97zaPZ6WUbTocYdOM5P+pfdjEP10KOlE2yH940ulLYTE1 7yZ9Qf53btwgs2d2eT+H/hRg/0Qk6kKraqZuRO1CNkm3lAMRuxh2JCczz/MNMmuot+1n4B SSac8BgFMDSaW9X+7BZRFLkOrvoK0idp794OloHPP4KJAC29haY5wGo5zko8hcRDl44Q1v pI06mGYJcIx2dN+oT/BTVz97mFsOdTIXuHwlmHbXb73ovg9lETzdLR4TABb/mwKakJ844v aUYVYW8wdGd9szeb2m523mds7+0S9VSIUPa9uD4z2XfpTh50qdSxP+5PcVBGpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748978645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mARqf7kCyb/fC+8P2QZ3oTSCYsejs8IRfuGJCnNjJEE=; b=JCDpiUw/okhkUwAwsWcVJnVN+nBPV7sZuCyRUmXaqzwI/coMkFeAHmx9ob1x6q0SLboXQO TrniYAHEwd39otVgH4M+ojWHkpH3VJk4XgbaX0QmQ8B1IMoREJaRuaSm65KdPAZiCrmDHW l7Gg7blKeEo0u1r7wW9a0SMFrBrjxFfMIX9wtrOH7zEFU6NARRac5kRldNpvH4CdCqnOyN oa+405V7IqaTu7/BOO2P5J9jD2uc/SUdveZrRTd55rPfkEoiBofoZaHjs8WpD6ulh+aY2J 7E94jYEQ8tmxz/3RVKbs/zHxppCQ/bgbmGS5y/Y7pkZimNyOdoHLVtqaYsQK+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748978645; a=rsa-sha256; cv=none; b=lvOAQUefjAgLiYWn2yLnnlUz0EU2slaMmat6/sHZe1dhAR+LFIPc+wNDWtjH0YA+lPvSBl nbgKAmlnT2v2fjUeferTRGqpWWGpVLMnmy4VlhbCusep4k0AGazQdfeoVbftYgPDXhx1yw oLLNOtJQTHg/BpaGZNCsUUH5imcynPlUYO1uGorrVzR1aQsS9jkJrcKlKnuQ6iVrLSb0uK 3JfPIf4pbTrXtteccWq9UKUcU5LaLplADpuVPyTDr+oNmSVHo2RAj+qcIo9dmAeVL8VMlO pkTDtJfNDe/wWi+Xy5i8/7x1muZ9quldCzyHBFaHQrCd5SGwtSMQAz/odblZxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBgcj005Qzrrf; Tue, 03 Jun 2025 19:24:04 +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 553JO4ua093458; Tue, 3 Jun 2025 19:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553JO4SF093455; Tue, 3 Jun 2025 19:24:04 GMT (envelope-from git) Date: Tue, 3 Jun 2025 19:24:04 GMT Message-Id: <202506031924.553JO4SF093455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 08bc00977348 - main - if_bridge.4: clarify how if_bridge assigns a MAC address 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: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08bc0097734824ff436769a95569e32575b51da3 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=08bc0097734824ff436769a95569e32575b51da3 commit 08bc0097734824ff436769a95569e32575b51da3 Author: Maxim Konovalov AuthorDate: 2025-06-03 19:19:59 +0000 Commit: Maxim Konovalov CommitDate: 2025-06-03 19:23:36 +0000 if_bridge.4: clarify how if_bridge assigns a MAC address PR: 283400 MFC after: 1 week --- share/man/man4/bridge.4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 45dea82325bc..7ce734ae87eb 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 13, 2025 +.Dd May 28, 2025 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -79,10 +79,12 @@ command or using the variable in .Xr rc.conf 5 . .Pp -The +When it is created, the .Nm -interface randomly chooses a link (MAC) address in the range reserved for -locally administered addresses when it is created. +interface gets assigned a link (MAC) address in the range of universally +administered addresses reserved for the FreeBSD Foundation by hashing +the host UUID, jail name, and the interface name. +If this fails, a random, locally administered address is generated instead. This address is guaranteed to be unique .Em only across all From nobody Tue Jun 3 19:57:05 2025 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 4bBhLn35lZz5y5Wn; Tue, 03 Jun 2025 19:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBhLn2MT6z3kjQ; Tue, 03 Jun 2025 19:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748980625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHd+P1LvELJxEHnzsavkostyFDtwRdeHpQecJHX+QMM=; b=ZwA0L2VJG6ARZccFG7y4HObybJJd59Uclr0iwzT3ZyNP2khfM6i2EwzU3EVSqJoZJc6wMM NlWgHCK26VKWmEMO4ygzXQFxU9sofUrOECqMR8JVwcNNBPu3wb/JghXV9jGjbnCsz2fd59 pgevObs8fTHfEfkYRPBqzaC+dAtJ9NMSOKGENYaEHX53hPud4DDgy6mvSBtMcvUwyaZT7V qDSyFdusBpfQQfAko2tMm0nDhVUJpTbAARUtSie71mqBVjjgfNxJW8MTJIBTYsdtE17264 Ri7T0r3W+hrtWVnoIevZ/I+6OPEZFbRZmUBGsFEdB+bBHPlh5Gj2xauo9lSJ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748980625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHd+P1LvELJxEHnzsavkostyFDtwRdeHpQecJHX+QMM=; b=xtbE6we67VvMOycmifbdhjpMaInIVHhi8V3U1RjLZae5OGYWTfzwShrzqDEe4F+prHTiHe iL3/5wyMQrSCttYmmTpk6gyWCUcvqH/v8oE+N2bXj0Nx4ibVRDK9BGBnfEcu05lmehFQhl fg7jJNXp+Pvh8QvPf5lMhwHt0Y+yKQGtxFF6R4uX+DExKxHf1nD7bXRTiyMUUhheX/I7wJ Ed52Mzkbc98ONrNmqGJxxE9VFsjRau8D9pVrBQzkHXAxwpou8XScllstllqCecvAa4Z/17 d9VYVBR38d/dA75okAgQgoI05P9T/4dwtIkFJ9zxxT2b7q6bVYqYmjUxpGLRfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748980625; a=rsa-sha256; cv=none; b=nBFH0RxDbcG4ioDJ1pJfFLPxCWg+oNI4WPkb2jGJlN6nEXcHNHiWWHajZLJV+YU9PFc6jr wI4HaGqK5mUxL65+IWkEjzPTgOwVJ656h2opB7p15GTEsq0agLq9zff0a0o9AvQbAbpbrL 3VC1b6Gf+eAhgmK/MwWbYJM7jqexhyFUR3X7LqVOnaPzcWSpuZtFvDOQ8UnQ1bdzdPE8Gr VglU4buDAHsMIApFdnML6AfSTY0FtcXyo8bnh563tTfJHYb7xu8iOGpWMBVdT/vPmykcxL XfXL3B/trNzKzOIoVHxGTDxQg5Dvf0ZcL6sWQZckoQw87OLo/JVRYEkg4iHjzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBhLn1sMRzrxm; Tue, 03 Jun 2025 19:57: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 553Jv5qL050452; Tue, 3 Jun 2025 19:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Jv5uF050449; Tue, 3 Jun 2025 19:57:05 GMT (envelope-from git) Date: Tue, 3 Jun 2025 19:57:05 GMT Message-Id: <202506031957.553Jv5uF050449@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: a40d73475b1d - main - Export SB_OBJROOT for later reference 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: a40d73475b1d716142dd32c29a16d5f9fc418f7d Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a40d73475b1d716142dd32c29a16d5f9fc418f7d commit a40d73475b1d716142dd32c29a16d5f9fc418f7d Author: Simon J. Gerraty AuthorDate: 2025-06-03 19:55:18 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-03 19:55:18 +0000 Export SB_OBJROOT for later reference The build varies MAKEOBJDIRPREFIX at times which can make it difficult to track the original OBJROOT. This is easier when we get the original from env as SB_OBJROOT. If SB_OBJROOT did not come from env, set and export it the first time we set OBJROOT. This allows SB_OBJROOT to be used in .MAKE.META.IGNORE* variables to tweak what should be considered as making a target out-of-date. Update auto.obj.mk to latest from contrib/bmake - handles relative objdirs more simply and reliably. Also update jobs.mk and stage-install.sh Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D50313 --- share/mk/auto.obj.mk | 15 ++++++---- share/mk/jobs.mk | 11 +++++--- share/mk/src.sys.obj.mk | 6 ++++ share/mk/stage-install.sh | 71 +++++++++++++++++++++++++++++++++++++---------- 4 files changed, 79 insertions(+), 24 deletions(-) diff --git a/share/mk/auto.obj.mk b/share/mk/auto.obj.mk index cfe60ef9c4d6..4b8c5325b71f 100644 --- a/share/mk/auto.obj.mk +++ b/share/mk/auto.obj.mk @@ -1,8 +1,8 @@ # SPDX-License-Identifier: BSD-2-Clause # -# $Id: auto.obj.mk,v 1.17 2024/02/17 17:26:57 sjg Exp $ +# $Id: auto.obj.mk,v 1.20 2025/05/17 15:29:55 sjg Exp $ # -# @(#) Copyright (c) 2004, Simon J. Gerraty +# @(#) Copyright (c) 2004-2025, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. @@ -50,7 +50,12 @@ __objdir?= ${.CURDIR} __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir} +# relative dirs can cause trouble below +# keep it simple and convert to absolute path now if needed +.if ${__objdir:M/*} == "" +# avoid ugly ${.CURDIR}/./obj etc. +__objdir:= ${.CURDIR}/${__objdir:S,^./,,} +.endif .if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ @@ -65,11 +70,9 @@ __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ .if ${.OBJDIR:tA} != ${__objdir:tA} # we did not get what we want - do we care? .if ${__objdir_made:Uno:M${__objdir}/*} != "" -# watch out for __objdir being relative path -.if !(${__objdir:M/*} == "" && ${.OBJDIR:tA} == ${${.CURDIR}/${__objdir}:L:tA}) +# we attempted to make ${__objdir} and failed .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif -.endif # apparently we can live with it # make sure we know what we have .OBJDIR: ${.CURDIR} diff --git a/share/mk/jobs.mk b/share/mk/jobs.mk index 0643e6481082..e304e16a9c56 100644 --- a/share/mk/jobs.mk +++ b/share/mk/jobs.mk @@ -1,6 +1,8 @@ -# $Id: jobs.mk,v 1.14 2023/09/11 16:52:44 sjg Exp $ +# SPDX-License-Identifier: BSD-2-Clause # -# @(#) Copyright (c) 2012-2023, Simon J. Gerraty +# $Id: jobs.mk,v 1.19 2025/02/03 21:18:44 sjg Exp $ +# +# @(#) Copyright (c) 2012-2025, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. @@ -66,7 +68,7 @@ NEWLOG_SH := ${(type newlog.sh) 2> /dev/null:L:sh:M/*} .endif .endif .if !empty(NEWLOG_SH) && exists(${NEWLOG_SH}) -NEWLOG := sh ${NEWLOG_SH} +NEWLOG := ${.SHELL:Ush} ${NEWLOG_SH} JOB_NEWLOG_ARGS ?= -S -n ${JOB_LOG_GENS} .else NEWLOG = : @@ -78,7 +80,8 @@ JOB_MAX = ${.MAKE.JOBS} # This should be derrived from number of cpu's .if ${.MAKE.JOBS.C:Uno} == "yes" # 1.2 - 1.5 times nCPU works well on most machines that support -jC -JOB_MAX_C ?= 1.33C +# if the factor is floating point, the C suffix isn't needed +JOB_MAX_C ?= 1.33 JOB_MAX ?= ${JOB_MAX_C} .endif JOB_MAX ?= 8 diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk index 708559edcdb8..e4fe3fa9a2aa 100644 --- a/share/mk/src.sys.obj.mk +++ b/share/mk/src.sys.obj.mk @@ -73,6 +73,12 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .endif # Must export since OBJDIR will dynamically be based on it .export OBJROOT SRCTOP +# if we didn't get SB_OBJROOT from env, +# it is handy to set it now, so we can remember it +.if empty(SB_OBJROOT) +SB_OBJROOT:= ${OBJROOT} +.export SB_OBJROOT +.endif .endif .if ${MK_DIRDEPS_BUILD} == "no" diff --git a/share/mk/stage-install.sh b/share/mk/stage-install.sh index 64d044fa048c..d9182e32feff 100755 --- a/share/mk/stage-install.sh +++ b/share/mk/stage-install.sh @@ -28,22 +28,28 @@ # "file".dirdep placed in "dest" or "dest".dirdep if it happed # to be a file rather than a directory. # +# Before we run install(1), we check if "dest" needs to be a +# directory (more than one file in "args") and create it +# if necessary. +# # SEE ALSO: # meta.stage.mk -# +# # RCSid: -# $Id: stage-install.sh,v 1.5 2013/04/19 16:32:24 sjg Exp $ +# $Id: stage-install.sh,v 1.11 2024/02/17 17:26:57 sjg Exp $ # -# @(#) Copyright (c) 2013, Simon J. Gerraty +# SPDX-License-Identifier: BSD-2-Clause +# +# @(#) Copyright (c) 2013-2020, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -59,6 +65,45 @@ do esac done +# get last entry from "$@" without side effects +last_entry() { + while [ $# -gt 8 ] + do + shift 8 + done + eval last=\$$# + echo $last +} + +# mkdir $dest if needed (more than one file) +mkdir_if_needed() { + ( + lf= + while [ $# -gt 8 ] + do + shift 4 + done + for f in "$@" + do + [ -f $f ] || continue + [ $f = $dest ] && continue + if [ -n "$lf" ]; then + # dest must be a directory + mkdir -p $dest + break + fi + lf=$f + done + ) +} + +args="$@" +dest=`last_entry "$@"` +case " $args " in +*" -d "*) ;; +*) [ -e $dest ] || mkdir_if_needed "$@";; +esac + # if .dirdep doesn't exist, just run install and be done _DIRDEP=${_DIRDEP:-$OBJDIR/.dirdep} [ -s $_DIRDEP ] && EXEC= || EXEC=exec @@ -74,18 +119,16 @@ StageDirdep() { t=$1 if [ -s $t.dirdep ]; then cmp -s $_DIRDEP $t.dirdep && return - echo "ERROR: $t installed by `cat $t.dirdep` not `cat $_DIRDEP`" >&2 - exit 1 + case "${STAGE_CONFLICT:-error}" in + [Ee]*) STAGE_CONFLICT=ERROR action=exit;; + *) STAGE_CONFLICT=WARNING action=: ;; + esac + echo "$STAGE_CONFLICT: $t installed by `cat $t.dirdep` not `cat $_DIRDEP`" >&2 + $action 1 fi LnCp $_DIRDEP $t.dirdep || exit 1 } -args="$@" -while [ $# -gt 8 ] -do - shift 8 -done -eval dest=\$$# if [ -f $dest ]; then # a file, there can be only one .dirdep needed StageDirdep $dest From nobody Tue Jun 3 20:04:28 2025 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 4bBhWb4G2jz5y5bX; Tue, 03 Jun 2025 20:04:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_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 4bBhWZ5JcZz3rL8; Tue, 03 Jun 2025 20:04:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 553K4SWN049625; Tue, 3 Jun 2025 23:04:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 553K4SWN049625 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 553K4Sm5049624; Tue, 3 Jun 2025 23:04:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Jun 2025 23:04:28 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9a139facd06e - main - pseudofs: enhance KASSERT with more information Message-ID: References: <202506031125.553BPHor094136@gitrepo.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: <202506031125.553BPHor094136@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bBhWZ5JcZz3rL8 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:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 03, 2025 at 11:25:17AM +0000, Bjoern A. Zeeb wrote: > The branch main has been updated by bz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a139facd06e4a1159a9c2cb992d04bcf1079e7e > > commit 9a139facd06e4a1159a9c2cb992d04bcf1079e7e > Author: Bjoern A. Zeeb > AuthorDate: 2025-06-03 11:20:56 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2025-06-03 11:25:00 +0000 > > pseudofs: enhance KASSERT with more information > > Add the name and type information to a KASSERT for 'homonymous siblings'. > Without this (or a core file) we do not even know which entry to look > for. This should make reporting and debugging a tad more simple. > > Prompted by: PR 287165 > --- > sys/fs/pseudofs/pseudofs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c > index eb4ca8a82456..d8dbf7117d13 100644 > --- a/sys/fs/pseudofs/pseudofs.c > +++ b/sys/fs/pseudofs/pseudofs.c > @@ -124,7 +124,8 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) > ("%s(): nested process directories", __func__)); > for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { > KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0, > - ("%s(): homonymous siblings", __func__)); > + ("%s(): homonymous siblings: '%s' type %d", __func__, > + pn->pn_name, pn->pn_type)); > if (pn->pn_type == pfstype_procdir) > KASSERT(iter->pn_type != pfstype_procdir, > ("%s(): sibling process directories", __func__)); May be it is time to finally make this check a runtime one. D50669 From nobody Tue Jun 3 21:00:42 2025 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 4bBjmB2NFvz5y8qK; Tue, 03 Jun 2025 21:00: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 4bBjmB1Wwkz3qLG; Tue, 03 Jun 2025 21:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748984442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FdTEJsZUoMwRH4YY7f7BwYP1NZFCOLSFBMB53rYAqHY=; b=ApEsfPWKvOtH1KFuq+7Gm9GJAwNAgnrLM8dq9K0lHJnsBuPpoP4Nql+qwCFZtxslk7kc+N merXKSfZpYhxoBPocVILEv7wCGe7C/PUK7DhO9pIFyRw99h+ynD4wmcPI5Z+/VVGVeg5Wd W5zQcenBxAkmKzBb/NCUy/wEuhYCw3BbpwGVEDtG3YeiT8i7vJQHajmF4XhZQaChaWwynV pAW1z1Q+TGliQCXSI2+eu7tR7sEqEBgwWa49ySrYyaZUOoaMXd8Iu+uEwGcOiLtukIpshs VOjJ4HqNcdL/l+BQp2FpgBmKxpjcNYvBhq5S/2C8qF4BpJYSnZoWZB2DCAeDQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748984442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FdTEJsZUoMwRH4YY7f7BwYP1NZFCOLSFBMB53rYAqHY=; b=AFoP4YcvQ4N5saYFJbf2pPvdWEYhZBmnJ14Tr3op/STqD5tVhdhUTEnqI0wHbSeLmJLDLO M2g84/Eb9nXt0tYQn9e1aCbqpOVRU6/TfkLUHYCPiS5WWjatjUm76bk87oK4YLayLmR8c9 Vxw/JC9/+TE0E321HXgKXG+Sqe6/M+KKTMmD4Lv0YryJpstIDq0so6byEsSCNSPDiEvaG3 KOo/KoWLlNQTiPNRXFXfNYFRh0RFME96jUVmaqkSZTBYF2YuOsR1rqjcCzTgk8V51MIuYC 6w4v4Y8iUygDtpxmEIIr9oNCr5OZDdm2bU03BWTBgctq7idT4L30bWn3JY8e+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748984442; a=rsa-sha256; cv=none; b=n3rfQfOIGWfkwsVKh+1Hb4Z3ZNP+De9KkQI+C2Iqs4eTyFYMyYU0ZYtUVDQceCUqaCmSxc 0NQZGVbqSpGl8Zi5boYA4y3QQ1M9o9htYEzVnJG8nwOy8JWqv9We1njfa4XjHt+0s8kzF6 EpxX306zghDw7Ld1nuIcZNw+GBFKKFIXiYwH4gZHL4NeI4oWY3GC+F2nCWsjcsKyUAx/Nv NHltQJr4yJqUKHClSHz4o4YEDkIa1U4LobIvb2rS9Da8iERHFEiAsueVcQWHi5p1eWs8vm SdkqRGGh6jZpxmFv+2jQSehQQSmxJ9v1cXxvlV6dNoiWvcqevslghMA0UyCtdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBjmB14znzvHv; Tue, 03 Jun 2025 21:00:42 +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 553L0gjR074164; Tue, 3 Jun 2025 21:00:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553L0gEt074161; Tue, 3 Jun 2025 21:00:42 GMT (envelope-from git) Date: Tue, 3 Jun 2025 21:00:42 GMT Message-Id: <202506032100.553L0gEt074161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 8bc0b97e193b - main - glob.h: Limit glob_b prototype visibility 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: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bc0b97e193b7bc2e2bb85ca489777e3dc672ff4 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=8bc0b97e193b7bc2e2bb85ca489777e3dc672ff4 commit 8bc0b97e193b7bc2e2bb85ca489777e3dc672ff4 Author: Bojan Novković AuthorDate: 2025-06-03 20:34:59 +0000 Commit: Bojan Novković CommitDate: 2025-06-03 20:59:28 +0000 glob.h: Limit glob_b prototype visibility Hide glob_b behind __BSD_VISIBLE as it is not a POSIX function. Reported by: kib Reviewed by: kib Fixes: 1e0743f54d2d ("glob: Add blocks support") Differential Revision: https://reviews.freebsd.org/D50670 --- include/glob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glob.h b/include/glob.h index cbe99bfef6ed..ee2ecd93cfc3 100644 --- a/include/glob.h +++ b/include/glob.h @@ -107,7 +107,7 @@ typedef struct { __BEGIN_DECLS int glob(const char * __restrict, int, int (*)(const char *, int), glob_t * __restrict); -#ifdef __BLOCKS__ +#if defined(__BLOCKS__) && __BSD_VISIBLE int glob_b(const char * __restrict, int, int (^)(const char *, int), glob_t * __restrict); #endif From nobody Tue Jun 3 21:25:56 2025 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 4bBkKP3BD0z5yB8M; Tue, 03 Jun 2025 21:26:01 +0000 (UTC) (envelope-from bz@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBkKP2Pdrz3JJb; Tue, 03 Jun 2025 21:26:01 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748985961; 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=9GXiGwfLOsafNriCy4cjRVqhqmXZLWTYX/kSYSKl30s=; b=Mdaz5kv9vqbgh9pnV8bTGHY+B3BpOqkrTJnWoeC3WrQWEeNFKyP0/uOhIuygS5JHSgMGYR zJRSMf4SvxUCCpYhkUyDV0GUJ6kVdOb/qL24nSgqoIJ7wuuzl353csC80TFuhrEeszIR28 MS4b4bYRFiJDODMlDLX2XQxe7QfiPKXp+PV3ZMTGKKDcCdvY5On5yFWUezInPqhTQ2LYx4 ol+/HxArAw8LHUcOk0zn37LjSo0F5vUlf6bTv+NRApctJVWYuxB89vJ3yEVt3EDpeBE6l7 NjJiy5fObsJ1exBC1LuGamLTkZRUoQTsujq7KU9+HKbKtzcfyDSGOBJZr+fSPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748985961; 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=9GXiGwfLOsafNriCy4cjRVqhqmXZLWTYX/kSYSKl30s=; b=UstCeOpLItLv0OAKbZc0gUcbHbeGxCRl38peJDbTn5pfjb9FCAdy7+giThZWTQEAHmi/8h HtrI3Ukv74EyZD9i+aO9mluSgK8zckx5oLWvsAWfcVe8jOH4S/Y7VHm9/Ypx0ZZwsRtnUi 00v4GcTzqoQLd+Q8AeLASdxsXpWjkWB2YcAiVuouVGgwiQ11pxiMycBF5jRUh6dSECf7FT 35YWaULoMtTHN3PHizwcBOg65D12LJ8hAdyucLf8FK9WJLINp35WA1bzwFJfejjoDCiC6o /yXOziRw6kwfs1rYpInF85n79SJvMnRXCH/FTlIAs3q2EU5gNeEbpGLtsW0SRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748985961; a=rsa-sha256; cv=none; b=H6533gUTFQx+H4/3qRUWxSLOMw32T5azYVLWwYreWyBZBAoev171T1zmL+kunOEPtdIgEE NBZn5k0sdyvrovO27fNy+1CIFt4YpGLQq2E9nowuok1E1sLoV53IyLOk+p1nBX3jySYoI+ 2oZk1EetAH9e7dXvy7hafHH5lO0NYniZc3+Dj7u7pjdg2fEVUn7tkXcyfzYH1scv2sAvT7 ntpH+9XoPBhxJwra2YAID+syL6AdIWUX3zmVsxNGcs2PPXKJ3Clz02ZobceHxkmxpbhExw xfVIYqXbtypShLMU/BnxpXaWCowNRw8NCjeGD8/3BNdFRIHG/BhDwLi7MDQU5Q== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bBkKP0lqXz1BW3; Tue, 03 Jun 2025 21:26:01 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 27416A64805; Tue, 03 Jun 2025 21:25:58 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 0FBB32D029E0; Tue, 3 Jun 2025 21:25:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id oyCQojxXlTg6; Tue, 3 Jun 2025 21:25:58 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:3e64:cfff:fe55:bc80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E86492D029D8; Tue, 3 Jun 2025 21:25:57 +0000 (UTC) Date: Tue, 3 Jun 2025 21:25:56 +0000 (UTC) From: "Bjoern A. Zeeb" To: Konstantin Belousov cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9a139facd06e - main - pseudofs: enhance KASSERT with more information In-Reply-To: Message-ID: <9112s3o2-7n79-s55s-7p95-77no5q1pp6q0@serrofq.bet> References: <202506031125.553BPHor094136@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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; format=flowed On Tue, 3 Jun 2025, Konstantin Belousov wrote: > On Tue, Jun 03, 2025 at 11:25:17AM +0000, Bjoern A. Zeeb wrote: >> The branch main has been updated by bz: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=9a139facd06e4a1159a9c2cb992d04bcf1079e7e >> >> commit 9a139facd06e4a1159a9c2cb992d04bcf1079e7e >> Author: Bjoern A. Zeeb >> AuthorDate: 2025-06-03 11:20:56 +0000 >> Commit: Bjoern A. Zeeb >> CommitDate: 2025-06-03 11:25:00 +0000 >> >> pseudofs: enhance KASSERT with more information >> >> Add the name and type information to a KASSERT for 'homonymous siblings'. >> Without this (or a core file) we do not even know which entry to look >> for. This should make reporting and debugging a tad more simple. >> >> Prompted by: PR 287165 >> --- >> sys/fs/pseudofs/pseudofs.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c >> index eb4ca8a82456..d8dbf7117d13 100644 >> --- a/sys/fs/pseudofs/pseudofs.c >> +++ b/sys/fs/pseudofs/pseudofs.c >> @@ -124,7 +124,8 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) >> ("%s(): nested process directories", __func__)); >> for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { >> KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0, >> - ("%s(): homonymous siblings", __func__)); >> + ("%s(): homonymous siblings: '%s' type %d", __func__, >> + pn->pn_name, pn->pn_type)); >> if (pn->pn_type == pfstype_procdir) >> KASSERT(iter->pn_type != pfstype_procdir, >> ("%s(): sibling process directories", __func__)); > > May be it is time to finally make this check a runtime one. > D50669 Can the callers deal with that? lindebugfs etc.? or will we just see different panics (less clear)? The problem that kargl is running into seems that drm-kmod/radeon is double-initialising and radeon has no cleanup routine hooked up most likely (or none which I could identify on quick look). No idea how this works on Linux but I know I had to fix wifi drivers as once I had two cards directories on FreeBSD were identical otherwise. /bz -- Bjoern A. Zeeb r15:7 From nobody Tue Jun 3 22:01:49 2025 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 4bBl6t6whNz5yCfK; Tue, 03 Jun 2025 22:01:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_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 4bBl6s2ZKWz3vdc; Tue, 03 Jun 2025 22:01:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 553M1nGC068652; Wed, 4 Jun 2025 01:01:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 553M1nGC068652 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 553M1nZM068651; Wed, 4 Jun 2025 01:01:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 4 Jun 2025 01:01:49 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9a139facd06e - main - pseudofs: enhance KASSERT with more information Message-ID: References: <202506031125.553BPHor094136@gitrepo.freebsd.org> <9112s3o2-7n79-s55s-7p95-77no5q1pp6q0@serrofq.bet> 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: <9112s3o2-7n79-s55s-7p95-77no5q1pp6q0@serrofq.bet> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bBl6s2ZKWz3vdc 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:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 03, 2025 at 09:25:56PM +0000, Bjoern A. Zeeb wrote: > On Tue, 3 Jun 2025, Konstantin Belousov wrote: > > > On Tue, Jun 03, 2025 at 11:25:17AM +0000, Bjoern A. Zeeb wrote: > > > The branch main has been updated by bz: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a139facd06e4a1159a9c2cb992d04bcf1079e7e > > > > > > commit 9a139facd06e4a1159a9c2cb992d04bcf1079e7e > > > Author: Bjoern A. Zeeb > > > AuthorDate: 2025-06-03 11:20:56 +0000 > > > Commit: Bjoern A. Zeeb > > > CommitDate: 2025-06-03 11:25:00 +0000 > > > > > > pseudofs: enhance KASSERT with more information > > > > > > Add the name and type information to a KASSERT for 'homonymous siblings'. > > > Without this (or a core file) we do not even know which entry to look > > > for. This should make reporting and debugging a tad more simple. > > > > > > Prompted by: PR 287165 > > > --- > > > sys/fs/pseudofs/pseudofs.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c > > > index eb4ca8a82456..d8dbf7117d13 100644 > > > --- a/sys/fs/pseudofs/pseudofs.c > > > +++ b/sys/fs/pseudofs/pseudofs.c > > > @@ -124,7 +124,8 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) > > > ("%s(): nested process directories", __func__)); > > > for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { > > > KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0, > > > - ("%s(): homonymous siblings", __func__)); > > > + ("%s(): homonymous siblings: '%s' type %d", __func__, > > > + pn->pn_name, pn->pn_type)); > > > if (pn->pn_type == pfstype_procdir) > > > KASSERT(iter->pn_type != pfstype_procdir, > > > ("%s(): sibling process directories", __func__)); > > > > May be it is time to finally make this check a runtime one. > > D50669 > > Can the callers deal with that? lindebugfs etc.? or will we just see > different panics (less clear)? Yes, the error is propagated to the callers, and callers must deal with it. Note that the current state is quite bad: the panic for INVARIANTS build is replaced by silent creation of the second node with the same name for non-INVARIANTS kernel. > > The problem that kargl is running into seems that drm-kmod/radeon is > double-initialising and radeon has no cleanup routine hooked up most > likely (or none which I could identify on quick look). No idea how this > works on Linux but I know I had to fix wifi drivers as once I had two > cards directories on FreeBSD were identical otherwise. Eventually callers should grow the proper reaction to the issue. But it cannot be started done until the pfs code acts reasonably. From nobody Tue Jun 3 23:02:41 2025 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 4bBmSy15yfz5yH6x; Tue, 03 Jun 2025 23:02: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 4bBmSy0NkJz3hv0; Tue, 03 Jun 2025 23:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748991762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=715N/wE2hCgj9lM6Kes0twmG2aQtM1IWD1WHFsDCJsw=; b=M/IoilM3sLo8rSnuEQV2otN47caEr7vr3z1IOMOLAHmMLAs0k6m6bkgiXsHaYDYrZzpN9N SUsACmVh8dps8RO2mKoEcP3fzU4vSqENBVYJDnMLwmM6lpD8ExiG9vTdQJzFgo5AN3cshz TmDDYJiR5mEAWv+PjXyo1e5iJUgM6bpYzuthw75FkuqDgFYngHudLBpGNlP19knRpHE/ee d5nOZkj1mX3+GJIGnM53FmoRde1vYZiB1aEWKcKywJwvAuTAeRQAEkYC3U6nDPNw4joZCm zwLrb66UYwfU9Rsiatva1XcoLeVMso+wP1mOdVs5R64E9PSvq0F9nkybiz/a/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748991762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=715N/wE2hCgj9lM6Kes0twmG2aQtM1IWD1WHFsDCJsw=; b=ecPXFgNcqM5p7cxsP9hV4hI6zgWWY28xKQ8Vioknqa0ixTRDrh9D1L3z2ZXe3owRFhbbJH 5gHbPCh3JzMqQURisdac7uiHfxUX+cyCX1P4N9RjbZS4oAB14YOFx6MsAOXlpKdnfVw1RZ 5UoU+UWDBSd2T5cJyPtGKIwJWwjDLraUEGLd4alNQ5v9StwwTt+6rXVHlPSTW8OJIPLbbb FlWfbuLaVpsPiri0BBy74EWVFsre/zTU+Cy10fpTJbcOSw4+hx+pAHm3IugrBWU+9R+9PS nzEIPE4BaFOoOpL4Q9EE83xH869ABvkg/CVfh/sDJb4/mmWJzERNbHOWpK6+Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748991762; a=rsa-sha256; cv=none; b=J/qnvIFD4qgtR7a3BN18rQ2h/I4EqbmTjSL7Ts/h0+BM/uz1Qj6T4gzVYn+9HF7a6+LRNC q8CSuuRM4RMlDtTB5BTbVRXtnmp7ZIeZPdwybFib6dpesqEbGpWx+UWoTI4QNm4mOF2TpQ OQ6+sGScbo7zU+oJWQVFN4JPRrMwyvyJYojyyAU/dnMd0WHHz7U+aLeMSEbQ9pkqc8ULI8 LNxS0dfFnvzwCjouyazwLJxJntaY84wa7maHU7uQ3NIOthK4sBxzRJ4nk4aQ3qT7srjWiG os+5sOr0mA0EykWo70k0YbMCT2ozyUQ9amNMDcTTHRb/sGwfYV9Po0zR4uvxYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBmSx71jPzyXr; Tue, 03 Jun 2025 23:02: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 553N2fsu004970; Tue, 3 Jun 2025 23:02:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553N2f2F004967; Tue, 3 Jun 2025 23:02:41 GMT (envelope-from git) Date: Tue, 3 Jun 2025 23:02:41 GMT Message-Id: <202506032302.553N2f2F004967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 503f752a347f - main - sysent: retire unused SV_IA32 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 503f752a347fdd74e406f3700dd2ad3bd770f302 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=503f752a347fdd74e406f3700dd2ad3bd770f302 commit 503f752a347fdd74e406f3700dd2ad3bd770f302 Author: Brooks Davis AuthorDate: 2025-06-03 22:59:30 +0000 Commit: Brooks Davis CommitDate: 2025-06-03 22:59:30 +0000 sysent: retire unused SV_IA32 When COMPAT_IA32 was generaliaed to COMPAT_FREEBSD32 in 2010 (commit 841c0c7ec75b), all runtime uses of SV_IA32 were removed in favor of SV_ILP32 check. Given SV_ILP32's existance it makes no sense to dynamically check for SV_IA32 (even if we had a 32-bit x86 ABI with 64-bit time_t we needed to differentiate, SV_IA32 would be the wrong spelling.) As such, remove SV_IA32 and mark the bit reserved. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50672 --- sys/amd64/linux32/linux32_sysvec.c | 2 +- sys/compat/ia32/ia32_sysvec.c | 2 +- sys/i386/i386/elf_machdep.c | 2 +- sys/i386/linux/linux_sysvec.c | 4 ++-- sys/kern/imgact_aout.c | 6 ++---- sys/sys/sysent.h | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index a8cc03ea8c71..d7f87e2fdf34 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -799,7 +799,7 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, - .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP | + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_SHP | SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP, .sv_set_syscall_retval = linux32_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index 5174438bc40a..0ea7d072e911 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -126,7 +126,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_setregs = ia32_setregs, .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, - .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | + .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG | SV_SIGSYS, .sv_set_syscall_retval = ia32_set_syscall_retval, diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index eb6ac5735e56..13769af0fbca 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -74,7 +74,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | + .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 24f8ec2d7ea8..c68a0e17a8e4 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -596,7 +596,7 @@ struct sysentvec linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32 | + .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_ILP32 | SV_SIG_DISCIGN | SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, @@ -638,7 +638,7 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP | + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_SHP | SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 0ecfaa65c84e..9978c74f0dee 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -90,8 +90,7 @@ struct sysentvec aout_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32 | - SV_SIGSYS, + .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_ILP32 | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -140,8 +139,7 @@ struct sysentvec aout_sysvec = { .sv_setregs = ia32_setregs, .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, - .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32 | - SV_SIGSYS, + .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_ILP32 | SV_SIGSYS, .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index c582ed494be9..dffe77de91d0 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -162,7 +162,7 @@ struct sysentvec { #define SV_ILP32 0x000100 /* 32-bit executable. */ #define SV_LP64 0x000200 /* 64-bit executable. */ -#define SV_IA32 0x004000 /* Intel 32-bit executable. */ +#define SV_RESERVED0 0x004000 /* Formerly SV_IA32 */ #define SV_AOUT 0x008000 /* a.out executable. */ #define SV_SHP 0x010000 /* Shared page. */ #define SV_SIGSYS 0x020000 /* SIGSYS for non-existing syscall */ From nobody Tue Jun 3 23:25:51 2025 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 4bBmzh18CJz5yHrP; Tue, 03 Jun 2025 23:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBmzh0PYDz47b3; Tue, 03 Jun 2025 23:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748993152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oC9s3OGG8HpYK3y/YZFz7mXUqa+OxW79DiBYp1+rDDE=; b=sTUULgRrzxkVtOr25ZYy8DwPxD3kRdKyIzlfKZFwCyUBSZlXtQzAtRlCmjp+8HY1Oy2DX9 PhX5skwbjceQndG49NbjDLVqWE/EyP1xuSH2fx0E3it6Fo6l6UE33WkNkgejHIArmGN86r FHNuS5diia2+RxlplXPv5U818e4XtdrhxUu9e+60maEQKluxrFMScoMtS495kDPR7RF1pu oXKk/nFCbnU3BRZLZZQchkYdVvOBkf0tT6hTYy4zYT40l3s6i0TX2GD9SPyEv/JMP+4Gx4 5k4qyJZXBtUZ4Jc0S3uRffmixtvDYlO7XZa8IFfQ/wL6fyNgMOoXEpcpKSe4PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748993152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oC9s3OGG8HpYK3y/YZFz7mXUqa+OxW79DiBYp1+rDDE=; b=LPYG6Xr5oLzk219mgr+WTzGsGdWAnAWDp1gaVqvmf9hRMMPu5l8ZNqzGu/pwnZgWiBNZsw N6FK2DHWaXUnqt+5EDwwSfwsarbgwgrAUNcaW96bQogpm0bOZqLXfYl0ZOjcTBvmiFeEiw TqstgeykjsFj7lvbdPtdai8/d6qfUzp3TOBZLkD+IxvCO9uiLYaOsMIFZ7XCrmDVjkumni KQhsOYarsyw0zGF3zI6b5uKvC/aJGY74qBzSda4xk72ie8YX7B5cUrubpcT093FrFGcBHz beUYh794UkU8ein3LGdf9pBY9Dl3DsBRoMT0AaSQUF1ko0fP1Vetjw2A0wv76Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748993152; a=rsa-sha256; cv=none; b=v/mrHenuKmut8+pz/vGttvZXwYApwgMoi3l2vRfgmt1CVFXALIx1ghx1NZbJfAXKWfELtN wXkpOfYMchEdwj21kxmOUH1puOSdWXkFfkb/g3xNQltVK8ewOuOA6IuOCiNenmmbKn1ccx zEOpG5Gyb7jNMpYP248IS4XMSF5DwI13OWGBdHydZRQJVegBBhZENuUWR1HQ8+UescVVPN kY9VO2UTPZ7fmx6Dx/kJrY+tPqrigz7mxmPQ+VTvlLbtOp9WERQ/+0UnOgWX/aYAxhAS+m pKvf9yF38ALxtJPlv2ZtV35G3FWwUojXI4VVpUMOFp1+/qAjgD/AfoiRjTutCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBmzg6bMFz10Jm; Tue, 03 Jun 2025 23:25:51 +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 553NPpGP043499; Tue, 3 Jun 2025 23:25:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553NPp88043496; Tue, 3 Jun 2025 23:25:51 GMT (envelope-from git) Date: Tue, 3 Jun 2025 23:25:51 GMT Message-Id: <202506032325.553NPp88043496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 71f854e5a01a - main - LinuxKPI: 802.11: update HE structures 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71f854e5a01a347174d09d594b3d490f806cf850 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=71f854e5a01a347174d09d594b3d490f806cf850 commit 71f854e5a01a347174d09d594b3d490f806cf850 Author: Bjoern A. Zeeb AuthorDate: 2025-06-02 15:49:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 23:25:39 +0000 LinuxKPI: 802.11: update HE structures Update strutures needed for 11ax (HE) to be correct. Add references to the standard. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 28 ++++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 7849c77062dc..e9af70f751d4 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -895,28 +895,34 @@ struct linuxkpi_ieee80211_regdomain { #define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT) +/* + * 802.11ax-2021, + * 9.4.2.248.2 HE MAC Capabilities Information field. + * 9.4.2.248.3 HE PHY Capabilities Information field. + */ struct ieee80211_he_cap_elem { u8 mac_cap_info[6]; u8 phy_cap_info[11]; } __packed; +/* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */ struct ieee80211_he_mcs_nss_supp { - /* TODO FIXME */ - uint32_t rx_mcs_80; - uint32_t tx_mcs_80; - uint32_t rx_mcs_160; - uint32_t tx_mcs_160; - uint32_t rx_mcs_80p80; - uint32_t tx_mcs_80p80; + uint16_t rx_mcs_80; + uint16_t tx_mcs_80; + uint16_t rx_mcs_160; + uint16_t tx_mcs_160; + uint16_t rx_mcs_80p80; + uint16_t tx_mcs_80p80; }; -#define IEEE80211_STA_HE_CAP_PPE_THRES_MAX 32 +#define IEEE80211_HE_CAP_PPE_THRES_MAX 25 + +/* net80211::ic_ieee80211_he_cap */ struct ieee80211_sta_he_cap { - /* TODO FIXME */ - int has_he; + bool has_he; struct ieee80211_he_cap_elem he_cap_elem; struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; - uint8_t ppe_thres[IEEE80211_STA_HE_CAP_PPE_THRES_MAX]; + uint8_t ppe_thres[IEEE80211_HE_CAP_PPE_THRES_MAX]; }; struct cfg80211_he_bss_color { From nobody Wed Jun 4 01:51:13 2025 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 4bBrCQ2GCbz5xDw3; Wed, 04 Jun 2025 01:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBrCQ0dl3z3Z6W; Wed, 04 Jun 2025 01:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749001874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUrlkjrjrdY9WC6tBWvHT0/TXVSH2ObfkCqtqjIMEOA=; b=WU55XPyq4Rp/dRSKKtVGZZvM8Bsz9D8JvSdBvfWFXCJrA9PSEJ5h1Y1IbsIvszHx5lfPoy gcyKLFyj68lc69aFm3IDunx9RHrbY7W/d01uLaLFHOqDHD6Zz1mDo+6zORVjZIy/lw5R0q XJyD9tBVcJe1hwrBPutZBQvKOwT8kwfem+KpuEo8K/0DGgaw8KcxIqUV6qmsRUT5iX5z/8 TZFUttgXHbo4VM2UfhkJtea4DBSCXKgCGiSYOGf5P1aWiTNFBUcwUZFoSK6/YZfJWAHkgT C1sq5QbZzH3FaHau2ZDuCi16SdU2tAzg8ISYn13O9TuruilMXLRkH+G3toixnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749001874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUrlkjrjrdY9WC6tBWvHT0/TXVSH2ObfkCqtqjIMEOA=; b=FoTtnmZ39RPp80lt837jqhkuETwgpTu7D3XZRgtmbMR2QLlEm56JD6dSIh/ilN3fGOc9hh 7XwfXeai571Igltpwr1D+1alFzoSfPWufbEjiW4KMm50+AOJF0FuyaKI9dMs0zzrjIa5/5 NyrpD0NjtfIhQuMGDITtAtWfmpL5GTmQ7nhIaOrfEp51beKjdp7VynQ72BDFmXKoLsMh6P qOFsNuQ5XEotqF/QSp0pi2BQTcOYBVyKCLhdeA9j13e+Bj7Ve96SuFH8B0uZUKBhKQK96i +UtTOmgI6dmlucT+JxIyaVxYHENN2lYxmhq+6KIaN39SAoKPsKWtbburtrNXwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749001874; a=rsa-sha256; cv=none; b=QDpfeZxayn58OpIRQ4nGW5zpepnrob3/7/pEQLnMdLRBguPMt1G/Zmjo40XGVWB0szDVMz qGdq8JvWBj7wk1nm+SpB6d9zPW3SypEsEZ7pDOthysbUUe/9dFVejESOfnPQSaTXahMCRc wo17yyZPbvvOpAdvEf/pJFwemftpqLqHdYTYDqTGuYtTA2Q2IjofnTW7BClbA+ygPPGMrt zcgfD32PtY4S98zxyuon9iLzL1XNRRtQEJBk6RzNwl0oiBHh/t8W08mAp3NMwwB3qrko7S ql9dI6gVuo7Pomfl7lx//vbhWZejxC/9DKRlsnwKH7LDOzYfFW7OzPuvNq9atQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBrCP6WDgz13cQ; Wed, 04 Jun 2025 01:51:13 +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 5541pDQB016445; Wed, 4 Jun 2025 01:51:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5541pDHs016442; Wed, 4 Jun 2025 01:51:13 GMT (envelope-from git) Date: Wed, 4 Jun 2025 01:51:13 GMT Message-Id: <202506040151.5541pDHs016442@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: 3eb26ef41ce8 - main - kdump: nicer printing of wait*() ID arguments 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: 3eb26ef41ce8a1f78ae9a1236ffccd9ced89d32b Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3eb26ef41ce8a1f78ae9a1236ffccd9ced89d32b commit 3eb26ef41ce8a1f78ae9a1236ffccd9ced89d32b Author: Kyle Evans AuthorDate: 2025-06-04 01:51:06 +0000 Commit: Kyle Evans CommitDate: 2025-06-04 01:51:06 +0000 kdump: nicer printing of wait*() ID arguments Currently, both of these will print pid/uid/gid/sid/jid in hex, which isn't very helpful for eyeballing. Align more closely with truss(1) and print these in decimal instead. `ip` is likely wider than our ID type, so we do a small casting trick in wait4(2) to get it sign-extended and rendered properly. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50496 --- usr.bin/kdump/kdump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index a8f3df14f304..ff32dd418f24 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -937,7 +937,8 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, narg -= 2; break; case SYS_wait4: - print_number(ip, narg, c); + *ip = (pid_t)*ip; + print_decimal_number(ip, narg, c); print_number(ip, narg, c); putchar(','); print_mask_arg0(sysdecode_wait4_options, *ip); @@ -950,7 +951,7 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, c = ','; ip++; narg--; - print_number64(first, ip, narg, c); + print_decimal_number64(first, ip, narg, c); print_number(ip, narg, c); putchar(','); print_mask_arg(sysdecode_wait6_options, *ip); From nobody Wed Jun 4 01:51:14 2025 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 4bBrCR3QR1z5xDkp; Wed, 04 Jun 2025 01:51: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 4bBrCQ6z2Dz3ZFZ; Wed, 04 Jun 2025 01:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749001875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5DsP36qaEI0+VqxEdhIN5tRAWiqlZifYAU95/ZSaf0=; b=CFob/3jqiQtIqbvNyX9v51AO7UVAxAsrnkg0KjKczAKOXux/nf7gU5F8DkF6IE1clsOSqT xZnMZaXcN+y0w+gTlv5nTmiFOnXh7ddWvKr6tR3boJz7USUwT34tHE9Kuc8Qptia9qmLU/ 1CGqE/XZ1S0IhsuONL+m43BiRghtHjy1hXbU+lH8YhO3CODe3mna/AwTuRyfO1OuNahINI 4J6aX0FVQtqJQZcd6RT0MX9x8j5RYVz7B2NLUCyvxYtj4vAhlCXv8zecUF3Sn104SwrOtx q+lypLo6R9+0fc+FWBGJbnPUyrL9vDrYVQfiOCKPZDay8irFhTEZvdl+jR9MTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749001875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5DsP36qaEI0+VqxEdhIN5tRAWiqlZifYAU95/ZSaf0=; b=oWw2iAPv6mv2l7E/MRLnGWZutQP4UJKZ5zBvfAe7AVYm2ocCVFrCQ4NejwCzYNRxWkkNg+ y5m6othCqbecxdPqJo9wCjuPIIESqG7DEjpHCyALy6R2Bdvo3vZ9DMFeys7oXt3yCTVHYy +Ujl2U0pjXAdBAF4INkVMWNBONoNzAI7yT5E59cHlA9Gu2ovGhcU0zp/M2Vtnm4rXHNaoG A+34MmEzt1pyAvi/VAF5qVala6RjK/pdCqQCK06fPgF7qTpepvv5sZTpUP+uTpLG0HyxYI SlcTtQzY4bIsA9nMhbNzLc4cKrmI+b0RHXCqjICmTUdb4zAx+6jn8ISMdcuOPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749001875; a=rsa-sha256; cv=none; b=jNi36fQw19PmHllUX6gBX2XOYse50qcT78IWHcx7gPWaR74pC/Q0/PBXu5WtgmdOHXIAKs 3bgc7jwS2UaSzbbha1ZUliPgNtYE2fbY1fpcWILPIN4yah6fukH/94uA/xUnZ2HPmmLLuu hblSg25mAYjXNqMYUnvzyUiJEs1WAL2wmq14dNrFJsA6F2mvHS47piA17TM8oyx7VjzakM wptF/b2nx1jsmVT7exMO0H2T7Xhy3fwUfCuVQPofHkHm8t7Tfa7mcrQZFeKirHd7lvx2LV VCEN98yxSsyBUTuNRmO8QDEsE0tebyvCCPAAImfwL3+aaXWlFOv5zE9hnUDH1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBrCQ6W1Cz13rT; Wed, 04 Jun 2025 01:51:14 +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 5541pEYZ016479; Wed, 4 Jun 2025 01:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5541pESm016476; Wed, 4 Jun 2025 01:51:14 GMT (envelope-from git) Date: Wed, 4 Jun 2025 01:51:14 GMT Message-Id: <202506040151.5541pESm016476@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: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument 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: 969f6380eb66f809eed3e5c38b6021824a4cc2bf Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf Author: Kyle Evans AuthorDate: 2025-06-04 01:51:06 +0000 Commit: Kyle Evans CommitDate: 2025-06-04 01:51:06 +0000 kdump: nicer printing of kill(2) PID argument Similar to wait*(), kill(2) operates on a pid that currently gets output as hex. Output it in decimal to make it a little easier to eyeball the pid we're signalling. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50508 --- usr.bin/kdump/kdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index ff32dd418f24..86df45acdf05 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1028,7 +1028,8 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip, narg--; break; case SYS_kill: - print_number(ip, narg, c); + *ip = (pid_t)*ip; + print_decimal_number(ip, narg, c); putchar(','); print_signal(*ip); ip++; From nobody Wed Jun 4 03:44:14 2025 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 4bBtjq1Wt6z5xMwk; Wed, 04 Jun 2025 03:44: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 4bBtjp5McLz3JLT; Wed, 04 Jun 2025 03:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61OvmU6jWClyDfSndFdirQCBzkB79NQXrOuWWa9ihwA=; b=vvfNKj+4h6SiXL3/fY5tnu5uMTPGnchITyVUcq9u8PKmtO8/Uzh1tgqiIWG+2/iukM+L7W meZFZ88AdFA0O+JUbQ/z+r442OBNan8EUAMeo5sRy0ylPyB2lw6IRHneKYFLYh2xwQCL40 68CdGChiwXZgUcPLxUsfBAy8jlBZQa4YAwPGQ4998CTxeDOWSlLqQta6iOQaeV6w8ihk+g BhZJGc2hz+SlJ8KAXM80ZBPwocd06VfRj/IH4mm28Syudnb8KU1KTsrCxilkpH+Axgml7p FDHoOowMoNcVQFYBEYZwi1rAlU0+LhqWDsRF9iFkZROit8wUpk/IiZ/MlThfBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61OvmU6jWClyDfSndFdirQCBzkB79NQXrOuWWa9ihwA=; b=D7K0y/tsq4NiVDoM5Aix+LjOo5WgYzvx4bMEDZdMoGk21m0JB/1lTBUETgynWM9Ggk4IU/ aZArg08bqwFuUGGAO8PDJBuiaUxZjxg6lCjrQqMhFqUYfQBLDSenlj0RocxSSFbI58ECzh /Nb8T20JOo+x/v0RybhiJ30BrcbX/YJ24oCWCOGN3zZ+VvYpolV41ZOuZ+e+5R+G07C4ox iRn+s3ul/OQTPnqvdAn5P5Ehv/jafCw9qJmOWKGpFUcyH/PVcbjhJOdhH/LDZ20KL+fZ2T 1iFzGfeMnii0mQDjpFWlwL/4VYHgaQO/A+LgqsPwsIYeWcvYI7p6fLf84AWURA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749008654; a=rsa-sha256; cv=none; b=YmasqeD8RFLH2kUqbp8+xWjF/OUNh0HpPmuIJnbEvz48A1zzCdDoYJWk964TFxHAaXzLI4 BGxfOhaT05nCX34yMDmgbGAdaFEZjEhmCEQEw4efr3SAaFddSyDjO4wfzcCyia2ABrsoxE tNdioxjxT/GH9/pY+aNNHh42Fm7vkLy02lwWn5xMyVte0EdGAu46yOMcYri5LkBsFTRKtI Q9WtU6PDL+HziqWWrI74hho0UfOKuVlMJCHtJQUQoXXzTCCP19Ld0VdyIV/6hNvzL5Rfn8 N99ge+KBSTEDaVAY8ieters/QtYmSB+oexywYUo7fWy7RZyen5ZexsW8J+XtfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBtjp4qR4z161N; Wed, 04 Jun 2025 03:44:14 +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 5543iE3b031059; Wed, 4 Jun 2025 03:44:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5543iECW031056; Wed, 4 Jun 2025 03:44:14 GMT (envelope-from git) Date: Wed, 4 Jun 2025 03:44:14 GMT Message-Id: <202506040344.5543iECW031056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 0861daf511dc - main - net80211: create net80211_vap_printf() / net80211_ic_printf() for printing 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0861daf511dc9a573d71f5c3c1d0233745a8712b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=0861daf511dc9a573d71f5c3c1d0233745a8712b commit 0861daf511dc9a573d71f5c3c1d0233745a8712b Author: Adrian Chadd AuthorDate: 2025-05-31 18:51:21 +0000 Commit: Adrian Chadd CommitDate: 2025-06-04 03:33:33 +0000 net80211: create net80211_vap_printf() / net80211_ic_printf() for printing Not all OSes support if_printf(), printf(), etc, so start migrating the printf / log routines into net80211 routines that are implemented in ieee80211_freebsd.c . Migrate ic_printf() to net80211_ic_printf() via a macro for testing. Differential Revision: https://reviews.freebsd.org/D50642 Reviewed by: bz --- sys/net80211/ieee80211.c | 13 ---------- sys/net80211/ieee80211_freebsd.c | 52 ++++++++++++++++++++++++++++++++++++++-- sys/net80211/ieee80211_freebsd.h | 6 +++++ sys/net80211/ieee80211_var.h | 4 +++- 4 files changed, 59 insertions(+), 16 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index e4de0b439ac0..74fdaa033952 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -273,19 +273,6 @@ null_update_chw(struct ieee80211com *ic) ic_printf(ic, "%s: need callback\n", __func__); } -int -ic_printf(struct ieee80211com *ic, const char * fmt, ...) -{ - va_list ap; - int retval; - - retval = printf("%s: ", ic->ic_name); - va_start(ap, fmt); - retval += vprintf(fmt, ap); - va_end(ap); - return (retval); -} - static LIST_HEAD(, ieee80211com) ic_head = LIST_HEAD_INITIALIZER(ic_head); static struct mtx ic_list_mtx; MTX_SYSINIT(ic_list, &ic_list_mtx, "ieee80211com list", MTX_DEF); diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 5c7ebd7c727c..b5ab79a4ad16 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -58,6 +59,8 @@ #include #include +#include + #include #include @@ -275,8 +278,8 @@ ieee80211_sysctl_vattach(struct ieee80211vap *vap) ctx = (struct sysctl_ctx_list *) IEEE80211_MALLOC(sizeof(struct sysctl_ctx_list), M_DEVBUF, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (ctx == NULL) { - if_printf(ifp, "%s: cannot allocate sysctl context!\n", - __func__); + net80211_vap_printf(vap, + "%s: cannot allocate sysctl context!\n", __func__); return; } sysctl_ctx_init(ctx); @@ -1326,6 +1329,51 @@ ieee80211_vap_get_broadcast_address(struct ieee80211vap *vap) return (if_getbroadcastaddr(vap->iv_ifp)); } +/** + * @brief net80211 printf() (not vap/ic related) + */ +void +net80211_printf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} + +/** + * @brief VAP specific printf() + */ +void +net80211_vap_printf(const struct ieee80211vap *vap, const char *fmt, ...) +{ + char if_fmt[256]; + va_list ap; + + va_start(ap, fmt); + snprintf(if_fmt, sizeof(if_fmt), "%s: %s", if_name(vap->iv_ifp), fmt); + vlog(LOG_INFO, if_fmt, ap); + va_end(ap); +} + +/** + * @brief ic specific printf() + */ +void +net80211_ic_printf(const struct ieee80211com *ic, const char *fmt, ...) +{ + va_list ap; + + /* + * TODO: do the vap_printf stuff above, use vlog(LOG_INFO, ...) + */ + printf("%s: ", ic->ic_name); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} + /* * Module glue. * diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index 5afc093ba90c..141b13f9f740 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -549,6 +549,12 @@ bool ieee80211_vap_ifp_check_is_running(struct ieee80211vap *); void ieee80211_vap_ifp_set_running_state(struct ieee80211vap *, bool); const uint8_t * ieee80211_vap_get_broadcast_address(struct ieee80211vap *); +void net80211_printf(const char *fmt, ...) __printflike(1, 2); +void net80211_vap_printf(const struct ieee80211vap *, const char *fmt, ...) + __printflike(2, 3); +void net80211_ic_printf(const struct ieee80211com *, const char *fmt, ...) + __printflike(2, 3); + #endif /* _KERNEL */ /* XXX this stuff belongs elsewhere */ diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 91beaec6f997..a0293f814899 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -765,7 +765,9 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_COM_REF_S 1 #define IEEE80211_COM_REF_MAX (IEEE80211_COM_REF >> IEEE80211_COM_REF_S) -int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); +/* TODO: Transition macro */ +#define ic_printf net80211_ic_printf + void ieee80211_ifattach(struct ieee80211com *); void ieee80211_ifdetach(struct ieee80211com *); void ieee80211_set_software_ciphers(struct ieee80211com *, From nobody Wed Jun 4 03:44:15 2025 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 4bBtjq6vwYz5xMT4; Wed, 04 Jun 2025 03:44: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 4bBtjq60jyz3JN3; Wed, 04 Jun 2025 03:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4vYSIEepKFillGqg9KZSDyTDXibP6PMTJoRKE/wZhs=; b=wuQPy82h3l1DBzgMgAXRkq5CijlmCMAklGFmcv+P0dWR2flXvlK5q/skl6KOYtMZJEYfG4 6PUJ1K2uZDIdeXmdb+CC5Hb6GQTtT4JuGgFjLXbNxvn4NSGUbzg4atJ+qDS9ycm8TI8A6n L8waNYre2p9TJDER8o0UPF5lZoa8FeEx6OVdpb4HwKXXlrXPPrS+2zu6KJOnkpjo3H9Zxz CPzIeUmce7+1kFr72SQ64E1tHkkNgDYUFmHU+wZjZobPg272z3fi69esCCDJolhYbqcGRN I1kBiu9JBAOP/wNCrffAISwDeNwLmtvDuYx/hIT8N2xLN5Gm94QPpjoQiwmDog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4vYSIEepKFillGqg9KZSDyTDXibP6PMTJoRKE/wZhs=; b=efQv1uBT9H/9wXsYfbKOaJ6zv3b7e0VGO0K/Z3f3PFYp74BhjaP4xd3tREAij5f5YAFOCQ mY142++vD3oQ1MmtID0nD1mQWYIQHUZxmWQ49YWpIq6KswATO+zgsntxU+D3SnasMZsZQ7 1JAGjGPR3JfUemWFferII9MpI351dpScTpG5h7Qahz0Y8edJed8EcTFnIH67eyYzGS9N/R ZCMrIiLfbDyCkLK7LASUVqBl/OJwyt7MnulUtLVUCrxIpdi3XPrRiS4PEuQHC6lS2sIjyW KuvXRaJoV8jNVpBRDPkcE5x1ZybdgVVbS5a27vdl/BPe1av+jYMCR/+vswtpCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749008655; a=rsa-sha256; cv=none; b=UKh9v2iW54tlgw1LaWd/OxqMtsHk4Ypfy9r8XGr/Zrh7uxD3eP/vtgobJwSpEQ7Pjkq/wY elFj0QjUN8pt1qvvdBqqVmV/m4/Pl7i6GHBeG0yNWskx3Yrs83TloqAl2Fkhf9lrYzP28t htLi8j838wQzS+DCVtt7vcHH1q5pclRnrCjKO8rND84rLLZ3P01C8cF+D83KFDBlqhF0Dn 3+/VFM431+u/u4zAZJnlqdYdTCfXgeCOAmPF1UuSeJA5UZKbpXnsffemBiW/vsBRM+fNjV qNnLN1hG6BoW5OQ+CTWHn0IC9SZC43KuRQmrb9iHuFd/p4ZdSy0ADf0g5qr6DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBtjq5XGgz16g4; Wed, 04 Jun 2025 03:44: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 5543iFLT031097; Wed, 4 Jun 2025 03:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5543iFTm031094; Wed, 4 Jun 2025 03:44:15 GMT (envelope-from git) Date: Wed, 4 Jun 2025 03:44:15 GMT Message-Id: <202506040344.5543iFTm031094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1a3c03d88aaf - main - net80211: migrate if_printf() -> net80211_vap_printf() 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a3c03d88aaf380e9b8bcb5efd3c8c3e84f721b1 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1a3c03d88aaf380e9b8bcb5efd3c8c3e84f721b1 commit 1a3c03d88aaf380e9b8bcb5efd3c8c3e84f721b1 Author: Adrian Chadd AuthorDate: 2025-05-31 19:02:25 +0000 Commit: Adrian Chadd CommitDate: 2025-06-04 03:34:12 +0000 net80211: migrate if_printf() -> net80211_vap_printf() Migrate the if_printf() calls to net80211_vap_printf(), which hides the underlying ifp and the network stack. Note: there are still a LOT of direct printf() calls in the codebase. This is just a mostly mechanical conversion of if_printf() calls. Differential Revision: https://reviews.freebsd.org/D50643 Reviewed by: bz --- sys/net80211/ieee80211.c | 2 +- sys/net80211/ieee80211_adhoc.c | 3 ++- sys/net80211/ieee80211_amrr.c | 9 +++++---- sys/net80211/ieee80211_dfs.c | 10 ++++++---- sys/net80211/ieee80211_hostap.c | 3 ++- sys/net80211/ieee80211_input.c | 15 ++++++++------- sys/net80211/ieee80211_mesh.c | 3 ++- sys/net80211/ieee80211_node.c | 2 +- sys/net80211/ieee80211_rssadapt.c | 9 +++++---- sys/net80211/ieee80211_scan.c | 4 ++-- sys/net80211/ieee80211_scan_sw.c | 12 ++++-------- sys/net80211/ieee80211_sta.c | 3 ++- sys/net80211/ieee80211_wds.c | 3 ++- 13 files changed, 42 insertions(+), 36 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 74fdaa033952..44d6a3294bdc 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -2748,7 +2748,7 @@ ieee80211_is_ctl_frame_for_vap(struct ieee80211_node *ni, const struct mbuf *m0) KASSERT(IEEE80211_IS_CTL(wh), ("%s: not a CTL frame (fc[0]=0x%04x)", __func__, wh->i_fc[0])); if (!IEEE80211_IS_CTL(wh)) { - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "%s: not a control frame (fc[0]=0x%04x)\n", __func__, wh->i_fc[0]); return (false); diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 5f5642884726..85baa132ebcf 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -645,7 +645,8 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, #ifdef IEEE80211_DEBUG if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { - if_printf(ifp, "received %s from %s rssi %d\n", + net80211_vap_printf(vap, + "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 1a06303bd2c9..3ce289fc10b6 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -121,7 +121,7 @@ amrr_init(struct ieee80211vap *vap) amrr = vap->iv_rs = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (amrr == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n"); + net80211_vap_printf(vap, "couldn't alloc ratectl structure\n"); return; } amrr->amrr_min_success_threshold = IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD; @@ -231,7 +231,8 @@ amrr_node_init(struct ieee80211_node *ni) struct ieee80211_amrr_node *amn; if (!amrr) { - if_printf(vap->iv_ifp, "ratectl structure was not allocated, " + net80211_vap_printf(vap, + "ratectl structure was not allocated, " "per-node structure allocation skipped\n"); return; } @@ -240,8 +241,8 @@ amrr_node_init(struct ieee80211_node *ni) ni->ni_rctls = amn = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr_node), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (amn == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " - "structure\n"); + net80211_vap_printf(vap, + "couldn't alloc per-node ratectl structure\n"); return; } } else diff --git a/sys/net80211/ieee80211_dfs.c b/sys/net80211/ieee80211_dfs.c index bce7c2fa5ea4..83774ed8cc71 100644 --- a/sys/net80211/ieee80211_dfs.c +++ b/sys/net80211/ieee80211_dfs.c @@ -144,7 +144,7 @@ cac_timeout(void *arg) ieee80211_notify_cac(ic, ic->ic_curchan, IEEE80211_NOTIFY_CAC_RADAR); - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "CAC timer on channel %u (%u MHz) stopped due to radar\n", ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq); @@ -153,7 +153,7 @@ cac_timeout(void *arg) vap->iv_des_chan = dfs->newchan; ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, 0); } else { - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "CAC timer on channel %u (%u MHz) expired; " "no radar detected\n", ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq); @@ -187,7 +187,8 @@ ieee80211_dfs_cac_start(struct ieee80211vap *vap) IEEE80211_LOCK_ASSERT(ic); callout_reset(&dfs->cac_timer, CAC_TIMEOUT, cac_timeout, vap); - if_printf(vap->iv_ifp, "start %d second CAC timer on channel %u (%u MHz)\n", + net80211_vap_printf(vap, + "start %d second CAC timer on channel %u (%u MHz)\n", ticks_to_secs(CAC_TIMEOUT), ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq); ieee80211_notify_cac(ic, ic->ic_curchan, IEEE80211_NOTIFY_CAC_START); @@ -206,7 +207,8 @@ ieee80211_dfs_cac_stop(struct ieee80211vap *vap) /* NB: racey but not important */ if (callout_pending(&dfs->cac_timer)) { - if_printf(vap->iv_ifp, "stop CAC timer on channel %u (%u MHz)\n", + net80211_vap_printf(vap, + "stop CAC timer on channel %u (%u MHz)\n", ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq); ieee80211_notify_cac(ic, ic->ic_curchan, IEEE80211_NOTIFY_CAC_STOP); diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 1b246c428411..7f5cffcbb145 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -838,7 +838,8 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, #ifdef IEEE80211_DEBUG if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { - if_printf(ifp, "received %s from %s rssi %d\n", + net80211_vap_printf(vap, + "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 7befff22bd6f..f8e9b4665b56 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -950,10 +950,11 @@ ieee80211_note(const struct ieee80211vap *vap, const char *fmt, ...) len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "%s", buf); /* NB: no \n */ + net80211_vap_printf(vap, "%s", buf); /* NB: no \n */ if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_vap_printf(vap, + "%s: XXX buffer too small: len = %d\n", __func__, len); } void @@ -968,7 +969,7 @@ ieee80211_note_frame(const struct ieee80211vap *vap, va_start(ap, fmt); len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "[%s] %s\n", + net80211_vap_printf(vap, "[%s] %s\n", ether_sprintf(ieee80211_getbssid(vap, wh)), buf); if (len >= sizeof(buf)) @@ -987,7 +988,7 @@ ieee80211_note_mac(const struct ieee80211vap *vap, va_start(ap, fmt); len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "[%s] %s\n", ether_sprintf(mac), buf); + net80211_vap_printf(vap, "[%s] %s\n", ether_sprintf(mac), buf); if (len >= sizeof(buf)) printf("%s: XXX buffer too small: len = %d\n", __func__, len); @@ -1006,7 +1007,7 @@ ieee80211_discard_frame(const struct ieee80211vap *vap, len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "[%s] discard %s frame, %s\n", + net80211_vap_printf(vap, "[%s] discard %s frame, %s\n", ether_sprintf(ieee80211_getbssid(vap, wh)), type != NULL ? type : ieee80211_mgt_subtype_name(wh->i_fc[0]), buf); @@ -1028,7 +1029,7 @@ ieee80211_discard_ie(const struct ieee80211vap *vap, len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "[%s] discard%s%s information element, %s\n", + net80211_vap_printf(vap, "[%s] discard%s%s information element, %s\n", ether_sprintf(ieee80211_getbssid(vap, wh)), type != NULL ? " " : "", type != NULL ? type : "", buf); @@ -1049,7 +1050,7 @@ ieee80211_discard_mac(const struct ieee80211vap *vap, len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - if_printf(vap->iv_ifp, "[%s] discard%s%s frame, %s\n", + net80211_vap_printf(vap, "[%s] discard%s%s frame, %s\n", ether_sprintf(mac), type != NULL ? " " : "", type != NULL ? type : "", buf); diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 9f81bc3643aa..dac023af1e41 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1788,7 +1788,8 @@ mesh_input(struct ieee80211_node *ni, struct mbuf *m, if ((ieee80211_msg_debug(vap) && (vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) || ieee80211_msg_dumppkts(vap)) { - if_printf(ifp, "received %s from %s rssi %d\n", + net80211_vap_printf(vap, + "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index a495f2f78113..360e5e7d9abd 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -179,7 +179,7 @@ ieee80211_node_latevattach(struct ieee80211vap *vap) /* XXX should we allow max aid to be zero? */ if (vap->iv_max_aid < IEEE80211_AID_MIN) { vap->iv_max_aid = IEEE80211_AID_MIN; - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "WARNING: max aid too small, changed to %d\n", vap->iv_max_aid); } diff --git a/sys/net80211/ieee80211_rssadapt.c b/sys/net80211/ieee80211_rssadapt.c index 43118aad53c3..d05cfc98c05b 100644 --- a/sys/net80211/ieee80211_rssadapt.c +++ b/sys/net80211/ieee80211_rssadapt.c @@ -137,7 +137,7 @@ rssadapt_init(struct ieee80211vap *vap) vap->iv_rs = rs = IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (rs == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n"); + net80211_vap_printf(vap, "couldn't alloc ratectl structure\n"); return; } rs->vap = vap; @@ -178,7 +178,8 @@ rssadapt_node_init(struct ieee80211_node *ni) const struct ieee80211_rateset *rs = &ni->ni_rates; if (!rsa) { - if_printf(vap->iv_ifp, "ratectl structure was not allocated, " + net80211_vap_printf(vap, + "ratectl structure was not allocated, " "per-node structure allocation skipped\n"); return; } @@ -188,8 +189,8 @@ rssadapt_node_init(struct ieee80211_node *ni) IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt_node), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (ra == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " - "structure\n"); + net80211_vap_printf(vap, + "couldn't alloc per-node ratectl structure\n"); return; } } else diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index f77baac1b134..78ee78fdd74c 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -299,9 +299,9 @@ ieee80211_scan_dump(struct ieee80211_scan_state *ss) { struct ieee80211vap *vap = ss->ss_vap; - if_printf(vap->iv_ifp, "scan set "); + net80211_vap_printf(vap, "scan set "); ieee80211_scan_dump_channels(ss); - printf(" dwell min %ums max %ums\n", + net80211_vap_printf(vap, " dwell min %ums max %ums\n", ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell)); } #endif /* IEEE80211_DEBUG */ diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index d5770ff41968..96658b83fab4 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -815,11 +815,9 @@ scan_end(struct ieee80211_scan_state *ss, int scandone) * driver calls (whilst unlocked), update scandone. */ if ((scandone == 0) && ((ss_priv->ss_iflags & ISCAN_PAUSE) == ISCAN_CANCEL)) { - /* XXX printf? */ - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "%s: OOPS! scan cancelled during driver call (1) (ss_iflags=0x%x)!\n", - __func__, - ss_priv->ss_iflags); + __func__, ss_priv->ss_iflags); scandone = 1; } @@ -886,11 +884,9 @@ scan_end(struct ieee80211_scan_state *ss, int scandone) * driver calls (whilst unlocked), update scandone. */ if (scandone == 0 && (ss_priv->ss_iflags & ISCAN_PAUSE) == ISCAN_CANCEL) { - /* XXX printf? */ - if_printf(vap->iv_ifp, + net80211_vap_printf(vap, "%s: OOPS! scan cancelled during driver call (2) (ss_iflags=0x%x)!\n", - __func__, - ss_priv->ss_iflags); + __func__, ss_priv->ss_iflags); scandone = 1; } diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 062b5610d082..9fc2bf8b7f68 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -916,7 +916,8 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, #ifdef IEEE80211_DEBUG if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { - if_printf(ifp, "received %s from %s rssi %d\n", + net80211_vap_printf(vap, + "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index 98eb7f78c58d..ed8b634a3456 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -703,7 +703,8 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, } #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap) || ieee80211_msg_dumppkts(vap)) { - if_printf(ifp, "received %s from %s rssi %d\n", + net80211_vap_printf(vap, + "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } From nobody Wed Jun 4 03:44:16 2025 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 4bBtjs1zzBz5xNCw; Wed, 04 Jun 2025 03:44:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBtjs02Szz3JLk; Wed, 04 Jun 2025 03:44:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qC6XNSK18RG1CvA0dE0gel/GcuAIJXZ8HtU/dVPssJE=; b=E+I9l/Xrc1idGqLp6c/iRNlEywn6jk3CvTMgQhCrK/LYUhchtjU5COxLAgbWOgseSkCw8o xAaF0Fc6Q7hzHmMbe7rITQd2nHkds5mFE1daCRuOyy9Gn+3pKtAcdUuEVMEnC0sv1IwBps AsRjmcjUHMLCFvKRNUc22OCIiPq/CZFWOzR3MrIJ6trraRvfc0PdsPvUCUmEzTu0D6fz48 6e21HB3J8HQ5qOcDJoZM3AVxUlj9Piw8F0ye8yQ5D1Hl/LezABUEtd0kBRyroKhjUTKeMX 637QIqefU0nmASu8Kg+gNjgYYiijLxhubkUdZjyxwAwiQR6D6pk5NP7lwNVfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qC6XNSK18RG1CvA0dE0gel/GcuAIJXZ8HtU/dVPssJE=; b=Ohu4AmHyaNp2zxOO+yqirks+AC9noDpgGPHJkgPcYPfL9sHFrXH5kpESvYjFpo+qNRFHKz mjdED14eIyno6X5TpGZPKw+5u/Jt4h0JzeYXD8reujOfHix3tK3yJjbPt+bsmG1OrbzVDb LfzpkK4h+P9sNKgwe2/VBa6NtnHMX5Go10ldmoRBvnv73Vi4Nk9NfKdnNMBWqY9tDiz3eO 8DeijjnJVgdYeNUkR7kwmJZ4alGZxhyYuIKhQ6lDVObuCMAhQPKLUSRsUr9mGuklJ6QSXm cmfiVbYuRYcQNZ/8SDmz2rNiCDsbmm3FysDRCr1uAEoPEky95dLNqbjDD7yHZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749008657; a=rsa-sha256; cv=none; b=kKivW3M2C5OjEDXphQFxKgAirnRN38A84cq9hDFaPZAGZtSbzmhKtES3SQ/pcCajz9NVN1 UlkVmzZAlK9CHboVQGwiV9+CaMHpDhI8u3fXcW3CZN4SQo7KfMK74mKyarm/Lup/R8DAlq qJTtr8lqrUDjHqpsOImID0xZqZdYxDGXml/1tlMqUS0TqR4zE6J197MnmSFaRN5zsyayni 9h7qpqFi2lQOstfPhEQZGXcVIbkYyKFhoEf/T2q61ExrnTJu/PEqhVPqfv9AIjO0h6Os1Y jvFgc2iRbLwUK6dK/yDXfxwqAtv7YzDIobD/CM3p3tckSXViJJ1rorsiXc4tnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBtjr6hbqz161P; Wed, 04 Jun 2025 03:44: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 5543iGjN031130; Wed, 4 Jun 2025 03:44:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5543iGMw031127; Wed, 4 Jun 2025 03:44:16 GMT (envelope-from git) Date: Wed, 4 Jun 2025 03:44:16 GMT Message-Id: <202506040344.5543iGMw031127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 674362e27015 - main - net80211: migrate direct printf() to net80211_printf() 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 674362e27015394e105125598cb1518506ae1efa Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=674362e27015394e105125598cb1518506ae1efa commit 674362e27015394e105125598cb1518506ae1efa Author: Adrian Chadd AuthorDate: 2025-06-01 15:30:58 +0000 Commit: Adrian Chadd CommitDate: 2025-06-04 03:34:35 +0000 net80211: migrate direct printf() to net80211_printf() Mechanically migrate printf() -> net80211_printf(). A few places looked like they should be using net80211_vap_printf(), so migrate those appropriately. Differential Revision: https://reviews.freebsd.org/D50644 Reviewed by: bz --- sys/net80211/ieee80211.c | 22 ++++++------- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_alq.c | 4 +-- sys/net80211/ieee80211_crypto.c | 8 ++--- sys/net80211/ieee80211_hostap.c | 4 +-- sys/net80211/ieee80211_hwmp.c | 3 +- sys/net80211/ieee80211_input.c | 21 ++++++++----- sys/net80211/ieee80211_ioctl.c | 2 +- sys/net80211/ieee80211_mesh.c | 5 +-- sys/net80211/ieee80211_node.c | 66 ++++++++++++++++++++------------------- sys/net80211/ieee80211_output.c | 3 +- sys/net80211/ieee80211_power.c | 3 +- sys/net80211/ieee80211_proto.c | 66 +++++++++++++++++++-------------------- sys/net80211/ieee80211_radiotap.c | 4 +-- sys/net80211/ieee80211_scan.c | 20 ++++++------ sys/net80211/ieee80211_scan_sta.c | 16 +++++----- sys/net80211/ieee80211_sta.c | 9 +++--- sys/net80211/ieee80211_superg.c | 11 ++++--- sys/net80211/ieee80211_tdma.c | 24 ++++++++------ sys/net80211/ieee80211_vht.c | 21 ++++++++----- 20 files changed, 167 insertions(+), 147 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 44d6a3294bdc..65ecb5d77607 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1204,7 +1204,7 @@ set_vht_extchan(struct ieee80211_channel *c) return (0); if (IEEE80211_IS_CHAN_VHT80P80(c)) { - printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n", + net80211_printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n", __func__, c->ic_ieee, c->ic_flags); } @@ -1219,7 +1219,7 @@ set_vht_extchan(struct ieee80211_channel *c) ieee80211_mhz2ieee(midpoint, c->ic_flags); c->ic_vht_ch_freq2 = 0; #if 0 - printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", + net80211_printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", __func__, c->ic_ieee, c->ic_freq, midpoint, c->ic_vht_ch_freq1, c->ic_vht_ch_freq2); #endif @@ -1240,7 +1240,7 @@ set_vht_extchan(struct ieee80211_channel *c) ieee80211_mhz2ieee(midpoint, c->ic_flags); c->ic_vht_ch_freq2 = 0; #if 0 - printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", + net80211_printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", __func__, c->ic_ieee, c->ic_freq, midpoint, c->ic_vht_ch_freq1, c->ic_vht_ch_freq2); #endif @@ -1265,7 +1265,7 @@ set_vht_extchan(struct ieee80211_channel *c) return (1); } - printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", + net80211_printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", __func__, c->ic_ieee, c->ic_flags); return (0); @@ -1313,7 +1313,7 @@ addchan(struct ieee80211_channel chans[], int maxchans, int *nchans, return (ENOBUFS); #if 0 - printf("%s: %d of %d: ieee=%d, freq=%d, flags=0x%08x\n", + net80211_printf("%s: %d of %d: ieee=%d, freq=%d, flags=0x%08x\n", __func__, *nchans, maxchans, ieee, freq, flags); #endif @@ -1343,7 +1343,7 @@ copychan_prev(struct ieee80211_channel chans[], int maxchans, int *nchans, return (ENOBUFS); #if 0 - printf("%s: %d of %d: flags=0x%08x\n", + net80211_printf("%s: %d of %d: flags=0x%08x\n", __func__, *nchans, maxchans, flags); #endif @@ -2075,10 +2075,10 @@ ieee80211_announce(struct ieee80211com *ic) if (mword == 0) continue; rate = ieee80211_media2rate(mword); - printf("%s%d%sMbps", (i != 0 ? " " : ""), + net80211_printf("%s%d%sMbps", (i != 0 ? " " : ""), rate / 2, ((rate & 0x1) != 0 ? ".5" : "")); } - printf("\n"); + net80211_printf("\n"); } ieee80211_ht_announce(ic); ieee80211_vht_announce(ic); @@ -2091,7 +2091,7 @@ ieee80211_announce_channels(struct ieee80211com *ic) char type; int i, cw; - printf("Chan Freq CW RegPwr MinPwr MaxPwr\n"); + net80211_printf("Chan Freq CW RegPwr MinPwr MaxPwr\n"); for (i = 0; i < ic->ic_nchans; i++) { c = &ic->ic_channels[i]; if (IEEE80211_IS_CHAN_ST(c)) @@ -2118,7 +2118,7 @@ ieee80211_announce_channels(struct ieee80211com *ic) cw = 5; else cw = 20; - printf("%4d %4d%c %2d%c %6d %4d.%d %4d.%d\n" + net80211_printf("%4d %4d%c %2d%c %6d %4d.%d %4d.%d\n" , c->ic_ieee, c->ic_freq, type , cw , IEEE80211_IS_CHAN_HT40U(c) ? '+' : @@ -2366,7 +2366,7 @@ ieee80211_chan2mode(const struct ieee80211_channel *chan) return IEEE80211_MODE_FH; /* NB: should not get here */ - printf("%s: cannot map channel to mode; freq %u flags 0x%x\n", + net80211_printf("%s: cannot map channel to mode; freq %u flags 0x%x\n", __func__, chan->ic_freq, chan->ic_flags); return IEEE80211_MODE_11B; } diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 85baa132ebcf..adb83004d815 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -235,7 +235,7 @@ adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(vap->iv_bss->ni_essid, ni->ni_esslen); - printf(" channel %d start %uMbit/s\n", + net80211_printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), ieee80211_node_get_txrate_kbit(ni) / 1000); } diff --git a/sys/net80211/ieee80211_alq.c b/sys/net80211/ieee80211_alq.c index c25ef11163d0..95a607a12265 100644 --- a/sys/net80211/ieee80211_alq.c +++ b/sys/net80211/ieee80211_alq.c @@ -79,7 +79,7 @@ ieee80211_alq_setlogging(int enable) ieee80211_alq_qsize, 0); ieee80211_alq_lost = 0; ieee80211_alq_logged = 0; - printf("net80211: logging to %s enabled; " + net80211_printf("net80211: logging to %s enabled; " "struct size %d bytes\n", ieee80211_alq_logfile, (int) sizeof(struct ieee80211_alq_rec)); @@ -87,7 +87,7 @@ ieee80211_alq_setlogging(int enable) if (ieee80211_alq) alq_close(ieee80211_alq); ieee80211_alq = NULL; - printf("net80211: logging disabled\n"); + net80211_printf("net80211: logging disabled\n"); error = 0; } return (error); diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index 6b636da9fa2c..1e63ca46f28f 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -261,12 +261,12 @@ void ieee80211_crypto_register(const struct ieee80211_cipher *cip) { if (cip->ic_cipher >= IEEE80211_CIPHER_MAX) { - printf("%s: cipher %s has an invalid cipher index %u\n", + net80211_printf("%s: cipher %s has an invalid cipher index %u\n", __func__, cip->ic_name, cip->ic_cipher); return; } if (ciphers[cip->ic_cipher] != NULL && ciphers[cip->ic_cipher] != cip) { - printf("%s: cipher %s registered with a different template\n", + net80211_printf("%s: cipher %s registered with a different template\n", __func__, cip->ic_name); return; } @@ -280,12 +280,12 @@ void ieee80211_crypto_unregister(const struct ieee80211_cipher *cip) { if (cip->ic_cipher >= IEEE80211_CIPHER_MAX) { - printf("%s: cipher %s has an invalid cipher index %u\n", + net80211_printf("%s: cipher %s has an invalid cipher index %u\n", __func__, cip->ic_name, cip->ic_cipher); return; } if (ciphers[cip->ic_cipher] != NULL && ciphers[cip->ic_cipher] != cip) { - printf("%s: cipher %s registered with a different template\n", + net80211_printf("%s: cipher %s registered with a different template\n", __func__, cip->ic_name); return; } diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 7f5cffcbb145..990b07f90032 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -309,7 +309,7 @@ hostap_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(ni->ni_essid, ni->ni_esslen); - printf(" channel %d start %uMbit/s\n", + net80211_printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), ieee80211_node_get_txrate_kbit(ni) / 1000); } @@ -2218,7 +2218,7 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, vhtcap != NULL && vhtinfo != NULL) { /* XXX TODO; see below */ - printf("%s: VHT TODO!\n", __func__); + net80211_vap_printf(vap, "%s: VHT TODO!\n", __func__); ieee80211_vht_node_init(ni); ieee80211_vht_update_cap(ni, vhtcap, vhtinfo); } else if (ni->ni_flags & IEEE80211_NODE_VHT) diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index c47e845bb8a8..b69210768c54 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -261,7 +261,8 @@ hwmp_vattach(struct ieee80211vap *vap) hs = IEEE80211_MALLOC(sizeof(struct ieee80211_hwmp_state), M_80211_VAP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (hs == NULL) { - printf("%s: couldn't alloc HWMP state\n", __func__); + net80211_vap_printf(vap, "%s: couldn't alloc HWMP state\n", + __func__); return; } hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index f8e9b4665b56..69ec286305b4 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -901,7 +901,7 @@ ieee80211_parse_action(struct ieee80211_node *ni, struct mbuf *m) break; #endif case IEEE80211_ACTION_CAT_VHT: - printf("%s: TODO: VHT handling!\n", __func__); + net80211_printf("%s: TODO: VHT handling!\n", __func__); break; } return 0; @@ -915,10 +915,10 @@ void ieee80211_ssid_mismatch(struct ieee80211vap *vap, const char *tag, uint8_t mac[IEEE80211_ADDR_LEN], uint8_t *ssid) { - printf("[%s] discard %s frame, ssid mismatch: ", + net80211_printf("[%s] discard %s frame, ssid mismatch: ", ether_sprintf(mac), tag); ieee80211_print_essid(ssid + 2, ssid[1]); - printf("\n"); + net80211_printf("\n"); } /* @@ -973,7 +973,8 @@ ieee80211_note_frame(const struct ieee80211vap *vap, ether_sprintf(ieee80211_getbssid(vap, wh)), buf); if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_printf("%s: XXX buffer too small: len = %d\n", + __func__, len); } void @@ -991,7 +992,8 @@ ieee80211_note_mac(const struct ieee80211vap *vap, net80211_vap_printf(vap, "[%s] %s\n", ether_sprintf(mac), buf); if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_printf("%s: XXX buffer too small: len = %d\n", + __func__, len); } void @@ -1013,7 +1015,8 @@ ieee80211_discard_frame(const struct ieee80211vap *vap, buf); if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_printf("%s: XXX buffer too small: len = %d\n", + __func__, len); } void @@ -1034,7 +1037,8 @@ ieee80211_discard_ie(const struct ieee80211vap *vap, type != NULL ? " " : "", type != NULL ? type : "", buf); if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_printf("%s: XXX buffer too small: len = %d\n", + __func__, len); } void @@ -1055,6 +1059,7 @@ ieee80211_discard_mac(const struct ieee80211vap *vap, type != NULL ? " " : "", type != NULL ? type : "", buf); if (len >= sizeof(buf)) - printf("%s: XXX buffer too small: len = %d\n", __func__, len); + net80211_printf("%s: XXX buffer too small: len = %d\n", + __func__, len); } #endif /* IEEE80211_DEBUG */ diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 85d46c018d36..4c3e5fa94243 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -2131,7 +2131,7 @@ ieee80211_ioctl_setchannel(struct ieee80211vap *vap, } break; case IEEE80211_MODE_VHT_2GHZ: - printf("%s: TBD\n", __func__); + net80211_printf("%s: TBD\n", __func__); break; case IEEE80211_MODE_VHT_5GHZ: if (IEEE80211_IS_CHAN_A(c)) { diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index dac023af1e41..4a9cd5e66a97 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -664,7 +664,8 @@ mesh_vattach(struct ieee80211vap *vap) ms = IEEE80211_MALLOC(sizeof(struct ieee80211_mesh_state), M_80211_VAP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (ms == NULL) { - printf("%s: couldn't alloc MBSS state\n", __func__); + net80211_vap_printf(vap, "%s: couldn't alloc MBSS state\n", + __func__); return; } vap->iv_mesh = ms; @@ -821,7 +822,7 @@ mesh_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ieee80211_print_essid(ni->ni_meshid, ni->ni_meshidlen); /* XXX MCS/HT */ - printf(" channel %d\n", + net80211_printf(" channel %d\n", ieee80211_chan2ieee(ic, ic->ic_curchan)); } #endif diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 360e5e7d9abd..de19bc6a7361 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -189,7 +189,8 @@ ieee80211_node_latevattach(struct ieee80211vap *vap) IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (vap->iv_aid_bitmap == NULL) { /* XXX no way to recover */ - printf("%s: no memory for AID bitmap, max aid %d!\n", + net80211_vap_printf(vap, + "%s: no memory for AID bitmap, max aid %d!\n", __func__, vap->iv_max_aid); vap->iv_max_aid = 0; } @@ -577,22 +578,22 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni) !IEEE80211_ADDR_EQ(vap->iv_des_bssid, ni->ni_bssid)) fail |= 0x20; - printf(" %c %s", fail ? '-' : '+', ether_sprintf(ni->ni_macaddr)); - printf(" %s%c", ether_sprintf(ni->ni_bssid), fail & 0x20 ? '!' : ' '); - printf(" %3d%c", + net80211_printf(" %c %s", fail ? '-' : '+', ether_sprintf(ni->ni_macaddr)); + net80211_printf(" %s%c", ether_sprintf(ni->ni_bssid), fail & 0x20 ? '!' : ' '); + net80211_printf(" %3d%c", ieee80211_chan2ieee(ic, ni->ni_chan), fail & 0x01 ? '!' : ' '); - printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2, + net80211_printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2, fail & 0x08 ? '!' : ' '); - printf(" %4s%c", + net80211_printf(" %4s%c", (ni->ni_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" : (ni->ni_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" : "????", fail & 0x02 ? '!' : ' '); - printf(" %3s%c ", + net80211_printf(" %3s%c ", (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) ? "wep" : "no", fail & 0x04 ? '!' : ' '); ieee80211_print_essid(ni->ni_essid, ni->ni_esslen); - printf("%s\n", fail & 0x10 ? "!" : ""); + net80211_printf("%s\n", fail & 0x10 ? "!" : ""); } #endif /* IEEE80211_DEBUG */ @@ -1035,10 +1036,9 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, ni->ni_ies.vhtcap_ie != NULL && vap->iv_vht_flags & IEEE80211_FVHT_VHT) { if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { - printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", - __func__, - ni->ni_macaddr, - ":"); + net80211_vap_printf(ni->ni_vap, + "%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", + __func__, ni->ni_macaddr, ":"); } else { ieee80211_vht_node_init(ni); ieee80211_vht_updateparams(ni, @@ -1166,7 +1166,7 @@ ieee80211_ies_expand(struct ieee80211_ies *ies) while (ielen > 1) { /* Make sure the given IE length fits into the total length. */ if ((2 + ie[1]) > ielen) { - printf("%s: malformed IEs! ies %p { data %p len %d }: " + net80211_printf("%s: malformed IEs! ies %p { data %p len %d }: " "ie %u len 2+%u > total len left %d\n", __func__, ies, ies->data, ies->len, ie[0], ie[1], ielen); @@ -1607,7 +1607,8 @@ ieee80211_node_create_wds(struct ieee80211vap *vap, */ ieee80211_ht_wds_init(ni); if (vap->iv_vht_flags & IEEE80211_FVHT_VHT) { - printf("%s: TODO: vht_wds_init\n", __func__); + net80211_vap_printf(vap, + "%s: TODO: vht_wds_init\n", __func__); } } else { struct ieee80211_channel *c = ni->ni_chan; @@ -1864,10 +1865,9 @@ ieee80211_init_neighbor(struct ieee80211_node *ni, if (do_vht_setup) { if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { - printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", - __func__, - ni->ni_macaddr, - ":"); + net80211_vap_printf(ni->ni_vap, + "%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", + __func__, ni->ni_macaddr, ":"); } else { ieee80211_vht_node_init(ni); ieee80211_vht_updateparams(ni, @@ -2341,7 +2341,7 @@ ieee80211_node_table_cleanup(struct ieee80211_node_table *nt) int i; for (i = 0; i < nt->nt_keyixmax; i++) if (nt->nt_keyixmap[i] != NULL) - printf("%s: %s[%u] still active\n", __func__, + net80211_printf("%s: %s[%u] still active\n", __func__, nt->nt_name, i); #endif IEEE80211_FREE(nt->nt_keyixmap, M_80211_NODE); @@ -2645,36 +2645,36 @@ void ieee80211_dump_node(struct ieee80211_node_table *nt __unused, struct ieee80211_node *ni) { - printf("%p: mac %s refcnt %d\n", ni, + net80211_printf("%p: mac %s refcnt %d\n", ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)); - printf("\tauthmode %u flags 0x%x\n", + net80211_printf("\tauthmode %u flags 0x%x\n", ni->ni_authmode, ni->ni_flags); - printf("\tassocid 0x%x txpower %u vlan %u\n", + net80211_printf("\tassocid 0x%x txpower %u vlan %u\n", ni->ni_associd, ni->ni_txpower, ni->ni_vlan); - printf("\ttxseq %u rxseq %u fragno %u rxfragstamp %u\n", + net80211_printf("\ttxseq %u rxseq %u fragno %u rxfragstamp %u\n", ni->ni_txseqs[IEEE80211_NONQOS_TID], ni->ni_rxseqs[IEEE80211_NONQOS_TID] >> IEEE80211_SEQ_SEQ_SHIFT, ni->ni_rxseqs[IEEE80211_NONQOS_TID] & IEEE80211_SEQ_FRAG_MASK, ni->ni_rxfragstamp); - printf("\trssi %d noise %d intval %u capinfo 0x%x\n", + net80211_printf("\trssi %d noise %d intval %u capinfo 0x%x\n", node_getrssi(ni), ni->ni_noise, ni->ni_intval, ni->ni_capinfo); - printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", + net80211_printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", ether_sprintf(ni->ni_bssid), ni->ni_esslen, ni->ni_essid, (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_freq : 0, (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_flags : 0); - printf("\tinact %u inact_reload %u txrate type %d dot11rate %u\n", + net80211_printf("\tinact %u inact_reload %u txrate type %d dot11rate %u\n", ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate.type, ni->ni_txrate.dot11rate); - printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", + net80211_printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); - printf("\thtopmode %x htstbc %x htchw %d (%s)\n", + net80211_printf("\thtopmode %x htstbc %x htchw %d (%s)\n", ni->ni_htopmode, ni->ni_htstbc, ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw)); - printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n", + net80211_printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n", ni->ni_vhtcap, (int) ni->ni_vht_chan1, (int) ni->ni_vht_chan2, (int) ni->ni_vht_basicmcs); /* XXX VHT state */ @@ -3162,7 +3162,8 @@ ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *ni) break; case IEEE80211_NODE_TXRATE_VHT: default: - printf("%s: called for VHT / unknown rate (type %d)!\n", + net80211_vap_printf(ni->ni_vap, + "%s: called for VHT / unknown rate (type %d)!\n", __func__, ni->ni_txrate.type); return (12); /* OFDM6 for now */ } @@ -3324,8 +3325,9 @@ ieee80211_node_get_txrate_kbit(struct ieee80211_node *ni) ni->ni_txrate.nss, ni->ni_txrate.mcs, false); break; default: - printf("%s: called for unknown rate (type %d)!\n", - __func__, ni->ni_txrate.type); + net80211_vap_printf(ni->ni_vap, + "%s: called for unknown rate (type %d)!\n", __func__, + ni->ni_txrate.type); return (0); } diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 9466b4851881..a4151f807882 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1834,7 +1834,8 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, * be forced to be non-QoS traffic to be A-MSDU encapsulated. */ if (is_amsdu) - printf("%s: XXX ERROR: is_amsdu set; not QoS!\n", + net80211_vap_printf(vap, + "%s: XXX ERROR: is_amsdu set; not QoS!\n", __func__); } diff --git a/sys/net80211/ieee80211_power.c b/sys/net80211/ieee80211_power.c index 13a49940f6f0..f39c6418710d 100644 --- a/sys/net80211/ieee80211_power.c +++ b/sys/net80211/ieee80211_power.c @@ -88,7 +88,8 @@ ieee80211_power_latevattach(struct ieee80211vap *vap) M_80211_POWER, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (vap->iv_tim_bitmap == NULL) { - printf("%s: no memory for TIM bitmap!\n", __func__); + net80211_vap_printf(vap, + "%s: no memory for TIM bitmap!\n", __func__); /* XXX good enough to keep from crashing? */ vap->iv_tim_len = 0; } diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 14c0d2beaad5..0c161d98a55a 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -504,7 +504,7 @@ static const struct ieee80211_aclator *acl = NULL; void ieee80211_aclator_register(const struct ieee80211_aclator *iac) { - printf("wlan: %s acl policy registered\n", iac->iac_name); + net80211_printf("wlan: %s acl policy registered\n", iac->iac_name); acl = iac; } @@ -513,7 +513,7 @@ ieee80211_aclator_unregister(const struct ieee80211_aclator *iac) { if (acl == iac) acl = NULL; - printf("wlan: %s acl policy unregistered\n", iac->iac_name); + net80211_printf("wlan: %s acl policy unregistered\n", iac->iac_name); } const struct ieee80211_aclator * @@ -538,14 +538,14 @@ ieee80211_print_essid(const uint8_t *essid, int len) break; } if (i == len) { - printf("\""); + net80211_printf("\""); for (i = 0, p = essid; i < len; i++, p++) - printf("%c", *p); - printf("\""); + net80211_printf("%c", *p); + net80211_printf("\""); } else { - printf("0x"); + net80211_printf("0x"); for (i = 0, p = essid; i < len; i++, p++) - printf("%02x", *p); + net80211_printf("%02x", *p); } } @@ -559,67 +559,67 @@ ieee80211_dump_pkt(struct ieee80211com *ic, wh = (const struct ieee80211_frame *)buf; switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) { case IEEE80211_FC1_DIR_NODS: - printf("NODS %s", ether_sprintf(wh->i_addr2)); - printf("->%s", ether_sprintf(wh->i_addr1)); - printf("(%s)", ether_sprintf(wh->i_addr3)); + net80211_printf("NODS %s", ether_sprintf(wh->i_addr2)); + net80211_printf("->%s", ether_sprintf(wh->i_addr1)); + net80211_printf("(%s)", ether_sprintf(wh->i_addr3)); break; case IEEE80211_FC1_DIR_TODS: - printf("TODS %s", ether_sprintf(wh->i_addr2)); - printf("->%s", ether_sprintf(wh->i_addr3)); - printf("(%s)", ether_sprintf(wh->i_addr1)); + net80211_printf("TODS %s", ether_sprintf(wh->i_addr2)); + net80211_printf("->%s", ether_sprintf(wh->i_addr3)); + net80211_printf("(%s)", ether_sprintf(wh->i_addr1)); break; case IEEE80211_FC1_DIR_FROMDS: - printf("FRDS %s", ether_sprintf(wh->i_addr3)); - printf("->%s", ether_sprintf(wh->i_addr1)); - printf("(%s)", ether_sprintf(wh->i_addr2)); + net80211_printf("FRDS %s", ether_sprintf(wh->i_addr3)); + net80211_printf("->%s", ether_sprintf(wh->i_addr1)); + net80211_printf("(%s)", ether_sprintf(wh->i_addr2)); break; case IEEE80211_FC1_DIR_DSTODS: - printf("DSDS %s", ether_sprintf((const uint8_t *)&wh[1])); - printf("->%s", ether_sprintf(wh->i_addr3)); - printf("(%s", ether_sprintf(wh->i_addr2)); - printf("->%s)", ether_sprintf(wh->i_addr1)); + net80211_printf("DSDS %s", ether_sprintf((const uint8_t *)&wh[1])); + net80211_printf("->%s", ether_sprintf(wh->i_addr3)); + net80211_printf("(%s", ether_sprintf(wh->i_addr2)); + net80211_printf("->%s)", ether_sprintf(wh->i_addr1)); break; } switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { case IEEE80211_FC0_TYPE_DATA: - printf(" data"); + net80211_printf(" data"); break; case IEEE80211_FC0_TYPE_MGT: - printf(" %s", ieee80211_mgt_subtype_name(wh->i_fc[0])); + net80211_printf(" %s", ieee80211_mgt_subtype_name(wh->i_fc[0])); break; default: - printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK); + net80211_printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK); break; } if (IEEE80211_QOS_HAS_SEQ(wh)) { const struct ieee80211_qosframe *qwh = (const struct ieee80211_qosframe *)buf; - printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID, + net80211_printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID, qwh->i_qos[0] & IEEE80211_QOS_ACKPOLICY ? " ACM" : ""); } if (IEEE80211_IS_PROTECTED(wh)) { int off; off = ieee80211_anyhdrspace(ic, wh); - printf(" WEP [IV %.02x %.02x %.02x", + net80211_printf(" WEP [IV %.02x %.02x %.02x", buf[off+0], buf[off+1], buf[off+2]); if (buf[off+IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV) - printf(" %.02x %.02x %.02x", + net80211_printf(" %.02x %.02x %.02x", buf[off+4], buf[off+5], buf[off+6]); - printf(" KID %u]", buf[off+IEEE80211_WEP_IVLEN] >> 6); + net80211_printf(" KID %u]", buf[off+IEEE80211_WEP_IVLEN] >> 6); } if (rate >= 0) - printf(" %dM", rate / 2); + net80211_printf(" %dM", rate / 2); if (rssi >= 0) - printf(" +%d", rssi); - printf("\n"); + net80211_printf(" +%d", rssi); + net80211_printf("\n"); if (len > 0) { for (i = 0; i < len; i++) { if ((i & 1) == 0) - printf(" "); - printf("%02x", buf[i]); + net80211_printf(" "); + net80211_printf("%02x", buf[i]); } - printf("\n"); + net80211_printf("\n"); } } diff --git a/sys/net80211/ieee80211_radiotap.c b/sys/net80211/ieee80211_radiotap.c index 79e00106a780..e79aba550f50 100644 --- a/sys/net80211/ieee80211_radiotap.c +++ b/sys/net80211/ieee80211_radiotap.c @@ -354,14 +354,14 @@ radiotap_offset(struct ieee80211_radiotap_header *rh, continue; if (items[i].align == 0) { /* NB: unidentified element, don't guess */ - printf("%s: unknown item %d\n", __func__, i); + net80211_printf("%s: unknown item %d\n", __func__, i); return -1; } off = roundup2(off, items[i].align); if (i == item) { if (off + items[i].width > le16toh(rh->it_len)) { /* NB: item does not fit in header data */ - printf("%s: item %d not in header data, " + net80211_printf("%s: item %d not in header data, " "off %d width %zu len %d\n", __func__, i, off, items[i].width, le16toh(rh->it_len)); return -1; diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index 78ee78fdd74c..d54cde157c6c 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -288,7 +288,7 @@ ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) for (i = ss->ss_next; i < ss->ss_last; i++) { const struct ieee80211_channel *c = ss->ss_chans[i]; - printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c), + net80211_printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c), ieee80211_channel_type_char(c)); sep = ", "; } @@ -547,21 +547,21 @@ dump_country(const uint8_t *ie) int i, nbands, schan, nchan; if (cie->len < 3) { - printf(" ", cie->len); + net80211_printf(" ", cie->len); return; } - printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]); + net80211_printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]); nbands = (cie->len - 3) / sizeof(cie->band[0]); for (i = 0; i < nbands; i++) { schan = cie->band[i].schan; nchan = cie->band[i].nchan; if (nchan != 1) - printf(" %u-%u,%u", schan, schan + nchan-1, + net80211_printf(" %u-%u,%u", schan, schan + nchan-1, cie->band[i].maxtxpwr); else - printf(" %u,%u", schan, cie->band[i].maxtxpwr); + net80211_printf(" %u,%u", schan, cie->band[i].maxtxpwr); } - printf("]"); + net80211_printf("]"); } void @@ -570,18 +570,18 @@ ieee80211_scan_dump_probe_beacon(uint8_t subtype, int isnew, const struct ieee80211_scanparams *sp, int rssi) { - printf("[%s] %s%s on chan %u (bss chan %u) ", + net80211_printf("[%s] %s%s on chan %u (bss chan %u) ", ether_sprintf(mac), isnew ? "new " : "", ieee80211_mgt_subtype_name(subtype), sp->chan, sp->bchan); ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]); - printf(" rssi %d\n", rssi); + net80211_printf(" rssi %d\n", rssi); if (isnew) { - printf("[%s] caps 0x%x bintval %u erp 0x%x", + net80211_printf("[%s] caps 0x%x bintval %u erp 0x%x", ether_sprintf(mac), sp->capinfo, sp->bintval, sp->erp); if (sp->country != NULL) dump_country(sp->country); - printf("\n"); + net80211_printf("\n"); } } #endif /* IEEE80211_DEBUG */ diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index 69347a5d99cf..529552d3719a 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -1157,7 +1157,7 @@ match_bss(struct ieee80211vap *vap, fail |= MATCH_RSSI; #ifdef IEEE80211_DEBUG if (ieee80211_msg(vap, debug)) { - printf(" %c %s", + net80211_printf(" %c %s", fail & MATCH_FAILS ? '=' : fail & MATCH_NOTSEEN ? '^' : fail & MATCH_CC ? '$' : @@ -1170,23 +1170,23 @@ match_bss(struct ieee80211vap *vap, #endif fail & MATCH_MESH_NOID ? 'm' : fail ? '-' : '+', ether_sprintf(se->se_macaddr)); - printf(" %s%c", ether_sprintf(se->se_bssid), + net80211_printf(" %s%c", ether_sprintf(se->se_bssid), fail & MATCH_BSSID ? '!' : ' '); - printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan), + net80211_printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan), fail & MATCH_CHANNEL ? '!' : ' '); - printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' '); - printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2, + net80211_printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' '); + net80211_printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2, fail & MATCH_RATE ? '!' : ' '); - printf(" %4s%c", + net80211_printf(" %4s%c", (se->se_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" : (se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" : "", fail & MATCH_CAPINFO ? '!' : ' '); - printf(" %3s%c ", + net80211_printf(" %3s%c ", (se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) ? "wep" : "no", fail & MATCH_PRIVACY ? '!' : ' '); ieee80211_print_essid(se->se_ssid+2, se->se_ssid[1]); - printf("%s\n", fail & (MATCH_SSID | MATCH_MESHID) ? "!" : ""); + net80211_printf("%s\n", fail & (MATCH_SSID | MATCH_MESHID) ? "!" : ""); } #endif return fail; diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 9fc2bf8b7f68..a41e3f5793dd 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -415,7 +415,7 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(vap->iv_bss->ni_essid, ni->ni_esslen); - printf(" channel %d start %uMbit/s\n", + net80211_printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), ieee80211_node_get_txrate_kbit(ni) / 1000); } @@ -1870,10 +1870,9 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, * We aren't ready for 2GHz VHT support. */ if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { - printf("%s: peer %6D: VHT on 2GHz, ignoring\n", - __func__, - ni->ni_macaddr, - ":"); + net80211_vap_printf(vap, + "%s: peer %6D: VHT on 2GHz, ignoring\n", + __func__, ni->ni_macaddr, ":"); } else { ieee80211_vht_node_init(ni); ieee80211_vht_updateparams(ni, vhtcap, vhtopmode); diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c index fcf0c614b0a0..cd1516302561 100644 --- a/sys/net80211/ieee80211_superg.c +++ b/sys/net80211/ieee80211_superg.c @@ -115,8 +115,8 @@ ieee80211_superg_attach(struct ieee80211com *ic) sizeof(struct ieee80211_superg), M_80211_VAP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (sg == NULL) { - printf("%s: cannot allocate SuperG state block\n", - __func__); + net80211_ic_printf(ic, + "%s: cannot allocate SuperG state block\n", __func__); return; } TIMEOUT_TASK_INIT(ic->ic_tq, &sg->ff_qtimer, 0, ff_age_all, ic); @@ -382,7 +382,8 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, ETHER_HEADER_COPY(&eh1, mtod(m1, caddr_t)); m1 = ieee80211_mbuf_adjust(vap, hdrspace, key, m1); if (m1 == NULL) { - printf("%s: failed initial mbuf_adjust\n", __func__); + net80211_vap_printf(vap, "%s: failed initial mbuf_adjust\n", + __func__); /* NB: ieee80211_mbuf_adjust handles msgs+statistics */ m_freem(m2); goto bad; @@ -398,7 +399,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, m2 = ieee80211_mbuf_adjust(vap, 4, NULL, m2); if (m2 == NULL) { /* NB: ieee80211_mbuf_adjust handles msgs+statistics */ - printf("%s: failed second \n", __func__); + net80211_vap_printf(vap, "%s: failed second \n", __func__); goto bad; } @@ -714,7 +715,7 @@ stageq_remove(struct ieee80211com *ic, struct ieee80211_stageq *sq, struct mbuf } mprev = m; } - printf("%s: packet not found\n", __func__); + net80211_ic_printf(ic, "%s: packet not found\n", __func__); } static uint32_t diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c index 90ab2525e488..956158dbe767 100644 --- a/sys/net80211/ieee80211_tdma.c +++ b/sys/net80211/ieee80211_tdma.c @@ -153,7 +153,8 @@ ieee80211_tdma_vattach(struct ieee80211vap *vap) sizeof(struct ieee80211_tdma_state), M_80211_VAP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (ts == NULL) { - printf("%s: cannot allocate TDMA state block\n", __func__); + net80211_vap_printf(vap, + "%s: cannot allocate TDMA state block\n", __func__); /* NB: fall back to adhdemo mode */ vap->iv_caps &= ~IEEE80211_C_TDMA; return; @@ -419,8 +420,9 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, if (tdma->tdma_slotcnt != ts->tdma_slotcnt) { if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) { if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) - printf("%s: bad slot cnt %u\n", - __func__, tdma->tdma_slotcnt); + net80211_vap_printf(vap, + "%s: bad slot cnt %u\n", __func__, + tdma->tdma_slotcnt); return 0; } update |= TDMA_UPDATE_SLOTCNT; @@ -429,8 +431,8 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, if (slotlen != ts->tdma_slotlen) { if (!TDMA_SLOTLEN_VALID(slotlen)) { if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) - printf("%s: bad slot len %u\n", - __func__, slotlen); + net80211_vap_printf(vap, + "%s: bad slot len %u\n", __func__, slotlen); return 0; } update |= TDMA_UPDATE_SLOTLEN; @@ -438,8 +440,9 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, if (tdma->tdma_bintval != ts->tdma_bintval) { if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) { if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) - printf("%s: bad beacon interval %u\n", - __func__, tdma->tdma_bintval); + net80211_vap_printf(vap, + "%s: bad beacon interval %u\n", __func__, + tdma->tdma_bintval); return 0; } update |= TDMA_UPDATE_BINTVAL; @@ -453,9 +456,10 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, if (isclr(tdma->tdma_inuse, slot)) break; if (slot <= 0) { - printf("%s: no free slot, slotcnt %u inuse: 0x%x\n", - __func__, tdma->tdma_slotcnt, - tdma->tdma_inuse[0]); + net80211_vap_printf(vap, + "%s: no free slot, slotcnt %u inuse: 0x%x\n", + __func__, tdma->tdma_slotcnt, + tdma->tdma_inuse[0]); /* XXX need to do something better */ return 0; } diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index eb4ea615da75..e91977f1ef98 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -250,7 +250,8 @@ ieee80211_parse_vhtopmode(struct ieee80211_node *ni, const uint8_t *ie) ni->ni_vht_basicmcs = le16dec(ie + 5); #if 0 - printf("%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n", + net80211_vap_printf(ni->ni_vap, + "%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n", __func__, ni->ni_vht_chan1, ni->ni_vht_chan2, ni->ni_vht_chanwidth, ni->ni_vht_basicmcs); #endif @@ -774,7 +775,8 @@ ieee80211_add_vhtcap_ch(uint8_t *frm, struct ieee80211vap *vap, } static uint8_t -ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c) +ieee80211_vht_get_chwidth_ie(const struct ieee80211vap *vap, + const struct ieee80211_channel *c) { /* @@ -794,7 +796,8 @@ ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c) return IEEE80211_VHT_CHANWIDTH_USE_HT; /* We shouldn't get here */ - printf("%s: called on a non-VHT channel (freq=%d, flags=0x%08x\n", + net80211_vap_printf(vap, + "%s: called on a non-VHT channel (freq=%d, flags=0x%08x\n", __func__, (int) c->ic_freq, c->ic_flags); return IEEE80211_VHT_CHANWIDTH_USE_HT; } @@ -820,7 +823,7 @@ ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) frm += 2; *** 44 LINES SKIPPED *** From nobody Wed Jun 4 03:44:17 2025 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 4bBtjt4rPdz5xN8g; Wed, 04 Jun 2025 03:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBtjt16jwz3JNH; Wed, 04 Jun 2025 03:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaqO7GoRVnG7wkJJAt63922C5okMnQuo9oYSCDMDn8M=; b=Xc88XiZVtSrWtwWq6vAKQYy0yu2rVwuDStkP9Ry9ajsCSep9m0O+/ywAV1JlKJVRwkUxlQ rthr9Yg3gwLLRhLvUua7iM2cdiODpAOlDiR0zNJsZmljGQwkvgtUYxvFSqLHL0rdE9JEYm 8mkmQcJjO4iJU25E3T4JEZ7mnvfWWD8MR21y+PEBcnT63UI788ol2CV3f358SqueJZjWH6 88531kS764azXnguY9DfpSA08A3cP9PYnkqTj14hGArUikcH9ZOyl+m0a+aXe62DDXnsbY 0Aa/xN4GfdkyA8/x7jfesgfjl0VREe50aKvFYGGNTWUopKKnmQzrCH5Q/uvOWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaqO7GoRVnG7wkJJAt63922C5okMnQuo9oYSCDMDn8M=; b=NhLpj9mBOVbxsBn6+tafGN3a4FAY35gcSxym2D0Bu72mt2iG23CJkBolVR+cm+4IpnStil seFtI5s2LysoqdaXFI9JsIicRyGo4ip87qPCrOJYPkofDI5UEtHjK98RlilvnXMTE//S3U pkIjmLyfIO7ueN6kNFi19+w+fmkO83XYhggxr0Qm5rax7WPmpsWAt4LI6btjG3t2PFl3S8 52YCCBT24kLjw6oBXpi1dtQSwIWsx5tvSBCjnmPlVFFd5qSjwHEGpe1iuoVT8SyA/N+rnK giEn3qmTLe+xAaLFt2hxxGhmWmoRimdE2zMlxPKCJtoklFoAv//Tf3Qa1A5aMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749008658; a=rsa-sha256; cv=none; b=TjqZ8IJZL4j8VkAmTQc69hcdMxPxEmxiDzFqWM45FPJz3+XFWxPRdH9illciQ0ZwSjcG36 VGCSifdslLujsfELwkFrdJ0VeVYXTaukZ4GLdT2eThEf1MSuLRuZiErTRlff/uv1x4xYU/ dwpQYGoc8cfGooWQXBzmVqt7BNy7p13WKATXVmaItkRtUNvI3KfvOT+DlDEA54HJFlz5Bg CHKecJyV6w3ow+Zn11CbR+eTm2EJnZDHJsXU9UwUvRGjRtkO0SmyFrYieDF5+JZ+sfN7Jk F+qPVgMjtwPWxHocAo5bPOW+UumBq3uHnGsqcmWhO6ejTd8vsPt4+wn9ToS+Qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBtjt0YGLz161Q; Wed, 04 Jun 2025 03:44:18 +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 5543iHEU031162; Wed, 4 Jun 2025 03:44:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5543iHDJ031159; Wed, 4 Jun 2025 03:44:17 GMT (envelope-from git) Date: Wed, 4 Jun 2025 03:44:17 GMT Message-Id: <202506040344.5543iHDJ031159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 2a1beace07f1 - main - net80211: convert ieee80211_mesh.c to not require if_private.h 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a1beace07f150ee4839a6bcf949479986e61861 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=2a1beace07f150ee4839a6bcf949479986e61861 commit 2a1beace07f150ee4839a6bcf949479986e61861 Author: Adrian Chadd AuthorDate: 2025-06-02 02:20:02 +0000 Commit: Adrian Chadd CommitDate: 2025-06-04 03:35:00 +0000 net80211: convert ieee80211_mesh.c to not require if_private.h Convert the couple of uses of ifnet structure bits into ifnet calls and remove the header. Differential Revision: https://reviews.freebsd.org/D50645 Reviewed by: bz --- sys/net80211/ieee80211_mesh.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 4a9cd5e66a97..3f0410a69e3c 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include @@ -3302,11 +3301,11 @@ mesh_airtime_calc(struct ieee80211_node *ni) /* Time to transmit a frame */ rate = ieee80211_node_get_txrate_dot11rate(ni); overhead = ieee80211_compute_duration(ic->ic_rt, - ifp->if_mtu + IEEE80211_MESH_MAXOVERHEAD, rate, 0) << M_BITS; + if_getmtu(ifp) + IEEE80211_MESH_MAXOVERHEAD, rate, 0) << M_BITS; /* Error rate in percentage */ /* XXX assuming small failures are ok */ - errrate = (((ifp->if_get_counter(ifp, IFCOUNTER_OERRORS) + - ifp->if_get_counter(ifp, IFCOUNTER_IERRORS)) / 100) << M_BITS) + errrate = (((if_getcounter(ifp, IFCOUNTER_OERRORS) + + if_getcounter(ifp, IFCOUNTER_IERRORS)) / 100) << M_BITS) / 100; res = (overhead + (nbits / rate)) * ((1 << S_FACTOR) / ((1 << M_BITS) - errrate)); From nobody Wed Jun 4 03:44:19 2025 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 4bBtjw3fbPz5xND4; Wed, 04 Jun 2025 03:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBtjv66Fmz3JGR; Wed, 04 Jun 2025 03:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJUKiRggcaQ+cyo2kK11rv1ozxRl1uWUU4BPl+QM6QY=; b=Wym2P9UKQBubbfqGeUpWoFLAuFvIdjmxqWXzmoiAVbzUztW7Al/+5ERr5+nIH83ZbqrRbQ hdJtkVu/pJq8QVIBLDpRBS/jdcM/nZ9nOlDYhLLYp9LiN0cqDkDxGCBlG+Vx59f9A/hgcl cTxQTQSoBunsz+/36//wwGM6OKRYU8q7YyduaLEuUupoCEY0au8968LUVThmRbnwbAwW0M oTdEzLljyo3YgbFR+jEB/Q+Jh7+YR5yWe5GowyBisGGD5p24e3awrudkvb8LIUjgNuqRQ+ jo0WkZFcjqYvHRSJATBnlZbPJG1M4qvP8hUMte1YseAHOFC4f2g3/+WRRsX9ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749008660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJUKiRggcaQ+cyo2kK11rv1ozxRl1uWUU4BPl+QM6QY=; b=pvXnlj+BBpExUL59o8+G0UXLX6pjCY4cj9TylFrnmskWgvRcs+Hdq+0f7mFi7duIPTb2k/ VDXM0GO0G62+4UrxboyZ4ozs0eBxsfC+c+MkTOm+0m2Fl9fWnArowFXtmB92Ej9Laq26mE k9KTHA+9JtkE6PUEMDjJab18N3y1P+fhUg+EUZhgmSgLJVuhXr75UChq0PsUseeCo5f/3Q j+N1GZOWlmTMFXvR5YjJhJwKO2Q5dK9qEdK/J8KKpd+JtDqP8AdhN2Wq0pBzVRrV0QdF3o 0uV/jRpHy6IcAzhJuNxA6/Uzo/L/ZIy0SorPvzcqemeNrrHNxh+q4+2hGJB/aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749008660; a=rsa-sha256; cv=none; b=sAO0x9KIXOOrQAAv5cFj1VMyopcj/dDCae/oRdow03u8YWQyCcat/kill5wwVprZSLbfD6 Ce8yzAqVtqyIDcs6kr/D9teGJDaA4rUcn8ZpZ1DA93iwaqDaHX9aTbAICL3t16aQfCbyOD ICYfhGc36Ze3T29O5Ox2HdbmXAjcO6hDwyMqaOBtFohljB2SSFtp19J4nkLcBjlwfxwT4X C3PU8KLanB2Kz6FppBcXALb7fyog2ooSz5O+4dQ4qk0UU+ewDJ8IYjHxo2EDyKL9FoOCXW TEJAkEhuOFJ0djpRU26ACpHklOM4uFmQccA38w5PX5pw+jn3bkzCKNO/Plyvjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBtjv1h4Fz16FJ; Wed, 04 Jun 2025 03:44:19 +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 5543iJuL031194; Wed, 4 Jun 2025 03:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5543iJMc031191; Wed, 4 Jun 2025 03:44:19 GMT (envelope-from git) Date: Wed, 4 Jun 2025 03:44:19 GMT Message-Id: <202506040344.5543iJMc031191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: a233c71650a1 - main - net80211: remove if_private.h from code that doesn't require it 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a233c71650a1e5b29723a8547ea160e105aa855e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=a233c71650a1e5b29723a8547ea160e105aa855e commit a233c71650a1e5b29723a8547ea160e105aa855e Author: Adrian Chadd AuthorDate: 2025-06-02 02:25:49 +0000 Commit: Adrian Chadd CommitDate: 2025-06-04 03:35:15 +0000 net80211: remove if_private.h from code that doesn't require it The previous clean-ups to remove some direct ifp manipulation have removed the need for if_private.h in these source files. Differential Revision: https://reviews.freebsd.org/D50646 Reviewed by: bz --- sys/net80211/ieee80211_adhoc.c | 1 - sys/net80211/ieee80211_hostap.c | 1 - sys/net80211/ieee80211_scan.c | 1 - sys/net80211/ieee80211_scan_sw.c | 1 - sys/net80211/ieee80211_sta.c | 1 - sys/net80211/ieee80211_wds.c | 1 - 6 files changed, 6 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index adb83004d815..22c28ee4fef9 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 990b07f90032..c5a478533313 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index d54cde157c6c..0066ac4fbc1b 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 96658b83fab4..d7d06b26643f 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index a41e3f5793dd..463a8b16773b 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index ed8b634a3456..1c05a40e632f 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include From nobody Wed Jun 4 06:22:33 2025 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 4bByDV2GTJz5xY1P; Wed, 04 Jun 2025 06:22: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 4bByDV0LQhz447D; Wed, 04 Jun 2025 06:22:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAL8V7uwRHvHDqxfp5XAhCUq7Q1m99flA/meoh0xKS8=; b=wh64l4rWa63ZkQGkslm8IOHbVHITXJ4P4W3k0nITB2iTAsP9D8RzyO0ekSXiD15IRjyQWv jyLOBxuXxxcAcJ7AxN7/JCYbPWCazngqN+J5EvLDMa2rpWmvGgx94RmT/7qgVvEF4b4ja3 4zOS46DXgaGxvcm3JXBQcyUoNPzWZ+dVvPnFCVOS5QdNZyLtxAiQ9LObLK9M7MRvxMHQ19 BIxB2EwuETdCta3XC4W7ZIEoS7iz7IQOBToaRXperbreKgRYyV80sPq0AQQgsznuuEA1XQ ZDUVUQVVgi5U0k43XEhlLzuBo8eik4InlqKlhZFCRV5qP0FVe9PBtTobEkkhsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAL8V7uwRHvHDqxfp5XAhCUq7Q1m99flA/meoh0xKS8=; b=GcoWcr3LQSDh3Y7uB2AS3Li7GxORmYvQM0C7zWnjp/TdWhhJLPcE62jAGpaFFB5Qga04wo MstOb2J44/KgeNX4oskyz2kl0393AvqF2cRB0eKvNlssYAUeRYji7Dt6lsRcNBJmn+NgIN hT0g936COvNvNPmooOEKS9zyh/2RrLXSZZJ+8h7/q4cV/F6SbWcQUQMkx9RDxo018zlgCi GZBP2cI/RZ6bm0UTHiyGU/JLUh3KfOsJCL48f3SF0ir8LGKNTw5nE0fZMqm/AVRs9EgqqZ p+CMjA0fFr75rV5JExU4bBM5ydAkpLgzH0VSXz5PmGACatTKTtkGcCLUIz46sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749018154; a=rsa-sha256; cv=none; b=k1BixnUmtTrR4N/Y2PBuageRr0U0HYOPXUpZMNVsW2f4BWeaQtvilz1NN7rusN6WQxBo5Q XFEXFG3WOYM02L2AJGmXDnLgAQ+mLXe9wtt5mJVbRwGefIThJWSY/8R4Ywb47svZxzjIUb SAJiItqiVHCMUyLwUEzV/B48a9ZBn57E1ra5VL8YLGeopszchhGsIQmf/q9Mr2ELaSHFo8 DqJ1sQUgKgEBHomRlTQYr67NOh4ZyH5nHuicKqKdLH5noLmSa25XpBg0gDRF3PEeIL4MY6 RMC4FNisqecXWJRsCYSaBQ6pWfxR6Om5IVwoF7znQTAhiCOsHvJjV0Tr7MZjAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bByDT6zS0z1BqM; Wed, 04 Jun 2025 06:22:33 +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 5546MX5E031983; Wed, 4 Jun 2025 06:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5546MXKD031980; Wed, 4 Jun 2025 06:22:33 GMT (envelope-from git) Date: Wed, 4 Jun 2025 06:22:33 GMT Message-Id: <202506040622.5546MXKD031980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: d9b6b10e5ebb - main - if_vlan_var.h: fix value of DOT1Q_VID_MAX 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9b6b10e5ebbb517a079e89ac0de99be3b815c8d Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=d9b6b10e5ebbb517a079e89ac0de99be3b815c8d commit d9b6b10e5ebbb517a079e89ac0de99be3b815c8d Author: Lexi Winter AuthorDate: 2025-06-04 05:33:05 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 05:33:57 +0000 if_vlan_var.h: fix value of DOT1Q_VID_MAX This should be 4094 (0xFFE), not 4095 (0xFFF), since 0xFFF is not a valid VID. Fixes: c59492025073 ("sys/net: add DOT1Q_VID_{MIN,MAX}") MFC after: 3 days Reviewed by: kevans, kp, adrian Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50576 --- sys/net/if_vlan_var.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index e7171974289b..3a8e45dfab03 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -131,7 +131,7 @@ struct vlanreq { #define DOT1Q_VID_DEF_SR_PVID 0x2 #define DOT1Q_VID_RSVD_IMPL 0xfff #define DOT1Q_VID_MIN 1 /* minimum valid vlan id */ -#define DOT1Q_VID_MAX 4095 /* maximum valid vlan id */ +#define DOT1Q_VID_MAX 4094 /* maximum valid vlan id */ /* * 802.1q full tag. Proto and vid are stored in host byte order. From nobody Wed Jun 4 06:22:34 2025 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 4bByDX0mgMz5xY2H; Wed, 04 Jun 2025 06:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bByDW25Tqz444x; Wed, 04 Jun 2025 06:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94QO6/X1Clr4/3xlE5EMpaVkemQXsKXRVmiGgF/5GCM=; b=axd6ODD1gixdhbzVm+b6dfsKtlOQHbozw44DQ2X3newxz8Q8DAT0id+q8F5MefifUdqs1w R7MjeR+vbEheRtQGAVXKhzlE8N5UMGH3/wEXp8TSbvreWaMzNoNdLCE8U+yJ1Q7J1s7DuD xGXAr0XUyQbbldnedExNpeuyCp0OZoarEzZzLhRFsRAJ2EorYxhtnFVm6cTKykChrMBcng lItkAEPhW62g4dIpseNQMnvNAcMvpN1x4XOEVWHjUo3pFjwpEVHSrrkgtn+upwkifm3bPs NF+CdVoU9z2tTJe8YpzDtajQjAMRMdFpe+WkJZfjPw0k1jn4hR9RRR0+tua8zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94QO6/X1Clr4/3xlE5EMpaVkemQXsKXRVmiGgF/5GCM=; b=avguIAm95sCRPEfKW2a1AOR2QoVQNMVFJQJKyKd1k6jBwfCc19pvNxhTuk5b38vtQ4pTC/ zNhY/roFrXogkNJQA11N5dfyhwaa1c/02a/8FUOaoH5+GU/Oqz/hr2LB7i0YksWltSU58g +tOREunw1LjZ5VgDaTMol1ESGwv3zwNfM6qjfwYXlhcCmxdrY9/V2O/G+O4i3/lVGE4sa/ CVNomc2byHlvpMOn487OkSsWVdJ6e1IkML5wWCZZrp9G7NpADgpNv2Ul7UR7vBGBjrW0sM 6JNPeyi5OiqmEU+BhGw85/EK6yHsI7O4gyfG3CxmS5HTPvd9VS4TXH70mpEsYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749018155; a=rsa-sha256; cv=none; b=N6B53g1GQNVQSCO4LNBupeWiJs/aQYTUZ5rB8PcAjMQbspbjMzqDwDg3WAPc/5nIYYXUxf LRO5Of2NRu0Rm4dr8MMWIEqf2DaLkPgKRIYwmd5gGXVzJIXxbAiXqLpHNRRO/Dh3IRd368 3AcdLC73xoHLo/sQoxh1ea6GqrdOzfDH9zmyZ7nywsdmuzPCDnd0AcfsEWWhbpuU+Jaxhv 98tnpoM6qvYbqYFOC6VIBPfSRjtYCHq55rHJAugVQpElIAweEbTYdDyFSQ6n+zZ7VKlgfI AMOUR5OZNtiHE6pbf59VCibiF28H/KGf9AY0wipNyj9+7twe2Lm5J2QPQ1qn9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bByDW0RpKz1BC6; Wed, 04 Jun 2025 06:22:35 +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 5546MY70032023; Wed, 4 Jun 2025 06:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5546MYCX032020; Wed, 4 Jun 2025 06:22:34 GMT (envelope-from git) Date: Wed, 4 Jun 2025 06:22:34 GMT Message-Id: <202506040622.5546MYCX032020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 0e33211f911c - main - kyua: increase cleanup_timeout to 300s 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e33211f911c906b47cd0c457a86372c4b5daf87 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=0e33211f911c906b47cd0c457a86372c4b5daf87 commit 0e33211f911c906b47cd0c457a86372c4b5daf87 Author: Lexi Winter AuthorDate: 2025-06-04 05:35:51 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 05:35:51 +0000 kyua: increase cleanup_timeout to 300s Test cleanup times out after 60 seconds, causing the test to fail if the cleanup hasn't finished in time. This timeout should be configurable, but it currently is not. Several tests (e.g. bridge, pf) are now reaching this limit; as a workaround, increase the timeout to 300 seconds. Reviewed by: igoro, kevans, des Approved by: des (mentor), kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50499 --- contrib/kyua/engine/scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/kyua/engine/scheduler.cpp b/contrib/kyua/engine/scheduler.cpp index 8b2498514f6d..4c40bf31046e 100644 --- a/contrib/kyua/engine/scheduler.cpp +++ b/contrib/kyua/engine/scheduler.cpp @@ -87,11 +87,11 @@ using utils::optional; /// /// TODO(jmmv): This is here only for testing purposes. Maybe we should expose /// this setting as part of the user_config. -datetime::delta scheduler::cleanup_timeout(60, 0); +datetime::delta scheduler::cleanup_timeout(300, 0); /// Timeout for the test case execenv cleanup operation. -datetime::delta scheduler::execenv_cleanup_timeout(60, 0); +datetime::delta scheduler::execenv_cleanup_timeout(300, 0); /// Timeout for the test case listing operation. From nobody Wed Jun 4 06:22:36 2025 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 4bByDX55pQz5xY3y; Wed, 04 Jun 2025 06:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bByDX2JHWz442d; Wed, 04 Jun 2025 06:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8e0ax4CUbHi+PoZH5dUP/KChGMXsbi+ld2Ljn32HwJI=; b=Woq+4r+6sC9nHvdD0PI6jtfDwEeYYnUbQBqDG0v70Z6Y5xx+XCyQMrYU+IeTiZAMSoMFWQ Mv5wTcnpvzc5/E2gD/5gcvavzXhNUZ9Uw5mmDefXeOsk/EN5ahWYaKOEHnhmN5r6eQ1H4+ kDsB0MnqmWIHEhi5fGginfhrnzPvtZPfCUf9a1XFJoS4SrtrrWsAupXEp/hc3LiaAyCis3 KMnfHBsdg/++IruPz+kbJLw/824CvGWQRJRv7WU8DEvzXPeHdBzkoiPT3yyq3jtLifispt vgElVrlhw+S/Am/7G/sguoVMcjQPURjnD04VgXMEISvq7YYgQqaJJ+sK4B6T+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8e0ax4CUbHi+PoZH5dUP/KChGMXsbi+ld2Ljn32HwJI=; b=g46hx1iepfVhYkglt+Wr+G6nS8Z6arZsq9lSx1PTZi2lGZ474LNJANjhxeUML3V1Dletx4 goB7uIPfeyq0MdvyJjTFaqJfJ//eL1UVNdYLcN9Nq1xls6oFL0R/IK0VencTQJpV9ryhIe 5LyGKD3XVZfX5ROfmA25PJtoRFDAMi2yGoFRvl2iT2HnyWuQWfAAFcjiyxlinjJfPlBux0 1eSktqBEEmvR0Bhyd2k9Kupn8mZ1A3Zjepb6tHKQnYGyxce+pH4zsvNQjd6a4WHgekw1K/ Y+nn+fN3Gw2IvjcBpOTDQ0VuiX04aNUzZ8mByaX6qf+vH66QQpApqx9Tgv9GwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749018156; a=rsa-sha256; cv=none; b=ArZimsENCcbZKk83pRGQdC/78nOb3MkiC3ogC0G+0JKu2HCmScnacDAv6oi1BsRyDtApoN T3NboNJZAF4Jj4X2wQ8gZZrb4/Fh4S6DdN1OdFoKxLseVHNfqJM0xTihtgK2sInUA6pPzq x38ibqs20QNxtHq41Tm7jtP2Pp7kULVDxoz8DKA6n2xlCZhf1+byvFT4V8gXpuZBAeGu+1 +JkXaRnQpoq4RLPYHX6lMu5p+wFMsoYi4+Te2WkKdxQQkvY1mcAn6INBlpYXoYcGDt9fQd Cnd55HbrVtj2JEittI/DPtvF0+7cgq0KFenNevAoaZf2qoasCYQmbkusW17yNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bByDX1rVZz1Bqw; Wed, 04 Jun 2025 06:22:36 +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 5546MaLf032061; Wed, 4 Jun 2025 06:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5546MaVG032058; Wed, 4 Jun 2025 06:22:36 GMT (envelope-from git) Date: Wed, 4 Jun 2025 06:22:36 GMT Message-Id: <202506040622.5546MaVG032058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: da9f1571dcd2 - main - tests/sys/net: run if_bridge_test in a jail 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da9f1571dcd28201a235fa230329ae3b1aa8e020 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=da9f1571dcd28201a235fa230329ae3b1aa8e020 commit da9f1571dcd28201a235fa230329ae3b1aa8e020 Author: Lexi Winter AuthorDate: 2025-06-04 05:37:18 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 05:37:18 +0000 tests/sys/net: run if_bridge_test in a jail Many of the tests in if_bridge_test create new epair interfaces and then add them to a bridge. If devd is running, devd will attempt to configure these interfaces based on the host's /etc/rc.conf, and may enable IPv6 on the new interface (for example, if ipv6_activate_all_interfaces is enabled), causing an IPv6 link-local address to be assigned to the epair. This causes the test to fail if net.link.bridge.member_ifaddrs is set to 0, which is the default. Fix this by running the tests in a jail, so there is no devd to interfere with our new interfaces. Reviewed by: kevans, kp, des Approved by: des (mentor), kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50476 --- tests/sys/net/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index a76fca4e61fb..bc8f9c5e9c80 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -7,6 +7,8 @@ ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_epair_test ATF_TESTS_SH+= if_bridge_test TEST_METADATA.if_bridge_test+= required_programs="python" +TEST_METADATA.if_bridge_test+= execenv="jail" +TEST_METADATA.if_bridge_test+= execenv_jail_params="vnet allow.raw_sockets" ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test From nobody Wed Jun 4 06:22:37 2025 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 4bByDZ0wZZz5xY2Q; Wed, 04 Jun 2025 06:22: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 4bByDY3pB0z44CM; Wed, 04 Jun 2025 06:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cMj7R9wgSHZcxWR/OXV3FXPdQLTrciI3y2KhrcuwGA=; b=dIROcowk7mfs2pYzFIA8tIwU9DLo0eTkB9guyI7Kc1SzclGv0Za69SrTAn7ysqWMzwO9fb gPQ4rIvYVXwMKhrfJyCeFhgD6KJz5EN+KkaHgc1wo8ak/h2ORCT4MDKlrwcnDGF3kExY1U SUYKyeP8MZjFV5X9L1DVnli6j8o9ISmbz0Ndl+py6GQb+jft4FjRIUrVxdMhfpKP3s6TG9 YuvT47mqSquXE0/gqloKKi0AlS/NWNZ0Dsbil9uBIWNlvMioK43aBLBuDaZKA51DvfDJWT EjSD7I216WqcHa2wxGppcff2Hxp4fWn5k8nzdzkjVEoKVimunBCHXn/OZXN7QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cMj7R9wgSHZcxWR/OXV3FXPdQLTrciI3y2KhrcuwGA=; b=SVxWcVEdELN+BNx19BNoqjN90D/2Xbuklq1WwNiyalFWrDA/OMBwFSsykmNQ5C8JtPimk4 YOmNX//RWzYq6EOLeIK3dros5TTlVpBo+v7kfzYU4F0J9x8i+uyf+2FrWcA4w/0ZBC8e3C 9JOXWGg7ILjk/sUb5awVjLz0wW1+wBufe7GIi2NZ/vlPfEaYjIBpKLijlQmRojc9iY1Oo3 oexk3KYzvUd2qrirW+FAMUoXVOwLpBWbKCmzvav129vvP/2RlDpcJjZHAK1EqiGCPFQBNK UNQKx01cHF5cS1wyMF6Xg8po6F3jMTBMvd1pY189lgMlYPnTI7KYD+O+tLw+vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749018157; a=rsa-sha256; cv=none; b=ZcnX3JVaO0fzLM7FYfJBw7bFB4ExABNrgkPTleEsxDFStO3/NrOcj/O6oEz4HAPj85b39+ y8fvXt01ikkbuf+jOJK7iKNYvwKUDdcb730EPJUO9fpKqnPJwH0oEYDkGwJ3Ghj0D/jFVl 6S25Nqoh5AZY/NQiRxl9X7X7nn9b6Ln/qxpwCsDQMEFYCa23vsLujJf8wvHRBJbK5j+DF3 66Kw28BsTMnOTPijD3GZUrpIhmJsHISGGN/UFFJ+m2qiuzbRnmQ/I4k3onMs2SWZ+APTMV R+o32qZ4Jk/IsKbDUL63HVojp9vKW0YWTXfnw0/vMXtjuW+yGhv55WZrc3Xkiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bByDY2VPlz1Bfj; Wed, 04 Jun 2025 06:22:37 +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 5546MbM8032095; Wed, 4 Jun 2025 06:22:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5546MbDW032092; Wed, 4 Jun 2025 06:22:37 GMT (envelope-from git) Date: Wed, 4 Jun 2025 06:22:37 GMT Message-Id: <202506040622.5546MbDW032092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 6b2993e74eba - main - packages: fix ownership of /tmp and /dev 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b2993e74ebaacd46bd1e438787c23450cd2752d Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=6b2993e74ebaacd46bd1e438787c23450cd2752d commit 6b2993e74ebaacd46bd1e438787c23450cd2752d Author: Lexi Winter AuthorDate: 2025-06-04 05:38:48 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 05:38:48 +0000 packages: fix ownership of /tmp and /dev release/packages/runtime.ucl manually adds "/tmp" and "/dev" to the "directories" key, which causes them to be included in the manifest with the user/group owner of whoever built the package repository: drwxr-xr-x 7 ivy wheel 512 Jun 1 17:24 /dev drwxrwxrwt 10 ivy wheel 10 Jun 1 17:42 /tmp Remove the manual entries and instead put an explicit package tag in etc/mtree/BSD.root.dist. This also means /tmp gets the right mode by default and we can remove the chmod from the post-install script. Reviewed by: manu, kevans, emaste Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50636 --- etc/mtree/BSD.root.dist | 4 ++-- release/packages/runtime.ucl | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index add31410f633..1312251cdd9e 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -38,7 +38,7 @@ zfs .. .. - dev mode=0555 + dev mode=0555 tags=package=runtime .. etc X11 @@ -136,7 +136,7 @@ .. sbin .. - tmp mode=01777 + tmp mode=01777 tags=package=runtime .. usr .. diff --git a/release/packages/runtime.ucl b/release/packages/runtime.ucl index 8a337c038fdd..b04bc32f33cc 100644 --- a/release/packages/runtime.ucl +++ b/release/packages/runtime.ucl @@ -3,10 +3,5 @@ scripts: { post-install = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 0ddc223c6d52 - main - OptionalObsoleteFiles.inc: add some now-optional rc.d scripts 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ddc223c6d526d19c338ed2af0820a998cbcb93e Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=0ddc223c6d526d19c338ed2af0820a998cbcb93e commit 0ddc223c6d526d19c338ed2af0820a998cbcb93e Author: Lexi Winter AuthorDate: 2025-06-04 05:45:10 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 05:45:10 +0000 OptionalObsoleteFiles.inc: add some now-optional rc.d scripts After f91d251b399a, some rc.d scripts are gated behind the src.conf knob for the services they start. Add them to OptionalObsoleteFiles.inc so they are properly removed when the knob is disabled. Fixes: f91d251b399a ("rc.d: move some rc scripts to their packages") Reviewed by: kevans, jhb Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50560 --- tools/build/mk/OptionalObsoleteFiles.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5c598306e152..91f7154d892f 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -2662,6 +2662,7 @@ OLD_FILES+=usr/share/man/man8/ippool.8.gz .if ${MK_IPFW} == no OLD_FILES+=etc/rc.d/ipfw +OLD_FILES+=etc/rc.d/natd OLD_FILES+=etc/periodic/security/500.ipfwdenied OLD_FILES+=etc/periodic/security/550.ipfwlimit OLD_FILES+=sbin/ipfw @@ -5575,6 +5576,7 @@ OLD_FILES+=usr/share/man/man1/genl.1.gz .endif .if ${MK_NIS} == no +OLD_FILES+=etc/rc.d/nisdomain OLD_FILES+=etc/rc.d/ypbind OLD_FILES+=etc/rc.d/ypldap OLD_FILES+=etc/rc.d/yppasswdd @@ -6654,6 +6656,9 @@ OLD_FILES+=etc/newsyslog.conf.d/pf.conf OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os OLD_FILES+=etc/rc.d/ftp-proxy +OLD_FILES+=etc/rc.d/pf +OLD_FILES+=etc/rc.d/pflog +OLD_FILES+=etc/rc.d/pfsync OLD_FILES+=sbin/pfctl OLD_FILES+=sbin/pflogd OLD_FILES+=usr/include/netpfil/pf/pf.h @@ -6843,6 +6848,7 @@ OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .if ${MK_PPP} == no OLD_FILES+=etc/newsyslog.conf.d/ppp.conf OLD_FILES+=etc/ppp/ppp.conf +OLD_FILES+=etc/rc.d/ppp OLD_FILES+=etc/syslog.d/ppp.conf OLD_DIRS+=etc/ppp OLD_FILES+=usr/sbin/ppp @@ -8997,6 +9003,9 @@ OLD_FILES+=etc/rc.d/zfs OLD_FILES+=etc/rc.d/zfsbe OLD_FILES+=etc/rc.d/zfsd OLD_FILES+=etc/rc.d/zfskeys +OLD_FILES+=etc/rc.d/zpool +OLD_FILES+=etc/rc.d/zpoolreguid +OLD_FILES+=etc/rc.d/zpoolupgrade OLD_FILES+=etc/rc.d/zvol OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs From nobody Wed Jun 4 06:22:39 2025 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 4bByDd13Jpz5xY2V; Wed, 04 Jun 2025 06:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bByDb6sw3z44Ck; Wed, 04 Jun 2025 06:22:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RtfQk7N4aaVSfMLzipyVQsGMGMIN0GFjG6EBPvKnwO4=; b=yffcLwIJ6BnX5d0Cy0jTOyYGHntd0S4y8sLIR0CiuvAL1NMThMyb6kAI/yoz+OOZa2QXZc QWXi86cY0BFQRsR4stz9LiC4JyJpzXAtulQ6EmhMpbBWyUCtwUQNf43lobU+dY7A/Ne4yL krtoZOCxYLciu4dg/20MCYfMG9S0Hypyp2ZkQbDJvgmKD8j0KWqa/BkMg/UMr1Gd7/KvBh ymaRiipjB7RQ5+mEpYxTgaEeqqGP68Z/ck53BaXa8HqGPwqbaeepoKxXL/fJY/xC+AN1XX HYoBo0YGKpjKWCknbVifudVrkFhYfJ/aG5uNdaMaTuFx0IemkUTYHiH8jlhRdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749018160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RtfQk7N4aaVSfMLzipyVQsGMGMIN0GFjG6EBPvKnwO4=; b=E52oY8tkNj3VrwXwQjc9bLF8BpVmsRFU/FWh3+27CNKVFt3f8veDVGlPQZ5KBPt0UIkTvX MEVUd/bINEJ5PTDAe4vd7sZ+wj3+NfeE9J71HANprf7HQoV1VwgI2BScK8lQrsghT+73HD 9YxE5dDrGt0i32fcr51mFB9FSEDNUTBjc70dZwBFWlQ4v0yvVrVnu2JamkDoelNBBKvmip RtCNdr9r/1psBmnf6000RjH5l5keOQsNDplPicrXFKt3MmxVXgMzV33ZxnIwZ10hhv91IS DH8fVAA9ew3RPvfaYvzmF/e4m6Ft36Ry1NtKPio8Gt0wCvAWi8tq0QBtl87vFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749018160; a=rsa-sha256; cv=none; b=GhUBPYzj48piFJoDZ4LpIXhMj8kty0lQjp1p+nzOf7+kdVkCMXVDu8xSbRHQxu0wRU2he9 KSToOCtujj2GitGMl9iusi0uc8m2WAYiNV+EDFF0gxIpQ2vgjBjViMIuZ+Kp6GbyRLlmWq ryMsDVEoBAc04FZZBiz8ybqQyTBChkpAPiM7mzI2VZ0Mvj7sr2iUfQSLSc6ZCogqOGGLvv 17UO5WuRW4GrUijB/a+aUxgvw+B+4IYJLf0RSSADC9gJzLu/n9Zk0w6PkDJGBmZouQQ9Sz WV+e8x8tEJyJGXcPx9tyE0GU2BaGVNf4fDSVhv3OzU6gTaKSFtDdtNe1WfWW1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bByDb4MsYz1B0X; Wed, 04 Jun 2025 06:22: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 5546Md16032163; Wed, 4 Jun 2025 06:22:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5546Mdsr032160; Wed, 4 Jun 2025 06:22:39 GMT (envelope-from git) Date: Wed, 4 Jun 2025 06:22:39 GMT Message-Id: <202506040622.5546Mdsr032160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: a5fe142e0844 - main - bridge: fix vlan(4) on a bridge member 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5fe142e08447c7116b89159c110d02e860ac6a1 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=a5fe142e08447c7116b89159c110d02e860ac6a1 commit a5fe142e08447c7116b89159c110d02e860ac6a1 Author: Lexi Winter AuthorDate: 2025-06-04 06:05:12 +0000 Commit: Lexi Winter CommitDate: 2025-06-04 06:05:12 +0000 bridge: fix vlan(4) on a bridge member If an interface is a bridge member, and a vlan(4) is also created on that interface, and net.link.bridge.member_ifaddrs=0, then vlan(4) will never see any incoming frames because bridge doesn't pass them to the host for processing. Work around this by checking for locally-addressed frames using the MAC address of the interface we received the frame on, but only if the frame has a .1q tag and there's a vlan trunk on the interface. This behaviour is almost certainly "wrong" and it's not clear if we really want to support this, but it did work in the past and the member_ifaddrs change was not supposed to break it, so this restores the previous behaviour. PR: 287150 MFC after: 1 week Reviewed by: kevans, des Approved by: kevans (mentor), des (mentor) Differential Revision: https://reviews.freebsd.org/D50623 --- sys/net/if_bridge.c | 23 ++++++++----------- tests/sys/net/if_bridge_test.sh | 51 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 9338d28437d0..82a530042413 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -2778,22 +2778,19 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) do { GRAB_OUR_PACKETS(bifp) } while (0); /* - * We only need to check members interfaces if member_ifaddrs is - * enabled; otherwise we should have never traffic destined for a - * member's lladdr. + * Check the interface the packet arrived on. For tagged frames, + * we need to do this even if member_ifaddrs is disabled because + * vlan(4) might need to handle the traffic. */ - - if (V_member_ifaddrs) { - /* - * Give a chance for ifp at first priority. This will help when - * the packet comes through the interface like VLAN's with the - * same MACs on several interfaces from the same bridge. This - * also will save some CPU cycles in case the destination - * interface and the input interface (eq ifp) are the same. - */ + if (V_member_ifaddrs || (vlan && ifp->if_vlantrunk)) do { GRAB_OUR_PACKETS(ifp) } while (0); - /* Now check the all bridge members. */ + /* + * We only need to check other members interface if member_ifaddrs + * is enabled; otherwise we should have never traffic destined for + * a member's lladdr. + */ + if (V_member_ifaddrs) { CK_LIST_FOREACH(bif2, &sc->sc_iflist, bif_next) { GRAB_OUR_PACKETS(bif2->bif_ifp) } diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index f9a36126fe59..2c6b039048e3 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -779,6 +779,56 @@ member_ifaddrs_disabled_cleanup() vnet_cleanup } +# +# Test kern/287150: when member_ifaddrs=0, and a physical interface which is in +# a bridge also has a vlan(4) on it, tagged packets are not correctly passed to +# vlan(4). +atf_test_case "member_ifaddrs_vlan" "cleanup" +member_ifaddrs_vlan_head() +{ + atf_set descr 'kern/287150: vlan and bridge on the same interface' + atf_set require.user root +} + +member_ifaddrs_vlan_body() +{ + vnet_init + vnet_init_bridge + + epone=$(vnet_mkepair) + eptwo=$(vnet_mkepair) + + # The first jail has an epair with an IP address on vlan 20. + vnet_mkjail one ${epone}a + atf_check -s exit:0 jexec one ifconfig ${epone}a up + atf_check -s exit:0 jexec one \ + ifconfig ${epone}a.20 create inet 192.0.2.1/24 up + + # The second jail has an epair with an IP address on vlan 20, + # which is also in a bridge. + vnet_mkjail two ${epone}b + + jexec two ifconfig + atf_check -s exit:0 -o save:bridge jexec two ifconfig bridge create + bridge=$(cat bridge) + atf_check -s exit:0 jexec two ifconfig ${bridge} addm ${epone}b up + + atf_check -s exit:0 -o ignore jexec two \ + sysctl net.link.bridge.member_ifaddrs=0 + atf_check -s exit:0 jexec two ifconfig ${epone}b up + atf_check -s exit:0 jexec two \ + ifconfig ${epone}b.20 create inet 192.0.2.2/24 up + + # Make sure the two jails can communicate over the vlan. + atf_check -s exit:0 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 + atf_check -s exit:0 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 +} + +member_ifaddrs_vlan_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -796,4 +846,5 @@ atf_init_test_cases() atf_add_test_case "many_bridge_members" atf_add_test_case "member_ifaddrs_enabled" atf_add_test_case "member_ifaddrs_disabled" + atf_add_test_case "member_ifaddrs_vlan" } From nobody Wed Jun 4 10:45:52 2025 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 4bC44J2gY0z5xqN6; Wed, 04 Jun 2025 10:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bC44J1rdxz3rb8; Wed, 04 Jun 2025 10:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749033952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IhyVPVyrJYjOxk9v9RYx1YwRIOpF3DkiPrxjgFWa9EQ=; b=aB7Vbr8RBluPV4j1NdBV+JJCSr0LHWwVG0IN7vC/eDfCsp8i17ZBHdchaUDW3h4TaUveZJ vnM38O0AcHYRCN5UXyeFy27BRvjYEHA/Iy8FLKLVVaN/d1fAz5U1ydtsieBrsKla1WBchI Y849fUDxxjp7x+u9N+of2SwODdWvfso7HSfY3oCMYsd6MkikgLMhcZm1AjJeCwZ702nCq+ ND0LQezxzzGG6wuXVD2wsk05cIf3HW7KC7dSUXoTHhHJep38Gq2xcLHB1vD0Fl/AAD4Se7 OFnoaiEEBVUXj4WxerK+/6T/o4Q6CY79TN0mH2+u37aBopHhspFJwJjocg9STA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749033952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IhyVPVyrJYjOxk9v9RYx1YwRIOpF3DkiPrxjgFWa9EQ=; b=LYfezSzDSIKDsBIBJnyCLjTlrTX5R6uCewZkO8lM22DygydR/rCHwDORhPMFosektCSqOj k+eVtE7d2fCS2M7OGOaAqrnSlP6Rrz+wDElzNjG9CNv5LEI0oodWLu9gveqOLWaf7sTsl/ shjeffmu3IhGfCnQByNmM130M2lRgBTQtUR08YcCbWwaQSPe3h2dbMFeIqbcNv6qPFseAO 58OQl4lo0d815MkrCudJsLmkgHwmCfazcJSXY/Z3+tsmg92jbrK6Ff1WK6S8UmaaApDEJT S0CerF7udjpf8lvJATZ0D1ffK5dFsUM92HLWLt4Iv7dOdpNKfapRubE2ESaF6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749033952; a=rsa-sha256; cv=none; b=yjIR8av+6wvprqCmXSGJhanXjepaIZ8SglSRjnFYTCaoDpdrWjTRXvzXFtqFVsVaVuw6EC jrUYe1aNLwO0oH5q+UhcTRnlkhJt/+hvvHLy1LtZIndgZeftp4+qGVwXuHVqu4+2USNsOz 0J96Lf/mFhTusz7gd2ipkYy0K4KxTCSCsCIs7AM134LJClEDQm/ZQ1itgY1VbUl861aZ2Y xJCSxDbcsOWkILlA3oBPygDAEgNvHJKm37ieQQi36wayrghBAjg1qUmVrES+vSZWHL3q+7 UKidrWmTsam9wpdyks/p5V8k2Q0MutLrf5s6nYJOq1Aa77sg/FlqjJ0j7A52Tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bC44J1Gpnz5YC; Wed, 04 Jun 2025 10:45: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 554Ajq2D021744; Wed, 4 Jun 2025 10:45:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554AjqZt021741; Wed, 4 Jun 2025 10:45:52 GMT (envelope-from git) Date: Wed, 4 Jun 2025 10:45:52 GMT Message-Id: <202506041045.554AjqZt021741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: a3ed55ff1818 - main - lib/libmd: reenable AVX2 SHA1 kernel 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: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3ed55ff181827ef1541e3ed25c76844bc835ad8 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ed55ff181827ef1541e3ed25c76844bc835ad8 commit a3ed55ff181827ef1541e3ed25c76844bc835ad8 Author: Robert Clausecker AuthorDate: 2025-06-04 10:00:05 +0000 Commit: Robert Clausecker CommitDate: 2025-06-04 10:28:03 +0000 lib/libmd: reenable AVX2 SHA1 kernel Following jrtc27@'s fix of the transcribed code, it seems to work fine now. See also: 207f3b2b25eaa0f9d32699e664b139e5e40e5450 --- lib/libmd/amd64/sha1dispatch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libmd/amd64/sha1dispatch.c b/lib/libmd/amd64/sha1dispatch.c index 6c4d43b95ac9..86509195d56e 100644 --- a/lib/libmd/amd64/sha1dispatch.c +++ b/lib/libmd/amd64/sha1dispatch.c @@ -47,10 +47,8 @@ DEFINE_UIFUNC(, void, sha1_block, (SHA1_CTX *, const void *, size_t)) { if (cpu_stdext_feature & CPUID_STDEXT_SHA) return (_libmd_sha1block_shani); -#if 0 if ((cpu_stdext_feature & AVX2_STDEXT_NEEDED) == AVX2_STDEXT_NEEDED) return (sha1block_avx2_wrapper); -#endif else return (_libmd_sha1block_scalar); } From nobody Wed Jun 4 11:32:36 2025 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 4bC56F1prlz5xtNH; Wed, 04 Jun 2025 11:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bC56F0yRcz4MHw; Wed, 04 Jun 2025 11:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749036757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=moi8R3xZO+9B+wRAU3JKLDbaKOQyK8TM7SEZdp2PPh4=; b=tC3kyOm0g74qTT1U0ITRmQJHk8/mMWeTAulhtn8n0apuNo4MHZPFiXhsMwXO35Py6wg5sz glz4ceY4PHm1nZSwUbI3JnYYYQkmbEVpqIoEgGdIOupBOX1B6xJvX+7CvsGNH0kfEKSNDi zWHFSwzHXtFu2GOme4ERB+/SJcfeSF5SxQiUwqn+afwsuIhe1iy8D2rc4tlgLq60hzc5Ov z3ok5si8MTlLSagYQYM9gj5LmK8viRMwsjZ/RU/PIkcLsmrLJb02A9Fx3sEslmqgohUB+W z8uBT6TK70So9GeNWqzku79oj7RVog8LZDyYMoQDxGyjIwDFsSomZL4Iu8JVdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749036757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=moi8R3xZO+9B+wRAU3JKLDbaKOQyK8TM7SEZdp2PPh4=; b=St1wP3VvpkKVv/sxpV2g2QOIVrfvxPrYbIILk+d4hwoS9bABxu3kHRsCenwmvz/db/GBxr Xy/h4RFD9PjFA7LqXm8H3JUH/2EEe8bOvc4gQl9uwZvLpWcW7yoeFbqixIiSPT79Ly/Uet OwGF48yOrictmjZZ7pKOXcC+wX4BzkAO2IUfW8caCPjwTO/p74At1mhfoaXc5cXvOwTJ/I rmCCVGAvXT1LMBm+kKUHXN84GOoQpooiMHc5H0IuRE7s1mbzFQXbiBYbYJxb0C8D7B6Nf7 7IXxcnx/1tlDW7vWMaDGNndiIjdvg1u4ZvL5+zXL3mLho34OccsOm3OESi2BsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749036757; a=rsa-sha256; cv=none; b=d9IV1Hqtzyuk9U5RjbF16qGq+AoC7oVIDI4d6yPq9w8CLona+EoB0scUhs3O0godZWEt3R oCGtgJo/OyQ0ltjmylTv52mAeUlsUhYuo2DwtkB7Yz2CThRkufiZ80OVk3BhA+M4Bva78l DibeHIUQUZ2YarUn9xPoOdk1H3nUWzRC8yUnMKl7N4njcCpjPBfCOJjF+awTiGPcZN66J0 PB3Di2d3YSm4B7bw1Gya4EMDXMYs3ldc4+LVGofbS49sEJ2raU6g61LC/E9K+tuMAszd0z 0Dr5N4rEiaMQwL4VPV17cs5ZycINg+upKbtrYJa3xrKVnWkKxwaqMQsaBVbFvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bC56F0XgPz6gG; Wed, 04 Jun 2025 11:32:37 +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 554BWaK6016148; Wed, 4 Jun 2025 11:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554BWauw016145; Wed, 4 Jun 2025 11:32:36 GMT (envelope-from git) Date: Wed, 4 Jun 2025 11:32:36 GMT Message-Id: <202506041132.554BWauw016145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c27f7d6b9cf6 - main - libsysdecode: correct regexp for thr_new 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c27f7d6b9cf6d4ab01cb3d0972726c14e0aca146 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c27f7d6b9cf6d4ab01cb3d0972726c14e0aca146 commit c27f7d6b9cf6d4ab01cb3d0972726c14e0aca146 Author: Konstantin Belousov AuthorDate: 2025-06-04 11:23:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-04 11:24:20 +0000 libsysdecode: correct regexp for thr_new flags Two flags include underscore after the "THR_" prefix. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libsysdecode/mktables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 87ab24ddf1a5..5d7be2aad3c8 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -145,7 +145,7 @@ gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "neti gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "netinet/udp.h" "UDP_ENCAP_" gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" -gen_table "thrcreateflags" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" +gen_table "thrcreateflags" "THR_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/thr.h" gen_table "umtxop" "UMTX_OP_[[:alnum:]][[:alnum:]_]*[[:space:]]+[0-9]+" "sys/umtx.h" gen_table "umtxopflags" "UMTX_OP__[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" gen_table "vmprot" "VM_PROT_[A-Z_]+[[:space:]]+\(\(vm_prot_t\)[[:space:]]+0x[0-9]+\)" "vm/vm.h" From nobody Wed Jun 4 11:32:38 2025 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 4bC56G3R15z5xtNL; Wed, 04 Jun 2025 11:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bC56G2P2jz4MSs; Wed, 04 Jun 2025 11:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749036758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNSzh79BPIXb8Pyci4CpyNDtAGLTHdGgfV5Vkza9AyY=; b=kJzGC2RA8b4Z69+bEyYc/bLam3AvG9OGGkC0ZJbM2qqz/xJZNjIMagOtIrt9rGs18pH6ki 0dXnggNZp5dRVw9TM/nfu54LrLN71c0WhUZHAWrwqlCZT1LYd0HCfGIcCgpWHcimtW2XHa pY3PIwBqotD1VF5mfZ/CQN6laaOvfVDR5djBpcMuXDh6wGq6rKq8E++Tvjp0wxBPbxcbA5 I069Sv7/h9/H27bAX+el56jUSqG+lQNL+F/ByZ3TiGSMFYoVbijkpXmK4pjSH0Lgu/GjpL V686Y57aiZuES5hvorgywtVtai3f07jOm4K56U4v6OYL1jawSFpjoKkHSsvcfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749036758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNSzh79BPIXb8Pyci4CpyNDtAGLTHdGgfV5Vkza9AyY=; b=W1rHWfw3dOsk7UYk1RaD1SBsU/BCAJcnZQ7FMueHzHNI3ahKCIGhvGdN7Di/mNju4/DkSS S7zHAOXhb/gE1z93yJB8vp2kmejGWcLEcWm/X9UqxtMpawJiyJdCpRklO2+Z+M/vHIorDI CTmuGRYd6/X9SyB43VpH5oxhM8HGdLwIZVUIoQm9Cpq/iWM3c766TsIriPnnzrd/vCHe7J Zn144KuyUJSGvz7yjC0lVlxJV9CrF7SKcs5jobvwzjM/GLjPWdHAc9Mj4j6YVWlCF2wfTe ixs7yIiMdFS9cEQATNxP/Tafg8bKXVKOoGDkwEaEdKQr11R+0vmD6G9v6YLxzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749036758; a=rsa-sha256; cv=none; b=VaOBpPJRRBF95XW2gdPBqlp6NL3wGyy+tOZ8QXVAyAN8CPbZFLnBb9hfh7pO6xHpgLVbka Eea/qipCXtE63T+6WQVZSafnKfK7BINabTYdpf5oBPcv6ISg9pWpGosJ9ggwlJ36T4HRXA OR4nD92YXXnclr/+7/isVFMzgBtN6MWbx2np7bFUsQ9ROja/WJp9XP17H25KEmjxuTeb38 E/K0dnr4GxVm4AXUOHovHidSF1CrlDFNFV1HUEb2OzK5IsG1LouBrPnvENLPS0qkPIzBbR 3GONz3IzD36FCCN34oGflh1OAMWiCOb0SyXuY8g6BcR1n72jxv4JZSGriBMOmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bC56G1LS0z5qW; Wed, 04 Jun 2025 11:32: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 554BWcvZ016189; Wed, 4 Jun 2025 11:32:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554BWcTt016186; Wed, 4 Jun 2025 11:32:38 GMT (envelope-from git) Date: Wed, 4 Jun 2025 11:32:38 GMT Message-Id: <202506041132.554BWcTt016186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 56a4d1a4cc15 - main - ktrace: trace and decode thr_new() thr_param 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56a4d1a4cc151cf8356704aafd2d2ec0fd009701 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56a4d1a4cc151cf8356704aafd2d2ec0fd009701 commit 56a4d1a4cc151cf8356704aafd2d2ec0fd009701 Author: Konstantin Belousov AuthorDate: 2025-06-04 05:41:47 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-04 11:24:20 +0000 ktrace: trace and decode thr_new() thr_param Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_thr.c | 8 ++++++++ sys/sys/ktrace.h | 2 ++ usr.bin/kdump/kdump.c | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 7863e40e73af..8ad885b42ebe 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -26,11 +26,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_ktrace.h" #include "opt_posix.h" #include "opt_hwpmc_hooks.h" #include #include +#ifdef KTRACE +#include +#endif #include #include #include @@ -188,6 +192,10 @@ kern_thr_new(struct thread *td, struct thr_param *param) return (error); rtpp = &rtp; } +#ifdef KTRACE + if (KTRPOINT(td, KTR_STRUCT)) + ktrthrparam(param); +#endif return (thread_create(td, rtpp, thr_new_initthr, param)); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index dba650c72494..822822a6ffe7 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -371,6 +371,8 @@ void ktrdata(int, const void *, size_t); ktrstruct("cpuset_t", (s), l) #define ktrsplice(s) \ ktrstruct("splice", (s), sizeof(struct splice)) +#define ktrthrparam(s) \ + ktrstruct("thrparam", (s), sizeof(struct thr_param)) extern u_int ktr_geniosize; #ifdef KTRACE extern int ktr_filesize_limit_signal; diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 86df45acdf05..9cc22d382de5 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,7 @@ static void ktrsockaddr(struct sockaddr *); static void ktrsplice(struct splice *); static void ktrstat(struct stat *); static void ktrstruct(char *, size_t); +static void ktrthrparam(struct thr_param *); static void ktrcapfail(struct ktr_cap_fail *); static void ktrfault(struct ktr_fault *); static void ktrfaultend(struct ktr_faultend *); @@ -1952,6 +1954,18 @@ ktrsplice(struct splice *sp) (intmax_t)sp->sp_idle.tv_usec); } +static void +ktrthrparam(struct thr_param *tp) +{ + printf("thr param { start=%p arg=%p stack_base=%p " + "stack_size=%#zx tls_base=%p tls_size=%#zx child_tidp=%p " + "parent_tidp=%p flags=", + tp->start_func, tp->arg, tp->stack_base, tp->stack_size, + tp->tls_base, tp->tls_size, tp->child_tid, tp->parent_tid); + print_mask_arg(sysdecode_thr_create_flags, tp->flags); + printf(" rtp=%p }\n", tp->rtp); +} + static void ktrstat(struct stat *statp) { @@ -2147,6 +2161,13 @@ ktrstruct(char *buf, size_t buflen) goto invalid; memcpy(&sp, data, datalen); ktrsplice(&sp); + } else if (strcmp(name, "thrparam") == 0) { + struct thr_param tp; + + if (datalen != sizeof(tp)) + goto invalid; + memcpy(&tp, data, datalen); + ktrthrparam(&tp); } else { #ifdef SYSDECODE_HAVE_LINUX if (ktrstruct_linux(name, data, datalen) == false) From nobody Wed Jun 4 14:53:36 2025 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 4bC9Z90DDqz5x8GJ; Wed, 04 Jun 2025 14:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bC9Z868n4z3xbb; Wed, 04 Jun 2025 14:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749048816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1blCqdYHAvvNClMzxYU5hCg0eOKD8oe2vpKpB3xpjCs=; b=JFaZ86YkOT5CdiLD93dgoc51m6fu5zKDnr0AIIyAaHLhenemn/cJy2F31PotjquqRZ5qCO XLaYqTc+NR157/B3WU0vE8xQryc2Sr01y5ldQk6mPPwyd9yGFi3XRLJ9h9jPp0quT2m0jK DN5VBlUJCNmkQD5vS33RmvyDNcQok2cGzS29VpuhrAkRLbAT2H2anVCGHoInCp7YSadj5N 4zzYgiDOUqQD3FWZb8h/nYLRQBMJJW5Gi9UhCZwF2LbzeWwpOWKQU6rQbvPyXjx+Sxbmh0 ckt+2lrF10Q2Ropu5pgS0lL78XhxwVvSHct7tKwTN9RSQ7dUomFgEtXlW0sjgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749048816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1blCqdYHAvvNClMzxYU5hCg0eOKD8oe2vpKpB3xpjCs=; b=TixWICmyrsaWHiGiqSN/wvUyWRykoACjXzX1r0Kiq34WzG1EMzdM/k9VPpARRhYiMAYBDW w+9CDMjd5phdI/6twFGOU19UghgaSbJ9FO9OfghgeVFL6mXfCdzGIBFhKvGY5j2dEc9+0C +nsEtTbBFnNT7Jz60WVk7C93i0tXVNscHx748I1sr7N86TmfHtuYsJ1REuYThJbkSE9C8+ t9Lu8g8rPMRNNV1GbEnDwmxDVveGGsi4RZF3CeG3PGBQRCafxPfMPBzuE3Xcvjg4kfspyt 1dTZfKsBto1F3cxiSoaKLtlgHJ1E5cfv0AJrzgK1pT6TcvCWPKF/pUAZFuchcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749048816; a=rsa-sha256; cv=none; b=p9T+fm92Ibgkh3E929SxBdYfU0aNA6AqWyEpnOxPt/J5D+YBSbCyHN5Xx/eVvLCy5QioQY xhi5FsF1iZBZg+fe1fTCYnTgoHc0t9XKpucozszkkJR37SwiQ+TZudT1Ogsn5p2gTlK5EO KEGMcEkMJDI1Eh1X5aT4/GRvNLmBlhlpS41EW81eUki4InrNaRg1qg7f7xpN7UsFS4m2Hn 1YlM2P9eQ6LPOGgRcLNz+3RGnNXPXUwZezvOFMN2XDksX4gf8vjAuopukzN79tgnPOmZvT qiDZzdzvFz7xKoL7nYCr5mMb6UZCMd071XoyzkzmihtOg8TnfmD/qQh17rmkhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bC9Z85m1bzCrB; Wed, 04 Jun 2025 14:53:36 +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 554Era3I091362; Wed, 4 Jun 2025 14:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554EralY091359; Wed, 4 Jun 2025 14:53:36 GMT (envelope-from git) Date: Wed, 4 Jun 2025 14:53:36 GMT Message-Id: <202506041453.554EralY091359@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: 7aac4b22f9be - main - efi: Include sys/types.h for register_t 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: 7aac4b22f9bed604a819419e19f0322a31d41397 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7aac4b22f9bed604a819419e19f0322a31d41397 commit 7aac4b22f9bed604a819419e19f0322a31d41397 Author: Warner Losh AuthorDate: 2025-06-04 14:51:37 +0000 Commit: Warner Losh CommitDate: 2025-06-04 14:53:07 +0000 efi: Include sys/types.h for register_t This file depends on sys/types.h being included before it, which isn't the best assumption. Include it here since we have no namespace pollution concerns. Sponsored by: Netflix --- sys/amd64/include/efi.h | 2 ++ sys/arm64/include/efi.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/amd64/include/efi.h b/sys/amd64/include/efi.h index 5932bbaeeec5..b47c4aa27ac7 100644 --- a/sys/amd64/include/efi.h +++ b/sys/amd64/include/efi.h @@ -29,6 +29,8 @@ #ifndef __AMD64_INCLUDE_EFI_H_ #define __AMD64_INCLUDE_EFI_H_ +#include + /* * XXX: from gcc 6.2 manual: * Note, the ms_abi attribute for Microsoft Windows 64-bit targets diff --git a/sys/arm64/include/efi.h b/sys/arm64/include/efi.h index d5cb44f740b0..bfce872296a2 100644 --- a/sys/arm64/include/efi.h +++ b/sys/arm64/include/efi.h @@ -35,6 +35,8 @@ #ifndef __ARM64_INCLUDE_EFI_H_ #define __ARM64_INCLUDE_EFI_H_ +#include + #define EFIABI_ATTR #ifdef _KERNEL From nobody Wed Jun 4 15:14:41 2025 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 4bCB2T2428z5x9QR; Wed, 04 Jun 2025 15:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCB2T1X7Wz47PM; Wed, 04 Jun 2025 15:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749050081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5AfkkdQib7aiGXDVyv1vGpi7sEV44AkrWHhTYk01/0=; b=E15cMrwxvdrwDzkQ9VdBXHjDIXobXK/Gnbs/j/gbYM68zCI+K1jzd855RYITfdNGS2OUrR M8Lofft7ATkOxd65ja1pCyjLdLfk4oluR5oS3ZoUZEpt69qVL+5YLWxETgKIlVD7+omDNn LWayySVTHcWJk7TMJypKzyTOGV452jTS6IDb4tpWwru/kA8fSPN/0S1fjMCTK1LoPKzvVi o0Irla+Dnf0s/OnC6ytUUJdusYz7QyD4lEMTNBA03yIjQ/2TT/vCdDRHcILD6Uz08XCukK rkMdg3vYwqR8A93/Ee/VEjE0LgwVCYvnmNznppB1WEmDslh6Ta6FeRrl+w18DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749050081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5AfkkdQib7aiGXDVyv1vGpi7sEV44AkrWHhTYk01/0=; b=kmpkXX1eOwHO4irl0vm1KmAvQGZDstPrjIcWzcny0y2oJbPXMimZwZas2jYn2d73obHxHz R7p9ekLN0MsEK2wZrABDvBXY+1WCiGi4H3z6XF3B0d8zaMsG0sDSFD/3QkuxHkjiERowpx 8PcSzx7hBIc85azb/5TQ2cc1AOB9VvyaiBDy9x7mANzcq9FVusmNjkE3C/hPYwux6sT1Kv U03otb02OeAebxzLyKfigifqvJZpqWgV2NqkhWx4BsEJY8UDhGRxy0VrLsAUNffdxefVvD ZEt52wWvoDsaDe01ErW+NNftkK21Eou2pYtwvc5c3O6zGiAxOLeGsDQCKSqSww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749050081; a=rsa-sha256; cv=none; b=DBy3s7g0btqK/FLpFrEuLb2EWA+BPtpHZVQCiIGP5tMUiXejgmxfmhfz1CBz9epEd12gJK qff1pfyaUUJW0ao8QG5mvUqB1WRECfyzZRnYFWqnjBq7+eJVhy96vthWApj2nC5EOFP/RJ gpyBSzg3MoKUp5Oo9DULiNymBkAumkpN+fDgsHJNNmIns6kvAEOAvAlLpBPBfV/49navPJ CWTyJ6aMubs1AciO7kB+zcwXrzjMlKNA0Qy4sZSsFi4+qbN4b9WTPJ+YZvSayPUy2VdIBk gOJrwEjmAvFQyIbh/Mok8kYvqQbSssDJMvn93s1oJbuvJfEKh5/XSZvswHxMeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCB2T14b8zDTg; Wed, 04 Jun 2025 15:14: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 554FEfPE030005; Wed, 4 Jun 2025 15:14:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554FEfef030002; Wed, 4 Jun 2025 15:14:41 GMT (envelope-from git) Date: Wed, 4 Jun 2025 15:14:41 GMT Message-Id: <202506041514.554FEfef030002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5304a20ff148 - main - cam nvme: Add nvme_command_string 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5304a20ff148ddd82e39dbc1ca6bc08dc5deffa4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5304a20ff148ddd82e39dbc1ca6bc08dc5deffa4 commit 5304a20ff148ddd82e39dbc1ca6bc08dc5deffa4 Author: John Baldwin AuthorDate: 2025-06-04 15:14:13 +0000 Commit: John Baldwin CommitDate: 2025-06-04 15:14:13 +0000 cam nvme: Add nvme_command_string Replace nvme_cmd_string and nvme_opcode_string with a single function. nvme_cmd_string was already using an sbuf around a caller-supplied string, so use the same pattern for the entire command string. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50651 --- sys/cam/nvme/nvme_all.c | 19 ++----------------- sys/cam/nvme/nvme_all.h | 3 +-- sys/cam/nvme/nvme_xpt.c | 7 +++---- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c index 3f264e2ff6eb..4145aa16ed49 100644 --- a/sys/cam/nvme/nvme_all.c +++ b/sys/cam/nvme/nvme_all.c @@ -269,22 +269,7 @@ nvme_print_ident_short(const struct nvme_controller_data *cdata, } const char * -nvme_op_string(const struct nvme_command *cmd, int admin) -{ - const char *s; - - if (admin) - s = admin_opcode[cmd->opc]; - else - s = nvm_opcode[cmd->opc]; - if (s == NULL) - return ("UNKNOWN"); - else - return (s); -} - -const char * -nvme_cmd_string(const struct nvme_command *cmd, char *cmd_string, size_t len) +nvme_command_string(struct ccb_nvmeio *nvmeio, char *cmd_string, size_t len) { struct sbuf sb; int error; @@ -293,7 +278,7 @@ nvme_cmd_string(const struct nvme_command *cmd, char *cmd_string, size_t len) return (""); sbuf_new(&sb, cmd_string, len, SBUF_FIXEDLEN); - nvme_cmd_sbuf(cmd, &sb); + nvme_command_sbuf(nvmeio, &sb); error = sbuf_finish(&sb); if (error != 0 && diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h index a32668ddc1fb..17c068b825be 100644 --- a/sys/cam/nvme/nvme_all.h +++ b/sys/cam/nvme/nvme_all.h @@ -42,11 +42,10 @@ struct sbuf; void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); void nvme_print_ident_short(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); -const char *nvme_op_string(const struct nvme_command *, int admin); -const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); +const char *nvme_command_string(struct ccb_nvmeio *nvmeio, char *, size_t); void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); const void *nvme_get_identify_cntrl(struct cam_periph *); diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 47c0bde1df37..bac9e6441040 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -833,14 +833,13 @@ nvme_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb) static void nvme_proto_debug_out(union ccb *ccb) { - char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; + char command_str[128]; if (ccb->ccb_h.func_code != XPT_NVME_IO && ccb->ccb_h.func_code != XPT_NVME_ADMIN) return; CAM_DEBUG(ccb->ccb_h.path, - CAM_DEBUG_CDB,("%s. NCB: %s\n", nvme_op_string(&ccb->nvmeio.cmd, - ccb->ccb_h.func_code == XPT_NVME_ADMIN), - nvme_cmd_string(&ccb->nvmeio.cmd, cdb_str, sizeof(cdb_str)))); + CAM_DEBUG_CDB,("%s\n", nvme_command_string(&ccb->nvmeio, + command_str, sizeof(command_str)))); } From nobody Wed Jun 4 17:05:37 2025 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 4bCDVY0pZMz5xKQX; Wed, 04 Jun 2025 17:05:41 +0000 (UTC) (envelope-from garga@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCDVX70c3z4HV0; Wed, 04 Jun 2025 17:05:40 +0000 (UTC) (envelope-from garga@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749056741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=v/O8zUiZjWlTCvNhUNpWFCBKP5ehCeMb2EijVmfVYXE=; b=yJamZDc25XJvBNHLI+tmJAcia9ETVykYDYR1NWIZa/CMJp/5nqvOONXtuDfK3SfPlE8QiS LhnzCAkP9NuaMtX6lv2wv4OXsXvilA/Eq7G6pbvecP5bsqDzvYWlUG/gKBRROyZ/Zn+/Da 2RdVoastehZWiW5is6MovC8hD+LZai0C4EqOVz3yDioivKsy7RK9CLlqyB7cF/7lh92/W2 Yfv+OplW+R/IQPDTEZw2voj0p+GLGGKDhI8gHx3Q3wOc8a+MB3UZb0943hnuWfvfSTkf37 o9Wq0SMlBH7jdR/RfymKu7XbbspxJdlMxcO2foV0kwY/IgcH48xNaGrDkD9qYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749056741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=v/O8zUiZjWlTCvNhUNpWFCBKP5ehCeMb2EijVmfVYXE=; b=e1qf8MkckQ4IHy8HVMq/tsZ3YT6M9wMezj0Dhob4FyMPhFwWD1oaFbmCP9JmFPhW6ed61f rZZwcjCONHRzP0zbcVF6T6AAaSa8LoEWxcRJsZLGZLK02QaZjK91fmC5MGQf6byeuSQJvS Et2fV37i8yy/fNxI7LeVYwWsnzRTqGC1+q8O+4YqQrOe4klDfYKaDf6WqdbgAaUJMbdvyW 10tt63T9VjkZRPlVUjxlxlkW1LE/EWlgA3x5u/jiB4oPvWStmnQb0FSRof14apKAhwj1aU JaYoodeMXPQNwVNAUrIThQvx4S9pYvpUROhrc1DlGFwABmMlDs47ylLFnw/xxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749056741; a=rsa-sha256; cv=none; b=dBBJ57lmMuuch6K1WfjqM7jOvCFc5WzDA0yH09/dkzeueCWVR6XybwWUEQ5aALE55yozIO RyckbIUsG/g54Ot1F9CYJMFR0zoZ5eDFqwkKSt09dS2/7r0fH5iNX+uW2bg9y7EHpcrIhP /N+7Dck2FeDUOqK1jHChgc18yyZKVfeXfktomo0NVGnxlXr1L0zsg7ZGMWwRd+UHwg0nbb kaXnnEwWgHR17pcQE+XL/B1Zixf+OWJhISGOeJQpm7x+397FBO6RzEE92akrC48I9q0qDK 5tzSgsPRaSMR+UdaB96DhAgYxZAJiq5y4iXQR7DUtUm2FVJCArjRmcdrPTVk0A== Received: from [172.21.4.172] (dynamic-177-53-82-16.telecominternet.net.br [177.53.82.16]) (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) (Authenticated sender: garga) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bCDVX217nzN9N; Wed, 04 Jun 2025 17:05:40 +0000 (UTC) (envelope-from garga@FreeBSD.org) Message-ID: Date: Wed, 4 Jun 2025 14:05:37 -0300 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 From: Renato Botelho Subject: Re: git: 970a71e1ef9a - main - Rename BLOW_KERNEL_WITH_EXTERR to BLOAT_KERNEL_WITH_EXTERR To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202505312303.54VN3rQt087436__9389.77073399059$1748732662$gmane$org@gitrepo.freebsd.org> Content-Language: en-US Autocrypt: addr=garga@FreeBSD.org; keydata= xsBNBGStavwBCACjNlp/9+Y+VFe9ieR2h/WWbdvjz4Mb2z/f22bGoaskzCfvVNbo/v3i34I9 H6OdgZkGqheQEAD2jNfRbmPr4z40xDMUpYGLds+1Mvg7G3Hms3j5Ef8KaLSWUNWIfwKdfSVR Qs35ccSJxAdRW5YdI6J3xZgika+3Bc4eJ05YE/nWW+PNTYevt5rqD50N3zybVYIcLoqVPpBi AZE/sf5SLiLACIJb1t/s4x+pi8vgWevxVVT9u8V1f8zYErmHSLSqjxii0B3eRZphX9NCJOv9 +tfFZhnENInhn9gT7H4e2YumUltEy3jacONHJF3CC1pvvWEa6lEyypclMOkHQwNON7DLABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4FAheAFiEERL7Dxegbnh7xTiQ5Ob6P xxJcZXoFAmSta78CGQEACgkQOb6PxxJcZXrYlggAgaZmr6c1yIWzN8VksHrHpwt/uxONEP+h ljy3yfrMsgfS5wx5Uzgfih1xYZUFC6jiI63CetqBqJpp3g1klRS1UWYKx2NeXphDMYZEdPm/ a6sXh4bKZbk6IE8Yn0/YiRT57d9DtbvswC7Gn7Igj/MSbhl49TvTGyvuB6juaffVoYZViomx 5zMoee8Ml2o2qj3MrCJ+/K8GU54RlpOGqGRsqdwVdr9XEWub6fF2YFwR46cjmbiU3P5urFHH nkJlBGPIwKxHimTW0lZsdx9aCKRDd/D80/WOEzXmk3k8B9lv/GsvOluHmveLhJG1R1tIJ31I f2q8dfTvqsQXnu8CcWRcgc7ATQRkrWr8AQgA1DufoxScA+CWQbUR6zExIu8wXQKrhuRt4DG2 BgynT7EMUvEBadcbQRZXsBpemNfncc9Axyut/+rWiyKJf9BLQuo/9QYmSRvW1U6+0LJUYmdg kMyBeYaPk+vnssv/u9jLuvV7FVgyE0yk1iaWIKOVDD+XrQCOvGw9uSceBrQyCyo3A/eRM/+p vnDCaywR63PKE+3axk6lfNdGK3TnaWmS30/ZDCZlNsXuqprqR4JdT5wXids5o36dsuJ5EZ20 s5hNMD34s4Yr1Y1R9elH6qBsFCpozs0+jwrArxq+UJJCR6hH5W8ZEwJtRC8tzR8mRE1WywzX BXYj0YhfGztQIxZckQARAQABwsB8BBgBCgAmFiEERL7Dxegbnh7xTiQ5Ob6PxxJcZXoFAmSt avwCGwwFCQWjmoAACgkQOb6PxxJcZXr1vgf/SKXhoZcUU5I7TqcbHg0lJz9tICTupCGHWr/s SQgjh9oEM5j1wqW7FlCGP90Tl9K0g3ow9YdbhU7VK470o6pymX9V9eLHzGgkZO/KMEtGBeK1 u+5ePjCJ/MK5B21KODLSU7WrIL1VN5ceXfQPLYt02LMLtPri+oduHD6RNBeA7US1DUzleq5F 9NHGbvV2U7BdDUezpiO8NaFjFZVB11I5d99FxUM5XGVstI3VhsRKZxjY0KnqJzaQgTFsPGmv AUfZVIN1pXgXiedhPXpr8+Y64jP+pHVwpVmh1zYWL6+q3kqFOUVP6c5iiMeoEXZvgJz7x/AC ek3X5gvu8Hpcv+MZIg== In-Reply-To: <202505312303.54VN3rQt087436__9389.77073399059$1748732662$gmane$org@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 31/05/25 20:03, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=970a71e1ef9a9792059c7c824a0106abb4fddcec > > commit 970a71e1ef9a9792059c7c824a0106abb4fddcec > Author: Konstantin Belousov > AuthorDate: 2025-05-31 22:06:46 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-05-31 22:59:55 +0000 > > Rename BLOW_KERNEL_WITH_EXTERR to BLOAT_KERNEL_WITH_EXTERR > > Guessed by: alc > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Hello Konstantin! I've upgraded my laptop recently and got a panic during boot. After bisecting I ended up on this series of commits you pushed on May 31. Commit 7944a87dce93 made by Jessica is good for me and after applying all these commits (2761de0832c1..970a71e1ef9a) I see the panic. Most recent main also panics so it's consistent for me. KDB: stack backtrace: db_trace_self_urapper() at db_trace_self_urapper+0x2b/frame 0xfffffe0137afda80 vpanic() at vpanic+0x136/frame 0xfffffe0137afdbb0 panic() at panic+0x43/frame Bxfffffe0137afdc10 trap_pfault() at trap_pfault+0x3da/frame 0xfffffe0137afdc60 calltrap() at calltrap+0x8/frame 0xfffffe0137afdc60 --- trap Oxc, rip = 0xffffffff80df545c, rsp = Bxfffffe0137afdd30, rbp = 0xfffffe0137afdd50 --- autoremove_wake_function() at autoremove_wake_function+0xic/frame 0xfffffe0137afdd50 linux_wake_up() at linux_wake_up+Bxca/frame 0xfffffe0137afdda0 gen8_de_irg_handler() at genB_de_irq_handler+0x501/frame 0xfffffe@137afde10 gen11_irq_ handler() at gen11_irq_handler +0x93/frame Exfffffe0137afde40 lkpi_irq_handler() at lkpi_irq_handler+0x29/frame 0xfffffe0137afde60 ithread_loop() at ithread_1oop+0x239/frame 0xfffffe0137afdef0 fork_exit() at fork_exit+0x7b/frame 0xfffffe0137afdf30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0137afdf30 --- trap @x1288d8, rip = 0x9d00b000128994, rsp = 0x9d030000128a10, rbp = 0x9cd3a0001287b0 --- KDB: enter: panic [] thread pid 12 tid 100892 ] Stopped at kdb_enter+0x33: movq $0,0x10333f2(%rip) db> -- Renato Botelho From nobody Wed Jun 4 17:06:51 2025 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 4bCDWv618Tz5xKVb; Wed, 04 Jun 2025 17:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCDWv5flSz4JK0; Wed, 04 Jun 2025 17:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749056811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRJAZP0a0ARwmluSBTNjf7k3tb5lDHjsHaTNG/2FTic=; b=YkCxI4p67TpF8dpAXzcU1lWhzC4ht95vO+5zfuSGju9owBod12BWHhLcAtVRFP4bQKW8WK ft+r5EBMlLgZIGWMZvUjrBb8xL9GZZWxYfhCZRxYtncvE/bIaxJl5mEl8Ic2H56mU61R5W DSyYb7JA1SfbsVEzbOtz4N1eOMwBfRWaP80oHbKN2KjBIksAHo9HbvqgtH72UtN197CJrM giTpCy2KMnoSopjs+l2D9iUQ+liudILAcCkudO3LlEfVD++78bKQ5wXcP35fldoHTY7V/s 5MQgvyPytoflJrR6JOxNpk3kXylypxd2Zt0bUPmMWmLS95x1v0owO+0iI5ry1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749056811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRJAZP0a0ARwmluSBTNjf7k3tb5lDHjsHaTNG/2FTic=; b=r39Rvf+HfvLtMnIW8Fd9hLWtrTbRvx3bRl001QKL2LtlmgDC8nKAKJsi93CE9IZq9dvruu 2b2aYqCqN0MJpzeN1hF8+hInnGeQA/kJy+ld9mHfrbgIQQf7v0LpjDNk+qqL0sa4bIiqyY sfwffINaLeE8RWfOYurhJIzr0p4wKWab9wZrOcFSGNfQULgUeUKDo3Xk4MmYiziZEz+LFl yNBCZujHigBJRll2uvkBp8oLQ5E4ozvAE1nh8/BqDibkgtAZ/vTup0BOUuL/y0TBQKrqOS JEB+C7CCKPD8kLGp3ojpSqj7iwuRMUXZ4cSH4duo5Oy8lfUJcX+P/yv9LxXUqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749056811; a=rsa-sha256; cv=none; b=RI1FYPxYaCJc1RTvTsKKfO7tNFd03gKYeOyUJJE8OZfvjHfRzc3PJKpi8sMc0oYdMZV4T9 cmPNbJmFQmJMj0pjP2vJ7Um3czm8zO+NJdTAHunaP6GbfF95ad3o6s3Hb6OJGUfkptFRNt TghWWsuwlS0F8B1cfyPTcayfLMNmzucE9sxFwkgasvizOyCx+kdV5jnRlomcDJ66ZhJt1h 3d3noUeFvlzPZQmbiVZn+VRAdJd5Bi5rP21UK/kQ1ELmw4bxIcU5MnmhLS3nOOz2qXHnOc 5GJ/+0Ix1baRsW1Zq5IyADDFoyC6M9k+tjIW16ybS9KDNU47O8vZ+VL1XnSnuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCDWv5FNKzZ3G; Wed, 04 Jun 2025 17:06:51 +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 554H6p2v036228; Wed, 4 Jun 2025 17:06:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554H6pXg036225; Wed, 4 Jun 2025 17:06:51 GMT (envelope-from git) Date: Wed, 4 Jun 2025 17:06:51 GMT Message-Id: <202506041706.554H6pXg036225@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: 8378665ff917 - main - tools: build: add a rewrite of makeman in lua 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: 8378665ff9176677c2ed117756afceb601a1dca0 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8378665ff9176677c2ed117756afceb601a1dca0 commit 8378665ff9176677c2ed117756afceb601a1dca0 Author: Kyle Evans AuthorDate: 2025-06-04 17:06:25 +0000 Commit: Kyle Evans CommitDate: 2025-06-04 17:06:29 +0000 tools: build: add a rewrite of makeman in lua The primary benefit of this rewrite is that it parallelizes a number of the make(1) jobs that it needs to do. It does so with a very naive forking model that could likely be improved, but is sufficient for our purposes. This version also doesn't assume that CWD is sane, and instead operates relative to the directory the script resides in. Note that this initial version is only intended to match the output of the legacy script. Some work is planned afterward to refactor the script out into various components to improve maintainability after we have switched over to it. In my horribly performing dev environment, this version runs in 40s rather than the original ~2 minutes. On a Mt. Snow machine, this version runs in ~15s rather than the original ~1m40s. This change does not yet switch the top-level `makeman` target over to the new version. Reviewed by: bapt (earlier version), emaste Differential Revision: https://reviews.freebsd.org/D39084 --- tools/build/options/makeman.lua | 791 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 791 insertions(+) diff --git a/tools/build/options/makeman.lua b/tools/build/options/makeman.lua new file mode 100644 index 000000000000..e96e6f50174b --- /dev/null +++ b/tools/build/options/makeman.lua @@ -0,0 +1,791 @@ +-- +-- Copyright (c) 2023 Kyle Evans +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- + +local libgen = require('posix.libgen') +local lfs = require('lfs') +local stdlib = require('posix.stdlib') +local unistd = require('posix.unistd') +local sys_wait = require('posix.sys.wait') + +local curdate = os.date("%B %e, %Y") + +local output_head = ".\\\" DO NOT EDIT-- this file is @" .. [[generated by tools/build/options/makeman. +.Dd ]] .. curdate .. [[ + +.Dt SRC.CONF 5 +.Os +.Sh NAME +.Nm src.conf +.Nd "source build options" +.Sh DESCRIPTION +The +.Nm +file contains variables that control what components will be generated during +the build process of the +.Fx +source tree; see +.Xr build 7 . +.Pp +The +.Nm +file uses the standard makefile syntax. +However, +.Nm +should not specify any dependencies to +.Xr make 1 . +Instead, +.Nm +is to set +.Xr make 1 +variables that control the aspects of how the system builds. +.Pp +The default location of +.Nm +is +.Pa /etc/src.conf , +though an alternative location can be specified in the +.Xr make 1 +variable +.Va SRCCONF . +Overriding the location of +.Nm +may be necessary if the system-wide settings are not suitable +for a particular build. +For instance, setting +.Va SRCCONF +to +.Pa /dev/null +effectively resets all build controls to their defaults. +.Pp +The only purpose of +.Nm +is to control the compilation of the +.Fx +source code, which is usually located in +.Pa /usr/src . +As a rule, the system administrator creates +.Nm +when the values of certain control variables need to be changed +from their defaults. +.Pp +In addition, control variables can be specified +for a particular build via the +.Fl D +option of +.Xr make 1 +or in its environment; see +.Xr environ 7 . +.Pp +The environment of +.Xr make 1 +for the build can be controlled via the +.Va SRC_ENV_CONF +variable, which defaults to +.Pa /etc/src-env.conf . +Some examples that may only be set in this file are +.Va WITH_DIRDEPS_BUILD , +and +.Va WITH_META_MODE , +and +.Va MAKEOBJDIRPREFIX +as they are environment-only variables. +.Pp +The values of +.Va WITH_ +and +.Va WITHOUT_ +variables are ignored regardless of their setting; +even if they would be set to +.Dq Li FALSE +or +.Dq Li NO . +The presence of an option causes +it to be honored by +.Xr make 1 . +.Pp +This list provides a name and short description for variables +that can be used for source builds. +.Bl -tag -width indent +]] + +local output_tail = [[.El +.Sh FILES +.Bl -tag -compact -width Pa +.It Pa /etc/src.conf +.It Pa /etc/src-env.conf +.It Pa /usr/share/mk/bsd.own.mk +.El +.Sh SEE ALSO +.Xr make 1 , +.Xr make.conf 5 , +.Xr build 7 , +.Xr ports 7 +.Sh HISTORY +The +.Nm +file appeared in +.Fx 7.0 . +.Sh AUTHORS +This manual page was autogenerated by +.An tools/build/options/makeman . +]] + +local scriptdir = libgen.dirname(stdlib.realpath(arg[0])) +local srcdir = stdlib.realpath(scriptdir .. "/../../../") +local makesysdir = srcdir .. "/share/mk" + +local make_envvar = os.getenv("MAKE") +local make_cmd_override = {} +if make_envvar then + for word in make_envvar:gmatch("[^%s]+") do + make_cmd_override[#make_cmd_override + 1] = word + end +end + +-- Lifted from bsdinstall/scripts/pkgbase.in (read_all) +local function read_pipe(pipe) + local ret = "" + repeat + local buffer = assert(unistd.read(pipe, 1024)) + ret = ret .. buffer + until buffer == "" + return ret +end +local function run_make(args) + local cmd_args = {"env", "-i", "make", "-C", srcdir, "-m", makesysdir, + "__MAKE_CONF=/dev/null", "SRCCONF=/dev/null"} + + if #make_cmd_override > 0 then + cmd_args[3] = make_cmd_override[1] + for k = 2, #make_cmd_override do + local val = make_cmd_override[k] + + table.insert(cmd_args, 3 + (k - 1), val) + end + end + for k, v in ipairs(args) do + cmd_args[#cmd_args + 1] = v + end + + local r, w = assert(unistd.pipe()) + local pid = assert(unistd.fork()) + if pid == 0 then + -- Child + assert(unistd.close(r)) + assert(unistd.dup2(w, 1)) + assert(unistd.dup2(w, 2)) + assert(unistd.execp("env", cmd_args)) + unistd._exit() + end + + -- Parent + assert(unistd.close(w)) + + local output = read_pipe(r) + assert(unistd.close(r)) + + local _, exit_type, exit_code = assert(sys_wait.wait(pid)) + assert(exit_type == "exited", "make exited with wrong status") + assert(exit_code == 0, "make exited unsuccessfully") + return output +end + +local function native_target() + local output = run_make({"MK_AUTO_OBJ=NO", "-V", "MACHINE", + "-V", "MACHINE_ARCH"}) + + local arch, machine_arch + for x in output:gmatch("[^\n]+") do + if not arch then + arch = x + elseif not machine_arch then + machine_arch = x + end + end + + return arch .. "/" .. machine_arch +end + +local function src_targets() + local targets = {} + targets[native_target()] = true + + local output = run_make({"MK_AUTO_OBJ=no", "targets"}) + local curline = 0 + + for line in output:gmatch("[^\n]+") do + curline = curline + 1 + if curline ~= 1 then + local arch = line:match("[^%s]+/[^%s]+") + + -- Make sure we don't roll over our default arch + if arch and not targets[arch] then + targets[arch] = false + end + end + end + + return targets +end + +local function config_options(srcconf, env, take_dupes, linting) + srcconf = srcconf or "/dev/null" + env = env or {} + + local option_args = {".MAKE.MODE=normal", "showconfig", + "SRC_ENV_CONF=" .. srcconf} + + for _, val in ipairs(env) do + option_args[#option_args + 1] = val + end + + local output = run_make(option_args) + + local options = {} + local known_dupes = {} + + local function warn_on_dupe(option, val) + if not linting or known_dupes[option] then + return false + end + if not option:match("^OPT_") then + val = val == "yes" + end + + known_dupes[option] = true + return val ~= options[val] + end + + for opt in output:gmatch("[^\n]+") do + if opt:match("^MK_[%a%d_]+%s+=%s+.+") then + local name = opt:match("MK_[%a%d_]+") + local val = opt:match("= .+"):sub(3) + + -- Some settings, e.g., MK_INIT_ALL_ZERO, may end up + -- output twice for some reason that I haven't dug into; + -- take the first value. In some circumstances, though, + -- we do make an exception and actually want to take the + -- latest. + if take_dupes or options[name] == nil then + options[name] = val == "yes" + elseif warn_on_dupe(name, val) then + io.stderr:write("ignoring duplicate option " .. + name .. "\n") + end + elseif opt:match("^OPT_[%a%d_]+%s+=%s+.+") then + local name = opt:match("OPT_[%a%d_]+") + local val = opt:match("= .+"):sub(3) + + -- Multi-value options will arbitrarily use a table here + -- to indicate the difference. + if take_dupes or options[name] == nil then + options[name] = val + elseif warn_on_dupe(name, val) then + io.stderr:write("ignoring duplicate option " .. + name .. "\n") + end + end + end + + return options +end + +local function env_only_options() + local output = run_make({"MK_AUTO_OBJ=no", "-V", "__ENV_ONLY_OPTIONS"}) + local options = {} + + for opt in output:gmatch("[^%s]+") do + options["MK_" .. opt] = true + end + + return options +end + +local function required_options() + local output = run_make({"-f", "share/mk/src.opts.mk", "-V", + "__REQUIRED_OPTIONS"}) + local options = {} + + for opt in output:gmatch("[^%s]+") do + options["MK_" .. opt] = true + end + + return options +end + +local function config_description(option_name) + local fh = io.open(scriptdir .. "/" .. option_name) + local desc + + if fh then + desc = "" + for line in fh:lines() do + if not line:match("%$FreeBSD%$") then + desc = desc .. line .. "\n" + end + end + + assert(fh:close()) + end + + return desc +end + +local function config_descriptions(options) + local desc = {} + for name, _ in pairs(options) do + if name:match("^MK_") then + local basename = name:gsub("^MK_", "") + local with_name = "WITH_" .. basename + local without_name = "WITHOUT_" .. basename + + desc[with_name] = config_description(with_name) + desc[without_name] = config_description(without_name) + elseif name:match("^OPT_") then + local basename = name:gsub("^OPT_", "") + + desc[name] = config_description(basename) + end + end + return desc +end + +local function dependent_options(tmpdir, option_name, all_opts, omit_others) + local opt_sense = not not option_name:match("^WITH_") + local base_option_name = option_name:gsub("^[^_]+_", "") + local prefix = (opt_sense and "WITHOUT_") or "WITH_" + + local srcconf = tmpdir .. "/src-" ..prefix .. "ALL_" .. + option_name .. ".conf" + local fh = assert(io.open(srcconf, "w+")) + + fh:write(option_name .. "=\"YES\"\n") + if not omit_others then + for opt, value in pairs(all_opts) do + local base_opt = opt:gsub("^MK_", "") + + if base_opt ~= base_option_name then + local opt_prefix = (value and "WITH_") or "WITHOUT_" + fh:write(opt_prefix .. base_opt .. "=\"YES\"\n") + end + end + end + assert(fh:close()) + + local option_name_key = "MK_" .. base_option_name + local options = config_options(srcconf, nil, omit_others) + for name, value in pairs(options) do + if name == option_name_key or value == all_opts[name] then + options[name] = nil + elseif name:match("^OPT_") then + -- Strip out multi-option values at the moment, they do + -- not really make sense. + options[name] = nil + end + end + + return options +end + +local function export_option_table(fd, name, options) + unistd.write(fd, name .. " = {") + for k, v in pairs(options) do + v = (v and "true") or "false" + unistd.write(fd, "['" .. k .. "'] = " .. v .. ",") + end + unistd.write(fd, "}") +end + +local function all_dependent_options(tmpdir, options, default_opts, + with_all_opts, without_all_opts) + local all_enforced_options = {} + local all_effect_options = {} + local children = {} + + for _, name in ipairs(options) do + local rfd, wfd = assert(unistd.pipe()) + local pid = assert(unistd.fork()) + + if pid == 0 then + -- We need to pcall() this so that errors bubble up to + -- our _exit() call rather than the main exit. + local ret, errobj = pcall(function() + unistd.close(rfd) + + local compare_table + if name:match("^WITHOUT") then + compare_table = with_all_opts + else + compare_table = without_all_opts + end + + -- List of knobs forced on by this one + local enforced_options = dependent_options(tmpdir, name, + compare_table) + -- List of knobs implied by this by one (once additionally + -- filtered based on enforced_options values) + local effect_options = dependent_options(tmpdir, name, + default_opts, true) + + export_option_table(wfd, "enforced_options", + enforced_options) + export_option_table(wfd, "effect_options", + effect_options) + end) + + io.stderr:write(".") + + if ret then + unistd._exit(0) + else + unistd.write(wfd, errobj) + unistd._exit(1) + end + end + + unistd.close(wfd) + children[pid] = {name, rfd} + end + + while next(children) ~= nil do +::again:: + local pid, status, exitcode = sys_wait.wait(-1) + + if status ~= "exited" then + goto again + end + + local info = children[pid] + children[pid] = nil + + local name = info[1] + local rfd = info[2] + local buf = '' + local rbuf, sz + + -- Drain the pipe + rbuf = unistd.read(rfd, 512) + while #rbuf ~= 0 do + buf = buf .. rbuf + rbuf = unistd.read(rfd, 512) + end + + unistd.close(rfd) + + if exitcode ~= 0 then + error("Child " .. pid .. " failed, buf: " .. buf) + end + + -- The child has written a pair of tables named enforced_options + -- and effect_options to the pipe. We'll load the pipe buffer + -- as a string and then yank these out of the clean environment + -- that we execute the chunk in. + local child_env = {} + local res, err = pcall(load(buf, "child", "t", child_env)) + + all_enforced_options[name] = child_env["enforced_options"] + all_effect_options[name] = child_env["effect_options"] + end + + io.stderr:write("\n") + return all_enforced_options, all_effect_options +end + +local function get_defaults(target_archs, native_default_opts) + local target_defaults = {} + -- Set of options with differing defaults in some archs + local different_defaults = {} + + for tgt, dflt in pairs(target_archs) do + if dflt then + local native_copy = {} + for opt, val in pairs(native_default_opts) do + native_copy[opt] = val + end + target_defaults[tgt] = native_copy + goto skip + end + + local target = tgt:gsub("/.+$", "") + local target_arch = tgt:gsub("^.+/", "") + + local target_opts = config_options(nil, {"TARGET=" .. target, + "TARGET_ARCH=" .. target_arch}) + + for opt, val in pairs(target_opts) do + if val ~= native_default_opts[opt] then + different_defaults[opt] = true + end + end + + target_defaults[tgt] = target_opts +::skip:: + end + + for opt in pairs(native_default_opts) do + if different_defaults[opt] == nil then + for _, opts in pairs(target_defaults) do + opts[opt] = nil + end + end + end + + for tgt, opts in pairs(target_defaults) do + local val = opts["MK_ACPI"] + + if val ~= nil then + print(" - " .. tgt .. ": " .. ((val and "yes") or "no")) + end + end + + return target_defaults, different_defaults +end + +local function option_comparator(lhs, rhs) + -- Convert both options to the base name, compare that instead unless + -- they're the same option. For the same option, we just want to get + -- ordering between WITH_/WITHOUT_ correct. + local base_lhs = lhs:gsub("^[^_]+_", "") + local base_rhs = rhs:gsub("^[^_]+_", "") + + if base_lhs == base_rhs then + return lhs < rhs + else + return base_lhs < base_rhs + end +end + +local function main(tmpdir) + io.stderr:write("building src.conf.5 man page from files in " .. + scriptdir .. "\n") + + local env_only_opts = env_only_options() + local default_opts = config_options(nil, nil, nil, true) + local opt_descriptions = config_descriptions(default_opts) + local srcconf_all = tmpdir .. "/src-all-enabled.conf" + local fh = io.open(srcconf_all, "w+") + local all_targets = src_targets() + local target_defaults, different_defaults = get_defaults(all_targets, + default_opts) + local options = {} + local without_all_opts = {} + + for name, value in pairs(default_opts) do + if name:match("^MK_") then + local base_name = name:gsub("^MK_", "") + local with_name = "WITH_" .. base_name + local without_name = "WITHOUT_" .. base_name + -- If it's differently defaulted on some architectures, + -- we'll split it into WITH_/WITHOUT_ just to simplify + -- some later bits. + if different_defaults[name] ~= nil then + options[#options + 1] = with_name + options[#options + 1] = without_name + elseif value then + options[#options + 1] = without_name + else + options[#options + 1] = with_name + end + + without_all_opts[name] = false + assert(fh:write(with_name .. '="YES"\n')) + else + options[#options + 1] = name + end + end + + assert(fh:close()) + + local with_all_opts = config_options(srcconf_all) + local all_enforced_options, all_effect_options + local all_required_options = required_options() + + all_enforced_options, all_effect_options = all_dependent_options(tmpdir, + options, default_opts, with_all_opts, without_all_opts) + + table.sort(options, option_comparator) + io.stdout:write(output_head) + for _, name in ipairs(options) do + local value + + if name:match("^OPT_") then + goto skip + end + assert(name:match("^WITH"), "Name looks wrong: " .. name) + local describe_option = name + + value = not not name:match("^WITHOUT") + + -- Normalize name to MK_ for indexing into various other + -- arrays + name = "MK_" .. name:gsub("^[^_]+_", "") + + print(".It Va " .. describe_option:gsub("^OPT_", "")) + if opt_descriptions[describe_option] then + io.stdout:write(opt_descriptions[describe_option]) + else + io.stderr:write("Missing description for " .. + describe_option .. "\n") + end + + local enforced_options = all_enforced_options[describe_option] + local effect_options = all_effect_options[describe_option] + + if different_defaults[name] ~= nil then + print([[.Pp +This is a default setting on]]) + + local which_targets = {} + for tgt, tgt_options in pairs(target_defaults) do + if tgt_options[name] ~= value then + which_targets[#which_targets + 1] = tgt + end + end + + table.sort(which_targets) + for idx, tgt in ipairs(which_targets) do + io.stdout:write(tgt) + if idx < #which_targets - 1 then + io.stdout:write(", ") + elseif idx == #which_targets - 1 then + io.stdout:write(" and ") + end + end + print(".") + end + + -- Unset any implied options that are actually required. + for dep_opt in pairs(enforced_options) do + if all_required_options[dep_opt] then + enforced_options[dep_opt] = nil + end + end + if next(enforced_options) ~= nil then + print([[When set, it enforces these options: +.Pp +.Bl -item -compact]]) + + local sorted_dep_opt = {} + for dep_opt in pairs(enforced_options) do + sorted_dep_opt[#sorted_dep_opt + 1] = dep_opt + end + + table.sort(sorted_dep_opt) + for _, dep_opt in ipairs(sorted_dep_opt) do + local dep_val = enforced_options[dep_opt] + local dep_prefix = (dep_val and "WITH_") or + "WITHOUT_" + local dep_name = dep_opt:gsub("^MK_", + dep_prefix) + print(".It") + print(".Va " .. dep_name) + end + + print(".El") + end + + if next(effect_options) ~= nil then + if next(enforced_options) ~= nil then + -- Remove any options that were previously + -- noted as enforced... + for opt, val in pairs(effect_options) do + if enforced_options[opt] == val then + effect_options[opt] = nil + end + end + + -- ... and this could leave us with an empty + -- set. + if next(effect_options) == nil then + goto noenforce + end + + print(".Pp") + end + + print([[When set, these options are also in effect: +.Pp +.Bl -inset -compact]]) + + local sorted_dep_opt = {} + for dep_opt in pairs(effect_options) do + sorted_dep_opt[#sorted_dep_opt + 1] = dep_opt + end + + table.sort(sorted_dep_opt) + for _, dep_opt in ipairs(sorted_dep_opt) do + local dep_val = effect_options[dep_opt] + local dep_prefix = (dep_val and "WITH_") or + "WITHOUT_" + local not_dep_prefix = ((not dep_val) and "WITH_") or + "WITHOUT_" + local dep_name = dep_opt:gsub("^MK_", + dep_prefix) + local not_dep_name = dep_opt:gsub("^MK_", + not_dep_prefix) + + print(".It Va " .. dep_name) + print("(unless") + print(".Va " .. not_dep_name) + print("is set explicitly)") + end + + print(".El") +::noenforce:: + end + + if env_only_opts[name] ~= nil then + print([[.Pp +This must be set in the environment, make command line, or +.Pa /etc/src-env.conf , +not +.Pa /etc/src.conf .]]) + end + ::skip:: + end + print([[.El +.Pp +The following options accept a single value from a list of valid values. +.Bl -tag -width indent]]) + for _, name in ipairs(options) do + if name:match("^OPT_") then + local desc = opt_descriptions[name] + + print(".It Va " .. name:gsub("^OPT_", "")) + if desc then + io.stdout:write(desc) + else + io.stderr:write("Missing description for " .. + name .. "\n") + end + end + end + io.stdout:write(output_tail) +end + +local tmpdir = "/tmp/makeman." .. unistd.getpid() + +if not lfs.mkdir(tmpdir) then + error("Failed to create tempdir " .. tmpdir) +end + +-- Catch any errors so that we can properly clean up, then re-throw it. +local ret, errobj = pcall(main, tmpdir) + +for fname in lfs.dir(tmpdir) do + if fname ~= "." and fname ~= ".." then + assert(os.remove(tmpdir .. "/" .. fname)) + end +end + +if not lfs.rmdir(tmpdir) then + assert(io.stderr:write("Failed to clean up tmpdir: " .. tmpdir .. "\n")) +end + +if not ret then + io.stderr:write(errobj .. "\n") + os.exit(1) +end From nobody Wed Jun 4 17:25:09 2025 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 4bCDx432JSz5xLQc; Wed, 04 Jun 2025 17:25:12 +0000 (UTC) (envelope-from garga@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCDx4178Xz3FfW; Wed, 04 Jun 2025 17:25:12 +0000 (UTC) (envelope-from garga@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749057912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gdKS5R3XTaA4AtQE6f0vBkAlA7aJoaipeS1ix9Zz1bg=; b=wPjEymJAV6XdXWENwUdwN+28+fPieR/Zhs33k3k+GQ9v0qOd8YgmAhhW7Vizpy4lKUoggg OlHNz0AXDF0cveQX1gQR/3pqv8aSvdnaqQi9/JqO4beJkDqoQ7N2EENXafUwUMUmu5cuvq 3zT/ikBpmWmJOmPBUjL+bQ4EWU/yE+ACWN03dQ8+GpKnNFbXjbcfqiDssoljEGWkQDJ6cI A+qluawTwT1XXuc3E+eEFp9doOcsGIMO+2z+83dkj60LKDQnHI6u9e4KRSQVSQHugx2EsM txn2lk/DDqi/17JPff8nTfVfi6DNhnT0WcvN4C+c6w9z8tPy3oWXZxp3cGaO/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749057912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gdKS5R3XTaA4AtQE6f0vBkAlA7aJoaipeS1ix9Zz1bg=; b=LtJG/5XEjbr+y+A0D5XGefUCHvLBBbKAsKwZKX+KXcH1kR67jrMoXrOYoxKNQAS4mTQ/HK YVsPqu66f38AM1Mw00lIZ1M35YA6+gR9CjVGf5oYxNUTjoZSpl6MxuEwNvZE/V7craXXOp e4CtmnHwExdRYU6DoRe6NV9dOL1yWn8QeSJAU2YMZWUGJkNYKtYAbybpGRaZqF41g9D43E NmCb7xTeDPxW8+7c7cGnsVjnX7Mg4goSvYCGc88G0YYnkcVFk9cVxGUcbSCxGVJ3lmPmmo KS3G0l387DYnsaeoz0kXcFT62zuHgRQejRo0xY9CNUNmL/iaIetenAQVGYDWpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749057912; a=rsa-sha256; cv=none; b=syAkcpfuCH9y47JrnMtmm2ZVwtEcyAAPkN+GgBo9aZEx3g1nMmgWg9bdYoougWMI2BlAFV GEx16LZjKCNc3dwbyXdKdzvAMnKN1u2HNTQR2atDQnKKl3LM5W/NglPc5kQGTN+maKM+Fa n6QKuQyM1YmQZrIuM9679PwD3kKUQtcn/cK3OB3y9unCgnQaEptcSM7jwEF98InzYzOVc7 lg6KJ+t+op/1rOEqepIEzjV7ksd/Zp4kApxboIbdq8xmXD6EQWae8yNrptV/FXAMVE1/qR X2TjIDE0flO6HDO11JqtxQPEl3XcGRLFjQskgakbCffOTmY9qhXTlI/Y1iqveg== Received: from [172.21.4.172] (dynamic-177-53-82-16.telecominternet.net.br [177.53.82.16]) (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) (Authenticated sender: garga) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bCDx33JzDzNSN; Wed, 04 Jun 2025 17:25:11 +0000 (UTC) (envelope-from garga@FreeBSD.org) Message-ID: <94de9c44-1ed7-4b9c-94ba-029ad5c11d93@FreeBSD.org> Date: Wed, 4 Jun 2025 14:25:09 -0300 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: 970a71e1ef9a - main - Rename BLOW_KERNEL_WITH_EXTERR to BLOAT_KERNEL_WITH_EXTERR From: Renato Botelho To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202505312303.54VN3rQt087436__9389.77073399059$1748732662$gmane$org@gitrepo.freebsd.org> Content-Language: en-US Autocrypt: addr=garga@FreeBSD.org; keydata= xsBNBGStavwBCACjNlp/9+Y+VFe9ieR2h/WWbdvjz4Mb2z/f22bGoaskzCfvVNbo/v3i34I9 H6OdgZkGqheQEAD2jNfRbmPr4z40xDMUpYGLds+1Mvg7G3Hms3j5Ef8KaLSWUNWIfwKdfSVR Qs35ccSJxAdRW5YdI6J3xZgika+3Bc4eJ05YE/nWW+PNTYevt5rqD50N3zybVYIcLoqVPpBi AZE/sf5SLiLACIJb1t/s4x+pi8vgWevxVVT9u8V1f8zYErmHSLSqjxii0B3eRZphX9NCJOv9 +tfFZhnENInhn9gT7H4e2YumUltEy3jacONHJF3CC1pvvWEa6lEyypclMOkHQwNON7DLABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4FAheAFiEERL7Dxegbnh7xTiQ5Ob6P xxJcZXoFAmSta78CGQEACgkQOb6PxxJcZXrYlggAgaZmr6c1yIWzN8VksHrHpwt/uxONEP+h ljy3yfrMsgfS5wx5Uzgfih1xYZUFC6jiI63CetqBqJpp3g1klRS1UWYKx2NeXphDMYZEdPm/ a6sXh4bKZbk6IE8Yn0/YiRT57d9DtbvswC7Gn7Igj/MSbhl49TvTGyvuB6juaffVoYZViomx 5zMoee8Ml2o2qj3MrCJ+/K8GU54RlpOGqGRsqdwVdr9XEWub6fF2YFwR46cjmbiU3P5urFHH nkJlBGPIwKxHimTW0lZsdx9aCKRDd/D80/WOEzXmk3k8B9lv/GsvOluHmveLhJG1R1tIJ31I f2q8dfTvqsQXnu8CcWRcgc7ATQRkrWr8AQgA1DufoxScA+CWQbUR6zExIu8wXQKrhuRt4DG2 BgynT7EMUvEBadcbQRZXsBpemNfncc9Axyut/+rWiyKJf9BLQuo/9QYmSRvW1U6+0LJUYmdg kMyBeYaPk+vnssv/u9jLuvV7FVgyE0yk1iaWIKOVDD+XrQCOvGw9uSceBrQyCyo3A/eRM/+p vnDCaywR63PKE+3axk6lfNdGK3TnaWmS30/ZDCZlNsXuqprqR4JdT5wXids5o36dsuJ5EZ20 s5hNMD34s4Yr1Y1R9elH6qBsFCpozs0+jwrArxq+UJJCR6hH5W8ZEwJtRC8tzR8mRE1WywzX BXYj0YhfGztQIxZckQARAQABwsB8BBgBCgAmFiEERL7Dxegbnh7xTiQ5Ob6PxxJcZXoFAmSt avwCGwwFCQWjmoAACgkQOb6PxxJcZXr1vgf/SKXhoZcUU5I7TqcbHg0lJz9tICTupCGHWr/s SQgjh9oEM5j1wqW7FlCGP90Tl9K0g3ow9YdbhU7VK470o6pymX9V9eLHzGgkZO/KMEtGBeK1 u+5ePjCJ/MK5B21KODLSU7WrIL1VN5ceXfQPLYt02LMLtPri+oduHD6RNBeA7US1DUzleq5F 9NHGbvV2U7BdDUezpiO8NaFjFZVB11I5d99FxUM5XGVstI3VhsRKZxjY0KnqJzaQgTFsPGmv AUfZVIN1pXgXiedhPXpr8+Y64jP+pHVwpVmh1zYWL6+q3kqFOUVP6c5iiMeoEXZvgJz7x/AC ek3X5gvu8Hpcv+MZIg== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 04/06/25 14:05, Renato Botelho wrote: > On 31/05/25 20:03, Konstantin Belousov wrote: >> The branch main has been updated by kib: >> >> URL: https://cgit.FreeBSD.org/src/commit/? >> id=970a71e1ef9a9792059c7c824a0106abb4fddcec >> >> commit 970a71e1ef9a9792059c7c824a0106abb4fddcec >> Author:     Konstantin Belousov >> AuthorDate: 2025-05-31 22:06:46 +0000 >> Commit:     Konstantin Belousov >> CommitDate: 2025-05-31 22:59:55 +0000 >> >>      Rename BLOW_KERNEL_WITH_EXTERR to BLOAT_KERNEL_WITH_EXTERR >>      Guessed by:     alc >>      Sponsored by:   The FreeBSD Foundation >>      MFC after:      1 week > Hello Konstantin! > > I've upgraded my laptop recently and got a panic during boot.  After > bisecting I ended up on this series of commits you pushed on May 31. > > Commit 7944a87dce93 made by Jessica is good for me and after applying > all these commits (2761de0832c1..970a71e1ef9a) I see the panic.  Most > recent main also panics so it's consistent for me. Oh, it's caused by i915kms, I'll update and rebuild it manually. It should fix the issue. -- Renato Botelho From nobody Wed Jun 4 18:09:30 2025 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 4bCFwC10HVz5xQCj; Wed, 04 Jun 2025 18:09: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 4bCFwB6zCCz3hrD; Wed, 04 Jun 2025 18:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749060571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0YDetj5ofBWnG3013SGeUykWBqaUrMzEjH5rT/kY93s=; b=j806HR9PV0RSFPHQefyKmRmrUP/btaF44EosKEKUizjjRBDXBMPHy7LfwH5F5CHoeltzXN iSeET1c+zDHhTkmNRfhqJpfNAlBMSft32Puz8xIFJFQWIP+7iS/YbFzSKYbTw2gOWf2Woi 2W9JclySZZu7SfSGBcopGcEfL4Kp+5Rlidx3pkQEtwEl1kyUmeP1xZNrUFGpMXjtn4+OVM lG7pjEkgiSszipza/kXr+JqqJYBk3oiMouE8brxsXEj0Bv49KEs4VQWY294CQdA4r78EZF J2IT/UDHlTyJbQFPSxRYD9Imay7Snwb2mo0TYsj7cDyMVymKwlhy6LC7qYA+aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749060571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0YDetj5ofBWnG3013SGeUykWBqaUrMzEjH5rT/kY93s=; b=U/ib7NY7NSw9gwnQ1wPnrqmsLT+6xt9WMub0o04IrPHD7bIOTeAw7pzBkrf/SY0ajVfQhV CXMHhjWleHwOkKcjFSARToVvLzlkodDWK0JWamDtk2BlSikXyBDwyBHr1ubsNXeiNszI9p y2PMqA4WjVj7xknLKSlvCIb2Zmoi6FX9SU2xVGmYpGlT5DVWo8iNOzt6VS6G7mLeKCXKtZ MirJjODSL7qre8mMmhJbsfEhrQ9MTDdYK/MwBj0Dj/dqebsnm8aK5WqqExcjIyoqGyxQXw p3h7ESEk7VAe1TCimIeEV5sO4HNLA+V/Irq0NXrHKt+2JuYpKo62dY129+H5Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749060571; a=rsa-sha256; cv=none; b=Hzs847ow66j9PTfQRypg4HTG/rnWJurNDOuE3HLRTdsJ/gFqUj435QshRhdti2dFSPxdx7 zkjb+KI5/5fumxpOhfVGgdGvamYvx8e6uHWNpEcJViZVvi+glGP+PMRYfyZ1ub/cmahy8k IorGVAWP9+3Gu2zIHfvMKeMtyNffwISgMReyOBJlhEUWU2cp/4z7j3B4zZP0iRHLRDTw7G T8BcT7rRIqPcnLkjCLnoHMMKCBv7Efc84xm/UJz/2vouyjKGo4ZFtm8ixk3ETK3ewZSg1d mnj6Du2VA3P591HATF9ITDFmMUbgDlFWIgzHL7BI9cr1iwNKvAKJoQL4lCdWOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCFwB6WmGzbZV; Wed, 04 Jun 2025 18:09: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 554I9UZv050132; Wed, 4 Jun 2025 18:09:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554I9UKN050129; Wed, 4 Jun 2025 18:09:30 GMT (envelope-from git) Date: Wed, 4 Jun 2025 18:09:30 GMT Message-Id: <202506041809.554I9UKN050129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: a5b0b2a7d421 - main - C runtime: add kernel version guards on exterrctl 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5b0b2a7d4219ae86f152433b6fcecd9e8c767d6 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=a5b0b2a7d4219ae86f152433b6fcecd9e8c767d6 commit a5b0b2a7d4219ae86f152433b6fcecd9e8c767d6 Author: Brooks Davis AuthorDate: 2025-06-04 17:58:03 +0000 Commit: Brooks Davis CommitDate: 2025-06-04 18:09:19 +0000 C runtime: add kernel version guards on exterrctl This allows userspace to run on a (somewhat) out of date kernel. Avoid a __FreeBSD_version bump and use the bump from a02180cf60a6 which has occured since exterrctl was added. Reviewed by: kevans Fixes: b9c8a07d4dd9 ("C runtime: enable extended error reporting from kernel") Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50687 --- lib/libc/gen/uexterr_gettext.c | 8 ++++++-- lib/libthr/thread/thr_create.c | 6 +++++- lib/libthr/thread/thr_init.c | 5 ++++- sys/sys/param.h | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/uexterr_gettext.c b/lib/libc/gen/uexterr_gettext.c index b4bb93cfdb50..5b8a5cd17a48 100644 --- a/lib/libc/gen/uexterr_gettext.c +++ b/lib/libc/gen/uexterr_gettext.c @@ -8,7 +8,8 @@ * under sponsorship from the FreeBSD Foundation. */ -#include +#define _WANT_P_OSREL +#include #include #include #include @@ -18,11 +19,14 @@ static struct uexterror uexterr = { .ver = UEXTERROR_VER, }; +int __getosreldate(void); + static void uexterr_ctr(void) __attribute__((constructor)); static void uexterr_ctr(void) { - exterrctl(EXTERRCTL_ENABLE, 0, &uexterr); + if (__getosreldate() >= P_OSREL_EXTERRCTL) + exterrctl(EXTERRCTL_ENABLE, 0, &uexterr); } int diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index ba2575d461e5..c66a5bb3bd21 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -27,6 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define _WANT_P_OSREL #include "namespace.h" #include #include @@ -44,6 +45,8 @@ #include "libc_private.h" #include "thr_private.h" +int __getosreldate(void); + static int create_stack(struct pthread_attr *pattr); static void thread_start(struct pthread *curthread); @@ -287,7 +290,8 @@ thread_start(struct pthread *curthread) #endif curthread->uexterr.ver = UEXTERROR_VER; - exterrctl(EXTERRCTL_ENABLE, 0, &curthread->uexterr); + if (__getosreldate() >= P_OSREL_EXTERRCTL) + exterrctl(EXTERRCTL_ENABLE, 0, &curthread->uexterr); /* Run the current thread's start routine with argument: */ _pthread_exit(curthread->start_routine(curthread->arg)); diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index aef2281c5f22..bd1474a7c6e8 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#define _WANT_P_OSREL #include "namespace.h" #include #include @@ -59,6 +60,7 @@ #include "libc_private.h" #include "thr_private.h" +int __getosreldate(void); char *_usrstack; struct pthread *_thr_initial; int _libthr_debug; @@ -434,7 +436,8 @@ init_main_thread(struct pthread *thread) #endif thread->uexterr.ver = UEXTERROR_VER; - exterrctl(EXTERRCTL_ENABLE, EXTERRCTLF_FORCE, &thread->uexterr); + if (__getosreldate() >= P_OSREL_EXTERRCTL) + exterrctl(EXTERRCTL_ENABLE, EXTERRCTLF_FORCE, &thread->uexterr); /* Others cleared to zero by thr_alloc() */ } diff --git a/sys/sys/param.h b/sys/sys/param.h index 98fb0aeacef0..da2089918323 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -107,6 +107,7 @@ #define P_OSREL_TIDPID 1400079 #define P_OSREL_ARM64_SPSR 1400084 #define P_OSREL_TLSBASE 1500044 +#define P_OSREL_EXTERRCTL 1500045 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif From nobody Wed Jun 4 19:11:03 2025 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 4bCHHD1r03z5xTrb; Wed, 04 Jun 2025 19:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCHHC6hCfz3k85; Wed, 04 Jun 2025 19:11:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749064264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=opBq//B5yNiJVoU2nBw92YY76/iWzLVE/iYG95RGQYQ=; b=HZXn1W43BSSAXoh1ggIEomr2yYJLDrzYtMq/KlwO8XOtd7Y2PvlVB4DxF565NOcTWSXvgJ zANKUgnVfLIkTVe8jtHcXw+oXp4W2Wqgjn6sTmwt99ylSPdvyGO8PWIWk6AeVOK3JCMtbU eDzdXSK5hafFeqVVOSh/sc4wa6ggTrjN+pwCYrF2b52qMLYpztIXns8paWqnqAWB9xperS p+IZ2xXlPky6SZgrZr4ZAKpBL1WUr88zxogNTG8Q13cJOX+HGNetQJM38CHVFBvwY+xMfc CycizqdLYTJdr4hiWP606AqzxacPNowqIA0I/U49av3NMFNwHMShbp2dctkjlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749064264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=opBq//B5yNiJVoU2nBw92YY76/iWzLVE/iYG95RGQYQ=; b=n/CBlvhI96SSoVFyfO5XWuvId3G60vMlKdoliIOjz7ykzGRG5Cby1kiVCCg0DPHe4ZV2SP UbzhOBEngRJt754H886n2YHDJFbOAW0XW1NtCfmpgLLaV7czfj4o9L63i1ju1A1uvqyGLq GbcHCHcrN2cP9JNX28GcV9DJe1Uxu2q9fDJJgpK9snJ8+awhWxVBqg8CotouqCIG8NPiSe rhW+zDxXC8+qCoN2YKswPA8drYVTvy1IzNARvSm/CmR/35wt9+iwLxk6JgGZgpOiScPGcA s9cOlTCb5ybEMywBwORzvA0h4Su81rjmrg2X5nP7bXxmGfV8rS2lPovLcYM8BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749064264; a=rsa-sha256; cv=none; b=R9eB/s3O2UE2+aylcqn5Pm/eI/WMRLwtYdbSpesfyfyB/g2CJG9iG2jIwpwJdrxwhWS7P5 qXoj2i5vsB8Qa53JfY1eN3E8VcJSPqtrMYoAZmYP4a4STOKUjUiv3P+3upHD9hLqSa/woA um5g8WXJBhKRMcdev2T9xJ9W6/nf7EJevUwtm/RsYgs03ylrP0JGLeQxTjD3F97y4Y/7LM qCquAH8EfmpaApWVg53lTI6U0fans66ykbkcX3m4Rf7t9z/Xgf7pEvoHQUJwwm80+rnIvG NX5/Yu6qGwTWobHbRZyXUGX37x3qrtVVRbo6wlOQfI3A10Nhjgaj5llhwKu/Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCHHC6BTszcyN; Wed, 04 Jun 2025 19:11:03 +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 554JB3K0071937; Wed, 4 Jun 2025 19:11:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554JB3Lc071934; Wed, 4 Jun 2025 19:11:03 GMT (envelope-from git) Date: Wed, 4 Jun 2025 19:11:03 GMT Message-Id: <202506041911.554JB3Lc071934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 51c8cd7e1a33 - main - arm64 pmap: Eliminate an unnecessary NULL 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: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51c8cd7e1a331af9e46076148c2b57db3474d2dd Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=51c8cd7e1a331af9e46076148c2b57db3474d2dd commit 51c8cd7e1a331af9e46076148c2b57db3474d2dd Author: Alan Cox AuthorDate: 2025-06-01 17:34:00 +0000 Commit: Alan Cox CommitDate: 2025-06-04 19:10:16 +0000 arm64 pmap: Eliminate an unnecessary NULL check The return value from pmap_l1_to_l2() cannot be NULL. --- sys/arm64/arm64/pmap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 625caf6ecd7e..f8e422848e94 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -4210,9 +4210,6 @@ pmap_remove1(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, bool map_delete) va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL) - continue; - l3_paddr = pmap_load(l2); if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { From nobody Wed Jun 4 19:58:40 2025 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 4bCJL86nnDz5xXp2; Wed, 04 Jun 2025 19:58: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 4bCJL847Rhz3Xb5; Wed, 04 Jun 2025 19:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749067120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cjv7w8CNqINpz+zr5run5qDUHH/WAXZoe/mJiJspvw=; b=RWnZgwrkpWKXbvDmsB0P07B1SWmKMfabCvWASrN1nVNm6CeXcmYXhfPLnxCb6Ej4jP+B+G aIPE/yC7+z5DZ15r3gFG99Rp3Vqi/s3o1l24LZ34TIJLZkhtZnTjxMur/a22CfMOCyWVq5 egVg32Mw6BzVyzo8Gtw2M+SQnHXxmz6zpAe11R0G6BfT5v03JMHiMLkI8R0uBzMFthookq k8Tm1zKsMCMxex152w+hZAPCZ2g67kxSA7p3bNX6fNZwEUTH5l6s8+LKOStreugMwFrbwq 46TBrOfUgUH7fXJwq74rVl1UoWQ2Yr7OFjHRGi5dvhoDYw3XCwZiW8gckSzQuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749067120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cjv7w8CNqINpz+zr5run5qDUHH/WAXZoe/mJiJspvw=; b=ylei/haLIjP03H93DcnhBvNyblkTCbS86W5d1t1MTS+u4S5otavKf9cZ3bQMgLcBqls1Ps +CQBNV25WME0mEBHE5TroA17vseJoBeBVEe1FizCtS6ziHdIYSBpcoRMfRi8Ij3xpb+6j2 qeWSIFLX3ne/x4TzhTHBRVLfNmNN3v8NYcjl3mBGzl4s/gJpFunMHKVzN4w/4Y/j3WzCCd 8TP6F5p2tFfB5qg5A/pmqnn3U1N/1nWj5F19dKNIqMC4ni6fniHFXaiuXMru5YdxG8MH6M gjhYs9JbItiHbqgLxl+V82Uui3571ylVWiu58F/EscXCc3xsEpmGFoMEDGyJNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749067120; a=rsa-sha256; cv=none; b=MzXJsIKxH6dxxlw8tTPpZKyLHzS14t8w9kD9LgU7ZLIOGvMkFSce09c0v7Zwqh4L9GDXRp cY95Lhl1hcwMB/SBNhA/q6S5k2yPnv6pnhMP7snt1K7zzScs62xyeX9OEs/WWVsxrLUq9e A4ufQiD7o6cAzrhoWrFdJSjhXr7wctnotrElKW5XecPcgQEIWhWAoyaDNrEsF0O29/6Ypd rpn+TJluwSWvXxR6fRTU1CQ+RX3c1LQZemip0I27betMDGTAh2t+PwL7eLXGS6Og4zDR/U tDcv5/g+Kfj02C4O+m0DCTZ6TD/4D1wSkY/bw16Lg55SrbKyTsP91lF/MF2ZwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCJL83NMgzdkY; Wed, 04 Jun 2025 19:58: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 554Jwe4p056713; Wed, 4 Jun 2025 19:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554JweU5056710; Wed, 4 Jun 2025 19:58:40 GMT (envelope-from git) Date: Wed, 4 Jun 2025 19:58:40 GMT Message-Id: <202506041958.554JweU5056710@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: 8e1e989c77d4 - main - Add host.test.mk for DIRDEPS_BUILD 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: 8e1e989c77d4e35ddc5ca3c143553f973c4a1764 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8e1e989c77d4e35ddc5ca3c143553f973c4a1764 commit 8e1e989c77d4e35ddc5ca3c143553f973c4a1764 Author: Simon J. Gerraty AuthorDate: 2025-06-04 19:56:44 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-04 19:56:44 +0000 Add host.test.mk for DIRDEPS_BUILD If we are doing DIRDEPS_BUILD and MK_RUN_TESTS is yes we can hook tests associated with dirs to be built into the graph such that we avoid circular dependencies but the build will fail should any test fail. Make MK_RUN_TESTS independent of MK_TESTS also for non-DIRDEPS_BUILD ensure we have RELDIR and check it against patterns in HOST_RUN_TESTS. Reviewed by: stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D50387 --- share/mk/Makefile | 1 + share/mk/bsd.opts.mk | 1 + share/mk/bsd.test.mk | 5 +++ share/mk/host.test.mk | 89 +++++++++++++++++++++++++++++++++++++++++++++++ share/mk/local.dirdeps.mk | 56 +++++++++++++++++++++++++++++ 5 files changed, 152 insertions(+) diff --git a/share/mk/Makefile b/share/mk/Makefile index 29de04f89670..837f7da68b4b 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -62,6 +62,7 @@ FILES= \ dirdeps-targets.mk \ gendirdeps.mk \ host-target.mk \ + host.test.mk \ install-new.mk \ jobs.mk \ meta.autodep.mk \ diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index a9400186f78a..85247d733a14 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -79,6 +79,7 @@ __DEFAULT_NO_OPTIONS = \ CTF \ INSTALL_AS_USER \ RETPOLINE \ + RUN_TESTS \ STALE_STAGED \ UBSAN \ UNDEFINED_VERSION \ diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk index b324ac173335..a2e15c840e02 100644 --- a/share/mk/bsd.test.mk +++ b/share/mk/bsd.test.mk @@ -91,6 +91,11 @@ MAN= .include .endif +.if ${MK_RUN_TESTS} == "yes" +# Run tests as part of the build +.include +.endif + .if !target(realcheck) realcheck: .PHONY @echo "$@ not defined; skipping" diff --git a/share/mk/host.test.mk b/share/mk/host.test.mk new file mode 100644 index 000000000000..17bb00a0b28b --- /dev/null +++ b/share/mk/host.test.mk @@ -0,0 +1,89 @@ +# +# If MK_RUN_TESTS is "yes"; we want to run tests for "host" +# during the build - and fail the build if any test fails. +# +# HOST_RUN_TESTS can be used to filter which tests should be built and +# run. It should be a list of glob patterns to apply to RELDIR, +# so "*" would mean all. +# +# For the DIRDEPS_BUILD, HOST_RUN_TESTS defaults to "*" as the +# selection of tests to build and run is taken controlled at level 0 +# in local.dirdeps.mk +# + +.if !target(____) +.error ${.PARSEFILE} cannot be included directly. +.endif + +all: + +.if ${.MAKE.LEVEL} > 0 && !empty(_TESTS) && ${MACHINE:Nhost*} == "" + +# allow for customization +.-include + +.if ${MK_DIRDEPS_BUILD} == "yes" +# orchestration choices are already made +HOST_RUN_TESTS ?= * +.else +.if empty(RELDIR) +RELDIR:= ${.CURDIR:S,${SRCTOP}/,,:S,${OBJTOP}/,,} +.endif +.endif + +.if ${HOST_RUN_TESTS:Uno:@x@${RELDIR:M$x}@} != "" +all: run-tests +.endif + +KYUA?= kyua + +# we need to make sure kyua-report can find the results +KYUA_RESULTS?= ${.OBJDIR}/kyua.results +KYUA_ARGS?= --results-file=${KYUA_RESULTS} +KYUA_ENV?= HOME=${KYUA_HOME} TMPDIR=${.OBJDIR} +KYUA_FLAGS?= --config none --loglevel=${KYUA_LOGLEVEL:Uinfo} +KYUA_HOME?= ${OBJTOP} + +.if make(debug*) +KYUA_LOGLEVEL?= debug +.endif + +# some tests have files they need +.if ${${PACKAGE}FILES:U:NKyuafile} != "" +run-tests run-tests.log: link-test-files +link-test-files: ${${PACKAGE}FILES:NKyuafile} + @for f in ${.ALLSRC:N*Kyuafile:M*/*}; do \ + ln -sf $$f .; \ + done +.endif + +# we do not want to stage any of this +RUN_TESTS_LOG= run-tests.log +MK_STAGING= no +META_XTRAS+= ${RUN_TESTS_LOG} + +run-tests: ${RUN_TESTS_LOG} + +# This is the main event. +# Run kyua-test followed by kyua-report. +# If we have any test failues we want to run kyua-report --verbose +# Also on fail, we rename run-tests.log to run-tests.err so we save the +# output but the target will be out-of-date. +# We prepend ${.OBJDIR}:${.OBJDIR:H}: to PATH seen by kyua +# so tests for things like cat, cp, cmp etc can find the one we just built +# rather than the one from the host. +${RUN_TESTS_LOG}: ${_TESTS} Kyuafile + @( export PATH=${.OBJDIR}:${.OBJDIR:H}:${PATH}; \ + rm -f ${KYUA_RESULTS}; \ + ${KYUA_ENV} ${KYUA} ${KYUA_FLAGS} test ${KYUA_ARGS} -k ${.OBJDIR}/Kyuafile --build-root=${.OBJDIR} && \ + ${KYUA_ENV} ${KYUA} ${KYUA_FLAGS} report ${KYUA_ARGS} ) > ${.TARGET} || \ + { mv ${.TARGET} ${.TARGET:R}.err; \ + ${KYUA_ENV} ${KYUA} ${KYUA_FLAGS} report ${KYUA_ARGS} --verbose --results-filter broken,failed; echo See ${.TARGET:R:tA}.err; \ + exit 1; } + +# make kyua-debug KYUA_DEBUG_ARGS=app:test +kyua-debug: + @(export PATH=${.OBJDIR}:${.OBJDIR:H}:${PATH}; \ + ${KYUA_ENV} ${KYUA} ${KYUA_FLAGS} debug ${KYUA_DEBUG_ARGS}) || true + +.endif diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index f34a4542e534..2173ea0be446 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -250,3 +250,59 @@ BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}} KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}} .-include + +.if ${MK_RUN_TESTS} == "yes" +# some the tests below will not run correctly on the host +# as they require support files not present in .CURDIR +BROKEN_HOST_TESTS += \ + ${BROKEN_HOST_DEP_TESTS} \ + bin/cp/tests \ + lib/atf/libatf-c++/tests \ + lib/atf/libatf-c/tests \ + lib/libarchive/tests \ + lib/libnv/tests \ + libexec/rtld-elf/tests \ + sbin/devd/tests \ + usr.bin/comm/tests \ + usr.bin/du/tests \ + usr.bin/procstat/tests \ + usr.bin/sed/tests \ + usr.bin/tar/tests \ + usr.bin/tr/tests \ + usr.bin/xargs/tests \ + usr.bin/yacc/tests \ + usr.sbin/makefs/tests \ + usr.sbin/rpcbind/tests \ + +# these all have broken dependencies which we choose not to fix for host +BROKEN_HOST_DEP_TESTS += \ + lib/msun/tests \ + usr.bin/cut/tests \ + usr.bin/diff/tests \ + usr.bin/grep/tests \ + usr.bin/gzip/tests \ + usr.bin/printf/tests \ + +.endif + +TESTS_DIR_LIST += tests +# most of the tree only has Makefile.depend +# by default we only want to run host tests for Makefile.depend.host +TESTS_DEPENDFILE_PREFERENCE ?= Makefile.depend.host +EXCLUDE_TESTS_FILTER += . \ + lib/libcasper/services/cap_* \ + +.for t in ${TESTS_DIR_LIST:O:u} +.if !target(${DEP_RELDIR}/$t.test) +.if ${BROKEN_HOST_TESTS:U:M${DEP_RELDIR}/$t} == "" && \ + ${RUN_TESTS_FILTER:U*:@m@${DEP_RELDIR:M$m}@} != "" && \ + ${DEP_RELDIR:${EXCLUDE_TESTS_FILTER:Uno:${M_ListToSkip}}} != "" && \ + ${TESTS_DEPENDFILE_PREFERENCE:@m@${exists(${SRCTOP}/${DEP_RELDIR}/$t/$m):?$m:}@} != "" +# build but not via DIRDEPS to avoid circular dependencies +_build_xtra_dirs += ${SRCTOP}/${DEP_RELDIR}/$t.host +# mark it done +${DEP_RELDIR}/$t.test: +.endif +.endif +.endfor +.endif From nobody Wed Jun 4 20:59:06 2025 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 4bCKgt3Sgjz5xd3L; Wed, 04 Jun 2025 20:59: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 4bCKgt2lWWz3kXm; Wed, 04 Jun 2025 20:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749070746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CT7QQNVuTWOXXMpEPv1v7LAE3nk/tNkbkpVUglt9FWo=; b=kwyzU3GcRD7j1x4G+XU6wJg5HNCA+cUpX5aiUkNdCeyIcbgQFCgIJTOBPuZrj052L6GJ9s che9f8TBBBJNiqCecOCMKeaEErrUWit4q5nlkA4kKshPQk9qKd6cEi8AM9Gqk/1EfzleuM HhBE+ReKabklbgaMuc+uI2UNsxCKnUxiCaqHpNKVB/IhCQ1NHWeE/qsE2myplMMObN4fZT WV+XW0Ufza+6j4EHW5goRLjXif8L/iIqaz/yAVWS8kOTJ50hi6VmWJ0Etc534hqKLjgUIF UUl+vMkNNpmXfV8gcEcRDhmuEMV6ALu6JRHdVrP6UxdpU9dk+VGayqyHAewTUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749070746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CT7QQNVuTWOXXMpEPv1v7LAE3nk/tNkbkpVUglt9FWo=; b=AHuDMt4lheuf/ZMryz5kGoMfgbN3lVr+nk4JseQxQ2lIdQg5XTNMltugSX2gZD2g31KP8m fEIIlutYdSA2Dyc50Fl04MOurrS11+Yfz5JV4mtulh/nA6HHPLv4AspBXzEYtOdGBEDMkd KhHWlkAKbz5e0e08iD3lEK6gIbfLlbSq/EwO2ha5X0A/Yngf1HjATYzRSDyJmPFUzLtmqI bq8iisP3aLsSnk51jzmqZN7LRS50y0UnvISDpscbkTV+7hPjagtL76GnaNeN3GOk5EmReY CBOCisSsorJlXTPHF8iZgNkYGWU4dx6Ri4/iXUmn1lkN9V3Qn/Nj7yK1+IRTYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749070746; a=rsa-sha256; cv=none; b=An1N9FHSIGcF8Wx9G01ui7pKo00Hp5AycRUqgmkQitXT7vEzwW0UivPYx8Ot0z4xSfkpCr dy+of6rS+OinqqTKHlZ8pD899FFyxUYRrEa1wc0GXrEsIZFHZ8gTwKJZU35hWm5eOB541t zomv98XmThpMltLf4wiEp0LcjYmQbW57h18m3A+xjtZ0Gp2uAOqYMf4Sqj1Xv/nvpmMSpy SBQoAK6Yv75XpWNHGARxUZ81R23mrjl2czhQy74MJpkF+/IxolBBNdmDAi1/rskSLlNWTD 15+EsOOBjV9dSwqkQdOgC7qLZ2yhz3a3ppLqkDn4ys6tsFHtj2GIdrKobjWOoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCKgt28GHzgt0; Wed, 04 Jun 2025 20:59:06 +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 554Kx6Pd069438; Wed, 4 Jun 2025 20:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554Kx65I069435; Wed, 4 Jun 2025 20:59:06 GMT (envelope-from git) Date: Wed, 4 Jun 2025 20:59:06 GMT Message-Id: <202506042059.554Kx65I069435@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: fdaba0128c17 - main - dtrace tests: Fix nits in some test programs 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: fdaba0128c17ecb3d6e2a458bdc00a7b36a4da51 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fdaba0128c17ecb3d6e2a458bdc00a7b36a4da51 commit fdaba0128c17ecb3d6e2a458bdc00a7b36a4da51 Author: Mark Johnston AuthorDate: 2025-06-04 20:52:16 +0000 Commit: Mark Johnston CommitDate: 2025-06-04 20:58:38 +0000 dtrace tests: Fix nits in some test programs Otherwise these tests fail spuriously, depending on which compiler is installed as cc. MFC after: 2 weeks Sponsored by: Innovate UK --- .../opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh | 7 ++++--- .../cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh index 9620b97cb019..c8f0d1e5f8c0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh @@ -40,8 +40,8 @@ echo '#pragma D option aggsortkey' >> test.d cat > test.c < -void -main() +int +main(void) { EOF @@ -52,7 +52,7 @@ for oogle in doogle bagnoogle; do #include void -$oogle() +$oogle(void) { DTRACE_PROBE($oogle, knows); } @@ -79,6 +79,7 @@ EOF fi objs="$objs $oogle.o $oogle.d.o" + echo "extern void $oogle(void);" >> test.c echo $oogle'();' >> test.c echo $oogle'$target:::{@[probefunc] = count()}' >> test.d done diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh index 2e404f4b8df6..4dd54f3fb633 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh @@ -35,8 +35,8 @@ cd $DIR cat > test.c < -void -main() +int +main(void) { EOF @@ -74,6 +74,7 @@ EOF fi objs="$objs $oogle.o $oogle.d.o" + echo "extern void $oogle(void);" >> test.c echo $oogle'();' >> test.c done From nobody Wed Jun 4 20:59:07 2025 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 4bCKgw17jHz5xckd; Wed, 04 Jun 2025 20:59: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 4bCKgv3Wtyz3kh4; Wed, 04 Jun 2025 20:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749070747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAzJTbj4WJsb9jHzd9rF3kBfUC/+okNWQqoE4FihYgo=; b=Q8yM1gUyGj6f8Bx3Vm1O/3NfZ6MjfUO91hBlUaase619uIon/q1v/OoJuYuvLvT+61weQI tOeK9RHe/0/RFOEPRQlYUGBapIaOvxmChDsxRSWDWoCF1VpRMXYPwTl1JKG4XiYCEocT3G 823cRrxeCI6Ha6A790fWusCTKtlbZKZY+wdEydjiJkLciRocfSgccYrZhmHFcI5+XUBVKw SPmIwTIz3oEGZZbRx0jFHUkTnRnoXouvv9PgOJCMd2hZVani7UHjHDUI3EPRoQKYq/xkkJ PXbhxGCZqcp4mnuzm70EbZQyM2GxJWEu70wq3532h5zrjC1LhmqB2C/UtarNjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749070747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAzJTbj4WJsb9jHzd9rF3kBfUC/+okNWQqoE4FihYgo=; b=vlp6j4wQaEUTd1f5doRuRgfgZARYoWphfVM4vaKWvN5Ojti4skcBM7q/4UT9CMLPj7L1bR sWvmGfYf23PRy3Q0qZmEMr95M7v7kJ2Pdgg2A0WtHH/qHaiSThb0EftPYLP3lBuyndJsxQ c0iCTKKFp5gob6Yrb+E0JhE0oOLIaWBngzTKuySKlGNV3GrYXemmVJZh4xsYkpiDoSmzfv W9eK6sexTOoK9WkL5j2od56KFsocRFlpxqFLVh1glBpImvDRe10XqzlJ6iGjygBVujV9ey 3NWDjFwdN1AaDZJbhL8oTRWoJ9tKJmw8PdVlQJFThWK7MSExWVBHQUkkCX2tkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749070747; a=rsa-sha256; cv=none; b=n4Ul/PWnMULOoVYuv2XDnuc7VgqO279Z9jKmg5dMrCe5K5SKVY/D582TijeqGgMOiTq/m1 /m0R8hbiUh9zunWy7KqVUtRF/D2j/AuQA1CVA6h9wX2tO05IH0dCf5SOOnVhIHE4Mbo8ba 6TgmfHM0XQIDfgKkLkxZ+SiGpjbeQYQwZC2XCnhkeNnwU3sAesDgPUsLdfXMVlpbOw+vyj tRUamxFDus+8S/mQ8mYErLTgrz2XSp6t0ItjCWJUCCf+GJezVGAraroMN5437jyQJQSPwm WckP82QLEc/rJbFwfNHU7IDhVtzvpmDqm65GVZOKpnNgk5VekoazXGqSHAiORg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCKgv33vTzgyZ; Wed, 04 Jun 2025 20:59: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 554Kx74j069471; Wed, 4 Jun 2025 20:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554Kx7Kk069468; Wed, 4 Jun 2025 20:59:07 GMT (envelope-from git) Date: Wed, 4 Jun 2025 20:59:07 GMT Message-Id: <202506042059.554Kx7Kk069468@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: 1776ba8de549 - main - share/mk: Define a rule for dtrace -G to generate .pieo files 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: 1776ba8de54957316a5afe43076904506e43310c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1776ba8de54957316a5afe43076904506e43310c commit 1776ba8de54957316a5afe43076904506e43310c Author: Mark Johnston AuthorDate: 2025-06-04 20:52:37 +0000 Commit: Mark Johnston CommitDate: 2025-06-04 20:58:38 +0000 share/mk: Define a rule for dtrace -G to generate .pieo files Now that bsd.prog.mk uses .pieo instead of .o for object files linked into PIEs, we need to ensure that the object file generated by dtrace -G has the same extension. Fixes: 245bb0110639 ("Use .pieo extension for WITH_PIE bsd.prog.mk output") Sponsored by: Innovate UK --- share/mk/bsd.dep.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 4f182eff78b8..bcf92e90c5db 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -168,14 +168,14 @@ CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} +${_D}.pieo: ${_DSRC} ${OBJS:S/^${_D}.pieo$//} + @rm -f ${.TARGET} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) CLEANFILES+= ${_D}.pico ${_D}.pieo ${_D}.po ${_D}.nossppico ${_D}.pico: ${_DSRC} ${SOBJS:S/^${_D}.pico$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} -${_D}.pieo: ${_DSRC} ${OBJS:S/^${_D}.pieo$//} - @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} From nobody Wed Jun 4 21:26:03 2025 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 4bCLH003KTz5xfMh; Wed, 04 Jun 2025 21:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCLGz4xyXz4DW3; Wed, 04 Jun 2025 21:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749072363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n849SiRQvy2CKyWVuYXDSmJse++Cp3liwJXVeIlQ8iM=; b=FRgjZv80Xw3oVEEGyJY7/jrYtTw/IvQfyv0RMIpWjAl5oXqnHZYz6uU3Oe2eNGst2tji0b W74QKJzemRFkWil+Zpfp1UW6VuVUjYpVwadCrLNBdNxwvBF9sdUsi9+yJuASj8EvHiICd5 ynl1WfGmSI29+jQaWC/dqu5lrjHldf02CpM3SNFy3Hu4euHHPWbb57dkjvaMJExcwvgMmc XdlV+cdvMMhu3pB+Xn8/+WyYdr/E3AiHGB0mx+nipOE2ZWfA4/i1vNehGVqGzqVN8LScf1 azgRBW1JZrWUCjAgFnrUnMBaI/kO5UlC0caX0Zbb8VtCNyGi41/XyCcWl19wDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749072363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n849SiRQvy2CKyWVuYXDSmJse++Cp3liwJXVeIlQ8iM=; b=Z/f9MMugb4c6DTeK24ebBxza7cs68UhcEtcGHiPG8Va64gRYCaxdbggFYbxUf7cqTRdSNh 1aFPPuZmC8nQ70JQA07rPxaFFQ7+Cj64ynoZ7cKZmzg8fd+iZZfCPvMSejQxJ0LKBl4L6G GxxXH7lU+/8JBcvOoauoKMBK4ieD5FF2NbnN2gOR55CxLWoGj/vaeA2xB9IoHj5h7lzIJz S3CtLjqM51scAEIaCF0fuSjr47QHk5c+9mQrVi5S0KRJygkKAkNm1wujPwqhE4TNf1AUX3 3Un77Ddh72OSLqpsdv/HHwfyI9aQjHq2eum3aSB0IYUEuWnhCMVPxrHlIDAWsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749072363; a=rsa-sha256; cv=none; b=Kscyk1IBPoz0DYNj76y3GE+mW+XwIfn02bSPZS2H2ya6KND36JmB3nGW+/M+5/SQqnY/AE Lsuz7/zILV4UsafTB6A6PTF+RrfDPEPUCVVpBJhWtbUTSHiNxiyV0vrCfav8MBGUXCCQlK iLAMF3jWlRJZDZYmBLNXejP6fTfcVTKg9aw48xCW7L/9Wi9pyU1rklm5C6Dtyq2CWT+cen Cq4VlhX/z/M3WtGPw8lv70v2FknyOjQD4x5p3Kd73lCxXeRLbfCADsxbz3Wd8FI2h54D/r 7a+d6YysgvztzKH9iiNpWpvQ6yeA+0KWeVODckbqSkH4UkxXUpYefjvf0GqgAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCLGz4TtqzhDY; Wed, 04 Jun 2025 21:26:03 +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 554LQ35J025406; Wed, 4 Jun 2025 21:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554LQ31s025403; Wed, 4 Jun 2025 21:26:03 GMT (envelope-from git) Date: Wed, 4 Jun 2025 21:26:03 GMT Message-Id: <202506042126.554LQ31s025403@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: 98ef590f7739 - main - dtrace/profile: Stop storing the probe name in struct profile_probe 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: 98ef590f77392159938d2e6f9fd45bf31d10b9c1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=98ef590f77392159938d2e6f9fd45bf31d10b9c1 commit 98ef590f77392159938d2e6f9fd45bf31d10b9c1 Author: Mark Johnston AuthorDate: 2025-06-04 21:13:08 +0000 Commit: Mark Johnston CommitDate: 2025-06-04 21:13:08 +0000 dtrace/profile: Stop storing the probe name in struct profile_probe It's unused, and the naked strcpy() was susceptible to buffer overflow if one creates, say, a probe called "profile-2000000000ns". Reported by: CHERI MFC after: 1 week Sponsored by: Innovate UK --- sys/cddl/dev/profile/profile.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 677c7543795f..3e106aab1c85 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -118,7 +118,6 @@ struct profile_probe_percpu; #endif typedef struct profile_probe { - char prof_name[PROF_NAMELEN]; dtrace_id_t prof_id; int prof_kind; #ifdef illumos @@ -302,7 +301,6 @@ profile_create(hrtime_t interval, char *name, int kind) } prof = kmem_zalloc(sizeof (profile_probe_t), KM_SLEEP); - (void) strcpy(prof->prof_name, name); #ifdef illumos prof->prof_interval = interval; prof->prof_cyclic = CYCLIC_NONE; From nobody Wed Jun 4 22:53:13 2025 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 4bCNCZ13hQz5xm4p; Wed, 04 Jun 2025 22:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCNCZ0NGDz3dYq; Wed, 04 Jun 2025 22:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqYZ4HJuURfz/SplLjuRHKlExkWALYW1Hozgm9WrHBo=; b=OpSaKqHUudAqKk0cC+jIZEjyXRrVoq1sLxsypjO6LCxtHcbeO8+rStW016Xi7D2Z8l/0tY VqEEc0Baoa4uUFO/nwY+xt4KXih9hk0YZzSsoU3xFsAL/XEtfpcpQsRxi2J1cLEEZcl54k bRwP+uRZkjhpGsT3XXosgyULxrRhwOLawk8Uo6ul/J9XFCHoigeLT38caqyVDhoi8WB7jP CPFNYsDi9afX2vQwIrXXEYAEbk+WJVC3wfdiyLbMp2M9Jz1Tf4QWMRmzbw7qDpgNddMgMy RDGzM9q61HN6OeY/OQHTdjKWq0/QlJYb8eMQUYvil4GOE2C/D9R9DB8qZPCAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqYZ4HJuURfz/SplLjuRHKlExkWALYW1Hozgm9WrHBo=; b=e1xQM9yOqdHW6iJ6y2I6jh72RCkLo0ZKP+NXMVs+liqM8IQUAo1FivqQ7gDEEhKJ9ovXfM 9kLttUDOYNe40gy/plEqJJ6nLFzgebBKNwonTPi8OF2Q91NSXkIyWYTGoROiDKsyetprl9 SnMXuzUPRHguY/AqbYCR5Zk7uDYTLqD32i0v7OnEQ6ZuHBcjCsmjLgqA55f1t2M7gOxuFF KU++MuwBkvhCGHJK8MY9ZOpygrhI8ixrbwlJ6qeXyW2SM34i9JWJoGahBUXO3EfFSGQa7Z daQsRrC99nrOi9I5lJi6PY0CEsYQKDMfP5M0BsiRanNv81wg8DxqhRiESvf1YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749077594; a=rsa-sha256; cv=none; b=qA7dsh1u5T8ztqjoXAJwC2ofdSlgSWmFUZfEpudh6TPdI0YMvvb5QAi7pW7Ni8Q6Cb7ZEa wLvkEwpEoG4nWXlzOTvB1Ybd/6Iz/oKfc5YxlPEUoMOcpF0d/0emDu4mzmpNNtZD60TgWQ KFNeMKPbkUuOm18QuNcZz47gxy6nGpbIIZ0UJbUK3Yf1gEOjNlStMUH0cPqfvPkJNTYz7M lwxK1OI0Sm/HbVDFhAopN+txAAz3KpOwPNt6R0YSEjCYi/pouqqzWTebKvrf+WEjauWzIW TEz/H+5ZPCt/SmwMFLYvJ0lLUNw57Sr0enw1AOoCVBwRpScQJzSo1IPaQzUrIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCNCY6yr3zkXw; Wed, 04 Jun 2025 22:53:13 +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 554MrDKo093576; Wed, 4 Jun 2025 22:53:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554MrDgZ093573; Wed, 4 Jun 2025 22:53:13 GMT (envelope-from git) Date: Wed, 4 Jun 2025 22:53:13 GMT Message-Id: <202506042253.554MrDgZ093573@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: 6b6542ec8446 - main - open.2: Document the O_NAMEDATTR flag 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: 6b6542ec84462c9d1fceb43bffb832e0fd556661 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6b6542ec84462c9d1fceb43bffb832e0fd556661 commit 6b6542ec84462c9d1fceb43bffb832e0fd556661 Author: Rick Macklem AuthorDate: 2025-06-04 22:50:16 +0000 Commit: Rick Macklem CommitDate: 2025-06-04 22:50:16 +0000 open.2: Document the O_NAMEDATTR flag Commit 2ec2ba7e232d added support for the O_NAMEDATTR flag to the open(2) and openat(2) syscalls for main. This patch updates the man page for this flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Reviewed by: emaste (earlier version), kib (earlier version) Differential Revision: https://reviews.freebsd.org/D49691 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes") --- lib/libsys/open.2 | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 6200723ed85c..84c4f02fce8a 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 28, 2025 +.Dd April 3, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -210,6 +210,8 @@ record only the target path in the opened descriptor open file referenced by .Fa fd if path is empty +.It Dv O_NAMEDATTR +open a named attribute or named attribute directory .El .Pp Exactly one of the flags @@ -506,6 +508,42 @@ and the description of the .Dv O_CLOEXEC flag. .Pp +When the +.Dv O_NAMEDATTR +flag is specified for an +.Fn openat +where the +.Fa fd +argument is for a file object, +a named attribute for the file object +is opened and not the file object itself. +If the +.Dv O_CREAT +flag has been specified as well, the named attribute will be +created if it does not exist. +When the +.Dv O_NAMEDATTR +flag is specified for a +.Fn open , +a named attribute for the current working directory is opened and +not the current working directory. +The +.Fa path +argument for this +.Fn openat +or +.Fn open +must be a single component name with no embedded +.Ql / . +If the +.Fa path +argument is +.Ql .\& +then the named attribute directory for the file object is opened. +(See +.Xr named_attribute 7 +for more information.) +.Pp The system imposes a limit on the number of file descriptors open simultaneously by one process. The @@ -737,6 +775,10 @@ contains a ".." component, the .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 is set, and the process is in capability mode. +.It Bq Er ENOATTR +.Dv O_NAMEDATTR +has been specified and the file object is not a named attribute +directory or named attribute. .El .Sh SEE ALSO .Xr chmod 2 , @@ -752,7 +794,8 @@ is set, and the process is in capability mode. .Xr umask 2 , .Xr write 2 , .Xr fopen 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr named_attribute 7 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -801,6 +844,8 @@ function was introduced in .Fx 8.0 . .Dv O_DSYNC appeared in 13.0. +.Dv O_NAMEDATTR +appeared in 15.0. .Sh BUGS The .Fa mode From nobody Wed Jun 4 22:55:59 2025 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 4bCNGp3kgWz5xlvn; Wed, 04 Jun 2025 22:56:02 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCNGp2qGZz3gcn; Wed, 04 Jun 2025 22:56:02 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077762; 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=wSx8LC7eFzfWhwKYsUJW1BVMugGioFbrVZs0f+VKNUg=; b=ueItsHxDcLba9K39s1thlytBCpW089+L5siTB0MEJLKBVlXKOlWiZdZlYQpxOvza94AMBg NkUaQWLD8wGMuOiSPHPhULQAhGeCuYx5SCC7jdBqVqx5QnsCQTXCoX1oLMaSO2BZTDiGY2 c3OnZrmxrrmh5wTyOfE3AnSI7W+LRfiO05a5idB0CqGsJL8vLo3ccCeBHkrG2YAYJtYbOX f/L8pnHjNCwNlwiRNBzwzqi27ba4D9aP2JU8tXe2UcibMwvLTPMYQcYrSdGNm49GqkGNnM i90jCrnIUexsAUjQ00SqB4hdMqBzbjs/nTXzVxzX3jAOkElMsnn6S9IAkw4v7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077762; 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=wSx8LC7eFzfWhwKYsUJW1BVMugGioFbrVZs0f+VKNUg=; b=DNA+4gYPTTTC1U87sVUY4FaQ94kD9B9bnp8oBj1USBoWunsb84ibZ8+j0DyebIqguA6RCY kSYo26msNKYHnTnCj+hq4BOnyoiZp2Lo5ehLZxslXgEL2iOp0mZhBX1859SBkGLsoimizN +qEaFqcLdx1EPDVnpwhrqoNxwrkHzr/Kee3x1nT2/IBfdwAfSkkc/mh9+h6CN7wDS84sfp yV6ojQ7r0/o6nSk0xrYhZrqooeugf12dFj5DNtEz/OjgETxQajjckOw6HhDApI6rtOnIVQ n6o1WPpsjVqRkrKSVa1JjmHOr2iYKbtKDn41Y3HnEX0qMulnAwQZTFovGZF6TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749077762; a=rsa-sha256; cv=none; b=VzAfGUdBGpqxwOYMaN5tP02Iis5+APhTJJdiwd6GbXQ9lKgVQx2qVU9J3urXiWe119qDgQ aLUIAhkFxd9vlBk6lV8iZo3gA9NPNUucafTAcdXqrkZmguDuVXduX+p7kwOBvFeAPNCZMa 1+XTLxxP3HBMpA+po3Swya6KTE9gGnz+Uxim96FzHduE1lBX1G78VnE1iNRwiPxANCbvP7 NyOGT7F2AM+MHJdTH4DWgXOv4Xl1deCFodQWNmVInMIF6a8UDibbKTFPDFXwpr0BITt0/N QuKkxeFyIY+PkhFMmtWPdI9FzTq3baAkXIfk775oK0xwSKaA126AvR2IP9e6qg== 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 4bCNGn39vHzmVc; Wed, 04 Jun 2025 22:56:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 4 Jun 2025 15:55:59 -0700 From: Gleb Smirnoff To: Kyle Evans , markj@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument Message-ID: References: <202506040151.5541pESm016476@gitrepo.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: <202506040151.5541pESm016476@gitrepo.freebsd.org> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: K> The branch main has been updated by kevans: K> K> URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf K> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf K> Author: Kyle Evans K> AuthorDate: 2025-06-04 01:51:06 +0000 K> Commit: Kyle Evans K> CommitDate: 2025-06-04 01:51:06 +0000 K> K> kdump: nicer printing of kill(2) PID argument K> K> Similar to wait*(), kill(2) operates on a pid that currently gets output K> as hex. Output it in decimal to make it a little easier to eyeball the K> pid we're signalling. K> K> Reviewed by: markj K> Differential Revision: https://reviews.freebsd.org/D50508 I didn't review if PIDs are always printed as decimals or not, but for the file descriptors it is a mix of hex and decimals. :( Usually I go with a sed script over kdump output to make it consistent. I think if we try to bring that to common format, that would leave some people unsatisfied regardless of our choice - all decimal or all hex. So, I would suggest to add a command line options that would force into all hex or all decimal. -- Gleb Smirnoff From nobody Wed Jun 4 23:03:44 2025 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 4bCNRk3Qt6z5xmw3; Wed, 04 Jun 2025 23:03:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCNRk2d6jz3nsy; Wed, 04 Jun 2025 23:03:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749078226; 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=BZw5uzs5SrXDbn0wLyNaxbUnRETqKK7D3R5siDiRlCw=; b=X1HGpaMPqNUJF5kitMg707H8ZYpS0Bq6cBHOsbsXbgmi5KdJzT0vpLsr+n6OtMrq8nYFVe UMgLxj498ILnIzU9z4xaaUYBqiuiOtT2y3mJVDMJEGyM5Z5q/xjwLnfRxgBvb3E/PErpe6 rRNYKfF7sVUHqPgh6iuvVRteWC1h1ZW7Xk+dXqBYhSgzBBFhmVRm3TIe5L+1aF1d6cLAO9 a98c+xJqqsLvSNXcLavpisT98nKiZOnRIkF1qq3Sw5d1QiYSewr2gxUr5QJ226NWNSAbjY 6hzIrflUOzFrGu0HPi0I/bVDG1jX98/3UevqkhXqpKeQjQt/hAhHBs9RTRVTsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749078226; 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=BZw5uzs5SrXDbn0wLyNaxbUnRETqKK7D3R5siDiRlCw=; b=tdoDO8lMJGyl90EQ2wvBwOTlaghhlDBGCOeM0mowNVd32kHRqUe1ipm5sAbv169YaiGY2Z J2orsN8J7EJLDmeCzZp7812TBRRx7IEharth8KaClFipLsbEoSCE7SS9gaz/9xJ/EB5hzH HkXwZAalq6IBqNdXMX+ABpMQgzBkGw2yCFh4WmZ0ijKs+SZGwStxDPU2zi/FqrJWMh0uJc AIPyEJUrZzAw8NRDmZ9ypjfIN6TpQ7Yad+S/Akk88/a+/KjSRdEwO92Fprn8UjJNeXUkMg 3/PWF0dSTp817i7QoSzdcqwkEbjcA3FwqVkOt98aM3wiPtvsl8kBTeLOtfn3pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749078226; a=rsa-sha256; cv=none; b=GTO1THXZIp1m2Fyob7e/ExqeQP9lVrfXa83bjGPKd3DzceJ8aAoidlhIyeBu9bUIdxv5mB Q2yVxva3zKeqABPNLMMV4EBwuDUN1kxVzWdfi0/FecziTLKB9G0DFih73CNRlTiEUZXiW9 CDaeUnBTuwjf31BWxtjrS8K/GghLtan0LLoKtdm8Ib+aIW63tCH1KMlp3v5ujtuuLHgvaG ev6YCLRNj4YtrzKo1KIa9I7/YMgN1N8Bo2TDop/3+ZuLMO/n6oPgb37pwyAzfpvyiKIyLm dHxdgsJsYMtC8HV89bFZASi6PYQVgHlUHEt/3C58OvCQuVNuzPm3it69NokKqw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bCNRj66llzmgh; Wed, 04 Jun 2025 23:03:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> Date: Wed, 4 Jun 2025 18:03:44 -0500 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: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument To: Gleb Smirnoff , markj@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506040151.5541pESm016476@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/4/25 17:55, Gleb Smirnoff wrote: > On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: > K> The branch main has been updated by kevans: > K> > K> URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf > K> > K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf > K> Author: Kyle Evans > K> AuthorDate: 2025-06-04 01:51:06 +0000 > K> Commit: Kyle Evans > K> CommitDate: 2025-06-04 01:51:06 +0000 > K> > K> kdump: nicer printing of kill(2) PID argument > K> > K> Similar to wait*(), kill(2) operates on a pid that currently gets output > K> as hex. Output it in decimal to make it a little easier to eyeball the > K> pid we're signalling. > K> > K> Reviewed by: markj > K> Differential Revision: https://reviews.freebsd.org/D50508 > > I didn't review if PIDs are always printed as decimals or not, but for > the file descriptors it is a mix of hex and decimals. :( Usually I go > with a sed script over kdump output to make it consistent. > To be fair, I'd like to fix that, too- I noticed close() the other day for fd > 0, but paused when I: 1.) couldn't tell where we even output close args 2.) noticed that close_range has the same problem, but hex can make sense for its upper range (particularly when you're doing ~0U to simulate closefrom(2)) and that's a bit of a predicament because that's a harder pattern to spot in decimal. > I think if we try to bring that to common format, that would leave > some people unsatisfied regardless of our choice - all decimal or > all hex. > > So, I would suggest to add a command line options that would force > into all hex or all decimal. > I'd like to hear from some folks that prefer hex here... other system tools are generally not printing IDs in hex, so it makes it harder to correlate. Ideally, I think we'd audit it all and make sure we match truss(1) here (which tends to just print decimal for all of the ID arguments, as far as I've found). From nobody Wed Jun 4 23:11:46 2025 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 4bCNcz3RDDz5xnWV; Wed, 04 Jun 2025 23:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCNcz1GcZz3xjk; Wed, 04 Jun 2025 23:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749078707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pE6MTL1S3HlSoUJhM16PGBbZm+FJOdKt/7Brbdsdpcs=; b=g0iwxqt8bnzO9AoHC6AsEtTekWgrOKazepNVtaZUYuBb5Zrmeu+YcOPjHZh9AaM32FBVTC FVIXRknfa+fmGbeGlMgvK4/FDePyVPnWV4SdIZ5cv3/X01MI3MT6Y3cGYFnAqbI6p5qDrS 94oxdwWcdQvlYu73bxjR8QxyJbq/Q38FISSPM4Owqt0wPElWjWa8O5k3SVwDJTGxKz1CQx WLdTUr5hCcUTqQLo7jnCZwBt5pCJbW8BfLheaT80VJ1lhhN5ujLHswi2hqKX+0DMqtBfsY XtiJLNDcW5hBUUhwJmHr/4u0f4O8aV5Gma5hjC0XsEbD8RfBE/XIu4umHp6k/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749078707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pE6MTL1S3HlSoUJhM16PGBbZm+FJOdKt/7Brbdsdpcs=; b=yEfbJUipdHHbg0V6BVpMSFiaaY3Nh3jEFfMuQ0Fp72+pbf5aULGOSmRonr6ewoa1EtcF8C eIeoJKKKsjfwPcTpM8mLD7Y4ZRmCPKvBrCLSa4Jg6Y5FXJLq/Tn0bduT6DlwlxyuaidUPl YIaMEQn3qO0OumMirh2ajQMj0zuIa9BXbv5GPcp1USGpClcmlPf1yr1pnaQfaZPpVozSDz Y+Ld3NmCFoFEl/gOMDyjCNC0A4xsMgvaPI/5/GQLqk4mXVbJ5y5+RvjXk2PTMWXjRgBwa5 ja0MlvAt1qkfk89KdFv5WfxeINU/yMyv9W0538xV4S/bFpWjY7MEQWouZ0KILQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749078707; a=rsa-sha256; cv=none; b=Vzz7JzBBAu+lrhf8+o+nqOB7VXqZcqHUWuTzdDPDOZtzVakAGgVuPLMLgU3DeImbPEbMns LV57LSwyI+Qf4UgejYlAxNS11OiHNUFRiIrplSrPRVU84qbJyOWgS4qsFJdzrMro/jXUTp 1UdCsJTEXrzVaAKaW4Z/4nCV4KGgXGle9tknWnzZb5EcpbSkVz+ud8oPbGLC1MnorUZ1xC vr+te/u4iTOua3wG59VQHaEeiOEiipVNvRtrBalme1HmDhDKV8AsNyElHJ2Yv5S+HVPR5I PihTXl0b2Xe0gqu+aBCULJ9mZXv9zQIgdZgmyynZChvJBrcfjdRJ9qJFuXrxSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCNcz0HwkzkJy; Wed, 04 Jun 2025 23:11:47 +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 554NBkFL030289; Wed, 4 Jun 2025 23:11:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554NBkRe030286; Wed, 4 Jun 2025 23:11:46 GMT (envelope-from git) Date: Wed, 4 Jun 2025 23:11:46 GMT Message-Id: <202506042311.554NBkRe030286@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: 1749465947a8 - main - nfsd: Fix accumulating nfslockfile structures 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: 1749465947a807caa53ce09b90a30b820eaab62e Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=1749465947a807caa53ce09b90a30b820eaab62e commit 1749465947a807caa53ce09b90a30b820eaab62e Author: Rick Macklem AuthorDate: 2025-06-04 23:09:01 +0000 Commit: Rick Macklem CommitDate: 2025-06-04 23:09:01 +0000 nfsd: Fix accumulating nfslockfile structures If a NFSv4 client does an exclusive open where the file already exists, the server returns EEXIST. However, without this patch, a partially filled in nfslockfile structure is allocated, but is not referenced by any open and, as such, never gets freed. This patch fixes the bug by checking for EEXIST before calling nfsvno_open(). Reported by: Christoper Iler Tested by: Christoper Iler MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index b26fc59bcd6d..3f43e9115e28 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2857,7 +2857,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, int how = NFSCREATE_UNCHECKED; int32_t cverf[2], tverf[2] = { 0, 0 }; vnode_t vp = NULL, dirp = NULL; - struct nfsvattr nva, dirfor, diraft; + struct nfsvattr nva, dirfor, diraft, nva2; struct nameidata named; nfsv4stateid_t stateid, delegstateid; nfsattrbit_t attrbits; @@ -3107,11 +3107,23 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, } break; case NFSCREATE_EXCLUSIVE: - exclusive_flag = 1; if (nd->nd_repstat == 0 && named.ni_vp == NULL) nva.na_mode = 0; - break; + /* FALLTHROUGH */ case NFSCREATE_EXCLUSIVE41: + if (nd->nd_repstat == 0 && named.ni_vp != NULL) { + nd->nd_repstat = nfsvno_getattr(named.ni_vp, + &nva2, nd, p, 1, NULL); + if (nd->nd_repstat == 0) { + tverf[0] = nva2.na_atime.tv_sec; + tverf[1] = nva2.na_atime.tv_nsec; + if (cverf[0] != tverf[0] || + cverf[1] != tverf[1])) + nd->nd_repstat = EEXIST; + } + if (nd->nd_repstat != 0) + done_namei = true; + } exclusive_flag = 1; break; } @@ -3201,16 +3213,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, NFSACCCHK_VPISLOCKED, NULL); } - if (!nd->nd_repstat) { + if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); - if (!nd->nd_repstat) { - tverf[0] = nva.na_atime.tv_sec; - tverf[1] = nva.na_atime.tv_nsec; - } - } - if (!nd->nd_repstat && exclusive_flag && (cverf[0] != tverf[0] || - cverf[1] != tverf[1])) - nd->nd_repstat = EEXIST; /* * Do the open locking/delegation stuff. */ From nobody Thu Jun 5 02:00:30 2025 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 4bCSMg24Jqz5y0ry; Thu, 05 Jun 2025 02:00: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 4bCSMg1CGdz3X9c; Thu, 05 Jun 2025 02:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749088831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w2zyMt1QVI3iAbv00yNbzRFsS8VI5VSDudDMPbL8pms=; b=LBEgfK+6h9qTLqzoe+0mrfVKteofKe7SoMjIl1yVH8g7HwNx5NLTrS4KfXegM5ZnKXIa1r CL7KLAl855VuvBGD1r2n7agguNT2YmyyGB3ZIShwjCVhXMSPbnnJFkLhtparfYIo1gPZ83 xQ3zbiBPy1JYVJK8emraCviO1lNCNC2qeyt+d/27RI6uE3srENWuj+cqYKsnM85YOdJWD+ xX5XZzz0Y4QPaQ2tBzoV0OKTwklA4SLC4lHKdErCHwxOkk2TF91L9NkuMfzkutCY/js26C 5rAC+I/30B3DHTk43A6B6rP8Liw1JPxmJ7G8Xg5A043JTgxXdjHbsDKwI0cxUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749088831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w2zyMt1QVI3iAbv00yNbzRFsS8VI5VSDudDMPbL8pms=; b=hsqLQ+qjSso8+UyKyFv/2uaXlPpTOajnLt38njuln+Lh9hrRIBwv1K0naVirpdN1EmaTVi fNtTYWfnjsH95S2t/sv+4c2x8Up9E6CTHkT94Gj3d9suOWEUjlTeptZrJvSQPHvZW3wRGu SWmDXSzB0ExSLQjSoOuzfg+X5XJA2ckFRnoa0EQp81FHzaSDgvdp/FLK2/IkKYiEcxsnqf ifu52B2a26uBvUgTdl7mZuE0Z1nZMKL/C9tGrOJPmry9/hf61sVOzK0m9gdTl+Hxpcv42j nBFXQ4+5uR/J9a4BD9VTelYRmSVhb52fyPnWM+ebName04LCMhL6KFzERpwgQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749088831; a=rsa-sha256; cv=none; b=FKqw12RXlviOlEHuuXfAe/urVIy/dggNFlRgXgNUlAbf/qdsGr/z/bcAa/3fcWkWf8wygH HbdawTQG6OnymsGOFkzLW4RqBrM62QQKiDwSzrQKHAf2wZ18YRhSND/WjepSzvLHKysuWX XMDlq9kgvTn635HcTRmaqFBIi/wTvlZ1Bi/AWmubFultpBULKXwvshlberpoul2mHGZtp9 pn3zUiXeLraBDYypWGFKgtyMJ6ji//ZAZAl/YfVgyLA7mvPAJFAAI0SnEosYiDSvZWgajq GckbPShz2EjAUyxJ6PVRNp/LUUNrv3xfPdS4bYyH2nHUZvJ3OJcKjhU7HZLlVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCSMg0czpzqCg; Thu, 05 Jun 2025 02:00: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 55520UBd042385; Thu, 5 Jun 2025 02:00:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55520U2v042382; Thu, 5 Jun 2025 02:00:30 GMT (envelope-from git) Date: Thu, 5 Jun 2025 02:00:30 GMT Message-Id: <202506050200.55520U2v042382@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: 4be12de1d630 - main - nfsd: Fix the build for 1749465947a8 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: 4be12de1d630383ab5e0c0f3ff48aa9f2f192ab6 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4be12de1d630383ab5e0c0f3ff48aa9f2f192ab6 commit 4be12de1d630383ab5e0c0f3ff48aa9f2f192ab6 Author: Rick Macklem AuthorDate: 2025-06-05 01:57:07 +0000 Commit: Rick Macklem CommitDate: 2025-06-05 01:57:07 +0000 nfsd: Fix the build for 1749465947a8 MFC after: 2 weeks Fixes: 1749465947a8 ("nfsd: Fix accumulating nfslockfile structures") --- sys/fs/nfsserver/nfs_nfsdserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 3f43e9115e28..88f812548445 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3118,7 +3118,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, tverf[0] = nva2.na_atime.tv_sec; tverf[1] = nva2.na_atime.tv_nsec; if (cverf[0] != tverf[0] || - cverf[1] != tverf[1])) + cverf[1] != tverf[1]) nd->nd_repstat = EEXIST; } if (nd->nd_repstat != 0) From nobody Thu Jun 5 02:53:52 2025 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 4bCTYD5dwnz5y3sl; Thu, 05 Jun 2025 02:53: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 4bCTYD2B6bz3P0R; Thu, 05 Jun 2025 02:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3bK93UfZINRQABIMjYdNXXuUm6ny6WtF46QUmtVosU=; b=A25btj8+GYfZ5AWrPoQlzOFKm6ER2IMukjWlu8Ok8wDjgRYDF9bKJq35CxbEW0istg9MO2 4XedWas/pGHZEpkEImIfvCUj46Cobm6v50ZJXVcB2qPHRMbXbbvaa0id19dFZMGTyrVMMQ 5r3HMJ39yGGm6Z7KvM10I0vTxgR2CR7L5cmppHHeiQkaxMFLr1I4rlMmUWQb0aErFlgEti YpBvvbN/r4JVle72GmeJFAVUib951tih0kbiBivcZYNKS1iGm3TywU+ewt/iZr9Ufojt3t 1TXrMwpE1XB+azLu8lpCZOBGPwz36phmIz2w6/pXKb77TTmBN1OysjLrOsiZPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3bK93UfZINRQABIMjYdNXXuUm6ny6WtF46QUmtVosU=; b=VFSPZRiyXZa5d7Cr9K82VOMlqfQbACX+hXz31ydUbENxixF7iJOHDoJUfY0HkqjIfjmFqE Mt9zfidZfLzfpYhUq7qSmyjvfgm2y5wN9yBpVrOWlYU0fylo5taPtW+f8e4fl8e2scqVd1 o+rUaXKe7zV+yD0t9zWQ9Q2Z5VtcUmIcgPeS8IG03Pb8vKTSANFFjYxsSzbOeVeZ+b7A/3 UN/BhieAY/eK0+eAW6H1AjbN9RtYHUos5Ry0j0CTOMafRjZgQN9wwXH3PZ1wDmSnMHJvGb RKlZEJ0FNvn5vahuIDaQz1aBCLzCaSzKKO6OhWVu4NqYwfQgVCCMvZlOYhrMLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749092032; a=rsa-sha256; cv=none; b=RW4kLficmN8P39Sl93QjeGtlQ1asLH17FXHpzsldajkJQ3ag1kPcLiOCAgJX5u8etKZ9Sp fMTLfIrYP1DTCvbVoorKDvQ03WQRZP9oxHbAJlZyIVDelGFa3SE4Cd6bBQ10xVG/3+/Hi5 iDxv6DSKyhcvJRjkxwi9u50UXZw4rePWqSd85kztfz2h93weDvDjq25T48EHOVxKVLPXgx Omiekzi+EdqFuz0SrRlv5KF8fntgWIQOuEO/MmV9HQqycqByitGZfk3C+Vss1DGqC/IH7q VBaobTqm36NuekM+8vP2RluraspU9Q8DhTEXEmFNVZdwbevMR5njcKCIjB7gdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCTYD1Vsszs3y; Thu, 05 Jun 2025 02:53: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 5552rqsE043445; Thu, 5 Jun 2025 02:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5552rqB7043442; Thu, 5 Jun 2025 02:53:52 GMT (envelope-from git) Date: Thu, 5 Jun 2025 02:53:52 GMT Message-Id: <202506050253.5552rqB7043442@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: 290e8aaa3840 - main - share/mk: Add MIT KRB5 build knob 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: 290e8aaa384085a7f691b2a140b5a904794eb83c Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=290e8aaa384085a7f691b2a140b5a904794eb83c commit 290e8aaa384085a7f691b2a140b5a904794eb83c Author: Cy Schubert AuthorDate: 2025-06-04 23:39:08 +0000 Commit: Cy Schubert CommitDate: 2025-06-05 02:45:46 +0000 share/mk: Add MIT KRB5 build knob This is the first in a series of commits to replace Heimdal with MIT KRB5. This first commit adds the WITH_MITKRB5/MK_MITKRB5 knob to src.opts.mk and its corresponding documentation in tools/build/options. The default is off. This change of and by itself is of no consequence as MIT KRB5 has yet to be imported in to HEAD. But it does insulate the build from inremental change until the last patch is committed when WITH_MITKRB5 will build MIT KRB5 1.21.3 instead of Heimdal. The affords us the opportunity to review smaller commits. This is the first of many commits. Reviewed by: imp, jhb, brooks, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50684 --- share/mk/src.opts.mk | 3 +++ tools/build/options/WITH_MITKRB5 | 1 + 2 files changed, 4 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 956220be43b3..387e570f8518 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -211,6 +211,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_FULL_DEBUGINFO \ MALLOC_PRODUCTION \ + MITKRB5 \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ @@ -403,6 +404,7 @@ MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no +MK_MITKRB5:= no .endif .if ${MK_DTRACE} == "no" @@ -429,6 +431,7 @@ MK_OPENSSH:= no MK_OPENSSL_KTLS:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no +MK_MITKRB5:= no MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_LOADER_ZFS:= no diff --git a/tools/build/options/WITH_MITKRB5 b/tools/build/options/WITH_MITKRB5 new file mode 100644 index 000000000000..6e3683c351c5 --- /dev/null +++ b/tools/build/options/WITH_MITKRB5 @@ -0,0 +1 @@ +Set this to build MIT Kerberos 5 instead of KTH Heimdal. From nobody Thu Jun 5 02:53:53 2025 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 4bCTYG3QyWz5y3sr; Thu, 05 Jun 2025 02:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCTYF5McTz3PPY; Thu, 05 Jun 2025 02:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7NIorfgiEVrq6O2D6vxxbWH9+LtrerzD0xSMcjlt+k=; b=JKgdyH4M9u8t4b2kv/LWa3cRSPOvSqa1zYErp+JqRSSzbbGY63hi7B52XhvQ3uDic3awn+ ny2LaAfiKIMZ8fRc6RRWi99RX+ZDmoUb+7j7jtB9IFxwRNbW/W6OMCU7zS3VaTaa2iLHx/ t6C+iygdSyEfHtg4oHzoloyClJ8MD1kC++H1m6tgtHq1xgkflyWPbgc+Dsc5FFgGy3XMKz WZvafn9eR0MF+U7fCfoeZ4E1rTsRyDrZeQdFpbD0pSPIj31UqV0eYO5Qi3cHGh1h7eSyKv 2AF/bY8FKXtFB/oKI1uEKHjtGv5XX4kXQnaxWMuz9aRj57+hcb+229cuaU6N3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7NIorfgiEVrq6O2D6vxxbWH9+LtrerzD0xSMcjlt+k=; b=HjMiRqT8N8LJzwjOPAiiRaZqXm1PWC/VS4JcLj3vkTYO8Du4it8LLXqc8DNapfIJfUFYaK QaC+xGu1adwW2Gmcu6EBytuyHMnR4fzNEpdoYpm6PJlcdfsjMVFoUaCynKhOUfn7KvBIBo Da7Yh60cGY6lijiqhg0hW2e4q5up6hi0xKWnR3N3Tox4Kgd3r/yZmb+a6yZMrfp5f4zJel mMVmrqmw73H/NQ1tkJa/VvOSs90a9y98Cpxty7O4S/+jSmErPqvySxB+Gnkg3nZohqrJfa zFQNw7saUBtHjRT0UdNHvyoAxLCTkbpWCGaZEXXukJM9HlpIxQQsv31UmOP+Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749092033; a=rsa-sha256; cv=none; b=fDMQSxjeIwNDBz1KskPXMyOUtmwyXqwMEE1wG4uioSvFqhJR17HRUAaTvqZTlvlmkf8URz TXQlurrnIacHomxIam3f8EVOuJ/VdHl7u3g3pQA46XFVWRs/NNlpsnz/oJx2W/DYs50wop Mn9809S6nSnXp2AGbAfojc1Siu4yr7HQ7QaegMQ0j8g3wxr4/p4UilLwN0pxBziJDyzhSD AIJ1GQDsJn1g0pSUslqB8ImGqLDpIo4HRvrrvEdWBwPZwIJB1YSk2CNQLkBOTj+USyA9I8 pf+jUTVLFEtKx6gUNRUNO5X0n3FC7zmhOruP3fFPT5/pX2yVSJFirCA04R23TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCTYF4qvlzry7; Thu, 05 Jun 2025 02:53: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 5552rr05043492; Thu, 5 Jun 2025 02:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5552rrhJ043488; Thu, 5 Jun 2025 02:53:53 GMT (envelope-from git) Date: Thu, 5 Jun 2025 02:53:53 GMT Message-Id: <202506050253.5552rrhJ043488@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: bf6873c5786e - main - pam-krb5: Import/add pam-krb5 from eyeire.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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf6873c5786e333d679a7838d28812febf479a8a Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bf6873c5786e333d679a7838d28812febf479a8a commit bf6873c5786e333d679a7838d28812febf479a8a Merge: 290e8aaa3840 24f0b4ca2d56 Author: Cy Schubert AuthorDate: 2025-06-05 02:46:40 +0000 Commit: Cy Schubert CommitDate: 2025-06-05 02:46:46 +0000 pam-krb5: Import/add pam-krb5 from eyeire.org From https://www.eyrie.org/~eagle/software/pam-krb5/: pam-krb5 provides a Kerberos PAM module that supports authentication, user ticket cache handling, simple authorization (via .k5login or checking Kerberos principals against local usernames), and password changing. It can be configured through either options in the PAM configuration itself or through entries in the system krb5.conf file, and it tries to work around PAM implementation flaws in commonly-used PAM-enabled applications such as OpenSSH and xdm. It supports both PKINIT and FAST to the extent that the underlying Kerberos libraries support these features. The reason for this import is to provide an MIT KRB5 compatible pam_krb5 PAM module. The existing pam_krb5 in FreeBS only works with Heimdal. The Makefiles to hook this software into the build willl come later. Sponsored by: The FreeBSD Foundation Add 'contrib/pam-krb5/' from commit '24f0b4ca2d565cdbb4fe7839ff28320706bf2386' git-subtree-dir: contrib/pam-krb5 git-subtree-mainline: 290e8aaa384085a7f691b2a140b5a904794eb83c git-subtree-split: 24f0b4ca2d565cdbb4fe7839ff28320706bf2386 contrib/pam-krb5/.clang-format | 30 + contrib/pam-krb5/.github/dependabot.yml | 6 + contrib/pam-krb5/.github/workflows/build.yaml | 44 + contrib/pam-krb5/LICENSE | 344 ++++ contrib/pam-krb5/Makefile.am | 210 +++ contrib/pam-krb5/NEWS | 1215 +++++++++++++ contrib/pam-krb5/README | 641 +++++++ contrib/pam-krb5/README.md | 665 ++++++++ contrib/pam-krb5/TODO | 101 ++ contrib/pam-krb5/bootstrap | 13 + contrib/pam-krb5/ci/README.md | 13 + contrib/pam-krb5/ci/files/heimdal/heimdal-kdc | 9 + contrib/pam-krb5/ci/files/heimdal/kadmind.acl | 1 + contrib/pam-krb5/ci/files/heimdal/kdc.conf | 30 + contrib/pam-krb5/ci/files/heimdal/krb5.conf | 19 + contrib/pam-krb5/ci/files/heimdal/pki-mapping | 1 + contrib/pam-krb5/ci/files/mit/extensions.client | 19 + contrib/pam-krb5/ci/files/mit/extensions.kdc | 20 + contrib/pam-krb5/ci/files/mit/kadm5.acl | 1 + contrib/pam-krb5/ci/files/mit/kdc.conf | 19 + contrib/pam-krb5/ci/files/mit/krb5.conf | 19 + contrib/pam-krb5/ci/install | 18 + contrib/pam-krb5/ci/kdc-setup-heimdal | 105 ++ contrib/pam-krb5/ci/kdc-setup-mit | 102 ++ contrib/pam-krb5/ci/test | 44 + contrib/pam-krb5/configure.ac | 145 ++ contrib/pam-krb5/docs/docknot.yaml | 551 ++++++ contrib/pam-krb5/docs/pam_krb5.pod | 1056 ++++++++++++ contrib/pam-krb5/m4/cc-flags.m4 | 131 ++ contrib/pam-krb5/m4/clang.m4 | 28 + contrib/pam-krb5/m4/kadm5clnt.m4 | 103 ++ contrib/pam-krb5/m4/krb5-config.m4 | 104 ++ contrib/pam-krb5/m4/krb5-pkinit.m4 | 47 + contrib/pam-krb5/m4/krb5.m4 | 384 +++++ contrib/pam-krb5/m4/ld-version.m4 | 40 + contrib/pam-krb5/m4/lib-depends.m4 | 30 + contrib/pam-krb5/m4/lib-helper.m4 | 149 ++ contrib/pam-krb5/m4/lib-pathname.m4 | 54 + contrib/pam-krb5/m4/pam-const.m4 | 53 + contrib/pam-krb5/module/account.c | 92 + contrib/pam-krb5/module/alt-auth.c | 240 +++ contrib/pam-krb5/module/auth.c | 1135 +++++++++++++ contrib/pam-krb5/module/cache.c | 185 ++ contrib/pam-krb5/module/context.c | 177 ++ contrib/pam-krb5/module/fast.c | 288 ++++ contrib/pam-krb5/module/internal.h | 261 +++ contrib/pam-krb5/module/options.c | 259 +++ contrib/pam-krb5/module/pam_krb5.map | 11 + contrib/pam-krb5/module/pam_krb5.sym | 6 + contrib/pam-krb5/module/password.c | 401 +++++ contrib/pam-krb5/module/prompting.c | 481 ++++++ contrib/pam-krb5/module/public.c | 260 +++ contrib/pam-krb5/module/setcred.c | 474 ++++++ contrib/pam-krb5/module/support.c | 141 ++ contrib/pam-krb5/pam-util/args.c | 105 ++ contrib/pam-krb5/pam-util/args.h | 84 + contrib/pam-krb5/pam-util/logging.c | 345 ++++ contrib/pam-krb5/pam-util/logging.h | 131 ++ contrib/pam-krb5/pam-util/options.c | 720 ++++++++ contrib/pam-krb5/pam-util/options.h | 205 +++ contrib/pam-krb5/pam-util/vector.c | 289 ++++ contrib/pam-krb5/pam-util/vector.h | 120 ++ contrib/pam-krb5/portable/asprintf.c | 84 + contrib/pam-krb5/portable/dummy.c | 33 + contrib/pam-krb5/portable/issetugid.c | 35 + contrib/pam-krb5/portable/kadmin.h | 82 + contrib/pam-krb5/portable/krb5-extra.c | 186 ++ contrib/pam-krb5/portable/krb5-profile.c | 237 +++ contrib/pam-krb5/portable/krb5.h | 248 +++ contrib/pam-krb5/portable/macros.h | 72 + contrib/pam-krb5/portable/mkstemp.c | 101 ++ contrib/pam-krb5/portable/pam.h | 129 ++ contrib/pam-krb5/portable/pam_syslog.c | 36 + contrib/pam-krb5/portable/pam_vsyslog.c | 63 + contrib/pam-krb5/portable/reallocarray.c | 64 + contrib/pam-krb5/portable/stdbool.h | 63 + contrib/pam-krb5/portable/strndup.c | 56 + contrib/pam-krb5/portable/system.h | 154 ++ contrib/pam-krb5/tests/README | 252 +++ contrib/pam-krb5/tests/TESTS | 46 + contrib/pam-krb5/tests/config/README | 70 + contrib/pam-krb5/tests/data/cppcheck.supp | 72 + contrib/pam-krb5/tests/data/generate-krb5-conf | 86 + contrib/pam-krb5/tests/data/krb5-pam.conf | 30 + contrib/pam-krb5/tests/data/krb5.conf | 30 + contrib/pam-krb5/tests/data/perl.conf | 19 + contrib/pam-krb5/tests/data/scripts/alt-auth/basic | 19 + .../tests/data/scripts/alt-auth/basic-debug | 25 + contrib/pam-krb5/tests/data/scripts/alt-auth/fail | 19 + .../tests/data/scripts/alt-auth/fail-debug | 28 + .../pam-krb5/tests/data/scripts/alt-auth/fallback | 25 + .../tests/data/scripts/alt-auth/fallback-debug | 38 + .../tests/data/scripts/alt-auth/fallback-realm | 25 + contrib/pam-krb5/tests/data/scripts/alt-auth/force | 19 + .../tests/data/scripts/alt-auth/force-fail-debug | 26 + .../tests/data/scripts/alt-auth/force-fallback | 25 + contrib/pam-krb5/tests/data/scripts/alt-auth/only | 19 + .../pam-krb5/tests/data/scripts/alt-auth/only-fail | 22 + .../tests/data/scripts/alt-auth/username-map | 19 + .../data/scripts/alt-auth/username-map-prefix | 19 + .../tests/data/scripts/bad-authtok/no-prompt | 25 + .../tests/data/scripts/bad-authtok/try-first | 25 + .../tests/data/scripts/bad-authtok/try-first-debug | 36 + .../tests/data/scripts/bad-authtok/use-first | 22 + .../tests/data/scripts/bad-authtok/use-first-debug | 33 + .../pam-krb5/tests/data/scripts/basic/force-first | 22 + .../tests/data/scripts/basic/force-first-debug | 32 + .../pam-krb5/tests/data/scripts/basic/ignore-root | 16 + .../tests/data/scripts/basic/ignore-root-debug | 24 + .../pam-krb5/tests/data/scripts/basic/minimum-uid | 13 + .../tests/data/scripts/basic/minimum-uid-debug | 21 + .../pam-krb5/tests/data/scripts/basic/no-context | 17 + .../tests/data/scripts/basic/no-context-debug | 47 + .../tests/data/scripts/cache-cleanup/auth-only | 17 + contrib/pam-krb5/tests/data/scripts/cache/basic | 21 + .../tests/data/scripts/cache/end-data-silent | 27 + .../pam-krb5/tests/data/scripts/cache/open-session | 20 + .../tests/data/scripts/cache/search-k5login | 20 + .../tests/data/scripts/cache/search-k5login-debug | 34 + .../tests/data/scripts/expired/basic-heimdal | 31 + .../tests/data/scripts/expired/basic-heimdal-debug | 44 + .../data/scripts/expired/basic-heimdal-flag-silent | 27 + .../tests/data/scripts/expired/basic-heimdal-old | 30 + .../data/scripts/expired/basic-heimdal-old-debug | 43 + .../data/scripts/expired/basic-heimdal-silent | 27 + .../pam-krb5/tests/data/scripts/expired/basic-mit | 28 + .../tests/data/scripts/expired/basic-mit-debug | 41 + .../data/scripts/expired/basic-mit-flag-silent | 27 + .../tests/data/scripts/expired/basic-mit-silent | 27 + .../pam-krb5/tests/data/scripts/expired/defer-mit | 33 + .../tests/data/scripts/expired/defer-mit-debug | 57 + contrib/pam-krb5/tests/data/scripts/expired/fail | 20 + .../pam-krb5/tests/data/scripts/expired/fail-debug | 24 + contrib/pam-krb5/tests/data/scripts/fast/anonymous | 17 + .../tests/data/scripts/fast/anonymous-debug | 22 + contrib/pam-krb5/tests/data/scripts/fast/ccache | 17 + .../pam-krb5/tests/data/scripts/fast/ccache-debug | 21 + contrib/pam-krb5/tests/data/scripts/fast/no-ccache | 17 + .../tests/data/scripts/fast/no-ccache-debug | 21 + contrib/pam-krb5/tests/data/scripts/long/password | 14 + .../tests/data/scripts/long/password-debug | 20 + contrib/pam-krb5/tests/data/scripts/long/use-first | 14 + .../tests/data/scripts/long/use-first-debug | 17 + .../pam-krb5/tests/data/scripts/no-cache/no-prompt | 25 + .../tests/data/scripts/no-cache/no-prompt-try | 25 + .../tests/data/scripts/no-cache/no-prompt-use | 25 + .../pam-krb5/tests/data/scripts/no-cache/prompt | 25 + .../tests/data/scripts/no-cache/prompt-expose | 25 + .../tests/data/scripts/no-cache/prompt-fail | 25 + .../tests/data/scripts/no-cache/prompt-fail-debug | 36 + .../tests/data/scripts/no-cache/prompt-principal | 26 + .../pam-krb5/tests/data/scripts/no-cache/try-first | 25 + .../pam-krb5/tests/data/scripts/no-cache/use-first | 25 + .../pam-krb5/tests/data/scripts/pam-user/no-update | 20 + .../pam-krb5/tests/data/scripts/pam-user/update | 20 + .../pam-krb5/tests/data/scripts/password/authtok | 21 + .../tests/data/scripts/password/authtok-force | 18 + .../tests/data/scripts/password/authtok-too-long | 17 + .../data/scripts/password/authtok-too-long-debug | 23 + .../pam-krb5/tests/data/scripts/password/banner | 23 + .../tests/data/scripts/password/banner-expose | 23 + contrib/pam-krb5/tests/data/scripts/password/basic | 20 + .../tests/data/scripts/password/basic-debug | 28 + .../pam-krb5/tests/data/scripts/password/expose | 23 + .../pam-krb5/tests/data/scripts/password/ignore | 18 + .../pam-krb5/tests/data/scripts/password/no-banner | 23 + .../tests/data/scripts/password/no-banner-expose | 23 + .../tests/data/scripts/password/prompt-principal | 24 + .../pam-krb5/tests/data/scripts/password/too-long | 15 + .../tests/data/scripts/password/too-long-debug | 24 + contrib/pam-krb5/tests/data/scripts/pkinit/basic | 22 + .../pam-krb5/tests/data/scripts/pkinit/basic-debug | 30 + .../tests/data/scripts/pkinit/no-use-pkinit | 18 + contrib/pam-krb5/tests/data/scripts/pkinit/pin-mit | 20 + .../tests/data/scripts/pkinit/preauth-opt-mit | 17 + .../pam-krb5/tests/data/scripts/pkinit/prompt-try | 20 + .../pam-krb5/tests/data/scripts/pkinit/prompt-use | 20 + .../pam-krb5/tests/data/scripts/pkinit/try-pkinit | 17 + .../tests/data/scripts/pkinit/try-pkinit-debug | 19 + .../tests/data/scripts/pkinit/try-pkinit-debug-mit | 20 + .../tests/data/scripts/realm/fail-bad-user-realm | 17 + .../tests/data/scripts/realm/fail-no-realm | 17 + .../tests/data/scripts/realm/fail-no-realm-debug | 21 + .../pam-krb5/tests/data/scripts/realm/fail-realm | 17 + .../tests/data/scripts/realm/fail-user-realm | 18 + .../pam-krb5/tests/data/scripts/realm/pass-realm | 17 + .../tests/data/scripts/realm/pass-user-realm | 17 + .../pam-krb5/tests/data/scripts/stacked/auth-only | 18 + contrib/pam-krb5/tests/data/scripts/stacked/basic | 22 + contrib/pam-krb5/tests/data/scripts/stacked/prompt | 25 + .../tests/data/scripts/stacked/prompt-principal | 25 + .../pam-krb5/tests/data/scripts/stacked/try-first | 22 + .../pam-krb5/tests/data/scripts/stacked/use-first | 22 + .../pam-krb5/tests/data/scripts/trace/supported | 58 + .../pam-krb5/tests/data/scripts/trace/unsupported | 52 + contrib/pam-krb5/tests/data/valgrind.supp | 242 +++ contrib/pam-krb5/tests/docs/pod-spelling-t | 55 + contrib/pam-krb5/tests/docs/pod-t | 56 + contrib/pam-krb5/tests/docs/spdx-license-t | 149 ++ contrib/pam-krb5/tests/fakepam/README | 276 +++ contrib/pam-krb5/tests/fakepam/config.c | 766 +++++++++ contrib/pam-krb5/tests/fakepam/data.c | 356 ++++ contrib/pam-krb5/tests/fakepam/general.c | 151 ++ contrib/pam-krb5/tests/fakepam/internal.h | 119 ++ contrib/pam-krb5/tests/fakepam/kuserok.c | 119 ++ contrib/pam-krb5/tests/fakepam/logging.c | 183 ++ contrib/pam-krb5/tests/fakepam/pam.h | 101 ++ contrib/pam-krb5/tests/fakepam/script.c | 411 +++++ contrib/pam-krb5/tests/fakepam/script.h | 82 + contrib/pam-krb5/tests/module/alt-auth-t.c | 117 ++ contrib/pam-krb5/tests/module/bad-authtok-t.c | 53 + contrib/pam-krb5/tests/module/basic-t.c | 67 + contrib/pam-krb5/tests/module/cache-cleanup-t.c | 104 ++ contrib/pam-krb5/tests/module/cache-t.c | 210 +++ contrib/pam-krb5/tests/module/expired-t.c | 175 ++ contrib/pam-krb5/tests/module/fast-anon-t.c | 108 ++ contrib/pam-krb5/tests/module/fast-t.c | 57 + contrib/pam-krb5/tests/module/long-t.c | 46 + contrib/pam-krb5/tests/module/no-cache-t.c | 47 + contrib/pam-krb5/tests/module/pam-user-t.c | 80 + contrib/pam-krb5/tests/module/password-t.c | 152 ++ contrib/pam-krb5/tests/module/pkinit-t.c | 98 ++ contrib/pam-krb5/tests/module/realm-t.c | 87 + contrib/pam-krb5/tests/module/stacked-t.c | 50 + contrib/pam-krb5/tests/module/trace-t.c | 48 + contrib/pam-krb5/tests/pam-util/args-t.c | 86 + contrib/pam-krb5/tests/pam-util/fakepam-t.c | 121 ++ contrib/pam-krb5/tests/pam-util/logging-t.c | 146 ++ contrib/pam-krb5/tests/pam-util/options-t.c | 458 +++++ contrib/pam-krb5/tests/pam-util/vector-t.c | 149 ++ contrib/pam-krb5/tests/portable/asprintf-t.c | 69 + contrib/pam-krb5/tests/portable/asprintf.c | 2 + contrib/pam-krb5/tests/portable/mkstemp-t.c | 81 + contrib/pam-krb5/tests/portable/mkstemp.c | 2 + contrib/pam-krb5/tests/portable/strndup-t.c | 60 + contrib/pam-krb5/tests/portable/strndup.c | 2 + contrib/pam-krb5/tests/runtests.c | 1782 ++++++++++++++++++++ contrib/pam-krb5/tests/style/obsolete-strings-t | 104 ++ contrib/pam-krb5/tests/tap/basic.c | 1029 +++++++++++ contrib/pam-krb5/tests/tap/basic.h | 192 +++ contrib/pam-krb5/tests/tap/kadmin.c | 138 ++ contrib/pam-krb5/tests/tap/kadmin.h | 58 + contrib/pam-krb5/tests/tap/kerberos.c | 544 ++++++ contrib/pam-krb5/tests/tap/kerberos.h | 135 ++ contrib/pam-krb5/tests/tap/libtap.sh | 248 +++ contrib/pam-krb5/tests/tap/macros.h | 99 ++ contrib/pam-krb5/tests/tap/perl/Test/RRA.pm | 324 ++++ .../pam-krb5/tests/tap/perl/Test/RRA/Automake.pm | 487 ++++++ contrib/pam-krb5/tests/tap/perl/Test/RRA/Config.pm | 224 +++ contrib/pam-krb5/tests/tap/process.c | 532 ++++++ contrib/pam-krb5/tests/tap/process.h | 95 ++ contrib/pam-krb5/tests/tap/string.c | 67 + contrib/pam-krb5/tests/tap/string.h | 51 + contrib/pam-krb5/tests/valgrind/logs-t | 83 + 254 files changed, 29790 insertions(+) diff --cc contrib/pam-krb5/.clang-format index 000000000000,000000000000..da1e4e8030d3 new file mode 100644 --- /dev/null +++ b/contrib/pam-krb5/.clang-format @@@ -1,0 -1,0 +1,30 @@@ ++# Configuration for clang-format automated reformatting. -*- yaml -*- ++# ++# The canonical version of this file is maintained in the rra-c-util package, ++# which can be found at . ++# ++# Copyright 2020-2021 Russ Allbery ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++# ++# SPDX-License-Identifier: FSFAP ++ ++--- ++Language: Cpp ++BasedOnStyle: LLVM ++AlignConsecutiveMacros: true ++AlignEscapedNewlines: Left ++AllowShortEnumsOnASingleLine: false ++AlwaysBreakAfterReturnType: AllDefinitions ++BreakBeforeBinaryOperators: NonAssignment ++BreakBeforeBraces: WebKit ++ColumnLimit: 79 ++IndentPPDirectives: AfterHash ++IndentWidth: 4 ++IndentWrappedFunctionNames: false ++MaxEmptyLinesToKeep: 2 ++SpaceAfterCStyleCast: true ++--- diff --cc contrib/pam-krb5/.github/dependabot.yml index 000000000000,5ace4600a1f2..5ace4600a1f2 mode 000000,100644..100644 --- a/contrib/pam-krb5/.github/dependabot.yml +++ b/contrib/pam-krb5/.github/dependabot.yml diff --cc contrib/pam-krb5/.github/workflows/build.yaml index 000000000000,6120a6cf8f58..6120a6cf8f58 mode 000000,100644..100644 --- a/contrib/pam-krb5/.github/workflows/build.yaml +++ b/contrib/pam-krb5/.github/workflows/build.yaml diff --cc contrib/pam-krb5/LICENSE index 000000000000,9c3abee30255..9c3abee30255 mode 000000,100644..100644 --- a/contrib/pam-krb5/LICENSE +++ b/contrib/pam-krb5/LICENSE diff --cc contrib/pam-krb5/Makefile.am index 000000000000,ef28c36ad045..ef28c36ad045 mode 000000,100644..100644 --- a/contrib/pam-krb5/Makefile.am +++ b/contrib/pam-krb5/Makefile.am diff --cc contrib/pam-krb5/NEWS index 000000000000,b5c007ef9359..b5c007ef9359 mode 000000,100644..100644 --- a/contrib/pam-krb5/NEWS +++ b/contrib/pam-krb5/NEWS diff --cc contrib/pam-krb5/README index 000000000000,3b7cb5c886dc..3b7cb5c886dc mode 000000,100644..100644 --- a/contrib/pam-krb5/README +++ b/contrib/pam-krb5/README diff --cc contrib/pam-krb5/README.md index 000000000000,000000000000..e74b6751ceb4 new file mode 100644 --- /dev/null +++ b/contrib/pam-krb5/README.md @@@ -1,0 -1,0 +1,665 @@@ ++# pam-krb5 ++ ++[![Build ++status](https://github.com/rra/pam-krb5/workflows/build/badge.svg)](https://github.com/rra/pam-krb5/actions) ++[![Debian ++package](https://img.shields.io/debian/v/libpam-krb5/unstable)](https://tracker.debian.org/pkg/libpam-krb5) ++ ++Copyright 2005-2010, 2014-2015, 2017, 2020-2021 Russ Allbery ++. Copyright 2009-2011 The Board of Trustees of the ++Leland Stanford Junior University. Copyright 2005 Andres Salomon ++. Copyright 1999-2000 Frank Cusack ++. This software is distributed under a BSD-style ++license. Please see the section [License](#license) below for more ++information. ++ ++## Blurb ++ ++pam-krb5 is a Kerberos PAM module for either MIT Kerberos or Heimdal. It ++supports ticket refreshing by screen savers, configurable authorization ++handling, authentication of non-local accounts for network services, ++password changing, and password expiration, as well as all the standard ++expected PAM features. It works correctly with OpenSSH, even with ++ChallengeResponseAuthentication and PrivilegeSeparation enabled, and ++supports extensive configuration either by PAM options or in krb5.conf or ++both. PKINIT is supported with recent versions of both MIT Kerberos and ++Heimdal and FAST is supported with recent MIT Kerberos. ++ ++## Description ++ ++pam-krb5 provides a Kerberos PAM module that supports authentication, user ++ticket cache handling, simple authorization (via .k5login or checking ++Kerberos principals against local usernames), and password changing. It ++can be configured through either options in the PAM configuration itself ++or through entries in the system krb5.conf file, and it tries to work ++around PAM implementation flaws in commonly-used PAM-enabled applications ++such as OpenSSH and xdm. It supports both PKINIT and FAST to the extent ++that the underlying Kerberos libraries support these features. ++ ++This is not the Kerberos PAM module maintained on Sourceforge and used on ++Red Hat systems. It is an independent implementation that, if it ever ++shared any common code, diverged long ago. It supports some features that ++the Sourceforge module does not (particularly around authorization), and ++does not support some options (particularly ones not directly related to ++Kerberos) that it does. This module will never support Kerberos v4 or ++AFS. For an AFS session module that works with this module (or any other ++Kerberos PAM module), see ++[pam-afs-session](https://www.eyrie.org/~eagle/software/pam-afs-session/). ++ ++If there are other options besides AFS and Kerberos v4 support from the ++Sourceforge PAM module that you're missing in this module, please let me ++know. ++ ++## Requirements ++ ++Either MIT Kerberos (or Kerberos implementations based on it) or Heimdal ++are supported. MIT Keberos 1.3 or later may be required; this module has ++not been tested with earlier versions. ++ ++For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later ++are required. Earlier MIT Kerberos 1.6 releases have a bug in their ++handling of PKINIT options. MIT Kerberos 1.12 or later is required to use ++the use_pkinit PAM option. ++ ++For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos ++1.7 or higher is required. For anonymous FAST support, anonymous ++authentication (generally anonymous PKINIT) support is required in both ++the Kerberos libraries and in the local KDC. ++ ++This module should work on Linux and build with gcc or clang. It may ++still work on Solaris and build with the Sun C compiler, but I have only ++tested it on Linux recently. There is beta-quality support for the AIX ++NAS Kerberos implementation that has not been tested in years. Other PAM ++implementations will probably require some porting, although untested ++build system support is present for FreeBSD, Mac OS X, and HP-UX. I ++personally can only test on Linux and rely on others to report problems on ++other operating systems. ++ ++Old versions of OpenSSH are known to call `pam_authenticate` followed by ++`pam_setcred(PAM_REINITIALIZE_CRED)` without first calling ++`pam_open_session`, thereby requesting that an existing ticket cache be ++renewed (similar to what a screensaver would want) rather than requesting ++a new ticket cache be created. Since this behavior is indistinguishable ++at the PAM level from a screensaver, pam-krb5 when used with these old ++versions of OpenSSH will refresh the ticket cache of the OpenSSH daemon ++rather than setting up a new ticket cache for the user. The resulting ++ticket cache will have the correct permissions (this is not a security ++concern), but will not be named correctly or referenced in the user's ++environment and will be overwritten by the next user login. The best ++solution to this problem is to upgrade OpenSSH. I'm not sure exactly when ++this problem was fixed, but at the very least OpenSSH 4.3 and later do not ++exhibit it. ++ ++To bootstrap from a Git checkout, or if you change the Automake files and ++need to regenerate Makefile.in, you will need Automake 1.11 or later. For ++bootstrap or if you change configure.ac or any of the m4 files it includes ++and need to regenerate configure or config.h.in, you will need Autoconf ++2.64 or later. Perl is also required to generate manual pages from a ++fresh Git checkout. ++ ++## Building and Installation ++ ++You can build and install pam-krb5 with the standard commands: ++ ++``` ++ ./configure ++ make ++ make install ++``` ++ ++If you are building from a Git clone, first run `./bootstrap` in the ++source directory to generate the build files. `make install` will ++probably have to be done as root. Building outside of the source ++directory is also supported, if you wish, by creating an empty directory ++and then running configure with the correct relative path. ++ ++The module will be installed in `/usr/local/lib/security` by default, but ++expect to have to override this using `--libdir`. The correct ++installation path for PAM modules varies considerably between systems. ++The module will always be installed in a subdirectory named `security` ++under the specified value of `--libdir`. On Red Hat Linux, for example, ++`--libdir=/usr/lib64` is appropriate to install the module into the system ++PAM directory. On Debian's amd64 architecture, ++`--libdir=/usr/lib/x86_64-linux-gnu` would be correct. ++ ++Normally, configure will use `krb5-config` to determine the flags to use ++to compile with your Kerberos libraries. To specify a particular ++`krb5-config` script to use, either set the `PATH_KRB5_CONFIG` environment ++variable or pass it to configure like: ++ ++``` ++ ./configure PATH_KRB5_CONFIG=/path/to/krb5-config ++``` ++ ++If `krb5-config` isn't found, configure will look for the standard ++Kerberos libraries in locations already searched by your compiler. If the ++the `krb5-config` script first in your path is not the one corresponding ++to the Kerberos libraries you want to use, or if your Kerberos libraries ++and includes aren't in a location searched by default by your compiler, ++you need to specify a different Kerberos installation root via ++`--with-krb5=PATH`. For example: ++ ++``` ++ ./configure --with-krb5=/usr/pubsw ++``` ++ ++You can also individually set the paths to the include directory and the ++library directory with `--with-krb5-include` and `--with-krb5-lib`. You ++may need to do this if Autoconf can't figure out whether to use `lib`, ++`lib32`, or `lib64` on your platform. ++ ++To not use `krb5-config` and force library probing even if there is a ++`krb5-config` script on your path, set `PATH_KRB5_CONFIG` to a nonexistent ++path: ++ ++``` ++ ./configure PATH_KRB5_CONFIG=/nonexistent ++``` ++ ++`krb5-config` is not used and library probing is always done if either ++`--with-krb5-include` or `--with-krb5-lib` are given. ++ ++Pass `--enable-silent-rules` to configure for a quieter build (similar to ++the Linux kernel). Use `make warnings` instead of `make` to build with ++full GCC compiler warnings (requires either GCC or Clang and may require a ++relatively current version of the compiler). ++ ++You can pass the `--enable-reduced-depends` flag to configure to try to ++minimize the shared library dependencies encoded in the binaries. This ++omits from the link line all the libraries included solely because other ++libraries depend on them and instead links the programs only against ++libraries whose APIs are called directly. This will only work with shared ++libraries and will only work on platforms where shared libraries properly ++encode their own dependencies (this includes most modern platforms such as ++all Linux). It is intended primarily for building packages for Linux ++distributions to avoid encoding unnecessary shared library dependencies ++that make shared library migrations more difficult. If none of the above ++made any sense to you, don't bother with this flag. ++ ++## Testing ++ ++pam-krb5 comes with a comprehensive test suite, but it requires some ++configuration in order to test anything other than low-level utility ++functions. For the full test suite, you will need to have a running KDC ++in which you can create two test accounts, one with admin access to the ++other. Using a test KDC environment, if you have one, is recommended. ++ ++Follow the instructions in `tests/config/README` to configure the test ++suite. ++ ++Now, you can run the test suite with: ++ ++``` ++ make check ++``` ++ ++If a test fails, you can run a single test with verbose output via: ++ ++``` ++ tests/runtests -o ++``` ++ ++Do this instead of running the test program directly since it will ensure ++that necessary environment variables are set up. ++ ++The default libkadm5clnt library on the system must match the ++implementation of your KDC for the module/expired test to work, since the ++two kadmin protocols are not compatible. If you use the MIT library ++against a Heimdal server, the test will be skipped; if you use the Heimdal ++library against an MIT server, the test suite may hang. ++ ++Several `module/expired` tests are expected to fail with Heimdal 1.5 due ++to a bug in Heimdal with reauthenticating immediately after a ++library-mediated password change of an expired password. This is fixed in ++later releases of Heimdal. ++ ++To run the full test suite, Perl 5.10 or later is required. The following ++additional Perl modules will be used if present: ++ ++* Test::Pod ++* Test::Spelling ++ ++All are available on CPAN. Those tests will be skipped if the modules are ++not available. ++ ++To enable tests that don't detect functionality problems but are used to ++sanity-check the release, set the environment variable `RELEASE_TESTING` ++to a true value. To enable tests that may be sensitive to the local ++environment or that produce a lot of false positives without uncovering ++many problems, set the environment variable `AUTHOR_TESTING` to a true ++value. ++ ++## Configuring ++ ++Just installing the module does not enable it or change anything about ++your system authentication configuration. To use the module for all ++system authentication on Debian systems, put something like: ++ ++``` ++ auth sufficient pam_krb5.so minimum_uid=1000 ++ auth required pam_unix.so try_first_pass nullok_secure ++``` ++ ++in `/etc/pam.d/common-auth`, something like: ++ ++``` ++ session optional pam_krb5.so minimum_uid=1000 ++ session required pam_unix.so ++``` ++ ++in `/etc/pam.d/common-session`, and something like: ++ ++``` ++ account required pam_krb5.so minimum_uid=1000 ++ account required pam_unix.so ++``` ++ ++in `/etc/pam.d/common-account`. The `minimum_uid` setting tells the PAM ++module to pass on any users with a UID lower than 1000, thereby bypassing ++Kerberos authentication for the root account and any system accounts. You ++normally want to do this since otherwise, if the network is down, the ++Kerberos authentication can time out and make it difficult to log in as ++root and fix matters. This also avoids problems with Kerberos principals ++that happen to match system accounts accidentally getting access to those ++accounts. ++ ++Be sure to include the module in the session group as well as the auth ++group. Without the session entry, the user's ticket cache will not be ++created properly for ssh logins (among possibly others). ++ ++If your users should normally all use Kerberos passwords exclusively, ++putting something like: ++ ++``` ++ password sufficient pam_krb5.so minimum_uid=1000 ++ password required pam_unix.so try_first_pass obscure md5 ++``` ++ ++in `/etc/pam.d/common-password` will change users' passwords in Kerberos ++by default and then only fall back on Unix if that doesn't work. (You can ++make this tighter by using the more complex new-style PAM configuration.) ++If you instead want to synchronize local and Kerberos passwords and change ++them both at the same time, you can do something like: ++ ++``` ++ password required pam_unix.so obscure sha512 ++ password required pam_krb5.so use_authtok minimum_uid=1000 ++``` ++ ++If you have multiple environments that you want to synchronize and you ++don't want password changes to continue if the Kerberos password change ++fails, use the `clear_on_fail` option. For example: ++ ++``` ++ password required pam_krb5.so clear_on_fail minimum_uid=1000 ++ password required pam_unix.so use_authtok obscure sha512 ++ password required pam_smbpass.so use_authtok ++``` ++ ++In this case, if `pam_krb5` cannot change the password (due to password ++strength rules on the KDC, for example), it will clear the stored password ++(because of the `clear_on_fail` option), and since `pam_unix` and ++`pam_smbpass` are both configured with `use_authtok`, they will both fail. ++`clear_on_fail` is not the default because it would interfere with the ++more common pattern of falling back to local passwords if the user doesn't ++exist in Kerberos. ++ ++If you use a more complex configuration with the Linux PAM `[]` syntax for ++the session and account groups, note that `pam_krb5` returns a status of ++ignore, not success, if the user didn't log on with Kerberos. You may ++need to handle that explicitly with `ignore=ignore` in your action list. ++ ++There are many, many other possibilities. See the Linux PAM documentation ++for all the configuration options. ++ ++On Red Hat systems, modify `/etc/pam.d/system-auth` instead, which ++contains all of the configuration for the different stacks. ++ ++You can also use pam-krb5 only for specific services. In that case, ++modify the files in `/etc/pam.d` for that particular service to use ++`pam_krb5.so` for authentication. For services that are using passwords ++over TLS to authenticate users, you may want to use the `ignore_k5login` ++and `no_ccache` options to the authenticate module. `.k5login` ++authorization is only meaningful for local accounts and ticket caches are ++usually (although not always) only useful for interactive sessions. ++ ++Configuring the module for Solaris is both simpler and less flexible, ++since Solaris (at least Solaris 8 and 9, which are the last versions of ++Solaris with which this module was extensively tested) use a single ++`/etc/pam.conf` file that contains configuration for all programs. For ++console login on Solaris, try something like: ++ ++``` ++ login auth sufficient /usr/local/lib/security/pam_krb5.so minimum_uid=100 ++ login auth required /usr/lib/security/pam_unix_auth.so.1 use_first_pass ++ login account required /usr/local/lib/security/pam_krb5.so minimum_uid=100 ++ login account required /usr/lib/security/pam_unix_account.so.1 ++ login session required /usr/local/lib/security/pam_krb5.so retain_after_close minimum_uid=100 ++ login session required /usr/lib/security/pam_unix_session.so.1 ++``` ++ ++A similar configuration could be used for other services, such as ssh. ++See the pam.conf(5) man page for more information. When using this module ++with Solaris login (at least on Solaris 8 and 9), you will probably also ++need to add `retain_after_close` to the PAM configuration to avoid having ++the user's credentials deleted before they are logged in. ++ ++The Solaris Kerberos library reportedly does not support prompting for a ++password change of an expired account during authentication. Supporting ++password change for expired accounts on Solaris with native Kerberos may ++therefore require setting the `defer_pwchange` or `force_pwchange` option ++for selected login applications. See the description and warnings about ++that option in the pam_krb5(5) man page. ++ ++Some configuration options may be put in the `krb5.conf` file used by your ++Kerberos libraries (usually `/etc/krb5.conf` or ++`/usr/local/etc/krb5.conf`) instead or in addition to the PAM ++configuration. See the man page for more details. ++ ++The Kerberos library, via pam-krb5, will prompt the user to change their ++password if their password is expired, but when using OpenSSH, this will ++only work when `ChallengeResponseAuthentication` is enabled. Unless this ++option is enabled, OpenSSH doesn't pass PAM messages to the user and can ++only respond to a simple password prompt. ++ ++If you are using MIT Kerberos, be aware that users whose passwords are ++expired will not be prompted to change their password unless the KDC ++configuration for your realm in `[realms]` in `krb5.conf` contains a ++`master_kdc` setting or, if using DNS SRV records, you have a DNS entry ++for `_kerberos-master` as well as `_kerberos`. ++ ++## Debugging ++ ++The first step when debugging any problems with this module is to add ++`debug` to the PAM options for the module (either in the PAM configuration ++or in `krb5.conf`). This will significantly increase the logging from the ++module and should provide a trace of exactly what failed and any available ++error information. ++ ++Many Kerberos authentication problems are due to configuration issues in ++`krb5.conf`. If pam-krb5 doesn't work, first check that `kinit` works on ++the same system. That will test your basic Kerberos configuration. If ++the system has a keytab file installed that's readable by the process ++doing authentication via PAM, make sure that the keytab is current and ++contains a key for `host/` where is the fully-qualified ++hostname. pam-krb5 prevents KDC spoofing by checking the user's ++credentials when possible, but this means that if a keytab is present it ++must be correct or authentication will fail. You can check the keytab ++with `klist -k` and `kinit -k`. ++ ++Be sure that all libraries and modules, including PAM modules, loaded by a ++program use the same Kerberos libraries. Sometimes programs that use PAM, ++such as current versions of OpenSSH, also link against Kerberos directly. ++If your sshd is linked against one set of Kerberos libraries and pam-krb5 ++is linked against a different set of Kerberos libraries, this will often ++cause problems (such as segmentation faults, bus errors, assertions, or ++other strange behavior). Similar issues apply to the com_err library or ++any other library used by both modules and shared libraries and by the ++application that loads them. If your OS ships Kerberos libraries, it's ++usually best if possible to build all Kerberos software on the system ++against those libraries. ++ ++## Implementation Notes ++ ++The normal sequence of actions taken for a user login is: ++ ++``` ++ pam_authenticate ++ pam_setcred(PAM_ESTABLISH_CRED) ++ pam_open_session ++ pam_acct_mgmt ++``` ++ ++and then at logout: ++ ++``` ++ pam_close_session ++``` ++ ++followed by closing the open PAM session. The corresponding `pam_sm_*` ++functions in this module are called when an application calls those public ++interface functions. Not all applications call all of those functions, or ++in particularly that order, although `pam_authenticate` is always first ++and has to be. ++ ++When `pam_authenticate` is called, pam-krb5 creates a temporary ticket ++cache in `/tmp` and sets the PAM environment variable `PAM_KRB5CCNAME` to ++point to it. This ticket cache will be automatically destroyed when the ++PAM session is closed and is there only to pass the initial credentials to ++the call to `pam_setcred`. The module would use a memory cache, but ++memory caches will only work if the application preserves the PAM ++environment between the calls to `pam_authenticate` and `pam_setcred`. ++Most do, but OpenSSH notoriously does not and calls `pam_authenticate` in ++a subprocess, so this method is used to pass the tickets to the ++`pam_setcred` call in a different process. ++ ++`pam_authenticate` does a complete authentication, including checking the ++resulting TGT by obtaining a service ticket for the local host if ++possible, but this requires read access to the system keytab. If the ++keytab doesn't exist, can't be read, or doesn't include the appropriate ++credentials, the default is to accept the authentication. This can be ++controlled by setting `verify_ap_req_nofail` to true in `[libdefaults]` in ++`/etc/krb5.conf`. `pam_authenticate` also does a basic authorization ++check, by default calling `krb5_kuserok` (which uses `~/.k5login` if ++available and falls back to checking that the principal corresponds to the ++account name). This can be customized with several options documented in ++the pam_krb5(5) man page. ++ ++pam-krb5 treats `pam_open_session` and `pam_setcred(PAM_ESTABLISH_CRED)` ++as synonymous, as some applications call one and some call the other. ++Both copy the initial credentials from the temporary cache into a ++permanent cache for this session and set `KRB5CCNAME` in the environment. ++It will remember when the credential cache has been established and then ++avoid doing any duplicate work afterwards, since some applications call ++`pam_setcred` or `pam_open_session` multiple times (most notably X.Org 7 ++and earlier xdm, which also throws away the module settings the last time ++it calls them). ++ ++`pam_acct_mgmt` finds the ticket cache, reads it in to obtain the ++authenticated principal, and then does is another authorization check ++against `.k5login` or the local account name as described above. ++ ++After the call to `pam_setcred` or `pam_open_session`, the ticket cache ++will be destroyed whenever the calling application either destroys the PAM ++environment or calls `pam_close_session`, which it should do on user ++logout. ++ ++The normal sequence of events when refreshing a ticket cache (such as ++inside a screensaver) is: ++ ++``` ++ pam_authenticate ++ pam_setcred(PAM_REINITIALIZE_CRED) ++ pam_acct_mgmt ++``` ++ ++(`PAM_REFRESH_CRED` may be used instead.) Authentication proceeds as ++above. At the `pam_setcred` stage, rather than creating a new ticket ++cache, the module instead finds the current ticket cache (from the ++`KRB5CCNAME` environment variable or the default ticket cache location ++from the Kerberos library) and then reinitializes it with the credentials ++from the temporary `pam_authenticate` ticket cache. When refreshing a ++ticket cache, the application should not open a session. Calling ++`pam_acct_mgmt` is optional; pam-krb5 doesn't do anything different when ++it's called in this case. ++ ++If `pam_authenticate` apparently didn't succeed, or if an account was ++configured to be ignored via `ignore_root` or `minimum_uid`, `pam_setcred` ++(and therefore `pam_open_session`) and `pam_acct_mgmt` return ++`PAM_IGNORE`, which tells the PAM library to proceed as if that module ++wasn't listed in the PAM configuration at all. `pam_authenticate`, ++however, returns failure in the ignored user case by default, since ++otherwise a configuration using `ignore_root` with pam-krb5 as the only ++PAM module would allow anyone to log in as root without a password. There ++doesn't appear to be a case where returning `PAM_IGNORE` instead would ++improve the module's behavior, but if you know of a case, please let me ++know. ++ ++By default, `pam_authenticate` intentionally does not follow the PAM ++standard for handling expired accounts and instead returns failure from ++`pam_authenticate` unless the Kerberos libraries are able to change the ++account password during authentication. Too many applications either do ++not call `pam_acct_mgmt` or ignore its exit status. The fully correct PAM ++behavior (returning success from `pam_authenticate` and ++`PAM_NEW_AUTHTOK_REQD` from `pam_acct_mgmt`) can be enabled with the ++`defer_pwchange` option. ++ ++The `defer_pwchange` option is unfortunately somewhat tricky to implement. ++In this case, the calling sequence is: ++ ++``` ++ pam_authenticate ++ pam_acct_mgmt ++ pam_chauthtok ++ pam_setcred ++ pam_open_session ++``` ++ ++During the first `pam_authenticate`, we can't obtain credentials and ++therefore a ticket cache since the password is expired. But ++`pam_authenticate` isn't called again after `pam_chauthtok`, so ++`pam_chauthtok` has to create a ticket cache. We however don't want it to ++do this for the normal password change (`passwd`) case. ++ ++What we do is set a flag in our PAM data structure saying that we're ++processing an expired password, and `pam_chauthtok`, if it sees that flag, ++redoes the authentication with password prompting disabled after it ++finishes changing the password. ++ ++Unfortunately, when handling password changes this way, `pam_chauthtok` ++will always have to prompt the user for their current password again even ++though they just typed it. This is because the saved authentication ++tokens are cleared after `pam_authenticate` returns, for security reasons. ++We could hack around this by saving the password in our PAM data ++structure, but this would let the application gain access to it (exactly ++what the clearing is intended to prevent) and breaks a PAM library ++guarantee. We could also work around this by having `pam_authenticate` ++get the `kadmin/changepw` authenticator in the expired password case and ++store it for `pam_chauthtok`, but it doesn't seem worth the hassle. ++ ++## History and Acknowledgements ++ ++Originally written by Frank Cusack , with the ++following acknowledgement: ++ ++> Thanks to Naomaru Itoi , Curtis King ++> , and Derrick Brashear , all of ++> whom have written and made available Kerberos 4/5 modules. Although no ++> code in this module is directly from these author's modules, (except the ++> get_user_info() routine in support.c; derived from whichever of these ++> authors originally wrote the first module the other 2 copied from), it ++> was extremely helpful to look over their code which aided in my design. ++ ++The module was then patched for the FreeBSD ports collection with ++additional modifications by unknown maintainers and then was modified by ++Joel Kociolek to be usable with Debian GNU/Linux. ++ ++It was packaged by Sam Hartman as the Kerberos v5 PAM module for Debian ++and improved and modified by him and later by Russ Allbery to fix bugs and ++add additional features. It was then adopted by Andres Salomon, who added ++support for refreshing credentials. ++ ++The current distribution is maintained by Russ Allbery, who also added ++support for reading configuration from `krb5.conf`, added many features ++for compatibility with the Sourceforge module, commented and standardized ++the formatting of the code, and overhauled the documentation. ++ ++Thanks to Douglas E. Engert for the initial implementation of PKINIT ++support. I have since modified and reworked it extensively, so any bugs ++or compilation problems are my fault. ++ ++Thanks to Markus Moeller for lots of debugging and multiple patches and ++suggestions for improved portability. ++ ++Thanks to Booker Bense for the implementation of the `alt_auth_map` ++option. ++ ++Thanks to Sam Hartman for the FAST support implementation. ++ ++## Support ++ ++The [pam-krb5 web page](https://www.eyrie.org/~eagle/software/pam-krb5/) ++will always have the current version of this package, the current ++documentation, and pointers to any additional resources. ++ ++For bug tracking, use the [issue tracker on ++GitHub](https://github.com/rra/pam-krb5/issues). However, please be aware ++that I tend to be extremely busy and work projects often take priority. ++I'll save your report and get to it as soon as I can, but it may take me a ++couple of months. ++ ++## Source Repository ++ ++pam-krb5 is maintained using Git. You can access the current source on ++[GitHub](https://github.com/rra/pam-krb5) or by cloning the repository at: ++ ++https://git.eyrie.org/git/kerberos/pam-krb5.git ++ ++or [view the repository on the ++web](https://git.eyrie.org/?p=kerberos/pam-krb5.git). ++ ++The eyrie.org repository is the canonical one, maintained by the author, ++but using GitHub is probably more convenient for most purposes. Pull ++requests are gratefully reviewed and normally accepted. ++ ++## License ++ ++The pam-krb5 package as a whole is covered by the following copyright ++statement and license: ++ ++> Copyright 2005-2010, 2014-2015, 2017, 2020-2021 ++> Russ Allbery ++> ++> Copyright 2009-2011 ++> The Board of Trustees of the Leland Stanford Junior University ++> ++> Copyright 2005 ++> Andres Salomon ++> ++> Copyright 1999-2000 *** 1529 LINES SKIPPED *** From nobody Thu Jun 5 02:53:55 2025 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 4bCTYJ3rfkz5y47B; Thu, 05 Jun 2025 02:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCTYJ0lFyz3PRw; Thu, 05 Jun 2025 02:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgMv5bKm2GXd7+W0s8/FhKWe318jaSPQhjD2Ir0GEEs=; b=DkFDlsMsR9viifx2BUbMumIxL9qJfEVQJ1KjWa0WfdyS2APsQdFgvqBT928G+mQf6PHabx U3RGDIfKuzv42fwTjAHQ1Ovk/AewhtFPsnocnuTJ1aeLFlZ5LCi80OT7LKv6RgEFT2T/Ij ps96t9Of4mjCO9Id/mPEUhz5W5DszGISXAI6wqw4birTvqtq9CN1HIbUB6QKHeXf9r6S58 Qj0M1kA9slMpu47JQBJgUJcbyZA45aCO7kV19l04RIDmJCWDbpJ1XGyB9GNymbz5c95R9x 4JAP1YhkhvDWanE6YhVcOV6pwMtJJP582pnUx+Xalk/ZyIrOIW1lCPpi8PnoKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgMv5bKm2GXd7+W0s8/FhKWe318jaSPQhjD2Ir0GEEs=; b=ECDi6ZUUt6sqIJhqvv7fxYo8mOzi+EYPLR6GXieK4/a+MM3e9vNwZ4xCTsisNNPR5FGl+s 5E7Me/JZrOQVTb0p5xTK3U6SFIwPDZYTY4wf2Pon6vlbfVYs699N2EjoeNR3amQBcRc3eG jcDCbIyDMjdV9glkydBALmnQhBdNxYL2nlX4Q2IjSjbPcsJ+DngTT7BIglJivgwyLJlQTc /J8nw96NiwbXs7q19J2I4CNkwjeYZb3oquDbFcPlc94SgvVdgunQJ5oiuBzz50OfxD4+kq E0fUOhtx+xYakpeyR5BW+SfXJpCn6hXU6QvztD2IPLZUZ0prDXPb7QaXQuIaOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749092036; a=rsa-sha256; cv=none; b=ZW7RTj/eHDqqozb1L4mTtAAHpAC+YiO8+sMgyeyQoDrfvIl7HqhKu06ApNlhKiEna7bVNL kYGsGoYhFouH5rjGJbjK3HETfY0n59PwjR5fwGPdh+RYJT/oO/OU7DCRVjCxwfohKK/3Av PjlLMe0BNuhqn0dwB1+tnB+x4gXyR5hS1jkFdMDeL6BZ/7sDtvBsdRnZ9ygX7qrfadPiSo OQ/+QCSoPBYeXFC7kjbifR6M8B2YaMsVtrlkCDutFpHLK1345AHBmUnLXxVM94TQ85hQmZ n+CLC+g3rZxzGmct6Ka0MZrBd22u8kvFyPTLlrqpTVu0N1REo2ZAU5uFJCJ5/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCTYJ0KYpzs1k; Thu, 05 Jun 2025 02:53: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 5552rtiO043531; Thu, 5 Jun 2025 02:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5552rt0R043523; Thu, 5 Jun 2025 02:53:55 GMT (envelope-from git) Date: Thu, 5 Jun 2025 02:53:55 GMT Message-Id: <202506050253.5552rt0R043523@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: 7f2fe78b9dd5 - main - krb5: Import MIT 1.21.3 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: 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9 commit 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9 Merge: bf6873c5786e 8f7d3ef26dec Author: Cy Schubert AuthorDate: 2025-06-05 02:47:44 +0000 Commit: Cy Schubert CommitDate: 2025-06-05 02:47:53 +0000 krb5: Import MIT 1.21.3 Import MIT KRB5 1.21.3, which will gracefully replace KTH Heimdal. The tarball used in this import is the same tarball used in ports/krb5-121. The Makefiles to add MIT KRB5 to the build will be added later. Obtained from: http://web.mit.edu/kerberos/dist/ Sponsored by: The FreeBSD Foundation Add 'crypto/krb5/' from commit '8f7d3ef26dec89a92ec0665de84a5936310a5574' git-subtree-dir: crypto/krb5 git-subtree-mainline: bf6873c5786e333d679a7838d28812febf479a8a git-subtree-split: 8f7d3ef26dec89a92ec0665de84a5936310a5574 crypto/krb5/.github/workflows/build.yml | 104 + crypto/krb5/.github/workflows/doc.yml | 41 + crypto/krb5/NOTICE | 1384 + crypto/krb5/README | 578 + crypto/krb5/doc/README | 56 + crypto/krb5/doc/_static/kerb.css_t | 169 + crypto/krb5/doc/_templates/layout.html | 73 + crypto/krb5/doc/about.rst | 35 + crypto/krb5/doc/admin/admin_commands/index.rst | 17 + crypto/krb5/doc/admin/admin_commands/k5srvutil.rst | 69 + .../krb5/doc/admin/admin_commands/kadmin_local.rst | 985 + crypto/krb5/doc/admin/admin_commands/kadmind.rst | 129 + .../doc/admin/admin_commands/kdb5_ldap_util.rst | 449 + crypto/krb5/doc/admin/admin_commands/kdb5_util.rst | 502 + crypto/krb5/doc/admin/admin_commands/kprop.rst | 60 + crypto/krb5/doc/admin/admin_commands/kpropd.rst | 144 + crypto/krb5/doc/admin/admin_commands/kproplog.rst | 85 + crypto/krb5/doc/admin/admin_commands/krb5kdc.rst | 114 + crypto/krb5/doc/admin/admin_commands/ktutil.rst | 129 + crypto/krb5/doc/admin/admin_commands/sserver.rst | 112 + crypto/krb5/doc/admin/advanced/index.rst | 8 + crypto/krb5/doc/admin/advanced/retiring-des.rst | 422 + crypto/krb5/doc/admin/appl_servers.rst | 171 + crypto/krb5/doc/admin/auth_indicator.rst | 57 + crypto/krb5/doc/admin/backup_host.rst | 34 + crypto/krb5/doc/admin/conf_files/index.rst | 20 + crypto/krb5/doc/admin/conf_files/kadm5_acl.rst | 163 + crypto/krb5/doc/admin/conf_files/kdc_conf.rst | 976 + crypto/krb5/doc/admin/conf_files/krb5_conf.rst | 1251 + crypto/krb5/doc/admin/conf_ldap.rst | 132 + crypto/krb5/doc/admin/database.rst | 587 + crypto/krb5/doc/admin/dbtypes.rst | 149 + crypto/krb5/doc/admin/dictionary.rst | 88 + crypto/krb5/doc/admin/enctypes.rst | 222 + crypto/krb5/doc/admin/env_variables.rst | 4 + crypto/krb5/doc/admin/host_config.rst | 235 + crypto/krb5/doc/admin/https.rst | 48 + crypto/krb5/doc/admin/index.rst | 34 + crypto/krb5/doc/admin/install.rst | 21 + crypto/krb5/doc/admin/install_appl_srv.rst | 78 + crypto/krb5/doc/admin/install_clients.rst | 58 + crypto/krb5/doc/admin/install_kdc.rst | 536 + crypto/krb5/doc/admin/lockout.rst | 154 + crypto/krb5/doc/admin/otp.rst | 100 + crypto/krb5/doc/admin/pkinit.rst | 354 + crypto/krb5/doc/admin/princ_dns.rst | 126 + crypto/krb5/doc/admin/realm_config.rst | 268 + crypto/krb5/doc/admin/spake.rst | 56 + crypto/krb5/doc/admin/troubleshoot.rst | 135 + crypto/krb5/doc/admin/various_envs.rst | 27 + crypto/krb5/doc/appdev/gssapi.rst | 727 + crypto/krb5/doc/appdev/h5l_mit_apidiff.rst | 28 + crypto/krb5/doc/appdev/index.rst | 16 + crypto/krb5/doc/appdev/init_creds.rst | 304 + crypto/krb5/doc/appdev/princ_handle.rst | 79 + crypto/krb5/doc/appdev/refs/api/index.rst | 413 + crypto/krb5/doc/appdev/refs/index.rst | 9 + crypto/krb5/doc/appdev/refs/macros/index.rst | 397 + crypto/krb5/doc/appdev/refs/types/index.rst | 108 + crypto/krb5/doc/appdev/refs/types/krb5_int32.rst | 12 + crypto/krb5/doc/appdev/refs/types/krb5_ui_4.rst | 12 + crypto/krb5/doc/appdev/y2038.rst | 28 + crypto/krb5/doc/basic/ccache_def.rst | 160 + crypto/krb5/doc/basic/date_format.rst | 140 + crypto/krb5/doc/basic/index.rst | 14 + crypto/krb5/doc/basic/keytab_def.rst | 59 + crypto/krb5/doc/basic/rcache_def.rst | 111 + crypto/krb5/doc/basic/stash_file_def.rst | 25 + crypto/krb5/doc/build/directory_org.rst | 75 + crypto/krb5/doc/build/doing_build.rst | 148 + crypto/krb5/doc/build/index.rst | 63 + crypto/krb5/doc/build/options2configure.rst | 397 + crypto/krb5/doc/build/osconf.rst | 26 + crypto/krb5/doc/build_this.rst | 82 + crypto/krb5/doc/coding-style | 5 + crypto/krb5/doc/conf.py | 320 + crypto/krb5/doc/contributing.txt | 70 + crypto/krb5/doc/copyright.rst | 8 + crypto/krb5/doc/doxy_examples/cc_set_config.c | 33 + crypto/krb5/doc/doxy_examples/cc_unique.c | 23 + crypto/krb5/doc/doxy_examples/error_message.c | 20 + crypto/krb5/doc/doxy_examples/tkt_creds.c | 55 + crypto/krb5/doc/doxy_examples/verify_init_creds.c | 28 + crypto/krb5/doc/formats/ccache_file_format.rst | 182 + crypto/krb5/doc/formats/cookie.rst | 97 + crypto/krb5/doc/formats/freshness_token.rst | 19 + crypto/krb5/doc/formats/index.rst | 11 + crypto/krb5/doc/formats/keytab_file_format.rst | 51 + crypto/krb5/doc/formats/rcache_file_format.rst | 50 + crypto/krb5/doc/html/.buildinfo | 4 + crypto/krb5/doc/html/_sources/about.rst.txt | 35 + .../_sources/admin/admin_commands/index.rst.txt | 17 + .../admin/admin_commands/k5srvutil.rst.txt | 69 + .../admin/admin_commands/kadmin_local.rst.txt | 985 + .../_sources/admin/admin_commands/kadmind.rst.txt | 129 + .../admin/admin_commands/kdb5_ldap_util.rst.txt | 449 + .../admin/admin_commands/kdb5_util.rst.txt | 502 + .../_sources/admin/admin_commands/kprop.rst.txt | 60 + .../_sources/admin/admin_commands/kpropd.rst.txt | 144 + .../_sources/admin/admin_commands/kproplog.rst.txt | 85 + .../_sources/admin/admin_commands/krb5kdc.rst.txt | 114 + .../_sources/admin/admin_commands/ktutil.rst.txt | 129 + .../_sources/admin/admin_commands/sserver.rst.txt | 112 + .../doc/html/_sources/admin/advanced/index.rst.txt | 8 + .../_sources/admin/advanced/retiring-des.rst.txt | 422 + .../doc/html/_sources/admin/appl_servers.rst.txt | 171 + .../doc/html/_sources/admin/auth_indicator.rst.txt | 57 + .../doc/html/_sources/admin/backup_host.rst.txt | 34 + .../html/_sources/admin/conf_files/index.rst.txt | 20 + .../_sources/admin/conf_files/kadm5_acl.rst.txt | 163 + .../_sources/admin/conf_files/kdc_conf.rst.txt | 976 + .../_sources/admin/conf_files/krb5_conf.rst.txt | 1251 + .../krb5/doc/html/_sources/admin/conf_ldap.rst.txt | 132 + .../krb5/doc/html/_sources/admin/database.rst.txt | 587 + .../krb5/doc/html/_sources/admin/dbtypes.rst.txt | 149 + .../doc/html/_sources/admin/dictionary.rst.txt | 88 + .../krb5/doc/html/_sources/admin/enctypes.rst.txt | 222 + .../doc/html/_sources/admin/env_variables.rst.txt | 4 + .../doc/html/_sources/admin/host_config.rst.txt | 235 + crypto/krb5/doc/html/_sources/admin/https.rst.txt | 48 + crypto/krb5/doc/html/_sources/admin/index.rst.txt | 34 + .../krb5/doc/html/_sources/admin/install.rst.txt | 21 + .../html/_sources/admin/install_appl_srv.rst.txt | 78 + .../html/_sources/admin/install_clients.rst.txt | 58 + .../doc/html/_sources/admin/install_kdc.rst.txt | 536 + .../krb5/doc/html/_sources/admin/lockout.rst.txt | 154 + crypto/krb5/doc/html/_sources/admin/otp.rst.txt | 100 + crypto/krb5/doc/html/_sources/admin/pkinit.rst.txt | 354 + .../krb5/doc/html/_sources/admin/princ_dns.rst.txt | 126 + .../doc/html/_sources/admin/realm_config.rst.txt | 268 + crypto/krb5/doc/html/_sources/admin/spake.rst.txt | 56 + .../doc/html/_sources/admin/troubleshoot.rst.txt | 135 + .../doc/html/_sources/admin/various_envs.rst.txt | 27 + .../krb5/doc/html/_sources/appdev/gssapi.rst.txt | 727 + .../html/_sources/appdev/h5l_mit_apidiff.rst.txt | 28 + crypto/krb5/doc/html/_sources/appdev/index.rst.txt | 16 + .../doc/html/_sources/appdev/init_creds.rst.txt | 304 + .../doc/html/_sources/appdev/princ_handle.rst.txt | 79 + .../html/_sources/appdev/refs/api/index.rst.txt | 413 + .../refs/api/krb5_425_conv_principal.rst.txt | 59 + .../refs/api/krb5_524_conv_principal.rst.txt | 60 + .../appdev/refs/api/krb5_524_convert_creds.rst.txt | 55 + .../appdev/refs/api/krb5_address_compare.rst.txt | 47 + .../appdev/refs/api/krb5_address_order.rst.txt | 49 + .../appdev/refs/api/krb5_address_search.rst.txt | 55 + .../appdev/refs/api/krb5_allow_weak_crypto.rst.txt | 49 + .../refs/api/krb5_aname_to_localname.rst.txt | 61 + .../refs/api/krb5_anonymous_principal.rst.txt | 47 + .../appdev/refs/api/krb5_anonymous_realm.rst.txt | 47 + .../refs/api/krb5_appdefault_boolean.rst.txt | 57 + .../appdev/refs/api/krb5_appdefault_string.rst.txt | 57 + .../appdev/refs/api/krb5_auth_con_free.rst.txt | 49 + .../appdev/refs/api/krb5_auth_con_genaddrs.rst.txt | 66 + .../api/krb5_auth_con_get_checksum_func.rst.txt | 49 + .../appdev/refs/api/krb5_auth_con_getaddrs.rst.txt | 49 + .../api/krb5_auth_con_getauthenticator.rst.txt | 51 + .../appdev/refs/api/krb5_auth_con_getflags.rst.txt | 60 + .../appdev/refs/api/krb5_auth_con_getkey.rst.txt | 51 + .../appdev/refs/api/krb5_auth_con_getkey_k.rst.txt | 51 + .../api/krb5_auth_con_getlocalseqnumber.rst.txt | 51 + .../refs/api/krb5_auth_con_getlocalsubkey.rst.txt | 46 + .../refs/api/krb5_auth_con_getrcache.rst.txt | 51 + .../refs/api/krb5_auth_con_getrecvsubkey.rst.txt | 51 + .../refs/api/krb5_auth_con_getrecvsubkey_k.rst.txt | 51 + .../api/krb5_auth_con_getremoteseqnumber.rst.txt | 51 + .../refs/api/krb5_auth_con_getremotesubkey.rst.txt | 46 + .../refs/api/krb5_auth_con_getsendsubkey.rst.txt | 51 + .../refs/api/krb5_auth_con_getsendsubkey_k.rst.txt | 51 + .../appdev/refs/api/krb5_auth_con_init.rst.txt | 57 + .../refs/api/krb5_auth_con_initivector.rst.txt | 49 + .../api/krb5_auth_con_set_checksum_func.rst.txt | 53 + .../api/krb5_auth_con_set_req_cksumtype.rst.txt | 51 + .../appdev/refs/api/krb5_auth_con_setaddrs.rst.txt | 56 + .../appdev/refs/api/krb5_auth_con_setflags.rst.txt | 60 + .../appdev/refs/api/krb5_auth_con_setports.rst.txt | 56 + .../refs/api/krb5_auth_con_setrcache.rst.txt | 51 + .../refs/api/krb5_auth_con_setrecvsubkey.rst.txt | 51 + .../refs/api/krb5_auth_con_setrecvsubkey_k.rst.txt | 55 + .../refs/api/krb5_auth_con_setsendsubkey.rst.txt | 51 + .../refs/api/krb5_auth_con_setsendsubkey_k.rst.txt | 55 + .../refs/api/krb5_auth_con_setuseruserkey.rst.txt | 47 + .../appdev/refs/api/krb5_build_principal.rst.txt | 72 + .../refs/api/krb5_build_principal_alloc_va.rst.txt | 66 + .../refs/api/krb5_build_principal_ext.rst.txt | 64 + .../refs/api/krb5_build_principal_va.rst.txt | 50 + .../appdev/refs/api/krb5_c_block_size.rst.txt | 47 + .../appdev/refs/api/krb5_c_checksum_length.rst.txt | 47 + .../appdev/refs/api/krb5_c_crypto_length.rst.txt | 49 + .../refs/api/krb5_c_crypto_length_iov.rst.txt | 53 + .../appdev/refs/api/krb5_c_decrypt.rst.txt | 65 + .../appdev/refs/api/krb5_c_decrypt_iov.rst.txt | 68 + .../appdev/refs/api/krb5_c_derive_prfplus.rst.txt | 48 + .../appdev/refs/api/krb5_c_encrypt.rst.txt | 65 + .../appdev/refs/api/krb5_c_encrypt_iov.rst.txt | 68 + .../appdev/refs/api/krb5_c_encrypt_length.rst.txt | 53 + .../appdev/refs/api/krb5_c_enctype_compare.rst.txt | 53 + .../appdev/refs/api/krb5_c_free_state.rst.txt | 47 + .../appdev/refs/api/krb5_c_fx_cf2_simple.rst.txt | 57 + .../appdev/refs/api/krb5_c_init_state.rst.txt | 49 + .../refs/api/krb5_c_is_coll_proof_cksum.rst.txt | 43 + .../appdev/refs/api/krb5_c_is_keyed_cksum.rst.txt | 43 + .../refs/api/krb5_c_keyed_checksum_types.rst.txt | 53 + .../appdev/refs/api/krb5_c_keylengths.rst.txt | 49 + .../appdev/refs/api/krb5_c_make_checksum.rst.txt | 68 + .../refs/api/krb5_c_make_checksum_iov.rst.txt | 68 + .../appdev/refs/api/krb5_c_make_random_key.rst.txt | 51 + .../appdev/refs/api/krb5_c_padding_length.rst.txt | 53 + .../_sources/appdev/refs/api/krb5_c_prf.rst.txt | 53 + .../appdev/refs/api/krb5_c_prf_length.rst.txt | 47 + .../appdev/refs/api/krb5_c_prfplus.rst.txt | 61 + .../refs/api/krb5_c_random_add_entropy.rst.txt | 46 + .../refs/api/krb5_c_random_make_octets.rst.txt | 49 + .../refs/api/krb5_c_random_os_entropy.rst.txt | 46 + .../appdev/refs/api/krb5_c_random_seed.rst.txt | 44 + .../appdev/refs/api/krb5_c_random_to_key.rst.txt | 64 + .../appdev/refs/api/krb5_c_string_to_key.rst.txt | 55 + .../api/krb5_c_string_to_key_with_params.rst.txt | 57 + .../appdev/refs/api/krb5_c_valid_cksumtype.rst.txt | 43 + .../appdev/refs/api/krb5_c_valid_enctype.rst.txt | 43 + .../appdev/refs/api/krb5_c_verify_checksum.rst.txt | 65 + .../refs/api/krb5_c_verify_checksum_iov.rst.txt | 70 + .../refs/api/krb5_calculate_checksum.rst.txt | 54 + .../appdev/refs/api/krb5_cc_cache_match.rst.txt | 56 + .../_sources/appdev/refs/api/krb5_cc_close.rst.txt | 52 + .../appdev/refs/api/krb5_cc_copy_creds.rst.txt | 47 + .../appdev/refs/api/krb5_cc_default.rst.txt | 54 + .../appdev/refs/api/krb5_cc_default_name.rst.txt | 51 + .../appdev/refs/api/krb5_cc_destroy.rst.txt | 52 + .../_sources/appdev/refs/api/krb5_cc_dup.rst.txt | 44 + .../appdev/refs/api/krb5_cc_end_seq_get.rst.txt | 54 + .../appdev/refs/api/krb5_cc_gen_new.rst.txt | 39 + .../appdev/refs/api/krb5_cc_get_config.rst.txt | 58 + .../appdev/refs/api/krb5_cc_get_flags.rst.txt | 55 + .../appdev/refs/api/krb5_cc_get_full_name.rst.txt | 52 + .../appdev/refs/api/krb5_cc_get_name.rst.txt | 53 + .../appdev/refs/api/krb5_cc_get_principal.rst.txt | 58 + .../appdev/refs/api/krb5_cc_get_type.rst.txt | 45 + .../appdev/refs/api/krb5_cc_initialize.rst.txt | 54 + .../_sources/appdev/refs/api/krb5_cc_move.rst.txt | 54 + .../appdev/refs/api/krb5_cc_new_unique.rst.txt | 52 + .../appdev/refs/api/krb5_cc_next_cred.rst.txt | 60 + .../appdev/refs/api/krb5_cc_remove_cred.rst.txt | 64 + .../appdev/refs/api/krb5_cc_resolve.rst.txt | 58 + .../appdev/refs/api/krb5_cc_retrieve_cred.rst.txt | 94 + .../appdev/refs/api/krb5_cc_select.rst.txt | 73 + .../appdev/refs/api/krb5_cc_set_config.rst.txt | 66 + .../refs/api/krb5_cc_set_default_name.rst.txt | 57 + .../appdev/refs/api/krb5_cc_set_flags.rst.txt | 51 + .../appdev/refs/api/krb5_cc_start_seq_get.rst.txt | 59 + .../appdev/refs/api/krb5_cc_store_cred.rst.txt | 54 + .../appdev/refs/api/krb5_cc_support_switch.rst.txt | 50 + .../appdev/refs/api/krb5_cc_switch.rst.txt | 52 + .../appdev/refs/api/krb5_cccol_cursor_free.rst.txt | 48 + .../appdev/refs/api/krb5_cccol_cursor_new.rst.txt | 56 + .../appdev/refs/api/krb5_cccol_cursor_next.rst.txt | 62 + .../refs/api/krb5_cccol_have_content.rst.txt | 48 + .../appdev/refs/api/krb5_change_password.rst.txt | 77 + .../appdev/refs/api/krb5_check_clockskew.rst.txt | 54 + .../appdev/refs/api/krb5_checksum_size.rst.txt | 44 + .../appdev/refs/api/krb5_chpw_message.rst.txt | 62 + .../refs/api/krb5_cksumtype_to_string.rst.txt | 47 + .../refs/api/krb5_clear_error_message.rst.txt | 40 + .../appdev/refs/api/krb5_copy_addresses.rst.txt | 51 + .../appdev/refs/api/krb5_copy_authdata.rst.txt | 59 + .../refs/api/krb5_copy_authenticator.rst.txt | 51 + .../appdev/refs/api/krb5_copy_checksum.rst.txt | 51 + .../appdev/refs/api/krb5_copy_context.rst.txt | 52 + .../appdev/refs/api/krb5_copy_creds.rst.txt | 51 + .../appdev/refs/api/krb5_copy_data.rst.txt | 51 + .../refs/api/krb5_copy_error_message.rst.txt | 42 + .../appdev/refs/api/krb5_copy_keyblock.rst.txt | 51 + .../refs/api/krb5_copy_keyblock_contents.rst.txt | 51 + .../appdev/refs/api/krb5_copy_principal.rst.txt | 51 + .../appdev/refs/api/krb5_copy_ticket.rst.txt | 51 + .../api/krb5_decode_authdata_container.rst.txt | 52 + .../appdev/refs/api/krb5_decode_ticket.rst.txt | 45 + .../_sources/appdev/refs/api/krb5_decrypt.rst.txt | 52 + .../appdev/refs/api/krb5_deltat_to_string.rst.txt | 47 + .../appdev/refs/api/krb5_eblock_enctype.rst.txt | 44 + .../api/krb5_encode_authdata_container.rst.txt | 56 + .../_sources/appdev/refs/api/krb5_encrypt.rst.txt | 52 + .../appdev/refs/api/krb5_encrypt_size.rst.txt | 44 + .../appdev/refs/api/krb5_enctype_to_name.rst.txt | 57 + .../appdev/refs/api/krb5_enctype_to_string.rst.txt | 47 + .../appdev/refs/api/krb5_expand_hostname.rst.txt | 52 + .../appdev/refs/api/krb5_find_authdata.rst.txt | 56 + .../appdev/refs/api/krb5_finish_key.rst.txt | 44 + .../appdev/refs/api/krb5_finish_random_key.rst.txt | 46 + .../appdev/refs/api/krb5_free_addresses.rst.txt | 54 + .../refs/api/krb5_free_ap_rep_enc_part.rst.txt | 42 + .../appdev/refs/api/krb5_free_authdata.rst.txt | 54 + .../refs/api/krb5_free_authenticator.rst.txt | 42 + .../appdev/refs/api/krb5_free_checksum.rst.txt | 42 + .../refs/api/krb5_free_checksum_contents.rst.txt | 42 + .../appdev/refs/api/krb5_free_cksumtypes.rst.txt | 42 + .../appdev/refs/api/krb5_free_context.rst.txt | 40 + .../refs/api/krb5_free_cred_contents.rst.txt | 42 + .../appdev/refs/api/krb5_free_creds.rst.txt | 42 + .../appdev/refs/api/krb5_free_data.rst.txt | 42 + .../refs/api/krb5_free_data_contents.rst.txt | 42 + .../refs/api/krb5_free_default_realm.rst.txt | 42 + .../appdev/refs/api/krb5_free_enctypes.rst.txt | 46 + .../appdev/refs/api/krb5_free_error.rst.txt | 42 + .../refs/api/krb5_free_error_message.rst.txt | 42 + .../appdev/refs/api/krb5_free_host_realm.rst.txt | 48 + .../appdev/refs/api/krb5_free_keyblock.rst.txt | 42 + .../refs/api/krb5_free_keyblock_contents.rst.txt | 42 + .../api/krb5_free_keytab_entry_contents.rst.txt | 53 + .../appdev/refs/api/krb5_free_principal.rst.txt | 42 + .../appdev/refs/api/krb5_free_string.rst.txt | 46 + .../appdev/refs/api/krb5_free_tgt_creds.rst.txt | 50 + .../appdev/refs/api/krb5_free_ticket.rst.txt | 42 + .../refs/api/krb5_free_unparsed_name.rst.txt | 42 + .../appdev/refs/api/krb5_fwd_tgt_creds.rst.txt | 68 + .../appdev/refs/api/krb5_get_credentials.rst.txt | 81 + .../refs/api/krb5_get_credentials_renew.rst.txt | 50 + .../refs/api/krb5_get_credentials_validate.rst.txt | 50 + .../appdev/refs/api/krb5_get_default_realm.rst.txt | 56 + .../appdev/refs/api/krb5_get_error_message.rst.txt | 62 + .../appdev/refs/api/krb5_get_etype_info.rst.txt | 72 + .../refs/api/krb5_get_fallback_host_realm.rst.txt | 52 + .../appdev/refs/api/krb5_get_host_realm.rst.txt | 63 + .../refs/api/krb5_get_in_tkt_with_keytab.rst.txt | 58 + .../refs/api/krb5_get_in_tkt_with_password.rst.txt | 58 + .../refs/api/krb5_get_in_tkt_with_skey.rst.txt | 58 + .../refs/api/krb5_get_init_creds_keytab.rst.txt | 62 + .../refs/api/krb5_get_init_creds_opt_alloc.rst.txt | 49 + .../refs/api/krb5_get_init_creds_opt_free.rst.txt | 45 + .../krb5_get_init_creds_opt_get_fast_flags.rst.txt | 47 + .../refs/api/krb5_get_init_creds_opt_init.rst.txt | 42 + ...rb5_get_init_creds_opt_set_address_list.rst.txt | 42 + .../krb5_get_init_creds_opt_set_anonymous.rst.txt | 42 + ...rb5_get_init_creds_opt_set_canonicalize.rst.txt | 42 + ...it_creds_opt_set_change_password_prompt.rst.txt | 42 + .../krb5_get_init_creds_opt_set_etype_list.rst.txt | 44 + ..._get_init_creds_opt_set_expire_callback.rst.txt | 78 + ...krb5_get_init_creds_opt_set_fast_ccache.rst.txt | 52 + ...get_init_creds_opt_set_fast_ccache_name.rst.txt | 48 + .../krb5_get_init_creds_opt_set_fast_flags.rst.txt | 51 + ...krb5_get_init_creds_opt_set_forwardable.rst.txt | 42 + .../krb5_get_init_creds_opt_set_in_ccache.rst.txt | 52 + .../krb5_get_init_creds_opt_set_out_ccache.rst.txt | 44 + .../api/krb5_get_init_creds_opt_set_pa.rst.txt | 46 + ...krb5_get_init_creds_opt_set_pac_request.rst.txt | 52 + ...rb5_get_init_creds_opt_set_preauth_list.rst.txt | 44 + .../krb5_get_init_creds_opt_set_proxiable.rst.txt | 42 + .../krb5_get_init_creds_opt_set_renew_life.rst.txt | 42 + .../krb5_get_init_creds_opt_set_responder.rst.txt | 50 + .../api/krb5_get_init_creds_opt_set_salt.rst.txt | 42 + .../krb5_get_init_creds_opt_set_tkt_life.rst.txt | 42 + .../refs/api/krb5_get_init_creds_password.rst.txt | 75 + .../refs/api/krb5_get_permitted_enctypes.rst.txt | 53 + .../appdev/refs/api/krb5_get_profile.rst.txt | 56 + .../appdev/refs/api/krb5_get_prompt_types.rst.txt | 43 + .../appdev/refs/api/krb5_get_renewed_creds.rst.txt | 62 + .../appdev/refs/api/krb5_get_server_rcache.rst.txt | 55 + .../appdev/refs/api/krb5_get_time_offsets.rst.txt | 51 + .../refs/api/krb5_get_validated_creds.rst.txt | 67 + .../appdev/refs/api/krb5_init_context.rst.txt | 58 + .../refs/api/krb5_init_context_profile.rst.txt | 55 + .../appdev/refs/api/krb5_init_creds_free.rst.txt | 42 + .../appdev/refs/api/krb5_init_creds_get.rst.txt | 53 + .../refs/api/krb5_init_creds_get_creds.rst.txt | 51 + .../refs/api/krb5_init_creds_get_error.rst.txt | 47 + .../refs/api/krb5_init_creds_get_times.rst.txt | 51 + .../appdev/refs/api/krb5_init_creds_init.rst.txt | 63 + .../refs/api/krb5_init_creds_set_keytab.rst.txt | 51 + .../refs/api/krb5_init_creds_set_password.rst.txt | 51 + .../refs/api/krb5_init_creds_set_service.rst.txt | 51 + .../appdev/refs/api/krb5_init_creds_step.rst.txt | 69 + .../appdev/refs/api/krb5_init_keyblock.rst.txt | 61 + .../appdev/refs/api/krb5_init_random_key.rst.txt | 48 + .../refs/api/krb5_init_secure_context.rst.txt | 54 + .../refs/api/krb5_is_config_principal.rst.txt | 45 + .../appdev/refs/api/krb5_is_referral_realm.rst.txt | 43 + .../appdev/refs/api/krb5_is_thread_safe.rst.txt | 43 + .../appdev/refs/api/krb5_k_create_key.rst.txt | 51 + .../appdev/refs/api/krb5_k_decrypt.rst.txt | 65 + .../appdev/refs/api/krb5_k_decrypt_iov.rst.txt | 68 + .../appdev/refs/api/krb5_k_encrypt.rst.txt | 65 + .../appdev/refs/api/krb5_k_encrypt_iov.rst.txt | 68 + .../appdev/refs/api/krb5_k_free_key.rst.txt | 39 + .../appdev/refs/api/krb5_k_key_enctype.rst.txt | 39 + .../appdev/refs/api/krb5_k_key_keyblock.rst.txt | 41 + .../appdev/refs/api/krb5_k_make_checksum.rst.txt | 68 + .../refs/api/krb5_k_make_checksum_iov.rst.txt | 68 + .../_sources/appdev/refs/api/krb5_k_prf.rst.txt | 61 + .../appdev/refs/api/krb5_k_reference_key.rst.txt | 39 + .../appdev/refs/api/krb5_k_verify_checksum.rst.txt | 65 + .../refs/api/krb5_k_verify_checksum_iov.rst.txt | 70 + .../appdev/refs/api/krb5_kdc_sign_ticket.rst.txt | 65 + .../appdev/refs/api/krb5_kdc_verify_ticket.rst.txt | 73 + .../appdev/refs/api/krb5_kt_add_entry.rst.txt | 52 + .../appdev/refs/api/krb5_kt_client_default.rst.txt | 56 + .../_sources/appdev/refs/api/krb5_kt_close.rst.txt | 45 + .../appdev/refs/api/krb5_kt_default.rst.txt | 52 + .../appdev/refs/api/krb5_kt_default_name.rst.txt | 55 + .../_sources/appdev/refs/api/krb5_kt_dup.rst.txt | 52 + .../appdev/refs/api/krb5_kt_end_seq_get.rst.txt | 54 + .../appdev/refs/api/krb5_kt_free_entry.rst.txt | 44 + .../appdev/refs/api/krb5_kt_get_entry.rst.txt | 70 + .../appdev/refs/api/krb5_kt_get_name.rst.txt | 57 + .../appdev/refs/api/krb5_kt_get_type.rst.txt | 45 + .../appdev/refs/api/krb5_kt_have_content.rst.txt | 50 + .../appdev/refs/api/krb5_kt_next_entry.rst.txt | 57 + .../refs/api/krb5_kt_read_service_key.rst.txt | 68 + .../appdev/refs/api/krb5_kt_remove_entry.rst.txt | 51 + .../appdev/refs/api/krb5_kt_resolve.rst.txt | 66 + .../appdev/refs/api/krb5_kt_start_seq_get.rst.txt | 54 + .../_sources/appdev/refs/api/krb5_kuserok.rst.txt | 51 + .../refs/api/krb5_make_authdata_kdc_issued.rst.txt | 48 + .../refs/api/krb5_marshal_credentials.rst.txt | 55 + .../appdev/refs/api/krb5_merge_authdata.rst.txt | 61 + .../_sources/appdev/refs/api/krb5_mk_1cred.rst.txt | 60 + .../_sources/appdev/refs/api/krb5_mk_error.rst.txt | 51 + .../_sources/appdev/refs/api/krb5_mk_ncred.rst.txt | 88 + .../_sources/appdev/refs/api/krb5_mk_priv.rst.txt | 79 + .../_sources/appdev/refs/api/krb5_mk_rep.rst.txt | 59 + .../appdev/refs/api/krb5_mk_rep_dce.rst.txt | 51 + .../_sources/appdev/refs/api/krb5_mk_req.rst.txt | 65 + .../appdev/refs/api/krb5_mk_req_extended.rst.txt | 74 + .../_sources/appdev/refs/api/krb5_mk_safe.rst.txt | 83 + .../appdev/refs/api/krb5_os_localaddr.rst.txt | 49 + .../appdev/refs/api/krb5_pac_add_buffer.rst.txt | 75 + .../_sources/appdev/refs/api/krb5_pac_free.rst.txt | 42 + .../appdev/refs/api/krb5_pac_get_buffer.rst.txt | 53 + .../refs/api/krb5_pac_get_client_info.rst.txt | 57 + .../appdev/refs/api/krb5_pac_get_types.rst.txt | 49 + .../_sources/appdev/refs/api/krb5_pac_init.rst.txt | 49 + .../appdev/refs/api/krb5_pac_parse.rst.txt | 53 + .../_sources/appdev/refs/api/krb5_pac_sign.rst.txt | 54 + .../appdev/refs/api/krb5_pac_sign_ext.rst.txt | 56 + .../appdev/refs/api/krb5_pac_verify.rst.txt | 69 + .../appdev/refs/api/krb5_pac_verify_ext.rst.txt | 60 + .../appdev/refs/api/krb5_parse_name.rst.txt | 78 + .../appdev/refs/api/krb5_parse_name_flags.rst.txt | 77 + .../refs/api/krb5_prepend_error_message.rst.txt | 44 + .../appdev/refs/api/krb5_principal2salt.rst.txt | 47 + .../appdev/refs/api/krb5_principal_compare.rst.txt | 47 + .../api/krb5_principal_compare_any_realm.rst.txt | 51 + .../refs/api/krb5_principal_compare_flags.rst.txt | 65 + .../appdev/refs/api/krb5_process_key.rst.txt | 46 + .../appdev/refs/api/krb5_prompter_posix.rst.txt | 64 + .../appdev/refs/api/krb5_random_key.rst.txt | 48 + .../_sources/appdev/refs/api/krb5_rd_cred.rst.txt | 67 + .../_sources/appdev/refs/api/krb5_rd_error.rst.txt | 51 + .../_sources/appdev/refs/api/krb5_rd_priv.rst.txt | 79 + .../_sources/appdev/refs/api/krb5_rd_rep.rst.txt | 57 + .../appdev/refs/api/krb5_rd_rep_dce.rst.txt | 53 + .../_sources/appdev/refs/api/krb5_rd_req.rst.txt | 105 + .../_sources/appdev/refs/api/krb5_rd_safe.rst.txt | 79 + .../appdev/refs/api/krb5_read_password.rst.txt | 71 + .../appdev/refs/api/krb5_realm_compare.rst.txt | 47 + .../_sources/appdev/refs/api/krb5_recvauth.rst.txt | 68 + .../appdev/refs/api/krb5_recvauth_version.rst.txt | 61 + .../refs/api/krb5_responder_get_challenge.rst.txt | 52 + .../refs/api/krb5_responder_list_questions.rst.txt | 50 + .../api/krb5_responder_otp_challenge_free.rst.txt | 48 + .../api/krb5_responder_otp_get_challenge.rst.txt | 56 + .../refs/api/krb5_responder_otp_set_answer.rst.txt | 52 + .../krb5_responder_pkinit_challenge_free.rst.txt | 48 + .../krb5_responder_pkinit_get_challenge.rst.txt | 56 + .../api/krb5_responder_pkinit_set_answer.rst.txt | 50 + .../refs/api/krb5_responder_set_answer.rst.txt | 57 + .../refs/api/krb5_salttype_to_string.rst.txt | 47 + .../_sources/appdev/refs/api/krb5_sendauth.rst.txt | 98 + .../api/krb5_server_decrypt_ticket_keytab.rst.txt | 51 + .../appdev/refs/api/krb5_set_default_realm.rst.txt | 52 + .../refs/api/krb5_set_default_tgs_enctypes.rst.txt | 61 + .../appdev/refs/api/krb5_set_error_message.rst.txt | 44 + .../appdev/refs/api/krb5_set_kdc_recv_hook.rst.txt | 52 + .../appdev/refs/api/krb5_set_kdc_send_hook.rst.txt | 52 + .../appdev/refs/api/krb5_set_password.rst.txt | 74 + .../api/krb5_set_password_using_ccache.rst.txt | 74 + .../refs/api/krb5_set_principal_realm.rst.txt | 54 + .../appdev/refs/api/krb5_set_real_time.rst.txt | 51 + .../refs/api/krb5_set_trace_callback.rst.txt | 63 + .../refs/api/krb5_set_trace_filename.rst.txt | 61 + .../appdev/refs/api/krb5_sname_match.rst.txt | 59 + .../refs/api/krb5_sname_to_principal.rst.txt | 74 + .../refs/api/krb5_string_to_cksumtype.rst.txt | 45 + .../appdev/refs/api/krb5_string_to_deltat.rst.txt | 45 + .../appdev/refs/api/krb5_string_to_enctype.rst.txt | 45 + .../appdev/refs/api/krb5_string_to_key.rst.txt | 50 + .../refs/api/krb5_string_to_salttype.rst.txt | 45 + .../refs/api/krb5_string_to_timestamp.rst.txt | 45 + .../appdev/refs/api/krb5_timeofday.rst.txt | 52 + .../refs/api/krb5_timestamp_to_sfstring.rst.txt | 53 + .../refs/api/krb5_timestamp_to_string.rst.txt | 51 + .../appdev/refs/api/krb5_tkt_creds_free.rst.txt | 46 + .../appdev/refs/api/krb5_tkt_creds_get.rst.txt | 53 + .../refs/api/krb5_tkt_creds_get_creds.rst.txt | 55 + .../refs/api/krb5_tkt_creds_get_times.rst.txt | 55 + .../appdev/refs/api/krb5_tkt_creds_init.rst.txt | 67 + .../appdev/refs/api/krb5_tkt_creds_step.rst.txt | 69 + .../refs/api/krb5_unmarshal_credentials.rst.txt | 55 + .../appdev/refs/api/krb5_unparse_name.rst.txt | 58 + .../appdev/refs/api/krb5_unparse_name_ext.rst.txt | 60 + .../refs/api/krb5_unparse_name_flags.rst.txt | 70 + .../refs/api/krb5_unparse_name_flags_ext.rst.txt | 54 + .../appdev/refs/api/krb5_us_timeofday.rst.txt | 54 + .../appdev/refs/api/krb5_use_enctype.rst.txt | 46 + .../api/krb5_verify_authdata_kdc_issued.rst.txt | 48 + .../appdev/refs/api/krb5_verify_checksum.rst.txt | 54 + .../appdev/refs/api/krb5_verify_init_creds.rst.txt | 65 + .../api/krb5_verify_init_creds_opt_init.rst.txt | 40 + ...verify_init_creds_opt_set_ap_req_nofail.rst.txt | 46 + .../refs/api/krb5_vprepend_error_message.rst.txt | 46 + .../refs/api/krb5_vset_error_message.rst.txt | 46 + .../refs/api/krb5_vwrap_error_message.rst.txt | 48 + .../refs/api/krb5_wrap_error_message.rst.txt | 46 + .../doc/html/_sources/appdev/refs/index.rst.txt | 9 + .../appdev/refs/macros/ADDRTYPE_ADDRPORT.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_CHAOS.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_DDP.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_INET.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_INET6.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_IPPORT.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_ISO.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_IS_LOCAL.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_NETBIOS.rst.txt | 17 + .../appdev/refs/macros/ADDRTYPE_XNS.rst.txt | 17 + .../appdev/refs/macros/AD_TYPE_EXTERNAL.rst.txt | 17 + .../refs/macros/AD_TYPE_FIELD_TYPE_MASK.rst.txt | 17 + .../appdev/refs/macros/AD_TYPE_REGISTERED.rst.txt | 17 + .../appdev/refs/macros/AD_TYPE_RESERVED.rst.txt | 17 + .../refs/macros/AP_OPTS_ETYPE_NEGOTIATION.rst.txt | 17 + .../refs/macros/AP_OPTS_MUTUAL_REQUIRED.rst.txt | 18 + .../appdev/refs/macros/AP_OPTS_RESERVED.rst.txt | 17 + .../refs/macros/AP_OPTS_USE_SESSION_KEY.rst.txt | 18 + .../appdev/refs/macros/AP_OPTS_USE_SUBKEY.rst.txt | 18 + .../appdev/refs/macros/AP_OPTS_WIRE_MASK.rst.txt | 17 + .../refs/macros/CKSUMTYPE_CMAC_CAMELLIA128.rst.txt | 18 + .../refs/macros/CKSUMTYPE_CMAC_CAMELLIA256.rst.txt | 18 + .../appdev/refs/macros/CKSUMTYPE_CRC32.rst.txt | 17 + .../appdev/refs/macros/CKSUMTYPE_DESCBC.rst.txt | 17 + .../refs/macros/CKSUMTYPE_HMAC_MD5_ARCFOUR.rst.txt | 18 + .../macros/CKSUMTYPE_HMAC_SHA1_96_AES128.rst.txt | 18 + .../macros/CKSUMTYPE_HMAC_SHA1_96_AES256.rst.txt | 18 + .../refs/macros/CKSUMTYPE_HMAC_SHA1_DES3.rst.txt | 17 + .../CKSUMTYPE_HMAC_SHA256_128_AES128.rst.txt | 18 + .../CKSUMTYPE_HMAC_SHA384_192_AES256.rst.txt | 18 + .../refs/macros/CKSUMTYPE_MD5_HMAC_ARCFOUR.rst.txt | 17 + .../appdev/refs/macros/CKSUMTYPE_NIST_SHA.rst.txt | 17 + .../appdev/refs/macros/CKSUMTYPE_RSA_MD4.rst.txt | 17 + .../refs/macros/CKSUMTYPE_RSA_MD4_DES.rst.txt | 17 + .../appdev/refs/macros/CKSUMTYPE_RSA_MD5.rst.txt | 17 + .../refs/macros/CKSUMTYPE_RSA_MD5_DES.rst.txt | 17 + .../appdev/refs/macros/CKSUMTYPE_SHA1.rst.txt | 18 + .../macros/ENCTYPE_AES128_CTS_HMAC_SHA1_96.rst.txt | 18 + .../ENCTYPE_AES128_CTS_HMAC_SHA256_128.rst.txt | 18 + .../macros/ENCTYPE_AES256_CTS_HMAC_SHA1_96.rst.txt | 18 + .../ENCTYPE_AES256_CTS_HMAC_SHA384_192.rst.txt | 18 + .../refs/macros/ENCTYPE_ARCFOUR_HMAC.rst.txt | 18 + .../refs/macros/ENCTYPE_ARCFOUR_HMAC_EXP.rst.txt | 18 + .../macros/ENCTYPE_CAMELLIA128_CTS_CMAC.rst.txt | 18 + .../macros/ENCTYPE_CAMELLIA256_CTS_CMAC.rst.txt | 18 + .../refs/macros/ENCTYPE_DES3_CBC_ENV.rst.txt | 18 + .../refs/macros/ENCTYPE_DES3_CBC_RAW.rst.txt | 17 + .../refs/macros/ENCTYPE_DES3_CBC_SHA.rst.txt | 17 + .../refs/macros/ENCTYPE_DES3_CBC_SHA1.rst.txt | 17 + .../appdev/refs/macros/ENCTYPE_DES_CBC_CRC.rst.txt | 17 + .../appdev/refs/macros/ENCTYPE_DES_CBC_MD4.rst.txt | 17 + .../appdev/refs/macros/ENCTYPE_DES_CBC_MD5.rst.txt | 17 + .../appdev/refs/macros/ENCTYPE_DES_CBC_RAW.rst.txt | 17 + .../refs/macros/ENCTYPE_DES_HMAC_SHA1.rst.txt | 17 + .../refs/macros/ENCTYPE_DSA_SHA1_CMS.rst.txt | 18 + .../appdev/refs/macros/ENCTYPE_MD5_RSA_CMS.rst.txt | 18 + .../appdev/refs/macros/ENCTYPE_NULL.rst.txt | 17 + .../appdev/refs/macros/ENCTYPE_RC2_CBC_ENV.rst.txt | 18 + .../appdev/refs/macros/ENCTYPE_RSA_ENV.rst.txt | 18 + .../refs/macros/ENCTYPE_RSA_ES_OAEP_ENV.rst.txt | 18 + .../refs/macros/ENCTYPE_SHA1_RSA_CMS.rst.txt | 18 + .../appdev/refs/macros/ENCTYPE_UNKNOWN.rst.txt | 17 + .../refs/macros/KDC_OPT_ALLOW_POSTDATE.rst.txt | 17 + .../refs/macros/KDC_OPT_CANONICALIZE.rst.txt | 17 + .../refs/macros/KDC_OPT_CNAME_IN_ADDL_TKT.rst.txt | 17 + .../macros/KDC_OPT_DISABLE_TRANSITED_CHECK.rst.txt | 17 + .../refs/macros/KDC_OPT_ENC_TKT_IN_SKEY.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_FORWARDABLE.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_FORWARDED.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_POSTDATED.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_PROXIABLE.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_PROXY.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_RENEW.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_RENEWABLE.rst.txt | 17 + .../refs/macros/KDC_OPT_RENEWABLE_OK.rst.txt | 17 + .../refs/macros/KDC_OPT_REQUEST_ANONYMOUS.rst.txt | 17 + .../appdev/refs/macros/KDC_OPT_VALIDATE.rst.txt | 17 + .../appdev/refs/macros/KDC_TKT_COMMON_MASK.rst.txt | 17 + .../KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE.rst.txt | 18 + .../refs/macros/KRB5_ANONYMOUS_PRINCSTR.rst.txt | 18 + .../refs/macros/KRB5_ANONYMOUS_REALMSTR.rst.txt | 18 + .../appdev/refs/macros/KRB5_AP_REP.rst.txt | 18 + .../appdev/refs/macros/KRB5_AP_REQ.rst.txt | 18 + .../appdev/refs/macros/KRB5_AS_REP.rst.txt | 18 + .../appdev/refs/macros/KRB5_AS_REQ.rst.txt | 18 + .../refs/macros/KRB5_AUTHDATA_AND_OR.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_AP_OPTIONS.rst.txt | 17 + .../macros/KRB5_AUTHDATA_AUTH_INDICATOR.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_CAMMAC.rst.txt | 17 + .../macros/KRB5_AUTHDATA_ETYPE_NEGOTIATION.rst.txt | 18 + .../refs/macros/KRB5_AUTHDATA_FX_ARMOR.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_IF_RELEVANT.rst.txt | 17 + .../KRB5_AUTHDATA_INITIAL_VERIFIED_CAS.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_KDC_ISSUED.rst.txt | 17 + .../macros/KRB5_AUTHDATA_MANDATORY_FOR_KDC.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_OSF_DCE.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_SESAME.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_SIGNTICKET.rst.txt | 17 + .../refs/macros/KRB5_AUTHDATA_WIN2K_PAC.rst.txt | 17 + .../macros/KRB5_AUTH_CONTEXT_DO_SEQUENCE.rst.txt | 18 + .../refs/macros/KRB5_AUTH_CONTEXT_DO_TIME.rst.txt | 18 + .../KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR.rst.txt | 18 + ...5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR.rst.txt | 18 + .../KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR.rst.txt | 18 + ..._AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR.rst.txt | 18 + .../macros/KRB5_AUTH_CONTEXT_PERMIT_ALL.rst.txt | 17 + .../macros/KRB5_AUTH_CONTEXT_RET_SEQUENCE.rst.txt | 18 + .../refs/macros/KRB5_AUTH_CONTEXT_RET_TIME.rst.txt | 18 + .../macros/KRB5_AUTH_CONTEXT_USE_SUBKEY.rst.txt | 17 + .../_sources/appdev/refs/macros/KRB5_CRED.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_CHECKSUM.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_DATA.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_EMPTY.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_HEADER.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_PADDING.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_SIGN_ONLY.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_STREAM.rst.txt | 18 + .../refs/macros/KRB5_CRYPTO_TYPE_TRAILER.rst.txt | 18 + .../refs/macros/KRB5_CYBERSAFE_SECUREID.rst.txt | 18 + .../refs/macros/KRB5_DOMAIN_X500_COMPRESS.rst.txt | 18 + .../macros/KRB5_ENCPADATA_REQ_ENC_PA_REP.rst.txt | 18 + .../_sources/appdev/refs/macros/KRB5_ERROR.rst.txt | 18 + .../appdev/refs/macros/KRB5_FAST_REQUIRED.rst.txt | 18 + .../appdev/refs/macros/KRB5_GC_CACHED.rst.txt | 18 + .../refs/macros/KRB5_GC_CANONICALIZE.rst.txt | 18 + .../macros/KRB5_GC_CONSTRAINED_DELEGATION.rst.txt | 18 + .../appdev/refs/macros/KRB5_GC_FORWARDABLE.rst.txt | 18 + .../appdev/refs/macros/KRB5_GC_NO_STORE.rst.txt | 18 + .../refs/macros/KRB5_GC_NO_TRANSIT_CHECK.rst.txt | 18 + .../appdev/refs/macros/KRB5_GC_USER_USER.rst.txt | 18 + .../KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_ANONYMOUS.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_CANONICALIZE.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_FORWARDABLE.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_PROXIABLE.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE.rst.txt | 17 + .../macros/KRB5_GET_INIT_CREDS_OPT_SALT.rst.txt | 17 + .../KRB5_GET_INIT_CREDS_OPT_TKT_LIFE.rst.txt | 17 + .../refs/macros/KRB5_INIT_CONTEXT_KDC.rst.txt | 18 + .../refs/macros/KRB5_INIT_CONTEXT_SECURE.rst.txt | 18 + .../KRB5_INIT_CREDS_STEP_FLAG_CONTINUE.rst.txt | 18 + .../appdev/refs/macros/KRB5_INT16_MAX.rst.txt | 17 + .../appdev/refs/macros/KRB5_INT16_MIN.rst.txt | 17 + .../appdev/refs/macros/KRB5_INT32_MAX.rst.txt | 17 + .../appdev/refs/macros/KRB5_INT32_MIN.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_AD_ITE.rst.txt | 17 + .../KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_AD_MTE.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_AD_SIGNEDPATH.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_APP_DATA_CKSUM.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_APP_DATA_ENCRYPT.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_AP_REP_ENCPART.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_AP_REQ_AUTH.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_AS_REP_ENCPART.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_AS_REQ.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_CAMMAC.rst.txt | 17 + .../KRB5_KEYUSAGE_ENC_CHALLENGE_CLIENT.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_ENC_CHALLENGE_KDC.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_FAST_ENC.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_FAST_FINISHED.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_FAST_REP.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_FAST_REQ_CHKSUM.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_GSS_TOK_MIC.rst.txt | 17 + .../KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_IAKERB_FINISHED.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_KDC_REP_TICKET.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_KRB_CRED_ENCPART.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_KRB_ERROR_CKSUM.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_KRB_PRIV_ENCPART.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_KRB_SAFE_CKSUM.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_PA_AS_FRESHNESS.rst.txt | 18 + .../refs/macros/KRB5_KEYUSAGE_PA_FX_COOKIE.rst.txt | 18 + .../macros/KRB5_KEYUSAGE_PA_OTP_REQUEST.rst.txt | 18 + .../refs/macros/KRB5_KEYUSAGE_PA_PKINIT_KX.rst.txt | 17 + .../KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY.rst.txt | 17 + .../KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST.rst.txt | 17 + .../KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM.rst.txt | 17 + .../KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_PA_SAM_RESPONSE.rst.txt | 17 + .../appdev/refs/macros/KRB5_KEYUSAGE_SPAKE.rst.txt | 17 + .../KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY.rst.txt | 17 + .../KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY.rst.txt | 17 + .../KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY.rst.txt | 17 + .../macros/KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY.rst.txt | 17 + .../refs/macros/KRB5_KEYUSAGE_TGS_REQ_AUTH.rst.txt | 17 + .../KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM.rst.txt | 17 + .../refs/macros/KRB5_KPASSWD_ACCESSDENIED.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_AUTHERROR.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_BAD_VERSION.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_HARDERROR.rst.txt | 18 + .../KRB5_KPASSWD_INITIAL_FLAG_NEEDED.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_MALFORMED.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_SOFTERROR.rst.txt | 18 + .../refs/macros/KRB5_KPASSWD_SUCCESS.rst.txt | 18 + .../refs/macros/KRB5_LRQ_ALL_ACCT_EXPTIME.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ALL_LAST_INITIAL.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ALL_LAST_RENEWAL.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ALL_LAST_REQ.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ALL_LAST_TGT.rst.txt | 17 + .../macros/KRB5_LRQ_ALL_LAST_TGT_ISSUED.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ALL_PW_EXPTIME.rst.txt | 17 + .../appdev/refs/macros/KRB5_LRQ_NONE.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_ACCT_EXPTIME.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_LAST_INITIAL.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_LAST_RENEWAL.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_LAST_REQ.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_LAST_TGT.rst.txt | 17 + .../macros/KRB5_LRQ_ONE_LAST_TGT_ISSUED.rst.txt | 17 + .../refs/macros/KRB5_LRQ_ONE_PW_EXPTIME.rst.txt | 17 + .../macros/KRB5_NT_ENTERPRISE_PRINCIPAL.rst.txt | 18 + .../macros/KRB5_NT_ENT_PRINCIPAL_AND_ID.rst.txt | 18 + .../refs/macros/KRB5_NT_MS_PRINCIPAL.rst.txt | 18 + .../macros/KRB5_NT_MS_PRINCIPAL_AND_ID.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_PRINCIPAL.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_SMTP_NAME.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_SRV_HST.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_SRV_INST.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_SRV_XHST.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_UID.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_UNKNOWN.rst.txt | 18 + .../appdev/refs/macros/KRB5_NT_WELLKNOWN.rst.txt | 18 + .../refs/macros/KRB5_NT_X500_PRINCIPAL.rst.txt | 18 + .../refs/macros/KRB5_PAC_ATTRIBUTES_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_CLIENT_CLAIMS.rst.txt | 18 + .../refs/macros/KRB5_PAC_CLIENT_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_CREDENTIALS_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_DELEGATION_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_DEVICE_CLAIMS.rst.txt | 18 + .../refs/macros/KRB5_PAC_DEVICE_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_FULL_CHECKSUM.rst.txt | 18 + .../appdev/refs/macros/KRB5_PAC_LOGON_INFO.rst.txt | 18 + .../refs/macros/KRB5_PAC_PRIVSVR_CHECKSUM.rst.txt | 18 + .../appdev/refs/macros/KRB5_PAC_REQUESTOR.rst.txt | 18 + .../refs/macros/KRB5_PAC_SERVER_CHECKSUM.rst.txt | 18 + .../refs/macros/KRB5_PAC_TICKET_CHECKSUM.rst.txt | 18 + .../refs/macros/KRB5_PAC_UPN_DNS_INFO.rst.txt | 18 + .../refs/macros/KRB5_PADATA_AFS3_SALT.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_AP_REQ.rst.txt | 17 + .../refs/macros/KRB5_PADATA_AS_CHECKSUM.rst.txt | 18 + .../refs/macros/KRB5_PADATA_AS_FRESHNESS.rst.txt | 18 + .../macros/KRB5_PADATA_ENCRYPTED_CHALLENGE.rst.txt | 18 + .../macros/KRB5_PADATA_ENC_SANDIA_SECURID.rst.txt | 18 + .../refs/macros/KRB5_PADATA_ENC_TIMESTAMP.rst.txt | 18 + .../refs/macros/KRB5_PADATA_ENC_UNIX_TIME.rst.txt | 18 + .../refs/macros/KRB5_PADATA_ETYPE_INFO.rst.txt | 18 + .../refs/macros/KRB5_PADATA_ETYPE_INFO2.rst.txt | 18 + .../refs/macros/KRB5_PADATA_FOR_USER.rst.txt | 18 + .../refs/macros/KRB5_PADATA_FX_COOKIE.rst.txt | 18 + .../refs/macros/KRB5_PADATA_FX_ERROR.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_FX_FAST.rst.txt | 18 + .../macros/KRB5_PADATA_GET_FROM_TYPED_DATA.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_NONE.rst.txt | 17 + .../appdev/refs/macros/KRB5_PADATA_OSF_DCE.rst.txt | 18 + .../refs/macros/KRB5_PADATA_OTP_CHALLENGE.rst.txt | 18 + .../refs/macros/KRB5_PADATA_OTP_PIN_CHANGE.rst.txt | 18 + .../refs/macros/KRB5_PADATA_OTP_REQUEST.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PAC_OPTIONS.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PAC_REQUEST.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PKINIT_KX.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PK_AS_REP.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PK_AS_REP_OLD.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PK_AS_REQ.rst.txt | 18 + .../refs/macros/KRB5_PADATA_PK_AS_REQ_OLD.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_PW_SALT.rst.txt | 18 + .../macros/KRB5_PADATA_REDHAT_IDP_OAUTH2.rst.txt | 18 + .../refs/macros/KRB5_PADATA_REDHAT_PASSKEY.rst.txt | 18 + .../refs/macros/KRB5_PADATA_REFERRAL.rst.txt | 18 + .../refs/macros/KRB5_PADATA_S4U_X509_USER.rst.txt | 18 + .../refs/macros/KRB5_PADATA_SAM_CHALLENGE.rst.txt | 18 + .../macros/KRB5_PADATA_SAM_CHALLENGE_2.rst.txt | 18 + .../refs/macros/KRB5_PADATA_SAM_REDIRECT.rst.txt | 18 + .../refs/macros/KRB5_PADATA_SAM_RESPONSE.rst.txt | 18 + .../refs/macros/KRB5_PADATA_SAM_RESPONSE_2.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_SESAME.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_SPAKE.rst.txt | 17 + .../macros/KRB5_PADATA_SVR_REFERRAL_INFO.rst.txt | 18 + .../appdev/refs/macros/KRB5_PADATA_TGS_REQ.rst.txt | 17 + .../macros/KRB5_PADATA_USE_SPECIFIED_KVNO.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_COMPARE_CASEFOLD.rst.txt | 18 + .../KRB5_PRINCIPAL_COMPARE_ENTERPRISE.rst.txt | 18 + .../KRB5_PRINCIPAL_COMPARE_IGNORE_REALM.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_COMPARE_UTF8.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_PARSE_ENTERPRISE.rst.txt | 18 + .../KRB5_PRINCIPAL_PARSE_IGNORE_REALM.rst.txt | 18 + .../KRB5_PRINCIPAL_PARSE_NO_DEF_REALM.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_PARSE_NO_REALM.rst.txt | 18 + .../KRB5_PRINCIPAL_PARSE_REQUIRE_REALM.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_UNPARSE_DISPLAY.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_UNPARSE_NO_REALM.rst.txt | 18 + .../macros/KRB5_PRINCIPAL_UNPARSE_SHORT.rst.txt | 18 + .../_sources/appdev/refs/macros/KRB5_PRIV.rst.txt | 18 + .../macros/KRB5_PROMPT_TYPE_NEW_PASSWORD.rst.txt | 18 + .../KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN.rst.txt | 18 + .../refs/macros/KRB5_PROMPT_TYPE_PASSWORD.rst.txt | 18 + .../refs/macros/KRB5_PROMPT_TYPE_PREAUTH.rst.txt | 18 + .../_sources/appdev/refs/macros/KRB5_PVNO.rst.txt | 18 + .../refs/macros/KRB5_REALM_BRANCH_CHAR.rst.txt | 17 + .../refs/macros/KRB5_RECVAUTH_BADAUTHVERS.rst.txt | 17 + .../refs/macros/KRB5_RECVAUTH_SKIP_VERSION.rst.txt | 17 + .../appdev/refs/macros/KRB5_REFERRAL_REALM.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FLAGS_NEXTOTP.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FORMAT_ALPHANUMERIC.rst.txt | 17 + .../KRB5_RESPONDER_OTP_FORMAT_DECIMAL.rst.txt | 18 + .../KRB5_RESPONDER_OTP_FORMAT_HEXADECIMAL.rst.txt | 17 + ...R_PKINIT_FLAGS_TOKEN_USER_PIN_COUNT_LOW.rst.txt | 18 + ...R_PKINIT_FLAGS_TOKEN_USER_PIN_FINAL_TRY.rst.txt | 18 + ...NDER_PKINIT_FLAGS_TOKEN_USER_PIN_LOCKED.rst.txt | 18 + .../macros/KRB5_RESPONDER_QUESTION_OTP.rst.txt | 47 + .../KRB5_RESPONDER_QUESTION_PASSWORD.rst.txt | 19 + .../macros/KRB5_RESPONDER_QUESTION_PKINIT.rst.txt | 34 + .../_sources/appdev/refs/macros/KRB5_SAFE.rst.txt | 18 + .../macros/KRB5_SAM_MUST_PK_ENCRYPT_SAD.rst.txt | 18 + .../macros/KRB5_SAM_SEND_ENCRYPTED_SAD.rst.txt | 17 + .../refs/macros/KRB5_SAM_USE_SAD_AS_KEY.rst.txt | 17 + .../refs/macros/KRB5_TC_MATCH_2ND_TKT.rst.txt | 18 + .../refs/macros/KRB5_TC_MATCH_AUTHDATA.rst.txt | 18 + .../appdev/refs/macros/KRB5_TC_MATCH_FLAGS.rst.txt | 18 + .../refs/macros/KRB5_TC_MATCH_FLAGS_EXACT.rst.txt | 18 + .../refs/macros/KRB5_TC_MATCH_IS_SKEY.rst.txt | 18 + .../appdev/refs/macros/KRB5_TC_MATCH_KTYPE.rst.txt | 18 + .../refs/macros/KRB5_TC_MATCH_SRV_NAMEONLY.rst.txt | 18 + .../appdev/refs/macros/KRB5_TC_MATCH_TIMES.rst.txt | 18 + .../refs/macros/KRB5_TC_MATCH_TIMES_EXACT.rst.txt | 18 + .../appdev/refs/macros/KRB5_TC_NOTICKET.rst.txt | 17 + .../appdev/refs/macros/KRB5_TC_OPENCLOSE.rst.txt | 18 + .../refs/macros/KRB5_TC_SUPPORTED_KTYPES.rst.txt | 18 + .../appdev/refs/macros/KRB5_TGS_NAME.rst.txt | 17 + .../appdev/refs/macros/KRB5_TGS_NAME_SIZE.rst.txt | 17 + .../appdev/refs/macros/KRB5_TGS_REP.rst.txt | 18 + .../appdev/refs/macros/KRB5_TGS_REQ.rst.txt | 18 + .../KRB5_TKT_CREDS_STEP_FLAG_CONTINUE.rst.txt | 18 + ...RB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL.rst.txt | 17 + .../refs/macros/KRB5_WELLKNOWN_NAMESTR.rst.txt | 18 + .../macros/LR_TYPE_INTERPRETATION_MASK.rst.txt | 17 + .../refs/macros/LR_TYPE_THIS_SERVER_ONLY.rst.txt | 17 + .../appdev/refs/macros/MAX_KEYTAB_NAME_LEN.rst.txt | 18 + .../appdev/refs/macros/MSEC_DIRBIT.rst.txt | 17 + .../appdev/refs/macros/MSEC_VAL_MASK.rst.txt | 17 + .../refs/macros/SALT_TYPE_AFS_LENGTH.rst.txt | 17 + .../appdev/refs/macros/SALT_TYPE_NO_LENGTH.rst.txt | 17 + .../appdev/refs/macros/THREEPARAMOPEN.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_ANONYMOUS.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_ENC_PA_REP.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_FORWARDABLE.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_FORWARDED.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_HW_AUTH.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_INITIAL.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_INVALID.rst.txt | 17 + .../refs/macros/TKT_FLG_MAY_POSTDATE.rst.txt | 17 + .../refs/macros/TKT_FLG_OK_AS_DELEGATE.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_POSTDATED.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_PRE_AUTH.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_PROXIABLE.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_PROXY.rst.txt | 17 + .../appdev/refs/macros/TKT_FLG_RENEWABLE.rst.txt | 17 + .../macros/TKT_FLG_TRANSIT_POLICY_CHECKED.rst.txt | 17 + .../appdev/refs/macros/VALID_INT_BITS.rst.txt | 17 + .../appdev/refs/macros/VALID_UINT_BITS.rst.txt | 17 + .../html/_sources/appdev/refs/macros/index.rst.txt | 397 + .../refs/macros/krb524_convert_creds_kdc.rst.txt | 17 + .../appdev/refs/macros/krb524_init_ets.rst.txt | 17 + .../_sources/appdev/refs/macros/krb5_const.rst.txt | 17 + .../refs/macros/krb5_princ_component.rst.txt | 17 + .../appdev/refs/macros/krb5_princ_name.rst.txt | 17 + .../appdev/refs/macros/krb5_princ_realm.rst.txt | 17 + .../refs/macros/krb5_princ_set_realm.rst.txt | 17 + .../refs/macros/krb5_princ_set_realm_data.rst.txt | 17 + .../macros/krb5_princ_set_realm_length.rst.txt | 17 + .../appdev/refs/macros/krb5_princ_size.rst.txt | 17 + .../appdev/refs/macros/krb5_princ_type.rst.txt | 17 + .../appdev/refs/macros/krb5_roundup.rst.txt | 17 + .../_sources/appdev/refs/macros/krb5_x.rst.txt | 17 + .../_sources/appdev/refs/macros/krb5_xc.rst.txt | 17 + .../html/_sources/appdev/refs/types/index.rst.txt | 108 + .../appdev/refs/types/krb5_address.rst.txt | 45 + .../appdev/refs/types/krb5_addrtype.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_ap_rep.rst.txt | 35 + .../appdev/refs/types/krb5_ap_rep_enc_part.rst.txt | 50 + .../_sources/appdev/refs/types/krb5_ap_req.rst.txt | 45 + .../appdev/refs/types/krb5_auth_context.rst.txt | 20 + .../appdev/refs/types/krb5_authdata.rst.txt | 45 + .../appdev/refs/types/krb5_authdatatype.rst.txt | 20 + .../appdev/refs/types/krb5_authenticator.rst.txt | 65 + .../appdev/refs/types/krb5_boolean.rst.txt | 20 + .../appdev/refs/types/krb5_cc_cursor.rst.txt | 21 + .../_sources/appdev/refs/types/krb5_ccache.rst.txt | 20 + .../appdev/refs/types/krb5_cccol_cursor.rst.txt | 21 + .../appdev/refs/types/krb5_checksum.rst.txt | 44 + .../appdev/refs/types/krb5_cksumtype.rst.txt | 20 + .../appdev/refs/types/krb5_const_pointer.rst.txt | 20 + .../appdev/refs/types/krb5_const_principal.rst.txt | 50 + .../appdev/refs/types/krb5_context.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_cred.rst.txt | 45 + .../appdev/refs/types/krb5_cred_enc_part.rst.txt | 60 + .../appdev/refs/types/krb5_cred_info.rst.txt | 60 + .../_sources/appdev/refs/types/krb5_creds.rst.txt | 80 + .../appdev/refs/types/krb5_crypto_iov.rst.txt | 35 + .../appdev/refs/types/krb5_cryptotype.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_data.rst.txt | 39 + .../_sources/appdev/refs/types/krb5_deltat.rst.txt | 20 + .../appdev/refs/types/krb5_enc_data.rst.txt | 44 + .../refs/types/krb5_enc_kdc_rep_part.rst.txt | 80 + .../appdev/refs/types/krb5_enc_tkt_part.rst.txt | 65 + .../appdev/refs/types/krb5_encrypt_block.rst.txt | 39 + .../appdev/refs/types/krb5_enctype.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_error.rst.txt | 75 + .../appdev/refs/types/krb5_error_code.rst.txt | 21 + .../refs/types/krb5_expire_callback_func.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_flags.rst.txt | 20 + .../refs/types/krb5_get_init_creds_opt.rst.txt | 80 + .../appdev/refs/types/krb5_gic_opt_pa_data.rst.txt | 35 + .../refs/types/krb5_init_creds_context.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_int16.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_int32.rst.txt | 20 + .../appdev/refs/types/krb5_kdc_rep.rst.txt | 60 + .../appdev/refs/types/krb5_kdc_req.rst.txt | 105 + .../_sources/appdev/refs/types/krb5_key.rst.txt | 21 + .../appdev/refs/types/krb5_keyblock.rst.txt | 45 + .../_sources/appdev/refs/types/krb5_keytab.rst.txt | 20 + .../appdev/refs/types/krb5_keytab_entry.rst.txt | 50 + .../appdev/refs/types/krb5_keyusage.rst.txt | 20 + .../appdev/refs/types/krb5_kt_cursor.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_kvno.rst.txt | 20 + .../appdev/refs/types/krb5_last_req_entry.rst.txt | 40 + .../_sources/appdev/refs/types/krb5_magic.rst.txt | 20 + .../refs/types/krb5_mk_req_checksum_func.rst.txt | 21 + .../appdev/refs/types/krb5_msgtype.rst.txt | 20 + .../_sources/appdev/refs/types/krb5_octet.rst.txt | 20 + .../appdev/refs/types/krb5_pa_data.rst.txt | 45 + .../appdev/refs/types/krb5_pa_pac_req.rst.txt | 29 + .../types/krb5_pa_server_referral_data.rst.txt | 49 + .../refs/types/krb5_pa_svr_referral_data.rst.txt | 29 + .../_sources/appdev/refs/types/krb5_pac.rst.txt | 21 + .../appdev/refs/types/krb5_pointer.rst.txt | 20 + .../appdev/refs/types/krb5_post_recv_fn.rst.txt | 22 + .../appdev/refs/types/krb5_pre_send_fn.rst.txt | 24 + *** 26275 LINES SKIPPED *** From nobody Thu Jun 5 02:53:57 2025 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 4bCTYK4N4yz5y3nQ; Thu, 05 Jun 2025 02:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCTYK1jL2z3PKK; Thu, 05 Jun 2025 02:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXIN2GPgv9wxcGmZAn8GXelE1ZjGg90Dh0V/kgic2ww=; b=EC2cMvjDmn24fqrD/76t44S3MUxIF/sp2TRQSKGGGFwHAlnLW3iq4ui9Uu9bSVxrjVGYoo VLIaN9gg0K2AJKYbPLS8yj0Y/i/u0vx5QGV8ma9xTST3yCxdZGIPMwrjgIraNiQkP3lLwE X5ZObXJKvvRJA1+BYrlFqp/dHhl3jf6fPlmOH88MN0g1hGiBlXxSHrsXt/oWz3EvI4q7xo yhTPNP9tvKTLuPx5PX2awsK8mPkXQIQx5MKRceCPzj0jMmGtZ2EN7Bc1lz2pZiewAuLUCp 3MN47aCCK7fJnqReWEXs6nZ87gEIbEGE3wWYcLIhfTbWcaQSC1PbuFJoEnT97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749092037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXIN2GPgv9wxcGmZAn8GXelE1ZjGg90Dh0V/kgic2ww=; b=Ny0RMbM8Osz+/IeQlbeSEelf92vE/rwe8zeK28KdOwrbIrPBFfeh8db2HpgahiCYsnZ6yM 8mkEUb7i7O2pBpG1O5RyjXiWTXxoZxdWdOxQOmD6ru8i3XeILlpOSxEfipBBOvJdYFCGsY ndi6FJPeEzm/J6QZocX/1wX3PXfJC4tBgRBeer1pBJj7MmAhkFBZBdgFw0cmXAIMoOB+HJ zQ9Asi4Gng0Qk7UVsUlDMA/RXm+mUEgR85wltyg0afPssIv0KIPldb7IYWkS57f585Z9V/ f6xKt7Of7F4sznkSSG7XeZaCWSLIVwCmL4xvHhnulnnEqXHceCqhFPE0YQNrKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749092037; a=rsa-sha256; cv=none; b=t5Y7T8h0OlROf2ZVRFf7MBpm1j7O0W9dHyc6uPXoqDRDgVsbM4/3HRayLJ/G3nKglDO3oU SUDZewRYhVUc3xohX9Fn9n/EQIRZLMUfNi6MHWLtxwWubSOp9GMQZDobqhjQJqhQVefPSZ wQNhFX5NJJiYaTpiZ3GwKKCjBEtnChsxQHfgBNyD+NfqRYHQstBMeMr1m/emf0qB4AccR7 LNP770jZHKHgimGXH+CDpBt8560dqIipKT30MAheh6RG7GHEkViKOFUDCZDLGSRrRal/8v y/lmbR7VLdvy5GHhbK/UiPPvdLpmwiL+HqVQVk5t1bjvc79Uz41WiW9OhX9PgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCTYK11kzzs1m; Thu, 05 Jun 2025 02:53: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 5552rv9U043566; Thu, 5 Jun 2025 02:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5552rvoH043563; Thu, 5 Jun 2025 02:53:57 GMT (envelope-from git) Date: Thu, 5 Jun 2025 02:53:57 GMT Message-Id: <202506050253.5552rvoH043563@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: 55f9c25f17a3 - main - krb5: Apply patches to build under FreeBSD 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: 55f9c25f17a362fe1db1ae4df6450963e420089b Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=55f9c25f17a362fe1db1ae4df6450963e420089b commit 55f9c25f17a362fe1db1ae4df6450963e420089b Author: Cy Schubert AuthorDate: 2025-06-05 02:50:35 +0000 Commit: Cy Schubert CommitDate: 2025-06-05 02:53:04 +0000 krb5: Apply patches to build under FreeBSD These patches fix the MIT KRB5 on FreeBSD. Some are obtained from ports/security/krb5-121. Sponsored by: The FreeBSD Foundation --- crypto/krb5/src/lib/krb5/ccache/t_stdio.c | 4 ++++ crypto/krb5/src/lib/krb5/os/localaddr.c | 10 ++++++++++ crypto/krb5/src/util/ss/listen.c | 4 ++++ crypto/krb5/src/util/ss/ss_internal.h | 2 ++ 4 files changed, 20 insertions(+) diff --git a/crypto/krb5/src/lib/krb5/ccache/t_stdio.c b/crypto/krb5/src/lib/krb5/ccache/t_stdio.c index 15185e301cad..4d95878b2e02 100644 --- a/crypto/krb5/src/lib/krb5/ccache/t_stdio.c +++ b/crypto/krb5/src/lib/krb5/ccache/t_stdio.c @@ -27,6 +27,7 @@ #include "scc.h" krb5_data client1 = { + 0, #define DATA "client1-comp1" sizeof(DATA), DATA, @@ -34,6 +35,7 @@ krb5_data client1 = { }; krb5_data client2 = { + 0, #define DATA "client1-comp2" sizeof(DATA), DATA, @@ -41,6 +43,7 @@ krb5_data client2 = { }; krb5_data server1 = { + 0, #define DATA "server1-comp1" sizeof(DATA), DATA, @@ -48,6 +51,7 @@ krb5_data server1 = { }; krb5_data server2 = { + 0, #define DATA "server1-comp2" sizeof(DATA), DATA, diff --git a/crypto/krb5/src/lib/krb5/os/localaddr.c b/crypto/krb5/src/lib/krb5/os/localaddr.c index 92d765f4bcac..efaee7cbdca6 100644 --- a/crypto/krb5/src/lib/krb5/os/localaddr.c +++ b/crypto/krb5/src/lib/krb5/os/localaddr.c @@ -176,6 +176,7 @@ printaddr(struct sockaddr *sa) } #endif +#if 0 static int is_loopback_address(struct sockaddr *sa) { @@ -192,6 +193,7 @@ is_loopback_address(struct sockaddr *sa) return 0; } } +#endif #ifdef HAVE_IFADDRS_H #include @@ -449,12 +451,14 @@ foreach_localaddr (/*@null@*/ void *data, ifp->ifa_flags &= ~IFF_UP; continue; } +#if 0 if (is_loopback_address(ifp->ifa_addr)) { /* Pretend it's not up, so the second pass will skip it. */ ifp->ifa_flags &= ~IFF_UP; continue; } +#endif /* If this address is a duplicate, punt. */ match = 0; for (ifp2 = ifp_head; ifp2 && ifp2 != ifp; ifp2 = ifp2->ifa_next) { @@ -583,11 +587,13 @@ foreach_localaddr (/*@null@*/ void *data, } /*@=moduncon@*/ +#if 0 /* None of the current callers want loopback addresses. */ if (is_loopback_address((struct sockaddr *)&lifr->lifr_addr)) { Tprintf ((" loopback\n")); goto skip; } +#endif /* Ignore interfaces that are down. */ if ((lifreq.lifr_flags & IFF_UP) == 0) { Tprintf ((" down\n")); @@ -754,11 +760,13 @@ foreach_localaddr (/*@null@*/ void *data, } /*@=moduncon@*/ +#if 0 /* None of the current callers want loopback addresses. */ if (is_loopback_address(&lifr->iflr_addr)) { Tprintf ((" loopback\n")); goto skip; } +#endif /* Ignore interfaces that are down. */ if ((lifreq.iflr_flags & IFF_UP) == 0) { Tprintf ((" down\n")); @@ -972,11 +980,13 @@ foreach_localaddr (/*@null@*/ void *data, } /*@=moduncon@*/ +#if 0 /* None of the current callers want loopback addresses. */ if (is_loopback_address(&ifreq.ifr_addr)) { Tprintf ((" loopback\n")); goto skip; } +#endif /* Ignore interfaces that are down. */ if ((ifreq.ifr_flags & IFF_UP) == 0) { Tprintf ((" down\n")); diff --git a/crypto/krb5/src/util/ss/listen.c b/crypto/krb5/src/util/ss/listen.c index fe18475447be..08427df1e5c7 100644 --- a/crypto/krb5/src/util/ss/listen.c +++ b/crypto/krb5/src/util/ss/listen.c @@ -14,6 +14,9 @@ #include #include +#ifdef __FreeBSD__ +#include +#else #if defined(HAVE_LIBEDIT) #include #elif defined(HAVE_READLINE) @@ -22,6 +25,7 @@ #else #define NO_READLINE #endif +#endif static ss_data *current_info; static jmp_buf listen_jmpb; diff --git a/crypto/krb5/src/util/ss/ss_internal.h b/crypto/krb5/src/util/ss/ss_internal.h index 1f5ddfff91b5..d37d86014eb3 100644 --- a/crypto/krb5/src/util/ss/ss_internal.h +++ b/crypto/krb5/src/util/ss/ss_internal.h @@ -85,7 +85,9 @@ typedef struct _ss_data { /* init values */ #define ss_current_request(sci_idx,code_ptr) \ (*code_ptr=0,ss_info(sci_idx)->current_request) void ss_unknown_function(); +#ifndef __FreeBSD__ void ss_delete_info_dir(); +#endif char **ss_parse (int, char *, int *); ss_abbrev_info *ss_abbrev_initialize (char *, int *); void ss_page_stdin (void); From nobody Thu Jun 5 03:03:24 2025 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 4bCTmW6DHzz5y4kF; Thu, 05 Jun 2025 03:03:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_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 4bCTmW1LZPz3Yg9; Thu, 05 Jun 2025 03:03:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 55533OrH073386; Thu, 5 Jun 2025 06:03:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55533OrH073386 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55533OkA073385; Thu, 5 Jun 2025 06:03:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Jun 2025 06:03:24 +0300 From: Konstantin Belousov To: Kyle Evans Cc: Gleb Smirnoff , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument Message-ID: References: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@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: <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bCTmW1LZPz3Yg9 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:6939, ipnet:2001:470::/32, country:US] On Wed, Jun 04, 2025 at 06:03:44PM -0500, Kyle Evans wrote: > On 6/4/25 17:55, Gleb Smirnoff wrote: > > On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: > > K> The branch main has been updated by kevans: > > K> > > K> URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf > > K> > > K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf > > K> Author: Kyle Evans > > K> AuthorDate: 2025-06-04 01:51:06 +0000 > > K> Commit: Kyle Evans > > K> CommitDate: 2025-06-04 01:51:06 +0000 > > K> > > K> kdump: nicer printing of kill(2) PID argument > > K> > > K> Similar to wait*(), kill(2) operates on a pid that currently gets output > > K> as hex. Output it in decimal to make it a little easier to eyeball the > > K> pid we're signalling. > > K> > > K> Reviewed by: markj > > K> Differential Revision: https://reviews.freebsd.org/D50508 > > > > I didn't review if PIDs are always printed as decimals or not, but for > > the file descriptors it is a mix of hex and decimals. :( Usually I go > > with a sed script over kdump output to make it consistent. > > > > To be fair, I'd like to fix that, too- I noticed close() the other day for > fd > 0, but paused when I: > > 1.) couldn't tell where we even output close args > 2.) noticed that close_range has the same problem, but hex can make sense > for its upper range (particularly when you're doing ~0U to simulate > closefrom(2)) and that's a bit of a predicament because that's a harder > pattern to spot in decimal. > > > I think if we try to bring that to common format, that would leave > > some people unsatisfied regardless of our choice - all decimal or > > all hex. > > > > So, I would suggest to add a command line options that would force > > into all hex or all decimal. > > > > I'd like to hear from some folks that prefer hex here... other system tools > are generally not printing IDs in hex, so it makes it harder to correlate. > Ideally, I think we'd audit it all and make sure we match truss(1) here > (which tends to just print decimal for all of the ID arguments, as far as > I've found). > Why cannot we consistently use %#x for hex instead of %x? From nobody Thu Jun 5 03:30:40 2025 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 4bCVMj1cmDz5y5vB; Thu, 05 Jun 2025 03:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCVMj0PBgz3vbN; Thu, 05 Jun 2025 03:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749094241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ld+B1G1ahg8UUiGtgaW0fPrkoseBMPnftvgGWf/8Igk=; b=eyn7oQaupsOlL1jjLMHzFF/UOipwf/SZRHor/3GQjfa68jwcsoOtWVjjCa/vTKcijtO3XJ /6XRz5DDjDTf2r838qyDqtyyzpKO4tXL7maDU/jZX3729dhHQaHHzaAEz1j/egceWCEwkW ZXnmuY3s8UJNRni+GmTcP4u3Qlhv8KKhT4mSO+p+VMJ38o4LFrKSwA2BL0OK6/BAYhntaL N1iVnPtcuVGcXKFgLka48856jngMlAJVyuuCShQkz2P0p3xooS2ZP6dJBop2syckZMiovj CxXRvwLr6BV0cJwIc7nsGHSjSLBd0+fL0epkWXCFnDcnTTcN/LaQVciqJBCqeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749094241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ld+B1G1ahg8UUiGtgaW0fPrkoseBMPnftvgGWf/8Igk=; b=X0fMig+E02OshXxv8cDSguZtQKRsFiTxiXRDEQ1IDf+kWRd591D5OrP7p63EYfiZql8dWr vnmFHkllyN+m5eGi8BW6hASGxz6VTIIG6qI2b43EETHf3ekK8pNbBqZi5n3N6V2PREKrfa lSviFtqU6mIqJU9vG0EuTONccNEyF0YSoWBuglMxuz34xTPmRpohpqIInS+Rp0ASJYeVQR huZ1uDqZxyQ3nG3EiAAlmi5RshUlHLQDzn15CxkSH2yn++K19diIoE53e8B49aqfojKOWh W2lrM5JWRHuT5DcsfJVL8komyALNRB3jU6IUThDnEbGuw+vRSzzz7elo38XDkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749094241; a=rsa-sha256; cv=none; b=Ec4fNJYQ2jVgiaQvLmEs2T+obmj5s++y+XqqccNxoOoAoduws/fha8X28Io699duP09yrV jKhK/c1N4bAHbXXGi5C1i/dUf6T9Irg9S3r5Kt//PDCmwyewOWPiCPulmyZwy/+1C24S+n kjubZotiaLKEg4wK/pwAVY64U9s70On2Ase1rewgc4wcDNvQTkBzk31PlQuSp5j2VDnUKy TwWG2gMp/UHe4PmRvENSybOdANcC4Q4pi1Q4zMLqxXsOs4i6whEth5EWoq1Jzpu23OE/Ek 3vU0ys3t7sC9/og2ac2BsnTnZU/bw3G7kVrrBTARLqhJEp8JHnLoDAkMwsqQVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCVMh5sPpzsNZ; Thu, 05 Jun 2025 03:30: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 5553UexW012934; Thu, 5 Jun 2025 03:30:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5553UeWu012931; Thu, 5 Jun 2025 03:30:40 GMT (envelope-from git) Date: Thu, 5 Jun 2025 03:30:40 GMT Message-Id: <202506050330.5553UeWu012931@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: bf407f36c5e9 - main - local.dirdeps.mk move MK_RUN_TESTS .endif 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: bf407f36c5e99a227f27c78a887e2ca2088ca432 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bf407f36c5e99a227f27c78a887e2ca2088ca432 commit bf407f36c5e99a227f27c78a887e2ca2088ca432 Author: Simon J. Gerraty AuthorDate: 2025-06-05 03:27:39 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-05 03:27:39 +0000 local.dirdeps.mk move MK_RUN_TESTS .endif The MK_RUN_TESTS check should bound all of the logic relevant to hooking tests into the graph. --- share/mk/local.dirdeps.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 2173ea0be446..a22f494bd33a 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -283,7 +283,6 @@ BROKEN_HOST_DEP_TESTS += \ usr.bin/gzip/tests \ usr.bin/printf/tests \ -.endif TESTS_DIR_LIST += tests # most of the tree only has Makefile.depend @@ -306,3 +305,5 @@ ${DEP_RELDIR}/$t.test: .endif .endfor .endif + +.endif From nobody Thu Jun 5 03:37:15 2025 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 4bCVWJ5CDXz5y6WG; Thu, 05 Jun 2025 03:37: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 4bCVWJ1bjjz42qG; Thu, 05 Jun 2025 03:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749094636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8MMASyzWH4xAeFv0RG8pd0wmNFrDueSu26MJ511ISk=; b=JB6BnK1qYA2hJfRRRoRjC/bFckCIUqOfRbR7Mo92dnd8VyGBxlWG46KsaPDFt6eToyJ5c2 CA4lHXLtyNQ+OkzS4bEcWbk7plH+iXkZ0liQiMWcfiNTxJa6pdPtp0/xLgS4Q4ZZqbNIFc gBAUZO8KVqj6fJ8GCg+M99HUKL/47JFe+W/ptclEd/Wkzs7neNRX8ceN/e+qAkAWpI4Oqj sP4tlDlC+INwNvALaDJ7AdU51UM557t0apmMEyFsSA7FURFvMOoad+qEpyumtB2lcCa5UK NKAGk++xWoUF09Lm/+QRE+8L3ZfWkS698fVdf19NJj3erOXl3yCyqTpa7tUcJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749094636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8MMASyzWH4xAeFv0RG8pd0wmNFrDueSu26MJ511ISk=; b=sBTGk+qb89SKkJFQe359+Pd39LjZ1BiQ/yJSnNgWpyIeBplHtxTNphL/lAI5VS67fVb9Fr fFlXaykaJlpSHPHHp13NdrEWQSBVH+lYrsG8e5aYIJO6XIi/woHQBwVR/2Wr//RjdBLHjT cIkXulwyw/zQ0vfJsTRNOKvAcdj3ahHtQTE+drJoezyJ6eVbuSL8mFMvkg5Lg19gmpescZ KEUDwPstHxp3Dp65Sy27u8hcggdIJzgKULnGP60WLSUYeeq2Dk0+1ZbcjdLjXL7IDZQQtN FsG0nZ6gDLynbibOtCh6d39L5Cp45rwjQNPTUiB38645CqhRYE74yTdb9Xrwhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749094636; a=rsa-sha256; cv=none; b=lMsOFuXykjj/C4+hj+thIbSMChrHUhJZyQHXs5KfMPB7dbRPOUUKqO8mAVjSnEweFenK9e lVomboboZxgFUJ3FjxNy+1Ybj50dU4Dqop2hbNP9r7UXFxGo7k3r5m6gFmK3DbDFy7Lmyr twRyluASi8Xv95IqSD1RvP+MaITbH0QOpSW1T8vXyNTjeplAbLE5+GoQlZwhgaz4k0hsw+ tJN6HGVYKI5WnM6syoVme8bKs3GfWTxIzNqMyFjBsK+c+XdAr1c5Yi9IJ2W1w7IcfYCKLf 5U74xoBJQLNn0DHG8wDMJqVnpKr+nFAUGcqLwT1YDuIoLDSPm8oOG7R+vVWIEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCVWH6wMqzsdD; Thu, 05 Jun 2025 03:37: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 5553bF69022031; Thu, 5 Jun 2025 03:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5553bF3A022029; Thu, 5 Jun 2025 03:37:15 GMT (envelope-from git) Date: Thu, 5 Jun 2025 03:37:15 GMT Message-Id: <202506050337.5553bF3A022029@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: ac05fc395317 - main - local.dirdeps.mk remove stray .endif 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: ac05fc395317749b195cc67698308eb081363cf2 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ac05fc395317749b195cc67698308eb081363cf2 commit ac05fc395317749b195cc67698308eb081363cf2 Author: Simon J. Gerraty AuthorDate: 2025-06-05 03:35:59 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-05 03:35:59 +0000 local.dirdeps.mk remove stray .endif --- share/mk/local.dirdeps.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index a22f494bd33a..a92539689a31 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -306,4 +306,3 @@ ${DEP_RELDIR}/$t.test: .endfor .endif -.endif From nobody Thu Jun 5 09:32:55 2025 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 4bCfPh00X6z5xHgG; Thu, 05 Jun 2025 09:32: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 4bCfPg6Q3Cz4HlX; Thu, 05 Jun 2025 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749115975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL8qGAuBzpoFSyPpwvhnPLr4Gp++iPkVLtMG5wdwoic=; b=Mcl9vzpURH6slqflHcNB9TCuPlrXRelYwLeDs+C2lzXh7HYdUwmLClqnOQciHOEvbchO9I TeC1HZ+Nuvd38b6LpUE9y2hj1hpyIkhdGg3e4GyLVc7thqCbN7ArZRbXUNuHF5G/QcJRpd Ea4kVEN8eO9YU5emVy52JYzOOSEqVJQBol6cWjpX+tIO+AZqHqWT9Mj8WLz53au5/Q6RDw 1NGlD/RXvERMb5xOgj5womqmNMKvE4Yu8GVV8b0u+DUke3qiY/8RvbgTiaV1HxSOuziMTr 0Xl+asAX2IpeXGj8L5+mwAhMVUWOWg85RaAZspBcJRnJTW7DNIcEpSeNjpkEeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749115975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL8qGAuBzpoFSyPpwvhnPLr4Gp++iPkVLtMG5wdwoic=; b=ICrtNTCDnLAXbhoNm5ZMRWeriPDO4bhM7v9/1oeqCoJiIYrvIAhW91AzyM/G04lE9tUU7n IdueyLMa6LyXvX4poguTjfkjrOrkZIN1ITjT9epEHESUArPktJcbg/hMwPy22IixWTdVw1 lqbZSgIaCCFAq/akiU7AjL6RecBU5ljZ/sr/6PlRqAbVabyyfatS0SSlwynENgZoZbWMYT lZd7DbhgFMmH8bZROTO8nMEK08nGrx4RE0eHiFBJnL+r6qGJAMZXccxj8MSqW1bU9hvHuf Poprysr2KPOFouKfXaiWzsLOONNPOhV2JRVKKi6hqUz0xlepYMVsmHduF2CCSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749115975; a=rsa-sha256; cv=none; b=SV/yV9sPc5eDIk4/pjFXk3cfEy98aVphJFUjFsqTzi67gsBz0yVVjt00pi/p9gQtSTX4U8 6rgUI933TF6i+fY4HGx2hhueamp6hxrs8tt8qWetxQrWLmA0HkIAghByV4u+02Ge6UJDXs Xo91Y5rmoEiQQuXgt8C2K3azGyjkRzD4EsZY/1CzI/9RXbE+Y3ZNb6HPdazGhttczoin5B yGrNQYKvHI6XdlWdkcjJhsHMai0AeSr4kLSM2yTPO8nENNDeB9nPenzKEFj9Vm83yCoags fLMREY/t6FvEj6ad8fakKP5eYBoRq1erRRDYyun0ew+8v5pNmyq9BxwSIftSjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCfPg5yNBz146f; Thu, 05 Jun 2025 09:32: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 5559WtaB095368; Thu, 5 Jun 2025 09:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5559Wt51095365; Thu, 5 Jun 2025 09:32:55 GMT (envelope-from git) Date: Thu, 5 Jun 2025 09:32:55 GMT Message-Id: <202506050932.5559Wt51095365@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: 38c655093c6b - main - route: fix rtentry double free 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: 38c655093c6b641a4ed4e844af95859f66844f25 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38c655093c6b641a4ed4e844af95859f66844f25 commit 38c655093c6b641a4ed4e844af95859f66844f25 Author: Kristof Provost AuthorDate: 2025-06-03 12:20:40 +0000 Commit: Kristof Provost CommitDate: 2025-06-05 07:52:33 +0000 route: fix rtentry double free add_route_flags() frees the rtentry on error when called with the RTM_F_CREATE flag. Don't free the rtentry a second time. Reviewed by: ae Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50665 --- sys/net/route/route_ctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 5a04e9dcf6e7..d629fd1625c3 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -673,12 +673,11 @@ rib_copy_route(struct rtentry *rt, const struct route_nhop_data *rnd_src, if (error != 0) { IF_DEBUG_LEVEL(LOG_DEBUG2) { char buf[NHOP_PRINT_BUFSIZE]; - rt_print_buf(rt_new, buf, sizeof(buf)); + rt_print_buf(rt, buf, sizeof(buf)); FIB_RH_LOG(LOG_DEBUG, rh_dst, "Unable to add route %s: error %d", buf, error); } nhop_free(nh); - rt_free_immediate(rt_new); } return (error); } From nobody Thu Jun 5 13:14:31 2025 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 4bClKN5PKgz5xp4N; Thu, 05 Jun 2025 13:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bClKN4Vx6z3nCZ; Thu, 05 Jun 2025 13:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749129272; 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=gq3+M5USFqbs8/4uxAdqUvK4474poCa30QcWvToPnFI=; b=n3rUPfsNnteRJAVFw4TaH62QCyu3Ma5D9xQVrq9xvQYRRpSfnOtolBU4ZP5H8fHpaiH8cy v30XG7H3Mn/SJf4219Dzw3LC4Qwc7v4kkhHi3IVY2+QWHYAdmI3dh2X/KbcAa7bUYSlMn1 NJL1VQawUx/x9IVu7Yr/W9gLD2ThNwjgHvy2kuitVVNEBxmKywEKtB9G7+j+p78Ttplq+P qLYm4PDeS8SrfBEUf7VPYfZP+6bORapHWIs5n1+q1niGEwTsVKjAypXNZwzriYJt1zdnTJ 89kO/+tQTcRrU8UdHfSG/pnuEHS7r8+YVA9Q43vIWDe2Zr7Vz9WeCThBJWB1bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749129272; 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=gq3+M5USFqbs8/4uxAdqUvK4474poCa30QcWvToPnFI=; b=dts89Qq3fvvjxc6aJ/IhEEfySeegru1cuPtfiPisikCFppgzGIohiB7kg+GdJXXTCEpuVr Dfm/yWnfWNejZALboT7kRYQaLLXwKD25yX0zUrh/aHCmcCJxf2rfXhmU4AEukIsPpln8Qm xCQbhRQgXLYfziETldDjKCBXDWNrEabv9yMo2OPFPN3+shQt37KH4tE+6VrrLHDcj/5ueY PsHXFfEDinsydfkLLphqltrCNEA5lho3UiB0hKRz2g2U9mtIc/2YXbwAmUL7879rudP4A4 88ShO1HsBZB9+UAiJrbiQ1m0ooFgd0+Ipqaa8NPGTadCRS+JqruVxKUpyKvEfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749129272; a=rsa-sha256; cv=none; b=CW4+qLn8mY6r37foEwtMiCjJthCJe+RhlUGaTGq2AD7Cp45UFJbeVg1B/uwvMtFCqhfsac VX9HIcZXiGMnfokrNHndfX3clkIARIjHsIQqwPQwkUzGKcCFgpkQ34uyrXEzzBhS1weG1V 6fuuPOuID12zwbGRbQvay18RwaSvyKQGOkeBvS0JZVPSWJG8t/kB0q10dbud7gFs24VcQU S2m6gYRv7QZosc/pZFPPsZ4PUy9BIQNatc1T7i9S96pxGRPJJtd/SZ6nZKVn9UfXw2SDqq YbWXyfm50MpQUw/PqqnasmWFJBpfm7g8nINzhKvFMOFXQDji9INtd/wNrauEaQ== Received: from [IPV6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1] (unknown [IPv6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1]) (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) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bClKN1ffyz14cy; Thu, 05 Jun 2025 13:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> Date: Thu, 5 Jun 2025 09:14:31 -0400 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: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument Content-Language: en-US To: Kyle Evans , Gleb Smirnoff , markj@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> From: John Baldwin In-Reply-To: <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/4/25 19:03, Kyle Evans wrote: > On 6/4/25 17:55, Gleb Smirnoff wrote: >> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: >> K> The branch main has been updated by kevans: >> K> >> K> URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf >> K> >> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf >> K> Author: Kyle Evans >> K> AuthorDate: 2025-06-04 01:51:06 +0000 >> K> Commit: Kyle Evans >> K> CommitDate: 2025-06-04 01:51:06 +0000 >> K> >> K> kdump: nicer printing of kill(2) PID argument >> K> >> K> Similar to wait*(), kill(2) operates on a pid that currently gets output >> K> as hex. Output it in decimal to make it a little easier to eyeball the >> K> pid we're signalling. >> K> >> K> Reviewed by: markj >> K> Differential Revision: https://reviews.freebsd.org/D50508 >> >> I didn't review if PIDs are always printed as decimals or not, but for >> the file descriptors it is a mix of hex and decimals. :( Usually I go >> with a sed script over kdump output to make it consistent. >> > > To be fair, I'd like to fix that, too- I noticed close() the other day > for fd > 0, but paused when I: > > 1.) couldn't tell where we even output close args close is probably handled by the default case where where all of the arguments are just output as hex values. Note that for kdump, most syscalls fall into this case including syscalls with pointer arguments. You'd probably be a bit sad with 64-bit pointers printed as decimal for many system calls. truss is different as truss stores some rudimentary type information about system call arguments and then defaults to printing certain types like file descriptors and ids as decimal. truss also prints NULL for null pointers IIRC. A useful project perhaps would be to move the table describing system call argument types out of syscalls.c in truss and into libsysdecode so that kdump could also reuse it. Probably the API you would want is something that returns an individual `struct syscall_decode` given (ABI, number) input arguments. I don't think you can generate this table automatically from makesyscalls.lua as many of the "types" truss uses are synthetic types that aren't visible in C, e.g. "OpenFlags" meaning O_* flags passed to open(2). This would allow kdump's hand-written per-syscall-number rules to instead be closer to truss where you instead just iterate over types. It would also mean only having to update a single table in libsysdecode when adding a new system call to add both truss and kdump support. Only when a new argument type is added would one have to actually touch truss or kdump directly. -- John Baldwin From nobody Thu Jun 5 14:34:07 2025 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 4bCn5C6VX1z5xvR6; Thu, 05 Jun 2025 14:34:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCn5C632Nz3X4L; Thu, 05 Jun 2025 14:34:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+T6/sLNkxXqH0PaNGg+kVlenlduAI6f1GRkkzY5ruWE=; b=O2KgPF6wYKT3C6p73t0Cjd5ac/ngDw2Oc5Od6UXlOeW6LGRld7QURlyhCyo/wpxphtEg/T DTR0H+BQ70c9MBEkQglYenFl5YWjWH2CFU3kctKd7aGvY1xsZlToXR7rzzfrE+VogdhauR cS0FU6ErHxuC+ZmSlH5gNcQGv+Wp9qOdBaxNMAIbrMdY7EIKEGz/46onhhG9ucBrCHDn92 kuLgIl6D04AxpAFd1K3cS4rJ5uJkSQrhQrjXe4CUf3RnMFDYGM/Ar0sY1DoKjp7j6Lgs1p oEZNUMqG0BmFRAg/wWK6Azk+NfJY8YXH7TZ4lES98If4d5iQPznn2JfHTvetSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+T6/sLNkxXqH0PaNGg+kVlenlduAI6f1GRkkzY5ruWE=; b=m2W+A0rW0x+1+Eey5V1d3SZgaHwAVReQo+7hlhQ+JtQVeSxTLCh37EPcsj47m4691AjAMr 1eTZkzUwoH3nQH8ewScO0Fpp9G2P1BWGh4m622m1bgct7gcJEfyjBjAjv3rB2lm5DTE6Mh GV8xwuxvPb5cTTNN5uG2VpWui/U0yOxH4+KYjNsAhWKdvop9yI28+QYG/A/QejS5VKx8S3 Ea6stttrYG9/B4K3kCRSRkidgXWW1ReGmPaJUUfAz8HgKhnXOtnhhbWrMkVNxdE67LowWW aG1ubfjyOQySMyTbpF/WM0oQSYaLJV1T06lMqpf8o6xesRkKXSZe95WqiPfHLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134047; a=rsa-sha256; cv=none; b=lMFuSazerkjj4a61T7F8iyGCpWszBWaU8t3FKRZV8PhOeaycxcfpwS5EH/4Jz3RtvVjWUX DwkI0oJF8KoB7Unz0DvEVK9ceTAUkcyywO/GkhvG61zTcWc8ib8O4s1TlB33F9eKQfnEkN OQwJppqCkKe+C3PfvvWae/xk7t/YykQdbsOIFNKth7sR25IYgtc8V2ol2rp4HDpEA47afR 2lJZdg/Za/fC59AVwUnwKDMyRFlQgUciIvLH+Ja5Knk96+vp8UgPx4qEF7g94ZwbK7DKOs v5xAKfPH+MAzh8NdFpALslk/SKOs9yKu0QKhhKgUAn0BGGfIF7o2n9W+ZTBF4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5C5cjYz1C00; Thu, 05 Jun 2025 14:34: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 555EY79B056698; Thu, 5 Jun 2025 14:34:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EY76i056695; Thu, 5 Jun 2025 14:34:07 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:07 GMT Message-Id: <202506051434.555EY76i056695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 58dae28f665b - main - LinuxKPI: 802.11: make synching from HT more resilient 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58dae28f665b32650f452730378693de40e96d68 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=58dae28f665b32650f452730378693de40e96d68 commit 58dae28f665b32650f452730378693de40e96d68 Author: Bjoern A. Zeeb AuthorDate: 2025-05-27 19:33:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 11:32:27 +0000 LinuxKPI: 802.11: make synching from HT more resilient During testing I hit a case where htcap->mcs.rx_mask[0,1] were zero. This should not happen as that would mean we are not supporting HT. After adding extra caution for debugging I could no longer reproduce the case. So just to deal with the eventuality make synching from HT more resilient by checking that we have nss > 0 or otherwise disable HT operations. Move setting the bandwidth below this check to not alter it in case of the now early return. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d424bb6c8d44..390b27802fc4 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -482,12 +482,6 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta, sta->deflink.ht_cap.cap = htcap->cap_info; sta->deflink.ht_cap.mcs = htcap->mcs; - if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0 && - IEEE80211_IS_CHAN_HT40(ni->ni_chan)) - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; - else - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; - /* * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ * optional MCS for Nss=1..4. We need to check the first four @@ -496,11 +490,21 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta, */ rx_nss = 0; for (i = 0; i < 4; i++) { - if (htcap->mcs.rx_mask[i]) + if (htcap->mcs.rx_mask[i] != 0) rx_nss++; } - if (rx_nss > 0) + if (rx_nss > 0) { sta->deflink.rx_nss = rx_nss; + } else { + sta->deflink.ht_cap.ht_supported = false; + return; + } + + if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0 && + IEEE80211_IS_CHAN_HT40(ni->ni_chan)) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + else + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; IMPROVE("sta->wme"); From nobody Thu Jun 5 14:34:08 2025 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 4bCn5F1YC7z5xvR9; Thu, 05 Jun 2025 14:34: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 4bCn5F00b3z3X8G; Thu, 05 Jun 2025 14:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNHZuZ0qJaAPL8B3KArOQXkWlAaRrKieDFqyc/0zQLU=; b=xCnHRrZy2c6JMc8/5k5cVSbPOHe/Rm86XlLdMrOKR29MVHCsgMQuSF7tkNexovg54wLP21 FwsVGcGY+hJmM/jgJE6gemo/G5BZzkOuFUI4VvP8ogkhVAaYnj7uha40B8y5NS085rBDAY ebAuf1Eullkr0ja57ug3ARLP4/CcIx2PQh4lY+poAF7mHehnoM4u5yFSJAktwNze2mHX9p 5uWK7cW0jPic2rYkVA+jFfnzdhx0SvBUV0CQhHp7kkgTa4UuI3bzcGv2moW0OiaEb74VHs TDU3rx9cP82M7kz/r/hRFSlYAWFDqhlExO7uGNWrESUGf2+ELoS183zLaHrSZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNHZuZ0qJaAPL8B3KArOQXkWlAaRrKieDFqyc/0zQLU=; b=buzL0E5X7AY0Vrt/27ZTNfLwwJzIH3mvt7jKM09m3qaibjamX9Wr1Xj/wuoJgWH4KhLZAb o0To2+i6JNmE71H9Z3SYAUu/JL47F6czCD00IMQV8KHa2br7M5BQE35sT+O/Mcpi4GWCQa amEXFuZ3KRLVFMlTQCcaGsuUZn+giTAh0fvMJnSpEHP09runAyK5RTmHwcvc/ksbXOI7Mo 8yCtcoIBGxdO/kY/b+0D74FNX5M0k4UGjy6MzaNa4WuXtmh0DaZJrG98qsj2W/K2Zh1UKc Kn6iDdl1/mFxA2qfh/rP38ByqWmCutBZVmms+f5h2mDfXEyK/pr/Z5oIMzjXrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134049; a=rsa-sha256; cv=none; b=UYxM0rCdaVdVafjSAFPU6298zAluNJUWJT94yJ23bQ3Bg3jAbbF6ff6MQwFtArma0S8gFy /BaVoadnSw8r00yW7Ylvvlnz4DBtDGmb+On/TpVrQUUoQ92jFiA7oUYyAwT3Kl7oXk/H1c JTmydQgbskBdfV871CHvXguhapUUDjfFLNvEgw6SxpTCJnYK9RF4JKNv7Y7z5MExtmGKW+ WuChD0N8OOKWFGs269bVDTtJS0jalAefkil05ETJ+JME/1DG8D+4qNabdppvNSlZR7+mRc 1AKF4YMTp6hRAZxkH6ClkrkuFeP2J0d2fDZVNagkCdJHFnOxIAHgd0kQ+XvWdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5D6d7Yz1Bmb; Thu, 05 Jun 2025 14:34: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 555EY8j2056736; Thu, 5 Jun 2025 14:34:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EY8If056731; Thu, 5 Jun 2025 14:34:08 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:08 GMT Message-Id: <202506051434.555EY8If056731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 29ddd583693a - main - LinuxKPI: 802.11: add support for GCMP hw crypto offload 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29ddd583693aced69be48b545e1c7e7249bdfb9c Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=29ddd583693aced69be48b545e1c7e7249bdfb9c commit 29ddd583693aced69be48b545e1c7e7249bdfb9c Author: Bjoern A. Zeeb AuthorDate: 2025-04-22 20:10:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 11:32:27 +0000 LinuxKPI: 802.11: add support for GCMP hw crypto offload For iwlwifi, rtw88, and rtw89 we can treat GCMP the same way as we treat CCMP which allows us to re-use the CCMP code for now. Add the missing case statements and factor out some common code. Allow IEEE80211_CRYPTO_AES_GCM_128 through our filter of supported cipher suites to announce it to net80211. Sponsored by; The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 390b27802fc4..2f9af39391f6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1415,11 +1415,12 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) lcipher = lkpi_net80211_to_l80211_cipher_suite( k->wk_cipher->ic_cipher, k->wk_keylen); switch (lcipher) { - case WLAN_CIPHER_SUITE_CCMP: - break; case WLAN_CIPHER_SUITE_TKIP: keylen += 2 * k->wk_cipher->ic_miclen; break; + case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_GCMP: + break; default: ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); @@ -1454,16 +1455,16 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) if (k->wk_flags & IEEE80211_KEY_GROUP) kc->flags &= ~IEEE80211_KEY_FLAG_PAIRWISE; + kc->iv_len = k->wk_cipher->ic_header; + kc->icv_len = k->wk_cipher->ic_trailer; + switch (kc->cipher) { - case WLAN_CIPHER_SUITE_CCMP: - kc->iv_len = k->wk_cipher->ic_header; - kc->icv_len = k->wk_cipher->ic_trailer; - break; case WLAN_CIPHER_SUITE_TKIP: memcpy(kc->key + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, k->wk_txmic, k->wk_cipher->ic_miclen); memcpy(kc->key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY, k->wk_rxmic, k->wk_cipher->ic_miclen); - kc->iv_len = k->wk_cipher->ic_header; - kc->icv_len = k->wk_cipher->ic_trailer; + break; + case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_GCMP: break; default: /* currently UNREACH */ @@ -1528,6 +1529,7 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) #endif break; case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_GCMP: exp_flags = (IEEE80211_KEY_FLAG_PAIRWISE | IEEE80211_KEY_FLAG_PUT_IV_SPACE | IEEE80211_KEY_FLAG_GENERATE_IV | @@ -4809,6 +4811,7 @@ encrypt: TODO("sw encrypt"); return (ENXIO); } + static int lkpi_hw_crypto_prepare_ccmp(struct ieee80211_key *k, struct ieee80211_key_conf *kc, struct sk_buff *skb) @@ -4876,10 +4879,11 @@ lkpi_hw_crypto_prepare(struct lkpi_sta *lsta, struct ieee80211_key *k, return (lkpi_hw_crypto_prepare_tkip(k, kc, skb)); case WLAN_CIPHER_SUITE_CCMP: return (lkpi_hw_crypto_prepare_ccmp(k, kc, skb)); + case WLAN_CIPHER_SUITE_GCMP: + return (lkpi_hw_crypto_prepare_ccmp(k, kc, skb)); case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_CCMP_256: - case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_AES_CMAC: case WLAN_CIPHER_SUITE_BIP_CMAC_256: @@ -6124,6 +6128,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) * Also permit TKIP if turned on. */ hwciphers &= (IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_AES_GCM_128 | (lkpi_hwcrypto_tkip ? (IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_TKIPMIC) : 0)); ieee80211_set_hardware_ciphers(ic, hwciphers); From nobody Thu Jun 5 14:34:09 2025 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 4bCn5G6065z5xvZK; Thu, 05 Jun 2025 14:34: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 4bCn5G1MVsz3X8N; Thu, 05 Jun 2025 14:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cj9mqFtjmVUSw9hqweUy6HIkQ8+Ib46AN3DbepecaFk=; b=jOfpT98BEwooj5jZZmPUMeQDBbtjlRpP6hm1gnG9OZQQz4QEj9fb/A3ghWS9zOxZ2Dgfyn j+bMnn0J2zOc+5zg4gdzBdgjuZoWUOeIHibtQVDIdfns6xHX6yOM5Agwo8/4LB53K4oSOH os+Z2XkflG3WKRQ8Lpt5neXT+DACbhCoYegqA4dJH/MHzHCGZ6Q2C7ROps72dm/s9XQYYJ otrcV7oy1gB0emmrgToNPjC1rpmwFnlzK5EeVGG16uSg58SZbXEXR5ajMLjq4iQGBb55yy 70FCqWpiMeSKhz73NbfT8SzIPWu2nY3oqnJrX5nPUWQbPRRNSICPOH9BzNCAEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cj9mqFtjmVUSw9hqweUy6HIkQ8+Ib46AN3DbepecaFk=; b=PdX/bzh8nOrDtkASYAnNptsbfnogKB4FPgFQuQgsjojglWEddsfVHe0kt0aga5p0bRYvH6 7SIDcmZ1pO4rn04B+5GS4wH761Q2HZLRQ0lFQFu1xXHqMzj8+2xOy6W/GRdcQYm+ym9mkH 3tVByeFlZTdb94/IN476zCim1eiwXvHetqktwOvwYrUun+i0mZ+cnVHOFIocvjiWSDdTMY ciF2+mwKTxWewMubCk+ORemzWArHh+WBUnNHkSlarwAeunp5fm/ZNP+bq78gL1WhstA+8w OqgXB/0ZFctZFm6hbiYAUF8NIue+8/TVsiMh/7VoAJwxukN8GYiK2xrlig42yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134050; a=rsa-sha256; cv=none; b=tpcQdU1UmeRCZuubPRpcNWmgIfd5LVACXcLMR54tExYRBlem3FcKdxOFYWUEm2dq+KazNQ QzDfmdzr3MJO9RVJfA2+a/yFaeT2Tb3zjd4B3cKxIJF5L0C9THRMN8BJW4wR7qVXOSqKZu lo5DclqEW0xnuRuGWWBFbdSf6HUEqKes0ldX++6FmBtzoObJOX6A52ATp3iazRDlWabZMw exfiNsxz9+uX6e1fYT7VzRM4whR/We7Hn71TYctrxTVdjfMQPjfyQvSCoZoVmmm0zmgga7 rf3TIxLsa3QcrfJfLYtFobX9xaDl/vCYyuBGTGx/gcg3vJ63WKWLMDkB0KvPpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5G0Wwzz1CBF; Thu, 05 Jun 2025 14:34: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 555EY9C7056771; Thu, 5 Jun 2025 14:34:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EY9YT056768; Thu, 5 Jun 2025 14:34:09 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:09 GMT Message-Id: <202506051434.555EY9YT056768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: aaee0ed3d163 - main - LinuxKPI: 802.11: WEP noise 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aaee0ed3d163a1d29ea74d7e4d2c3658a51cfb27 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=aaee0ed3d163a1d29ea74d7e4d2c3658a51cfb27 commit aaee0ed3d163a1d29ea74d7e4d2c3658a51cfb27 Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 11:11:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 11:32:27 +0000 LinuxKPI: 802.11: WEP noise While we decided that we will not provide WEP support for the LinuxKPI 802.11 compat code, some of it is in there already (also because drivers still support it). Put proper keylen checks in place as net80211 only knows about WEP while LinuxKPI has WEP40 and WEP104. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 2f9af39391f6..7520ed7331be 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1064,10 +1064,15 @@ lkpi_net80211_to_l80211_cipher_suite(uint32_t cipher, uint8_t keylen) switch (cipher) { case IEEE80211_CIPHER_WEP: - if (keylen < 8) + if (keylen == (40/NBBY)) return (WLAN_CIPHER_SUITE_WEP40); - else + else if (keylen == (104/NBBY)) return (WLAN_CIPHER_SUITE_WEP104); + else { + printf("%s: WEP with unsupported keylen %d\n", + __func__, keylen * NBBY); + return (0); + } break; case IEEE80211_CIPHER_TKIP: return (WLAN_CIPHER_SUITE_TKIP); From nobody Thu Jun 5 14:34:11 2025 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 4bCn5J1sCgz5xvCl; Thu, 05 Jun 2025 14:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCn5H30Clz3XHZ; Thu, 05 Jun 2025 14:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qKhQIH3RPQxBaIo1KDK0j24OC2ICdZMtyj5GgzVKnhU=; b=s6YpyADKG+Qc7CpXqWeDRif4XpobARimXeTqub7163hvKIQCDqU1mpjOhP6lQMyzDv8sAf WnpR/LSgkCq5zC6EU9S5IajVKH3gYg4HSHjmK8/wR90jVm3oWdSneAARTlrLpI5r5RUPF/ AjCOFLWvTfx/S93/UsXApb83TG5PBb/FQEPdnUMA/TRawXNPox7mExlMvWPXSGsJFFmAY9 SQN17tmV4shJMOyZCzrkOR6YV8mnBZ3lvYksaeGxAcUmHlayeBkk9R4TKWhzQXKthU4K20 0XOj2ERsCLyuwIOz7W3EhyBUOhyl19PeJ6Sx3rjnPLBibg5djKlA18vyCLA5wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qKhQIH3RPQxBaIo1KDK0j24OC2ICdZMtyj5GgzVKnhU=; b=qAmHsB8bWo4OK0bYzrGS7rJera3cGwSCNpTqwUC1Vc1ustrMuqqPJEqwRg+KtaemMo7leC s7mweYwvKICvajwyCi84ija/CcFsz7LftUQc9P3U1lJnJwkK3Zwu4UUmFCgTFhCmcqVUAz zPEMF/2eTmR/rFof7ac/ewL/HS24jD9tL8/eduV543Wm+HKHg9PaUHsbWinY+UBhHkb7XK zixuPWD3vNKstAUjhO25Vm9Aaj+jlUEwb9fNIkqI3MHZwNAVm4SBLp98hhXRxrbyXoQ7MU TysQTJDUCwl6ID1Lm73QAPt4FRZ/mlpz+ZSAEQiejWId3zHOnIWX8MgTr/VoIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134051; a=rsa-sha256; cv=none; b=LqyZXYXsiLOV+fi3kBNR+kBnk+JWdDI8ToY2TXh9wGb7QcdC1iMLUYTyhXj7ULoqZzhgVj 0GUZh5tgz0fVLlnBoL6X86T1eX/aPsaafrFGcKdRfl0UCUzdsjrnAFh204Y4G5wTl1txOP ZI5LnB/obRqUZjqfRF7sgMf5iV/1qxaev/NJ8BBrdGDQEWYTr25ZU2zTTL4GfqIMdMHWfc v9SAhKAHgNB1RJAKR3nDVzlBYlZ5tIw6hleiYUDsRy9Nw7knq18uNVdPDsLPaBXAPnOcep Gvp8fVVQbtiO0BNwgdQLwHXU9Zx4DioqhGkYxygppMXiSeq9xHkbwFN4ojIjXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5H1YNWz1CZs; Thu, 05 Jun 2025 14:34:11 +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 555EYBTu056806; Thu, 5 Jun 2025 14:34:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EYBSt056803; Thu, 5 Jun 2025 14:34:11 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:11 GMT Message-Id: <202506051434.555EYBSt056803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 173bbdba8f51 - main - net80211: add more information elements (IEs) definitions 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 173bbdba8f5197f5514100846727726b0875a39a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=173bbdba8f5197f5514100846727726b0875a39a commit 173bbdba8f5197f5514100846727726b0875a39a Author: Bjoern A. Zeeb AuthorDate: 2020-12-08 14:59:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 14:33:38 +0000 net80211: add more information elements (IEs) definitions Annotate a few which are obsolete (gone). Naming as usual is questionable and I contemplated using the names from wpa with a different prefix but then we end up with another mix. While updating the reference to the newer standard I haven't made a full pass again and I cannot say which version I used in 2020. The motivation for this is to get rid of unknown IEs displayed in ifconfig and elsewhere. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 50982d26e45ba (MMIC -> MGMT_MIC) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50671 --- sys/net80211/ieee80211.h | 131 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 8 deletions(-) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 90b329500128..0551f46af2e5 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -1101,7 +1101,7 @@ struct ieee80211_ie_vht_txpwrenv { /* * Management information element payloads. * - * 802.11-2016 Table 9-77 (Element IDs). + * 802.11-2020 Table 9-92 (Element IDs). */ enum { @@ -1113,7 +1113,10 @@ enum { IEEE80211_ELEMID_TIM = 5, IEEE80211_ELEMID_IBSSPARMS = 6, IEEE80211_ELEMID_COUNTRY = 7, + /* 8, 9 reserved */ + IEEE80211_ELEMID_REQUEST = 10, IEEE80211_ELEMID_BSSLOAD = 11, + IEEE80211_ELEMID_EDCA_PARAM_SET = 12, IEEE80211_ELEMID_TSPEC = 13, IEEE80211_ELEMID_TCLAS = 14, IEEE80211_ELEMID_CHALLENGE = 16, @@ -1129,29 +1132,77 @@ enum { IEEE80211_ELEMID_QUIET = 40, IEEE80211_ELEMID_IBSSDFS = 41, IEEE80211_ELEMID_ERP = 42, + IEEE80211_ELEMID_TS_DELAY = 43, + IEEE80211_ELEMID_TCLAS_PROCES = 44, IEEE80211_ELEMID_HTCAP = 45, IEEE80211_ELEMID_QOS = 46, IEEE80211_ELEMID_RESERVED_47 = 47, IEEE80211_ELEMID_RSN = 48, + /* 49 reserved */ IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_APCHANREP = 51, - IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, + IEEE80211_ELEMID_NEIGHBOR_REP = 52, + IEEE80211_ELEMID_RCPI = 53, + IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, + IEEE80211_ELEMID_FAST_BSS_TRANS = 55, /* FTE */ + IEEE80211_ELEMID_TIMEOUT_INTVL = 56, + IEEE80211_ELEMID_RIC_DATA = 57, /* RDE */ + IEEE80211_ELEMID_DSE_REG_LOC = 58, + IEEE80211_ELEMID_SUP_OP_CLASS = 59, + IEEE80211_ELEMID_EXT_CHAN_SW_A = 60, IEEE80211_ELEMID_HTINFO = 61, IEEE80211_ELEMID_SECCHAN_OFFSET = 62, + IEEE80211_ELEMID_BSS_AVG_D_ACC = 63, + IEEE80211_ELEMID_ANTENNA = 64, + IEEE80211_ELEMID_RSNI = 65, + IEEE80211_ELEMID_MEAS_PILOT_TRANS = 66, + IEEE80211_ELEMID_BSS_AVAIL_AD_CAP = 67, + IEEE80211_ELEMID_BSS_AC_ACC_D = 68, + IEEE80211_ELEMID_TIME_ADV = 69, IEEE80211_ELEMID_RRM_ENACAPS = 70, IEEE80211_ELEMID_MULTIBSSID = 71, IEEE80211_ELEMID_COEX_2040 = 72, IEEE80211_ELEMID_INTOL_CHN_REPORT = 73, IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM = 74, - IEEE80211_ELEMID_MMIC = 76, + IEEE80211_ELEMID_RIC_DESC = 75, + IEEE80211_ELEMID_MGMT_MIC = 76, + IEEE80211_ELEMID_MMIC = 76, /* To be removed */ + /* = 77, */ + IEEE80211_ELEMID_EVENT_REQ = 78, + IEEE80211_ELEMID_EVENT_REP = 79, + IEEE80211_ELEMID_DIAGNOSTIC_REQ = 80, + IEEE80211_ELEMID_DIAGNOSTIC_REP = 81, + IEEE80211_ELEMID_LOCATION_PARAM = 82, + IEEE80211_ELEMID_NONTRANS_BSSID_CAP = 83, + IEEE80211_ELEMID_SSID_LIST = 84, + IEEE80211_ELEMID_MULTI_BSS_ID = 85, + IEEE80211_ELEMID_FMS_DESC = 86, + IEEE80211_ELEMID_FMS_REQ = 87, + IEEE80211_ELEMID_FMS_RESP = 88, + IEEE80211_ELEMID_QOS_TRAFFIC_CAP = 89, + IEEE80211_ELEMID_BSS_MAX_IDLE_P = 90, IEEE80211_ELEMID_TSF_REQ = 91, IEEE80211_ELEMID_TSF_RESP = 92, IEEE80211_ELEMID_WNM_SLEEP_MODE = 93, IEEE80211_ELEMID_TIM_BCAST_REQ = 94, IEEE80211_ELEMID_TIM_BCAST_RESP = 95, - IEEE80211_ELEMID_TPC = 150, - IEEE80211_ELEMID_CCKM = 156, - IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ + IEEE80211_ELEMID_COL_INTERF_REP = 96, + IEEE80211_ELEMID_CHAN_USAGE = 97, + IEEE80211_ELEMID_TIME_ZONE = 98, + IEEE80211_ELEMID_DMS_REQ = 99, + IEEE80211_ELEMID_DMS_RESP = 100, + IEEE80211_ELEMID_LINK_ID = 101, + IEEE80211_ELEMID_WAKEUP_SCHED = 102, + /* = 103, */ + IEEE80211_ELEMID_CHAN_SW_TIMING = 104, + IEEE80211_ELEMID_PTI_CONTROL = 105, + IEEE80211_ELEMID_TPU_BUF_STATUS = 106, + IEEE80211_ELEMID_INTERWORKING = 107, + IEEE80211_ELEMID_ADV_PROTO = 108, + IEEE80211_ELEMID_EXP_BW_REQ = 109, + IEEE80211_ELEMID_QOS_MAP = 110, + IEEE80211_ELEMID_ROAM_CONSORT = 111, + IEEE80211_ELEMID_EMERG_ALERT_ID = 112, /* * 802.11s IEs @@ -1181,17 +1232,81 @@ enum { IEEE80211_ELEMID_MESHPXU = 137, IEEE80211_ELEMID_MESHPXUC = 138, IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ + /* XXX 139 */ + + IEEE80211_ELEMID_MIC = 140, + IEEE80211_ELEMID_DEST_URI = 141, + IEEE80211_ELEMID_U_APSD_COEX = 142, + IEEE80211_ELEMID_DMG_WAKEUP_SCHED = 143, + IEEE80211_ELEMID_EXT_SCHED = 144, + IEEE80211_ELEMID_STA_AVAIL = 145, + IEEE80211_ELEMID_DMG_TSPEC = 146, + IEEE80211_ELEMID_NEXT_DMG_ATI = 147, + IEEE80211_ELEMID_DMG_CAP = 148, + /* 149-150 reserved. */ + IEEE80211_ELEMID_TPC = 150, /* XXX: remove */ + + IEEE80211_ELEMID_DMG_OPER = 151, + IEEE80211_ELEMID_DMG_BSS_PARAM_CHANGE = 152, + IEEE80211_ELEMID_DMG_BEAM_REF = 153, + IEEE80211_ELEMID_CHAN_MEAS_FEEDB = 154, + /* 155-156 reserved. */ + IEEE80211_ELEMID_CCKM = 156, /* XXX: remove? */ + IEEE80211_ELEMID_AWAKE_WIN = 157, + IEEE80211_ELEMID_MULTI_BAND = 158, + IEEE80211_ELEMID_ADDBA_EXT = 159, + + IEEE80211_ELEMID_NEXTPCP_LIST = 160, + IEEE80211_ELEMID_PCP_HANDOVER = 161, + IEEE80211_ELEMID_DMG_LINK_MARGIN = 162, + IEEE80211_ELEMID_SW_STREAM = 163, + IEEE80211_ELEMID_SESS_TRANS = 164, + IEEE80211_ELEMID_DYN_TONE_PAIR_REP = 165, + IEEE80211_ELEMID_CLUSTER_REP = 166, + IEEE80211_ELEMID_RELAY_CAP = 167, + IEEE80211_ELEMID_RELAY_TRANS_PARAM_SET = 168, + IEEE80211_ELEMID_BEAMLINK_MAINT = 169, + IEEE80211_ELEMID_MULTI_MAC_SUBL = 170, + IEEE80211_ELEMID_U_PID = 171, + IEEE80211_ELEMID_DMG_LINK_ADAP_ACK = 172, + /* 173 reserved. */ + IEEE80211_ELEMID_MCCAOP_ADV_OV = 174, + IEEE80211_ELEMID_QUIET_PERIOD_REQ = 175, + /* 176 reserved. */ + IEEE80211_ELEMID_QUIET_PERIOD_RESP = 177, + /* 178-180 reserved. */ + IEEE80211_ELEMID_QMF_POLICY = 181, + IEEE80211_ELEMID_ECAPC_POLICY = 182, + IEEE80211_ELEMID_CLUSTER_TIME_OFFSET = 183, + IEEE80211_ELEMID_INTRA_ACC_CAT_PRIO = 184, + IEEE80211_ELEMID_SCS_DESCR = 185, + IEEE80211_ELEMID_QLOAD_REPORT = 186, + IEEE80211_ELEMID_HCCA_TXOP_UP_CNT = 187, + IEEE80211_ELEMID_HL_STREAM_ID = 188, + IEEE80211_ELEMID_GCR_GROUP_ADDR = 189, + IEEE80211_ELEMID_ANTENNA_SECTOR_ID_PAT = 190, - /* 802.11ac-2013, Table 8-54-Element IDs */ IEEE80211_ELEMID_VHT_CAP = 191, IEEE80211_ELEMID_VHT_OPMODE = 192, + IEEE80211_ELEMID_EXTENDED_BSS_LOAD = 193, IEEE80211_ELEMID_WIDE_BW_CHANNEL_SWITCH = 194, - IEEE80211_ELEMID_VHT_PWR_ENV = 195, + IEEE80211_ELEMID_VHT_PWR_ENV = 195, /* TX_PWR_ENV */ IEEE80211_ELEMID_CHANNEL_SWITCH_WRAPPER = 196, IEEE80211_ELEMID_AID = 197, IEEE80211_ELEMID_QUIET_CHANNEL = 198, IEEE80211_ELEMID_OPMODE_NOTIF = 199, + IEEE80211_ELEMID_UPSIM = 200, + IEEE80211_ELEMID_RED_NEIGH_REP = 201, + IEEE80211_ELEMID_TVHT_OP = 202, + /* 203 reserved. */ + IEEE80211_ELEMID_DEVICE_LOC = 204, + IEEE80211_ELEMID_WHITE_SPACE_MAP = 205, + IEEE80211_ELEMID_FINE_TIME_MEAS_PARAM = 206, + /* 207-220 reserved. */ + IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ + /* 222-254 reserved. */ + IEEE80211_ELEMID_EXTFIELD = 255 }; struct ieee80211_tim_ie { From nobody Thu Jun 5 14:34:13 2025 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 4bCn5K61wjz5xvFr; Thu, 05 Jun 2025 14:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCn5K3z3Bz3XJ1; Thu, 05 Jun 2025 14:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OAzlLM2p4w4VRW66r9H5LQ9kjUrZqiT1o72fx7lMYwc=; b=c98FFe5VrQWImh49VWUsSqUmY7Vpiw+KV+/xcB4EXYGyWoSeieQCSjTE3lY4BFHwU12uD/ VOwrtm1oJuymOIhzHCK9U7yt363+9q79jnRVhAM9fk9XUv0rNVf5+PnJBZBYYEf1tMhevQ QNJXcVAFrkCc3cgYzudMAxkIFzhzylP1Jl/Iz3YWzahCUzATAUuWBNMpo0BPePeBnoyKTw ToeYf0cXLXtOrfNkkzM5S43aYA8lkxTYSmB5q0Mq7otZpyjNpjl/amx8aP822ph2+eeYVk I9zGEF9eFDHV5ixGSgR8hC1iSMQ5VAXVspkSfTRnDznA4TsQ2WAdQIV4xnWL9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OAzlLM2p4w4VRW66r9H5LQ9kjUrZqiT1o72fx7lMYwc=; b=XPafqfgwvvaekQWJMVb9THEGgD+2yu66JOWQccaoiKs68TBAeyPw5DxjifV8FrCr1H73WL POdgYIVFWNo+F8c1CF3mmn0BTwhIqxIKxm7nM1Jpr9PVMMpBffBWR6RuarASKXNCAbAtSB 9ZOWqZBQNqq7MwWfZJGY02lIx3uOAMOD4jMmlP7y97w6m3zForh9NwZnr+td59qHFi/6Sp Eqd/2PeG7fhPnkWkoFbPqT3wT7ZVZItlI00OtfHI27zd3NdVAmESjKW0uaH8wCxsrN+jRC 95wD9TTO1Z50nx3UUP28rsx/u2nft0mPZ5F60R5EiycOSvCS4vHYvKorgv61ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134053; a=rsa-sha256; cv=none; b=qz1JCRfnuJYB8Sg3GIjOUpsZdyDFEQbLsFUGTcBTwwdDR2VNO8U86W7oZHVVueIAfp9gtL vyXm6sh/Ki1i4XFa5l2YacwXhEpIS3koj2I/6/5WI38t2OKyOCr0WuGwsD41n6XHnut+9Q DkWVxAdIpy3xbM1H5qvWzS7ikcRd6Cvmi8y7hHlsrLXETzFxKntNVnmfeWv+pmpvAu+6jT 63171Kcxw8VUGCFDQdZxiB5Utv/APzun8qC0OrDEMmlGOleiAheDr2rv0mPQd45+RAbn5m lfx9RcqnVBcP/UfvVEewUjuahHI5rtd4tBtnBe0g6oEGCIm+g7NHaUHpuFjPKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5K3Q2Rz1CBG; Thu, 05 Jun 2025 14:34:13 +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 555EYD00056883; Thu, 5 Jun 2025 14:34:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EYDH0056880; Thu, 5 Jun 2025 14:34:13 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:13 GMT Message-Id: <202506051434.555EYDH0056880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fa02d9fceab7 - main - net80211: add the beginning of the extfield information elements (IE ext) 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa02d9fceab7d452d5b3312a89b4e7b95529edcd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fa02d9fceab7d452d5b3312a89b4e7b95529edcd commit fa02d9fceab7d452d5b3312a89b4e7b95529edcd Author: Bjoern A. Zeeb AuthorDate: 2025-06-02 16:00:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 14:33:50 +0000 net80211: add the beginning of the extfield information elements (IE ext) The original list of IEs got expanded from TLV to TLextTV. If the T matches 255 then we have a second list of IEs where the meaning of TL stays the same. That means the 1 octet extT is part of the length and the value starts at ie+3. Start populating the list with IEEE802.11-2020 and 802.11ax-2021 values. They will be initially used to start decoding some of the announced IEs for ifconfig [-v] list (scan|sta). That should help users with AX-enabled APs to see this (rather than no or UNKNOWN_ELEMID_255 and make debugging easier once we implement 11ax. Sposored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50674 --- sys/net80211/ieee80211.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index bab74d0ca41c..cca721e6b54e 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -1102,6 +1102,7 @@ struct ieee80211_ie_vht_txpwrenv { * Management information element payloads. * * 802.11-2020 Table 9-92 (Element IDs). + * 802.11ax-2021 */ enum { @@ -1343,6 +1344,74 @@ enum { IEEE80211_ELEMID_EXTFIELD = 255 }; +enum ieee80211_elemid_ext { + IEEE80211_ELEMID_EXT_ASSOC_DELAY_INFO = 1, + IEEE80211_ELEMID_EXT_FILS_REQ_PARAMS = 2, + IEEE80211_ELEMID_EXT_FILS_KEY_CONFIRM = 3, + IEEE80211_ELEMID_EXT_FILS_SESSION = 4, + IEEE80211_ELEMID_EXT_FILS_HLP_CONTAINER = 5, + IEEE80211_ELEMID_EXT_FILS_IP_ADDR_ASSIGNMENT = 6, + IEEE80211_ELEMID_EXT_KEY_DELIVERY = 7, + IEEE80211_ELEMID_EXT_FILS_WRAPPED_DATA = 8, + IEEE80211_ELEMID_EXT_FTM_SYNC_INFO = 9, + IEEE80211_ELEMID_EXT_EXT_REQ = 10, + IEEE80211_ELEMID_EXT_EST_SERVICE_PARAM_INBOUND = 11, + IEEE80211_ELEMID_EXT_FILS_PUBLIC_KEY = 12, + IEEE80211_ELEMID_EXT_FILS_NONCE = 13, + IEEE80211_ELEMID_EXT_FUTURE_CHAN_GUIDANCE = 14, + IEEE80211_ELEMID_EXT_SERVICE_HINT = 15, + IEEE80211_ELEMID_EXT_SERVICE_HASH = 16, + IEEE80211_ELEMID_EXT_CDMG_CAPA = 17, + IEEE80211_ELEMID_EXT_DYN_BW_CTRL = 18, + IEEE80211_ELEMID_EXT_CDMG_EXT_SCHEDULE = 19, + IEEE80211_ELEMID_EXT_SSW_REPORT = 20, + IEEE80211_ELEMID_EXT_CLUSTER_PROBE = 21, + IEEE80211_ELEMID_EXT_EXT_CLUSTER_REPORT = 22, + IEEE80211_ELEMID_EXT_CLUSTER_SW_ANNOUNCEMENT = 23, + IEEE80211_ELEMID_EXT_ENHANCED_BEAM_TRACKING = 24, + IEEE80211_ELEMID_EXT_SPSH_REPORT = 25, + IEEE80211_ELEMID_EXT_CLUSTER_INTERF_ASSESS = 26, + IEEE80211_ELEMID_EXT_CMMG_CAPA = 27, + IEEE80211_ELEMID_EXT_CMMG_OPER = 28, + IEEE80211_ELEMID_EXT_CMMG_OPMODE_NOTIF = 29, + IEEE80211_ELEMID_EXT_CMMG_LINK_MARGIN = 30, + IEEE80211_ELEMID_EXT_CMMG_LINK_ADAP_ACK = 31, + /* 32 reserved. */ + IEEE80211_ELEMID_EXT_PASSWORD_ID = 33, + IEEE80211_ELEMID_EXT_GLK_GCR_PARAM_SET = 34, + IEEE80211_ELEMID_EXT_HE_CAPA = 35, + IEEE80211_ELEMID_EXT_HE_OPER = 36, + IEEE80211_ELEMID_EXT_UORA_PARAM_SET = 37, + IEEE80211_ELEMID_EXT_MU_EDCA_PARAM_SET = 38, + IEEE80211_ELEMID_EXT_SPATIAL_REUSE_PARAM_SET = 39, + IEEE80211_ELEMID_EXT_GAS_EXTENSION = 40, + IEEE80211_ELEMID_EXT_NDP_FEEDB_REPORT_PARAM = 41, + IEEE80211_ELEMID_EXT_BSS_COLOR_CHG_ANNOUNCE = 42, + IEEE80211_ELEMID_EXT_QUIET_TIMME_PERIOD = 43, + IEEE80211_ELEMID_EXT_VENDOR_SPECIFIC_REQ_ELEM = 44, + IEEE80211_ELEMID_EXT_ESS_REPORT = 45, + IEEE80211_ELEMID_EXT_OPS = 46, + IEEE80211_ELEMID_EXT_HE_BSS_LOAD = 47, + /* 48-51 reserved. */ + IEEE80211_ELEMID_EXT_MAC_CH_SW_TIME = 52, + IEEE80211_ELEMID_EXT_EST_SERVICE_PARAM_OUTBOUND = 53, + IEEE80211_ELEMID_EXT_OCI = 54, + IEEE80211_ELEMID_EXT_MULTI_BSSID_CONFIG = 55, + IEEE80211_ELEMID_EXT_NON_INHERITANCE = 56, + IEEE80211_ELEMID_EXT_KNOWN_BSSID = 57, + IEEE80211_ELEMID_EXT_SHORT_SSID_LIST = 58, + IEEE80211_ELEMID_EXT_HE_6GHZ_BAND_CAPA = 59, + IEEE80211_ELEMID_EXT_ULMU_POWER_CAAP = 60, + /* 61-87 reserved. */ + IEEE80211_ELEMID_EXT_MSCS_DESCRIPTOR = 88, + IEEE80211_ELEMID_EXT_TCLAS_MASK = 89, + IEEE80211_ELEMID_EXT_SUPPL_CLASS_2_CAPA = 90, + IEEE80211_ELEMID_EXT_OCT_SOURCE = 91, + IEEE80211_ELEMID_EXT_REJECTED_GROUPS = 92, + IEEE80211_ELEMID_EXT_ANTI_CLOGGING_TAOKEN_CONTAINER = 93, + /* 94-255 reserved. */ +}; + struct ieee80211_tim_ie { uint8_t tim_ie; /* IEEE80211_ELEMID_TIM */ uint8_t tim_len; From nobody Thu Jun 5 14:34:12 2025 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 4bCn5J4xNQz5xvJ3; Thu, 05 Jun 2025 14:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCn5J2fPFz3X8j; Thu, 05 Jun 2025 14:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8fadunbxPM63QXu661kpjXQw8yP2qVXTpc/zCfK6II=; b=BUnzNkQ54EJnUs7nTVOBOs72/PKCGfPQoAly+/f/lygiu7gpp3YgW3qUrEmhk2d0oUpVP3 waXzIXFMSw1bBXSenW5VNo7OczXLVszWU4Kb08dnRcBfQM2Sur14aDusAWP+SQnJjtY/XT b/OBraYRbKPhowcBWZJ/mn95bzIch+y+E7Lxj5TyllSicxFekkVZTGLBbKZKRRd7gK63mL oTdPn5bdW0yEGyJvjE1RsXtS+6il3MAQh9p4WYaw4ySE+9ui5L+TcFnwqHO7KREO8+kAxV KUzt4tINkfc/7ZFIP8KE/Cnn6XfJc8Yv2lckA2/28+BDQcR0hMw2HVEJDxf+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749134052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8fadunbxPM63QXu661kpjXQw8yP2qVXTpc/zCfK6II=; b=hbSrgKxA7fFNnbKmguzhHUsIm4w2kDsMHqKUe2MGYyqvEZsRwo0kWYNT7B+JrCHPUwh7uL ztfMWvNH6ESa+k0yHA7Yb3CG7a/oM0JrXTaDEcJGhNdBFIDRrcoL+FKWKZ06cjPtCstBI1 nOOIs/HyWw7dmeUANU5pIz0oq7jDA2nj/uqdMVToc2kJ4TWb8J+QkyVvriCpTQjw9fvrmE Jjrp84owOjUh1sPvSEzKI4Ma6JBUY0YbohbUGtDt99XTS6lgOOcUKtFZqstZ34/DISYXLp ZKGHD/83alAq+n0C1x1OXM//FMPhc6gKzBfTT5Zabv2o95bGvIsZEZ5xxN7Phg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749134052; a=rsa-sha256; cv=none; b=x6nIpVXH/yEKYbD6XS0ENKI21VKC+i8ytSH99Kx6rIXtFUYL28vDsTHJ0U+yyxdsMuluh1 CVy3DUEyZLspYP6z2ig7CX1t/n03Usp9KuRBjefCc2kgcxKtgw0PmMhUdU2KxAgvoTgnbV z0tenWZiOeeHvlGZv/haanGilRbReL8QBPhR2EMxiRZWazf3ytMedtsTRlHZ7U0XcXNQK4 j4Tg3AFe8/GmZfLMhlI6RA5uFJf5NWVrMOjS42AHGp6aKkVqNSj08JLKr5fSoN8KaR8uCR 4yEgndBKxai23n8P+Lu+efl2uFZtn1I0KG6LORp5W2xJUTs4rC0p8+q0AkJF2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCn5J2BCHz1C01; Thu, 05 Jun 2025 14:34:12 +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 555EYCQb056841; Thu, 5 Jun 2025 14:34:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555EYCQs056838; Thu, 5 Jun 2025 14:34:12 GMT (envelope-from git) Date: Thu, 5 Jun 2025 14:34:12 GMT Message-Id: <202506051434.555EYCQs056838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: beb51893cc29 - main - net80211: update IE list for 802.11-2020 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: beb51893cc292f24b3284b1465a58cba4c3059d7 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=beb51893cc292f24b3284b1465a58cba4c3059d7 commit beb51893cc292f24b3284b1465a58cba4c3059d7 Author: Bjoern A. Zeeb AuthorDate: 2025-04-22 20:09:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-05 14:33:50 +0000 net80211: update IE list for 802.11-2020 Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50673 --- sys/net80211/ieee80211.h | 76 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 0551f46af2e5..bab74d0ca41c 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -1107,9 +1107,11 @@ struct ieee80211_ie_vht_txpwrenv { enum { IEEE80211_ELEMID_SSID = 0, IEEE80211_ELEMID_RATES = 1, - IEEE80211_ELEMID_FHPARMS = 2, + /* 2 Reserved */ + IEEE80211_ELEMID_FHPARMS = 2, /* remove? */ IEEE80211_ELEMID_DSPARMS = 3, - IEEE80211_ELEMID_CFPARMS = 4, + /* 4 Reserved */ + IEEE80211_ELEMID_CFPARMS = 4, /* remove? */ IEEE80211_ELEMID_TIM = 5, IEEE80211_ELEMID_IBSSPARMS = 6, IEEE80211_ELEMID_COUNTRY = 7, @@ -1119,6 +1121,7 @@ enum { IEEE80211_ELEMID_EDCA_PARAM_SET = 12, IEEE80211_ELEMID_TSPEC = 13, IEEE80211_ELEMID_TCLAS = 14, + IEEE80211_ELEMID_SCHEDULE = 15, IEEE80211_ELEMID_CHALLENGE = 16, /* 17-31 reserved for challenge text extension */ IEEE80211_ELEMID_PWRCNSTR = 32, @@ -1136,6 +1139,7 @@ enum { IEEE80211_ELEMID_TCLAS_PROCES = 44, IEEE80211_ELEMID_HTCAP = 45, IEEE80211_ELEMID_QOS = 46, + /* 47 reserved */ IEEE80211_ELEMID_RESERVED_47 = 47, IEEE80211_ELEMID_RSN = 48, /* 49 reserved */ @@ -1143,31 +1147,30 @@ enum { IEEE80211_ELEMID_APCHANREP = 51, IEEE80211_ELEMID_NEIGHBOR_REP = 52, IEEE80211_ELEMID_RCPI = 53, - IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, + IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, /* MDE */ IEEE80211_ELEMID_FAST_BSS_TRANS = 55, /* FTE */ IEEE80211_ELEMID_TIMEOUT_INTVL = 56, IEEE80211_ELEMID_RIC_DATA = 57, /* RDE */ IEEE80211_ELEMID_DSE_REG_LOC = 58, IEEE80211_ELEMID_SUP_OP_CLASS = 59, - IEEE80211_ELEMID_EXT_CHAN_SW_A = 60, - IEEE80211_ELEMID_HTINFO = 61, + IEEE80211_ELEMID_EXT_CSA = 60, + IEEE80211_ELEMID_HTINFO = 61, /* HTOPER */ IEEE80211_ELEMID_SECCHAN_OFFSET = 62, - IEEE80211_ELEMID_BSS_AVG_D_ACC = 63, + IEEE80211_ELEMID_BSS_AVG_ACC_DELAY = 63, IEEE80211_ELEMID_ANTENNA = 64, IEEE80211_ELEMID_RSNI = 65, IEEE80211_ELEMID_MEAS_PILOT_TRANS = 66, IEEE80211_ELEMID_BSS_AVAIL_AD_CAP = 67, - IEEE80211_ELEMID_BSS_AC_ACC_D = 68, + IEEE80211_ELEMID_BSS_AC_ACC_DELAY = 68, IEEE80211_ELEMID_TIME_ADV = 69, - IEEE80211_ELEMID_RRM_ENACAPS = 70, + IEEE80211_ELEMID_RRM_ENACAPS = 70, /* RM_ENCAPS */ IEEE80211_ELEMID_MULTIBSSID = 71, IEEE80211_ELEMID_COEX_2040 = 72, - IEEE80211_ELEMID_INTOL_CHN_REPORT = 73, + IEEE80211_ELEMID_2040_INTOL_CHAN_REPORT = 73, IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM = 74, IEEE80211_ELEMID_RIC_DESC = 75, IEEE80211_ELEMID_MGMT_MIC = 76, - IEEE80211_ELEMID_MMIC = 76, /* To be removed */ - /* = 77, */ + /* 77 reserved */ IEEE80211_ELEMID_EVENT_REQ = 78, IEEE80211_ELEMID_EVENT_REP = 79, IEEE80211_ELEMID_DIAGNOSTIC_REQ = 80, @@ -1175,7 +1178,7 @@ enum { IEEE80211_ELEMID_LOCATION_PARAM = 82, IEEE80211_ELEMID_NONTRANS_BSSID_CAP = 83, IEEE80211_ELEMID_SSID_LIST = 84, - IEEE80211_ELEMID_MULTI_BSS_ID = 85, + IEEE80211_ELEMID_MULTI_BSSID_IDX = 85, IEEE80211_ELEMID_FMS_DESC = 86, IEEE80211_ELEMID_FMS_REQ = 87, IEEE80211_ELEMID_FMS_RESP = 88, @@ -1193,7 +1196,7 @@ enum { IEEE80211_ELEMID_DMS_RESP = 100, IEEE80211_ELEMID_LINK_ID = 101, IEEE80211_ELEMID_WAKEUP_SCHED = 102, - /* = 103, */ + /* 103 reserved */ IEEE80211_ELEMID_CHAN_SW_TIMING = 104, IEEE80211_ELEMID_PTI_CONTROL = 105, IEEE80211_ELEMID_TPU_BUF_STATUS = 106, @@ -1245,7 +1248,6 @@ enum { IEEE80211_ELEMID_DMG_CAP = 148, /* 149-150 reserved. */ IEEE80211_ELEMID_TPC = 150, /* XXX: remove */ - IEEE80211_ELEMID_DMG_OPER = 151, IEEE80211_ELEMID_DMG_BSS_PARAM_CHANGE = 152, IEEE80211_ELEMID_DMG_BEAM_REF = 153, @@ -1255,13 +1257,12 @@ enum { IEEE80211_ELEMID_AWAKE_WIN = 157, IEEE80211_ELEMID_MULTI_BAND = 158, IEEE80211_ELEMID_ADDBA_EXT = 159, - IEEE80211_ELEMID_NEXTPCP_LIST = 160, IEEE80211_ELEMID_PCP_HANDOVER = 161, IEEE80211_ELEMID_DMG_LINK_MARGIN = 162, IEEE80211_ELEMID_SW_STREAM = 163, IEEE80211_ELEMID_SESS_TRANS = 164, - IEEE80211_ELEMID_DYN_TONE_PAIR_REP = 165, + /* 165 reserved. */ IEEE80211_ELEMID_CLUSTER_REP = 166, IEEE80211_ELEMID_RELAY_CAP = 167, IEEE80211_ELEMID_RELAY_TRANS_PARAM_SET = 168, @@ -1285,12 +1286,10 @@ enum { IEEE80211_ELEMID_HL_STREAM_ID = 188, IEEE80211_ELEMID_GCR_GROUP_ADDR = 189, IEEE80211_ELEMID_ANTENNA_SECTOR_ID_PAT = 190, - IEEE80211_ELEMID_VHT_CAP = 191, IEEE80211_ELEMID_VHT_OPMODE = 192, - IEEE80211_ELEMID_EXTENDED_BSS_LOAD = 193, - IEEE80211_ELEMID_WIDE_BW_CHANNEL_SWITCH = 194, + IEEE80211_ELEMID_WIDE_BW_CHAN_SW = 194, IEEE80211_ELEMID_VHT_PWR_ENV = 195, /* TX_PWR_ENV */ IEEE80211_ELEMID_CHANNEL_SWITCH_WRAPPER = 196, IEEE80211_ELEMID_AID = 197, @@ -1303,9 +1302,44 @@ enum { IEEE80211_ELEMID_DEVICE_LOC = 204, IEEE80211_ELEMID_WHITE_SPACE_MAP = 205, IEEE80211_ELEMID_FINE_TIME_MEAS_PARAM = 206, - /* 207-220 reserved. */ + IEEE80211_ELEMID_SIG_OPEN_LOOP_LINK_MARGIN_IDX = 207, + IEEE80211_ELEMID_RPS = 208, + IEEE80211_ELEMID_PAGE_SLICE = 209, + IEEE80211_ELEMID_AID_REQ = 210, + IEEE80211_ELEMID_AID_RESP = 211, + IEEE80211_ELEMID_SIG_SECTOR_OP = 212, + IEEE80211_ELEMID_SIG_BEACON_COMPAT = 213, + IEEE80211_ELEMID_SHORT_BEACON_INTVL = 214, + IEEE80211_ELEMID_CHANGE_SEQ = 215, + IEEE80211_ELEMID_TWT = 216, + IEEE80211_ELEMID_SIG_CAPS = 217, + /* 218-219 reserved. */ + IEEE80211_ELEMID_SUBCHAN_SELECT_TRANS = 220, IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ - /* 222-254 reserved. */ + IEEE80211_ELEMID_AUTH_CONTROL = 222, + IEEE80211_ELEMID_TSF_TIMER_ACC = 223, + IEEE80211_ELEMID_S1G_RELAY = 224, + IEEE80211_ELEMID_REACHABLE_ADDR = 225, + IEEE80211_ELEMID_SIG_RELAY_DISC = 226, + /* 227 reserved. */ + IEEE80211_ELEMID_AID_ANNOUNCEMENT = 228, + IEEE80211_ELEMID_PV1_PROBE_RESP_OPT = 229, + IEEE80211_ELEMID_EL_OP = 230, + IEEE80211_ELEMID_SECTORIZED_GRP_ID_LIST = 231, + IEEE80211_ELEMID_SIG_OP = 232, + IEEE80211_ELEMID_HDR_COMPRESSION = 233, + IEEE80211_ELEMID_SST_OP = 234, + IEEE80211_ELEMID_MAD = 235, + IEEE80211_ELEMID_SIG_RELAY_ACT = 236, + IEEE80211_ELEMID_CAG_NUMBER = 237, + /* 238 reserved. */ + IEEE80211_ELEMID_AP_CSN = 239, + IEEE80211_ELEMID_FILS_INDICATION = 240, + IEEE80211_ELEMID_DILS = 241, + IEEE80211_ELEMID_FRAGMENT = 242, + /* 243 reserved. */ + IEEE80211_ELEMID_RSN_EXT = 244, + /* 245-254 reserved. */ IEEE80211_ELEMID_EXTFIELD = 255 }; From nobody Thu Jun 5 16:45:20 2025 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 4bCr0d3l4hz5y4sQ; Thu, 05 Jun 2025 16:45:21 +0000 (UTC) (envelope-from brooks@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCr0d1FVxz3D7R; Thu, 05 Jun 2025 16:45:21 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749141921; 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=ZF+ZoKol9c6zK6nDhLZIiKSscFtGA48UdWItlafL9Xc=; b=dwQ3Y3RP8xoBCtjlkP/zIpTSeGwYfgBzZHMrCYpBtymSTC7FYUV6G63zJKMG3sHMXW96Ak KUmji1swtO29NFoJRWt6csZafHj52vG9vK1SNhhAPC9U/IXA03BVmUPfJtMPvruW7FjZgS LZcWpl1PGy4NkvoxcKeg/G2CX87D0AELccl5CkvSgMuSlFTKa6XdQWmsX75xwFyOp7nCUk CjhouedUZxpXJrnqcOpioJtNe0NP+mLM9cN7o6F3R9tu2dPZWLlEinb/8Oqdd26zVD7X1o ohiYg64tZ2gJ9sS9nKfkyYxdHvKTskJJG+6KDC5Vi+Azg5t/qDj+6ZjNgAWQ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749141921; 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=ZF+ZoKol9c6zK6nDhLZIiKSscFtGA48UdWItlafL9Xc=; b=Gn0g7Z8ZnkzLqqSSeAk1M2A5TsP/Pq4Z6+Buy5J3voCGwwzg5rBURZtYt43R2m4DKzlhBg c3nZAL5lzGZV631BOODMJGyZ5Q4Ma5bXvGvBh4lnuOyu3BoVroL8zPMGH42wYEMar4hE3G bjjlwycTTweCFA5Q3kLD/xVCMpgSfP+orMKKFCHe1Toh8ue21CvOEnjWWKzKBzorOvlL8c 2RxbMKQUmiYffd/SyS5o/ugm7OzoTsGNqyjUdzyHjC+rHiJLH04AoiehnBFmm7iwHCrY2n Ay/v4FPEYmYG1IgsF2EUNTzRMuhpL8h2ePI39rT278VR9qe55iQvRU8Pk9pG1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749141921; a=rsa-sha256; cv=none; b=JEab5WL3RzdUYuHeXPCsvJKukAw3C5cMThX26qi5tI4WhTiivRB/nlQI7d3S7b0nTtUD7F BOh6txnXr6Xo5fx6y+kC87aC2EAOqOhxt/RGJCO4xtYD6PQ/ZLBUhg3fvlosjYV9AEx7Vn x7v/P1YKEr32e5xMcb9SAizhmZ6Zd2iQd/yW+sRnPY4SR1sdM4+WJgqayQQ7j2SgzmNUVx aV0YbDiW7wTOZzt5MjhlIXyam3DLJsah/6sKegzNAadIHh4LouWv4sg3LzhKy4uaeC/eSZ obE+bV0H71bSD44NFLQwCsvauIukb5W8dukoSCW7GxzkCQYBO5U4wSub2kQmRA== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_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: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bCr0d0RR4z18rX; Thu, 05 Jun 2025 16:45:21 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 677B83C01A0; Thu, 05 Jun 2025 16:45:20 +0000 (UTC) Date: Thu, 5 Jun 2025 16:45:20 +0000 From: Brooks Davis To: Rick Macklem Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6b6542ec8446 - main - open.2: Document the O_NAMEDATTR flag Message-ID: References: <202506042253.554MrDgZ093573@gitrepo.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: <202506042253.554MrDgZ093573@gitrepo.freebsd.org> On Wed, Jun 04, 2025 at 10:53:13PM +0000, Rick Macklem wrote: > The branch main has been updated by rmacklem: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b6542ec84462c9d1fceb43bffb832e0fd556661 > > commit 6b6542ec84462c9d1fceb43bffb832e0fd556661 > Author: Rick Macklem > AuthorDate: 2025-06-04 22:50:16 +0000 > Commit: Rick Macklem > CommitDate: 2025-06-04 22:50:16 +0000 > > open.2: Document the O_NAMEDATTR flag > > Commit 2ec2ba7e232d added support for the O_NAMEDATTR flag to > the open(2) and openat(2) syscalls for main. I must confess I'm quite concernted that we added this when it seems to be unique to FreeBSD. We've very short of O_ bits and when we're out, we're out. I'm not sure we should be adding anything that isn't at least in Linux. -- Brooks From nobody Thu Jun 5 16:54:29 2025 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 4bCrCQ5t9zz5y5qK for ; Thu, 05 Jun 2025 16:54:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (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 4bCrCQ0hqrz3Mvh for ; Thu, 05 Jun 2025 16:54:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7376dd56f8fso1515582b3a.2 for ; Thu, 05 Jun 2025 09:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749142480; x=1749747280; 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=e2wpoMoWNlS0FJ08KMHqlml51wIU/H2aLC3IyJM3BJI=; b=W9GJSL4FXYSKiUyaZPCzLZkT1osTXuGbEF5hcAExDpWuKP6po8FbM2Sd7KzRdyadRH 46O2M9SWGYjMJ9iB1BwDXmhcoPN8qOYCls4gR5MU3z1vGpVX+mRh1vcc7RNFBR2OOhd9 wAwOsmwZZtXENxSMK/oWWjKf/ijuVdIHAKuAiwJSIfrXblzdwNbNBgXOeZWFM2A9gN15 Hp/KTZUWlerXBD8IxIlnZYn37MXEjvXzpBtvzQfVU1Jx1tCSZz/LXIZLs91WWOccXKh7 wBbG799ghe5JcZuV0+bSsx2PNEbEAHcgwasxTzWXNmVUGkB6/9rizWScNiy0ie5jYjVV yTEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749142480; x=1749747280; 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=e2wpoMoWNlS0FJ08KMHqlml51wIU/H2aLC3IyJM3BJI=; b=IJUA7PYBxNWt+aqZytrl3+tdqBIzhsySrzMhqV0eOmRB6opMIW35hmLb6hEn6dfhjN al124980t5NwcAftwZ4CY+MixesBPLpRDQViguzRzcZE4Hke2Bz1Zf+HX2wppLGUoxNV sVw0Mg8UnMEmgRZ4L2jSa4HEk2aD4Y+U9Fkz1zS0K1HbhOcB6W/TM8xez+x9xHfY3lpu MAH2RQa85QLERH42zacUVKwa+XWmQbZFRun+QIvoYdBbczS45oVoHgDm9DmLcLlQa+iq fI07LJ+2J5a3RhwzJnkQgILwFGvUY5xTJVO42iWZ2/ttgya/D58a+IU1it1Kw5Kb2+Ke ERWw== X-Forwarded-Encrypted: i=1; AJvYcCV2fw+KRWaGNHa/asF28JwqwaUra3Cx1dezQ70x1shNTrFOHw8jcEvmHLuZEbiDaXlhelOdHs9isOP7jEZ30i9er8T/DA==@freebsd.org X-Gm-Message-State: AOJu0YwlgQqYGS0LBnlXAlhyyCpmxphKL5mr1QLGw1abX77Bl3780avZ 5eS+oxhm8p6lr1qUPVOidoWJvBAXqkjk1W7B1wJB5POUrQn8vN+RP2O+EXDGGErGvfFTy42Nsg7 R3HgiDJKhhuVDj6EFBCsYh7a/4O1YytbtmebRaGu6sw== X-Gm-Gg: ASbGncuecVAT5sP+ZY2vRFKMn41Ngc21CfxCQ8GCe/y6PdA/Ws6CXk0v7/CcVmm3Ul8 6sCtFY7uMVG1aGVUQP85xiuFQnFt8nHqil4vRiU6JBuJKlaVa1ReQORpCJ8IIoL7erlWlrtryVK EDZhpPGa8zXt8P/LV3Nh204vgofGtdpjc+aZu+Jy8GS1I= X-Google-Smtp-Source: AGHT+IF3WXSewx/UOm3txGx9FHtpTUzb6UelQoeXjxBmQEqf4+BLfH/Y2baewkfs7VyY4LMimXVZf63DY1vR5mmXrrU= X-Received: by 2002:a05:6a00:2309:b0:740:595a:f9bf with SMTP id d2e1a72fcca58-74827e513b6mr668123b3a.3.1749142480330; Thu, 05 Jun 2025 09:54: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: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> In-Reply-To: <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> From: Warner Losh Date: Thu, 5 Jun 2025 09:54:29 -0700 X-Gm-Features: AX0GCFv9cidmdtF6utjvCBVBtj70v0Fko3ZQ_occvp9FLy9-smmt1_M8NjQF1qY Message-ID: Subject: Re: git: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument To: John Baldwin Cc: Kyle Evans , Gleb Smirnoff , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bCrCQ0hqrz3Mvh 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] On Thu, Jun 5, 2025 at 6:14=E2=80=AFAM John Baldwin wrote= : > > On 6/4/25 19:03, Kyle Evans wrote: > > On 6/4/25 17:55, Gleb Smirnoff wrote: > >> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: > >> K> The branch main has been updated by kevans: > >> K> > >> K> URL: https://cgit.FreeBSD.org/src/commit/?id=3D969f6380eb66f809eed3= e5c38b6021824a4cc2bf > >> K> > >> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf > >> K> Author: Kyle Evans > >> K> AuthorDate: 2025-06-04 01:51:06 +0000 > >> K> Commit: Kyle Evans > >> K> CommitDate: 2025-06-04 01:51:06 +0000 > >> K> > >> K> kdump: nicer printing of kill(2) PID argument > >> K> > >> K> Similar to wait*(), kill(2) operates on a pid that currently ge= ts output > >> K> as hex. Output it in decimal to make it a little easier to eye= ball the > >> K> pid we're signalling. > >> K> > >> K> Reviewed by: markj > >> K> Differential Revision: https://reviews.freebsd.org/D50508 > >> > >> I didn't review if PIDs are always printed as decimals or not, but for > >> the file descriptors it is a mix of hex and decimals. :( Usually I go > >> with a sed script over kdump output to make it consistent. > >> > > > > To be fair, I'd like to fix that, too- I noticed close() the other day > > for fd > 0, but paused when I: > > > > 1.) couldn't tell where we even output close args > > close is probably handled by the default case where where all of the > arguments are just output as hex values. Note that for kdump, most > syscalls fall into this case including syscalls with pointer arguments. > You'd probably be a bit sad with 64-bit pointers printed as decimal > for many system calls. > > truss is different as truss stores some rudimentary type information abou= t > system call arguments and then defaults to printing certain types like > file descriptors and ids as decimal. truss also prints NULL for null > pointers IIRC. > > A useful project perhaps would be to move the table describing system > call argument types out of syscalls.c in truss and into libsysdecode so > that kdump could also reuse it. Probably the API you would want is > something that returns an individual `struct syscall_decode` given > (ABI, number) input arguments. Yes. All this generation is why we did the lua project to make the master system call table parsing into a library. We need it also for qemu-bsd-user long-term: writing new system calls by hand is a pain and error-prone. > I don't think you can generate this table automatically from makesyscalls= .lua > as many of the "types" truss uses are synthetic types that aren't visible > in C, e.g. "OpenFlags" meaning O_* flags passed to open(2). I think that we should, in the fullness of time, flag these so we can do that. If we do add additional notations, we can not only have better truss/trace output, as well as being able to generate the right flag translations for running FreeBSD binaries on Linux (which people are doing by hand right now...). > This would allow kdump's hand-written per-syscall-number rules to instead > be closer to truss where you instead just iterate over types. It would > also mean only having to update a single table in libsysdecode when addin= g > a new system call to add both truss and kdump support. Only when a new > argument type is added would one have to actually touch truss or kdump > directly. I'd love for this to be generated as well... It was certainly one of the use cases that we had in mind for the GSOC project that did this. Warner From nobody Thu Jun 5 17:59:14 2025 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 4bCsdw0D6Jz5y9cD; Thu, 05 Jun 2025 17:59:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCsdv6bJfz4GLV; Thu, 05 Jun 2025 17:59:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749146355; 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=Y1qzbT546QYMtfRvmBpG+mE/3WMji0RthNbMdJUHAdg=; b=M/M6HZB6Bdj1M4F1a+vl6MdjWa3PSubRs+K5ZX8X2i8rH+ewGOwHcQhpZxCeVhBiDfVDdE SE7s+kgdfW+ZFKbEoFi6h3OfWI3ngWx5oq65XWU1owznBLgraWSx2jEaPkZkmCwTM2dOUL W1+7+ucfLB5v8s3bTaXwxwWenAB15rcByFfSc26C1df1iA+Btt/0REO+0Bw2WG7xFhPrXn kMyJcUmsdyV1kcQ0GBo62ukm90O6Y6SmySSpZkZyh5EQ/WISIc6La990sB4Mtqv58NxoPc ourB01OXbJC1a3iW+hFcjkNQ4OMAQHcQ656LP67vxHK2l5bHN0h+oC1vCVTYEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749146355; 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=Y1qzbT546QYMtfRvmBpG+mE/3WMji0RthNbMdJUHAdg=; b=URAVNUEBgYPKslgnBG07g6sw6N5wGR4obcn4d9awPXQ5wrKswlhk38jQvnDF8TaP601BCs suHWZiFoLhz/QBLssRoDt4uWhYeFj8tNNkDHmdJukgUFPKM6L/vHcAqjJx/F8CSJx745sy 89PinyM1RAvQ4zk4v2N2VDK5jUygmUhAT9P3y3MukP5kWhwM4ZBh3V7a6QVIPXCqFMoA5E UUtN4dHr8doSXRqKYRiA3wCLJgwS+co1njPsiRr+qOHBJgUzQ7VWyDvKSFWAyNsOashjLh wc+mystkO+0OoWpD+heNurdFo02xnFrS7/PjEc3v8BpgwbEQXXtplqSfWJwbyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749146355; a=rsa-sha256; cv=none; b=BLhW3x0YcF26rqUZl+BhqFUBX1xLWttPnIpOtyXTCm02HA4ngSmrCD0H9GTk1m2rVrleus gd+jvG71tO9bDBg/sJnasZs6jFstSUWfjZv79yP389GIKRTIjE+3w9SHlhTP64FnJvS0gO vl1HuNbpD62O/fIvNedBo5Hrj3HKfcTDge3CWnB6W4mbL1n9asTK5M3t0AoAs0yJWSCkff kwjRRFDuoSCJgl+dYeyYduQPspIqYov3cY8q/plvzZFQ/P6sepFSsV36VveApwUNiPpL/W V41q4EcCwhVI5euB1WUvv+XZuFMHJpX55hy8OICAzbqiKwltaOfPCjZIyVOU2g== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bCsdv1L9dz196s; Thu, 05 Jun 2025 17:59:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <701efeb3-3a7e-42fe-ba18-eaf1862c7a3f@FreeBSD.org> Date: Thu, 5 Jun 2025 12:59:14 -0500 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: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument To: Warner Losh , John Baldwin Cc: Gleb Smirnoff , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/5/25 11:54, Warner Losh wrote: > On Thu, Jun 5, 2025 at 6:14 AM John Baldwin wrote: >> >> On 6/4/25 19:03, Kyle Evans wrote: >>> On 6/4/25 17:55, Gleb Smirnoff wrote: >>>> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: >>>> K> The branch main has been updated by kevans: >>>> K> >>>> K> URL: https://cgit.FreeBSD.org/src/commit/?id=969f6380eb66f809eed3e5c38b6021824a4cc2bf >>>> K> >>>> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf >>>> K> Author: Kyle Evans >>>> K> AuthorDate: 2025-06-04 01:51:06 +0000 >>>> K> Commit: Kyle Evans >>>> K> CommitDate: 2025-06-04 01:51:06 +0000 >>>> K> >>>> K> kdump: nicer printing of kill(2) PID argument >>>> K> >>>> K> Similar to wait*(), kill(2) operates on a pid that currently gets output >>>> K> as hex. Output it in decimal to make it a little easier to eyeball the >>>> K> pid we're signalling. >>>> K> >>>> K> Reviewed by: markj >>>> K> Differential Revision: https://reviews.freebsd.org/D50508 >>>> >>>> I didn't review if PIDs are always printed as decimals or not, but for >>>> the file descriptors it is a mix of hex and decimals. :( Usually I go >>>> with a sed script over kdump output to make it consistent. >>>> >>> >>> To be fair, I'd like to fix that, too- I noticed close() the other day >>> for fd > 0, but paused when I: >>> >>> 1.) couldn't tell where we even output close args >> >> close is probably handled by the default case where where all of the >> arguments are just output as hex values. Note that for kdump, most >> syscalls fall into this case including syscalls with pointer arguments. >> You'd probably be a bit sad with 64-bit pointers printed as decimal >> for many system calls. >> >> truss is different as truss stores some rudimentary type information about >> system call arguments and then defaults to printing certain types like >> file descriptors and ids as decimal. truss also prints NULL for null >> pointers IIRC. >> >> A useful project perhaps would be to move the table describing system >> call argument types out of syscalls.c in truss and into libsysdecode so >> that kdump could also reuse it. Probably the API you would want is >> something that returns an individual `struct syscall_decode` given >> (ABI, number) input arguments. > > Yes. All this generation is why we did the lua project to make the > master system call table parsing into a library. We need it also for > qemu-bsd-user long-term: writing new system calls by hand is a pain > and error-prone. > >> I don't think you can generate this table automatically from makesyscalls.lua >> as many of the "types" truss uses are synthetic types that aren't visible >> in C, e.g. "OpenFlags" meaning O_* flags passed to open(2). > > I think that we should, in the fullness of time, flag these so we can > do that. If we do add additional notations, we can not only have > better truss/trace output, as well as being able to generate the right > flag translations for running FreeBSD binaries on Linux (which people > are doing by hand right now...). > >> This would allow kdump's hand-written per-syscall-number rules to instead >> be closer to truss where you instead just iterate over types. It would >> also mean only having to update a single table in libsysdecode when adding >> a new system call to add both truss and kdump support. Only when a new >> argument type is added would one have to actually touch truss or kdump >> directly. > > I'd love for this to be generated as well... It was certainly one of > the use cases that we had in mind for the GSOC project that did this. > If we don't currently have a GSoC project idea around the above thoughts about truss -> libsysdecode and how we might be able to leverage makesyscalls and/or other annotations for it, maybe that'd be good to fish for in the 2026 program. I'm afraid I don't really have time for more than the sniping of random cases that make my life a tiny bit harder for the foreseeable future. Thanks, Kyle Evans From nobody Thu Jun 5 18:12:45 2025 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 4bCsxs0rHvz5yBhJ for ; Thu, 05 Jun 2025 18:13:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 4bCsxr2Qdgz4QDf for ; Thu, 05 Jun 2025 18:12:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-309fac646adso2451805a91.1 for ; Thu, 05 Jun 2025 11:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749147177; x=1749751977; 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=OqA1pDwgEWff0H7M0pjxY2KaiC5prOJt3eHj9Vjf3mE=; b=QAGl/NCWoQW8W3nLhBlgNjZCKMMfvdHEYdGfm9HlhFGQPvialZ3bvBV8FwraIfENxe QPKecWkGJadEGloB1+uSugppJRtG9hxZJZIf8kv0PeQdTJnQRY+jET66uc5broA69SfH uwtJkwmkIhTVC0hSAQJKfwxI0hd3CVsHBIDIo2z0lrTfB9AsAY6+Cnt3qDRwWidstEYc HjTu70v9s8j/KVlaYwIWwHzIEwVdtgXKzLnw4oJaDZYcdzjdEeCuwBH0zJ+3ed/wLIFB 6quR53YcDroa2irc5BphP29f3QOmu6IDd0xP0O+TcE/m9KRHc0wAlUnRk0eLcFPdSWXE SveA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749147177; x=1749751977; 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=OqA1pDwgEWff0H7M0pjxY2KaiC5prOJt3eHj9Vjf3mE=; b=jxvXLee0w8MUT1NVCAXX5R3rh1U3AKTJ/lDliLfSTjS7uDGhZrd//ziQGvq6IHAye2 S2GNZw8i/YgTX5fjaJMPH4HkODju8mccj1uBIzkqpz9T/PGfFBrxqzieq+LkXc1a9GOt 7jIzJNecwE47w7nwHrKcH6HmuFb1ToImJt67ZJw1GKllW5tGeZZhb7wMTMOruHN5BuRH pF0oo5jJ2zV+QxL7Hxbs7TqmqO43OfXubCN5HXTeh7aOyGn6oMFMIeymPJvPLzOW/AGL VTyNXwDCuXbDu9KG4GjMpyLhM8Q2GrmGwF9h6va9I8DbcMjMCmIL9u5FsOZ2hfgujVEQ LOaQ== X-Forwarded-Encrypted: i=1; AJvYcCU4q1o5zYOseOR7RexOUfTDXlQ+Y9qHDJ4La1YzSvmDWVa7/YLFtHNN6+YoXPt3/kxTIncmTAqx+Zg9GAL2IGBjRkeqMQ==@freebsd.org X-Gm-Message-State: AOJu0Yy9AUpLgpGvGdXlfdEjjuBIu8EOzeLF2nsl6PkL/cbjz6SjHBhk U3VHhyfUv0Svls/NjuBZl/1kCpfoUlq6Xej7WatlTjAMbXrivKhY0eIFjLvUeBGLVVXAh//W/dn HY2NDITIQXOAOslNFLndRJK1lS64Q2tn/w2nESi+rZQ== X-Gm-Gg: ASbGnctgXAfEln4Hw6if1e0hI1Wmho9ScFcCflOBEKIXBOIWFgOAiCZZOsai2hdBbI3 DTTLwDTN4hB/XZRYu77FCaPZVcKnrZWvd6oD3576AvwTkRPTnKnAcU6BoRXL1NIg4+TiYCjzaw1 ZmKKT+TGiH41MutDWtJ6H339+FNOrqThH60AhYiFcnZ0qij7eRJug/NQ== X-Google-Smtp-Source: AGHT+IHpz8gL5WfFV/3GlrNnmSJfH7N/xOqrKJP4SDlnGTOzCO3Z2gTMAh7a+qAnaSBKNWoMozXLkAlU/I/5W+fzGCY= X-Received: by 2002:a17:90b:48d0:b0:312:e751:8213 with SMTP id 98e67ed59e1d1-31349fb548cmr212263a91.13.1749147177457; Thu, 05 Jun 2025 11:12:57 -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: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> <701efeb3-3a7e-42fe-ba18-eaf1862c7a3f@FreeBSD.org> In-Reply-To: <701efeb3-3a7e-42fe-ba18-eaf1862c7a3f@FreeBSD.org> From: Warner Losh Date: Thu, 5 Jun 2025 11:12:45 -0700 X-Gm-Features: AX0GCFsPT5Pm95U3y3l_pis9fx9HAtoOsjge7x-i0CQ9FBggtZ-NtlqyVaNyDpc Message-ID: Subject: Re: git: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument To: Kyle Evans Cc: John Baldwin , Gleb Smirnoff , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bCsxr2Qdgz4QDf 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] On Thu, Jun 5, 2025 at 10:59=E2=80=AFAM Kyle Evans wro= te: > > On 6/5/25 11:54, Warner Losh wrote: > > On Thu, Jun 5, 2025 at 6:14=E2=80=AFAM John Baldwin w= rote: > >> > >> On 6/4/25 19:03, Kyle Evans wrote: > >>> On 6/4/25 17:55, Gleb Smirnoff wrote: > >>>> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: > >>>> K> The branch main has been updated by kevans: > >>>> K> > >>>> K> URL: https://cgit.FreeBSD.org/src/commit/?id=3D969f6380eb66f809ee= d3e5c38b6021824a4cc2bf > >>>> K> > >>>> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf > >>>> K> Author: Kyle Evans > >>>> K> AuthorDate: 2025-06-04 01:51:06 +0000 > >>>> K> Commit: Kyle Evans > >>>> K> CommitDate: 2025-06-04 01:51:06 +0000 > >>>> K> > >>>> K> kdump: nicer printing of kill(2) PID argument > >>>> K> > >>>> K> Similar to wait*(), kill(2) operates on a pid that currently = gets output > >>>> K> as hex. Output it in decimal to make it a little easier to e= yeball the > >>>> K> pid we're signalling. > >>>> K> > >>>> K> Reviewed by: markj > >>>> K> Differential Revision: https://reviews.freebsd.org/D50508 > >>>> > >>>> I didn't review if PIDs are always printed as decimals or not, but f= or > >>>> the file descriptors it is a mix of hex and decimals. :( Usually I = go > >>>> with a sed script over kdump output to make it consistent. > >>>> > >>> > >>> To be fair, I'd like to fix that, too- I noticed close() the other da= y > >>> for fd > 0, but paused when I: > >>> > >>> 1.) couldn't tell where we even output close args > >> > >> close is probably handled by the default case where where all of the > >> arguments are just output as hex values. Note that for kdump, most > >> syscalls fall into this case including syscalls with pointer arguments= . > >> You'd probably be a bit sad with 64-bit pointers printed as decimal > >> for many system calls. > >> > >> truss is different as truss stores some rudimentary type information a= bout > >> system call arguments and then defaults to printing certain types like > >> file descriptors and ids as decimal. truss also prints NULL for null > >> pointers IIRC. > >> > >> A useful project perhaps would be to move the table describing system > >> call argument types out of syscalls.c in truss and into libsysdecode s= o > >> that kdump could also reuse it. Probably the API you would want is > >> something that returns an individual `struct syscall_decode` given > >> (ABI, number) input arguments. > > > > Yes. All this generation is why we did the lua project to make the > > master system call table parsing into a library. We need it also for > > qemu-bsd-user long-term: writing new system calls by hand is a pain > > and error-prone. > > > >> I don't think you can generate this table automatically from makesysca= lls.lua > >> as many of the "types" truss uses are synthetic types that aren't visi= ble > >> in C, e.g. "OpenFlags" meaning O_* flags passed to open(2). > > > > I think that we should, in the fullness of time, flag these so we can > > do that. If we do add additional notations, we can not only have > > better truss/trace output, as well as being able to generate the right > > flag translations for running FreeBSD binaries on Linux (which people > > are doing by hand right now...). > > > >> This would allow kdump's hand-written per-syscall-number rules to inst= ead > >> be closer to truss where you instead just iterate over types. It woul= d > >> also mean only having to update a single table in libsysdecode when ad= ding > >> a new system call to add both truss and kdump support. Only when a ne= w > >> argument type is added would one have to actually touch truss or kdump > >> directly. > > > > I'd love for this to be generated as well... It was certainly one of > > the use cases that we had in mind for the GSOC project that did this. > > > > If we don't currently have a GSoC project idea around the above thoughts > about truss -> libsysdecode and how we might be able to leverage > makesyscalls and/or other annotations for it, maybe that'd be good to > fish for in the 2026 program. I'm afraid I don't really have time for > more than the sniping of random cases that make my life a tiny bit > harder for the foreseeable future. That's a great idea. I've not had the time to write it up with sufficient detail for a gSOC student to want to do it... There's half a dozen different projects we could do to improve somebody's quality of life and implementation... Warner From nobody Thu Jun 5 20:37:46 2025 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 4bCx970c4Lz5yM1k; Thu, 05 Jun 2025 20:38:03 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 4bCx962Tg7z3S9h; Thu, 05 Jun 2025 20:38:02 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-6071ac9dc3eso2228477a12.1; Thu, 05 Jun 2025 13:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749155880; x=1749760680; 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=pywf0pzjKBkZsHRNzan14nzP1MXAtQ7ZoUtlmuT2CTw=; b=R57hSBALCCkLYsSKm3lqBFn0pwBhZpxntCMBwUop3flytyvwhlb+YH1Heqt+w1V0bL NnwQRG2n2me299VjCiAWRczwckL/H5mDsWOctjFHV/ZfKnhPAYDGt9H3IVBB3k5/vS7T SA5SCPDHnkaCkpGzDQsg3lQXWMGLhn55y6rjjJ8280ly4qDsz5Fy7C3YsfnruId+TBXQ 7sN5CF9Uvv1rtc9nul2Xci3334WeUt2d87gr1AJ+rv/9wJy7dM7N9ztaWVHpN/wjquYM eN+25uYNpqmq8CmeFOrRwPjYS1AKeulq2EQ5XtBM2fGJjJtUrxhZ12KgmdhfrXb64PuH pCfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749155880; x=1749760680; 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=pywf0pzjKBkZsHRNzan14nzP1MXAtQ7ZoUtlmuT2CTw=; b=gABVB9zG09khUDJ0dHlFaTBoK6j22EDxeci8uQrG5dbQKHErVDsdlGKVf+ECQig7yT 45VAzpDbzHwCivguLyhicO4J/HJ8Iz212h3U6EM4fGF8R/g/8T4Errrf6Uk6QE5zP5aD CWpfXkFwLStGACuTNpOYXlhTmyvhvIu4Nk/S3cIiqiG37z6pTxmaKzVwvOqgceAShXDr ox31fQBn3+CxoCLgwWoITLfosoosEBlDNBYvJwG1uqFzeLJY8N+zag68t2fuJ9CQCJdy B2Q5R3UqLGsz573ZtJ+YCHPNUmmOdYTN8q62/NvyGOPN3WMBe1xhhUUehyXUNskK8Lbb poTw== X-Forwarded-Encrypted: i=1; AJvYcCUmV6j6MIZywc0otMtIL1Swmzlj0yuPh1RBlLI0XHl9bscO8xTeUc89xssY2SysQCP7/WjoTyyIuk1+8lMB3rZn3K/nKcE=@freebsd.org, AJvYcCWUtwgH0RDGQ/5hKirNqrRT3GlWswxbM4KRDWvQksyZQt72um9W8+ZXNosC65FR9kuGJPWOJiAotcHSRy40Y00=@freebsd.org, AJvYcCX/ymE24//eOLy2BMcGLtPtNKiFNyI+gCJEx7cNEH6RKIoT7d/hLgNzmEhvQRec8HGo0QGZvSW98uyne26poOdFOeZG@freebsd.org X-Gm-Message-State: AOJu0YyFop2NudCsw3ecws3tntn56khxcT5KuT1VaJHFRoYEPafgf3u0 aCOhn9kkJUBr4WLID57tuwIuP52wOX/iYXv68tHX1vnrfvxvWFsPujI8ns/h+4E1C/HtKZUr7/b NWGdPK10k7N6D2FHpR0IseKvd9aZfVzqJQQTm3ycx X-Gm-Gg: ASbGncuX58wO35BA1PzDsvYNuhhalUKNGY4C33AearQQv/YjKrvIFxwtGJxAdMvBg4M kKAhIR78XBaFo6pzEExHsMhT8GAODzPS+j3Y0zheZIcyNbd+OdWBI4/+1hq5/axHhjGU+DMQd0Z QzyeHZe22aYNe1a7pIL5fjhSr1pxq1y8x0NgH4PCB+Wdfz4taBKzlEGO+0bEYz90e+vH0bvDoby p0= X-Google-Smtp-Source: AGHT+IHPJSbA/P2m4YWPPCHC/MOFeP9Mj8/Lskam3y5wCdyStcMDBDUN6k8EtHecVOETrzOQpISDADdNnfaKdyrboRs= X-Received: by 2002:a05:6402:34cd:b0:607:4500:2862 with SMTP id 4fb4d7f45d1cf-60773ed2c0bmr610303a12.15.1749155879470; Thu, 05 Jun 2025 13:37:59 -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: <202506042253.554MrDgZ093573@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Thu, 5 Jun 2025 13:37:46 -0700 X-Gm-Features: AX0GCFtYtNhCdzeUFNcDUuV7domwscneVtmo_hbYfALyoV3kRsBWE58ttGzE1KE Message-ID: Subject: Re: git: 6b6542ec8446 - main - open.2: Document the O_NAMEDATTR flag To: Brooks Davis Cc: Rick Macklem , 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-Rspamd-Queue-Id: 4bCx962Tg7z3S9h 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Thu, Jun 5, 2025 at 9:45=E2=80=AFAM Brooks Davis wr= ote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > On Wed, Jun 04, 2025 at 10:53:13PM +0000, Rick Macklem wrote: > > The branch main has been updated by rmacklem: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D6b6542ec84462c9d1fceb43b= ffb832e0fd556661 > > > > commit 6b6542ec84462c9d1fceb43bffb832e0fd556661 > > Author: Rick Macklem > > AuthorDate: 2025-06-04 22:50:16 +0000 > > Commit: Rick Macklem > > CommitDate: 2025-06-04 22:50:16 +0000 > > > > open.2: Document the O_NAMEDATTR flag > > > > Commit 2ec2ba7e232d added support for the O_NAMEDATTR flag to > > the open(2) and openat(2) syscalls for main. > > I must confess I'm quite concernted that we added this when it seems to > be unique to FreeBSD. We've very short of O_ bits and when we're out, > we're out. I'm not sure we should be adding anything that isn't at > least in Linux. Well, it's in Solaris as O_XATTR. (I chose a different name to try and avoid confusion with the extended attributes mechanism already in place in FreeBSD for Linux style extended attributes.) Bash is an example of an application that has support for O_XATTR. Is Linux more important than Solaris these days? (I guess so.) The alternative would be some kind of ioctl() interface, but that wouldn't look anything like what Solaris provides. rick > > -- Brooks From nobody Thu Jun 5 21:06:33 2025 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 4bCxp16nhXz5yNRT; Thu, 05 Jun 2025 21: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 4bCxp16C7Kz3nVT; Thu, 05 Jun 2025 21: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=1749157593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ka4cFHO7vZhd2dt3GYsU9e5YQ45nsz2YtCvlL3Zbb2E=; b=r6wq/GmheSWN0S7J9ZNqBqTVi+WekXHNoIxLeMg+b9JVui7jihS7j80MkWQOAPhGmpZnP7 pxVhuZkLHGZbgHOUqxJeVdG4S43dWZrNR6IDXOf9OPWuTyTqmQGDeccOGA1I2f/C9PZBFT dJLyIa7Fe5Kry70w1iyu27B3cWvuQkyXoeNY6gkH/qDaaYUuag3NWBx2jDMu00US7/pDHM d4zxiogBgvhHJ9QXVHkVnTpP48PjZ/0kJCasMFrA5w23w3y7mpIhXZRhae1wyDAArfEviu 9ObWthASycClxi9usdaF5T43F1EvoHLinId1XKdUk6PoCZvFWtsuTf5EHWiV/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749157593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ka4cFHO7vZhd2dt3GYsU9e5YQ45nsz2YtCvlL3Zbb2E=; b=w7S/aHK/45ZUY3+hHYRBpv8V738DZf64eLbLWaWq8VOgBlgfoXd31tAMaRPiNhXw6h6/e3 MKkOy+VFkeXLng1rRpF3szmoZ351OZGVcsAdGlXCHM9dglPy2qRKNj/VI2Btoyo2NtfudI PtPixS0vxemPZOzNMiijJwvTr9jQb5SdCQjIdFQNB9b9YzHGNMYv7FH7IXXOjHEs+xV8lY TgHI5tKNg4IkEfVVhI13fho9lXvdTwZctruU+LyowEC1ceqf3B4iHbfb7dMQuGptRW8aLK r1BXURD1B+HLbEkhWteN2/ClxvuzukLn4WPRi9FSw6JXl5tN1jeKCPv6zqnEfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749157593; a=rsa-sha256; cv=none; b=b3KuIKWFtqm0P/+TkUmXeQvCs453m3YJJ+CTOxErX5uGnH358KFT0nu74hOThwDtqhgVsB xsc00EqYYKv2ED5r8n2v6g4a7Z+9c0aoPKtddC8OKtE+lT3/AUr1QjcPTvfws6W6crj46c OPXAuW6KNs3v7tjYTntGNF4iYWRBQNeTBdQNpFuKglt4caZDQoijFdnkJXoc+Me++PLTRP pqqP8kQx7zOarmpjYDTeX48ia69Pl73u+AUrPTfexVDW6aq5mMjeFKwBDCMMLbBFVfuVQg yRzjg/lBozTFlUJm4f7WbOehaICWF/jfNVsTVgvTG6ei25g+ZPoQaXSdFSD3uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCxp15Tf7z9cF; Thu, 05 Jun 2025 21:06:33 +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 555L6XNm089400; Thu, 5 Jun 2025 21:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555L6XBV089396; Thu, 5 Jun 2025 21:06:33 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:06:33 GMT Message-Id: <202506052106.555L6XBV089396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60159a98a83747e539eb14c6a0eaaa1875e2cacc Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=60159a98a83747e539eb14c6a0eaaa1875e2cacc commit 60159a98a83747e539eb14c6a0eaaa1875e2cacc Author: John Baldwin AuthorDate: 2025-06-05 21:03:01 +0000 Commit: John Baldwin CommitDate: 2025-06-05 21:03:01 +0000 nvme: Move opcode and status code tables from base CAM to nvme_util.c This makes it possible to share these tables with the nvme(4) driver in custom kernels that do not include any CAM support, only nvd(4). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50685 --- sys/cam/nvme/nvme_all.c | 224 --------------------------------------------- sys/cam/nvme/nvme_all.h | 2 - sys/conf/files | 2 +- sys/dev/nvme/nvme.h | 4 + sys/dev/nvme/nvme_util.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 236 insertions(+), 227 deletions(-) diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c index 4145aa16ed49..2ab8ae5340c6 100644 --- a/sys/cam/nvme/nvme_all.c +++ b/sys/cam/nvme/nvme_all.c @@ -60,168 +60,6 @@ #include #endif -/* XXX: This duplicates lists in nvme_qpair.c. */ - -#define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x - -static const char *admin_opcode[256] = { - OPC_ENTRY(DELETE_IO_SQ), - OPC_ENTRY(CREATE_IO_SQ), - OPC_ENTRY(GET_LOG_PAGE), - OPC_ENTRY(DELETE_IO_CQ), - OPC_ENTRY(CREATE_IO_CQ), - OPC_ENTRY(IDENTIFY), - OPC_ENTRY(ABORT), - OPC_ENTRY(SET_FEATURES), - OPC_ENTRY(GET_FEATURES), - OPC_ENTRY(ASYNC_EVENT_REQUEST), - OPC_ENTRY(NAMESPACE_MANAGEMENT), - OPC_ENTRY(FIRMWARE_ACTIVATE), - OPC_ENTRY(FIRMWARE_IMAGE_DOWNLOAD), - OPC_ENTRY(DEVICE_SELF_TEST), - OPC_ENTRY(NAMESPACE_ATTACHMENT), - OPC_ENTRY(KEEP_ALIVE), - OPC_ENTRY(DIRECTIVE_SEND), - OPC_ENTRY(DIRECTIVE_RECEIVE), - OPC_ENTRY(VIRTUALIZATION_MANAGEMENT), - OPC_ENTRY(NVME_MI_SEND), - OPC_ENTRY(NVME_MI_RECEIVE), - OPC_ENTRY(CAPACITY_MANAGEMENT), - OPC_ENTRY(LOCKDOWN), - OPC_ENTRY(DOORBELL_BUFFER_CONFIG), - OPC_ENTRY(FABRICS_COMMANDS), - OPC_ENTRY(FORMAT_NVM), - OPC_ENTRY(SECURITY_SEND), - OPC_ENTRY(SECURITY_RECEIVE), - OPC_ENTRY(SANITIZE), - OPC_ENTRY(GET_LBA_STATUS), -}; - -static const char *nvm_opcode[256] = { - OPC_ENTRY(FLUSH), - OPC_ENTRY(WRITE), - OPC_ENTRY(READ), - OPC_ENTRY(WRITE_UNCORRECTABLE), - OPC_ENTRY(COMPARE), - OPC_ENTRY(WRITE_ZEROES), - OPC_ENTRY(DATASET_MANAGEMENT), - OPC_ENTRY(VERIFY), - OPC_ENTRY(RESERVATION_REGISTER), - OPC_ENTRY(RESERVATION_REPORT), - OPC_ENTRY(RESERVATION_ACQUIRE), - OPC_ENTRY(RESERVATION_RELEASE), - OPC_ENTRY(COPY), -}; - -#define SC_ENTRY(x) [NVME_SC_ ## x] = #x - -static const char *generic_status[256] = { - SC_ENTRY(SUCCESS), - SC_ENTRY(INVALID_OPCODE), - SC_ENTRY(INVALID_FIELD), - SC_ENTRY(COMMAND_ID_CONFLICT), - SC_ENTRY(DATA_TRANSFER_ERROR), - SC_ENTRY(ABORTED_POWER_LOSS), - SC_ENTRY(INTERNAL_DEVICE_ERROR), - SC_ENTRY(ABORTED_BY_REQUEST), - SC_ENTRY(ABORTED_SQ_DELETION), - SC_ENTRY(ABORTED_FAILED_FUSED), - SC_ENTRY(ABORTED_MISSING_FUSED), - SC_ENTRY(INVALID_NAMESPACE_OR_FORMAT), - SC_ENTRY(COMMAND_SEQUENCE_ERROR), - SC_ENTRY(INVALID_SGL_SEGMENT_DESCR), - SC_ENTRY(INVALID_NUMBER_OF_SGL_DESCR), - SC_ENTRY(DATA_SGL_LENGTH_INVALID), - SC_ENTRY(METADATA_SGL_LENGTH_INVALID), - SC_ENTRY(SGL_DESCRIPTOR_TYPE_INVALID), - SC_ENTRY(INVALID_USE_OF_CMB), - SC_ENTRY(PRP_OFFET_INVALID), - SC_ENTRY(ATOMIC_WRITE_UNIT_EXCEEDED), - SC_ENTRY(OPERATION_DENIED), - SC_ENTRY(SGL_OFFSET_INVALID), - SC_ENTRY(HOST_ID_INCONSISTENT_FORMAT), - SC_ENTRY(KEEP_ALIVE_TIMEOUT_EXPIRED), - SC_ENTRY(KEEP_ALIVE_TIMEOUT_INVALID), - SC_ENTRY(ABORTED_DUE_TO_PREEMPT), - SC_ENTRY(SANITIZE_FAILED), - SC_ENTRY(SANITIZE_IN_PROGRESS), - SC_ENTRY(SGL_DATA_BLOCK_GRAN_INVALID), - SC_ENTRY(NOT_SUPPORTED_IN_CMB), - SC_ENTRY(NAMESPACE_IS_WRITE_PROTECTED), - SC_ENTRY(COMMAND_INTERRUPTED), - SC_ENTRY(TRANSIENT_TRANSPORT_ERROR), - - SC_ENTRY(LBA_OUT_OF_RANGE), - SC_ENTRY(CAPACITY_EXCEEDED), - SC_ENTRY(NAMESPACE_NOT_READY), - SC_ENTRY(RESERVATION_CONFLICT), - SC_ENTRY(FORMAT_IN_PROGRESS), -}; - -static const char *command_specific_status[256] = { - SC_ENTRY(COMPLETION_QUEUE_INVALID), - SC_ENTRY(INVALID_QUEUE_IDENTIFIER), - SC_ENTRY(MAXIMUM_QUEUE_SIZE_EXCEEDED), - SC_ENTRY(ABORT_COMMAND_LIMIT_EXCEEDED), - SC_ENTRY(ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED), - SC_ENTRY(INVALID_FIRMWARE_SLOT), - SC_ENTRY(INVALID_FIRMWARE_IMAGE), - SC_ENTRY(INVALID_INTERRUPT_VECTOR), - SC_ENTRY(INVALID_LOG_PAGE), - SC_ENTRY(INVALID_FORMAT), - SC_ENTRY(FIRMWARE_REQUIRES_RESET), - SC_ENTRY(INVALID_QUEUE_DELETION), - SC_ENTRY(FEATURE_NOT_SAVEABLE), - SC_ENTRY(FEATURE_NOT_CHANGEABLE), - SC_ENTRY(FEATURE_NOT_NS_SPECIFIC), - SC_ENTRY(FW_ACT_REQUIRES_NVMS_RESET), - SC_ENTRY(FW_ACT_REQUIRES_RESET), - SC_ENTRY(FW_ACT_REQUIRES_TIME), - SC_ENTRY(FW_ACT_PROHIBITED), - SC_ENTRY(OVERLAPPING_RANGE), - SC_ENTRY(NS_INSUFFICIENT_CAPACITY), - SC_ENTRY(NS_ID_UNAVAILABLE), - SC_ENTRY(NS_ALREADY_ATTACHED), - SC_ENTRY(NS_IS_PRIVATE), - SC_ENTRY(NS_NOT_ATTACHED), - SC_ENTRY(THIN_PROV_NOT_SUPPORTED), - SC_ENTRY(CTRLR_LIST_INVALID), - SC_ENTRY(SELF_TEST_IN_PROGRESS), - SC_ENTRY(BOOT_PART_WRITE_PROHIB), - SC_ENTRY(INVALID_CTRLR_ID), - SC_ENTRY(INVALID_SEC_CTRLR_STATE), - SC_ENTRY(INVALID_NUM_OF_CTRLR_RESRC), - SC_ENTRY(INVALID_RESOURCE_ID), - SC_ENTRY(SANITIZE_PROHIBITED_WPMRE), - SC_ENTRY(ANA_GROUP_ID_INVALID), - SC_ENTRY(ANA_ATTACH_FAILED), - - SC_ENTRY(CONFLICTING_ATTRIBUTES), - SC_ENTRY(INVALID_PROTECTION_INFO), - SC_ENTRY(ATTEMPTED_WRITE_TO_RO_PAGE), -}; - -static const char *media_error_status[256] = { - SC_ENTRY(WRITE_FAULTS), - SC_ENTRY(UNRECOVERED_READ_ERROR), - SC_ENTRY(GUARD_CHECK_ERROR), - SC_ENTRY(APPLICATION_TAG_CHECK_ERROR), - SC_ENTRY(REFERENCE_TAG_CHECK_ERROR), - SC_ENTRY(COMPARE_FAILURE), - SC_ENTRY(ACCESS_DENIED), - SC_ENTRY(DEALLOCATED_OR_UNWRITTEN), -}; - -static const char *path_related_status[256] = { - SC_ENTRY(INTERNAL_PATH_ERROR), - SC_ENTRY(ASYMMETRIC_ACCESS_PERSISTENT_LOSS), - SC_ENTRY(ASYMMETRIC_ACCESS_INACCESSIBLE), - SC_ENTRY(ASYMMETRIC_ACCESS_TRANSITION), - SC_ENTRY(CONTROLLER_PATHING_ERROR), - SC_ENTRY(HOST_PATHING_ERROR), - SC_ENTRY(COMMAND_ABORTED_BY_HOST), -}; - void nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid, uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, @@ -292,24 +130,6 @@ nvme_command_string(struct ccb_nvmeio *nvmeio, char *cmd_string, size_t len) return(sbuf_data(&sb)); } -void -nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb) -{ - const char *s, *type; - - if (admin) { - s = admin_opcode[opc]; - type = "ADMIN"; - } else { - s = nvm_opcode[opc]; - type = "NVM"; - } - if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, opc); - else - sbuf_printf(sb, "%s", s); -} - void nvme_cmd_sbuf(const struct nvme_command *cmd, struct sbuf *sb) { @@ -340,50 +160,6 @@ nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb) return(0); } -void -nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) -{ - const char *s, *type; - uint16_t status; - - status = le16toh(cpl->status); - switch (NVME_STATUS_GET_SCT(status)) { - case NVME_SCT_GENERIC: - s = generic_status[NVME_STATUS_GET_SC(status)]; - type = "GENERIC"; - break; - case NVME_SCT_COMMAND_SPECIFIC: - s = command_specific_status[NVME_STATUS_GET_SC(status)]; - type = "COMMAND SPECIFIC"; - break; - case NVME_SCT_MEDIA_ERROR: - s = media_error_status[NVME_STATUS_GET_SC(status)]; - type = "MEDIA ERROR"; - break; - case NVME_SCT_PATH_RELATED: - s = path_related_status[NVME_STATUS_GET_SC(status)]; - type = "PATH RELATED"; - break; - case NVME_SCT_VENDOR_SPECIFIC: - s = NULL; - type = "VENDOR SPECIFIC"; - break; - default: - s = "RESERVED"; - type = NULL; - break; - } - - if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, NVME_STATUS_GET_SC(status)); - else - sbuf_printf(sb, "%s", s); - if (NVME_STATUS_GET_M(status) != 0) - sbuf_printf(sb, " M"); - if (NVME_STATUS_GET_DNR(status) != 0) - sbuf_printf(sb, " DNR"); -} - /* * nvme_status_sbuf() returns 0 for success and -1 for failure. */ diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h index 17c068b825be..2bc1953e79be 100644 --- a/sys/cam/nvme/nvme_all.h +++ b/sys/cam/nvme/nvme_all.h @@ -42,11 +42,9 @@ struct sbuf; void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); void nvme_print_ident_short(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); -void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); const char *nvme_command_string(struct ccb_nvmeio *nvmeio, char *, size_t); -void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); const void *nvme_get_identify_cntrl(struct cam_periph *); const void *nvme_get_identify_ns(struct cam_periph *); diff --git a/sys/conf/files b/sys/conf/files index e54eff8464a7..57f1f7970321 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2538,7 +2538,7 @@ dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sim.c optional nvme scbus dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme -dev/nvme/nvme_util.c optional nvme +dev/nvme/nvme_util.c optional nvme | scbus dev/nvmem/nvmem.c optional nvmem fdt dev/nvmem/nvmem_if.m optional nvmem dev/nvmf/controller/ctl_frontend_nvmf.c optional nvmft diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index a08abcb4aec6..9ae6d4f3bae6 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1906,6 +1906,7 @@ void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen); #ifdef _KERNEL struct bio; +struct sbuf; struct thread; struct nvme_namespace; @@ -1926,6 +1927,9 @@ enum nvme_namespace_flags { NVME_NS_FLUSH_SUPPORTED = 0x2, }; +void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); +void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); + int nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctrlr, struct nvme_pt_command *pt, uint32_t nsid, int is_user_buffer, diff --git a/sys/dev/nvme/nvme_util.c b/sys/dev/nvme/nvme_util.c index 47d84e5b6957..892ea86c6b22 100644 --- a/sys/dev/nvme/nvme_util.c +++ b/sys/dev/nvme/nvme_util.c @@ -5,6 +5,8 @@ * Copyright (C) 1997 Justin T. Gibbs * All rights reserved. * + * Copyright (c) 2023-2025 Chelsio Communications, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -28,8 +30,237 @@ */ #include +#ifdef _KERNEL +#include +#endif #include +#ifdef _KERNEL +/* XXX: This duplicates lists in nvme_qpair.c. */ + +#define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x + +static const char *admin_opcode[256] = { + OPC_ENTRY(DELETE_IO_SQ), + OPC_ENTRY(CREATE_IO_SQ), + OPC_ENTRY(GET_LOG_PAGE), + OPC_ENTRY(DELETE_IO_CQ), + OPC_ENTRY(CREATE_IO_CQ), + OPC_ENTRY(IDENTIFY), + OPC_ENTRY(ABORT), + OPC_ENTRY(SET_FEATURES), + OPC_ENTRY(GET_FEATURES), + OPC_ENTRY(ASYNC_EVENT_REQUEST), + OPC_ENTRY(NAMESPACE_MANAGEMENT), + OPC_ENTRY(FIRMWARE_ACTIVATE), + OPC_ENTRY(FIRMWARE_IMAGE_DOWNLOAD), + OPC_ENTRY(DEVICE_SELF_TEST), + OPC_ENTRY(NAMESPACE_ATTACHMENT), + OPC_ENTRY(KEEP_ALIVE), + OPC_ENTRY(DIRECTIVE_SEND), + OPC_ENTRY(DIRECTIVE_RECEIVE), + OPC_ENTRY(VIRTUALIZATION_MANAGEMENT), + OPC_ENTRY(NVME_MI_SEND), + OPC_ENTRY(NVME_MI_RECEIVE), + OPC_ENTRY(CAPACITY_MANAGEMENT), + OPC_ENTRY(LOCKDOWN), + OPC_ENTRY(DOORBELL_BUFFER_CONFIG), + OPC_ENTRY(FABRICS_COMMANDS), + OPC_ENTRY(FORMAT_NVM), + OPC_ENTRY(SECURITY_SEND), + OPC_ENTRY(SECURITY_RECEIVE), + OPC_ENTRY(SANITIZE), + OPC_ENTRY(GET_LBA_STATUS), +}; + +static const char *nvm_opcode[256] = { + OPC_ENTRY(FLUSH), + OPC_ENTRY(WRITE), + OPC_ENTRY(READ), + OPC_ENTRY(WRITE_UNCORRECTABLE), + OPC_ENTRY(COMPARE), + OPC_ENTRY(WRITE_ZEROES), + OPC_ENTRY(DATASET_MANAGEMENT), + OPC_ENTRY(VERIFY), + OPC_ENTRY(RESERVATION_REGISTER), + OPC_ENTRY(RESERVATION_REPORT), + OPC_ENTRY(RESERVATION_ACQUIRE), + OPC_ENTRY(RESERVATION_RELEASE), + OPC_ENTRY(COPY), +}; + +#define SC_ENTRY(x) [NVME_SC_ ## x] = #x + +static const char *generic_status[256] = { + SC_ENTRY(SUCCESS), + SC_ENTRY(INVALID_OPCODE), + SC_ENTRY(INVALID_FIELD), + SC_ENTRY(COMMAND_ID_CONFLICT), + SC_ENTRY(DATA_TRANSFER_ERROR), + SC_ENTRY(ABORTED_POWER_LOSS), + SC_ENTRY(INTERNAL_DEVICE_ERROR), + SC_ENTRY(ABORTED_BY_REQUEST), + SC_ENTRY(ABORTED_SQ_DELETION), + SC_ENTRY(ABORTED_FAILED_FUSED), + SC_ENTRY(ABORTED_MISSING_FUSED), + SC_ENTRY(INVALID_NAMESPACE_OR_FORMAT), + SC_ENTRY(COMMAND_SEQUENCE_ERROR), + SC_ENTRY(INVALID_SGL_SEGMENT_DESCR), + SC_ENTRY(INVALID_NUMBER_OF_SGL_DESCR), + SC_ENTRY(DATA_SGL_LENGTH_INVALID), + SC_ENTRY(METADATA_SGL_LENGTH_INVALID), + SC_ENTRY(SGL_DESCRIPTOR_TYPE_INVALID), + SC_ENTRY(INVALID_USE_OF_CMB), + SC_ENTRY(PRP_OFFET_INVALID), + SC_ENTRY(ATOMIC_WRITE_UNIT_EXCEEDED), + SC_ENTRY(OPERATION_DENIED), + SC_ENTRY(SGL_OFFSET_INVALID), + SC_ENTRY(HOST_ID_INCONSISTENT_FORMAT), + SC_ENTRY(KEEP_ALIVE_TIMEOUT_EXPIRED), + SC_ENTRY(KEEP_ALIVE_TIMEOUT_INVALID), + SC_ENTRY(ABORTED_DUE_TO_PREEMPT), + SC_ENTRY(SANITIZE_FAILED), + SC_ENTRY(SANITIZE_IN_PROGRESS), + SC_ENTRY(SGL_DATA_BLOCK_GRAN_INVALID), + SC_ENTRY(NOT_SUPPORTED_IN_CMB), + SC_ENTRY(NAMESPACE_IS_WRITE_PROTECTED), + SC_ENTRY(COMMAND_INTERRUPTED), + SC_ENTRY(TRANSIENT_TRANSPORT_ERROR), + + SC_ENTRY(LBA_OUT_OF_RANGE), + SC_ENTRY(CAPACITY_EXCEEDED), + SC_ENTRY(NAMESPACE_NOT_READY), + SC_ENTRY(RESERVATION_CONFLICT), + SC_ENTRY(FORMAT_IN_PROGRESS), +}; + +static const char *command_specific_status[256] = { + SC_ENTRY(COMPLETION_QUEUE_INVALID), + SC_ENTRY(INVALID_QUEUE_IDENTIFIER), + SC_ENTRY(MAXIMUM_QUEUE_SIZE_EXCEEDED), + SC_ENTRY(ABORT_COMMAND_LIMIT_EXCEEDED), + SC_ENTRY(ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED), + SC_ENTRY(INVALID_FIRMWARE_SLOT), + SC_ENTRY(INVALID_FIRMWARE_IMAGE), + SC_ENTRY(INVALID_INTERRUPT_VECTOR), + SC_ENTRY(INVALID_LOG_PAGE), + SC_ENTRY(INVALID_FORMAT), + SC_ENTRY(FIRMWARE_REQUIRES_RESET), + SC_ENTRY(INVALID_QUEUE_DELETION), + SC_ENTRY(FEATURE_NOT_SAVEABLE), + SC_ENTRY(FEATURE_NOT_CHANGEABLE), + SC_ENTRY(FEATURE_NOT_NS_SPECIFIC), + SC_ENTRY(FW_ACT_REQUIRES_NVMS_RESET), + SC_ENTRY(FW_ACT_REQUIRES_RESET), + SC_ENTRY(FW_ACT_REQUIRES_TIME), + SC_ENTRY(FW_ACT_PROHIBITED), + SC_ENTRY(OVERLAPPING_RANGE), + SC_ENTRY(NS_INSUFFICIENT_CAPACITY), + SC_ENTRY(NS_ID_UNAVAILABLE), + SC_ENTRY(NS_ALREADY_ATTACHED), + SC_ENTRY(NS_IS_PRIVATE), + SC_ENTRY(NS_NOT_ATTACHED), + SC_ENTRY(THIN_PROV_NOT_SUPPORTED), + SC_ENTRY(CTRLR_LIST_INVALID), + SC_ENTRY(SELF_TEST_IN_PROGRESS), + SC_ENTRY(BOOT_PART_WRITE_PROHIB), + SC_ENTRY(INVALID_CTRLR_ID), + SC_ENTRY(INVALID_SEC_CTRLR_STATE), + SC_ENTRY(INVALID_NUM_OF_CTRLR_RESRC), + SC_ENTRY(INVALID_RESOURCE_ID), + SC_ENTRY(SANITIZE_PROHIBITED_WPMRE), + SC_ENTRY(ANA_GROUP_ID_INVALID), + SC_ENTRY(ANA_ATTACH_FAILED), + + SC_ENTRY(CONFLICTING_ATTRIBUTES), + SC_ENTRY(INVALID_PROTECTION_INFO), + SC_ENTRY(ATTEMPTED_WRITE_TO_RO_PAGE), +}; + +static const char *media_error_status[256] = { + SC_ENTRY(WRITE_FAULTS), + SC_ENTRY(UNRECOVERED_READ_ERROR), + SC_ENTRY(GUARD_CHECK_ERROR), + SC_ENTRY(APPLICATION_TAG_CHECK_ERROR), + SC_ENTRY(REFERENCE_TAG_CHECK_ERROR), + SC_ENTRY(COMPARE_FAILURE), + SC_ENTRY(ACCESS_DENIED), + SC_ENTRY(DEALLOCATED_OR_UNWRITTEN), +}; + +static const char *path_related_status[256] = { + SC_ENTRY(INTERNAL_PATH_ERROR), + SC_ENTRY(ASYMMETRIC_ACCESS_PERSISTENT_LOSS), + SC_ENTRY(ASYMMETRIC_ACCESS_INACCESSIBLE), + SC_ENTRY(ASYMMETRIC_ACCESS_TRANSITION), + SC_ENTRY(CONTROLLER_PATHING_ERROR), + SC_ENTRY(HOST_PATHING_ERROR), + SC_ENTRY(COMMAND_ABORTED_BY_HOST), +}; + +void +nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb) +{ + const char *s, *type; + + if (admin) { + s = admin_opcode[opc]; + type = "ADMIN"; + } else { + s = nvm_opcode[opc]; + type = "NVM"; + } + if (s == NULL) + sbuf_printf(sb, "%s:0x%02x", type, opc); + else + sbuf_printf(sb, "%s", s); +} + +void +nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) +{ + const char *s, *type; + uint16_t status; + + status = le16toh(cpl->status); + switch (NVME_STATUS_GET_SCT(status)) { + case NVME_SCT_GENERIC: + s = generic_status[NVME_STATUS_GET_SC(status)]; + type = "GENERIC"; + break; + case NVME_SCT_COMMAND_SPECIFIC: + s = command_specific_status[NVME_STATUS_GET_SC(status)]; + type = "COMMAND SPECIFIC"; + break; + case NVME_SCT_MEDIA_ERROR: + s = media_error_status[NVME_STATUS_GET_SC(status)]; + type = "MEDIA ERROR"; + break; + case NVME_SCT_PATH_RELATED: + s = path_related_status[NVME_STATUS_GET_SC(status)]; + type = "PATH RELATED"; + break; + case NVME_SCT_VENDOR_SPECIFIC: + s = NULL; + type = "VENDOR SPECIFIC"; + break; + default: + s = "RESERVED"; + type = NULL; + break; + } + + if (s == NULL) + sbuf_printf(sb, "%s:0x%02x", type, NVME_STATUS_GET_SC(status)); + else + sbuf_printf(sb, "%s", s); + if (NVME_STATUS_GET_M(status) != 0) + sbuf_printf(sb, " M"); + if (NVME_STATUS_GET_DNR(status) != 0) + sbuf_printf(sb, " DNR"); +} +#endif + void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen) { From nobody Thu Jun 5 21:06:34 2025 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 4bCxp33FTpz5yN2S; Thu, 05 Jun 2025 21:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCxp26wJBz3nRm; Thu, 05 Jun 2025 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749157594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9aEE97gBgyYohPGZ780QA3CGiCSmwMEDayoC54ePuw=; b=ms9x9Krjy0Adin8etKZnJSAjfIsFQqkRRGmVTldEJpRm6jpipiXnKb4wSBwgBZMuGhlJeK Z11kc+ComIpEkNJIX6wVlYEcuwwHtZ5o1o/aW1NBtWA0XjrURqKFSKnZgSZT/QQ4uG0x7g nKtQo5filzv5c3S+40zpe7OA5Y+1b4e7QAlFtA0a8AAv+q0tTgUFC0icdIpolJEPUDmI6u aPIJsECms/27yzIPJ6Z/8KCISdl6SoCRT0aFonPGWOF+/WOkLy5kDkmRs03H+8Aim1LBf3 DaFjytE8qlJx/TNuR5Th1+HBzQMviti44gZk3mc+eTKOZ+C7bQyDCsRr/US61A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749157594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9aEE97gBgyYohPGZ780QA3CGiCSmwMEDayoC54ePuw=; b=KLCdI3cLtQuKX7rbimHesiJwRfBrL7RT/UOUbRhnfwtARdXAIhv5Jy/XnjlwhIHrILh0dt xvalmt5cYrqF80Zq9zHbvmsOod8UZ79oos1YI2s1/PYrnfcetvsR72MsVU2iwjaOl5MRWX /I0cvUMcd3rgn9TzwLL95zApAFWerdIMQlITQ8Ve4c8bMNHdcP5P7SXGqX14JwBdRaqgbK XO0GguH4KCs+nZkTzxgqcTEYrHOUdIgGXYciLwuY1SysKE0F0rZp+s7blyo7ukxMUuKd0z EisJNJt4tsXzwDMQP364H5zxNFFxKNyvqp3bQ69bGScUu2Bhh4h7mii4rCzaWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749157594; a=rsa-sha256; cv=none; b=NTnLkcNtML3+FC1RX8WCrEYq+RXdM0qxtqUUxA5padgw2ngfSKp2wI2bh4C31VU4Zzwnzu 5HJkisFBrlWzKkTtOiwpHCWLn31e0dVWdNfqLsf0uyLCYcx+vn0/Naw++Ty51Lh45pigvW /Rl9D3MJB+hkc4gFlTLlhS50JRoY33bOIguqSshxqHsAijDVSp2m1TNn4I411vXh7rDznK ITYN04kp6WbqKHT2OqYK3C7VeNKmvfklZ8Rj4Ll7nP/k827BHeCUGTzlfELdzrhcoLymnP MNpYex9TZaLc2S+KQF5RK7II+Y4qrxfTnABVJR60BufhhVz4sXwwZi4ZI/bnMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCxp25WFVz9k2; Thu, 05 Jun 2025 21:06: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 555L6YZV089438; Thu, 5 Jun 2025 21:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555L6Yuu089435; Thu, 5 Jun 2025 21:06:34 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:06:34 GMT Message-Id: <202506052106.555L6Yuu089435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 85a6ba310f05 - main - nvme: Use routines from nvme_util.c to decode opcodes and status codes 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85a6ba310f05139cdbdb2bc852e5a5fbe7975bfa Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=85a6ba310f05139cdbdb2bc852e5a5fbe7975bfa commit 85a6ba310f05139cdbdb2bc852e5a5fbe7975bfa Author: John Baldwin AuthorDate: 2025-06-05 21:03:32 +0000 Commit: John Baldwin CommitDate: 2025-06-05 21:03:32 +0000 nvme: Use routines from nvme_util.c to decode opcodes and status codes This reduces the number of duplicate string tables for NVMe opcodes and status codes. Adjust the formatting of unknown opcodes and status codes to more closely match nvme(4). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50652 --- sys/dev/nvme/nvme.h | 1 + sys/dev/nvme/nvme_qpair.c | 264 ++++++---------------------------------------- sys/dev/nvme/nvme_util.c | 24 +++-- 3 files changed, 48 insertions(+), 241 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 9ae6d4f3bae6..87f1da4d281d 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1929,6 +1929,7 @@ enum nvme_namespace_flags { void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); +void nvme_sc_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); int nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctrlr, struct nvme_pt_command *pt, diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index fcc95bf854b9..bd8626e32209 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -43,96 +44,36 @@ static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); static void nvme_qpair_destroy(struct nvme_qpair *qpair); -#define DEFAULT_INDEX 256 -#define DEFAULT_ENTRY(x) [DEFAULT_INDEX] = x -#define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x - -static const char *admin_opcode[DEFAULT_INDEX + 1] = { - OPC_ENTRY(DELETE_IO_SQ), - OPC_ENTRY(CREATE_IO_SQ), - OPC_ENTRY(GET_LOG_PAGE), - OPC_ENTRY(DELETE_IO_CQ), - OPC_ENTRY(CREATE_IO_CQ), - OPC_ENTRY(IDENTIFY), - OPC_ENTRY(ABORT), - OPC_ENTRY(SET_FEATURES), - OPC_ENTRY(GET_FEATURES), - OPC_ENTRY(ASYNC_EVENT_REQUEST), - OPC_ENTRY(NAMESPACE_MANAGEMENT), - OPC_ENTRY(FIRMWARE_ACTIVATE), - OPC_ENTRY(FIRMWARE_IMAGE_DOWNLOAD), - OPC_ENTRY(DEVICE_SELF_TEST), - OPC_ENTRY(NAMESPACE_ATTACHMENT), - OPC_ENTRY(KEEP_ALIVE), - OPC_ENTRY(DIRECTIVE_SEND), - OPC_ENTRY(DIRECTIVE_RECEIVE), - OPC_ENTRY(VIRTUALIZATION_MANAGEMENT), - OPC_ENTRY(NVME_MI_SEND), - OPC_ENTRY(NVME_MI_RECEIVE), - OPC_ENTRY(CAPACITY_MANAGEMENT), - OPC_ENTRY(LOCKDOWN), - OPC_ENTRY(DOORBELL_BUFFER_CONFIG), - OPC_ENTRY(FABRICS_COMMANDS), - OPC_ENTRY(FORMAT_NVM), - OPC_ENTRY(SECURITY_SEND), - OPC_ENTRY(SECURITY_RECEIVE), - OPC_ENTRY(SANITIZE), - OPC_ENTRY(GET_LBA_STATUS), - DEFAULT_ENTRY("ADMIN COMMAND"), -}; - -static const char *io_opcode[DEFAULT_INDEX + 1] = { - OPC_ENTRY(FLUSH), - OPC_ENTRY(WRITE), - OPC_ENTRY(READ), - OPC_ENTRY(WRITE_UNCORRECTABLE), - OPC_ENTRY(COMPARE), - OPC_ENTRY(WRITE_ZEROES), - OPC_ENTRY(DATASET_MANAGEMENT), - OPC_ENTRY(VERIFY), - OPC_ENTRY(RESERVATION_REGISTER), - OPC_ENTRY(RESERVATION_REPORT), - OPC_ENTRY(RESERVATION_ACQUIRE), - OPC_ENTRY(RESERVATION_RELEASE), - OPC_ENTRY(COPY), - DEFAULT_ENTRY("IO COMMAND"), -}; - static const char * -get_opcode_string(const char *op[DEFAULT_INDEX + 1], uint16_t opc) +get_opcode_string(bool admin, uint8_t opc, char *buf, size_t len) { - const char *nm = opc < DEFAULT_INDEX ? op[opc] : op[DEFAULT_INDEX]; - - return (nm != NULL ? nm : op[DEFAULT_INDEX]); -} + struct sbuf sb; -static const char * -get_admin_opcode_string(uint16_t opc) -{ - return (get_opcode_string(admin_opcode, opc)); -} - -static const char * -get_io_opcode_string(uint16_t opc) -{ - return (get_opcode_string(io_opcode, opc)); + sbuf_new(&sb, buf, len, SBUF_FIXEDLEN); + nvme_opcode_sbuf(admin, opc, &sb); + if (sbuf_finish(&sb) != 0) + return (""); + return (buf); } static void nvme_admin_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) { + char buf[64]; - nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%x " + nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%x " "cdw10:%08x cdw11:%08x\n", - get_admin_opcode_string(cmd->opc), cmd->opc, qpair->id, cmd->cid, - le32toh(cmd->nsid), le32toh(cmd->cdw10), le32toh(cmd->cdw11)); + get_opcode_string(true, cmd->opc, buf, sizeof(buf)), qpair->id, + cmd->cid, le32toh(cmd->nsid), le32toh(cmd->cdw10), + le32toh(cmd->cdw11)); } static void nvme_io_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) { + char buf[64]; switch (cmd->opc) { case NVME_OPC_WRITE: @@ -143,23 +84,15 @@ nvme_io_qpair_print_command(struct nvme_qpair *qpair, case NVME_OPC_VERIFY: nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d " "lba:%llu len:%d\n", - get_io_opcode_string(cmd->opc), qpair->id, cmd->cid, le32toh(cmd->nsid), + get_opcode_string(false, cmd->opc, buf, sizeof(buf)), + qpair->id, cmd->cid, le32toh(cmd->nsid), ((unsigned long long)le32toh(cmd->cdw11) << 32) + le32toh(cmd->cdw10), (le32toh(cmd->cdw12) & 0xFFFF) + 1); break; - case NVME_OPC_FLUSH: - case NVME_OPC_DATASET_MANAGEMENT: - case NVME_OPC_RESERVATION_REGISTER: - case NVME_OPC_RESERVATION_REPORT: - case NVME_OPC_RESERVATION_ACQUIRE: - case NVME_OPC_RESERVATION_RELEASE: - nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d\n", - get_io_opcode_string(cmd->opc), qpair->id, cmd->cid, le32toh(cmd->nsid)); - break; default: - nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%d\n", - get_io_opcode_string(cmd->opc), cmd->opc, qpair->id, - cmd->cid, le32toh(cmd->nsid)); + nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d\n", + get_opcode_string(false, cmd->opc, buf, sizeof(buf)), + qpair->id, cmd->cid, le32toh(cmd->nsid)); break; } } @@ -183,170 +116,33 @@ nvme_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) } } -struct nvme_status_string { - uint16_t sc; - const char * str; -}; - -static struct nvme_status_string generic_status[] = { - { NVME_SC_SUCCESS, "SUCCESS" }, - { NVME_SC_INVALID_OPCODE, "INVALID OPCODE" }, - { NVME_SC_INVALID_FIELD, "INVALID_FIELD" }, - { NVME_SC_COMMAND_ID_CONFLICT, "COMMAND ID CONFLICT" }, - { NVME_SC_DATA_TRANSFER_ERROR, "DATA TRANSFER ERROR" }, - { NVME_SC_ABORTED_POWER_LOSS, "ABORTED - POWER LOSS" }, - { NVME_SC_INTERNAL_DEVICE_ERROR, "INTERNAL DEVICE ERROR" }, - { NVME_SC_ABORTED_BY_REQUEST, "ABORTED - BY REQUEST" }, - { NVME_SC_ABORTED_SQ_DELETION, "ABORTED - SQ DELETION" }, - { NVME_SC_ABORTED_FAILED_FUSED, "ABORTED - FAILED FUSED" }, - { NVME_SC_ABORTED_MISSING_FUSED, "ABORTED - MISSING FUSED" }, - { NVME_SC_INVALID_NAMESPACE_OR_FORMAT, "INVALID NAMESPACE OR FORMAT" }, - { NVME_SC_COMMAND_SEQUENCE_ERROR, "COMMAND SEQUENCE ERROR" }, - { NVME_SC_INVALID_SGL_SEGMENT_DESCR, "INVALID SGL SEGMENT DESCRIPTOR" }, - { NVME_SC_INVALID_NUMBER_OF_SGL_DESCR, "INVALID NUMBER OF SGL DESCRIPTORS" }, - { NVME_SC_DATA_SGL_LENGTH_INVALID, "DATA SGL LENGTH INVALID" }, - { NVME_SC_METADATA_SGL_LENGTH_INVALID, "METADATA SGL LENGTH INVALID" }, - { NVME_SC_SGL_DESCRIPTOR_TYPE_INVALID, "SGL DESCRIPTOR TYPE INVALID" }, - { NVME_SC_INVALID_USE_OF_CMB, "INVALID USE OF CONTROLLER MEMORY BUFFER" }, - { NVME_SC_PRP_OFFET_INVALID, "PRP OFFET INVALID" }, - { NVME_SC_ATOMIC_WRITE_UNIT_EXCEEDED, "ATOMIC WRITE UNIT EXCEEDED" }, - { NVME_SC_OPERATION_DENIED, "OPERATION DENIED" }, - { NVME_SC_SGL_OFFSET_INVALID, "SGL OFFSET INVALID" }, - { NVME_SC_HOST_ID_INCONSISTENT_FORMAT, "HOST IDENTIFIER INCONSISTENT FORMAT" }, - { NVME_SC_KEEP_ALIVE_TIMEOUT_EXPIRED, "KEEP ALIVE TIMEOUT EXPIRED" }, - { NVME_SC_KEEP_ALIVE_TIMEOUT_INVALID, "KEEP ALIVE TIMEOUT INVALID" }, - { NVME_SC_ABORTED_DUE_TO_PREEMPT, "COMMAND ABORTED DUE TO PREEMPT AND ABORT" }, - { NVME_SC_SANITIZE_FAILED, "SANITIZE FAILED" }, - { NVME_SC_SANITIZE_IN_PROGRESS, "SANITIZE IN PROGRESS" }, - { NVME_SC_SGL_DATA_BLOCK_GRAN_INVALID, "SGL_DATA_BLOCK_GRANULARITY_INVALID" }, - { NVME_SC_NOT_SUPPORTED_IN_CMB, "COMMAND NOT SUPPORTED FOR QUEUE IN CMB" }, - { NVME_SC_NAMESPACE_IS_WRITE_PROTECTED, "NAMESPACE IS WRITE PROTECTED" }, - { NVME_SC_COMMAND_INTERRUPTED, "COMMAND INTERRUPTED" }, - { NVME_SC_TRANSIENT_TRANSPORT_ERROR, "TRANSIENT TRANSPORT ERROR" }, - - { NVME_SC_LBA_OUT_OF_RANGE, "LBA OUT OF RANGE" }, - { NVME_SC_CAPACITY_EXCEEDED, "CAPACITY EXCEEDED" }, - { NVME_SC_NAMESPACE_NOT_READY, "NAMESPACE NOT READY" }, - { NVME_SC_RESERVATION_CONFLICT, "RESERVATION CONFLICT" }, - { NVME_SC_FORMAT_IN_PROGRESS, "FORMAT IN PROGRESS" }, - { 0xFFFF, "GENERIC" } -}; - -static struct nvme_status_string command_specific_status[] = { - { NVME_SC_COMPLETION_QUEUE_INVALID, "INVALID COMPLETION QUEUE" }, - { NVME_SC_INVALID_QUEUE_IDENTIFIER, "INVALID QUEUE IDENTIFIER" }, - { NVME_SC_MAXIMUM_QUEUE_SIZE_EXCEEDED, "MAX QUEUE SIZE EXCEEDED" }, - { NVME_SC_ABORT_COMMAND_LIMIT_EXCEEDED, "ABORT CMD LIMIT EXCEEDED" }, - { NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED, "ASYNC LIMIT EXCEEDED" }, - { NVME_SC_INVALID_FIRMWARE_SLOT, "INVALID FIRMWARE SLOT" }, - { NVME_SC_INVALID_FIRMWARE_IMAGE, "INVALID FIRMWARE IMAGE" }, - { NVME_SC_INVALID_INTERRUPT_VECTOR, "INVALID INTERRUPT VECTOR" }, - { NVME_SC_INVALID_LOG_PAGE, "INVALID LOG PAGE" }, - { NVME_SC_INVALID_FORMAT, "INVALID FORMAT" }, - { NVME_SC_FIRMWARE_REQUIRES_RESET, "FIRMWARE REQUIRES RESET" }, - { NVME_SC_INVALID_QUEUE_DELETION, "INVALID QUEUE DELETION" }, - { NVME_SC_FEATURE_NOT_SAVEABLE, "FEATURE IDENTIFIER NOT SAVEABLE" }, - { NVME_SC_FEATURE_NOT_CHANGEABLE, "FEATURE NOT CHANGEABLE" }, - { NVME_SC_FEATURE_NOT_NS_SPECIFIC, "FEATURE NOT NAMESPACE SPECIFIC" }, - { NVME_SC_FW_ACT_REQUIRES_NVMS_RESET, "FIRMWARE ACTIVATION REQUIRES NVM SUBSYSTEM RESET" }, - { NVME_SC_FW_ACT_REQUIRES_RESET, "FIRMWARE ACTIVATION REQUIRES RESET" }, - { NVME_SC_FW_ACT_REQUIRES_TIME, "FIRMWARE ACTIVATION REQUIRES MAXIMUM TIME VIOLATION" }, - { NVME_SC_FW_ACT_PROHIBITED, "FIRMWARE ACTIVATION PROHIBITED" }, - { NVME_SC_OVERLAPPING_RANGE, "OVERLAPPING RANGE" }, - { NVME_SC_NS_INSUFFICIENT_CAPACITY, "NAMESPACE INSUFFICIENT CAPACITY" }, - { NVME_SC_NS_ID_UNAVAILABLE, "NAMESPACE IDENTIFIER UNAVAILABLE" }, - { NVME_SC_NS_ALREADY_ATTACHED, "NAMESPACE ALREADY ATTACHED" }, - { NVME_SC_NS_IS_PRIVATE, "NAMESPACE IS PRIVATE" }, - { NVME_SC_NS_NOT_ATTACHED, "NS NOT ATTACHED" }, - { NVME_SC_THIN_PROV_NOT_SUPPORTED, "THIN PROVISIONING NOT SUPPORTED" }, - { NVME_SC_CTRLR_LIST_INVALID, "CONTROLLER LIST INVALID" }, - { NVME_SC_SELF_TEST_IN_PROGRESS, "DEVICE SELF-TEST IN PROGRESS" }, - { NVME_SC_BOOT_PART_WRITE_PROHIB, "BOOT PARTITION WRITE PROHIBITED" }, - { NVME_SC_INVALID_CTRLR_ID, "INVALID CONTROLLER IDENTIFIER" }, - { NVME_SC_INVALID_SEC_CTRLR_STATE, "INVALID SECONDARY CONTROLLER STATE" }, - { NVME_SC_INVALID_NUM_OF_CTRLR_RESRC, "INVALID NUMBER OF CONTROLLER RESOURCES" }, - { NVME_SC_INVALID_RESOURCE_ID, "INVALID RESOURCE IDENTIFIER" }, - { NVME_SC_SANITIZE_PROHIBITED_WPMRE, "SANITIZE PROHIBITED WRITE PERSISTENT MEMORY REGION ENABLED" }, - { NVME_SC_ANA_GROUP_ID_INVALID, "ANA GROUP IDENTIFIED INVALID" }, - { NVME_SC_ANA_ATTACH_FAILED, "ANA ATTACH FAILED" }, - - { NVME_SC_CONFLICTING_ATTRIBUTES, "CONFLICTING ATTRIBUTES" }, - { NVME_SC_INVALID_PROTECTION_INFO, "INVALID PROTECTION INFO" }, - { NVME_SC_ATTEMPTED_WRITE_TO_RO_PAGE, "WRITE TO RO PAGE" }, - { 0xFFFF, "COMMAND SPECIFIC" } -}; - -static struct nvme_status_string media_error_status[] = { - { NVME_SC_WRITE_FAULTS, "WRITE FAULTS" }, - { NVME_SC_UNRECOVERED_READ_ERROR, "UNRECOVERED READ ERROR" }, - { NVME_SC_GUARD_CHECK_ERROR, "GUARD CHECK ERROR" }, - { NVME_SC_APPLICATION_TAG_CHECK_ERROR, "APPLICATION TAG CHECK ERROR" }, - { NVME_SC_REFERENCE_TAG_CHECK_ERROR, "REFERENCE TAG CHECK ERROR" }, - { NVME_SC_COMPARE_FAILURE, "COMPARE FAILURE" }, - { NVME_SC_ACCESS_DENIED, "ACCESS DENIED" }, - { NVME_SC_DEALLOCATED_OR_UNWRITTEN, "DEALLOCATED OR UNWRITTEN LOGICAL BLOCK" }, - { 0xFFFF, "MEDIA ERROR" } -}; - -static struct nvme_status_string path_related_status[] = { - { NVME_SC_INTERNAL_PATH_ERROR, "INTERNAL PATH ERROR" }, - { NVME_SC_ASYMMETRIC_ACCESS_PERSISTENT_LOSS, "ASYMMETRIC ACCESS PERSISTENT LOSS" }, - { NVME_SC_ASYMMETRIC_ACCESS_INACCESSIBLE, "ASYMMETRIC ACCESS INACCESSIBLE" }, - { NVME_SC_ASYMMETRIC_ACCESS_TRANSITION, "ASYMMETRIC ACCESS TRANSITION" }, - { NVME_SC_CONTROLLER_PATHING_ERROR, "CONTROLLER PATHING ERROR" }, - { NVME_SC_HOST_PATHING_ERROR, "HOST PATHING ERROR" }, - { NVME_SC_COMMAND_ABORTED_BY_HOST, "COMMAND ABORTED BY HOST" }, - { 0xFFFF, "PATH RELATED" }, -}; - static const char * -get_status_string(uint16_t sct, uint16_t sc) +get_status_string(const struct nvme_completion *cpl, char *buf, size_t len) { - struct nvme_status_string *entry; + struct sbuf sb; - switch (sct) { - case NVME_SCT_GENERIC: - entry = generic_status; - break; - case NVME_SCT_COMMAND_SPECIFIC: - entry = command_specific_status; - break; - case NVME_SCT_MEDIA_ERROR: - entry = media_error_status; - break; - case NVME_SCT_PATH_RELATED: - entry = path_related_status; - break; - case NVME_SCT_VENDOR_SPECIFIC: - return ("VENDOR SPECIFIC"); - default: - return ("RESERVED"); - } - - while (entry->sc != 0xFFFF) { - if (entry->sc == sc) - return (entry->str); - entry++; - } - return (entry->str); + sbuf_new(&sb, buf, len, SBUF_FIXEDLEN); + nvme_sc_sbuf(cpl, &sb); + if (sbuf_finish(&sb) != 0) + return (""); + return (buf); } void nvme_qpair_print_completion(struct nvme_qpair *qpair, struct nvme_completion *cpl) { - uint8_t sct, sc, crd, m, dnr, p; + char buf[64]; + uint8_t crd, m, dnr, p; - sct = NVME_STATUS_GET_SCT(cpl->status); - sc = NVME_STATUS_GET_SC(cpl->status); crd = NVME_STATUS_GET_CRD(cpl->status); m = NVME_STATUS_GET_M(cpl->status); dnr = NVME_STATUS_GET_DNR(cpl->status); p = NVME_STATUS_GET_P(cpl->status); - nvme_printf(qpair->ctrlr, "%s (%02x/%02x) crd:%x m:%x dnr:%x p:%d " + nvme_printf(qpair->ctrlr, "%s crd:%x m:%x dnr:%x p:%d " "sqid:%d cid:%d cdw0:%x\n", - get_status_string(sct, sc), sct, sc, crd, m, dnr, p, + get_status_string(cpl, buf, sizeof(buf)), crd, m, dnr, p, cpl->sqid, cpl->cid, cpl->cdw0); } diff --git a/sys/dev/nvme/nvme_util.c b/sys/dev/nvme/nvme_util.c index 892ea86c6b22..050dfcfbef79 100644 --- a/sys/dev/nvme/nvme_util.c +++ b/sys/dev/nvme/nvme_util.c @@ -36,8 +36,6 @@ #include #ifdef _KERNEL -/* XXX: This duplicates lists in nvme_qpair.c. */ - #define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x static const char *admin_opcode[256] = { @@ -211,13 +209,13 @@ nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb) type = "NVM"; } if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, opc); + sbuf_printf(sb, "%s (%02x)", type, opc); else sbuf_printf(sb, "%s", s); } void -nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) +nvme_sc_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) { const char *s, *type; uint16_t status; @@ -245,15 +243,27 @@ nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) type = "VENDOR SPECIFIC"; break; default: - s = "RESERVED"; + s = NULL; type = NULL; break; } - if (s == NULL) - sbuf_printf(sb, "%s:0x%02x", type, NVME_STATUS_GET_SC(status)); + if (type == NULL) + sbuf_printf(sb, "RESERVED (%02x/%02x)", + NVME_STATUS_GET_SCT(status), NVME_STATUS_GET_SC(status)); + else if (s == NULL) + sbuf_printf(sb, "%s (%02x)", type, NVME_STATUS_GET_SC(status)); else sbuf_printf(sb, "%s", s); +} + +void +nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) +{ + uint16_t status; + + status = le16toh(cpl->status); + nvme_sc_sbuf(cpl, sb); if (NVME_STATUS_GET_M(status) != 0) sbuf_printf(sb, " M"); if (NVME_STATUS_GET_DNR(status) != 0) From nobody Thu Jun 5 21:06:35 2025 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 4bCxp46kYLz5yNRV; Thu, 05 Jun 2025 21:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCxp40xlGz3nM7; Thu, 05 Jun 2025 21:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749157596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Mx5RDsS7eZvL5fZlGXZu8XjOCl0ZVndxSGawpRrplQ=; b=ZaobYYZaifkgvAY5+KpsLyVvKu+EnwxuoC6CtbPuLDpB7Z28OuLOdV+XUcBZbmovghzhOy wJukIiW+HSX/qn1Z6G8e1jpvAtELFlpdu9/3N8ezdp82Jm+UsXbmCOrWWOzRdUAoDwyfFp bqQIsch7dpSw+WRdae6YL5pKaRCWGZ+9tNFn6fW+SnFxbxUyppS8h0k/OBPk79EcedY6fa BzQQ/V1ovmBEL+LatkdWup0PN+/vySLuY+IYzWB8Rp/6e+xiW2qx0FBCw/MBmZmT1iocDF sG1Bs1V/0t++kaCY74ZnupI/cumDX0Ony9r8oX7+W1s4KzHZtFiz81eC6He1SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749157596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Mx5RDsS7eZvL5fZlGXZu8XjOCl0ZVndxSGawpRrplQ=; b=WnL8fdpM9f2qYMOLgtEojQMc+5Hqc0MAD4edSoFRVogTkFa6m/pcdZNHkIU9jtdvD/1hZB 8CevxiXL1HFKV8qdr8bJYsOId2g3beoSdpchK/dUHa/KfOt+9eaPDYvfx1mvaQjnh4GH/k vE0M9YBczSpaHndrOmtCyoaQvBkLvtCwkTPWASspjPdmv8joHimpiPR6dgBDBVymBB2NTP ZLubhNPxZmQmRL/bi5mTFns60FhjTJbU0661wDceoqH7rRo/M/hCbGRBoDvbtOha7W3Cqo 9qWTQnrl9XNGbusRlYmuLeG9IryF+/v9D1vZ9l6YL+C+kW40aZkg65uiOJ6CZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749157596; a=rsa-sha256; cv=none; b=uLCxPnwa5wTQc4eUzvLh3AF5I2OtRwZ1XLAzH7SAqdTh8NHXfsDPRG0EtSmH4yNCVRNNGd K35zg68LJuIMse45ysi9heR7Ypo6MwvAztxMCdpdiLAtoUdkjVWZDg/qtn/TJhst408S4O iQUH4UCQOIaTZN2Y4k+1tf5OeUWhZHOZ3CNwqLVNVt46VK5YUJui5PP4yIKCAxJlQ53zLf dpf89EKS5pIeF6wfamy9MGkCIYSClH3cD2EUfwqzmaCj45S78WVN5LNxRgtsGC+zAX2BIr kALAlX9xJqGjmwC66P5HPReEB7C12hNBfguSqIq4nX8/e2kwt9U40Deg8b1R+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 4bCxp36Vn8z94M; Thu, 05 Jun 2025 21:06:35 +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 555L6ZaO089475; Thu, 5 Jun 2025 21:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555L6ZYa089472; Thu, 5 Jun 2025 21:06:35 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:06:35 GMT Message-Id: <202506052106.555L6ZYa089472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 152372a30ab7 - main - Fix incorrect syntax in sys/conf/files for nvmf_transport.c 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 152372a30ab73f1f947748febdd5b397189f4284 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=152372a30ab73f1f947748febdd5b397189f4284 commit 152372a30ab73f1f947748febdd5b397189f4284 Author: John Baldwin AuthorDate: 2025-06-05 21:04:06 +0000 Commit: John Baldwin CommitDate: 2025-06-05 21:04:06 +0000 Fix incorrect syntax in sys/conf/files for nvmf_transport.c Fixes: a15f7c96a276 ("nvmft: The in-kernel NVMe over Fabrics controller") Sponsored by: Chelsio Communications --- sys/conf/files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 57f1f7970321..84fae3c00ea6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2553,7 +2553,7 @@ dev/nvmf/host/nvmf_ns.c optional nvmf dev/nvmf/host/nvmf_qpair.c optional nvmf dev/nvmf/host/nvmf_sim.c optional nvmf dev/nvmf/nvmf_tcp.c optional nvmf_tcp -dev/nvmf/nvmf_transport.c optional nvmf | optional nvmft +dev/nvmf/nvmf_transport.c optional nvmf | nvmft dev/oce/oce_hw.c optional oce pci dev/oce/oce_if.c optional oce pci dev/oce/oce_mbox.c optional oce pci From nobody Thu Jun 5 21:30:17 2025 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 4bCyKQ0qQrz5yPg1; Thu, 05 Jun 2025 21:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCyKQ0D3pz3Dps; Thu, 05 Jun 2025 21:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749159018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6wI1F7SQyNccA5mTor7II2psMWscq4nte47yXLsbwl4=; b=od8YdQZxQ0GEDw4JTuch2BNP+TyB1lWLTShHRg9kIWuEOUoRcopfr+C4kTv6wG+Anvnzq2 xWCG+FaKvbu054/9XJP4akexW1bjEE6nEkThtcnlFJALy/laSxvT0FSD5mzOZyDElCGdMZ YxffBj1bNGz+3m4S4HbrU9ig902pg87qYY8EvxlMhns9XhDwz5Dgdzxn1HiJ4IDE7yrX1V 2dAMpQJZ4FbX8TLE+f7JH83vt89kywRlEwM5g0OHD9Mpkge98YHnDSN/wGuP2uXeqycqyL oIbyUiY+0ShKuilIkTspgCSIS2YohBM2ma3arEHzteBK1X/G5Gr66KFX1wFEQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749159018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6wI1F7SQyNccA5mTor7II2psMWscq4nte47yXLsbwl4=; b=SkNb++oios3qwwIkk3mwzlRhnaIRB0TlH2FdVFQQ+lKbtJitJW8o26adZgtujS+3yFdlq4 akVpcCSaiZYn2j6cVopzp3bAIgHdRImyU18W+D9gQzCqaDMvZE3pDfZUKggv6dgYgYwsKY DN4s0LAA0uGM8Bp3vH+OhiStVUMz4StAcaxHyfGkmBQJpE28HLqMR8wnNmezKJJJ+KDOyy K/B9JaXaYh4Q3l7eOo3iyVYWsOQKShBJ6qXQFRu0MMx7EAgfJ/u5lAcWjxlIBWo7asia0B 0MfTpzrdRZUVIZwZIbZFZPKIFVCImcWPQ6GCSs2nGAH7z0vdS+VHv/kXedJAAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749159018; a=rsa-sha256; cv=none; b=J+f1ms6rzIM2f3FbqZAhQjU87Y3N5rSVPPIRLkraLp7H/NFU3fKBAJaRNFip3LXLbS0Ahu A3Km+QOQE31zFZPWUocmIWBLqg9CdYJ849gTrCuy24F2hPwV31XJZOuHPbSfCw2rD3r72c 1V+hafRcTaQA6Ypcln0pmCDt1OyIQuJuaa2FlxrUzxRAc8uNbr8ZyziDRR6xpbR6kylVPD Vc9VapQxDUwytlCAChBEhEt0ivUNS+C1WAmb5HMFz0/csrVBeOwIjpkSEze1TEhC2PNQmq PR70cH8Eys+KnHk4PApZFDbsm52YqdqnAHRYyFOmaxOs75oiaX+K5ZQbdw2BOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCyKP6mX4z9g2; Thu, 05 Jun 2025 21:30:17 +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 555LUHIQ036574; Thu, 5 Jun 2025 21:30:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555LUHTH036568; Thu, 5 Jun 2025 21:30:17 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:30:17 GMT Message-Id: <202506052130.555LUHTH036568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 35c4ea02cb9f - main - fusefs: revert a workaround for a googletest bug 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35c4ea02cb9fe199dd88b19cf51fef56838c8cba Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=35c4ea02cb9fe199dd88b19cf51fef56838c8cba commit 35c4ea02cb9fe199dd88b19cf51fef56838c8cba Author: Alan Somers AuthorDate: 2025-06-05 14:44:43 +0000 Commit: Alan Somers CommitDate: 2025-06-05 21:17:47 +0000 fusefs: revert a workaround for a googletest bug This bug was fixed by googletest back in 2019 and released in googletest 1.10.0, I think. Using GTEST_SKIP from a test environment works now. https://github.com/google/googletest/issues/2189 MFC after: 2 weeks Sponsored by: ConnectWise --- tests/sys/fs/fusefs/utils.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index d059221b2e55..d702dec50247 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -124,6 +124,7 @@ bool is_unsafe_aio_enabled(void) { class FuseEnv: public Environment { virtual void SetUp() { + check_environment(); } }; @@ -132,14 +133,6 @@ void FuseTest::SetUp() { const char *maxphys_node = "kern.maxphys"; size_t size; - /* - * XXX check_environment should be called from FuseEnv::SetUp, but - * can't due to https://github.com/google/googletest/issues/2189 - */ - check_environment(); - if (IsSkipped()) - return; - size = sizeof(m_maxbcachebuf); ASSERT_EQ(0, sysctlbyname(maxbcachebuf_node, &m_maxbcachebuf, &size, NULL, 0)) << strerror(errno); From nobody Thu Jun 5 21:30:19 2025 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 4bCyKR2jLQz5yPjG; Thu, 05 Jun 2025 21:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCyKR1Jpzz3F09; Thu, 05 Jun 2025 21:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749159019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wRSkFsNBUBvGzIDpAf496B+CCu4z0OypZQKzG8Pl98=; b=nB0kinRx4tx/upHoJ8+tEbNhHb7Eo9VW8Jljk+QNheFAIQgyB8cHhEtL/RzvdR5zzEUsWg KhAFXecigfDdKucHe23oqzVmnIfcCwAVxweOQxFY8UMeWbmTtjhkKgUbnwwaS77zQx/Gl8 g1jbYx3iejD2tW3GiYqs9BwOvdBDVL/tyvqMWjwa6s2uQVpU8/OLNNBRHQRGbg7lrgKicK OBjah3Lj1OnpHwtpIexSPbY/A13WnSKHnwraoNezY7HsaQTa5oOE6KuLwEiEHj6DM8nX68 Oo8CfHaPdKLtPuj7kEIcClFZUiaIC68bVIjTscgv/u4jJXG9DE2XfHxUAGTStw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749159019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wRSkFsNBUBvGzIDpAf496B+CCu4z0OypZQKzG8Pl98=; b=yNfVWVqXh5zoniE+qMB9AfPqlfe8XO4rvwfcKc/0kqqDx4QwlDkUyQMCVNiaDuTMAZy5F+ 2ivs8CBF+tVehbTD2Wu0SuvJlPXmUIr3uOq9H/PxuLloCpMzn/Zi3c0Btck2aQQuqbYNR+ D5rFA+d2LGY7KOZyw32yvl52XPVzKeTnDWjYEQgq7HaWqGUrQ+o9PNI+EvXE6xgNcNyVwC 2q6x9hgPaJGCJGlf8dEzRmuoKva2m1qrKpp6LkpkuWouJzj2ylB0Zg8m+mKRdVnr9IQCGh U797ZAmuqTfrPhz+0JsTfB24IYdFU43a45xQsnyeC1jEltxts3d9piyV+YlQXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749159019; a=rsa-sha256; cv=none; b=eDoBS+TJk+/u/4cc8ds2s8bFRMPnd42+W/RHMHN9rgenudhcvC1f7T+expd7FLrOtTbY3w 0t0unVaIpbIqK28/hcsETbSaHPYvew643niu2II0z3l1GOeO2Hptomkp6EwUbApyXRQ8c8 beO+1uO4MNf4VYPe0BZt1tiqQNtb7W7NZ7vT2Q32096pKvoSIeKSU15lnQabMJ1lFVd7aT ToaS/pz+GNFl7JlBn1x7CfanckcJQo83g9hHJK46age4GcZNUJIM4uClPcXfnSgH6/Bnew 0W60sT+E/LK6tjJXgaLuCaInyDfwVm8c0PnxPYAjvuGh/RTH2DzA5pWXhO+BMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCyKR0sn2zBK3; Thu, 05 Jun 2025 21:30:19 +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 555LUJ8c036694; Thu, 5 Jun 2025 21:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555LUJTq036691; Thu, 5 Jun 2025 21:30:19 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:30:19 GMT Message-Id: <202506052130.555LUJTq036691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 7ce93195ddb3 - main - fusefs: delete dead code 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ce93195ddb30b371022ae3adbd9bd24189e1444 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7ce93195ddb30b371022ae3adbd9bd24189e1444 commit 7ce93195ddb30b371022ae3adbd9bd24189e1444 Author: Alan Somers AuthorDate: 2025-06-05 20:32:22 +0000 Commit: Alan Somers CommitDate: 2025-06-05 21:17:53 +0000 fusefs: delete dead code These lines have been commented out ever since the first import of fuse. The intention seems to be for the original developer to experiment with different error handling strategies, but they're very obsolete by now. Delete them. MFC after: 2 weeks Sponsored by: ConnectWise --- sys/fs/fuse/fuse_ipc.c | 5 ----- sys/fs/fuse/fuse_vnops.c | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/fs/fuse/fuse_ipc.c b/sys/fs/fuse/fuse_ipc.c index f1f9f801bf4d..d3536e0a2a61 100644 --- a/sys/fs/fuse/fuse_ipc.c +++ b/sys/fs/fuse/fuse_ipc.c @@ -443,11 +443,6 @@ retry: if (err == EWOULDBLOCK) { SDT_PROBE2(fusefs, , ipc, trace, 3, "fticket_wait_answer: EWOULDBLOCK"); -#ifdef XXXIP /* die conditionally */ - if (!fdata_get_dead(data)) { - fdata_set_dead(data); - } -#endif err = ETIMEDOUT; fticket_set_answered(ftick); } else if ((err == EINTR || err == ERESTART)) { diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 83f527ec8ec0..d09d86e4f3a1 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1936,10 +1936,8 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) if (fuse_isdeadfs(vp)) { return ENXIO; } - if ( /* XXXIP ((uio_iovcnt(uio) > 1)) || */ - (uio_resid(uio) < sizeof(struct dirent))) { + if (uio_resid(uio) < sizeof(struct dirent)) return EINVAL; - } tresid = uio->uio_resid; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); From nobody Thu Jun 5 21:49:05 2025 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 4bCyl61R7zz5yQTC; Thu, 05 Jun 2025 21:49: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 4bCyl60f7mz3Yf1; Thu, 05 Jun 2025 21:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749160146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E20fmRBwfqI9vkcGPLlpbisRxVC2C9d/LSmNsswZlp8=; b=GP8HG3zwpmKbJc2zGxq7vF4nB/TxzyStGX3lVIA+89a+DiJjxjkvWO7QUnp9pvLwv+/5eR qFtbiSwNUMMLGbjZPwkarG/vlfSfo8rAix+zV2y8UqeXZ6l8tNfmArIMDzBBFDEnmdkFKh hxkE/ARqzYTnKdXnMBT5NO+skPIRvHWHxUuiP2cSYxABMTyCumT2zsiCslPNy+dmcZ6v/K XHydxaZi6Zb6FFLEMjaSliLoJdAvZwWDWSsbxFwolBbvhbc8xzhNuLHMv3UsSkPmUd7Ap0 sNX0hjhiN096ziGRPrGqpy2y6YPV0f6uKT9VRzp9oCjZMPPVfBKVj8O20cXDHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749160146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E20fmRBwfqI9vkcGPLlpbisRxVC2C9d/LSmNsswZlp8=; b=mB1v1ZPTiTHm3Aw5DmruLkEPJnjTNx4B89V+9ITOzOkYvzMUUEE7Y+7gptyTqFdzdHGzGa 5IW/H8LRY26dKAzmH9ONYsdx8DbnSapQ3BvFzFbielpO+GknXfp/gtWw2NMYd9jMQWNUOJ 6b7CX6GeObAzXnetnczf4GfgdWzUEyLfmEkde1r56eb6qqq9P4jgvzJXn+4+CurDxJCeoy Vjh/KPQuJG5qAoB+TgdTNbFAiURSMgVzNdqjMlZbox4RhtDdbCdE/ogJeI796KgzCUOxA6 d9HTSk8wK0pOqTrrJqNTzLgC/1pevAR2JrAjTNYxa419CUdQ0XZ9CwjHec6JCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749160146; a=rsa-sha256; cv=none; b=LFuQR7szFJx8rtfv38MYULtRWxBP0/W1hTKeCi6S3Xs/mHGRTC1nDdXELFDFgLepq/b5rr J4y940wlu3i0m2ed2rf7lBx+EsyyoYiRtzcOKpXHU+WBovlyCIhFuqyoTuuNkOfb6E6WAz W2iRkFUHI4Zo36KtHKJ71GhQkZfFiMsjnMEjFk5NHC9QWL7HkxpsfS0Dec6GkAXaknNEHm F7Cvz17PQ9EuDjc5ybhx4IYUsLNJVoiVQo57GJVd66txPEGefJA7tTroFe9boCYJP4g7wu wP9689O6Wve1yZK7y2IOoMsWLP/EgvBWdRb0rOa0tcercf2p1pGL8ZOHwWqryw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCyl603y4zBQm; Thu, 05 Jun 2025 21:49:06 +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 555Ln5FH064683; Thu, 5 Jun 2025 21:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555Ln5kj064679; Thu, 5 Jun 2025 21:49:05 GMT (envelope-from git) Date: Thu, 5 Jun 2025 21:49:05 GMT Message-Id: <202506052149.555Ln5kj064679@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: 46fce0008432 - main - gve: Fix timestamp invalidation for DQO queue formats 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: 46fce000843215ff3d574d1c24fc24771975973e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=46fce000843215ff3d574d1c24fc24771975973e commit 46fce000843215ff3d574d1c24fc24771975973e Author: Jasper Tran O'Leary AuthorDate: 2025-06-05 17:21:06 +0000 Commit: Mark Johnston CommitDate: 2025-06-05 21:48:57 +0000 gve: Fix timestamp invalidation for DQO queue formats We need to invalidate timestamps when a TX queue is cleared so that the TX timeout detection callout does not mistakenly fire for cleared packets. When using DQO queue formats, timestamps are set on the pending packet array whose length is not the same as the length of the descriptor ring itself. This commit fixes logic which invalidated the wrong number of pending packets. Signed-off-by: Jasper Tran O'Leary Fixes: 3d2957336c7d ("gve: Add callout to detect and handle TX timeouts") Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50688 --- sys/dev/gve/gve_tx_dqo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index bbf2ee1b0324..551a7e308d19 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -987,11 +987,8 @@ gve_tx_clear_desc_ring_dqo(struct gve_tx_ring *tx) struct gve_ring_com *com = &tx->com; int i; - for (i = 0; i < com->priv->tx_desc_cnt; i++) { + for (i = 0; i < com->priv->tx_desc_cnt; i++) tx->dqo.desc_ring[i] = (union gve_tx_desc_dqo){}; - gve_invalidate_timestamp( - &tx->dqo.pending_pkts[i].enqueue_time_sec); - } bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, BUS_DMASYNC_PREWRITE); @@ -1033,6 +1030,8 @@ gve_clear_tx_ring_dqo(struct gve_priv *priv, int i) for (j = 0; j < tx->dqo.num_pending_pkts; j++) { if (gve_is_qpl(tx->com.priv)) gve_clear_qpl_pending_pkt(&tx->dqo.pending_pkts[j]); + gve_invalidate_timestamp( + &tx->dqo.pending_pkts[j].enqueue_time_sec); tx->dqo.pending_pkts[j].next = (j == tx->dqo.num_pending_pkts - 1) ? -1 : j + 1; tx->dqo.pending_pkts[j].state = GVE_PACKET_STATE_FREE; From nobody Thu Jun 5 22:43:11 2025 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 4bCzxX1C1Vz5yTJD; Thu, 05 Jun 2025 22:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCzxW5RbCz4MRM; Thu, 05 Jun 2025 22:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749163391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVs8EOoY2WR8f8n/I90TwUBN0GFTtohb0XrqvI8OhSg=; b=EWReBDFAm1gS8WBznV4jQQaFS5NSGyzzMgtYXjUhfPsVm+2AvTwrDaiYBKt5SAhGcEltL/ /T5eqlxcvpZm819ggO28phUE+l7oL2PWky8VRdWKe6WyPomTIbeXmXeTv/1kxUdIqh6TEN AA7ZDm0uCiboY7eHGyBZH5T2ArBMBy8bPAk1HBVL1lYgH30QkZaG1i1HbzDVoC/DOMnmbF vKCy6roECDP/TbllqEM2Nz1PPuNZg2lTOY+Bn/ZfxsBBCFEF3VF6uC6dUEy0DNT22Rh81D YXF7t2MgeD//FCqDqLmYn8J61oq/0xRD3vxB9CQk+xJrG1UhcdWXrBvH6PHqzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749163391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVs8EOoY2WR8f8n/I90TwUBN0GFTtohb0XrqvI8OhSg=; b=HSsI5S595rdckk9PT/5EOS3cFWPiBxVYFrznjANdELkZpOBXN5bTvsAAKXJoPbDYJxyYJf u0r37kL8WM0eI8i6kqYiF++m2bhRNJJaWPlaa0Z6OLab3Gm+//cyQQ/VlGl1OYHSKDBtlB 0weSAIKd+mZfc+ng1Mt4KKwvQm3eE0QbYfaj57stBmrLXaY8xFbCO1hBm2wpUSyyQvluui dRIZJF4PwwWIqoNTrqnxsPVD9t22idyLWitA/SrO0Cbyj9pvMiCofGvdWGdrhz37bzD4cV bzm6+/PJ49IBqwhzbZKLs5oJWxiuuWQtFjYPxDBiR/4lPz4ae2HdORznMwXXNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749163391; a=rsa-sha256; cv=none; b=k7Y/wF+i6vSS6+inT6Kq6KXmGGskWVs3dkqrZqC9+XOw2MBmqVRuGJ2qe9+aExj2aaN+sU WcSMRsGXDV6BHvshvHTzhTaJPPDGasL3Ap9IWJWmIIxdFm0pyMxbWk00uYEcu3pn9FZmyJ qXhLersQZpHg9dYL91OnjkM5HLB5UxgMgRDIEVYhoR/jQzUekAtgjA5Iyug9q8pmB/+wck MSnJFgw0FSY9sVLQx4hgDznjTx2kWvkogLPhYlxlfcZTXquo4wynpvI5PAqAEqGHahNAre EFDHXqzVG+zT+EQQd8Ud2cF8qcBrZ/sdQhrrsTf7uudUmMTyhTlJDm6S0DsRMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCzxW4syBzD3Y; Thu, 05 Jun 2025 22:43:11 +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 555MhBjJ075257; Thu, 5 Jun 2025 22:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555MhBKl075254; Thu, 5 Jun 2025 22:43:11 GMT (envelope-from git) Date: Thu, 5 Jun 2025 22:43:11 GMT Message-Id: <202506052243.555MhBKl075254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b63f298b1ff9 - main - pseudofs: fix typo in 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b63f298b1ff90d9c25dee09df7fdd0e509185587 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b63f298b1ff90d9c25dee09df7fdd0e509185587 commit b63f298b1ff90d9c25dee09df7fdd0e509185587 Author: Konstantin Belousov AuthorDate: 2025-06-03 22:50:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-05 22:41:04 +0000 pseudofs: fix typo in comment Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D50669 --- sys/fs/pseudofs/pseudofs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index d8dbf7117d13..eafa2947490a 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -155,7 +155,7 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) } /* - * Detach a node from its aprent + * Detach a node from its parent */ static void pfs_detach_node(struct pfs_node *pn) From nobody Thu Jun 5 22:43:12 2025 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 4bCzxY4NbXz5yTNG; Thu, 05 Jun 2025 22:43:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCzxX6BJmz4Mfm; Thu, 05 Jun 2025 22:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749163392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9q0xkZflAt1yl5EOy8w3edvFaMoQCPfVhVUp+eWPadE=; b=NQeu51NXKL0oHa58Id5pO+rb8BaEOx0U3PN7Xn6tcfM+d9s2t3UH4vWk5kFqIxnQwvJI/S zBZD3oyHldOFqD3i8hSg7xHsiKWgcWPoWHHnErmaVmftusKeRie2krDPoSMW1q6JO7y5sH Jqb2GVTGmpqJceRI6EKt6FJInTKdBf2my1nWnoCz8XgJzc98RBdf4vpyJBFhDt5tU3JKvB hvBPWaI6AWV+sQzJ3ru4XhbHz13A/knDPAbRFdwvXIYf9+8rePKVsdDPPDh9YUDHDwIQ+q XyaGuuBSSjKffUHs4UVcz0ENIzR0bMA4jbRrioQqrtHGP/8zt2WZ5g+tWZ6ceQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749163392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9q0xkZflAt1yl5EOy8w3edvFaMoQCPfVhVUp+eWPadE=; b=vlDacQUZrrsQWpMwAA2qKlvvif1EnU/lXtfSlvqGh8vQNw3SAeydB8IsQrDR5p0DE8J2g1 Qt2jaoChpEw4QknAHaM1cMV7hnf0p6r1OJkif4crQ1ImKeXph7OIiCVD5wSQiDoJQKP1EC ciXbOUcd37u9MXH7UxXxoYVWD7CJqzSlQms9B4RCMbLTJQ0r1jTS8ytliiFzen9wrVUS3d C/HolvCeXmWRQFabz5LbZve8HcEQXJ1k+1nDN7Umk9CdRG7luPEaJHr1mz4g0RaR1IAdo1 QTvdX3A1AU1HQUlMGJZv8gZvBnbpPbTAZeoM0Ps6mTrtjWzEp0IL9bDF0dwOVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749163392; a=rsa-sha256; cv=none; b=W+UYp5fG3rFh5CfYHqQ17IUL6Ke/v4k6Ra9JGr1jK3JQ9aoKq81w3S1XGG6uNTm44ecokA iF2zmUwCrDFPkiPliaiJeYp6pUGjyArth0MwGLDEoyYpjr5Jd1FazstscM0emK2pYB4sSk FSs7qZPaZ3hBFpjsesWMPqI+qZ6BG289UDYt5msZMV+fr8kQNmPEkhNyw8v0ja2Rp57K5i LTofGRDii0R2J4NDkmqhBlNxDeHveT2nqHhzdz0fsQ2/E8l7yCtFTRUJU63wJCzsF9JyS8 qih0PzBWPVYZozifgOi7/cRy7G14LLLBhATNbogPcgKx8QF5STRd5KMPkuUobw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCzxX5nC5zD1G; Thu, 05 Jun 2025 22:43:12 +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 555MhCRU075289; Thu, 5 Jun 2025 22:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555MhCtx075286; Thu, 5 Jun 2025 22:43:12 GMT (envelope-from git) Date: Thu, 5 Jun 2025 22:43:12 GMT Message-Id: <202506052243.555MhCtx075286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e9897199576a - main - pseudofs: make dup name an error instead of panic 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9897199576a40360440aa4d2aa48d61c4010f11 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e9897199576a40360440aa4d2aa48d61c4010f11 commit e9897199576a40360440aa4d2aa48d61c4010f11 Author: Konstantin Belousov AuthorDate: 2025-06-03 20:01:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-05 22:41:40 +0000 pseudofs: make dup name an error instead of panic There are enough cases where the duplicate name is caused by dubious hardware configuration. Stopping the whole system instead of failing a driver, or even a diagnostic subsystem in a driver, is more user-friendly. Another issue right now is that the check is only present for the INVARIANTS builds, silently accepting the request to create an entry with the existing name on production builds. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50669 --- sys/fs/pseudofs/pseudofs.c | 53 +++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index eafa2947490a..ef45f96a6192 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -98,12 +98,10 @@ pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) /* * Add a node to a directory */ -static void +static int pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) { -#ifdef INVARIANTS struct pfs_node *iter; -#endif KASSERT(parent != NULL, ("%s(): parent is NULL", __func__)); @@ -123,9 +121,6 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) KASSERT(iter->pn_type != pfstype_procdir, ("%s(): nested process directories", __func__)); for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { - KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0, - ("%s(): homonymous siblings: '%s' type %d", __func__, - pn->pn_name, pn->pn_type)); if (pn->pn_type == pfstype_procdir) KASSERT(iter->pn_type != pfstype_procdir, ("%s(): sibling process directories", __func__)); @@ -134,8 +129,19 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) pn->pn_parent = parent; pfs_fileno_alloc(pn); - pfs_lock(parent); + for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) { + if (strcmp(pn->pn_name, iter->pn_name) != 0) + continue; + printf("pfs_add_node: homonymous siblings: '%s/%s' type %d", + parent->pn_name, pn->pn_name, pn->pn_type); + /* Do not detach, because we are not yet attached. */ + pn->pn_parent = NULL; + pfs_unlock(parent); + return (EEXIST); + } + + if ((parent->pn_flags & PFS_PROCDEP) != 0) pn->pn_flags |= PFS_PROCDEP; if (parent->pn_nodes == NULL) { @@ -152,6 +158,7 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn) parent->pn_last_node = pn; } pfs_unlock(parent); + return (0); } /* @@ -197,6 +204,7 @@ static int pfs_fixup_dir_flags(struct pfs_node *parent, int flags) { struct pfs_node *dot, *dotdot; + int rc; dot = pfs_alloc_node_flags(parent->pn_info, ".", pfstype_this, flags); if (dot == NULL) @@ -206,9 +214,14 @@ pfs_fixup_dir_flags(struct pfs_node *parent, int flags) pfs_destroy(dot); return (ENOMEM); } - pfs_add_node(parent, dot); - pfs_add_node(parent, dotdot); - return (0); + rc = pfs_add_node(parent, dot); + if (rc == 0) + rc = pfs_add_node(parent, dotdot); + if (rc != 0) { + pfs_destroy(dot); + pfs_destroy(dotdot); + } + return (rc); } static void @@ -237,11 +250,12 @@ pfs_create_dir(struct pfs_node *parent, const char *name, pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; - pfs_add_node(parent, pn); - rc = pfs_fixup_dir_flags(pn, flags); - if (rc) { + rc = pfs_add_node(parent, pn); + if (rc == 0) + rc = pfs_fixup_dir_flags(pn, flags); + if (rc != 0) { pfs_destroy(pn); - return (NULL); + pn = NULL; } return (pn); } @@ -264,8 +278,10 @@ pfs_create_file(struct pfs_node *parent, const char *name, pfs_fill_t fill, pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; - pfs_add_node(parent, pn); - + if (pfs_add_node(parent, pn) != 0) { + pfs_destroy(pn); + pn = NULL; + } return (pn); } @@ -287,7 +303,10 @@ pfs_create_link(struct pfs_node *parent, const char *name, pfs_fill_t fill, pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; - pfs_add_node(parent, pn); + if (pfs_add_node(parent, pn) != 0) { + pfs_destroy(pn); + pn = NULL; + } return (pn); } From nobody Thu Jun 5 23:29:59 2025 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 4bD0zZ10k1z5yXCs; Thu, 05 Jun 2025 23:30:02 +0000 (UTC) (envelope-from vishwin@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD0zY4RZNz3sFx; Thu, 05 Jun 2025 23:30:01 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749166201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=HY9nqRvREYItHHHJCplDEZm62KfpuAReL2mc2Jt0exM=; b=cRGJAUwTSrOGNCXZCL/yQI+tb2wonhA7TSRfVqiaqjuBzIHhVeJ+l0+FZXRnM9H2WNj3P9 0rvxjlA2jojRRu5rywuc8HBAeRT92e4vzHLnXtu2T28HKQc4ZOlDTgFFMBIlWTJhLh02iD U205uFdnPLOXztVjK8Y4J4HZDCsYA12OJO/VamUxmwcmE8pMc6/RIjTnP56OJI7jixIu9z suvN9s7/umJJCYp+Su7b2uBNr0jpisYeRwl6hJ9UGVGSbWxHMUk496leU3grdtU6mCEmGx 9Cwt/d38TYacG2QsYq/uJUAqQl7bi76y30AO6ime9e/N91a8qL25HI7UEQZfpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749166201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=HY9nqRvREYItHHHJCplDEZm62KfpuAReL2mc2Jt0exM=; b=tnz4qyeArOb0+94MIZO4fe8NaPZXQlrGRV7C+b5dJpl3KRy+w0vYW2rWakYG83Uh5q9hNe MJwa97i8VqDE+nhh2RNcP8Biq3+yrm9XXDlIlKnByRrp+FLulzifjp+UTJK3PxqoWIbIak qIa0rvDB56DNczCDs1BQw5+N0EZo+aKl5DNkxl9p1qOfJKP8kYVken2wpCqr6HNOkjqHtU MZypklqvhXWfnQjQXH4DZQV04EejvcqmK2nJ+LbH0BlKogBCWEnVBeNVKlU+8nyP771Eb0 VE0xw3fQIVvpUpKWLh891t61NOffOn87HVmEWaWreo4fe1PHyBqIBCwi9cdYDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749166201; a=rsa-sha256; cv=none; b=X9kaY14sJ1j2nh/FDJBF96F/bqfyBTQVjilsP2CiJMzJk82kYsSxMu/jb5aaddTGubFi6k bMVmQHYNCWpb+73HIFpBzmVo/EwgoMNe0Wn2vurmg0ui4licD5I5/PSOABobcFxhqRV+xF WTpXgoOd008epbTGzznyiY6r+4MX+pLoxqLlEC54330fctmBAosoOLht6i9E5f0FKDt68R O5lNCpcVmS0OVtcN3cAc/3AYPuCic1uZ0uPSFCi0UhPoF7BU/FxrUyRp9nWlHXr+RiYNo1 jiREW49xCHoIPeLgEu5PiFJuXEZz6QO1YlthisVkx0k2pVMz6oHBWsKILpMWGQ== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bD0zY1ny0z3pV; Thu, 05 Jun 2025 23:30:01 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> Date: Thu, 5 Jun 2025 19:29:59 -0400 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: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEZFWWqBYJKwYBBAHaRw8BAQdAINFDmM+bgGkT1C4nD5a3BxgcH8Xnx5qTJbPuIBxD57LN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbAwUJA+3ogAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRBnj5NgWEFcyllaAP9CGICFEvTUOv5BYh/H8m49VJ87a/wd 0obeQfVBnS464AD9FopTHbjEs0HDV0ZYmJPxzJIznjumsj9gBxX0bBqqTgzOOARkVZaoEgor BgEEAZdVAQUBAQdA6BUWuG5RuT0vmtoDyCUUqiJGdtd78GM5ic3kw2AntSADAQgHwn4EGBYK ACYWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbDAUJA+3ogAAKCRBnj5NgWEFcyn55 AP9ezKDCUgHqAq6JX976abb9pYdbSjxxNJqnrjgNkfhgIQD/QhR+fgnUHhcGTMBy+pYHZUGH 5DCuITsK1U4+v252uws= Organization: FreeBSD Project In-Reply-To: <202506052106.555L6XBV089396@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------APPC0zWSj6Wvx46LOOVfA5PL" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------APPC0zWSj6Wvx46LOOVfA5PL Content-Type: multipart/mixed; boundary="------------4xQUm0zy7KTTZWDHQjg80TPJ"; protected-headers="v1" From: Charlie Li To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> Subject: Re: git: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> In-Reply-To: <202506052106.555L6XBV089396@gitrepo.freebsd.org> --------------4xQUm0zy7KTTZWDHQjg80TPJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 Sm9obiBCYWxkd2luIHdyb3RlOg0KPiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRl ZCBieSBqaGI6DQo+IA0KPiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMvY29t bWl0Lz9pZD02MDE1OWE5OGE4Mzc0N2U1MzllYjE0YzZhMGVhYWExODc1ZTJjYWNjDQo+IA0K PiBjb21taXQgNjAxNTlhOThhODM3NDdlNTM5ZWIxNGM2YTBlYWFhMTg3NWUyY2FjYw0KPiBB dXRob3I6ICAgICBKb2huIEJhbGR3aW4gPGpoYkBGcmVlQlNELm9yZz4NCj4gQXV0aG9yRGF0 ZTogMjAyNS0wNi0wNSAyMTowMzowMSArMDAwMA0KPiBDb21taXQ6ICAgICBKb2huIEJhbGR3 aW4gPGpoYkBGcmVlQlNELm9yZz4NCj4gQ29tbWl0RGF0ZTogMjAyNS0wNi0wNSAyMTowMzow MSArMDAwMA0KPiANCj4gICAgICBudm1lOiBNb3ZlIG9wY29kZSBhbmQgc3RhdHVzIGNvZGUg dGFibGVzIGZyb20gYmFzZSBDQU0gdG8gbnZtZV91dGlsLmMNCj4gICAgICANCj4gICAgICBU aGlzIG1ha2VzIGl0IHBvc3NpYmxlIHRvIHNoYXJlIHRoZXNlIHRhYmxlcyB3aXRoIHRoZSBu dm1lKDQpIGRyaXZlcg0KPiAgICAgIGluIGN1c3RvbSBrZXJuZWxzIHRoYXQgZG8gbm90IGlu Y2x1ZGUgYW55IENBTSBzdXBwb3J0LCBvbmx5IG52ZCg0KS4NCj4gICAgICANCj4gICAgICBS ZXZpZXdlZCBieTogICAgaW1wDQo+ICAgICAgU3BvbnNvcmVkIGJ5OiAgIENoZWxzaW8gQ29t bXVuaWNhdGlvbnMNCj4gICAgICBEaWZmZXJlbnRpYWwgUmV2aXNpb246ICBodHRwczovL3Jl dmlld3MuZnJlZWJzZC5vcmcvRDUwNjg1DQo+IC0tLQ0KPiAgIHN5cy9jYW0vbnZtZS9udm1l X2FsbC5jICB8IDIyNCAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0NCj4gICBzeXMvY2FtL252bWUvbnZtZV9hbGwuaCAgfCAgIDIgLQ0KPiAgIHN5cy9j b25mL2ZpbGVzICAgICAgICAgICB8ICAgMiArLQ0KPiAgIHN5cy9kZXYvbnZtZS9udm1lLmgg ICAgICB8ICAgNCArDQo+ICAgc3lzL2Rldi9udm1lL252bWVfdXRpbC5jIHwgMjMxICsrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+ICAgNSBmaWxl cyBjaGFuZ2VkLCAyMzYgaW5zZXJ0aW9ucygrKSwgMjI3IGRlbGV0aW9ucygtKQ0KPiANCj4g ZGlmZiAtLWdpdCBhL3N5cy9jYW0vbnZtZS9udm1lX2FsbC5jIGIvc3lzL2NhbS9udm1lL252 bWVfYWxsLmMNCj4gaW5kZXggNDE0NWFhMTZlZDQ5Li4yYWI4YWU1MzQwYzYgMTAwNjQ0DQo+ IC0tLSBhL3N5cy9jYW0vbnZtZS9udm1lX2FsbC5jDQo+ICsrKyBiL3N5cy9jYW0vbnZtZS9u dm1lX2FsbC5jDQo+IEBAIC0yOTIsMjQgKzEzMCw2IEBAIG52bWVfY29tbWFuZF9zdHJpbmco c3RydWN0IGNjYl9udm1laW8gKm52bWVpbywgY2hhciAqY21kX3N0cmluZywgc2l6ZV90IGxl bikNCj4gICAJcmV0dXJuKHNidWZfZGF0YSgmc2IpKTsNCj4gICB9DQo+ICAgDQo+IC12b2lk DQo+IC1udm1lX29wY29kZV9zYnVmKGJvb2wgYWRtaW4sIHVpbnQ4X3Qgb3BjLCBzdHJ1Y3Qg c2J1ZiAqc2IpDQo+IC17DQo+IC0JY29uc3QgY2hhciAqcywgKnR5cGU7DQo+IC0NCj4gLQlp ZiAoYWRtaW4pIHsNCj4gLQkJcyA9IGFkbWluX29wY29kZVtvcGNdOw0KPiAtCQl0eXBlID0g IkFETUlOIjsNCj4gLQl9IGVsc2Ugew0KPiAtCQlzID0gbnZtX29wY29kZVtvcGNdOw0KPiAt CQl0eXBlID0gIk5WTSI7DQo+IC0JfQ0KPiAtCWlmIChzID09IE5VTEwpDQo+IC0JCXNidWZf cHJpbnRmKHNiLCAiJXM6MHglMDJ4IiwgdHlwZSwgb3BjKTsNCj4gLQllbHNlDQo+IC0JCXNi dWZfcHJpbnRmKHNiLCAiJXMiLCBzKTsNCj4gLX0NCj4gLQ0KPiBkaWZmIC0tZ2l0IGEvc3lz L2NhbS9udm1lL252bWVfYWxsLmggYi9zeXMvY2FtL252bWUvbnZtZV9hbGwuaA0KPiBpbmRl eCAxN2MwNjhiODI1YmUuLjJiYzE5NTNlNzliZSAxMDA2NDQNCj4gLS0tIGEvc3lzL2NhbS9u dm1lL252bWVfYWxsLmgNCj4gKysrIGIvc3lzL2NhbS9udm1lL252bWVfYWxsLmgNCj4gQEAg LTQyLDExICs0Miw5IEBAIHN0cnVjdCBzYnVmOw0KPiAgIHZvaWQJbnZtZV9wcmludF9pZGVu dChjb25zdCBzdHJ1Y3QgbnZtZV9jb250cm9sbGVyX2RhdGEgKiwgY29uc3Qgc3RydWN0IG52 bWVfbmFtZXNwYWNlX2RhdGEgKiwgc3RydWN0IHNidWYgKik7DQo+ICAgdm9pZAludm1lX3By aW50X2lkZW50X3Nob3J0KGNvbnN0IHN0cnVjdCBudm1lX2NvbnRyb2xsZXJfZGF0YSAqLA0K PiAgICAgICBjb25zdCBzdHJ1Y3QgbnZtZV9uYW1lc3BhY2VfZGF0YSAqLCBzdHJ1Y3Qgc2J1 ZiAqKTsNCj4gLXZvaWQgbnZtZV9vcGNvZGVfc2J1Zihib29sIGFkbWluLCB1aW50OF90IG9w Yywgc3RydWN0IHNidWYgKnNiKTsNCj4gICB2b2lkIG52bWVfY21kX3NidWYoY29uc3Qgc3Ry dWN0IG52bWVfY29tbWFuZCAqLCBzdHJ1Y3Qgc2J1ZiAqc2IpOw0KPiAgIGludCBudm1lX2Nv bW1hbmRfc2J1ZihzdHJ1Y3QgY2NiX252bWVpbyAqbnZtZWlvLCBzdHJ1Y3Qgc2J1ZiAqc2Ip Ow0KPiAgIGNvbnN0IGNoYXIgKm52bWVfY29tbWFuZF9zdHJpbmcoc3RydWN0IGNjYl9udm1l aW8gKm52bWVpbywgY2hhciAqLCBzaXplX3QpOw0KPiAtdm9pZCBudm1lX2NwbF9zYnVmKGNv bnN0IHN0cnVjdCBudm1lX2NvbXBsZXRpb24gKmNwbCwgc3RydWN0IHNidWYgKnNidWYpOw0K PiAgIGludCBudm1lX3N0YXR1c19zYnVmKHN0cnVjdCBjY2JfbnZtZWlvICpudm1laW8sIHN0 cnVjdCBzYnVmICpzYik7DQo+ICAgY29uc3Qgdm9pZCAqbnZtZV9nZXRfaWRlbnRpZnlfY250 cmwoc3RydWN0IGNhbV9wZXJpcGggKik7DQo+ICAgY29uc3Qgdm9pZCAqbnZtZV9nZXRfaWRl bnRpZnlfbnMoc3RydWN0IGNhbV9wZXJpcGggKik7DQo+IA0KPiANCjxzeXMvZGV2L252bWUu aD4gZG9lc24ndCBhcHBlYXIgdG8gYmUgbWFraW5nIGl0IGluIG52bWVfYWxsLmggYXMgdGhl IA0KYnVpbGQgY29tcGxhaW5zIGFib3V0IG1pc3NpbmcgbnZtZV9vcGNvZGVfc2J1ZigpIGlu IG52bWVfYWxsLmMuDQoNCi0tIA0KQ2hhcmxpZSBMaQ0KLi4ubm9wZSwgc3RpbGwgZG9uJ3Qg aGF2ZSBhbiBleGl0IGxpbmUuDQoNCg== --------------4xQUm0zy7KTTZWDHQjg80TPJ-- --------------APPC0zWSj6Wvx46LOOVfA5PL Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCaEIodwUDAAAAAAAKCRBnj5NgWEFcypO1 AQDP6Vnuh7G+vU4j9prqiahsPAypTu7bLWPpfBFEq5LQVQD6AqTu7QIKbkyy74IZL87/L8P6TbTO ofQCC/IjB1Xihw4= =flnn -----END PGP SIGNATURE----- --------------APPC0zWSj6Wvx46LOOVfA5PL-- From nobody Thu Jun 5 23:56:36 2025 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 4bD1ZD5bryz5x56H; Thu, 05 Jun 2025 23:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD1ZD4PqQz3MY1; Thu, 05 Jun 2025 23:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749167796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZVKQAx9321zeDbYXho/ReLZ+gyG616PjHzuJf8XvEkY=; b=cpq9rKxZh4L1OMleYJos4NWjZnTL1RgxGi+Ygjr4EydOmGaZlFeN9r7gVdpOG4LHwyl0Sb 0067MRsokkyfZS0fWD5AoqkW94OYn86dPjCBIvPARLTrK13TFFE4i4luTsGWRgiWZAfkok Kk2c5H/qClTLM96E1aQcJQaid07aXs+fbAtvnXjB5sNxM7aOn9YhWoUhYM66z/vc/Pgtac a19c7cPzP35U5cuDmsIBn+Z0I47WczsggTIwTiRlqC4+4i136RDZkMYujvSpLQiJPGcHpK ECbtpUH1vAZisia3E8Kbah2kGmthY8ch0xBV0pajaszVzABXzcxOcTyrBpgTqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749167796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZVKQAx9321zeDbYXho/ReLZ+gyG616PjHzuJf8XvEkY=; b=WBbDg2Ip+UHv9ULs5tgJfREzdsdqj3MC796xHQRTqbhTSHCCGKQKVpv9B10Kvw3rRiRc40 wnbM771BSfrItu2OZdHaQg92tb+GadbpNmkPg1pAnh8vIOwk1KfMUoOy+1iy/HFVeol3MO /Mch2ujw5xGkDqQc2vv6VVD9YIMCSmBV+llSUoPGeUhNm9pz0Yh2ArzSepY4D22aNOT5/k Z096Uq7Bf8aj45EgE0O9Hv+1O3JVsDWFOruy2TvlTF4k4BTJ7XKDHVlfukDYZv0URTR1Az EeAufOFBLB2QA5Ro0dRAIz41Suj2sTKstmZZrZbuAPk7EuxmOEiXz4/9n8c8dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749167796; a=rsa-sha256; cv=none; b=kGOtqifgtztSRmeTrBrxYg/Ay2qAbt8qGOrjg8xMhmLxQmWjqgBpKd2OVpfT/FZ4HlE1Y/ OtLC7fYC00u2+Nf8G/fQO3X9nz9G5P3Wk96Pg+ErNWJV0vbdzc3HYvk3XDy6xtbs2aztDj 9dymH9PYMEbBgVVxcS3E5ttlDwfkfOrX1f+YOwTjHjwUvN6fPgSa/FxEEFMBtpz/1ym6k/ LqLhlf601RiLSTtrJ4Yzx/DyecKNDqcsRpy0rDuGT2FYmdYTjedx76MK4tbOtoZa60JK/9 Ws1xxpF3/QNzKuBTRG/3F3R58Ack3/NM54gv+v7OLB2uv1kmEBIy2GOuZTL+yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bD1ZD3ms8zWVV; Thu, 05 Jun 2025 23:56:36 +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 555Nuaif007321; Thu, 5 Jun 2025 23:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555NuarD007318; Thu, 5 Jun 2025 23:56:36 GMT (envelope-from git) Date: Thu, 5 Jun 2025 23:56:36 GMT Message-Id: <202506052356.555NuarD007318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 8e3580073257 - main - build: remove the last vestiges of lint support 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e35800732573de6c4bc1dd3ac420447fca96231 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=8e35800732573de6c4bc1dd3ac420447fca96231 commit 8e35800732573de6c4bc1dd3ac420447fca96231 Author: Brooks Davis AuthorDate: 2025-06-05 23:55:34 +0000 Commit: Brooks Davis CommitDate: 2025-06-05 23:55:34 +0000 build: remove the last vestiges of lint support Commit 1cbb58886a47 (shipped in 12.0.0) removed all lint infrastructure. A bunch of NO_LINT definitions remained (perhaps as a bootstrapping measture). Remove them. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50704 --- Makefile.inc1 | 7 ++----- Makefile.libcompat | 1 - cddl/Makefile.inc | 5 ----- gnu/Makefile.inc | 5 +---- kerberos5/Makefile.inc | 2 -- lib/ncurses/ncurses/Makefile | 2 -- lib/ncurses/tinfo/Makefile | 2 -- secure/lib/libcrypto/Makefile | 1 - secure/lib/libssh/Makefile | 2 -- secure/lib/libssl/Makefile | 2 -- targets/pseudo/bootstrap-tools/Makefile | 1 - 11 files changed, 3 insertions(+), 27 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 60010da6ad50..fc61f5ec54c6 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -767,7 +767,6 @@ BSARGS= DESTDIR= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ -DNO_CPU_CFLAGS \ - -DNO_LINT \ -DNO_PIC \ -DNO_SHARED \ MK_ASAN=no \ @@ -800,7 +799,6 @@ TMAKE= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ -DNO_CPU_CFLAGS \ - -DNO_LINT \ MK_ASAN=no \ MK_CTF=no \ MK_CLANG_EXTRAS=no \ @@ -838,7 +836,6 @@ KTMAKE= ${TIME_ENV} \ MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ -DNO_CPU_CFLAGS \ - -DNO_LINT \ -DNO_PIC \ -DNO_SHARED \ MK_CTF=no \ @@ -1223,7 +1220,7 @@ _libraries: @echo ">>> stage 4.2: building libraries" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ - ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \ + ${WMAKE} -DNO_FSCHG MK_HTML=no MK_MAN=no \ MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} \ libraries everything: .PHONY @@ -3717,7 +3714,7 @@ XDEV_CPUTYPE?=${CPUTYPE} XDEV_CPUTYPE?=${TARGET_CPUTYPE} .endif -NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \ +NOFUN=-DNO_FSCHG MK_HTML=no \ MK_MAN=no MK_NLS=no \ MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WERROR=no \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ diff --git a/Makefile.libcompat b/Makefile.libcompat index 7054cf9ee0bb..5675fa5eaff2 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -64,7 +64,6 @@ build${libcompat}: .PHONY OBJROOT='$${OBJTOP}/' \ UNIVERSE_TOOLCHAIN_PATH=${UNIVERSE_TOOLCHAIN_PATH} \ MAKEOBJDIRPREFIX= \ - -DNO_LINT \ -DNO_CPU_CFLAGS \ MK_ASAN=no \ MK_CTF=no \ diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index 63768ae44a7d..dc942ed2812d 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -5,8 +5,3 @@ IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN CFLAGS+= -DHAVE_STRLCAT -DHAVE_STRLCPY - -# Do not lint the CDDL stuff. It is all externally maintained and -# lint output is wasteful noise here. - -NO_LINT= diff --git a/gnu/Makefile.inc b/gnu/Makefile.inc index 6ceebdef9d59..7f963b3788d1 100644 --- a/gnu/Makefile.inc +++ b/gnu/Makefile.inc @@ -1,4 +1 @@ -# Do not lint the GNU stuff. It is all externally maintained and -# lint output is wasteful noise here. - -NO_LINT= +# This file is empty to prevent infinite recursion in */Makefile.inc diff --git a/kerberos5/Makefile.inc b/kerberos5/Makefile.inc index 71bd19c0b895..2525f3888806 100644 --- a/kerberos5/Makefile.inc +++ b/kerberos5/Makefile.inc @@ -1,7 +1,5 @@ .include -NO_LINT= - KRB5DIR= ${SRCTOP}/crypto/heimdal CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR:H:H}/include diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 254f05a1e740..512a452ad6d0 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -8,8 +8,6 @@ SHLIBDIR?= /lib LIB= ncursesw SHLIB_MAJOR= 9 -NO_LINT= - GENSRCS= \ expanded.c \ lib_gen.c diff --git a/lib/ncurses/tinfo/Makefile b/lib/ncurses/tinfo/Makefile index e11d0e15245e..920bd6e5559c 100644 --- a/lib/ncurses/tinfo/Makefile +++ b/lib/ncurses/tinfo/Makefile @@ -8,8 +8,6 @@ SHLIBDIR?= /lib LIB= tinfow SHLIB_MAJOR= 9 -NO_LINT= - NCURSES_MAJOR!= egrep 'NCURSES_MAJOR[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' NCURSES_MINOR!= egrep 'NCURSES_MINOR[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' NCURSES_PATCH!= egrep 'NCURSES_PATCH[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index a6ca46ecd372..4d2ad2294829 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -11,7 +11,6 @@ LIB= crypto SHLIB_MAJOR= 30 VERSION_MAP= ${.CURDIR}/Version.map -NO_LINT= PCFILES= libcrypto.pc .include "Makefile.man" diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index 35883d4a9d42..2f1bc4a9ba69 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -65,8 +65,6 @@ LIBADD+= ldns CFLAGS+= -D_PATH_SSH_ASKPASS_DEFAULT='"${LOCALBASE}/bin/ssh-askpass"' .endif -NO_LINT= - LIBADD+= crypto crypt z .include diff --git a/secure/lib/libssl/Makefile b/secure/lib/libssl/Makefile index 9d8a64ee0ab4..d8ce01cdb92e 100644 --- a/secure/lib/libssl/Makefile +++ b/secure/lib/libssl/Makefile @@ -5,8 +5,6 @@ SHLIB_MAJOR= 30 VERSION_MAP= ${.CURDIR}/Version.map PACKAGE= openssl-lib -NO_LINT= - PCFILES= libssl.pc openssl.pc .include "../libcrypto/Makefile.inc" diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile index d342af4ff9f9..77e656ca56c5 100644 --- a/targets/pseudo/bootstrap-tools/Makefile +++ b/targets/pseudo/bootstrap-tools/Makefile @@ -38,7 +38,6 @@ BSARGS= DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET} \ -DNO_CPU_CFLAGS \ - -DNO_LINT \ -DNO_PIC \ -DNO_SHARED \ MK_CTF=no \ From nobody Thu Jun 5 23:56:37 2025 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 4bD1ZG1MHMz5x4dZ; Thu, 05 Jun 2025 23:56: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 4bD1ZF596lz3MgG; Thu, 05 Jun 2025 23:56:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749167797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kxSTXhIoeyobAQLdT9UsCglL0paIHgM1LgJZjAAwENQ=; b=Lnvw7i6TW5lHRb0165BEtZjpz1shNuWUi5E0Ojg2BvuBRfLrZhPnH0gCmhguO3sjL/5qU1 kiP/hWbSnSL7WFtu8M/sfDwk3RI+K7MhFkkSuLnkgSwEevQCoLaQIPb+q9yHzvbzk7h6Bm z5KBcQZ8EHUtCq9JG5m3N6quC8r2Xg72Bz+5lDF3+uRosKfM+YVZ0MNjZUyVpP/E7tHmAV v6e/F8Jt6UIFc+U4tCAtxYfjhA7wi1ynoIIqj2+EvH83cyRbzmhKVdhALMoqQmUdnFsUJy A9AQRyNjworgysUm1ZcYYcXQGa/3xlW1HbWNQFku3teySl/PyfTTfDUbn9f1DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749167797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kxSTXhIoeyobAQLdT9UsCglL0paIHgM1LgJZjAAwENQ=; b=WtAM2Qe0K2VSmNQFqalsPPWscfMh/DDgqzhlSfHUPJhzJm83KprLgu//Wu4McnPvVJfx58 4HUcoGvE12wbc9Ezcmqp4jIUYGObFlyEwvwS9kmb+w92fLzB8qKGl1JzNVOn3s5zLf138U o69qGxXhFrYc336QgEmXE7NXljqsm7UZEDsc7CkTgEXjYs1jSIJTUxvyEeN/5QrfmpLD9f 8tfrw5DGEuX7brKU8t0nymkO6nXEuh9kDT9xbHlaipr7O248pOo83/wM60TMqtcXCevaXk lmQMUuHgkocO1iOGqFvAarNuCAdPC5UcHwzLvFFIXuxyVzjUCo1zncYvuzvkPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749167797; a=rsa-sha256; cv=none; b=W1LudyOrP/G7S961/FClh3wHtUdckchhpuaJFcBQKzrbHuPaOS9EE4YAppZ6kBSipXrCEz 0n2Hl0J5sSExqDeaeDh2UwnRTEj7GL+24NI6iLLUzTAagHoESr+8OTz6qikMRUTVhidFjr tQNal/TFnNeiUA9hrMxz2cW3aB0/2SImTJHwwQNuaVMZ3dh6yr3arCvqGBbLPYqLgpEXgJ hs//6dd9mWXNZCa39ylOjP5NGulbnQgHLFcu+vdjQFEeayJjNwilo5PiFnPkY3kQRK4nuG LM1QKRAoZSzc3FPGveG6wyapg6/NosxN8M9lDG9EHFCz4qoVZk7k/ocLNbR8ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bD1ZF4kcJzX1T; Thu, 05 Jun 2025 23:56:37 +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 555NubSu007355; Thu, 5 Jun 2025 23:56:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 555NubFi007352; Thu, 5 Jun 2025 23:56:37 GMT (envelope-from git) Date: Thu, 5 Jun 2025 23:56:37 GMT Message-Id: <202506052356.555NubFi007352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 934df0ca61bf - main - mman: Reserve two PROT_ for CHERI 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 934df0ca61bfbb6bdedba8588457a3ffa2adde25 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=934df0ca61bfbb6bdedba8588457a3ffa2adde25 commit 934df0ca61bfbb6bdedba8588457a3ffa2adde25 Author: Brooks Davis AuthorDate: 2025-06-05 23:55:35 +0000 Commit: Brooks Davis CommitDate: 2025-06-05 23:55:35 +0000 mman: Reserve two PROT_ for CHERI use In CheriBSD we use two bits to control load and store of CHERI capabilities (pointers). In anticipation of merging CHERI support in time for FreeBSD 16, reserved these two bits to avoid the (low, but non-zero) risk of a flag day downstream. I've used PROT_CHERI0 and PROT_CHERI1 rather than their downstream name in hopes of avoiding the impression they do something today. Reviewed by: kevans, adrian Suggested by: kevans, adrian Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50621 --- sys/sys/mman.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/mman.h b/sys/sys/mman.h index 611c5b4e669f..ba478bc71c7c 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -53,6 +53,8 @@ #define PROT_WRITE 0x02 /* pages can be written */ #define PROT_EXEC 0x04 /* pages can be executed */ #if __BSD_VISIBLE +#define PROT_CHERI0 0x08 +#define PROT_CHERI1 0x10 #define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) #define PROT_EXTRACT(prot) ((prot) & _PROT_ALL) From nobody Fri Jun 6 00:42:12 2025 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 4bD2Zs4ltYz5x8M3; Fri, 06 Jun 2025 00:42:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD2Zs48zPz47p9; Fri, 06 Jun 2025 00:42:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749170533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hpKAP/7c6CosfwbeoKMJUX4r1USsfEf2sQDJyQlaNnI=; b=ke1am8CRKvVE4Tr5gWDRVNnxBjNHTxyDrvIqZT1JQvk1K4jZZi16gzAxumakRwgF3Tl+UM zJLdSyIBpDH/3J7W6JFqwzhXIL/3XbnL1QlaWl3QmJCMvKe9rF/It6bSzFSF3J6JG350QB 5FctrqaBz55//SJY2DlRuIVs67wzHGmpvxYRiKxqRwNVEYqcsKB5tS+zWrUJgiEfVmfFrK ebqyBI32UnNJrQyDk5uojY6quZwGcMT1pUviXnPwuPldNmJacW1yS5pkYmFiAuKfDa/z2w tNjVsdFZxli38IpooCp9Z8G6gmwy0I4eq+DeoMy2COmmDReVmiZqPq2ZdhR1hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749170533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hpKAP/7c6CosfwbeoKMJUX4r1USsfEf2sQDJyQlaNnI=; b=xKj45RaEV9qkbASanaOk2QX4n9r1AThb2cJrofux03IgjHNKOzPRZu4Zn7rArzsXJzBDcL AY0oK0e95QU8k9nL5CljErxA/ZMI9JEXWezu5pywYev+ZjBYKpP5oXvmtcJwcV+ajKHn37 wHmZlAyPYZwu9ieDHV8fUetvT2LKK/dR1Wc/ZVFUjigXUlmAXLbnbD1+IF0+UCarbrQsNm cG5cLv9HkHrzfFs5h+DaKWy0FJatgWa0e9r8Qx0sTzpY6JEkvOIBMGYqHn62nLfq4YN4jg Bz7BYpNlZU7M9FWdEEm1+EmuCExDdRIfWI0x8i2GE/gieKltnbM2Vps6koHdKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749170533; a=rsa-sha256; cv=none; b=uIxR+b//2a1mluHP4kpcjp7BUy5GBmlmWbJJd8xQ7W/dfKW2DWB+UVcidppEAzgUpkWfMk k8cEfoYOJ8H5cui0cSd3oEqPckRcL/MxMz+RJmlbVN/4hhBZSySb5+CoGWBpmSDqnbnqRc esKWVNSgDrhqbg3K+ea9s7R7mEuSXnJHt5WPbGAS1NJEldJcFzcGSF0UOkheERpVprfkxi n5GvLllseAD0NcLyUjMdbtVp+g/6gsOJXpDhedhGuNjo5iuk7i+Z8LSCtGTIY80TUw6IZh 5xUTNMh0Txv3a4Orp2clpLAGOSm9BsJ9rICBXBXMhbp6effVbzA5/zu4P1W8tw== Received: from [IPV6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1] (unknown [IPv6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1]) (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) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bD2Zs2HY4z4ZH; Fri, 06 Jun 2025 00:42:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 5 Jun 2025 20:42:12 -0400 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: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c Content-Language: en-US To: Charlie Li , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> From: John Baldwin In-Reply-To: <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/5/25 19:29, Charlie Li wrote: > John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=60159a98a83747e539eb14c6a0eaaa1875e2cacc >> >> commit 60159a98a83747e539eb14c6a0eaaa1875e2cacc >> Author: John Baldwin >> AuthorDate: 2025-06-05 21:03:01 +0000 >> Commit: John Baldwin >> CommitDate: 2025-06-05 21:03:01 +0000 >> >> nvme: Move opcode and status code tables from base CAM to nvme_util.c >> >> This makes it possible to share these tables with the nvme(4) driver >> in custom kernels that do not include any CAM support, only nvd(4). >> >> Reviewed by: imp >> Sponsored by: Chelsio Communications >> Differential Revision: https://reviews.freebsd.org/D50685 >> --- >> sys/cam/nvme/nvme_all.c | 224 --------------------------------------------- >> sys/cam/nvme/nvme_all.h | 2 - >> sys/conf/files | 2 +- >> sys/dev/nvme/nvme.h | 4 + >> sys/dev/nvme/nvme_util.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++ >> 5 files changed, 236 insertions(+), 227 deletions(-) >> >> diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c >> index 4145aa16ed49..2ab8ae5340c6 100644 >> --- a/sys/cam/nvme/nvme_all.c >> +++ b/sys/cam/nvme/nvme_all.c >> @@ -292,24 +130,6 @@ nvme_command_string(struct ccb_nvmeio *nvmeio, char *cmd_string, size_t len) >> return(sbuf_data(&sb)); >> } >> >> -void >> -nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb) >> -{ >> - const char *s, *type; >> - >> - if (admin) { >> - s = admin_opcode[opc]; >> - type = "ADMIN"; >> - } else { >> - s = nvm_opcode[opc]; >> - type = "NVM"; >> - } >> - if (s == NULL) >> - sbuf_printf(sb, "%s:0x%02x", type, opc); >> - else >> - sbuf_printf(sb, "%s", s); >> -} >> - >> diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h >> index 17c068b825be..2bc1953e79be 100644 >> --- a/sys/cam/nvme/nvme_all.h >> +++ b/sys/cam/nvme/nvme_all.h >> @@ -42,11 +42,9 @@ struct sbuf; >> void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); >> void nvme_print_ident_short(const struct nvme_controller_data *, >> const struct nvme_namespace_data *, struct sbuf *); >> -void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); >> void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); >> int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); >> const char *nvme_command_string(struct ccb_nvmeio *nvmeio, char *, size_t); >> -void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); >> int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); >> const void *nvme_get_identify_cntrl(struct cam_periph *); >> const void *nvme_get_identify_ns(struct cam_periph *); >> >> > doesn't appear to be making it in nvme_all.h as the > build complains about missing nvme_opcode_sbuf() in nvme_all.c. Are you getting a link error or a compile error? I built this locally several times today to test various combinations (kernels with and without either CAM or nvme and loading nvme.ko in kernels without to make sure it worked). I also built GENERIC prior to pushing and it built fine. Sigh, so from ci.freebsd.org, it appears to be userland that is choking (libcam) rather than the kernel. I'll fix shortly (mostly it just means removing the #ifdef _KERNEL). -- John Baldwin From nobody Fri Jun 6 00:46:19 2025 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 4bD2gc6zpvz5x8RJ; Fri, 06 Jun 2025 00:46:20 +0000 (UTC) (envelope-from vishwin@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD2gc6GCPz3F8B; Fri, 06 Jun 2025 00:46:20 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749170780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Fvrv+yIBh1Cfj6TxtrjSoGwML0jUFWL0y428xQd884c=; b=kqA0n6SInSPUa5OUwfq+ZLEAYRBNAvYO5b+YKi7GlTC1ac66Ho6TxV3ZZ8BHCeNnQ8mPTQ Fc11Z5omYPZKNgdq6sBVESbdlqAXX5nTh3gA65C9tqbX0u91XTEUNtsiQgex9YHsUHZ4gc ZcMmtxPh0YbVpepfkqnABQrjdsLy2Rl3M2RqpSA+88xfOKgG6xFw9GICNmnIK/doTOk31s s5gJBMuwilIzKGEYAVsFF6wIcBREXvUiy1HmQQPvPvpAjRJnrbE2nqToNwRa4m0BGCMLGB /zNc3pg80cyTjMxOSHns0UNNGVQDwIkRjrzuK+3NKBvXxrAsbGjziA6hXffsWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749170780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Fvrv+yIBh1Cfj6TxtrjSoGwML0jUFWL0y428xQd884c=; b=HDwxLOZZI2dX+wtJRDUrbsjG6VMcScfqiUkJv1kK0Sb+7wozhn3bzjCn0daSyu+lg3OR1l OtKfw1EEFbSMZZWmP6s3FkMBAFsECXN9/JiQ62cZHZ8W4TOlNJcBgVUO/S1aTqALOQ+kQm zr1pujsKxN5fF1VQtR4ybaILKssSzZRwV1z2PSlweQzR+qWE/9AKZonGjneTfyuRK20X2P JlZIq2lxVJWpBo3JDfUddJOoLAhiiom7aSJkzASkHVWca+ciseYEn/5Dy5GA0Hkvtc9Zuf 0yzA4y60EUw8X1MO6qxTexwy6VbCFb1h9OtLGwtBA7lOQXLBAXSWj/nfK58nGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749170780; a=rsa-sha256; cv=none; b=nBVV2mRN/LUfmWkJ/5YYi/xkklg8grhG4rhZ7nZxBX70aaHEF0nswUJTsbHFaRMLp8oo3J 3mn8dLAV97LMsWcIA8unuBMKcOIzgQcn2kPwWq7kDrhF290nB97u8bb7Pnt6ZLmKZ6wZ+M lIW1yFW5DA9qqem/PzJ2SpqyyoLQJkls0I+IwlCj3HKtLaGvFda9n8iOUtihTSC3o7jQmL 4XFdSDAofWWpWzFjvWwRzW+3Gox0hFgU2Ou3a0LWcGxEPN9+IJB4T6UEnAvnQ7S5Wyd8i2 bosQIeETz+s9bKz2mw/GO3goo5lrm1PTTdEqznj6nOjVKF4+kmuw0npVhQJCcw== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bD2gc3pkYz4ZJ; Fri, 06 Jun 2025 00:46:20 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> Date: Thu, 5 Jun 2025 20:46:19 -0400 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: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEZFWWqBYJKwYBBAHaRw8BAQdAINFDmM+bgGkT1C4nD5a3BxgcH8Xnx5qTJbPuIBxD57LN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbAwUJA+3ogAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRBnj5NgWEFcyllaAP9CGICFEvTUOv5BYh/H8m49VJ87a/wd 0obeQfVBnS464AD9FopTHbjEs0HDV0ZYmJPxzJIznjumsj9gBxX0bBqqTgzOOARkVZaoEgor BgEEAZdVAQUBAQdA6BUWuG5RuT0vmtoDyCUUqiJGdtd78GM5ic3kw2AntSADAQgHwn4EGBYK ACYWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbDAUJA+3ogAAKCRBnj5NgWEFcyn55 AP9ezKDCUgHqAq6JX976abb9pYdbSjxxNJqnrjgNkfhgIQD/QhR+fgnUHhcGTMBy+pYHZUGH 5DCuITsK1U4+v252uws= Organization: FreeBSD Project In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------PQdmu0dOIK2CLv0PN3Z7XM6S" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------PQdmu0dOIK2CLv0PN3Z7XM6S Content-Type: multipart/mixed; boundary="------------cCuhb4jwOhK7Gw5I6KKcFRfu"; protected-headers="v1" From: Charlie Li To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> Subject: Re: git: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> In-Reply-To: --------------cCuhb4jwOhK7Gw5I6KKcFRfu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 Sm9obiBCYWxkd2luIHdyb3RlOg0KPiBPbiA2LzUvMjUgMTk6MjksIENoYXJsaWUgTGkgd3Jv dGU6DQo+PiA8c3lzL2Rldi9udm1lLmg+IGRvZXNuJ3QgYXBwZWFyIHRvIGJlIG1ha2luZyBp dCBpbiBudm1lX2FsbC5oIGFzIHRoZQ0KPj4gYnVpbGQgY29tcGxhaW5zIGFib3V0IG1pc3Np bmcgbnZtZV9vcGNvZGVfc2J1ZigpIGluIG52bWVfYWxsLmMuDQo+IA0KPiBBcmUgeW91IGdl dHRpbmcgYSBsaW5rIGVycm9yIG9yIGEgY29tcGlsZSBlcnJvcj/CoCBJIGJ1aWx0IHRoaXMg bG9jYWxseSANCj4gc2V2ZXJhbCB0aW1lcw0KPiB0b2RheSB0byB0ZXN0IHZhcmlvdXMgY29t YmluYXRpb25zIChrZXJuZWxzIHdpdGggYW5kIHdpdGhvdXQgZWl0aGVyIENBTSANCj4gb3Ig bnZtZSBhbmQNCj4gbG9hZGluZyBudm1lLmtvIGluIGtlcm5lbHMgd2l0aG91dCB0byBtYWtl IHN1cmUgaXQgd29ya2VkKS7CoCBJIGFsc28gDQo+IGJ1aWx0IEdFTkVSSUMNCj4gcHJpb3Ig dG8gcHVzaGluZyBhbmQgaXQgYnVpbHQgZmluZS4NCj4gDQpDb21waWxlIGVycm9yIGluIGJ1 aWxkd29ybGQuDQo+IFNpZ2gsIHNvIGZyb20gY2kuZnJlZWJzZC5vcmcsIGl0IGFwcGVhcnMg dG8gYmUgdXNlcmxhbmQgdGhhdCBpcyBjaG9raW5nIA0KPiAobGliY2FtKQ0KPiByYXRoZXIg dGhhbiB0aGUga2VybmVsLsKgIEknbGwgZml4IHNob3J0bHkgKG1vc3RseSBpdCBqdXN0IG1l YW5zIHJlbW92aW5nIA0KPiB0aGUNCj4gI2lmZGVmIF9LRVJORUwpLg0KPiANCg0KLS0gDQpD aGFybGllIExpDQouLi5ub3BlLCBzdGlsbCBkb24ndCBoYXZlIGFuIGV4aXQgbGluZS4NCg== --------------cCuhb4jwOhK7Gw5I6KKcFRfu-- --------------PQdmu0dOIK2CLv0PN3Z7XM6S Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCaEI6WwUDAAAAAAAKCRBnj5NgWEFcyteC AP9ebJEM0xB/wdvT9u5Ccpohh7T8mF9rYOqAV8SSwN+ELgEAvcIF3P5s3m6fR3C2D+htSKT/W56T 44pREw7odcW0BQU= =vwUy -----END PGP SIGNATURE----- --------------PQdmu0dOIK2CLv0PN3Z7XM6S-- From nobody Fri Jun 6 01:14:19 2025 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 4bD3JF3MV9z5xC3P for ; Fri, 06 Jun 2025 01:14:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) (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 4bD3JF1R7fz3jpx for ; Fri, 06 Jun 2025 01:14:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-70dd2d35449so13304867b3.3 for ; Thu, 05 Jun 2025 18:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749172476; x=1749777276; 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=Hhjz7IWMlaVI8eBb3MnC4EzqBqDPxRu6uSWgl5uTi2w=; b=Km1XCmgfTaE8CYtgUpgIE0wVAP0MpngpVscdFFNEy/M2oH+nbqsjFiiLVAiAaUTbOz p8o7Xtj+YIRjmbQxVAV9EWFIsmacME0NOfzFzw0s7We94MjtLgnoavInrrmwuGUk+HHT Dpxu5q3BrILfJpmaNuPAFmDNlFOGxT/afj7ywVxDdxHLVRg/CXMYi/QyymHMW3+dnm4p 6c7CWHxBaLoCck547Co2qIe4h07apxZfj3gVrsHkbnXcr8Wac+9PDm51nY897ebuGLvH viTR2DeVZHDbJCMrg/6i6cGoJpZ8KV9hiXK1pAv+XLERALWTwC6tJZ0tmmAj7pbGEohb Bgpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749172476; x=1749777276; 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=Hhjz7IWMlaVI8eBb3MnC4EzqBqDPxRu6uSWgl5uTi2w=; b=JF5hR6OmXQar0NUmUrKa9zpFvETi5rRsRz8FqVPZ3oMV7Gxw9HpT/x+5kigmhZCWxn KqDr8MYbD2r0InCLjUrvl+0ZqnkeKCMkgwRGaWyHZMOsWiD2E3QvCunCVYMHqeF/rvk2 UidH3T6eleR9scHGGTyu4LbFZzl7qOgHDyBc+PA8p0CMwRIk8jh80k7dShT6mUR96YzP SJ6kwakKnEWF+Wsez7Y7xnXAvINNkiLXdj97iAzRUAFrJjSjvhL81oR8mFInuZ0F0jwy ft+zxb66/Gm4rD7ll3wIBFA9SKqbgXIHAPifdAee7tAr1XiM00vZOpvBrnL5djbUVtpv X+5w== X-Forwarded-Encrypted: i=1; AJvYcCWjzWwTBo19B2UBwY3YZjwEfX8DbS7+csP9sDqEN0+Oe+UvoYuEasRDjlmGzGF5avuswi2O/DrUeRMb5DRItp8hi0HSSg==@freebsd.org X-Gm-Message-State: AOJu0YxtH1JdClRNB5pKGzkwkE6icksEZOc2E3tEb75MNF209isUSb4B O9iuXzKdXjaeYiQK/T6tHzRy/ZbaGuVw6mFXVmlCBDl3ZLiEZ75Bvo8vxsLPmTSuDUMvqLfuEw8 gN8MjlOcdGjcLmx+TvBLcJpzpK52yMgDGitwFM+Xy8A== X-Gm-Gg: ASbGncs7qQqSwow45V5lGMtG1LE8lhptjnByh1YnzYb6ikPRIUHA+iI44urXA1j5m68 vDV+i4uQ5xpADNWioOFGICR0kAASj5oPipx/NSZHmqUA9nYPtedhrfCYPUmpcil79FSLGQKufh4 GHJpny34vK3epydZTY5JCK8fMvktGhJn4yHqJFc9it/gJoZuJyoWubLIoPGLlZa47pDA== X-Google-Smtp-Source: AGHT+IFZrJwlIifjx56F+RjBTc9kp7RHSqC3eU1F/zm+asOzJpCq22bccCPfRn8+AJvfs0QfxU/h94LotCl74fCw6MA= X-Received: by 2002:a05:690c:6302:b0:70e:7a67:b4b5 with SMTP id 00721157ae682-710f76a56b4mr23197227b3.22.1749172475989; Thu, 05 Jun 2025 18:14:35 -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: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> In-Reply-To: <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> From: Warner Losh Date: Thu, 5 Jun 2025 19:14:19 -0600 X-Gm-Features: AX0GCFvJc3Yaf2BOJDDHeSMRFt9r7sG7LX6sf3bUU_jwv9nJxwUh3yPn5bK5jTc Message-ID: Subject: Re: git: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c To: Charlie Li Cc: John Baldwin , src-committers , "" , "" Content-Type: multipart/alternative; boundary="0000000000001520760636dcf401" X-Rspamd-Queue-Id: 4bD3JF1R7fz3jpx 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] --0000000000001520760636dcf401 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 5, 2025, 6:46=E2=80=AFPM Charlie Li wrote= : > John Baldwin wrote: > > On 6/5/25 19:29, Charlie Li wrote: > >> doesn't appear to be making it in nvme_all.h as the > >> build complains about missing nvme_opcode_sbuf() in nvme_all.c. > > > > Are you getting a link error or a compile error? I built this locally > > several times > > today to test various combinations (kernels with and without either CAM > > or nvme and > > loading nvme.ko in kernels without to make sure it worked). I also > > built GENERIC > > prior to pushing and it built fine. > > > Compile error in buildworld. > In libcam? Warner > Sigh, so from ci.freebsd.org, it appears to be userland that is choking > > (libcam) > > rather than the kernel. I'll fix shortly (mostly it just means removin= g > > the > > #ifdef _KERNEL). > > > > -- > Charlie Li > ...nope, still don't have an exit line. > --0000000000001520760636dcf401 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Jun 5, 2025, 6:46=E2=80= =AFPM Charlie Li <vishwin@freebsd= .org> wrote:
John Baldwin wr= ote:
> On 6/5/25 19:29, Charlie Li wrote:
>> <sys/dev/nvme.h> doesn't appear to be making it in nvme_= all.h as the
>> build complains about missing nvme_opcode_sbuf() in nvme_all.c. >
> Are you getting a link error or a compile error?=C2=A0 I built this lo= cally
> several times
> today to test various combinations (kernels with and without either CA= M
> or nvme and
> loading nvme.ko in kernels without to make sure it worked).=C2=A0 I al= so
> built GENERIC
> prior to pushing and it built fine.
>
Compile error in buildworld.
=
In libcam?

Warner

> Sigh, so from ci.freebsd.org, it appears to be userland tha= t is choking
> (libcam)
> rather than the kernel.=C2=A0 I'll fix shortly (mostly it just mea= ns removing
> the
> #ifdef _KERNEL).
>

--
Charlie Li
...nope, still don't have an exit line.
--0000000000001520760636dcf401-- From nobody Fri Jun 6 01:32:36 2025 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 4bD3j14FHjz5xDFL; Fri, 06 Jun 2025 01:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD3j11H4Yz4215; Fri, 06 Jun 2025 01:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749173557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9LRpqPh7aMWYgD4x+DAkjHmEMP1Mz+g+HcAFZMwSikc=; b=ogg9HJi8BcnoKYM0SolqdOZcj0ad57mb3LIpA6il8wREtw26jdoYLd6yJdSsJEm4k1KvtL p3fjpu3IpCA3GgVdNdFJ+MmappSbxjTu9Qnvrex70hHMxOX+DD1sM66uTODzaiOR5FVp+8 TclgUo5MdyWibdQu3a75R6EAM79S4ogycK24od0fS7rMPP3VZhHq5Wy0R0oqjTh8S5d3wC id/ISMXe5rj6x0j2cAgdYiPQb9SCUYDm22tYmDdhy0KZo5Mqk8f9wM4xnWd7TJfDHjltSF SHYUvPhf+3Vx3I1lGcVVaAjhrSg0siPYsqkdUzuWlyZxgjldHy6q/Gq0A7glIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749173557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9LRpqPh7aMWYgD4x+DAkjHmEMP1Mz+g+HcAFZMwSikc=; b=Zit/wWkpe00H+4WAp6FfAjHoXPcVde4vheWUKqqEt34U5h+Fehb6jVhOTJbH98obuDi31e EQ870Z0WS34eiUVu1IuljZINZ2PoVaEmka9p7fO5R5DubtMQ/iw+YpfsfvDFpPg/9H4eWX w2NdoDMQY2vYb6p8v21phIdTxLdkS2zhWsuq7exJklQ2T1W4B6NE/jYc+TYSVSY/XeuZ2B 0mauqXjynEICMrcW4vQL5tIMVWwPgA9/3ljULUP895854gwkuIVok8Xp8nhINZcPMny1xP 950hU+tbl4QsH1XdFN0l1NXWM7HxoVCEU9UH5u/mbzlIAwVOz9xa+09GgZmVKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749173557; a=rsa-sha256; cv=none; b=JSceaz6z0I2Pu6OkTAoXRHVj5r8HZiV7zqed80wm5fMtIGL/g09GqI0cGruFFgvEdFNsCl YemsYu5Z0kiQ7dREqZxABSwoxRyaq1yYyyRcBz2xwe6bUndqCkWGGBFrQfdxNDmFQy9lNQ peZTjmEWmIOIP+eIsK7FB1lIqIsBgLHH+un0xFdAgA4GUJYDjy7b+e0rX8imq6AfzJ2DI4 6dWjpS47hqF05ZBdFG2F5vGwYwKtoiU05V8IjSWGGqPkGGSMOR2Mr9w9/Iggkw+7nr0uFl pqXrXv0QwS4v7rcfomcW8Kai9znufOlHqrurx3bXEkNoMgAVBtuHtioPtJKtdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bD3j10T1tzZd9; Fri, 06 Jun 2025 01:32:37 +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 5561WawX094188; Fri, 6 Jun 2025 01:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5561Wakc094185; Fri, 6 Jun 2025 01:32:36 GMT (envelope-from git) Date: Fri, 6 Jun 2025 01:32:36 GMT Message-Id: <202506060132.5561Wakc094185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b3ee39e73af36f49f471f7900baeb98ac3504d0 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b3ee39e73af36f49f471f7900baeb98ac3504d0 commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 Author: John Baldwin AuthorDate: 2025-06-06 01:28:38 +0000 Commit: John Baldwin CommitDate: 2025-06-06 01:28:38 +0000 libcam: Include nvme opcode and status code routines from nvme_util.c libcam in userspace also includes nvme_all.c which now depends on nvme_util.c, so add nvme_util.c to libcam's sources. This requires exporting the opcode and status code routines in nvme_util.c to userspace as well as the kernel. In turn, this means nvmecontrol now depends on libsbuf (which is already present in /lib). Reported by: viswhin, Jenkins Fixes: 60159a98a837 ("nvme: Move opcode and status code tables from base CAM to nvme_util.c") Sponsored by: Chelsio Communications --- lib/libcam/Makefile | 5 +++-- sbin/nvmecontrol/Makefile | 2 +- sys/dev/nvme/nvme.h | 13 ++++++++----- sys/dev/nvme/nvme_util.c | 4 ---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile index c2f7b75bc878..d4efbbdf4d9b 100644 --- a/lib/libcam/Makefile +++ b/lib/libcam/Makefile @@ -3,7 +3,7 @@ PACKAGE= runtime LIB= cam SHLIBDIR?= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ - ata_all.c nvme_all.c smp_all.c scsi_wrap.c + ata_all.c nvme_all.c nvme_util.c smp_all.c scsi_wrap.c INCS= camlib.h scsi_wrap.h LIBADD= sbuf @@ -39,7 +39,8 @@ MLINKS+= cam.3 cam_open_device.3 \ ${SRCTOP}/sys/cam/ata \ ${SRCTOP}/sys/cam/nvme \ ${SRCTOP}/sys/cam/mmc \ - ${SRCTOP}/sys/cam/scsi + ${SRCTOP}/sys/cam/scsi \ + ${SRCTOP}/sys/dev/nvme CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index 2abcd72dedfa..cf9c23548e36 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -30,7 +30,7 @@ SRCS+= telemetry.c CFLAGS+= -I${SRCTOP}/lib/libnvmf MAN= nvmecontrol.8 LDFLAGS+= -rdynamic -LIBADD+= nvmf util +LIBADD+= nvmf sbuf util SUBDIR= modules HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 87f1da4d281d..17c5cdb4db87 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -35,6 +35,11 @@ #include #include +#ifndef _KERNEL +#include +#endif + +struct sbuf; #define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command) #define NVME_RESET_CONTROLLER _IO('n', 1) @@ -1901,12 +1906,14 @@ struct nvme_hmb_desc { #define nvme_completion_is_error(cpl) \ (NVME_STATUS_GET_SC((cpl)->status) != 0 || NVME_STATUS_GET_SCT((cpl)->status) != 0) +void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); +void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); +void nvme_sc_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen); #ifdef _KERNEL struct bio; -struct sbuf; struct thread; struct nvme_namespace; @@ -1927,10 +1934,6 @@ enum nvme_namespace_flags { NVME_NS_FLUSH_SUPPORTED = 0x2, }; -void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); -void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb); -void nvme_sc_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); - int nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctrlr, struct nvme_pt_command *pt, uint32_t nsid, int is_user_buffer, diff --git a/sys/dev/nvme/nvme_util.c b/sys/dev/nvme/nvme_util.c index 050dfcfbef79..0a07653a7378 100644 --- a/sys/dev/nvme/nvme_util.c +++ b/sys/dev/nvme/nvme_util.c @@ -30,12 +30,9 @@ */ #include -#ifdef _KERNEL #include -#endif #include -#ifdef _KERNEL #define OPC_ENTRY(x) [NVME_OPC_ ## x] = #x static const char *admin_opcode[256] = { @@ -269,7 +266,6 @@ nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sb) if (NVME_STATUS_GET_DNR(status) != 0) sbuf_printf(sb, " DNR"); } -#endif void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen) From nobody Fri Jun 6 01:41:23 2025 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 4bD3v82hzKz5xDn8; Fri, 06 Jun 2025 01:41:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD3v81byPz4BvC; Fri, 06 Jun 2025 01:41:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749174084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uRtvQT2nEUJzzNp30g8PWcU1VUV1s7ZvLsW5OYNTwc=; b=k8a/Aqk+cpY7/PhJQtJrMtpdyBU5RSUsljUi56E81LZ3jNSjgQfXrb5Ny9NK5Lhtj4bJoP J4ZbkeLG3cnh8/8xLfNFPxawACAr1v/f2IRMVbxGqpK9xURtqosL85RVtMRQHHuGgx+6fw RcKJDNRJqC3shuoP8KAYaSrkUfbuILrasgpJyApoOnXPDLlcV1VYYuODP2uZ4YZMNN5mmW i51+3WFl9Y327Zdkpp6pwaMvjIBORPj/i5ByDu2tcdl6Px/9WKZq5f9kAtK39T53arM4o/ mocUQ10Qb9/GwMsrcOYR6/CihmxFJxQY+cO2CwDzzEAZeYWyC5prpyD5A44N7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749174084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uRtvQT2nEUJzzNp30g8PWcU1VUV1s7ZvLsW5OYNTwc=; b=sgInFOGBBZ6JyOkzLxSt+2IlAOV0B2AvBLtP/BzeBYAZui+rqMfM4oAFiB6uVOiDd2BQdS mAD5pRib8sSayRj7rP2GH0eHWhCW60JJyzculhcE53PJidobJkttuCkC6+NvpRJzFQnuQd knGpRYr9aD32f14dlS/Wuu/ZyhsaRDN9DDvhRHtYwrJLWbvUhodvkvKJ3bYMq30yu9Q7P4 wWy4DpRLzlx/imkBo60kNwwd8h4zmDZ0npN30j93VRM79IJnpqFSwldXS7jID161pDOkQR HLTjO4ksZ2g4bQKHqqw0TbnhmWlkVApaGAh4yPCpeYFskziLfVLq+kv6s2UuAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749174084; a=rsa-sha256; cv=none; b=bOA1NKDPOekKkFhGuJUbz/nn8WOJy9yJMXM428e8F25od4hT4IUn3BM1t2vt+bDhJBbAAL c8zeopGx1XzaLdONfQkDqqQXllQJQfxIdeB6niIrjr8McwJsUA+DgMJHz0VftqJ851nIH1 9XcGX2AwGGBdIdIGHNuLLX/wG17ARxoHg1ZRc8vrv+VvVKTZ1vTuq0NchMNZD2VMhwvnfC PaIYr8mrc3LxCAndRelgrfqCxOCVLjHbEGgZY7M09vM9ERufmbyCYXF4Si3NjX23PZvSR4 dcAeDzzpwKIQh98WZ1hKneK6EyvzoxYJZMeCFdG5NPCIpcbv5TqlGzsN3VE/uQ== Received: from [IPV6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1] (unknown [IPv6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1]) (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) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bD3v76d6yz6ZV; Fri, 06 Jun 2025 01:41:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 5 Jun 2025 21:41:23 -0400 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: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506060132.5561Wakc094185@gitrepo.freebsd.org> In-Reply-To: <202506060132.5561Wakc094185@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/5/25 21:32, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7b3ee39e73af36f49f471f7900baeb98ac3504d0 > > commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 > Author: John Baldwin > AuthorDate: 2025-06-06 01:28:38 +0000 > Commit: John Baldwin > CommitDate: 2025-06-06 01:28:38 +0000 > > libcam: Include nvme opcode and status code routines from nvme_util.c > > libcam in userspace also includes nvme_all.c which now depends on > nvme_util.c, so add nvme_util.c to libcam's sources. This requires > exporting the opcode and status code routines in nvme_util.c to > userspace as well as the kernel. In turn, this means nvmecontrol now > depends on libsbuf (which is already present in /lib). > > Reported by: viswhin, Jenkins > Fixes: 60159a98a837 ("nvme: Move opcode and status code tables from base CAM to nvme_util.c") > Sponsored by: Chelsio Communications This fixes the build for now (and sorry for breaking it). However, this raises a few questions for me at least. Why does libcam include nvme_all.c at all? We don't document any of the nvme_* functions in cam(3), nor any of the functions from scsi_all.c, smp_all.c, etc. This seems really odd, and it also means that we can add (and remove!) symbols from libcam without realizing it by changing sys/cam//_all.h which is not very obvious. It seems to me that we should be more intentional about which symbols we export from libcam. Switching to symbol versioning (which implicitly enforces hidden visibility on all symbols not explicitly exported) would keep us from leaking symbols into the ABI of libcam that we don't intend to export. I also wonder if we can remove some of the *_all.c files from libcam entirely? None of the nvme_* ones are used outside of the kernel in the base system for example. -- John Baldwin From nobody Fri Jun 6 02:21:30 2025 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 4bD4ng4Ntsz5xHR4 for ; Fri, 06 Jun 2025 02:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 4bD4nf72grz3Thx for ; Fri, 06 Jun 2025 02:21:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2350fc2591dso13451135ad.1 for ; Thu, 05 Jun 2025 19:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749176502; x=1749781302; 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=FE/me4thOf8JgbFdqwLI/X3ybfMCCBOsmcOr9Abr4Rc=; b=u/l63Sja6gJAvdy2ot3yn7YkAkdHsy8dWgpxu/pBHgUCj18NkW7Cz4pQ0A/gzMVwRc FB1y1tH8+KRwYqUyKqyRep0JEAvT4d0faRjYyvTvMstnDgSJbptEbFQLYj+HCHczGsRS QdNkv24V3D6SgMvkPto6qpxigqJLgSQSHNgO4XvENIIFKdUv/haPHHgHxm3HP5bZ/XSj HJYEDATcaMAAA/4hX0hJE50ZMrtpI7po97C57gO6d3P/fc/CRobAR/xWH3+fVwdaOhL4 5YMEZGezjua0lot9HAbXVgb1/YwX9vPOY8Yzd29yf8nN1kY0i9n9qumuIWoQdo6qC4Cw 0Y1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749176502; x=1749781302; 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=FE/me4thOf8JgbFdqwLI/X3ybfMCCBOsmcOr9Abr4Rc=; b=ixewpe0eKus+rYIoxSJJAiDd/baDu8cMbS8Tu+4ZrytcRnYdwZ8ePQaeFiYmtq1ZDH VcZ+nBonRz0cOgZsNnNIyI2qaq2eucUbdq6CWMGT/kfxwF9I/Ab6rnJqSnl50veWqsA0 uXvn2S11o6GzLdo1OyUEAWl1ymiV+G8Rkkc93h8qmhTX1j0JiEfzKFIrGm1Kr+VJBXJp Khl4vwLZDWzJtTxFPdqElzZuitgpwuWeWr540n2GUYcvcnUWS4cHHRcBWw2Ys8HKi1PN oqo4j2ucR0RW8HGoR3Y9cRl74r319vISHRpQc5fHfqVfTXgPnc83z+L5xjwmTTaufHj2 oFQA== X-Forwarded-Encrypted: i=1; AJvYcCWANmsu+ZE4+tJZye20IfO5/f7QTUmyrpCc8ugEDc/QHwHSZmAjgSac3zCpLqNrUCvH8Q+HgwLEWu4E6rfUOh2jKszk9Q==@freebsd.org X-Gm-Message-State: AOJu0Yx1CvOMNqyQjNp4WRKTkD9NpcVpFd5AJmlbKfwHQ72JBu4VxtmA Wyka8LObxR531NM3xycMXjyKR17qg8ldrL6DLH4XDK0mmVwul0T0EYvrbk1oIrw7xqs/GC1ctCK yVeo3WzVDLt6kcDU5sUDsWBb+TKtyCujtO/I9sHqCrw== X-Gm-Gg: ASbGncv9Y7ehzuUUdpXNYMqAHFF0sf4tIsQXvc8iNfIHVRXGlGeS6MGaLwRtS2SzsVg lrKI3flkdWzNqjr7b9mlNObuoRwmnKNZ6k2FX3gLlrzjqtzjF4GqHblz5g8GxBDp+8YR2XQjw5a jzuhYVbZme6Oa92+o9siIK+2IYcTBMfO2BG1RbC/I/r1TtkmPd+EBaSVAYJb7XJQ4w X-Google-Smtp-Source: AGHT+IGFPPZ+OWqZG4Iyl76CgIfZO4Nbp+iQHulvISvF7+iJZp13EJLvqMvDcbMwLh4VLCLk2G23aeiIlZyfrQBIhVc= X-Received: by 2002:a17:903:22cf:b0:231:c89f:4e94 with SMTP id d9443c01a7336-23603a5d4d0mr11336645ad.21.1749176501616; Thu, 05 Jun 2025 19:21:41 -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: <202506060132.5561Wakc094185@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 5 Jun 2025 20:21:30 -0600 X-Gm-Features: AX0GCFs0MJB1I_WUtrogsyAkPdNqz-Qnhb4Ew9rAs8jYQ74OyoGKLxKoFmrEr-A Message-ID: Subject: Re: git: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c To: John Baldwin Cc: 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-Rspamd-Queue-Id: 4bD4nf72grz3Thx 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] On Thu, Jun 5, 2025 at 7:41=E2=80=AFPM John Baldwin wrote= : > > On 6/5/25 21:32, John Baldwin wrote: > > The branch main has been updated by jhb: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7b3ee39e73af36f49f471f79= 00baeb98ac3504d0 > > > > commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 > > Author: John Baldwin > > AuthorDate: 2025-06-06 01:28:38 +0000 > > Commit: John Baldwin > > CommitDate: 2025-06-06 01:28:38 +0000 > > > > libcam: Include nvme opcode and status code routines from nvme_uti= l.c > > > > libcam in userspace also includes nvme_all.c which now depends on > > nvme_util.c, so add nvme_util.c to libcam's sources. This require= s > > exporting the opcode and status code routines in nvme_util.c to > > userspace as well as the kernel. In turn, this means nvmecontrol = now > > depends on libsbuf (which is already present in /lib). > > > > Reported by: viswhin, Jenkins > > Fixes: 60159a98a837 ("nvme: Move opcode and status code t= ables from base CAM to nvme_util.c") > > Sponsored by: Chelsio Communications > > This fixes the build for now (and sorry for breaking it). However, this > raises a few questions for me at least. Why does libcam include nvme_all= .c > at all? We don't document any of the nvme_* functions in cam(3), nor any > of the functions from scsi_all.c, smp_all.c, etc. This seems really odd, > and it also means that we can add (and remove!) symbols from libcam witho= ut > realizing it by changing sys/cam//_all.h which is not very > obvious. > > It seems to me that we should be more intentional about which symbols we > export from libcam. Switching to symbol versioning (which implicitly > enforces hidden visibility on all symbols not explicitly exported) would > keep us from leaking symbols into the ABI of libcam that we don't intend > to export. > > I also wonder if we can remove some of the *_all.c files from libcam > entirely? None of the nvme_* ones are used outside of the kernel in the > base system for example. No. We can't remove all that. They are used by camcontrol, ddcam and others. We use the functions in *_all.h/c functions to populate the CCBs to send down into the kernel. I think that we need a different take on it. It is, after all, basically designed in FreeBSD 3 timeframe when such considerations were the furthest thing from the minds of the developers. Times have changed, though, and libcam hasn't with it. We don't document it very well... Sometimes I've thought we should make libcam a private library. But I don't know who all uses it in raw mode. I think about a dozen ports use this for things like smart reporting... Warner From nobody Fri Jun 6 02:38:42 2025 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 4bD59H2ft5z5xJcV; Fri, 06 Jun 2025 02:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD59G6skFz3k6t; Fri, 06 Jun 2025 02:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749177523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gASuoRz9ytz1aPaY6/iE8/5kuhlfJbOoxqfl6kZh9a8=; b=dmAYEnokf4PvjZTzt8RfvCzjQQdGLiiMVTGhzMZBpQN5J2BvZB5VM/JgBUMIXwTTSXDpKh MNVz2NdDqueODlEaD2fX/8JnGE8FOmWM2/g/1TTvjRzyRIefewzhBOTYu2UKD+4ExrAA2z yS7CRj6t+sLW764hhQo8ZUlFujaoHTfeXpKBeaOIZr43s+F9Qni0WiCmMAmnHwRAAfPNEE kKbJFSo2unpNRoSu8N9K49/IemZSejnRo3FDJCis4tQuPauQapfb3wh0INWnV4Y7u5ceaW LW7DSEwNlc9HyJokzgzr+SS6pVBTC0xwYi2aWrExDukuYowLc7E5vEA2eLHftQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749177523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gASuoRz9ytz1aPaY6/iE8/5kuhlfJbOoxqfl6kZh9a8=; b=RUvYI7wRhr2d2E9DosYwVg450otzjKF1EjdlFWuFp4HJZteEz9ao595g4FL3a/IdvDMRyG 0SFm1xE55wBoXVP9E4ua3M+geL18ujpFw8kq6nYAHSxERjN5Rx5ltqVFhk+W9BwpVaYWMX 2ZAQv6vHqCTRcUlGhy08AKchih9dISI5D01GEGRXwEcTZ+O/q0MghViAPZE4X4zgGdFL6S 3Dj2w0FBhelDjQQZY02XaV++uydgm1Xae4w1AQVlvKTwmFUb+DgHrwQjNlzj9SVylwKnph TlB7QtV8MY8R8x6A1zTvg3KpIVBVoWuD1N8xkURcEnVoBM4ppJ67112zca3YsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749177523; a=rsa-sha256; cv=none; b=NdHCGSpCV8Idc3v0612LVlW0S1MqyQWp7/DpJvjS5aGmCzRhGa5H9VvBNIfjuclFqF0Lss RvvTEys5DpAafJMN1J78tCijYhjJpiavFq4lSI+ioMulJ9E6RgJMjsOpsTIPVBYdOg3lW+ 24QS9f0bXjk3DygZWxqGoYBZU22O+plbqyz+aJoyeO39/zse+VDU8hUdHsRVA799SwAoQS JY/ZmdqKFKTEqztg9CRq/1zhN/dtI3twY3OtjFTPzq3ApHZS4qA7fGysjxNTUYy4SvMRKq Ua33qTYZdD0ueRpwLUAG3SqVLTUXOGNqCB/L1QBM1ydKOkd4FveLTOO5tp3NgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bD59G6Mzrzcrs; Fri, 06 Jun 2025 02:38:42 +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 5562cgFX008821; Fri, 6 Jun 2025 02:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5562cgDG008818; Fri, 6 Jun 2025 02:38:42 GMT (envelope-from git) Date: Fri, 6 Jun 2025 02:38:42 GMT Message-Id: <202506060238.5562cgDG008818@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: 6d46fd2cbea4 - main - capsicum.4: Add capsicum_helpers and libcasper references 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: 6d46fd2cbea43002689ae1a8a0e388e9774da1bc Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6d46fd2cbea43002689ae1a8a0e388e9774da1bc commit 6d46fd2cbea43002689ae1a8a0e388e9774da1bc Author: Ed Maste AuthorDate: 2025-06-05 21:22:13 +0000 Commit: Ed Maste CommitDate: 2025-06-06 02:38:27 +0000 capsicum.4: Add capsicum_helpers and libcasper references These were present in the SEE ALSO section but were not explicitly mentioned. Add a brief description of both. Reviewed by: ziaee Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50707 --- share/man/man4/capsicum.4 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/man/man4/capsicum.4 b/share/man/man4/capsicum.4 index 3c3eab5d798b..6aefae9d6df2 100644 --- a/share/man/man4/capsicum.4 +++ b/share/man/man4/capsicum.4 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 3, 2024 +.Dd June 5, 2025 .Dt CAPSICUM 4 .Os .Sh NAME @@ -101,6 +101,20 @@ restrict access to global namespaces: Processes can only act upon their own process ID with syscalls such as .Xr cpuset_setaffinity 2 . .El +.Pp +.Fx +provides some additional functionality to support application sandboxing that +is not part of +.Nm +itself: +.Bl -tag -width indent +.It Xr capsicum_helpers 3 +A set of a inline functions which simplify modifying programs to use +.Nm . +.It Xr libcasper 3 +A library that provides services for sandboxed applications, such as operating +on files specified on a command line or establishing network connections. +.El .Sh SEE ALSO .Xr cap_enter 2 , .Xr cap_fcntls_limit 2 , From nobody Fri Jun 6 10:07:57 2025 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 4bDH7f0qZBz5y74D; Fri, 06 Jun 2025 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDH7f0JlGz3Wp7; Fri, 06 Jun 2025 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749204478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ti90mqnqGWCtCO/GCxT5+rMWqB1q/gbQxHuF+AH7Xew=; b=b/rZ/mhAK6S0rd2WOaYqu6e3MOBhQu1obVpE+ZeVt3FBkEgykg0ur8P08NvXFArtyc0RYr 3R+4Xc2/2O898AdJsLfoZoTY60QjADL2mZU7uRLImpuML5T4MgJVwdXLZI6+omOhiYwEHt rssBXFp+3TLfUmHXxJIaw3ZX/Ff8NuRej5xXpyfdJRfDEvUPQgqWhkQLrxJnmCZ5f4wlFr RScgjP0G6YwMuuwRUgZ8Xi2tVdtoNogAsalWfDPDMjAskwaVSP6fYCTHugY0cIrmi062+I +pW63ljl8R0cA5SLmHIa/eMCgZI5CsluGAqPaP8otDUAqbtyuBXLxz5Z3YlEvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749204478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ti90mqnqGWCtCO/GCxT5+rMWqB1q/gbQxHuF+AH7Xew=; b=BkkJQcXfSOdwS88Hhf2u+i/vMULOlnIal1604qbQoSZuw4kzYHuKr/M5zA6nYo+f5VNSEd 8KxZqkC7TB/Km2Wj535PrfGczfk1XBhkR7aChQ2L8jyUp7Ry5DiJFH4ULIX+djhH/sByoe Prkf19Tp7EDFf8X29z6oyRuYzEYtjPcdH0HhNuMkRjoKzK2iTDe16kBA71L8zPyZvj5aSR xk55XKjzoUbrATyjIMzYb2mOqy1E8Jt8nPnQZNTNHBqcDn14nWlm35rqRmc4zZtMYPZTDu 3HHhRpwVLCS58ctj8Azkhd7D12W7/SJT4QRYha2r5EORf7wQcwjKnFA3MKhD3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749204478; a=rsa-sha256; cv=none; b=k9PH+xmQfA3MrdF85r7GxSbGM5G3OGM+wYz9w9YzcefT0TFi8yFJeOIg+1mMCHmKjvS3wD Glv4vHV43t/HPgQfDTUkvf+6ANT+S3CGImmixN7SL9+0b5yHnqV1VKUQ4WuhVEQJPmsfrC mDHl03ocoN6zG+x5lrZ4KkkMjxBgnvFZEnghZ7UWKm36rZ2kXzvm+U9rMB1K40BUrYF+Lf Lrx+HqqHmHqIllWrjHI383V5NI1S2w8Xx3vYDc6vduFHcLMPnkuEHwewELmk2tu707p6mp AExjFAW0EwhbfGlOImTmkY7oITSP9BNkJ8FX/ICIqC3eN5rrV/xvnTcuVRSwbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDH7d71K9zqp0; Fri, 06 Jun 2025 10:07: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 556A7vtx052274; Fri, 6 Jun 2025 10:07:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556A7v3p052271; Fri, 6 Jun 2025 10:07:57 GMT (envelope-from git) Date: Fri, 6 Jun 2025 10:07:57 GMT Message-Id: <202506061007.556A7v3p052271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 721e783a2a33 - main - iflib: Some style(9) tweaks 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 721e783a2a3316826f92fb44c931e28163118b3f Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=721e783a2a3316826f92fb44c931e28163118b3f commit 721e783a2a3316826f92fb44c931e28163118b3f Author: Zhenlei Huang AuthorDate: 2025-06-06 10:04:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-06 10:04:42 +0000 iflib: Some style(9) tweaks Prefer tab over eight whitespaces for indentation, and four spaces as second level idents. MFC after: 3 days --- sys/net/iflib.c | 208 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 4c626edd8f31..2b8f0e617df3 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -196,7 +196,7 @@ struct iflib_ctx { uint8_t ifc_sysctl_separate_txrx; uint8_t ifc_sysctl_use_logical_cores; uint16_t ifc_sysctl_extra_msix_vectors; - bool ifc_cpus_are_physical_cores; + bool ifc_cpus_are_physical_cores; qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; @@ -281,16 +281,16 @@ iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx) #define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) typedef struct iflib_sw_rx_desc_array { - bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ - struct mbuf **ifsd_m; /* pkthdr mbufs */ - caddr_t *ifsd_cl; /* direct cluster pointer for rx */ - bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ + bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + struct mbuf **ifsd_m; /* pkthdr mbufs */ + caddr_t *ifsd_cl; /* direct cluster pointer for rx */ + bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ } iflib_rxsd_array_t; typedef struct iflib_sw_tx_desc_array { - bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ - bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ - struct mbuf **ifsd_m; /* pkthdr mbufs */ + bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ + struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; /* magic number that should be high enough for any hardware */ @@ -363,7 +363,7 @@ struct iflib_txq { /* constant values */ if_ctx_t ift_ctx; - struct ifmp_ring *ift_br; + struct ifmp_ring *ift_br; struct grouptask ift_task; qidx_t ift_size; uint16_t ift_id; @@ -381,7 +381,7 @@ struct iflib_txq { bus_dma_tag_t ift_tso_buf_tag; iflib_dma_info_t ift_ifdi; #define MTX_NAME_LEN 32 - char ift_mtx_name[MTX_NAME_LEN]; + char ift_mtx_name[MTX_NAME_LEN]; bus_dma_segment_t ift_segs[IFLIB_MAX_TX_SEGS] __aligned(CACHE_LINE_SIZE); #ifdef IFLIB_DIAGNOSTICS uint64_t ift_cpu_exec_count[256]; @@ -401,7 +401,7 @@ struct iflib_fl { uint64_t ifl_cl_dequeued; #endif /* implicit pad */ - bitstr_t *ifl_rx_bitmap; + bitstr_t *ifl_rx_bitmap; qidx_t ifl_fragidx; /* constant */ qidx_t ifl_size; @@ -457,7 +457,7 @@ struct iflib_rxq { uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; uint8_t ifr_fl_offset; struct lro_ctrl ifr_lc; - struct grouptask ifr_task; + struct grouptask ifr_task; struct callout ifr_watchdog; struct iflib_filter_info ifr_filter_info; iflib_dma_info_t ifr_ifdi; @@ -548,7 +548,7 @@ rxd_info_zero(if_rxd_info_t ri) #define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) -#define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) +#define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) /* Our boot-time initialization hook */ static int iflib_module_event_handler(module_t, int, void *); @@ -926,7 +926,7 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) MPASS(i < IFLIB_MAX_RX_REFRESH); if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ - return (netmap_ring_reinit(kring)); + return (netmap_ring_reinit(kring)); fl->ifl_bus_addrs[i] = paddr + nm_get_offset(kring, slot); @@ -1457,17 +1457,17 @@ iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, i lowaddr = DMA_WIDTH_TO_BUS_LOWADDR(ctx->ifc_softc_ctx.isc_dma_width); err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - align, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - size, /* maxsize */ - 1, /* nsegments */ - size, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockarg */ - &dma->idi_tag); + align, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + size, /* maxsize */ + 1, /* nsegments */ + size, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &dma->idi_tag); if (err) { device_printf(dev, "%s: bus_dma_tag_create failed: %d (size=%d, align=%d)\n", @@ -1679,11 +1679,11 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, irq->ii_res = res; KASSERT(filter == NULL || handler == NULL, ("filter and handler can't both be non-NULL")); rc = bus_setup_intr(dev, res, INTR_MPSAFE | INTR_TYPE_NET, - filter, handler, arg, &tag); + filter, handler, arg, &tag); if (rc != 0) { device_printf(dev, "failed to setup interrupt for rid %d, name %s: %d\n", - rid, name ? name : "unknown", rc); + rid, name ? name : "unknown", rc); return (rc); } else if (name) bus_describe_intr(dev, res, tag, "%s", name); @@ -1732,17 +1732,17 @@ iflib_txsd_alloc(iflib_txq_t txq) * Set up DMA tags for TX buffers. */ if ((err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sctx->isc_tx_maxsize, /* maxsize */ - nsegments, /* nsegments */ - sctx->isc_tx_maxsegsize, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &txq->ift_buf_tag))) { + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sctx->isc_tx_maxsize, /* maxsize */ + nsegments, /* nsegments */ + sctx->isc_tx_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &txq->ift_buf_tag))) { device_printf(dev, "Unable to allocate TX DMA tag: %d\n", err); device_printf(dev, "maxsize: %ju nsegments: %d maxsegsize: %ju\n", (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); @@ -1750,17 +1750,17 @@ iflib_txsd_alloc(iflib_txq_t txq) } tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0; if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - tsomaxsize, /* maxsize */ - ntsosegments, /* nsegments */ - sctx->isc_tso_maxsegsize,/* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &txq->ift_tso_buf_tag))) { + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + tsomaxsize, /* maxsize */ + ntsosegments, /* nsegments */ + sctx->isc_tso_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &txq->ift_tso_buf_tag))) { device_printf(dev, "Unable to allocate TSO TX DMA tag: %d\n", err); goto fail; @@ -1966,17 +1966,17 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) fl->ifl_size = scctx->isc_nrxd[rxq->ifr_fl_offset]; /* this isn't necessarily the same */ /* Set up DMA tag for RX buffers. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sctx->isc_rx_maxsize, /* maxsize */ - sctx->isc_rx_nsegments, /* nsegments */ - sctx->isc_rx_maxsegsize, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockarg */ - &fl->ifl_buf_tag); + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sctx->isc_rx_maxsize, /* maxsize */ + sctx->isc_rx_nsegments, /* nsegments */ + sctx->isc_rx_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &fl->ifl_buf_tag); if (err) { device_printf(dev, "Unable to allocate RX DMA tag: %d\n", err); @@ -1985,8 +1985,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the RX mbuf map. */ if (!(fl->ifl_sds.ifsd_m = - (struct mbuf **) malloc(sizeof(struct mbuf *) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (struct mbuf **) malloc(sizeof(struct mbuf *) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX mbuf map memory\n"); err = ENOMEM; @@ -1995,8 +1995,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the direct RX cluster pointer map. */ if (!(fl->ifl_sds.ifsd_cl = - (caddr_t *) malloc(sizeof(caddr_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (caddr_t *) malloc(sizeof(caddr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX cluster map memory\n"); err = ENOMEM; @@ -2005,8 +2005,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the RX cluster bus address map. */ if (!(fl->ifl_sds.ifsd_ba = - (bus_addr_t *) malloc(sizeof(bus_addr_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_addr_t *) malloc(sizeof(bus_addr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX bus address map memory\n"); err = ENOMEM; @@ -2017,7 +2017,7 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) * Create the DMA maps for RX buffers. */ if (!(fl->ifl_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX buffer DMA map memory\n"); err = ENOMEM; @@ -2557,7 +2557,7 @@ done: callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq, txq->ift_timer.c_cpu); - /* Re-enable txsync/rxsync. */ + /* Re-enable txsync/rxsync. */ netmap_enable_all_rings(ifp); } @@ -3188,11 +3188,11 @@ static void print_pkt(if_pkt_info_t pi) { printf("pi len: %d qsidx: %d nsegs: %d ndescs: %d flags: %x pidx: %d\n", - pi->ipi_len, pi->ipi_qsidx, pi->ipi_nsegs, pi->ipi_ndescs, pi->ipi_flags, pi->ipi_pidx); + pi->ipi_len, pi->ipi_qsidx, pi->ipi_nsegs, pi->ipi_ndescs, pi->ipi_flags, pi->ipi_pidx); printf("pi new_pidx: %d csum_flags: %lx tso_segsz: %d mflags: %x vtag: %d\n", - pi->ipi_new_pidx, pi->ipi_csum_flags, pi->ipi_tso_segsz, pi->ipi_mflags, pi->ipi_vtag); + pi->ipi_new_pidx, pi->ipi_csum_flags, pi->ipi_tso_segsz, pi->ipi_mflags, pi->ipi_vtag); printf("pi etype: %d ehdrlen: %d ip_hlen: %d ipproto: %d\n", - pi->ipi_etype, pi->ipi_ehdrlen, pi->ipi_ip_hlen, pi->ipi_ipproto); + pi->ipi_etype, pi->ipi_ehdrlen, pi->ipi_ip_hlen, pi->ipi_ipproto); } #endif @@ -3742,7 +3742,7 @@ defrag: */ txq->ift_rs_pending += nsegs + 1; if (txq->ift_rs_pending > TXQ_MAX_RS_DEFERRED(txq) || - iflib_no_tx_batch || (TXQ_AVAIL(txq) - nsegs) <= MAX_TX_DESC(ctx) + 2) { + iflib_no_tx_batch || (TXQ_AVAIL(txq) - nsegs) <= MAX_TX_DESC(ctx) + 2) { pi.ipi_flags |= IPI_TX_INTR; txq->ift_rs_pending = 0; } @@ -3878,8 +3878,8 @@ iflib_completed_tx_reclaim(iflib_txq_t txq, int thresh) #ifdef INVARIANTS if (iflib_verbose_debug) { printf("%s processed=%ju cleaned=%ju tx_nsegments=%d reclaim=%d thresh=%d\n", __func__, - txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, - reclaim, thresh); + txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, + reclaim, thresh); } #endif return (0); @@ -3984,7 +3984,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) #ifdef INVARIANTS if (iflib_verbose_debug) printf("%s avail=%d ifc_flags=%x txq_avail=%d ", __func__, - avail, ctx->ifc_flags, TXQ_AVAIL(txq)); + avail, ctx->ifc_flags, TXQ_AVAIL(txq)); #endif do_prefetch = (ctx->ifc_flags & IFC_PREFETCH); err = 0; @@ -4366,7 +4366,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) if (abdicate) GROUPTASK_ENQUEUE(&txq->ift_task); - if (err) { + if (err) { if (!abdicate) GROUPTASK_ENQUEUE(&txq->ift_task); /* support forthcoming later */ @@ -4459,9 +4459,9 @@ iflib_if_qflush(if_t ifp) } #define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ - IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ - IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ - IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) + IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ + IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) @@ -4807,17 +4807,17 @@ iflib_reset_qvalues(if_ctx_t ctx) for (i = 0; i < sctx->isc_nrxqs; i++) { if (scctx->isc_nrxd[i] < sctx->isc_nrxd_min[i]) { device_printf(dev, "nrxd%d: %d less than nrxd_min %d - resetting to min\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_min[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_min[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_min[i]; } if (scctx->isc_nrxd[i] > sctx->isc_nrxd_max[i]) { device_printf(dev, "nrxd%d: %d greater than nrxd_max %d - resetting to max\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_max[i]; } if (!powerof2(scctx->isc_nrxd[i])) { device_printf(dev, "nrxd%d: %d is not a power of 2 - using default value of %d\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_default[i]; } } @@ -4825,17 +4825,17 @@ iflib_reset_qvalues(if_ctx_t ctx) for (i = 0; i < sctx->isc_ntxqs; i++) { if (scctx->isc_ntxd[i] < sctx->isc_ntxd_min[i]) { device_printf(dev, "ntxd%d: %d less than ntxd_min %d - resetting to min\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_min[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_min[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_min[i]; } if (scctx->isc_ntxd[i] > sctx->isc_ntxd_max[i]) { device_printf(dev, "ntxd%d: %d greater than ntxd_max %d - resetting to max\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_max[i]; } if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, "ntxd%d: %d is not a power of 2 - using default value of %d\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_default[i]; } } @@ -4908,7 +4908,7 @@ cpuid_advance(if_ctx_t ctx, unsigned int cpuid, unsigned int n) } #if defined(SMP) && defined(SCHED_ULE) -extern struct cpu_group *cpu_top; /* CPU topology */ +extern struct cpu_group *cpu_top; /* CPU topology */ static int find_child_with_core(int cpu, struct cpu_group *grp) @@ -5460,9 +5460,9 @@ fail_unlock: iflib_deregister(ctx); fail_ctx_free: device_set_softc(ctx->ifc_dev, NULL); - if (ctx->ifc_flags & IFC_SC_ALLOCATED) - free(ctx->ifc_softc, M_IFLIB); - free(ctx, M_IFLIB); + if (ctx->ifc_flags & IFC_SC_ALLOCATED) + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } @@ -5791,11 +5791,11 @@ iflib_register(if_ctx_t ctx) if_setqflushfn(ifp, iflib_if_qflush); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); ctx->ifc_vlan_attach_event = - EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx, - EVENTHANDLER_PRI_FIRST); + EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx, + EVENTHANDLER_PRI_FIRST); ctx->ifc_vlan_detach_event = - EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, - EVENTHANDLER_PRI_FIRST); + EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, + EVENTHANDLER_PRI_FIRST); if ((sctx->isc_flags & IFLIB_DRIVER_MEDIA) == 0) { ctx->ifc_mediap = &ctx->ifc_media; @@ -5868,12 +5868,12 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs >= fl_offset + nfree_lists, - ("there must be at least a rxq for each free list")); + ("there must be at least a rxq for each free list")); /* Allocate the TX ring struct memory */ if (!(ctx->ifc_txqs = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * - ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate TX ring memory\n"); err = ENOMEM; goto fail; @@ -5882,7 +5882,7 @@ iflib_queues_alloc(if_ctx_t ctx) /* Now allocate the RX */ if (!(ctx->ifc_rxqs = (iflib_rxq_t) malloc(sizeof(struct iflib_rxq) * - nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX ring memory\n"); err = ENOMEM; goto rx_fail; @@ -5941,7 +5941,7 @@ iflib_queues_alloc(if_ctx_t ctx) #endif /* DEV_NETMAP */ err = ifmp_ring_alloc(&txq->ift_br, 2048, txq, iflib_txq_drain, - iflib_txq_can_drain, M_IFLIB, M_WAITOK); + iflib_txq_can_drain, M_IFLIB, M_WAITOK); if (err) { /* XXX free any allocated rings */ device_printf(dev, "Unable to allocate buf_ring\n"); @@ -5954,7 +5954,7 @@ iflib_queues_alloc(if_ctx_t ctx) callout_init(&rxq->ifr_watchdog, 1); if ((ifdip = malloc(sizeof(struct iflib_dma_info) * nrxqs, - M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "Unable to allocate RX DMA info memory\n"); err = ENOMEM; @@ -5979,7 +5979,7 @@ iflib_queues_alloc(if_ctx_t ctx) rxq->ifr_fl_offset = fl_offset; rxq->ifr_nfl = nfree_lists; if (!(fl = - (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { + (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate free list memory\n"); err = ENOMEM; goto err_tx_desc; @@ -6636,7 +6636,7 @@ iflib_msix_init(if_ctx_t ctx) */ if (bar != -1) { ctx->ifc_msix_mem = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &bar, RF_ACTIVE); + SYS_RES_MEMORY, &bar, RF_ACTIVE); if (ctx->ifc_msix_mem == NULL) { device_printf(dev, "Unable to map MSI-X table\n"); goto msi; @@ -6781,7 +6781,7 @@ mp_ring_state_handler(SYSCTL_HANDLER_ARGS) state[0], state[1], state[2], ring_state); rc = sbuf_finish(sb); sbuf_delete(sb); - return (rc); + return (rc); } enum iflib_ndesc_handler { @@ -6842,7 +6842,7 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) static void iflib_add_device_sysctl_pre(if_ctx_t ctx) { - device_t dev = iflib_get_dev(ctx); + device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child, *oid_list; struct sysctl_ctx_list *ctx_list; struct sysctl_oid *node; @@ -6888,7 +6888,7 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) CTLFLAG_RDTUN, &ctx->ifc_sysctl_extra_msix_vectors, 0, "attempt to reserve the given number of extra MSI-X vectors during driver load for the creation of additional interfaces later"); SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "allocated_msix_vectors", - CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, + CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, "total # of MSI-X vectors allocated by driver"); /* XXX change for per-queue sizes */ @@ -6907,7 +6907,7 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) { if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - device_t dev = iflib_get_dev(ctx); + device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx_list; iflib_fl_t fl; From nobody Fri Jun 6 10:07:58 2025 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 4bDH7g4MHRz5y723; Fri, 06 Jun 2025 10:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDH7g1TFPz3Wk4; Fri, 06 Jun 2025 10:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749204479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=szhDjGvgC2reZQ0GI5o93/uXygrzgTcK//moGe1KGNA=; b=V1NOn8j/25jWbyebeN3YAoPLaiGT/ye8hGqux0SbYEsjBjfQL2R+sdzdQQw2uN4MibUjca SSxz75z5xFGpidk8zz6bPbzPdtd6n4INoPDSYki/QyDNSxQc/a64iGnCghTFvIXoTjmJIf 8suGNbtiIakzdPM8CMEatYqwpmraHRwM5SgKafEo2wwx995XOZmwRh8vJvamqk+1a1Uhru b7Ma67x6Zs4G309SbsICeYoRjrJSibuIPVxRVMLY69qg9bbHykkZ9HsWSAW9vFFg9gvN3N tcIzKUh/4bnmmOEj2Z2KfVxeF8KBqZPZY8n6vcsTx8OoaKiu8yeLsB5ZFcn/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749204479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=szhDjGvgC2reZQ0GI5o93/uXygrzgTcK//moGe1KGNA=; b=jPDBhfwqkLXsJlSRN0KQxLaWcU2+4cvmtaqFg2RaTsfWmdXYVHATUD7+4Y/rYWUJaGZ2ji VCPnfO22dTGxZc8FM885IS9jeHGibMfFf52FidcJCrVCbfomvtRqDN8V96ZcZd1evtGKhD pL8SCoK5bix071JPK042akG7j3y6IccL4orB0NE48yVTwicA6qy2S1XkZ+QrfWZc5Waxb0 fjodHg6ctAJSPA057PfoM6uUYfsAJfJuFUUB665wdk12BJ9w06ITxy/GTYhuUmyxSgN3b4 1SpxxrvHXa/tq+JtGpFRGBFhv5QxyaVwX4hpGw4N0KCaOoIPmxFmdjfCl82+Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749204479; a=rsa-sha256; cv=none; b=nqq4an2VlJFxxZUMHRc9zeokxMwcUMo1UeS/v8beCPwTBnwE6tJJjeryOduH69/mMoZUvK fGkjWBm2QKDlxUF3Wm6HVeUY9uJxKM0/IUB7NAwQsgC4Vg/zt8gn51An9pVKbuiK8ixW72 lEFvOburVl3JmtLgHYI4vqdSkkxSQj9aocKGZ5MVFVEy2crPgmlMupwMJrMgw4msuT0hGG LNt0bbg2d0q6DT2F1SKusJSYo5kIDXE0C/dGAZ6sgJ4AuMUzHr+f1rxKE3GtJcLrDK2C3T yRKfTC8I7vHfKQhFw8jar3CuR7YlU8zkSMQor1ucN2tzXns6DJoRpgKuStLcXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDH7g0Pxwzr04; Fri, 06 Jun 2025 10:07: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 556A7wci052308; Fri, 6 Jun 2025 10:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556A7wpN052305; Fri, 6 Jun 2025 10:07:58 GMT (envelope-from git) Date: Fri, 6 Jun 2025 10:07:58 GMT Message-Id: <202506061007.556A7wpN052305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 898a886b4504 - main - git-blame-ignore-revs: iflib style(9) tweaks 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 898a886b4504cd9c7fe7dddd918cd64c068b1cfe Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=898a886b4504cd9c7fe7dddd918cd64c068b1cfe commit 898a886b4504cd9c7fe7dddd918cd64c068b1cfe Author: Zhenlei Huang AuthorDate: 2025-06-06 10:07:06 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-06 10:07:06 +0000 git-blame-ignore-revs: iflib style(9) tweaks --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 52799d554460..407304c5a675 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,8 @@ # # This file is sorted in git log order (newest commits first). +# iflib style tweaks +721e783a2a3316826f92fb44c931e28163118b3f # queue(3) single space after all #define a4df0830d74dba9d20c01d8c108bddeb1ecd62cd # bin/ps whitespace cleanup From nobody Fri Jun 6 11:07:39 2025 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 4bDJSW6wzBz5yBZX; Fri, 06 Jun 2025 11:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJSW5SVXz3CfK; Fri, 06 Jun 2025 11:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KiaNJt1Vke0c/fufuCXExQxp+CnEnPxZuDOtVz69WWI=; b=ZtKTeuRjmL3KwKcY28piCUz+VPxDGMfxFZ03cUkd3DiXN4EhmX1Z0detiVjOVm2Ey8p5OB HeYx4IEjiCmqVlruxd+0ssxiCi9H6Gfnle4FCb7TV9kklg9siq9zqnBqAGW09hXduujCpH ff4HGQ6zopr/D2/EhO9Wpb15vI15+y5CHQAbBG6VmV2JIk4xq66iMnaDeV/fLIhFG0zvP+ MZ5dihHSew3aNBg7QlSIA6uA30Dsc3qeQnfwWgbVGWxTeml69nlr/MgrqQBnKwCqMoAxDs YrQPCleYbwn+bcDic8quyFt/O2Io7LDMbLog7guDCtR2W4PL5IMzHbXpKcdJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KiaNJt1Vke0c/fufuCXExQxp+CnEnPxZuDOtVz69WWI=; b=n50W9jPq/AjRRsqqpFQdnfBmtGE0J08KP6nsp2qSpewe7PQp4XWwvRYfKUuTD91dIillPm U3YQmYa4okQdit+IdVG6HYyzln5nF0ZImqbVoO0blwVCQZc/EL6eVK2h+UH2K7DRD/ZyF9 YIDa3tluUhUjFLo1vfH+jwERTByUkDkqUe962PBu+EZsbBXdeDjY5jTs38g85wC9emxe6H KZEC5a64l3Dxxl+vskldmMjC6a+zRH5fZG4QhZKaEtOTsEFfgNt5YN2054dMmYFujzumzW DUMxoN32QtR/079iHQ+UJLeR0GjO4k7XLN5KW7FPYyRmg5Xp5cP2iWTgA8G5aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208059; a=rsa-sha256; cv=none; b=pX3LHm360kXN8sFOyd311iN9+xDwXOdkB9qPzJS9sgmrRFtaM/M9T284oP352VriVlrlIq x0OYN48/MUcnyDfoMudVFPy7LTAChv2Y8Y92FSQk+dsMJENzKFXeBsI7HeYDvnEA+9FgWU YyUuvZffS0WH69LZZqAH23OFO4Prgkb0jYT4gTaiP31DZENBI8i2t6F7rdBLba3YtUZFGG KPtQoiRsirIpfyhd/wBpYCaFWyJIFL3bmMzKg1GlLrBtZtmx0NT7c7sVtIzB+8gbPXE7DT kIlQH33jCffQIrUMdFMSb8xLJDyt6PcEGCRRKT9zJ4f9Tf9sbSI+WpbiX+QzLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJSW51ltzslG; Fri, 06 Jun 2025 11:07: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 556B7dJu064507; Fri, 6 Jun 2025 11:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556B7dOA064502; Fri, 6 Jun 2025 11:07:39 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:07:39 GMT Message-Id: <202506061107.556B7dOA064502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9a62e1d98dc7 - main - nuageinit: log nuageinit execution 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a62e1d98dc79c69f0d20439bd34a16149106046 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9a62e1d98dc79c69f0d20439bd34a16149106046 commit 9a62e1d98dc79c69f0d20439bd34a16149106046 Author: Baptiste Daroussin AuthorDate: 2025-06-06 11:06:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 11:07:32 +0000 nuageinit: log nuageinit execution Sponsored by: OVHCloud --- libexec/rc/rc.d/nuageinit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index 54e5b1fbec07..c901971488bd 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -75,13 +75,13 @@ nuageinit_start() for d in openstack ec2; do dir=/media/nuageinit/$d/latest if [ -d $dir ]; then - /usr/libexec/nuageinit $dir $citype + /usr/libexec/nuageinit $dir $citype 2>&1 | tee -a /var/log/nuageinit.log break fi done ;; nocloud) - /usr/libexec/nuageinit /media/nuageinit $citype + /usr/libexec/nuageinit /media/nuageinit $citype 2>&1 | tee -a /var/log/nuageinit.log ;; esac if [ -n "$drive" ]; then From nobody Fri Jun 6 11:17:11 2025 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 4bDJgW40wVz5yC26; Fri, 06 Jun 2025 11:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJgW20tSz3JwV; Fri, 06 Jun 2025 11:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wEAM+Tp/0b+vFYk9W60trC1xpU2GVGO3PTHr585W1C0=; b=DL6jouBwx+TLQ27vsX6zIZl8aZ1uJVAr3Uvzseor1Hxl0DTVUsJGsX70Ihfn2nxWD71SkC iL63/ehjCy1j+Va0UnneCEsp62Uzkg0bUGKWXnCHPQMDYL0AY29bBlsNwRDybntcrWPYcg DiMSOcf02UOIKJ3xDuAXaLtE5qnYh2ZaioebjhcJUPgdAqjrFPbruchs6p4ibavh3hXstz SrV9SL7+ctwydFcY4tmtcuW+B0M+9kLmEAvV1tP/O7eh7gPKLMGlZ783W1jWtzprAfVAxV VK1kE75Ms6DIWsk99Qk78MK/LeVVKIF/1HqDM9KpuOBv5OLVIREBn1TP85K2sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wEAM+Tp/0b+vFYk9W60trC1xpU2GVGO3PTHr585W1C0=; b=k/F21ZN+nD2MGfkj+IgJoYnn4Ir/uxPrCD8GQRW6yr0DuG1ywt2HBZfIIg1T75KT174bmn Rn2Sbkl+flxU5eHRsmnNE1Jgf2cmGos3JSa/IAHFHQ915Z0qTJH3W65kiwXo83puXHPyoG TQ+BoOGZwzQaisfw8oqavzyz4/CwJF5OKyQV/JK9OjJug4IKz7DUJxJB6PqGXLvsIB5+mJ R0dTe/SBKlwJZIEhEv5ruFWQSdSpcsKms8Kf0Dc5h8pmdu0c1Zs158Loao2PCSTLBP9jsa XRKp2PKqRhzyuUS3rkFrTQScbwK1a9dHc0xJPXxAQlXVNaxllkKk5zgIhQHweA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208631; a=rsa-sha256; cv=none; b=MUp/htefrZ/viJsQ1EyG9OQQ7bLFPhCbsiUh+a/d+Ii6JmHLIlaJozl5XvVDfp1oTi7jLw EYCkDf+6rCGskdWh02pKHy7S/lOd6oSvOxcFcuc797sY11RRH0iCUH8mSUUqb1nt61AWUJ U46fIIlXnbbHrOwNFU8fhG4s0KmIb+n2qnQc6XTQMWZfM66ntRmnVTv0+UPmPwlgy3s/r/ Qn5MNBVEIqQM7kjy3A3d2iyMfi0lodbgqy+80scruUDLdM1ToYnfkS0NuZyxyCZSgGzXMA 489SvsNPIohye2GYYoKkeBem3aqC5uG2VfKqfbl45TsRVN1cZBub4yAnrZiqGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgW1b1bzsBN; Fri, 06 Jun 2025 11:17:11 +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 556BHBwr083609; Fri, 6 Jun 2025 11:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHBbI083606; Fri, 6 Jun 2025 11:17:11 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:11 GMT Message-Id: <202506061117.556BHBbI083606@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: 3be4d54ecd11 - main - pf: use 'struct ah' for the AH extension header rather than 'struct ip6_ext' 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: 3be4d54ecd118ab6e29a3aa80329e710d8c2fee1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3be4d54ecd118ab6e29a3aa80329e710d8c2fee1 commit 3be4d54ecd118ab6e29a3aa80329e710d8c2fee1 Author: Kristof Provost AuthorDate: 2025-05-27 15:02:46 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:15:59 +0000 pf: use 'struct ah' for the AH extension header rather than 'struct ip6_ext' This fixes the build for NOINET6 kernels, but also more accurately reflects what we're doing. The first two fields are the same, so the only functional change is that we require slightly more data in the first fragment now. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50658 --- sys/netpfil/pf/pf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 69a68d0249b2..0cfb728c3eb5 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -114,6 +114,8 @@ #include #include +#include + #include #include @@ -9694,7 +9696,7 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, static int pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) { - struct ip6_ext ext; + struct ah ext; u_int32_t hlen, end; hlen = h->ip_hl << 2; @@ -9720,8 +9722,8 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) DPFPRINTF(PF_DEBUG_MISC, ("IP short exthdr")); return (PF_DROP); } - pd->off += (ext.ip6e_len + 2) * 4; - pd->proto = ext.ip6e_nxt; + pd->off += (ext.ah_len + 2) * 4; + pd->proto = ext.ah_nxt; break; default: return (PF_PASS); From nobody Fri Jun 6 11:17:09 2025 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 4bDJgV3nPBz5yC24; Fri, 06 Jun 2025 11:17: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 4bDJgV1CKBz3Jl7; Fri, 06 Jun 2025 11:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wGP/M5h0Tc05N7bhC2ShZXyAZHPtQCPPaSF23BLwiE4=; b=FLMJVGdLpbKU1hzQXXoeQ+ZQddKDQyJlWRc8E/nmk5QCBxSlVdYAgYNGefFPtfeJOgeb6r pGWrbS5SMUEdVhXdxfs4wP5rKAlXRIPdR7+xpWjF/qmJR4wvcF+qsLYAhgbrinHI+Fbmjg rMB0Vwnh/bi7BQ95RJc9EnZDuSzmT2+H37OMLy2EnbLEkWxTYwqhzPg7wXtGD0ySXkl7c/ KjUph0PtKbL4epg5USyFDywtzwKNjxB7m93I9T+NQDltbbuJ8yGK0uXgz7/VjKJ77Ev3rg Qk0XNACc07UXcpj8IiX4OYRoLVRQn1X75j2XqxQD2yGe2+cTzbih7uWUUnqiJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wGP/M5h0Tc05N7bhC2ShZXyAZHPtQCPPaSF23BLwiE4=; b=cGiuQM4maGn8fu7yKWZFFfB8u3K1oUlhWJWq2md/3RqhzlQrenKHZFHyQWiefN7KqFnvCw 5+x5knNgqcZHulHDOyVBIuUHLr44JALgnwdHGw2I+wohsPjTWjapkzrhvIzzkAYpOEKos3 DNr9BHsB/u6gsVqJX3fkCtB6nUQbWrzslTR2I7PgpjnOcpFU/7fs2BuInrKZoIZ4oXFuaG SQmiXegHgeB29v20lSGZMNzIfIJs/kiB8Mf0KF/vqQf7jq5XDFCGnNkFJddpV6hZcygM0G 5A6TtIz9WPwKv/eSlabYIbL3UIs1tFJ52mbbaFNKO2OLqxHi/PXKoAiTMSY8mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208630; a=rsa-sha256; cv=none; b=s7YxYNcl7+/PZCmHHc/GdbO1UWm/6at8NftIbz931AKhA8wIZjk/6Ck+9lTUr/EQLrsGyT xH/H8vFGg1Z6n31iC/MRcmNxtF7SqhmDNaoqxQjDp2kzmWVEy09PUngBpzaK6kLkzu3mAg nVwzEhZxT6fKjZtcImSoaZ62D7oCKzB8uhxbQG4D8TF2sdMrEXLapAJQwOdqSwOnRidRAv JU/Jjq5nZbK10rrs9sLwmE3YvFyuRgi8MaCXuKjBqdyBx8Shi0pBUt+e+n/3Oa0dps6Gqk AmUcraLwJQVdgMgZD6sTTQ2MUtrn3QrNkiYlz1jCmLXEicjAI8hDLHYZtG65zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgV0ccwzsBM; Fri, 06 Jun 2025 11:17: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 556BH9Bx083577; Fri, 6 Jun 2025 11:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BH9h1083574; Fri, 6 Jun 2025 11:17:09 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:09 GMT Message-Id: <202506061117.556BH9h1083574@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: 09d62e0658d1 - main - pf: align IPv4 and IPv6 AH header handling 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: 09d62e0658d11cda80678bb9fc0ed5a48c0e838e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09d62e0658d11cda80678bb9fc0ed5a48c0e838e commit 09d62e0658d11cda80678bb9fc0ed5a48c0e838e Author: Kristof Provost AuthorDate: 2025-05-26 09:21:27 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:15:59 +0000 pf: align IPv4 and IPv6 AH header handling Pf was handling IPv4 and IPv6 differently regarding AH extension headers. pf_walk_header6() steps over it and detects the real protocol. So to implement a minimal header walking function pf_walk_header() for IPv4. It does the header checks and jumps over AH. Then pf does not understand AH as a protocol, it is just an extension that authenticates the packet. Move some header and option checks to pf_walk_header() for consistency with IPv6. This also improves the header check for IPv4 packets in ICMP payload. OK henning@ Obtained from: OpenBSD, bluhm , 22ef11432c Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50657 --- sys/netpfil/pf/pf.c | 65 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4451cca76842..69a68d0249b2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -372,6 +372,7 @@ static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, int, u_int16_t); static int pf_check_proto_cksum(struct mbuf *, int, int, u_int8_t, sa_family_t); +static int pf_walk_header(struct pf_pdesc *, struct ip *, u_short *); static int pf_walk_option6(struct pf_pdesc *, struct ip6_hdr *, int, int, u_short *); static int pf_walk_header6(struct pf_pdesc *, struct ip6_hdr *, @@ -7911,9 +7912,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, } /* offset of protocol header that follows h2 */ - pd2.off = ipoff2 + (h2.ip_hl << 2); + pd2.off = ipoff2; + if (pf_walk_header(&pd2, &h2, reason) != PF_PASS) + return (PF_DROP); - pd2.proto = h2.ip_p; pd2.tot_len = ntohs(h2.ip_len); pd2.src = (struct pf_addr *)&h2.ip_src; pd2.dst = (struct pf_addr *)&h2.ip_dst; @@ -9689,6 +9691,44 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, return (0); } +static int +pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) +{ + struct ip6_ext ext; + u_int32_t hlen, end; + + hlen = h->ip_hl << 2; + if (hlen < sizeof(struct ip) || hlen > ntohs(h->ip_len)) { + REASON_SET(reason, PFRES_SHORT); + return (PF_DROP); + } + end = pd->off + ntohs(h->ip_len); + pd->off += hlen; + pd->proto = h->ip_p; + /* stop walking over non initial fragments */ + if ((h->ip_off & htons(IP_OFFMASK)) != 0) + return (PF_PASS); + for (;;) { + switch (pd->proto) { + case IPPROTO_AH: + /* fragments may be short */ + if ((h->ip_off & htons(IP_MF | IP_OFFMASK)) != 0 && + end < pd->off + sizeof(ext)) + return (PF_PASS); + if (!pf_pull_hdr(pd->m, pd->off, &ext, sizeof(ext), + NULL, reason, AF_INET)) { + DPFPRINTF(PF_DEBUG_MISC, ("IP short exthdr")); + return (PF_DROP); + } + pd->off += (ext.ip6e_len + 2) * 4; + pd->proto = ext.ip6e_nxt; + break; + default: + return (PF_PASS); + } + } +} + #ifdef INET6 static int pf_walk_option6(struct pf_pdesc *pd, struct ip6_hdr *h, int off, int end, @@ -9936,18 +9976,22 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, *m0 = pd->m; h = mtod(pd->m, struct ip *); - pd->off = h->ip_hl << 2; - if (pd->off < (int)sizeof(*h)) { + if (pd->m->m_pkthdr.len < ntohs(h->ip_len)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); return (-1); } + + if (pf_walk_header(pd, h, reason) != PF_PASS) { + *action = PF_DROP; + return (-1); + } + pd->src = (struct pf_addr *)&h->ip_src; pd->dst = (struct pf_addr *)&h->ip_dst; PF_ACPY(&pd->osrc, pd->src, af); PF_ACPY(&pd->odst, pd->dst, af); pd->ip_sum = &h->ip_sum; - pd->virtual_proto = pd->proto = h->ip_p; pd->tos = h->ip_tos & ~IPTOS_ECN_MASK; pd->ttl = h->ip_ttl; pd->tot_len = ntohs(h->ip_len); @@ -9957,8 +10001,8 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, if (h->ip_hl > 5) /* has options */ pd->badopts++; - if (h->ip_off & htons(IP_MF | IP_OFFMASK)) - pd->virtual_proto = PF_VPROTO_FRAGMENT; + pd->virtual_proto = (h->ip_off & htons(IP_MF | IP_OFFMASK)) ? + PF_VPROTO_FRAGMENT : pd->proto; break; } @@ -9978,7 +10022,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, } h = mtod(pd->m, struct ip6_hdr *); - pd->off = 0; + if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; return (-1); @@ -9993,11 +10037,10 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->tos = IPV6_DSCP(h); pd->ttl = h->ip6_hlim; pd->tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); - pd->virtual_proto = pd->proto = h->ip6_nxt; pd->act.rtableid = -1; - if (pd->fragoff != 0) - pd->virtual_proto = PF_VPROTO_FRAGMENT; + pd->virtual_proto = (pd->fragoff != 0) ? + PF_VPROTO_FRAGMENT : pd->proto; /* * we do not support jumbogram. if we keep going, zero ip6_plen From nobody Fri Jun 6 11:17:14 2025 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 4bDJgb0Sxwz5yCXJ; Fri, 06 Jun 2025 11:17: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 4bDJgZ54Tkz3Jr9; Fri, 06 Jun 2025 11:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5OLgOiDQoqDhEekYe9Z47SNT2QGt166gpHmOcdLyzQ=; b=YJJezaLYWZNTAdsU5YzbbKnlVH06I4pHmW7YTo09JYxcTu5xI41Ok4mB1qdi8wtaH2cc5f u1vUuDU04uqnXJQQNGVM7iyOgvTAJU7T1oPuvfOV1kCxuSMnjCUtrA41a0GHXMahuseP0F /QDivRVsZ8gLg83mkyXbgxhvrO93Sw9whJhkqVqkCCkfd22OCiEJjJcfVTL6aynUaMLs8m EZMZ22rEkQZ8iS4d7uuxSKXkxYOOpE94fW7xJCFXm7ks/Q9BIFK3unRun1fcaqJcKwwuje f+LoknPIPTj9+SPyaDYDIegNu7pOb8juHLzqpbW1qaH1QvmBGwmI2alOnZ6wHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5OLgOiDQoqDhEekYe9Z47SNT2QGt166gpHmOcdLyzQ=; b=y4nfyELqp2VYh0ucp8fwj/gU+PA+cjy1ylLDGCSg/P277aqFtJvPV1Qsri+KltVeY6ZJcv WN8KMdUfLHJVWaWTa6MIqK1X3xQqJms4YHhEO9/AH+mlWbKhO+GkqT6xYE/d5wYW1WkypG ikTYBclHLUf5oxKBOqg4ax6KlYVgzeryT2wS2YWFXVQu4OPICbfUoLaKZjUMmxEuSfYLcy q7hMWDANnj0a34ZhlhuKdwo/0WAcyl9JyLLi5ft3XqkZVo2Gkc8tebO9uJ9q9WowpSp+ot UTgU7dC05qLcGbXAC38XX++vkirG7LoiWgsw4fzlBsW1ACsRxqrRbdOmrVBwKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208634; a=rsa-sha256; cv=none; b=H3cnfOZNH7PekvqeIa7q7vtUsqCpPIuKvvo2sllFLZYpS3zG9WqTNscd5CGfA4OsvTTTYP oKaF6VdAazcBekvbXd9l8+f75keNHvxVjBAoYSmWPDqNLU8eJf/F/qDogjWVg0VD0nJyk4 +zKGDVpvTsf0ipCQI1WBM9rtTcwbQCwQ7lV4xdBZLEgdmSLvWsT5yI6wIFotqw2yJYYNlT m12mappU7mJy9nfKvruZZK6nO3mdiuT6XoyB+d+YCUS9SZNsBgz5Uh7UCZiNjeOgggOq6L fh/qK+T7YcdFMrd/0MVS9R8Qk9VmwRoFfLjrle5pS4+DA2VlR8kx6MXoxKtnQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgZ4RVwzsjH; Fri, 06 Jun 2025 11:17:14 +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 556BHEm5083709; Fri, 6 Jun 2025 11:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHEU0083706; Fri, 6 Jun 2025 11:17:14 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:14 GMT Message-Id: <202506061117.556BHEU0083706@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: 7659d0fa2b87 - main - pf tests: skip TestHeader6::test_too_many if ipfilter is loaded 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: 7659d0fa2b873374623e7582e38fb2fe92056c87 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7659d0fa2b873374623e7582e38fb2fe92056c87 commit 7659d0fa2b873374623e7582e38fb2fe92056c87 Author: Kristof Provost AuthorDate: 2025-05-27 14:19:04 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:00 +0000 pf tests: skip TestHeader6::test_too_many if ipfilter is loaded IPFilter interferes with the header.py:TestHeader6::test_too_many test, so skip it if the module is loaded. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50661 --- tests/atf_python/utils.py | 10 ++++++++++ tests/sys/netpfil/pf/header.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/atf_python/utils.py b/tests/atf_python/utils.py index 4bd4b642b131..26911c12aef3 100644 --- a/tests/atf_python/utils.py +++ b/tests/atf_python/utils.py @@ -46,6 +46,7 @@ class BaseTest(object): NEED_ROOT: bool = False # True if the class needs root privileges for the setup TARGET_USER = None # Set to the target user by the framework REQUIRED_MODULES: List[str] = [] + SKIP_MODULES: List[str] = [] def require_module(self, mod_name: str, skip=True): error_code = libc.modfind(mod_name) @@ -58,9 +59,18 @@ class BaseTest(object): else: raise ValueError(txt) + def skip_module(self, mod_name: str): + error_code = libc.modfind(mod_name) + if error_code == 0: + txt = "kernel module '{}' loaded, skip test".format(mod_name) + pytest.skip(txt) + return + def _check_modules(self): for mod_name in self.REQUIRED_MODULES: self.require_module(mod_name) + for mod_name in self.SKIP_MODULES: + self.skip_module(mod_name) @property def atf_vars(self) -> Dict[str, str]: diff --git a/tests/sys/netpfil/pf/header.py b/tests/sys/netpfil/pf/header.py index 71abc8e9a049..6832cfe6d42b 100644 --- a/tests/sys/netpfil/pf/header.py +++ b/tests/sys/netpfil/pf/header.py @@ -125,6 +125,7 @@ class TestHeader(VnetTestTemplate): class TestHeader6(VnetTestTemplate): REQUIRED_MODULES = [ "pf" ] + SKIP_MODULES = [ "ipfilter" ] TOPOLOGY = { "vnet1": {"ifaces": ["if1", "if2"]}, "vnet2": {"ifaces": ["if1", "if2"]}, From nobody Fri Jun 6 11:17:12 2025 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 4bDJgX5d8zz5yCDV; Fri, 06 Jun 2025 11:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJgX39Tkz3JnP; Fri, 06 Jun 2025 11:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6KSmbwlfTiRHSoeta+H2a+eUgdjbJWpqfOZw3e9FoAs=; b=ot9+FnKp3V5FE7VK7Gbs8OeqiyRiYkZmk8gCM410T2AlXvLBVb2cxqLrVJAf8JENar2abs jY3gSlsujvoXkZxkiLDok5WvAnFhu8SoV20WqXZFwDnzKOuOqgG30XQzGAyt463O4SKqgL 2NNuqKcjTY/ecxzS3gO87J7nG6KRYUiGfxq9iEhzjj/LdZcohu7+kp4oxtQg+ziAEKhVgP 4cstnqBzObiU5wwc4GLWmuTpdZO0+fe/V1E2DOJ7wjEwrpYW8oJebetWLWH2Sd2i3HJPeW S8FhFpuDfwtpi8ughsm/+2JNHZUnCdzjG6OjDC2SuBdI78SxtzvAqpiXUhMe9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6KSmbwlfTiRHSoeta+H2a+eUgdjbJWpqfOZw3e9FoAs=; b=uNDYZpdaT6SwzE8txUjubz4F5DDJUb3NjlxleCavF5ojQkVCw4g9bl8pYObJtOEM5CY3Mr 37kmI6ZqiX5grE9uqZ9zDkb+vEcHh7ByQHRXeCQ/Z6GDUwLxFtRu1gImi3HZFWicAoe/m/ BhdA+h0rW7zCdbeYnmadU/B1B9t0Ei462BCJdsVeMEBDKD4O6y9SJnRsZffIZDz63xjtuj bkqcqidqfeBRo2FS//I3+yaq2/C+cIZUrPqov/2dMtX9rZaF2JjqCS4dHmxQu7E1VLL8iO YCP9dNGPMDEi2L6IjJ6XX2X0uf3GyA98buJaW5FwdvAnUsjThZukvwDn+mBhCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208632; a=rsa-sha256; cv=none; b=UtE9BJ350zbKcfj7JWqPYfNOUH10afGPLSrct4AikXVtiw+/wDJwDKoAm2vqQhn8xk8sJc s5O2/kYE4M4KKSQLwvEEB4YMn7hsQQ0eS8wHIALFdUqgT541l8O5ZAcqooUN8OAL7OfxtY B8aggcV014yN6bPU72Qz0zuhq4opR3VIdWDvEwdm6V/SdjlzHWA1AIpEVcsbj01S9T5bil 41TI68NlSQY+lqKVaNkZag1zIHrNnK5izMmrbMFYnEsp4JBQ1f0jRme8o8A20GMlCQOFIj WGjPeoWD8KXY0Ij+mE1+vSO3rbkgkr4jMLjy2VSLTmYngRjIoPZs5TGOQcDboA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgX2brZzsJ6; Fri, 06 Jun 2025 11:17:12 +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 556BHC8R083642; Fri, 6 Jun 2025 11:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHCOo083639; Fri, 6 Jun 2025 11:17:12 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:12 GMT Message-Id: <202506061117.556BHCOo083639@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: dda88af8fa4e - main - pf: limit how many headers we look at 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: dda88af8fa4eb1455a6e899434936c4ddeaf526d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dda88af8fa4eb1455a6e899434936c4ddeaf526d commit dda88af8fa4eb1455a6e899434936c4ddeaf526d Author: Kristof Provost AuthorDate: 2025-05-26 09:55:12 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:00 +0000 pf: limit how many headers we look at Limit the nested header chain for IPv6 extensions headers and for authentication headers in the IPv4 case. This prevents spending excessive cpu time on crafted packets. OK henning@ Obtained from: OpenBSD, bluhm , 2e5bc81177 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50659 --- sys/netpfil/pf/pf.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0cfb728c3eb5..f1b04a96590b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -180,6 +180,8 @@ VNET_DEFINE(u_int32_t, ticket_altqs_inactive); VNET_DEFINE(int, altqs_inactive_open); VNET_DEFINE(u_int32_t, ticket_pabuf); +static const int PF_HDR_LIMIT = 20; /* arbitrary limit */ + VNET_DEFINE(SHA512_CTX, pf_tcp_secret_ctx); #define V_pf_tcp_secret_ctx VNET(pf_tcp_secret_ctx) VNET_DEFINE(u_char, pf_tcp_secret[16]); @@ -9698,6 +9700,7 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) { struct ah ext; u_int32_t hlen, end; + int hdr_cnt; hlen = h->ip_hl << 2; if (hlen < sizeof(struct ip) || hlen > ntohs(h->ip_len)) { @@ -9710,7 +9713,7 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) /* stop walking over non initial fragments */ if ((h->ip_off & htons(IP_OFFMASK)) != 0) return (PF_PASS); - for (;;) { + for (hdr_cnt = 0; hdr_cnt < PF_HDR_LIMIT; hdr_cnt++) { switch (pd->proto) { case IPPROTO_AH: /* fragments may be short */ @@ -9729,6 +9732,9 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) return (PF_PASS); } } + DPFPRINTF(PF_DEBUG_MISC, ("IPv4 nested authentication header limit")); + REASON_SET(reason, PFRES_IPOPTIONS); + return (PF_DROP); } #ifdef INET6 @@ -9801,14 +9807,13 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) struct ip6_ext ext; struct ip6_rthdr rthdr; uint32_t end; - int hdr_cnt = 0, fraghdr_cnt = 0, rthdr_cnt = 0; + int hdr_cnt, fraghdr_cnt = 0, rthdr_cnt = 0; pd->off += sizeof(struct ip6_hdr); end = pd->off + ntohs(h->ip6_plen); pd->fragoff = pd->extoff = pd->jumbolen = 0; pd->proto = h->ip6_nxt; - for (;;) { - hdr_cnt++; + for (hdr_cnt = 0; hdr_cnt < PF_HDR_LIMIT; hdr_cnt++) { switch (pd->proto) { case IPPROTO_FRAGMENT: if (fraghdr_cnt++) { @@ -9863,7 +9868,7 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) /* FALLTHROUGH */ case IPPROTO_HOPOPTS: /* RFC2460 4.1: Hop-by-Hop only after IPv6 header */ - if (pd->proto == IPPROTO_HOPOPTS && hdr_cnt > 1) { + if (pd->proto == IPPROTO_HOPOPTS && hdr_cnt > 0) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 hopopts not first")); REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); @@ -9922,6 +9927,9 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) return (PF_PASS); } } + DPFPRINTF(PF_DEBUG_MISC, ("IPv6 nested extension header limit")); + REASON_SET(reason, PFRES_IPOPTIONS); + return (PF_DROP); } #endif /* INET6 */ From nobody Fri Jun 6 11:17:13 2025 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 4bDJgZ1B8vz5yCDY; Fri, 06 Jun 2025 11:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJgY47Chz3Jf9; Fri, 06 Jun 2025 11:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6R/Djv1+NBaootyoAy7/8RH40Um20omo3SRH4gJVyik=; b=khSkvx8bIxEe8zI74TRyA46MeAzl2VU+3CYy2lycOfoj84EsohkfpsKBZg/i/0jQHDkP/q 9B6Lolaxb+iqDBAQdA54bWsPsEwXEEKqDZx9MykZarzswgkqoBoeaxQyOpq0TkPSYDHGX+ NjGvSLcB9a3lAhXPFqe6fCxXCsuyD80NUQkgobIIZgxXXLwjYKjhh9onIiwVdN/b4kKsIH JWt6NNJUOdzdEJXcD1pu3ICfFLacN5993u6vkLoOaZymXPRSw6+wKbSBerbZX2cCOQx1ts wJKV2ocZzUmXKV7FdrBKdZhSiqApAciWEu1RmHnXwZsmmJuat3OGU0ArybbtWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6R/Djv1+NBaootyoAy7/8RH40Um20omo3SRH4gJVyik=; b=DEyhk18h7ew8M86AcKQOmwnbw6dpDb9nSccHXi+Fj3oslvqeSobBIRh/EedS30M+KnMwmL c4kXrNtM5YePn8tp0xPmQKidrrXkeolX+U8LwQlK9X2ZSW9kzKEh3CjcXBiA8j/VWYJwoD lkv5kIkCa55XhpNL0wNe9rYkDOBWo49X3exY+6pizVfWYmMGQex1PKSNWcxqCD2bUY8vHz xj9d2lNAHPsrlHq2gLYXnCqsH7KersRllSJ3Eukjmr3/lA/PmCAjhD05/Mp8z8vjV4Cb0V HZIkI9XCa5Wze4RCAxeQx0O0fWC9VpcXFm2upLwrZwcKZiawfyl9LP5fYvkQSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208633; a=rsa-sha256; cv=none; b=W3XCQZRs7PXq6ko13eiuWKTA2PaaNhmRBrS9G2InKNy+fwk+H+l4JWzzetHihPUQ2je9uF 4HbqpF1wUxtqj/8GPJNs61P7o91gisui5l+nUn9erWHqMF04EwZIh9vsoMkjYDp5eaZkxO fYGCrErOtrZXfHx6SJlwGhaZs0B1pXQNfa3rwG6rdocU+bghQIPC7UdtP7GRLMMn43ev4j bCnSodqmEhe/OzdaWbijk4pZbvjiQ/Fs1KnrO1zGN9xUdDk8uRlb/Kf7u2Xd2iE5yQ8j2O Tpw0HIUdThJ+8G+OW7JxnplVVBiMBwh+WGRQ+TJNOvw4i6ouRvA1/wWha49c9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgY3V2jzrv2; Fri, 06 Jun 2025 11:17:13 +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 556BHDJC083677; Fri, 6 Jun 2025 11:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHDvo083674; Fri, 6 Jun 2025 11:17:13 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:13 GMT Message-Id: <202506061117.556BHDvo083674@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: 32546d57f3bb - main - pf tests: verify header processing limit 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: 32546d57f3bb371ca17943509a8315b73de684c9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=32546d57f3bb371ca17943509a8315b73de684c9 commit 32546d57f3bb371ca17943509a8315b73de684c9 Author: Kristof Provost AuthorDate: 2025-05-26 16:03:22 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:00 +0000 pf tests: verify header processing limit Verify that we drop packets with 20 or more AH headers (IPv4) or 20 or more extension headers (IPv6). Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50660 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/header.py | 216 +++++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/utils.py | 9 +- 3 files changed, 224 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d70631a9de53..e926c9dd50c2 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -54,6 +54,7 @@ ATF_TESTS_SH+= altq \ tos ATF_TESTS_PYTEST+= frag6.py +ATF_TESTS_PYTEST+= header.py ATF_TESTS_PYTEST+= icmp.py ATF_TESTS_PYTEST+= nat64.py ATF_TESTS_PYTEST+= nat66.py diff --git a/tests/sys/netpfil/pf/header.py b/tests/sys/netpfil/pf/header.py new file mode 100644 index 000000000000..71abc8e9a049 --- /dev/null +++ b/tests/sys/netpfil/pf/header.py @@ -0,0 +1,216 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 Rubicon Communications, LLC (Netgate) +# +# 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. + +import pytest +import re +from utils import DelayedSend +from atf_python.sys.net.tools import ToolsHelper +from atf_python.sys.net.vnet import VnetTestTemplate + +class TestHeader(VnetTestTemplate): + REQUIRED_MODULES = [ "pf" ] + TOPOLOGY = { + "vnet1": {"ifaces": ["if1", "if2"]}, + "vnet2": {"ifaces": ["if1", "if2"]}, + "if1": {"prefixes4": [("192.0.2.2/24", "192.0.2.1/24")]}, + "if2": {"prefixes4": [("198.51.100.1/24", "198.51.100.2/24")]}, + } + + def vnet2_handler(self, vnet): + ToolsHelper.print_output("/sbin/sysctl net.inet.ip.forwarding=1") + ToolsHelper.print_output("/usr/sbin/arp -s 198.51.100.3 00:01:02:03:04:05") + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.print_output("/sbin/pfctl -x loud") + ToolsHelper.pf_rules([ + "pass", + ]) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_too_many(self): + "Verify that we drop packets with silly numbers of headers." + + sendif = self.vnet.iface_alias_map["if1"].name + recvif = self.vnet.iface_alias_map["if2"].name + gw_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) + gw_mac = re.sub("0a$", "0b", gw_mac) + + ToolsHelper.print_output("/sbin/route add default 192.0.2.1") + + # Import in the correct vnet, so at to not confuse Scapy + import scapy.all as sp + + # Sanity check, ensure we get replies to normal ping + pkt = sp.Ether(dst=gw_mac) \ + / sp.IP(dst="198.51.100.3") \ + / sp.ICMP(type='echo-request') + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + + found = False + for r in reply: + r.show() + + icmp = r.getlayer(sp.ICMP) + if not icmp: + continue + assert icmp.type == 8 # 'echo-request' + found = True + assert found + + # Up to 19 AH headers will pass + pkt = sp.Ether(dst=gw_mac) \ + / sp.IP(dst="198.51.100.3") + for i in range(0, 18): + pkt = pkt / sp.AH(nh=51, payloadlen=1) + pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') + + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + found = False + for r in reply: + r.show() + + ah = r.getlayer(sp.AH) + if not ah: + continue + found = True + assert found + + # But more will get dropped + pkt = sp.Ether(dst=gw_mac) \ + / sp.IP(dst="198.51.100.3") + for i in range(0, 19): + pkt = pkt / sp.AH(nh=51, payloadlen=1) + pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') + + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + + found = False + for r in reply: + r.show() + + ah = r.getlayer(sp.AH) + if not ah: + continue + found = True + assert not found + +class TestHeader6(VnetTestTemplate): + REQUIRED_MODULES = [ "pf" ] + TOPOLOGY = { + "vnet1": {"ifaces": ["if1", "if2"]}, + "vnet2": {"ifaces": ["if1", "if2"]}, + "if1": {"prefixes6": [("2001:db8::2/64", "2001:db8::1/64")]}, + "if2": {"prefixes6": [("2001:db8:1::2/64", "2001:db8:1::1/64")]}, + } + + def vnet2_handler(self, vnet): + ToolsHelper.print_output("/sbin/sysctl net.inet6.ip6.forwarding=1") + ToolsHelper.print_output("/usr/sbin/ndp -s 2001:db8:1::3 00:01:02:03:04:05") + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.print_output("/sbin/pfctl -x loud") + ToolsHelper.pf_rules([ + "pass", + ]) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_too_many(self): + "Verify that we drop packets with silly numbers of headers." + ToolsHelper.print_output("/sbin/ifconfig") + + sendif = self.vnet.iface_alias_map["if1"].name + recvif = self.vnet.iface_alias_map["if2"].name + our_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) + gw_mac = re.sub("0a$", "0b", our_mac) + + ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") + + # Import in the correct vnet, so at to not confuse Scapy + import scapy.all as sp + + # Sanity check, ensure we get replies to normal ping + pkt = sp.Ether(src=our_mac, dst=gw_mac) \ + / sp.IPv6(src="2001:db8::2", dst="2001:db8:1::3") \ + / sp.ICMPv6EchoRequest() + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + + found = False + for r in reply: + r.show() + + icmp = r.getlayer(sp.ICMPv6EchoRequest) + if not icmp: + continue + found = True + assert found + + # Up to 19 AH headers will pass + pkt = sp.Ether(src=our_mac, dst=gw_mac) \ + / sp.IPv6(src="2001:db8::2", dst="2001:db8:1::3") + for i in range(0, 18): + pkt = pkt / sp.AH(nh=51, payloadlen=1) + pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + + found = False + for r in reply: + r.show() + + ah = r.getlayer(sp.AH) + if not ah: + continue + found = True + assert found + + # But more will get dropped + pkt = sp.Ether(src=our_mac, dst=gw_mac) \ + / sp.IPv6(src="2001:db8::2", dst="2001:db8:1::3") + for i in range(0, 19): + pkt = pkt / sp.AH(nh=51, payloadlen=1) + pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() + s = DelayedSend(pkt, sendif) + reply = sp.sniff(iface=recvif, timeout=3) + print(reply) + + found = False + for r in reply: + r.show() + + ah = r.getlayer(sp.AH) + if not ah: + continue + found = True + assert not found diff --git a/tests/sys/netpfil/pf/utils.py b/tests/sys/netpfil/pf/utils.py index 3cd8278f7cf7..3d1c1de86aad 100644 --- a/tests/sys/netpfil/pf/utils.py +++ b/tests/sys/netpfil/pf/utils.py @@ -28,14 +28,19 @@ import threading import time class DelayedSend(threading.Thread): - def __init__(self, packet): + def __init__(self, packet, sendif=None): threading.Thread.__init__(self) self._packet = packet + self._sendif = sendif self.start() def run(self): import scapy.all as sp time.sleep(1) - sp.send(self._packet) + + if self._sendif: + sp.sendp(self._packet, iface=self._sendif) + else: + sp.send(self._packet) From nobody Fri Jun 6 11:17:16 2025 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 4bDJgd4jSnz5yCQX; Fri, 06 Jun 2025 11:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJgc6q9fz3K1Z; Fri, 06 Jun 2025 11:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn54sImImzzNLxZlr4/hCiT6qKRXfurVsFY09cjzXbg=; b=GSclDCZsNg8Vb1gupup64hjtA7BNXpIDbPunxugvNTa8bq4g05eSqfBsWdMxjXDzft3BgH ght/hgSjnEYdKWs27rQiIej3h4b3/iDZY4/Z6QdpVgAbvuhiJ8JuX+N2pUYjiGd/kkMt5+ PCXNNXvXEnatAusiCY8CHQAOo11zqcWUV34Vg8iGe3joZftFjd0tfk/3xNZdTLqnV6sko4 w5A9SNIixVN4mEnP+/wwMkdQGRm3H9I4GSd/mPV2mVfFqXzRF2p8GieiXOQjckKcPw2h+S fFoKZs2uKLe5L7e4Lu5ryMFNq/Ci3HBWS4i2TQWehVBT411q529MmJWiHRKSRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn54sImImzzNLxZlr4/hCiT6qKRXfurVsFY09cjzXbg=; b=e8Cv251NTSu7928C2sY/WkKpIp1RC3K/HX5Ke77Hqj6WHx318RHPXEZQI9zENqJwju8VME dVidYc+v1/EiDH99eXZ8nJT8lVf9ViEFIgY5IvgrO/felLU+jRiKoKG20xBT4L4qJrtQg7 EuEyhV/lAZLQX0iB4ZNQCBgyl0uLRWa9ilFUlY8QY8DOKe/p4IMppNcw5SZSbfT4O2dFD/ dECeCF4w/4KDvM/7NXyjLk3mIf4+bLkaalYVEE4K3W5jen78d5fhzaMK6FLqV3JRpWrYMe QmHvK1Pl6pWu9z0yHo2iG3jb4RSMlznhHfhuRgUQzSNbNre3cF1khiFlG/rZdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208637; a=rsa-sha256; cv=none; b=DpHR2UBkZyC4bwWGOs79AplK2k/yloVD/gnKUqusKvf0Crzy60weSY+8VppCVRWYvs2q8W FDomJ6lNZJBvPviXegNiBnZsUZhguCtm1GxA6Ir70Jwhoeje0dyMns/cMP8fTBVpyBIiRI YaXMlB4ndQNQuTfkTc3kISePn6CP3kEKWKp+vu3v28t8RpXd1+YmDHydmkQ9zi+lLiJOw/ XO+G1yOrQKWIGWaItHTlP0A6R6pN3YOt/yy+tLtiOwd4KDs6H6WAtqhP39LJT2NflhPSRG GZkoJMcUQOjkqp1Tvi+DQ95JQKIiQQIQkxn57bnM2qFQ8A2K1VlTVIe5RntA4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgc6R8PzsWl; Fri, 06 Jun 2025 11:17: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 556BHGhu083780; Fri, 6 Jun 2025 11:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHG27083777; Fri, 6 Jun 2025 11:17:16 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:16 GMT Message-Id: <202506061117.556BHG27083777@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: 3baef738a8ae - main - pf tests: update after IPv6 hop-by-hop change 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: 3baef738a8ae58c7286f499ef1cd8a50f2435777 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3baef738a8ae58c7286f499ef1cd8a50f2435777 commit 3baef738a8ae58c7286f499ef1cd8a50f2435777 Author: Kristof Provost AuthorDate: 2025-05-27 15:22:20 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:00 +0000 pf tests: update after IPv6 hop-by-hop change Hop-by-hop headers on IPv6 are now blocked by default. Specify 'allow-opts' to allow them. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50663 --- tests/sys/netpfil/pf/frag6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py index 0ed980f96fdd..c8b756f8274b 100644 --- a/tests/sys/netpfil/pf/frag6.py +++ b/tests/sys/netpfil/pf/frag6.py @@ -101,7 +101,7 @@ class TestFrag6HopHyHop(VnetTestTemplate): ToolsHelper.print_output("/sbin/pfctl -x loud") ToolsHelper.pf_rules([ "scrub fragment reassemble min-ttl 10", - "pass", + "pass allow-opts", ]) @pytest.mark.require_user("root") From nobody Fri Jun 6 11:17:15 2025 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 4bDJgc1hnmz5yCV1; Fri, 06 Jun 2025 11:17: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 4bDJgb5kYXz3K1R; Fri, 06 Jun 2025 11:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8g9VnbHgOX0eguVmSM4Fha1DsDRwGnSDw7Ucs08h0CM=; b=yX7FevlUDVdDEXOaWqgy7sItFdNLmxXX3c2/Dm67WkKlaEB1Vyo0Xuk1pSAYutDvqlTdcr qw7qzwSKBwFYv0L9YotKgd2B6zGHp1Al7fFSToVW4Q+OoIpLitOCOFw1MEPMg4+cUHTLae nLEettwRM3zGDlXmxAEY6JyXgSC7JvaMwbfmHHbaS2pi92Gy2qHnNKUjtPpsO19Knq8w/6 rvNFZELemh8FsKizAuN5jNF1l+sJlO/UpXoMviLct09vyuMMWwrvjYEc+O5jHuI7NspIFi I1PjRliJyuz2826i3UNJbzYHdSAvMRTgVZeI3GHa26ACdqNL/O0DqpE09pK9tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8g9VnbHgOX0eguVmSM4Fha1DsDRwGnSDw7Ucs08h0CM=; b=Jw/IO3de6uM3g1/Bro+L0baen8rTNWkdgKb9Y+M5Bxp5WbNtvhMJ3uT9ZhAGbvJTzhYgHD xzjsG/vAKFkLTkpfeEXcfke3S0kwUNC68eol5fiBRGyhjYhzPhuZ+U0ig8RCUIdy8t83fL LpdDp9GaWWR8cLgyOUnCjqpI4LEpfjCzSa+nK2xYU4HKSA5fWPnF/vkjxehNZwhuIdeVsS H0TP0GVyyqfrO+lEQwNRLhLyg8RR+S5xSKwJG60dvm5WTt7gHAF/oD0Ks7hSF4wqXrdXiE DfunqVgTQxWZR37a5v1OMXHZ3RtCxSGwP2uGsdtrCu7udPEjrDB9mJPrQ4oSIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208635; a=rsa-sha256; cv=none; b=SWN2PipJLDCDLOUQhXo4BnUmBYvgYkX1Y71TkbbxqRYvqK1VX3LWXzV0ENvIKNuwNfMe1B r8mbBP/9bJl3a2dc+x7qzh3gfXdYWePBVcPQgLBs5M83aUyERpvh2LrGhLgnoJ7SiMt390 fnOsXwUUC9h269rk3AoUpWY1d3fMlIshh+VqdHr2h0ynP7uXZV9L6H549imT3YrROeI7XT C6PcvU94XnBQxjoJmMbrsel31q0q6PGRqayo6lnIBV21aiLXugpJFm+IQUFtIVWJJJlcz2 OltaCIzOBBmmcgfDlRUIcP01uCGZ5dDXbG8n29QdZxcnu4q39pnyQb1tFr8cJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgb59b4zsBP; Fri, 06 Jun 2025 11:17: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 556BHFTf083748; Fri, 6 Jun 2025 11:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHFbH083745; Fri, 6 Jun 2025 11:17:15 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:15 GMT Message-Id: <202506061117.556BHFbH083745@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: ee97d8918389 - main - pf: align option handling for IPv4 and IPv6 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: ee97d89183896e45d3ff40d0f3a5b727b7a534cb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ee97d89183896e45d3ff40d0f3a5b727b7a534cb commit ee97d89183896e45d3ff40d0f3a5b727b7a534cb Author: Kristof Provost AuthorDate: 2025-05-27 14:44:56 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:00 +0000 pf: align option handling for IPv4 and IPv6 Block IPv6 packets in pf(4) that have hop-by-hop options header or destination options header. Such packets can be passed by adding "allow-opts" to the rule. So IPv6 options are handled like their counterpart in IPv4 now. tested by benno@; OK henning@ Obtained from: OpenBSD, bluhm , c50c83ac27 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50662 --- share/man/man5/pf.conf.5 | 13 +++++++------ sys/netpfil/pf/pf.c | 11 +++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 6cabdc6741a6..df1e0a99a47e 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 26, 2025 +.Dd May 27, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2147,20 +2147,21 @@ pass all tos 0x10 pass all tos 16 .Ed .It Ar allow-opts -By default, IPv4 packets with IP options or IPv6 packets with routing -extension headers are blocked. +By default, packets with IPv4 options or IPv6 hop-by-hop or destination +options header are blocked. When .Ar allow-opts is specified for a .Ar pass rule, packets that pass the filter based on that rule (last matching) -do so even if they contain IP options or routing extension headers. +do so even if they contain options. For packets that match state, the rule that initially created the state is used. The implicit .Ar pass -rule that is used when a packet does not match any rules does not -allow IP options. +rule, that is used when a packet does not match +any rules, does not allow IP options or option headers. +Note that IPv6 packets with type 0 routing headers are always dropped. .It Ar label Aq Ar string Adds a label (name) to the rule, which can be used to identify the rule. For instance, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f1b04a96590b..fa4c4b73809c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9707,6 +9707,8 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, u_short *reason) REASON_SET(reason, PFRES_SHORT); return (PF_DROP); } + if (hlen != sizeof(struct ip)) + pd->badopts++; end = pd->off + ntohs(h->ip_len); pd->off += hlen; pd->proto = h->ip_p; @@ -9814,6 +9816,11 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) pd->fragoff = pd->extoff = pd->jumbolen = 0; pd->proto = h->ip6_nxt; for (hdr_cnt = 0; hdr_cnt < PF_HDR_LIMIT; hdr_cnt++) { + switch (pd->proto) { + case IPPROTO_HOPOPTS: + case IPPROTO_DSTOPTS: + pd->badopts++; + } switch (pd->proto) { case IPPROTO_FRAGMENT: if (fraghdr_cnt++) { @@ -10007,10 +10014,6 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->tot_len = ntohs(h->ip_len); pd->act.rtableid = -1; pd->df = h->ip_off & htons(IP_DF); - - if (h->ip_hl > 5) /* has options */ - pd->badopts++; - pd->virtual_proto = (h->ip_off & htons(IP_MF | IP_OFFMASK)) ? PF_VPROTO_FRAGMENT : pd->proto; From nobody Fri Jun 6 11:17:17 2025 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 4bDJgf2YyVz5yCZB; Fri, 06 Jun 2025 11:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDJgf0d8pz3K3y; Fri, 06 Jun 2025 11:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y4MmomLAMulAnVJ6plae7a3zTFskO5goEo8Ida9uN1I=; b=gqntBVCTkMoGtZDByatFDTAHZg+u9t1uvhMEgGeduQjqx3ZwgqYZKjwEV+HdlKIw5OVe4W Jzfuy2YTlTFyBziDc2PE1EHklXWGNI+V5jw3+/gQFLBhI9eRErbmRki3hJR6vQA5UedmTm uUKRiSUtI+dkVbwelKaeteE4v00LdxjyzjbXOkAREwYs9ZAFcPOAbW+psx9mOOmoKx54vi gftgPVnWjgIHxbAHHRnnK4C3Cry7Gz47m3uxdcnrP6FiSrwEf1/2A50Ic+fjG8blzBrsMH 6Xe9hhTr/51ivgg7i4Pk6aE98SpF+k67N4L0ZTCqJMdwJEeOWtjPXcgUvuZkpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749208638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y4MmomLAMulAnVJ6plae7a3zTFskO5goEo8Ida9uN1I=; b=JcM6weEjwE9526PPW/wFuNe0KT8t/JSo6zEvZkQWx/4elwEoN9uh8AO2Ky/y3GM+KyZxwR CAtclvASMNMkY7FPZaEuRQWXOe77W7lLOhqH61pI1OUgAdNItQZuQlqrFkHWT3PyuIB1F5 MbOewIdhUrZFnTY3wgtbDu9hmkJ6ft2Dgg22xZkJxu2tRBM+4sFz2diUyaNTNCRobNBdps o2vCsgFyQgtH+TK50Cr7cAhMk4l+zEggEmbIXouzPxjHXyeFrSjEMzlZCFJnz4i/zzwrCi rCyroq67r60JGzeHxGIev9AtTAtmfr7UwP9BPHG0tt77fKTCDD1YFvj1H321Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749208638; a=rsa-sha256; cv=none; b=lEjs5JCYveMX5AGWvQSusHy+lQuEOTePMiI3ruv7YdQa6nhTGd08QOLEBTwgmdL/ywW17s M6jtiPh04sqQpcV9f0nssoJEanpOunwoSPNWGs4ee4ErQuWK1X7vFyy5Q2FmeLcWD33xbl RpIMcfOOFr0+b11vYK52pUcDYhLb7kU/sJU9xbMQe0+8CsKxn+GGj+sHB8I/ys6AIMIzAo khWxVEK290CURcTK2Mr1ieeX4jg2bezM44HZFSVcTuRm1p6o78ra+UfMwfdKr+F4JSygeR AX8ijg71hDUXU0KjewfY59ntben+3OLFWgB6u/B5b304Z63Hkp9rdrRZwv+Sfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDJgd750Nzsm2; Fri, 06 Jun 2025 11:17:17 +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 556BHHDp083814; Fri, 6 Jun 2025 11:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556BHHJP083811; Fri, 6 Jun 2025 11:17:17 GMT (envelope-from git) Date: Fri, 6 Jun 2025 11:17:17 GMT Message-Id: <202506061117.556BHHJP083811@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: 311ad5bc811d - main - UPDATING: document recent pf changes 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: 311ad5bc811d0d14da772cbb1333970266194ec7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=311ad5bc811d0d14da772cbb1333970266194ec7 commit 311ad5bc811d0d14da772cbb1333970266194ec7 Author: Kristof Provost AuthorDate: 2025-05-28 08:46:26 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 11:16:01 +0000 UPDATING: document recent pf changes Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50664 --- UPDATING | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UPDATING b/UPDATING index bee8b348f113..b12d31f4bec9 100644 --- a/UPDATING +++ b/UPDATING @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. Bump _FreeBSD_version to 1500045 to be able to detect this change. +20250527: + pf changed extension header handling. It now treats AH headers on IPv4 just + like AH headers on IPv6 and skips over them, allowing filtering on the inner + protocol. + +20250527: + pf now blocks IPv6 packets with a hop-by-hop or destination options header by + default. Such packets can be passed by adding "allow-opts" to the rule. IPv6 + options are now handled just like their IPv4 counterparts. + 20250527: The CAM target layer userland, i.e. ctld(8), ctladm(8) and ctlstat(8), has moved to the new FreeBSD-ctl package. If you use pkgbase and you From nobody Fri Jun 6 12:05:17 2025 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 4bDKl164SBz5yG9c; Fri, 06 Jun 2025 12:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDKl135GQz3s8B; Fri, 06 Jun 2025 12:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749211517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gWxrBex9KNRlszJvH4Cbh+3cmc2yoTsaoSJn4/tYtEM=; b=OOtazOgJYBek/KnSxB79nDsViLo2M3ZB3HFH8WiaNCenUNnPYcZtKCJHhle422Q76YOjrH /oPPOQIhX7fZzLGa8tCNrIGtS4Wl0rM5mEX8Es/uj7FWOmRM/s+DyS3n/fOGx1701I/u5C SWW2Khmvn5r1DjxGU7+5SkwWXOSkmcpcreJM65HIxUT0S5MdfyFQcOCws5h+mlvf5l8/V9 Cywxv64u06F7RSRCasfVlqOnNDm36ZbXjkDk1FZ7Y8HX2fS8Qm8CZS9T3+nhEP9YpXcd+u +Hu6fUAHEEY9CGHCkhVy7/qatMF/MKYAxhIj7J3ks63oS+xV2kqOMG++xT7jpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749211517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gWxrBex9KNRlszJvH4Cbh+3cmc2yoTsaoSJn4/tYtEM=; b=gWjTAO70YD/7Sp1T8y4LLlbMApYTqxiwNLC2LtMivMNC65L4D7rYIJl7HYgrNfAgRUNiG8 X/rG3vMgVtEW0GWXaKUkYHQ1eWtD66LEurBgKaYrfZBs+oSkdNyDrJ9gv8snSKzHlpToX9 aM4MuFTs1Cy1qsROOqrbbbN9RaI1P01RbN5Mn5Ya4inEJ8+U1vmrIfWmqCfondUpql7vnI qLbEEN2S+e5UpzQcFbvkOu3RghlOS4vPAwFHlLZOCM3zlypjimn53L1Kt09EAm5JimlLx6 uBm8eSVJuZ5jMvGiVe8WrrgKEMfjNcgULykdzCUMwg7GTnpF4OzhsLzkz/oDDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749211517; a=rsa-sha256; cv=none; b=pIh5jKCUnv/n2U/j4UpNksPv1adoLjdKBXgKpneC81WpbcA/544sDoUvDYVvYX5a+6dHBc MtsYCNC/xdybo4/74nOSNI2Qze5wJICDATf7bf1HuKZCetSvGhdNzNDO8CJAV5t2ju1rII 00D3kGyAH6qG6d9GGybV0qMmQ2h53Y7xEw08KrIKmC4Xu/b6mSI5BAz2DuD5viAKvo0AgD zA4VWaAWympA4SxGouqPiJH0TLFUZPvN+f4UQDN+kGJDN3/1rby8qhEJw4FZyL4+AOvhX8 EfWNQ8KEOkQcs3/YSOCQ3A0kYBQcj+B83c99f9bx4ww0OaT1EnV9AxzqrPU0LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDKl12fbkzvDm; Fri, 06 Jun 2025 12:05:17 +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 556C5HI7078080; Fri, 6 Jun 2025 12:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556C5HHI078077; Fri, 6 Jun 2025 12:05:17 GMT (envelope-from git) Date: Fri, 6 Jun 2025 12:05:17 GMT Message-Id: <202506061205.556C5HHI078077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e945411697cf - main - diff: minor fixes to manual page 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e945411697cfaf9e57ef9ffdf9d35dfd9778612b Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e945411697cfaf9e57ef9ffdf9d35dfd9778612b commit e945411697cfaf9e57ef9ffdf9d35dfd9778612b Author: Pau Amma AuthorDate: 2025-06-06 12:04:04 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-06 12:05:05 +0000 diff: minor fixes to manual page * Add missing dash before long option name in synopsis. * Remove spurious paragraph break and bullet item. * While there, fix mandoc -T lint complaints. Reviewed by: ziaee, des Differential Revision: https://reviews.freebsd.org/D48388 --- usr.bin/diff/diff.1 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index 559434d8e4fb..47f9c11eb3db 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" $OpenBSD: diff.1,v 1.47 2015/11/24 19:35:41 jmc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 @@ -27,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 26, 2024 +.Dd January 7, 2025 .Dt DIFF 1 .Os .Sh NAME @@ -95,7 +98,7 @@ .Op Fl -strip-trailing-cr .Op Fl -tabsize Ar number .Op Fl -text -.Fl C Ar number | -context Ar number +.Fl C Ar number | Fl -context Ar number .Ar file1 file2 .Nm diff .Op Fl aBbdiltw @@ -354,7 +357,7 @@ Files differ and only the second file contains the line. .Pp Comparison options: .Bl -tag -width Ds -.It Fl A Ar algo, Fl -algorithm Ar algo +.It Fl A Ar algo , Fl -algorithm Ar algo Configure the algorithm used when comparing files. .Nm supports 3 algorithms: @@ -420,9 +423,9 @@ environment variable is set to a non-empty string. Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes. -.It Fl F Ar pattern, Fl -show-function-line Ar pattern +.It Fl F Ar pattern , Fl -show-function-line Ar pattern Like -.Fl p, +.Fl p , but display the last line that matches provided pattern. .It Fl I Ar pattern Fl -ignore-matching-lines Ar pattern Ignores changes, insertions, and deletions whose lines match the @@ -483,7 +486,7 @@ Output at most columns when using side by side format. The default value is 130. Note that unless -.It Fl t +.Fl t was specified, .Nm will always align the second column to a tab stop, so values of @@ -695,7 +698,7 @@ number. .Bl -tag -width DIFFCOLORS .It Ev DIFFCOLORS The value of this variable is the form -.Ar add Ns : Ns Ar rm , +.Ar add : Ns Ar rm , where .Ar add is the ASCII escape sequence for additions and @@ -818,4 +821,5 @@ by a BSD-licensed implementation written by Some GNUisms were lost in the process. .Pp libdiff was imported from the Game of Trees version control system and default -algorithm was changed to Myers for FreeBSD 15. +algorithm was changed to Myers for +.Fx 15 . From nobody Fri Jun 6 13:00:01 2025 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 4bDLy95gHtz5x5tN; Fri, 06 Jun 2025 13:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDLy92BwWz3FMp; Fri, 06 Jun 2025 13:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeVAz7n3M2Y2XpA0Hs4CZOawmeIvfYNByqJ0uQ3MB7E=; b=EqaDLs9fIb9IgCRo7vi+F/wDyLjOpCZTLVo9wb0hIVsyMPZXaz4c21lBSR5qxZzNMZRtjr iWVtSdl4un8ky1orW6b/1Kc5P1cP5oSj5T47nQDkalQvUGlmOQt1A1gLPLRyuRj+dpffdC JILEb5ZicBCjSwmF6hrS/AqfzLSU7FSM+sc6IMhQZ3IsLUPkMfe3yLioNcC0M+I3xArWEM DCkAEZLk1Jlav/UiWE1AyyPa/PxnjX1sjB78uk+1b8erNk5eQe7rIjetxBRSmpiRpTUInW nPJfRyhviZ9nVOR21cB8Q4mq+9Lcw8jDZXCN6Wri/Sr7Hb7UxvTz1+Yt56qw4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeVAz7n3M2Y2XpA0Hs4CZOawmeIvfYNByqJ0uQ3MB7E=; b=pGidNliclRl3i61mJg6F682hKGQgyERbCqD8SLzPsACly/dTX5ob71cNW8EDTY3FFwb5l9 CXSOJwDfyzL0sjT5857pAPtpR/mcoNpraGt4qjzgu85qX8XxYYvzdTCWaiiUC6dEWhV2uz 6oRu8j2ZVkHbUmSQG+C33lxRpcS8FxGwg+MfaXCcOp76JaIY+p+ZP5TCwfsEIXAZW9UU0E OxFmFci3chYFLtLzQsiliGm4kpBvP7JYLZ9IMsXavG5jUrx+rX2ppFyi2SBDfG42cYHSEL qLHQULXND7SsmMbV3DY3A43DwjpAgoWIKjJR1/7cY7HmL8iflDK6IN8E4lwH8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749214801; a=rsa-sha256; cv=none; b=ObRfo6AGtq4TLT9Nf8ytVvEu8g96pQBwZ04GTS+Ovtz7GFqFjGkkshr2TO2UHXj24WfG19 IE9FcBF5x6m+sllnI3f7a4Y3exox82hdtwCoz4HPqlrfxZkQtJlr2LA8OgnwH7RNK4IqRC ZC/X6F+YdcHMIqCLWgZY3eLTdMJrntTWBfzhDr4Xhs5kNgYgQIi5L7EcTAihkV0JMKPGjY 5TgIejnaTPMACvwjfZc38h5x5Sr+keiLZ80V2/ZHfAzDkx0+fSjg3Pd9ZGgUYgAEiAe5uz mvXCf+On2zfxbCNnVIXyIVa79XJdi7vAOjwBIF4egJk2UkqabbF8BzZj7CDqRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDLy91K50zvys; Fri, 06 Jun 2025 13:00:01 +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 556D01Nv074329; Fri, 6 Jun 2025 13:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556D01it074323; Fri, 6 Jun 2025 13:00:01 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:00:01 GMT Message-Id: <202506061300.556D01it074323@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: 834d72b555b5 - main - pf.conf.5: clarify set prio 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: 834d72b555b5cf639b7d643390a0bb4d51e11a2c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=834d72b555b5cf639b7d643390a0bb4d51e11a2c commit 834d72b555b5cf639b7d643390a0bb4d51e11a2c Author: Kristof Provost AuthorDate: 2025-05-28 12:21:28 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 12:59:47 +0000 pf.conf.5: clarify set prio the second prio given applies to 1) TCP ACKs 2) packets with ToS=lowdelay and not TCP ACKs that have ToS=lowdelay confusion discovered during bsdcan pf tutorial Obtained from: OpenBSD, henning , ab995ee558 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index df1e0a99a47e..26ffef6d0471 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 27, 2025 +.Dd May 28, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2234,9 +2234,10 @@ If the packet is transmitted on a .Xr vlan 4 interface, the queueing priority will be written as the priority code point in the 802.1Q VLAN header. -If two priorities are given, packets which have a TOS of +If two priorities are given, TCP ACKs with no data payload and packets +which have a TOS of .Cm lowdelay -and TCP ACKs with no data payload will be assigned to the second one. +will be assigned to the second one. .Pp For example: .Bd -literal -offset indent From nobody Fri Jun 6 13:00:02 2025 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 4bDLyB3kQhz5x5gh; Fri, 06 Jun 2025 13:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDLyB2FBtz3F48; Fri, 06 Jun 2025 13:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=979TTSLufTdghDYjQLMlBlhHn72dOm10+G08rHMX5Qk=; b=J+Bifalb1xiYFRyUHiPeEAOUlCdtLtXY8k2FQeNO/gvcFJHO6M3BlJApY73qc96iDkf9uw xOZty+lFOAmS+db5WGc2BqccyiKnMG+2geHANgTXQOZeZ/DZRzkxPTKAYSxnYrcms30ZHL 5vEKNsd8GXY/f+3lL+4TSn9mOwHiDFJB+xF1D5ZgbscL7cRy1G0bb+TunA2w1JIFL+ckZB lmjBuRBk2kxc18CWhbNFGO/qAnB0zejCrOX1EtknZWBqY4tbuzptvFtPrBlBl1d0sNJ6QU Uu3Z+LZeVZDkxNKT/QZl88v1YODT7pIAU5QK7Ry3lcDcovLNXU9GRKBstYTdPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=979TTSLufTdghDYjQLMlBlhHn72dOm10+G08rHMX5Qk=; b=eu8gco35sgNnLGD7nbsEi9wxoS2bkO8Qr8kEbhDUBy6otA0EvM+ULlGY87NmUVMF7nJVP0 AEU+JbTGtY1tZ4qLoAhVD5rXOsgE9qZ28lA/uOArGZDpEkKRC94fU+gTFdWuldPB5swA+H 8k6uPo/DTjzlUWtfzvnUyyr58JBFTVqze5jS/nCtc9feX3uYTGPMg+nhC0XibD//lEo2fQ 6ZjUnrXtSrqBHJQg/COQ8f0xSYeDk+qoYVEqV2btoLuWCVSq8sN/AvmC2plPezaJK7ariw 3hGsMGaun2X/i1SInXa87pgzE96kGIWC7Y3XN4rC0a53E3IVyA5CU3gjmeFPdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749214802; a=rsa-sha256; cv=none; b=IyDuJRDGNgrZioOdhNDdFHLB5QW/PgFlTAhBs8D/Q1YKw8URr06zsY6/0FUJK9snQfJc1s jduwUxxMdTmG7mf1kRTALqhoqtWSso8PulHcOfm0ptvmB0oUO+XhRvjBbNYGRsDuY6fImj Vgq7FVFQUIS0d0FyO4hl72rw7rYzoRty0FY9h3XkOfAj+RhXy0+ivX+L71pdztPlHr2Nyk pVGGL7VLiIaT1Fu8a8bXm58eOZUhFM+HGIzMW8B1PG3qhC89DKYFmAxQW07trQnbnVkaW3 Wz0r0BYOlFhUu9P8qKcsFvS8CqMqu2w6CuWEfHbMs87whNMzukbwx8ci0x8VNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDLyB1mJMzwSD; Fri, 06 Jun 2025 13:00: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 556D02cj074910; Fri, 6 Jun 2025 13:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556D02uC074900; Fri, 6 Jun 2025 13:00:02 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:00:02 GMT Message-Id: <202506061300.556D02uC074900@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: 6ea237c31eff - main - pf.conf.5: clarify filter evaluation and anchor loading 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: 6ea237c31effadc739163ccfcf595b1b5e2f0a60 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6ea237c31effadc739163ccfcf595b1b5e2f0a60 commit 6ea237c31effadc739163ccfcf595b1b5e2f0a60 Author: Kristof Provost AuthorDate: 2025-05-29 12:21:45 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 12:59:47 +0000 pf.conf.5: clarify filter evaluation and anchor loading * Clarify that filter rules are evaluated once per packet and interface, not only once per packet. * Clarify that the syntax anchor "name" { ... } both loads and evaluates the anchor, rather than merely loading it. Triggered by questions from Benedikt Neuffer . OK mikeb@ Obtained from: OpenBSD, schwarze , 7528bd0ba2 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 26ffef6d0471..a9fd9e8b29e1 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 28, 2025 +.Dd May 29, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -703,8 +703,9 @@ and .Ar pass packets based on attributes of their Ethernet (layer 2) header. .Pp -For each packet processed by the packet filter, the filter rules are -evaluated in sequential order, from first to last. +Each time a packet processed by the packet filter comes in on or +goes out through an interface, the filter rules are evaluated in +sequential order, from first to last. The last matching rule decides what action is taken. If no rule matches the packet, the default action is to pass the packet without creating a state. @@ -3063,12 +3064,13 @@ anchor, if any, before finally evaluating the .Ar pass rule. .Pp -Filter rule -.Ar anchors -can also be loaded inline in the ruleset within a brace ('{' '}') delimited -block. +An +.Ar anchor +rule can also contain a filter ruleset in a brace-delimited block. +In that case, no separate loading of rules into the anchor +is required. Brace delimited blocks may contain rules or other brace-delimited blocks. -When anchors are loaded this way the anchor name becomes optional. +When an anchor is populated this way the anchor name becomes optional. .Bd -literal -offset indent anchor "external" on $ext_if { block From nobody Fri Jun 6 13:00:03 2025 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 4bDLyC4hnNz5x5rC; Fri, 06 Jun 2025 13:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDLyC2xf8z3FQW; Fri, 06 Jun 2025 13:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jb+7DVm9+mXm/4np6ZHgv4Cdz1C8z69cU1sqF72D52E=; b=hz7V4kTkVNeh73sB1EJR3wSagFjVEjuJYMCWKiPdPjzegbxD3esqFCrYYkgo6c70ds9zVM lWB65UyeCDaQsILkwiXYu3/FE53i4rlqubd4OZEaWo+CbbC6m1lS2JeciFJGfDNF/2uJb/ lEZCCEdf1RDF6nt255Y8m/6zmHMgGESflg1ymp4WEl6J3jobq9fBRbuOe6N6BjqbtaRKwE eP9yUDxVoKbxjH9ThN7J8IiXXfkz+JrOZ9nF1noFANH7f4Ko4ds0YvwunvlLltHy2hVOyu XzHIoMUY8yiY2cnWgfCjLVj2dcifQT81iUq6X58SNjeJMXPQMahdw6UA9n4kgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749214803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jb+7DVm9+mXm/4np6ZHgv4Cdz1C8z69cU1sqF72D52E=; b=xb9/7Z+A8ntWxGVS4iOnajzQeFS9x462xD8lPB3QxTg5WB0ZeiLY7dhtkC5VRpAGo5cb9A IC51i3NDbaeLV+i5msJbgzGaeWy8UMZ8JvV5PHBzex2j+MAAJJuRh8MM90t6G2b4GcSwVV 0sX4wYAp7q6yk/CEHx0OZAqzcXK4kbj4oM7h3K/oMHGJco8Rn5qY7cQ91ISwjPz9eKIZ2m hJHXHJ9jbWl5+KKTSo+sVubfopnywZM/LXDd3QoKNO8vLuRw/JONfH4pWESLWp/QbuzL5C xY5vNs+4yv+BTXmaCWkuC5lbPY1WBe4wIAsR7sCJT3iFFyhTywBfPvWf7XQnVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749214803; a=rsa-sha256; cv=none; b=Rfl3cxlts/QQciMhDxMoIw7rnv3f8dXoJCxFVOk4xcUGG7BEElBbJ87NpT5gW9/vBDAl4U Jpmq4PnpSvY5cC5wWTkKYc+4iZMBX37Bu7zF7Q3Y5m3WnCRnXoukmgUC3wQNryzYlXp+xn PUQ1jVw/ZzZsxnM2yLwqcuo6s0RO+8ArbTp8g5jzAGWNkg7sO0kqbstqq7wBUpU10aOYJs r2TJX0BuWYXJ7H1iBDxAtGQ0EhPBcRewS3F4OIm3cNnCKHRnUfmKRTK4Ca62zsEmlDsk3Z ESgaBFJa6hLtEYEElQHjw9zd4NsaeDA9wkbv9qZOcNhO27jv0qFX+tx0Tlxfjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDLyC2Gjnzvyt; Fri, 06 Jun 2025 13:00:03 +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 556D03fQ075483; Fri, 6 Jun 2025 13:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556D03Ug075477; Fri, 6 Jun 2025 13:00:03 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:00:03 GMT Message-Id: <202506061300.556D03Ug075477@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: feac17714fdf - main - pfctl: void functions and exit(3) on error 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: feac17714fdf23d8cda5c552d6edd8e12ff9a43f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=feac17714fdf23d8cda5c552d6edd8e12ff9a43f commit feac17714fdf23d8cda5c552d6edd8e12ff9a43f Author: Kristof Provost AuthorDate: 2025-05-29 12:28:54 +0000 Commit: Kristof Provost CommitDate: 2025-06-06 12:59:47 +0000 pfctl: void functions and exit(3) on error Changes: voided: - pfctl_do_clear_tables - pfctl_show_tables - pfctl_show_ifaces Those functions now exit(3) in case of error instead of passing it up to the callers (where it was ignored). OK mikeb@, sashan@ Obtained from: OpenBSD, awolk , c5e9690e42 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.h | 6 +++--- sbin/pfctl/pfctl_table.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index b4f8c97854d1..7df56499ea16 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -81,13 +81,13 @@ int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); void pfctl_print_title(char *); -int pfctl_do_clear_tables(const char *, int); -int pfctl_show_tables(const char *, int); +void pfctl_do_clear_tables(const char *, int); +void pfctl_show_tables(const char *, int); int pfctl_command_tables(int, char *[], char *, const char *, char *, const char *, int); int pfctl_show_altq(int, const char *, int, int); void warn_namespace_collision(const char *); -int pfctl_show_ifaces(const char *, int); +void pfctl_show_ifaces(const char *, int); void pfctl_show_creators(int); FILE *pfctl_fopen(const char *, const char *); diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 834f74811ea2..f23a62f518e1 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -104,16 +104,18 @@ static const char *istats_text[2][2][2] = { table.pfrt_flags &= ~PFR_TFLAG_PERSIST; \ } while(0) -int +void pfctl_do_clear_tables(const char *anchor, int opts) { - return pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts); + if (pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts)) + exit(1); } -int +void pfctl_show_tables(const char *anchor, int opts) { - return pfctl_table(0, NULL, NULL, "-s", NULL, anchor, opts); + if (pfctl_table(0, NULL, NULL, "-s", NULL, anchor, opts)) + exit(1); } int @@ -644,7 +646,7 @@ xprintf(int opts, const char *fmt, ...) /* interface stuff */ -int +void pfctl_show_ifaces(const char *filter, int opts) { struct pfr_buffer b; @@ -657,7 +659,7 @@ pfctl_show_ifaces(const char *filter, int opts) b.pfrb_size = b.pfrb_msize; if (pfi_get_ifaces(filter, b.pfrb_caddr, &b.pfrb_size)) { radix_perror(); - return (1); + exit(1); } if (b.pfrb_size <= b.pfrb_msize) break; @@ -666,7 +668,6 @@ pfctl_show_ifaces(const char *filter, int opts) pfctl_print_title("INTERFACES:"); PFRB_FOREACH(p, &b) print_iface(p, opts); - return (0); } void From nobody Fri Jun 6 13:57:02 2025 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 4bDNCz1fHzz5x9tX; Fri, 06 Jun 2025 13:57: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 4bDNCz15Fkz3m7h; Fri, 06 Jun 2025 13:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/TU/tsx6lbMKq6rofcxVtVw6niaThV3cqjKQUqLrVs=; b=r3maV+qZMeGUT6cxzD9Aw2YTjQsK48jummcVp+3jr27aHoiFnhFe+ZNK8bbLr+8u50QH83 wl8SJhg1SM3L1Q75PbjXyjmIwEWW589rbqWoo4QtNvwJ3ZMbT/SVr453QKwmmVPlars6f8 Q8ul/GdfqHAGAJLZw7wx4KFla+u4wow6eiVxNQWkyLdgzlFx6AkSIdpDwvL7K0283T0F8r eVJfqLUY9BR3+EPLb6Ex161PaiUTt98H+YaJ4yGa/mZVAGCMSJwAwaNXPNYW+kleuFNvvs OEVj9xyKs2qQ6epHQ1eCNcdiEyb7OXtdVaDC0c2fkb7g60k2B2lPl0LOdmJMqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/TU/tsx6lbMKq6rofcxVtVw6niaThV3cqjKQUqLrVs=; b=BvW9hZtxWU/1rToen23Hf7W4t7VFDTuAGrYTpgcu414YxYHSek+dViNAjfiJJ2pY8jvHCZ GgEQFXctRXkJLwu7/WYY013tWBhmLYtGJFYSTU0Km8+AQPkL6rMR7lqFgIf/H33DXuW+Qy prdhbYVeuW3R0DpZrpZmPWTgGs7rF8StFkogjlNhr0rezg4+hikYU5UkH1umL25GtHr7Nw T0RSoPn8nWAHYMuSquE/UHQr8esCHn+NIB1BiMruPnB/prtB2slPOIhsFdwn5y9uLVxqdC VxUPgHwGgqJBZ3ZeaC6IUAMh6KhjWy4Hoki4ktz/PVmRPneOe7NABwfqBly9QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218223; a=rsa-sha256; cv=none; b=kI5YzztVhy9EXF6m7ZDsY/AgA6yZ2W4KaMs7jyqnjBpRtITNGEUQpTtJmE73/TfU/v9hh8 G2JHt0esPiM9IgaYGGYDnM3poZi9R9IntWaRBtp6JnEC1gcwH4zVblK7qeNz1dCYySFR+z Fi+QznGjCOsLsY0tPZTFi53hw4cgnCc/amuvyf8ZeKTgOkB9nPsUbW2oVVOuAFGi1BU1oQ N3MXbEjoyfMk6SxmWb+Oijb+lxAqSv3QJJZHoxRZC6cS2UtjQR0DyVprI/DWLPleW+1KCE XkUVig106irpjLvolOCbGkWHZUYSK03ilkB7UQKHSGC4lXcBITvsKktFMOO1OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDNCz0Zkxzy1L; Fri, 06 Jun 2025 13:57:03 +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 556Dv3OV083882; Fri, 6 Jun 2025 13:57:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv2Z6083879; Fri, 6 Jun 2025 13:57:02 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:02 GMT Message-Id: <202506061357.556Dv2Z6083879@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: 25f09d4a9c35 - main - qat: fix typos and formatting issues 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: 25f09d4a9c358c5452435d299e00c1a1bdafff87 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=25f09d4a9c358c5452435d299e00c1a1bdafff87 commit 25f09d4a9c358c5452435d299e00c1a1bdafff87 Author: Hareshx Sankar Raj AuthorDate: 2025-04-29 23:13:11 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:42:31 +0000 qat: fix typos and formatting issues Multiple typos are corrected across the source code. Formatting corrections are done to improve code quality and maintainability. Some files which did not have proper Copyright license are updated. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/include/common/adf_uio_cleanup.h | 3 +- sys/dev/qat/include/common/adf_uio_control.h | 3 +- sys/dev/qat/qat/qat_ocf.c | 3 +- .../qat/qat_api/common/compression/dc_datapath.c | 12 +---- .../common/crypto/sym/include/lac_session.h | 26 ++++----- .../qat_api/common/crypto/sym/include/lac_sym.h | 12 ++--- .../common/crypto/sym/include/lac_sym_alg_chain.h | 7 +-- .../qat_api/common/crypto/sym/include/lac_sym_cb.h | 6 +-- .../common/crypto/sym/include/lac_sym_cipher.h | 6 +-- .../common/crypto/sym/include/lac_sym_hash.h | 13 ++--- .../common/crypto/sym/include/lac_sym_hash_defs.h | 4 +- .../crypto/sym/include/lac_sym_hash_precomputes.h | 6 +-- .../common/crypto/sym/include/lac_sym_key.h | 21 ++++---- .../common/crypto/sym/include/lac_sym_partial.h | 4 +- .../common/crypto/sym/include/lac_sym_qat.h | 4 +- .../common/crypto/sym/include/lac_sym_qat_cipher.h | 4 +- .../common/crypto/sym/include/lac_sym_qat_hash.h | 6 +-- .../sym/include/lac_sym_qat_hash_defs_lookup.h | 4 +- .../common/crypto/sym/include/lac_sym_stats.h | 6 +-- .../qat_api/common/crypto/sym/key/lac_sym_key.c | 22 +++----- .../qat_api/common/crypto/sym/lac_sym_alg_chain.c | 10 ++-- .../qat/qat_api/common/crypto/sym/lac_sym_api.c | 14 ++--- .../qat_api/common/crypto/sym/lac_sym_auth_enc.c | 3 +- sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c | 15 +++--- .../qat/qat_api/common/crypto/sym/lac_sym_cipher.c | 7 ++- .../common/crypto/sym/lac_sym_compile_check.c | 7 +-- sys/dev/qat/qat_api/common/crypto/sym/lac_sym_dp.c | 7 +-- .../qat/qat_api/common/crypto/sym/lac_sym_hash.c | 3 +- .../crypto/sym/lac_sym_hash_sw_precomputes.c | 4 +- .../qat/qat_api/common/crypto/sym/lac_sym_queue.c | 4 +- .../qat_api/common/crypto/sym/qat/lac_sym_qat.c | 6 +-- .../common/crypto/sym/qat/lac_sym_qat_cipher.c | 23 ++++---- .../crypto/sym/qat/lac_sym_qat_hash_defs_lookup.c | 8 +-- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 22 +------- sys/dev/qat/qat_api/common/include/lac_common.h | 3 +- sys/dev/qat/qat_api/common/include/lac_hooks.h | 4 +- sys/dev/qat/qat_api/common/include/lac_mem.h | 6 +-- sys/dev/qat/qat_api/common/include/lac_mem_pools.h | 14 ++--- sys/dev/qat/qat_api/common/include/lac_sal.h | 10 ++-- sys/dev/qat/qat_api/common/include/lac_sal_types.h | 6 +-- .../qat/qat_api/common/include/sal_qat_cmn_msg.h | 4 +- .../qat/qat_api/common/qat_comms/sal_qat_cmn_msg.c | 4 +- sys/dev/qat/qat_api/common/utils/lac_buffer_desc.c | 6 +-- sys/dev/qat/qat_api/firmware/include/icp_qat_fw.h | 7 ++- .../qat/qat_api/firmware/include/icp_qat_fw_comp.h | 15 ++---- .../qat/qat_api/firmware/include/icp_qat_fw_la.h | 10 ++-- .../qat/qat_api/firmware/include/icp_qat_fw_mmp.h | 14 +++-- .../qat_api/firmware/include/icp_qat_fw_mmp_ids.h | 5 +- .../qat/qat_api/firmware/include/icp_qat_fw_pke.h | 4 +- sys/dev/qat/qat_api/firmware/include/icp_qat_hw.h | 6 +-- .../qat_api/firmware/include/icp_qat_hw_20_comp.h | 3 +- sys/dev/qat/qat_api/include/cpa.h | 12 ++--- sys/dev/qat/qat_api/include/cpa_dev.h | 18 +++---- sys/dev/qat/qat_api/include/cpa_types.h | 12 ++--- sys/dev/qat/qat_api/include/dc/cpa_dc.h | 23 ++++---- sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h | 14 ++--- sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h | 56 +++++++++---------- sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h | 12 ++--- sys/dev/qat/qat_api/include/icp_buffer_desc.h | 9 ++-- sys/dev/qat/qat_api/include/icp_sal_user.h | 6 +-- sys/dev/qat/qat_api/include/lac/cpa_cy_common.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h | 20 +++---- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_im.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_key.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h | 20 +++---- sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 62 ++++++++++++---------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 16 +++--- .../qat_api/qat_direct/include/icp_accel_devices.h | 4 +- .../qat/qat_api/qat_direct/include/icp_adf_init.h | 4 +- .../qat_kernel/src/lac_adf_interface_freebsd.c | 6 +-- sys/dev/qat/qat_api/qat_utils/include/qat_utils.h | 7 ++- .../qat/qat_api/qat_utils/src/QatUtilsServices.c | 4 +- sys/dev/qat/qat_common/qat_uclo.c | 1 + 80 files changed, 385 insertions(+), 467 deletions(-) diff --git a/sys/dev/qat/include/common/adf_uio_cleanup.h b/sys/dev/qat/include/common/adf_uio_cleanup.h index 8f1132181355..876843cd9aa8 100644 --- a/sys/dev/qat/include/common/adf_uio_cleanup.h +++ b/sys/dev/qat/include/common/adf_uio_cleanup.h @@ -1,10 +1,9 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2023 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_UIO_CLEANUP_H #define ADF_UIO_CLEANUP_H void adf_uio_do_cleanup_orphan(int bank, struct adf_uio_control_accel *accel); - #endif diff --git a/sys/dev/qat/include/common/adf_uio_control.h b/sys/dev/qat/include/common/adf_uio_control.h index 4662c02233b6..032baa9b54c2 100644 --- a/sys/dev/qat/include/common/adf_uio_control.h +++ b/sys/dev/qat/include/common/adf_uio_control.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2023 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef QAT_UIO_CONTROL_H #define QAT_UIO_CONTROL_H #include @@ -38,5 +38,4 @@ struct adf_uio_control_accel { }; - #endif /* end of include guard: QAT_UIO_CONTROL_H */ diff --git a/sys/dev/qat/qat/qat_ocf.c b/sys/dev/qat/qat/qat_ocf.c index 3ec8f802f324..afdc5f396c80 100644 --- a/sys/dev/qat/qat/qat_ocf.c +++ b/sys/dev/qat/qat/qat_ocf.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* System headers */ #include #include @@ -1280,7 +1280,6 @@ static driver_t qat_ocf_driver = { .size = sizeof(struct qat_ocf_softc), }; - DRIVER_MODULE_ORDERED(qat, nexus, qat_ocf_driver, diff --git a/sys/dev/qat/qat_api/common/compression/dc_datapath.c b/sys/dev/qat/qat_api/common/compression/dc_datapath.c index de14be2fdb0d..f5a8600eadfa 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_datapath.c +++ b/sys/dev/qat/qat_api/common/compression/dc_datapath.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** * @file dc_datapath.c @@ -523,7 +523,7 @@ dcCheckOpData(sal_compression_service_t *pService, CpaDcOpData *pOpData) if (CPA_TRUE == pOpData->integrityCrcCheck && NULL == pOpData->pCrcData) { LAC_INVALID_PARAM_LOG("Integrity CRC data structure " - "not intialized in CpaDcOpData"); + "not initialized in CpaDcOpData"); return CPA_STATUS_INVALID_PARAM; } @@ -1401,7 +1401,6 @@ cpaDcCompressData(CpaInstanceHandle dcInstance, CpaInstanceHandle insHandle = NULL; Cpa64U srcBuffSize = 0; - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1507,7 +1506,6 @@ cpaDcCompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if ((CPA_TRUE == pOpData->compressAndVerify) && (CPA_TRUE == pOpData->compressAndVerifyAndRecover) && (CPA_FALSE == pOpData->integrityCrcCheck)) { @@ -1526,7 +1524,6 @@ cpaDcCompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_UNSUPPORTED; } - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1703,7 +1700,6 @@ dcDecompressDataCheck(CpaInstanceHandle insHandle, return CPA_STATUS_INVALID_PARAM; } - *srcBufferSize = srcBuffSize; return CPA_STATUS_SUCCESS; @@ -1724,7 +1720,6 @@ cpaDcDecompressData(CpaInstanceHandle dcInstance, Cpa64U srcBuffSize = 0; CpaStatus status = CPA_STATUS_SUCCESS; - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1783,7 +1778,6 @@ cpaDcDecompressData(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if (CPA_DC_STATEFUL == pSessionDesc->sessState) { /* Lock the session to check if there are in-flight stateful * requests */ @@ -1864,7 +1858,6 @@ cpaDcDecompressData2(CpaInstanceHandle dcInstance, callbackTag); } - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1931,7 +1924,6 @@ cpaDcDecompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if (CPA_DC_STATEFUL == pSessionDesc->sessState) { /* Lock the session to check if there are in-flight stateful * requests */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h index afb3994daad7..6c9de34e7691 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -56,7 +56,7 @@ * while there are requests in flight. * * Reference Count\n - * - The perform funcion increments the reference count for the session. + * - The perform function increments the reference count for the session. * - The callback function decrements the reference count for the session. * - The Remove function checks the reference count to ensure that it is 0. * @@ -256,14 +256,14 @@ typedef struct lac_session_desc_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -442,14 +442,14 @@ typedef struct lac_session_desc_d1_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -594,14 +594,14 @@ typedef struct lac_session_desc_d2_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -625,7 +625,7 @@ typedef struct lac_session_desc_d2_s { sizeof(LAC_ARCH_UINT)) /**< @ingroup LacSym_Session * Size of the memory that the client has to allocate for a session. Extra - * memory is needed to internally re-align the data. The pointer to the algined + * memory is needed to internally re-align the data. The pointer to the aligned * data is stored at the start of the user allocated memory hence the extra * space for an LAC_ARCH_UINT */ @@ -669,7 +669,7 @@ typedef struct lac_session_desc_d2_s { * * @param[in] instanceHandle_in Instance Handle * @param[in] pSymCb callback function -* @param[in] pSessionSetupData pointer to the strucutre containing the setup +* @param[in] pSessionSetupData pointer to the structure containing the setup *data * @param[in] isDpSession CPA_TRUE for a data plane session * @param[out] pSessionCtx Pointer to session context diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h index 3eb41432aced..f7468b5d20dd 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -18,7 +18,7 @@ * The symmetric component demuliplexes the following crypto operations to * the appropriate sub-components: cipher, hash, algorithm chaining and * authentication encryption. It is a common layer between the above - * mentioned components where common resources are allocated and paramater + * mentioned components where common resources are allocated and parameter * checks are done. The operation specific resource allocation and parameter * checks are done in the sub-component itself. * @@ -32,15 +32,15 @@ * chain to ensure it is valid. * - \ref LacSymStats "Statistics": Manages statistics for symmetric * - \ref LacSymQat "Symmetric QAT": The symmetric qat component is - * initialiased by the symmetric component. - * - \ref LacCipher "Cipher" : demultiplex cipher opertions to this component. - * - \ref LacHash "Hash" : demultiplex hash opertions to this component. + * initialised by the symmetric component. + * - \ref LacCipher "Cipher" : demultiplex cipher operations to this component. + * - \ref LacHash "Hash" : demultiplex hash operations to this component. * to this component. * - \ref LacAlgChain "Algorithm Chaining": The algorithm chaining component * - OSAL : Memory allocation, Mutex's, atomics * * @lld_initialisation - * This component is initialied during the LAC initialisation sequence. It + * This component is initialized during the LAC initialisation sequence. It * initialises the session table, statistics, symmetric QAT, initialises the * hash definitions lookup table, the hash alg supported lookup table and * registers a callback function with the symmetric response handler to process diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h index 1750fd0bebf4..095b7a426732 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h index 58caa321c410..703fa92b614a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -21,7 +21,7 @@ * Dequeue pending requests * @description * This function is called by a callback function of a blocking - * operation (either a partial packet or a hash precompute operaion) + * operation (either a partial packet or a hash precompute operation) * in softIRQ context. It dequeues requests for the following reasons: * 1. All pre-computes that happened when initialising a session * have completed. Dequeue any requests that were queued on the @@ -40,7 +40,7 @@ CpaStatus LacSymCb_PendingReqsDequeue(lac_session_desc_t *pSessionDesc); /** ***************************************************************************** * @ingroup LacSym - * Register symmetric callback funcion handlers + * Register symmetric callback function handlers * * @description * This function registers the symmetric callback handler functions with diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h index 3ae237939b2c..c3d8203dd8b0 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -23,14 +23,14 @@ * and Triple-DES cipher algorithms, in ECB, CBC and CTR modes. The ARC4 stream * cipher algorithm is also supported. Data may be provided as a full packet, * or as a sequence of partial packets. The result of the operation can be - * written back to the source buffer (in-place) or to a seperate output buffer + * written back to the source buffer (in-place) or to a separate output buffer * (out-of-place). Data must be encapsulated in ICP buffers. * * The cipher component is responsible for implementing the cipher-specific * functionality for registering and de-registering a session, for the perform * operation and for processing the QAT responses to cipher requests. Statistics * are maintained for cipher in the symmetric \ref CpaCySymStats64 "stats" - * structure. This module has been seperated out into two. The cipher QAT module + * structure. This module has been separated out into two. The cipher QAT module * deals entirely with QAT data structures. The cipher module itself has minimal * exposure to the QAT data structures. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h index 4451e91ea5d6..19f6f5ddc69a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -24,7 +21,7 @@ * * The hash component supports hashing in 3 modes. PLAIN, AUTH and NESTED. * Plain mode is used to provide data integrity while auth mode is used to - * provide integrity as well as its authenticity. Nested mode is inteded + * provide integrity as well as its authenticity. Nested mode is intended * for use by non standard HMAC like algorithms such as for the SSL master * key secret. Partial packets is supported for both plain and auth modes. * In-place and out-of-place processing is supported for all modes. The @@ -33,7 +30,7 @@ * The hash component is responsible for implementing the hash specific * functionality for initialising a session and for a perform operation. * Statistics are maintained in the symmetric \ref CpaCySymStats64 "stats" - * structure. This module has been seperated out into two. The hash QAT module + * structure. This module has been separated out into two. The hash QAT module * deals entirely with QAT data structures. The hash module itself has minimal * exposure to the QAT data structures. * @@ -62,7 +59,7 @@ * the data path by the length of time it takes to do two hashes on a block * size of data. Note: a partial packet operation generates an intermediate * state. The final operation on a partial packet or when a full packet is - * used applies padding and gives the final hash result. Esentially for the + * used applies padding and gives the final hash result. Essentially for the * inner hash, a partial packet final is issued on the data, using the * precomputed intermediate state and returns the digest. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h index 6ebdcf659360..de9e74b31577 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -313,7 +313,7 @@ /**< @ingroup LacSymQatHash * Macro to check for qat hash mode is set to 2 and the hash mode is * Auth. This applies to HMAC algorithms (no pre compute). This is used - * to differntiate between TLS and HMAC */ + * to differentiate between TLS and HMAC */ #define IS_HASH_MODE_2_NESTED(qatHashMode, hashMode) \ ((IS_HASH_MODE_2(qatHashMode)) && \ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h index cdb252fb5b46..cf5e21a14c5f 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -34,7 +34,7 @@ /**< maximum size of the working data for the HMAC precompute operations * * Maximum size of lac_sym_hash_precomp_op_data_t is 264 bytes. For hash - * precomputes there are 2 of these structrues and a further + * precomputes there are 2 of these structures and a further * lac_sym_hash_precomp_op_t structure required. This comes to a total of 536 * bytes. * For the asynchronous version of the precomputes, the memory for the hash @@ -122,7 +122,7 @@ typedef struct lac_sym_hash_aes_precomp_qat_s { Cpa8U contentDesc[LAC_SYM_QAT_MAX_CIPHER_SETUP_BLK_SZ]; /**< Content descriptor for a cipher operation */ Cpa8U data[LAC_SYM_HASH_PRECOMP_MAX_AES_ECB_DATA]; - /**< The data to be ciphered is conatined here and the result is + /**< The data to be ciphered is contained here and the result is * written in place back into this buffer */ icp_qat_fw_la_cipher_req_params_t cipherReqParams; /**< Request parameters as read in by the QAT */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h index bae0d8faabc7..25c919d9b38d 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -16,7 +13,7 @@ * * @lld_overview * - * Key generation component is reponsible for SSL, TLS & MGF operations. All + * Key generation component is responsible for SSL, TLS & MGF operations. All * memory required for the keygen operations is got from the keygen cookie * structure which is carved up as required. * @@ -24,8 +21,8 @@ * outer hash and SHA1 as the inner hash. * * Refer to sections in draft-freier-ssl-version3-02.txt: - * 6.1 Asymmetric cryptographic computations - This refers to coverting - * the pre master secret to the master secret. + * 6.1 Asymmetric cryptographic computations - This refers to converting + * the pre-master secret to the master secret. * 6.2.2 Converting the master secret into keys and MAC secrets - Using * the master secret to generate the key material. * @@ -40,11 +37,11 @@ * * @lld_dependencies * \ref LacSymQatHash: for building up hash content descriptor - * \ref LacMem: for virt to phys coversions + * \ref LacMem: for virt to phys conversions * * @lld_initialisation - * The reponse handler is registered with Symmetric. The Maximum SSL is - * allocated. A structure is allocated containing all the TLS lables that + * The response handler is registered with Symmetric. The Maximum SSL is + * allocated. A structure is allocated containing all the TLS labels that * are supported. On shutdown the memory for these structures are freed. * * @lld_module_algorithms @@ -115,7 +112,7 @@ * * @description * This structure is used to hold the various TLS labels. Each field is - * on an 8 byte boundary provided the structure itslef is 8 bytes aligned. + * on an 8 byte boundary provided the structure itself is 8 bytes aligned. *****************************************************************************/ typedef struct lac_sym_key_tls_labels_s { Cpa8U masterSecret[ICP_QAT_FW_LA_TLS_LABEL_LEN_MAX]; diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h index 3f6c75ca7fb7..633d1c7afa96 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -20,7 +20,7 @@ * proceed where they would get an incorrect digest, cipher result. * * Maintain a SpinLock for partials in flight per session. Try and acquire this - * SpinLock. If it cant be acquired return an error straight away to the client + * SpinLock. If it can't be acquired return an error straight away to the client * as there is already a partial in flight. There is no blocking in the data * path for this. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h index 986e230dc1ff..dc72601bae44 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -24,7 +24,7 @@ * - \ref LacMem "Memory" - Inline memory functions * * @lld_initialisation - * This component is initialied during the LAC initialisation sequence. It + * This component is initialized during the LAC initialisation sequence. It * is called by the Symmetric Initialisation function. * * @lld_module_algorithms diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h index 2f1d36dcd669..2f4a4511f4fc 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -172,7 +172,7 @@ void LacSymQat_CipherXTSModeUpdateKeyLen(lac_session_desc_t *pSessionDesc, * LacSymQat_CipherCtrlBlockInitialize() * * @description - * intialize the cipher control block with all zeros + * initialize the cipher control block with all zeros * * @param[in] pMsg Pointer to the common request message * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h index 38c5892b0cc4..51a215ffc72a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -42,7 +42,7 @@ * hash precomputes * * @description - * This structure contains infomation on the hash precomputes + * This structure contains information on the hash precomputes * *****************************************************************************/ typedef struct lac_sym_qat_hash_precompute_info_s { @@ -62,7 +62,7 @@ typedef struct lac_sym_qat_hash_precompute_info_s { * hash state prefix buffer info * * @description - * This structure contains infomation on the hash state prefix aad buffer + * This structure contains information on the hash state prefix aad buffer * *****************************************************************************/ typedef struct lac_sym_qat_hash_state_buffer_info_s { diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h index decc5d8c491b..050dd42ba9b2 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -117,7 +117,7 @@ void LacSymQat_HashAlgLookupGet(CpaInstanceHandle instanceHandle, /** ******************************************************************************* * @ingroup LacSymQatHashDefsLookup -* get hash defintions from lookup table. +* get hash definitions from lookup table. * * @description * This function looks up the hash lookup array for a structure diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h index 96f579b26c4c..ac7439713681 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -9,7 +9,7 @@ * * @ingroup LacSym * - * Symetric Common consists of common statistics, buffer and partial packet + * Symmetric Common consists of common statistics, buffer and partial packet * functionality. * ***************************************************************************/ @@ -123,7 +123,7 @@ void LacSym_StatsFree(CpaInstanceHandle instanceHandle); /** ******************************************************************************* * @ingroup LacSymStats -* Inrement a stat +* Increment a stat * * @description * This function incrementes a stat for a specific engine. diff --git a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c index cab8d6c7796c..965874e7466f 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -365,7 +362,6 @@ cpaCyKeyGenQueryStats(CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -393,7 +389,6 @@ cpaCyKeyGenQueryStats64(CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -917,7 +912,6 @@ cpaCyKeyGenMgf(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -956,7 +950,6 @@ cpaCyKeyGenMgfExt(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2194,11 +2187,11 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, /* Api max value */ /* ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX needs to be * multiplied - * by 4 in order to verifiy the 512 conditions. We did + * by 4 in order to verify the 512 conditions. We did * not change * ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX as it * represents - * the max value tha firmware can handle. + * the max value that firmware can handle. */ maxSecretLen = ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX * 4; @@ -2206,11 +2199,11 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, /* Api max value */ /* ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX needs to be * multiplied - * by 8 in order to verifiy the 512 conditions. We did + * by 8 in order to verify the 512 conditions. We did * not change * ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX as it * represents - * the max value tha firmware can handle. + * the max value that firmware can handle. */ maxSecretLen = ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX * 8; @@ -2596,7 +2589,6 @@ cpaCyKeyGenTls(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2669,7 +2661,6 @@ cpaCyKeyGenTls2(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2756,7 +2747,6 @@ cpaCyKeyGenTls3(const CpaInstanceHandle instanceHandle_in, return CPA_STATUS_INVALID_PARAM; } - return LacSymKey_KeyGenSslTls(instanceHandle_in, pKeyGenCb, pCallbackTag, diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c index 5b4ebdc85654..56f211025103 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -403,7 +400,6 @@ LacAlgChain_HashCDBuild( &sizeInBytes); } } - static Cpa16U LacAlgChain_GetCipherConfigSize(lac_session_desc_t *pSessionDesc) { @@ -1178,7 +1174,7 @@ LacAlgChain_SessionInit(const CpaInstanceHandle instanceHandle, &cipherOffsetInConstantsTable, &hashOffsetInConstantsTable); - /* for a certain combination of Algorthm Chaining we want to + /* for a certain combination of Algorithm Chaining we want to use an optimised cd block */ if (pSessionDesc->symOperation == diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c index a0891278cb52..6f330835902c 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -336,7 +336,6 @@ LacSymSession_ParamCheck(const CpaInstanceHandle instanceHandle, return CPA_STATUS_SUCCESS; } - /** * @ingroup LacSym * Function which perform parameter checks on data buffers for symmetric @@ -445,7 +444,7 @@ LacSymPerform_BufferParamCheck(const CpaBufferList *const pSrcBuffer, } } - /* check for partial packet suport for the session operation */ + /* check for partial packet support for the session operation */ if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { if (CPA_FALSE == pSessionDesc->isPartialSupported) { /* return out here to simplify cleanup */ @@ -569,7 +568,6 @@ LacSym_InitSession(const CpaInstanceHandle instanceHandle, return CPA_STATUS_INVALID_PARAM; } - pCipherSetupData = &pSessionSetupData->cipherSetupData; pHashSetupData = &pSessionSetupData->hashSetupData; @@ -673,7 +671,6 @@ cpaCySymRemoveSession(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; Cpa64U numPendingRequests = 0; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -794,7 +791,6 @@ LacSym_Perform(const CpaInstanceHandle instanceHandle, } } - /* If synchronous Operation - Callback function stored in the session * descriptor so a flag is set in the perform to indicate that * the perform is being re-called for the synchronous operation */ @@ -872,7 +868,7 @@ LacSym_Perform(const CpaInstanceHandle instanceHandle, pVerifyResult); if (CPA_STATUS_SUCCESS == status) { - /* check for partial packet suport for the session operation */ + /* check for partial packet support for the session operation */ if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { LacSym_PartialPacketStateUpdate( pOpData->packetType, &pSessionDesc->partialState); @@ -923,7 +919,6 @@ cpaCySymQueryStats(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -955,7 +950,6 @@ cpaCySymQueryStats64(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -1037,7 +1031,6 @@ cpaCySymSessionCtxGetDynamicSize( /* Choose Session Context size */ getCtxSize(pSessionSetupData, pSessionCtxSizeInBytes); - return CPA_STATUS_SUCCESS; } @@ -1116,6 +1109,5 @@ cpaCyBufferListGetMetaSize(const CpaInstanceHandle instanceHandle_in, (sizeof(icp_flat_buffer_desc_t) * numBuffers) + ICP_DESCRIPTOR_ALIGNMENT_BYTES; - return CPA_STATUS_SUCCESS; } diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c index dd018a25a88c..67ffeafcd48d 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -91,7 +91,6 @@ LacSymAlgChain_CheckCCMData(Cpa8U *pAdditionalAuthData, return CPA_STATUS_SUCCESS; } - /** * @ingroup LacAuthEnc */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c index 4e47de384a1a..d88c6707b9df 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -296,7 +296,7 @@ LacSymCb_ProcessDpCallback(CpaCySymDpOpData *pResponse, *** 2509 LINES SKIPPED *** From nobody Fri Jun 6 13:57:04 2025 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 4bDND03Qhtz5x9tY; Fri, 06 Jun 2025 13:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND01tT6z3mLB; Fri, 06 Jun 2025 13:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/UhgHzkGNvIccPIc8XpLS0ICERgjHlh+ylJOsXgmf1Y=; b=n0uGtd7aO7RTjtqFHUMFWMsSpcA0wBkYQ+uMyx0qHFlmoWXtqEgCCwwmlA1+Swx4corjK4 l3Vju2Pbjrn+f0tBCt1GfYGSOwGOUbrtuu8wLNie6dq0AwIuuibGyH7YYL/94AwtCyTUIW iPpIykRJDidgceFc86NXgnwDRa5Qnqj5LeA8swiq4xU8pLrks9jqcxsSyPoAXLPCbbDVPk 9yJc+Wimoy0NZPiEg/2SZOfYoQk6vlB4Bw4dlSzuSIngppd76uEth1+cXI4L7hZ7m8V7nN p829rLckVNLfpXB+ikudoFoSVPWP51a0mdkYpX0y2G5C7FggJ32H8EqccfY/mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/UhgHzkGNvIccPIc8XpLS0ICERgjHlh+ylJOsXgmf1Y=; b=JPKPPK4dpfxDo/qNN6ylFkqVHHTTxkB2hdMJdCERu2/97MfMQSykEZvjfprsyBhT+ahs2a OlL7TDru6c3zMClnxtqfA5IOa6naOtX2WeKGJY23E+nitwIwmLGstjC0RsDjBeB9xva7OT zm9zoC65uCXVjSHMbOuJYh8mhLKPKyUgl2G7td4Tu4L5eQL/HZVvhATX4wFcl2GPPhp360 /eUN6/K4IQKO466+mYTjeRCEufeJLu90FoOyGOGc9MHJig5nPb29aR/ZSby5xISADpMPdt iQ0N8yHr3BAfkD0UhcIcHP/v7mtrcgS5JxqFOMaYqqNvshCBGuekYw3umfAiew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218224; a=rsa-sha256; cv=none; b=Gi6ID7E1h0zuGspxFbGi9bLV9mvxRHTppKk53DfsQm990Ly60y0VqCagnxRbIhsDiK7qek Uxfy5teMAwnPFoXQI8VaHlltVwJNpSZJBfKdQFua2pr7K+KrirQZMBFvuqbbPYRySkuBYb e4YD7dDxfeY3RSM+SkJH+vqsE28zgNfe/VrydOoGoexGxtPrvjqDwOgpcVvRdXkXiXhdhh 9aILRdK2F4fJKoTMKSIuzq5aUQmWeQvkQrUTldb6NEh/DAOaQkDqjZ2AwCyH7xvNeNQ9bL 6lDdTR0r1JHby5ZvkvpcP44iaqxAIn52N3AsKzHf3laFwYcdrsWk2RHmcINt8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND01Jwbzy1M; Fri, 06 Jun 2025 13:57:04 +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 556Dv4pL083917; Fri, 6 Jun 2025 13:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv40g083914; Fri, 6 Jun 2025 13:57:04 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:04 GMT Message-Id: <202506061357.556Dv40g083914@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: 5a8e5215cef0 - main - qat: add disable safe dc mode for QAT SPR devices 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: 5a8e5215cef0dac1115853889e925099f61bb5fa Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a8e5215cef0dac1115853889e925099f61bb5fa commit 5a8e5215cef0dac1115853889e925099f61bb5fa Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 00:00:01 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:42:58 +0000 qat: add disable safe dc mode for QAT SPR devices Build and sysctl configuration modes are introduced for QAT SPR devices to disable safe dc mode. A new QAT driver build option ‘QAT_DISABLE_SAFE_DC_MODE’ is required to build the QAT driver with code that allows a request to be sent to FW to override the ‘History Buffer’ mitigation. Default QAT driver builds do not include this ‘QAT_DISABLE_SAFE_DC_MODE’ build option. Even if the QAT driver was built with code that allows a request to be sent to FW to override the ‘History Buffer’ mitigation, the QAT driver must still be configured using sysctl to request an override of the ‘History Buffer’ mitigation if desired. The default QAT driver configuration option sysctl dev.qat.X.disable_safe_dc_mode does not allow override of the mitigation. The new sysctl attribute disable_safe_dc_mode is to be set to 1 for overriding the history buffer mitigation. Firmware for qat_4xxx is updated for this change. If this mode is enabled, decompression throughput increases but may result in a data leak if num_user_processes is more than 1. This option is to be enabled only if your system is not prone to user data leaks. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- share/man/man4/qat.4 | 11 +++- sys/conf/NOTES | 3 + sys/conf/options | 3 + sys/contrib/dev/qat/qat_4xxx.bin | Bin 665356 -> 665356 bytes sys/dev/qat/include/common/adf_accel_devices.h | 8 ++- sys/dev/qat/include/icp_qat_fw_init_admin.h | 7 ++- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 4 ++ sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 75 +++++++++++++++++++++++++ sys/modules/qat/qat/Makefile | 13 ++++- sys/modules/qat/qat_api/Makefile | 13 ++++- sys/modules/qat/qat_common/Makefile | 13 ++++- sys/modules/qat/qat_hw/Makefile | 13 ++++- 12 files changed, 154 insertions(+), 9 deletions(-) diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index e7907c7c6331..613091df2e7e 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-3-Clause -.\" Copyright(c) 2007-2022 Intel Corporation -.Dd May 16, 2025 +.\" Copyright(c) 2007-2025 Intel Corporation +.Dd June 2, 2025 .Dt QAT 4 .Os .Sh NAME @@ -108,6 +108,13 @@ Default value "ks;us". Override the number of uio user space processes that can connect to the QAT device. Default: 2 +.It Va dev.qat.X.disable_safe_dc_mode +Override history buffer mitigation. +Disabled by default. +If enabled, decompression throughput increases but may result in a data leak if +.Va dev.qat.X.num_user_processes +is more than 1. +Enable this option only if your system is not prone to user data leaks. .El .Pp The following diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 8aa0ed9dda78..2458756ae350 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2869,3 +2869,6 @@ options STATS # File system monitoring device filemon # file monitoring for make(1) meta-mode + +# Options for the Intel QuickAssist (QAT) driver. +options QAT_DISABLE_SAFE_DC_MODE # Disable QAT safe data compression mode (only for 4940 devices). diff --git a/sys/conf/options b/sys/conf/options index b218226b4126..03e8964e965d 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1014,3 +1014,6 @@ HIDRAW_MAKE_UHID_ALIAS opt_hid.h # This option is insecure except in controlled environments where the static # environment's contents are known to be safe. PRESERVE_EARLY_KENV opt_global.h + +# Options for the Intel QuickAssist (QAT) driver. +QAT_DISABLE_SAFE_DC_MODE opt_qat.h diff --git a/sys/contrib/dev/qat/qat_4xxx.bin b/sys/contrib/dev/qat/qat_4xxx.bin index 23eb8077241a..7783d361a93c 100644 Binary files a/sys/contrib/dev/qat/qat_4xxx.bin and b/sys/contrib/dev/qat/qat_4xxx.bin differ diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index 0a1248b9a68e..3731cf6587b2 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_ACCEL_DEVICES_H_ #define ADF_ACCEL_DEVICES_H_ @@ -7,6 +7,8 @@ #include "adf_cfg_common.h" #include "adf_pfvf_msg.h" +#include "opt_qat.h" + #define ADF_CFG_NUM_SERVICES 4 #define ADF_DH895XCC_DEVICE_NAME "dh895xcc" @@ -687,6 +689,10 @@ struct adf_accel_dev { struct adf_accel_pci accel_pci_dev; struct adf_accel_compat_manager *cm; u8 compat_ver; +#ifdef QAT_DISABLE_SAFE_DC_MODE + struct sysctl_oid *safe_dc_mode; + u8 disable_safe_dc_mode; +#endif /* QAT_DISABLE_SAFE_DC_MODE */ union { struct { /* vf_info is non-zero when SR-IOV is init'ed */ diff --git a/sys/dev/qat/include/icp_qat_fw_init_admin.h b/sys/dev/qat/include/icp_qat_fw_init_admin.h index 3537fb3f8cfd..cd4edbdbc93b 100644 --- a/sys/dev/qat/include/icp_qat_fw_init_admin.h +++ b/sys/dev/qat/include/icp_qat_fw_init_admin.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef _ICP_QAT_FW_INIT_ADMIN_H_ #define _ICP_QAT_FW_INIT_ADMIN_H_ @@ -43,6 +43,8 @@ enum icp_qat_fw_cnv_error_type { CNV_ERR_TYPE_UNKNOWN_ERROR }; +#define ICP_QAT_FW_INIT_DISABLE_SAFE_DC_MODE_FLAG 0x02 + #define CNV_ERROR_TYPE_GET(latest_error) \ ({ \ __typeof__(latest_error) _lerror = latest_error; \ @@ -69,7 +71,8 @@ struct icp_qat_fw_init_admin_req { struct { u64 resrvd2; u16 ibuf_size_in_kb; - u16 resrvd3; + u8 fw_flags; + u8 resrvd3; u32 resrvd4; }; /* ICP_QAT_FW_CONSTANTS_CFG */ diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c index 3326d7cb4ffb..43e530c3a6f1 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c @@ -709,6 +709,10 @@ adf_4xxx_send_admin_init(struct adf_accel_dev *accel_dev) memset(&req, 0, sizeof(req)); memset(&resp, 0, sizeof(resp)); req.cmd_id = ICP_QAT_FW_INIT_ME; +#ifdef QAT_DISABLE_SAFE_DC_MODE + if (accel_dev->disable_safe_dc_mode) + req.fw_flags = ICP_QAT_FW_INIT_DISABLE_SAFE_DC_MODE_FLAG; +#endif /* QAT_DISABLE_SAFE_DC_MODE */ if (adf_send_admin(accel_dev, &req, &resp, ae_mask)) { device_printf(GET_DEV(accel_dev), "Error sending init message\n"); diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index f4a673e25a40..9b585fe7d3d1 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -47,6 +47,74 @@ adf_probe(device_t dev) return ENXIO; } +#ifdef QAT_DISABLE_SAFE_DC_MODE +static int adf_4xxx_sysctl_disable_safe_dc_mode(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + int error, value = accel_dev->disable_safe_dc_mode; + + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || !req->newptr) + return error; + + if (value != 1 && value != 0) + return EINVAL; + + if (adf_dev_started(accel_dev)) { + device_printf( + GET_DEV(accel_dev), + "QAT: configuration can only be changed in \"down\" device state\n"); + return EBUSY; + } + + accel_dev->disable_safe_dc_mode = (u8)value; + + return 0; +} + +static void +adf_4xxx_disable_safe_dc_sysctl_add(struct adf_accel_dev *accel_dev) +{ + struct sysctl_ctx_list *qat_sysctl_ctx; + struct sysctl_oid *qat_sysctl_tree; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + qat_sysctl_tree = + device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); + accel_dev->safe_dc_mode = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "disable_safe_dc_mode", + CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_TUN | + CTLFLAG_SKIP, + accel_dev, + 0, + adf_4xxx_sysctl_disable_safe_dc_mode, + "LU", + "Disable QAT safe data compression mode"); +} + +static void +adf_4xxx_disable_safe_dc_sysctl_remove(struct adf_accel_dev *accel_dev) +{ + int ret; + struct sysctl_ctx_list *qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + ret = sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->safe_dc_mode); + if (ret) { + device_printf(GET_DEV(accel_dev), "Failed to delete entry\n"); + } else { + ret = sysctl_remove_oid(accel_dev->safe_dc_mode, 1, 1); + if (ret) + device_printf(GET_DEV(accel_dev), + "Failed to delete oid\n"); + } +} +#endif /* QAT_DISABLE_SAFE_DC_MODE */ + static void adf_cleanup_accel(struct adf_accel_dev *accel_dev) { @@ -76,6 +144,9 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_4XXX); accel_dev->hw_device = NULL; } +#ifdef QAT_DISABLE_SAFE_DC_MODE + adf_4xxx_disable_safe_dc_sysctl_remove(accel_dev); +#endif /* QAT_DISABLE_SAFE_DC_MODE */ adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -153,6 +224,10 @@ adf_attach(device_t dev) if (ret) goto out_err; +#ifdef QAT_DISABLE_SAFE_DC_MODE + adf_4xxx_disable_safe_dc_sysctl_add(accel_dev); +#endif /* QAT_DISABLE_SAFE_DC_MODE */ + pci_set_max_read_req(dev, 4096); ret = bus_dma_tag_create(bus_get_dma_tag(dev), diff --git a/sys/modules/qat/qat/Makefile b/sys/modules/qat/qat/Makefile index 14f3a566063f..cee1ee8fb1b1 100644 --- a/sys/modules/qat/qat/Makefile +++ b/sys/modules/qat/qat/Makefile @@ -4,7 +4,7 @@ KMOD= qat SRCS+= qat_ocf.c qat_ocf_mem_pool.c qat_ocf_utils.c -SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h +SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h opt_qat.h CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -I${SRCTOP}/sys/dev/qat/include @@ -17,6 +17,17 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include .if ${COMPILER_TYPE} == "clang" diff --git a/sys/modules/qat/qat_api/Makefile b/sys/modules/qat/qat_api/Makefile index f30d49cd8269..24fbcb46a987 100644 --- a/sys/modules/qat/qat_api/Makefile +++ b/sys/modules/qat/qat_api/Makefile @@ -60,7 +60,7 @@ SRCS+= qat_utils/src/QatUtilsSemaphore.c SRCS+= qat_utils/src/QatUtilsSpinLock.c SRCS+= qat_utils/src/QatUtilsAtomic.c SRCS+= qat_utils/src/QatUtilsCrypto.c -SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h vnode_if.h +SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h vnode_if.h opt_qat.h CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/lac @@ -74,6 +74,17 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common CFLAGS+= ${LINUXKPI_INCLUDES} +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include CWARNFLAGS+= -Wno-cast-qual diff --git a/sys/modules/qat/qat_common/Makefile b/sys/modules/qat/qat_common/Makefile index b0f847ae9a96..c2131cc1e24b 100644 --- a/sys/modules/qat/qat_common/Makefile +++ b/sys/modules/qat/qat_common/Makefile @@ -23,10 +23,21 @@ SRCS+= adf_gen4vf_hw_csr_data.c SRCS+= adf_freebsd_transport_debug.c adf_clock.c SRCS+= adf_freebsd_cnvnr_ctrs_dbg.c SRCS+= adf_freebsd_pfvf_ctrs_dbg.c -SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h +SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h opt_qat.h CFLAGS+= -I${SRCTOP}/sys/dev/qat/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common CFLAGS+= ${LINUXKPI_INCLUDES} +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include diff --git a/sys/modules/qat/qat_hw/Makefile b/sys/modules/qat/qat_hw/Makefile index 2a51640bd327..4ab8db5f0c56 100644 --- a/sys/modules/qat/qat_hw/Makefile +++ b/sys/modules/qat/qat_hw/Makefile @@ -12,7 +12,7 @@ SRCS+= qat_dh895xcc/adf_dh895xcc_hw_data.c qat_dh895xcc/adf_drv.c SRCS+= qat_c4xxx/adf_c4xxx_hw_data.c qat_c4xxx/adf_drv.c qat_c4xxx/adf_c4xxx_ae_config.c qat_c4xxx/adf_c4xxx_misc_error_stats.c SRCS+= qat_c4xxx/adf_c4xxx_pke_replay_stats.c qat_c4xxx/adf_c4xxx_ras.c qat_c4xxx/adf_c4xxx_res_part.c SRCS+= qat_c4xxx/adf_c4xxx_reset.c -SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h +SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h opt_qat.h CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -I${SRCTOP}/sys/dev/qat/include @@ -25,4 +25,15 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include From nobody Fri Jun 6 13:57:05 2025 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 4bDND14Zynz5xB6v; Fri, 06 Jun 2025 13:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND130Qxz3mNf; Fri, 06 Jun 2025 13:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fVpUT8R/3ZdBr845TmYXYDx+BGFFgd9aBugqAuX3sz8=; b=hl6c+pKUuidXe/SaMOxmOzJEH8lkLcIN+YHt0FKWMjatDOgF9cRWPFwU/WNO3Z/zxtmDX5 SE/7Hf8TWQBfkcoQW/aXgfWILxZg4dH6A5bdLWDOxM0u9TBzjVTDLPgITzn+Uk0Fc3LbOr 4U3/y+tyYhRIDw9SmLgo6qHnGtcev8DzGAQqMZO1Yua6x+S8GoGmkD1vzDbR80dhDuu8hP 5p6hfiXqitJbOQUtG0deuc63Fwfml8dOzSz15Ri5HnhS4/55/FfrpsVEwmOeqHs3TOS8aH uVMVZVHEfMulD1gmnroKyTsprIhFc6wN3nhKN7ZOxJpHfE2C0+FXPTxqQeL1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fVpUT8R/3ZdBr845TmYXYDx+BGFFgd9aBugqAuX3sz8=; b=C/W9r13J6KIG+ZWTxUXTb+tlSOlBnTR9XpRs1Yweuf9PND28UKIqsHX/Txj8/7SJoVxCIW 7r4ceuYRDUpi4uYuOGGv7oWM4aCyipT+UxDDIrYpxeGXB+cGYScKpLShvK38ITcXFfy01V q5dbQ4YiMbghEgEZRygbK6bfyoo4StDVvsDb9pSN91QERTV2W9MhvryHFW7RDU7Qxg3YYx WI4WUuz1MjfvuSAQng/7ZCZCMRFKKrG1X4hOUmFEZRQnTBV7PVtiQAeHoCzYJgsTg3KBFr /fyEqE7hkzIEG3WCZaFphSd+Y7QQU+FtWb2mdkv1XRVuFl1JBpXel85tBlASWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218225; a=rsa-sha256; cv=none; b=MRpU3KsUPKPMExzSNNNcpqZ8DA8C21XbnB10Oi7DDSlt74GCvzPSVlnwsrM83Ou8wkNIwy yVDyE+S6lHb0kl/aJtH1zpXKn4u4bJW50PLz9cp5SSXt1ftzuzxvFPYaDOCYdaWKGWsyY3 8f5QYzi6bn9pg9ZIpVB8oBdOMdrDawWmUFYe9J8w8nY5Z9Arokk+v1y/XCE8rgz9ZLTkbH KZ0LgAhIgtYdgsqkaZjdVmk0jlyU1Tg73UQr7GFLaRiU4fe2VL/cz5TkQ+yBThpnTwX5XZ kT0Xji1ZgEQptWz+FXBxHNsHRzE6v2cnZxsl7r3D7lI6JTw9Yw6mU2E/IogBLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND12Ryrzy1N; Fri, 06 Jun 2025 13:57: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 556Dv5ol083960; Fri, 6 Jun 2025 13:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv5dn083957; Fri, 6 Jun 2025 13:57:05 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:05 GMT Message-Id: <202506061357.556Dv5dn083957@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: 4da5c15e5c84 - main - qat: update 4xxx capabilities handling 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: 4da5c15e5c84738903fd306b54b18a0aaf166d5f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4da5c15e5c84738903fd306b54b18a0aaf166d5f commit 4da5c15e5c84738903fd306b54b18a0aaf166d5f Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 19:48:44 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:43:10 +0000 qat: update 4xxx capabilities handling Some capabilities were not properly fused out based on the hardware slices. Hence updated the function accordingly. Both PF and VF are changed. This change also streamlines capability handling for SYM service: - Lack of UCS slice does not mean that CIPHER capabilities are not available. - SYM capabilities should be considered disabled only if both AUTH and CIPHER capabilities are not present. - AUTH capability shouldn't disable CIPHER. SMX slice mask for qat_4xxx is also corrected to check for both SM3 and SM4 support. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 98 +++++++++++++--------- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h | 4 +- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c | 89 +++++++++++++------- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h | 14 +++- 4 files changed, 133 insertions(+), 72 deletions(-) diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c index 43e530c3a6f1..9a84ad652282 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -212,57 +212,77 @@ adf_4xxx_get_hw_cap(struct adf_accel_dev *accel_dev) { device_t pdev = accel_dev->accel_pci_dev.pci_dev; u32 fusectl1; - u32 capabilities; + u32 capabilities_sym, capabilities_sym_cipher, capabilities_sym_auth, + capabilities_asym, capabilities_dc, capabilities_other; + + capabilities_other = ICP_ACCEL_CAPABILITIES_RL; /* Read accelerator capabilities mask */ fusectl1 = pci_read_config(pdev, ADF_4XXX_FUSECTL1_OFFSET, 4); - capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CIPHER | - ICP_ACCEL_CAPABILITIES_AUTHENTICATION | - ICP_ACCEL_CAPABILITIES_COMPRESSION | - ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | - ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | - ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_HKDF | - ICP_ACCEL_CAPABILITIES_SHA3_EXT | ICP_ACCEL_CAPABILITIES_SM3 | + + capabilities_sym_cipher = ICP_ACCEL_CAPABILITIES_HKDF | ICP_ACCEL_CAPABILITIES_SM4 | ICP_ACCEL_CAPABILITIES_CHACHA_POLY | - ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2 | - ICP_ACCEL_CAPABILITIES_RL | ICP_ACCEL_CAPABILITIES_ECEDMONT | - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2; + capabilities_sym_auth = ICP_ACCEL_CAPABILITIES_SM3 | + ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_SHA3_EXT; + /* A set bit in fusectl1 means the feature is OFF in this SKU */ if (fusectl1 & ICP_ACCEL_4XXX_MASK_CIPHER_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_HKDF; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; - } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_AUTH_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_AUTHENTICATION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SHA3; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_HKDF; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; } - if (fusectl1 & ICP_ACCEL_MASK_PKE_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_UCS_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AES_V2; } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_AUTH_SLICE) { + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; } + if (fusectl1 & ICP_ACCEL_4XXX_MASK_SMX_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM3; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_UCS_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; - capabilities &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_AES_V2; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_cipher) + capabilities_sym_cipher |= ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_auth) + capabilities_sym_auth |= ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + capabilities_sym = capabilities_sym_cipher | capabilities_sym_auth; + + if (capabilities_sym) + capabilities_sym |= ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; + + capabilities_asym = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | + ICP_ACCEL_CAPABILITIES_SM2 | ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_PKE_SLICE) { + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_SM2; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; + } + + capabilities_dc = ICP_ACCEL_CAPABILITIES_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | + ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE) { + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; } - return capabilities; + return capabilities_sym | capabilities_dc | capabilities_asym | + capabilities_other; } static u32 diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h index b6a5da92fdb5..c35ebbcadcd7 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007 - 2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_4XXX_HW_DATA_H_ #define ADF_4XXX_HW_DATA_H_ @@ -105,7 +105,7 @@ enum icp_qat_4xxx_slice_mask { ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE = BIT(3), ICP_ACCEL_4XXX_MASK_UCS_SLICE = BIT(4), ICP_ACCEL_4XXX_MASK_EIA3_SLICE = BIT(5), - ICP_ACCEL_4XXX_MASK_SMX_SLICE = BIT(6), + ICP_ACCEL_4XXX_MASK_SMX_SLICE = BIT(7), }; void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 id); diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c index 27e5ef8162ab..f3d4ae3c7b38 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -133,45 +133,74 @@ adf_4xxxvf_get_hw_cap(struct adf_accel_dev *accel_dev) { device_t pdev = accel_dev->accel_pci_dev.pci_dev; u32 vffusectl1; - u32 capabilities; - - capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC + - ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC + - ICP_ACCEL_CAPABILITIES_CIPHER + - ICP_ACCEL_CAPABILITIES_AUTHENTICATION + - ICP_ACCEL_CAPABILITIES_COMPRESSION + - ICP_ACCEL_CAPABILITIES_SHA3_EXT + ICP_ACCEL_CAPABILITIES_SM2 + - ICP_ACCEL_CAPABILITIES_SM3 + ICP_ACCEL_CAPABILITIES_SM4 + - ICP_ACCEL_CAPABILITIES_CHACHA_POLY + - ICP_ACCEL_CAPABILITIES_AESGCM_SPC + - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64 + - ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION + - ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + u32 capabilities_sym, capabilities_sym_cipher, capabilities_sym_auth, + capabilities_asym, capabilities_dc; /* Get fused capabilities */ vffusectl1 = pci_read_config(pdev, ADF_4XXXIOV_VFFUSECTL1_OFFSET, 4); - if (vffusectl1 & BIT(7)) { - capabilities &= - ~(ICP_ACCEL_CAPABILITIES_SM3 + ICP_ACCEL_CAPABILITIES_SM4); + capabilities_sym_cipher = ICP_ACCEL_CAPABILITIES_HKDF | + ICP_ACCEL_CAPABILITIES_SM4 | ICP_ACCEL_CAPABILITIES_CHACHA_POLY | + ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2; + capabilities_sym_auth = ICP_ACCEL_CAPABILITIES_SM3 | + ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_SHA3_EXT; + + /* A set bit in vffusectl1 means the feature is OFF in this SKU */ + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_CIPHER_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_HKDF; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; } - if (vffusectl1 & BIT(6)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM3; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_UCS_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AES_V2; } - if (vffusectl1 & BIT(3)) { - capabilities &= ~(ICP_ACCEL_CAPABILITIES_COMPRESSION + - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64); + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_AUTH_SLICE) { + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; } - if (vffusectl1 & BIT(2)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_SMX_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; } - if (vffusectl1 & BIT(1)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + if (capabilities_sym_cipher) + capabilities_sym_cipher |= ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_auth) + capabilities_sym_auth |= ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + capabilities_sym = capabilities_sym_cipher | capabilities_sym_auth; + + if (capabilities_sym) + capabilities_sym |= ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; + + capabilities_asym = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | + ICP_ACCEL_CAPABILITIES_SM2 | ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_PKE_SLICE) { + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_SM2; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; } - if (vffusectl1 & BIT(0)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + + capabilities_dc = ICP_ACCEL_CAPABILITIES_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | + ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_COMPRESS_SLICE) { + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; } - return capabilities; + + return capabilities_sym | capabilities_dc | capabilities_asym; } static void diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h index 83c034f543c9..a702fc69dde7 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_4XXXVF_HW_DATA_H_ #define ADF_4XXXVF_HW_DATA_H_ @@ -27,6 +27,18 @@ #define ADF_4XXXIOV_VFFUSECTL4_OFFSET (0x1C4) #define ADF_4XXXIOV_VFFUSECTL5_OFFSET (0x1C8) +/*qat_4xxxvf fuse bits are same as qat_4xxx*/ +enum icp_qat_4xxxvf_slice_mask { + ICP_ACCEL_4XXXVF_MASK_CIPHER_SLICE = 0x01, + ICP_ACCEL_4XXXVF_MASK_AUTH_SLICE = 0x02, + ICP_ACCEL_4XXXVF_MASK_PKE_SLICE = 0x04, + ICP_ACCEL_4XXXVF_MASK_COMPRESS_SLICE = 0x08, + ICP_ACCEL_4XXXVF_MASK_UCS_SLICE = 0x10, + ICP_ACCEL_4XXXVF_MASK_EIA3_SLICE = 0x20, + /*SM3&SM4 are indicated by same bit*/ + ICP_ACCEL_4XXXVF_MASK_SMX_SLICE = 0x80, +}; + void adf_init_hw_data_4xxxiov(struct adf_hw_device_data *hw_data); void adf_clean_hw_data_4xxxiov(struct adf_hw_device_data *hw_data); u32 adf_4xxxvf_get_hw_cap(struct adf_accel_dev *accel_dev); From nobody Fri Jun 6 13:57:06 2025 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 4bDND30n5fz5x9td; Fri, 06 Jun 2025 13:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND25B5Nz3mLT; Fri, 06 Jun 2025 13:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJKUKpG6dvxUSBkvRKEMKWqYQ4SrzOl5QxnFpv4Kqpg=; b=WHrcUTyMy0Ch8jabiH0Q4j3meF1Paj33GUMt8geJghDY4lZNtVthqAY8HRSxaCFGym0Pl7 bAHOkFTlETwzxZ5uipIuHwsutI0Bx5Ye14KX5vinjZ//dsO5nEQHwiQeN/68k+dzBTKiSq HnyUk4CaCAAX20YPpOVWE0f87+FH+04tJ3Nvp36qjiZctxnunXI6d8NHID4trEz1Zk/XJr 4qUwjaH80QyZvozDZb2HRnHv4iTYbGdozGFrQJRHAAypgiwzoh13MqsuVU4X76J9RMq1tt 3jbwjG7wvmzShAeUkPtKlTQljElqDWodzsasvLgAFSQNSp/rMeJ+Lq3VCuzBeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJKUKpG6dvxUSBkvRKEMKWqYQ4SrzOl5QxnFpv4Kqpg=; b=nE6bfUf38wpvAxEdaAk2ILfTiRGl7ETDXOsHrDCfCVbQLWMFBnssPcDnsvmARxXbRAzUOA CcjCtIRteXGBgbpSmW83GxW16PORyakFfXk7GsqpZP4KERRRIhfLTDOElcOnCfei4yTZA8 xpWfFrkn7+bDQd7VNYc3YZiU6xs2TJeagYUZQv4jUhNyqcelIOc0oSEuh2fD9HMnDwWL53 hTHetzEpydvA0q++vcvUCxJgBIbN4/4Lo4IRTCFfyDAldFW5+zuLT0BNyB9NwGup5P9ekZ cc7+cSyNcKZVVZzVtw2gWdz26Jdrl1Qw5Zr57D8g9FGTBz+S103KuAbgqDtjOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218226; a=rsa-sha256; cv=none; b=GEpyF2kvsfZRxg2FwCNhAGX9eKsAQMcFeF6CYLP9if4WZgRYJ/rRTYNtkl02KPvdXZcbrv cl2/USkun21oJiWPxC/iO2XWw9NdDLY1z+RD6ZFQyFtMzzjEw6T15sVgLTIFdjvGtOkKLb OqPchvM+8hz/pB1b/aBOQOm/cXLszXmNzMqYNpBnGZSIVzfds+g3znr/dfNVPX9atA7ME3 ElPX5Cxfw4I2Z7tBGAHuOkWbzZqSqPbqb+HpspsAmTpu1xD+SCyniaYiHts247n3EqdG7v iOLXH8pOimgomrUGpuD1MvZHMyzrpdGcYJYoIUrgJ7N4NL7IJydUUHAEZhXSWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND22n4zzxVm; Fri, 06 Jun 2025 13:57:06 +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 556Dv66x083993; Fri, 6 Jun 2025 13:57:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv6I7083990; Fri, 6 Jun 2025 13:57:06 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:06 GMT Message-Id: <202506061357.556Dv6I7083990@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: c38bafee7e18 - main - qat: move debugfs handling to separate 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c38bafee7e182fbcdc3c346b2785ed258230cb06 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c38bafee7e182fbcdc3c346b2785ed258230cb06 commit c38bafee7e182fbcdc3c346b2785ed258230cb06 Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 21:53:56 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:43:22 +0000 qat: move debugfs handling to separate file Moved handling of debugfs entries to a separate file. In addition, it will allow to consolidate the addition of debugfs entries to a single location in the code. This implementation adds infrastructure to create (and remove) debugfs entries at two different stages. - Done when a device is probed, allows to keep debugfs entries persistent between a transition in device state (up to down or vice versa). - Done after the initialization phase, allows to have debugfs entries that are accessible only when the device is up. In addition, moved the creation of debugfs entries for configuration of the newly created function adf_dbgfs_init() and replace symbolic permissions with octal permissions when creating the debugfs files. Added sysctl oids storage for proper cleanup on device down. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/include/adf_dbgfs.h | 11 +++ sys/dev/qat/include/adf_heartbeat.h | 6 +- sys/dev/qat/include/common/adf_accel_devices.h | 4 + sys/dev/qat/qat_common/adf_cfg.c | 42 ++-------- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 55 +++++++----- sys/dev/qat/qat_common/adf_freebsd_dbgfs.c | 68 +++++++++++++++ sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c | 98 ++++++++++++++-------- sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c | 98 ++++++++++++++-------- sys/dev/qat/qat_common/adf_fw_counters.c | 42 ++++++---- sys/dev/qat/qat_common/adf_init.c | 7 +- sys/dev/qat/qat_hw/qat_200xx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c | 6 +- sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_c62x/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c | 8 +- sys/modules/qat/qat_common/Makefile | 1 + 18 files changed, 325 insertions(+), 161 deletions(-) diff --git a/sys/dev/qat/include/adf_dbgfs.h b/sys/dev/qat/include/adf_dbgfs.h new file mode 100644 index 000000000000..a07933c0f02d --- /dev/null +++ b/sys/dev/qat/include/adf_dbgfs.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ + +#ifndef ADF_DBGFS_H +#define ADF_DBGFS_H + +void adf_dbgfs_init(struct adf_accel_dev *accel_dev); +void adf_dbgfs_add(struct adf_accel_dev *accel_dev); +void adf_dbgfs_rm(struct adf_accel_dev *accel_dev); +void adf_dbgfs_exit(struct adf_accel_dev *accel_dev); +#endif diff --git a/sys/dev/qat/include/adf_heartbeat.h b/sys/dev/qat/include/adf_heartbeat.h index b2eab7139c1f..7a72678e77de 100644 --- a/sys/dev/qat/include/adf_heartbeat.h +++ b/sys/dev/qat/include/adf_heartbeat.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_HEARTBEAT_H_ #define ADF_HEARTBEAT_H_ @@ -18,8 +18,8 @@ struct adf_heartbeat { u64 last_hb_check_time; enum adf_device_heartbeat_status last_hb_status; struct qat_sysctl heartbeat; - struct qat_sysctl *heartbeat_sent; - struct qat_sysctl *heartbeat_failed; + struct qat_sysctl heartbeat_sent; + struct qat_sysctl heartbeat_failed; }; int adf_heartbeat_init(struct adf_accel_dev *accel_dev); diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index 3731cf6587b2..b3f82234bc2b 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -685,6 +685,10 @@ struct adf_accel_dev { struct sysctl_oid *ras_reset; struct sysctl_oid *pke_replay_dbgfile; struct sysctl_oid *misc_error_dbgfile; + struct sysctl_oid *fw_version_oid; + struct sysctl_oid *mmp_version_oid; + struct sysctl_oid *hw_version_oid; + struct sysctl_oid *cnv_error_oid; struct list_head list; struct adf_accel_pci accel_pci_dev; struct adf_accel_compat_manager *cm; diff --git a/sys/dev/qat/qat_common/adf_cfg.c b/sys/dev/qat/qat_common/adf_cfg.c index 736ede860840..37ab44fdb1f6 100644 --- a/sys/dev/qat/qat_common/adf_cfg.c +++ b/sys/dev/qat/qat_common/adf_cfg.c @@ -1,15 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_cfg.h" #include "adf_common_drv.h" -#include "adf_cfg_dev_dbg.h" #include "adf_cfg_device.h" #include "adf_cfg_sysctl.h" -#include "adf_heartbeat_dbg.h" -#include "adf_ver_dbg.h" -#include "adf_fw_counters.h" -#include "adf_cnvnr_freq_counters.h" /** * adf_cfg_dev_add() - Create an acceleration device configuration table. @@ -73,31 +68,13 @@ adf_cfg_dev_add(struct adf_accel_dev *accel_dev) ADF_CFG_MAX_VAL); } - if (adf_cfg_sysctl_add(accel_dev)) - goto err; - - if (adf_cfg_dev_dbg_add(accel_dev)) - goto err; - - if (!accel_dev->is_vf) { - if (adf_heartbeat_dbg_add(accel_dev)) - goto err; - - if (adf_ver_dbg_add(accel_dev)) - goto err; - - if (adf_fw_counters_add(accel_dev)) - goto err; - - if (adf_cnvnr_freq_counters_add(accel_dev)) - goto err; + if (adf_cfg_sysctl_add(accel_dev)) { + free(dev_cfg_data, M_QAT); + accel_dev->cfg = NULL; + return EFAULT; } - return 0; -err: - free(dev_cfg_data, M_QAT); - accel_dev->cfg = NULL; - return EFAULT; + return 0; } static void adf_cfg_section_del_all(struct list_head *head); @@ -142,13 +119,6 @@ adf_cfg_dev_remove(struct adf_accel_dev *accel_dev) sx_xunlock(&dev_cfg_data->lock); adf_cfg_sysctl_remove(accel_dev); - adf_cfg_dev_dbg_remove(accel_dev); - if (!accel_dev->is_vf) { - adf_ver_dbg_del(accel_dev); - adf_heartbeat_dbg_del(accel_dev); - adf_fw_counters_remove(accel_dev); - adf_cnvnr_freq_counters_remove(accel_dev); - } free(dev_cfg_data, M_QAT); accel_dev->cfg = NULL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index 960c71472bc8..ead172635e59 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -123,10 +123,12 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) cnvnr_err_str[error_type], latest_error); if (bytes_written <= 0) { - printf("ERROR: No space left in CnV ctrs line buffer\n" - "\tAcceleration ID: %d, Engine: %d\n", - accel_dev->accel_id, - ae); + device_printf( + GET_DEV(accel_dev), + "ERROR: No space left in CnV ctrs line buffer\n" + "\tAcceleration ID: %d, Engine: %d\n", + accel_dev->accel_id, + ae); break; } report_ptr += bytes_written; @@ -141,7 +143,6 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) { struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_cnvnr_ctrs_sysctl_tree; - struct sysctl_oid *oid_rc; /* Defensive checks */ if (!accel_dev) @@ -154,19 +155,22 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); /* Create "cnv_error" string type leaf - with callback */ - oid_rc = SYSCTL_ADD_PROC(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_cnvnr_ctrs_sysctl_tree), - OID_AUTO, - "cnv_error", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - qat_cnvnr_ctrs_dbg_read, - "IU", - "QAT CnVnR status"); - - if (!oid_rc) { - printf("ERROR: Memory allocation failed\n"); + accel_dev->cnv_error_oid = + SYSCTL_ADD_PROC(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_cnvnr_ctrs_sysctl_tree), + OID_AUTO, + "cnv_error", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + qat_cnvnr_ctrs_dbg_read, + "IU", + "QAT CnVnR status"); + + if (!accel_dev->cnv_error_oid) { + device_printf( + GET_DEV(accel_dev), + "Failed to create qat cnvnr freq counters sysctl entry.\n"); return ENOMEM; } return 0; @@ -175,4 +179,17 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) void adf_cnvnr_freq_counters_remove(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + + if (!accel_dev) + return; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (accel_dev->cnv_error_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->cnv_error_oid); + sysctl_remove_oid(accel_dev->cnv_error_oid, 1, 1); + accel_dev->cnv_error_oid = NULL; + } } diff --git a/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c b/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c new file mode 100644 index 000000000000..21ffb0adf559 --- /dev/null +++ b/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ + +#include "adf_accel_devices.h" +#include "adf_cfg_dev_dbg.h" +#include "adf_cnvnr_freq_counters.h" +#include "adf_common_drv.h" +#include "adf_dbgfs.h" +#include "adf_fw_counters.h" +#include "adf_freebsd_pfvf_ctrs_dbg.h" +#include "adf_heartbeat_dbg.h" +#include "adf_ver_dbg.h" + +/** + * adf_dbgfs_init() - add persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + * + * This function creates debugfs entries that are persistent through a device + * state change (from up to down or vice versa). + */ +void +adf_dbgfs_init(struct adf_accel_dev *accel_dev) +{ + adf_cfg_dev_dbg_add(accel_dev); +} + +/** + * adf_dbgfs_exit() - remove persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + */ +void +adf_dbgfs_exit(struct adf_accel_dev *accel_dev) +{ + adf_cfg_dev_dbg_remove(accel_dev); +} + +/** + * adf_dbgfs_add() - add non-persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + * + * This function creates debugfs entries that are not persistent through + * a device state change (from up to down or vice versa). + */ +void +adf_dbgfs_add(struct adf_accel_dev *accel_dev) +{ + if (!accel_dev->is_vf) { + adf_heartbeat_dbg_add(accel_dev); + adf_ver_dbg_add(accel_dev); + adf_fw_counters_add(accel_dev); + adf_cnvnr_freq_counters_add(accel_dev); + } +} + +/** + * adf_dbgfs_rm() - remove non-persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + */ +void +adf_dbgfs_rm(struct adf_accel_dev *accel_dev) +{ + if (!accel_dev->is_vf) { + adf_cnvnr_freq_counters_remove(accel_dev); + adf_fw_counters_remove(accel_dev); + adf_ver_dbg_del(accel_dev); + adf_heartbeat_dbg_del(accel_dev); + } +} diff --git a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c index c22640045fda..8690c000760c 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -48,7 +48,6 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) struct sysctl_ctx_list *qat_hb_sysctl_ctx; struct sysctl_oid *qat_hb_sysctl_tree; struct adf_heartbeat *hb; - struct sysctl_oid *rc = 0; if (accel_dev == NULL) { return EINVAL; @@ -63,43 +62,76 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) qat_hb_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat_sent", - CTLFLAG_RD, - &hb->hb_sent_counter, - 0, - "HB sent count"); - HB_SYSCTL_ERR(rc); - - rc = SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat_failed", - CTLFLAG_RD, - &hb->hb_failed_counter, - 0, - "HB failed count"); - HB_SYSCTL_ERR(rc); - - rc = SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat", - CTLTYPE_INT | CTLFLAG_RD, - accel_dev, - 0, - qat_dev_hb_read, - "IU", - "QAT device status"); - HB_SYSCTL_ERR(rc); + hb->heartbeat_sent.oid = + SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat_sent", + CTLFLAG_RD, + &hb->hb_sent_counter, + 0, + "HB sent count"); + HB_SYSCTL_ERR(hb->heartbeat_sent.oid); + + hb->heartbeat_failed.oid = + SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat_failed", + CTLFLAG_RD, + &hb->hb_failed_counter, + 0, + "HB failed count"); + HB_SYSCTL_ERR(hb->heartbeat_failed.oid); + + hb->heartbeat.oid = SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat", + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, + 0, + qat_dev_hb_read, + "IU", + "QAT device status"); + HB_SYSCTL_ERR(hb->heartbeat.oid); return 0; } int adf_heartbeat_dbg_del(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + struct adf_heartbeat *hb; + + if (!accel_dev) { + return EINVAL; + } + + hb = accel_dev->heartbeat; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (hb->heartbeat.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat.oid); + sysctl_remove_oid(hb->heartbeat.oid, 1, 1); + hb->heartbeat.oid = NULL; + } + + if (hb->heartbeat_failed.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat_failed.oid); + sysctl_remove_oid(hb->heartbeat_failed.oid, 1, 1); + hb->heartbeat_failed.oid = NULL; + } + + if (hb->heartbeat_sent.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat_sent.oid); + sysctl_remove_oid(hb->heartbeat_sent.oid, 1, 1); + hb->heartbeat_sent.oid = NULL; + } + adf_heartbeat_clean(accel_dev); + return 0; } diff --git a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c index 31805d5fb91e..98cde6a742c1 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -86,7 +86,6 @@ adf_ver_dbg_add(struct adf_accel_dev *accel_dev) { struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; if (!accel_dev) return -EINVAL; @@ -96,43 +95,46 @@ adf_ver_dbg_add(struct adf_accel_dev *accel_dev) qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "fw_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_fw_versions, - "A", - "QAT FW version"); - if (!rc) + accel_dev->fw_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "fw_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_fw_versions, + "A", + "QAT FW version"); + if (!accel_dev->fw_version_oid) goto err; - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "hw_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_hw_versions, - "A", - "QAT HW version"); - if (!rc) + accel_dev->hw_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "hw_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_hw_versions, + "A", + "QAT HW version"); + if (!accel_dev->hw_version_oid) goto err; - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "mmp_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_mmp_versions, - "A", - "QAT MMP version"); - if (!rc) + accel_dev->mmp_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "mmp_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_mmp_versions, + "A", + "QAT MMP version"); + if (!accel_dev->mmp_version_oid) goto err; return 0; @@ -145,4 +147,30 @@ err: void adf_ver_dbg_del(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + + if (!accel_dev) + return; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (accel_dev->mmp_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, + accel_dev->mmp_version_oid); + sysctl_remove_oid(accel_dev->mmp_version_oid, 1, 1); + accel_dev->mmp_version_oid = NULL; + } + + if (accel_dev->hw_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->hw_version_oid); + sysctl_remove_oid(accel_dev->hw_version_oid, 1, 1); + accel_dev->hw_version_oid = NULL; + } + + if (accel_dev->fw_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->fw_version_oid); + sysctl_remove_oid(accel_dev->fw_version_oid, 1, 1); + accel_dev->fw_version_oid = NULL; + } } diff --git a/sys/dev/qat/qat_common/adf_fw_counters.c b/sys/dev/qat/qat_common/adf_fw_counters.c index ea674b27bd0f..1acabe4c9364 100644 --- a/sys/dev/qat/qat_common/adf_fw_counters.c +++ b/sys/dev/qat/qat_common/adf_fw_counters.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -211,7 +211,6 @@ adf_fw_counters_add(struct adf_accel_dev *accel_dev) struct adf_fw_counters_data *fw_counters_data; struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; fw_counters_data = malloc(sizeof(*fw_counters_data), M_QAT, M_WAITOK | M_ZERO); @@ -225,20 +224,24 @@ adf_fw_counters_add(struct adf_accel_dev *accel_dev) device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "fw_counters", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_read_fw_counters, - "A", - "QAT FW counters"); - if (!rc) + fw_counters_data->debug = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "fw_counters", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_read_fw_counters, + "A", + "QAT FW counters"); + if (!fw_counters_data->debug) { + free(fw_counters_data, M_QAT); + accel_dev->fw_counters_data = NULL; return ENOMEM; - else - return 0; + } + + return 0; } static void @@ -396,12 +399,21 @@ adf_fw_counters_section_add(struct adf_accel_dev *accel_dev, void adf_fw_counters_remove(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; struct adf_fw_counters_data *fw_counters_data = accel_dev->fw_counters_data; if (!fw_counters_data) return; + if (fw_counters_data->debug) { + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + sysctl_ctx_entry_del(qat_sysctl_ctx, fw_counters_data->debug); + sysctl_remove_oid(fw_counters_data->debug, 1, 1); + fw_counters_data->debug = NULL; + } + down_write(&fw_counters_data->lock); adf_fw_counters_section_del_all(&fw_counters_data->ae_sec_list); up_write(&fw_counters_data->lock); diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index f0b75db3f6ed..9f239b8f63d3 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -1,8 +1,9 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" +#include "adf_dbgfs.h" #include "adf_accel_devices.h" #include "icp_qat_uclo.h" #include "icp_qat_fw.h" @@ -489,6 +490,8 @@ adf_dev_start(struct adf_accel_dev *accel_dev) clear_bit(ADF_STATUS_STARTING, &accel_dev->status); set_bit(ADF_STATUS_STARTED, &accel_dev->status); + adf_dbgfs_add(accel_dev); + return 0; } @@ -526,6 +529,8 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) return EBUSY; } + adf_dbgfs_rm(accel_dev); + clear_bit(ADF_STATUS_STARTING, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status); diff --git a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c index f9b8c742d339..9e2462c05657 100644 --- a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_200xx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_200XX, "qat_200xx", "qat_200xx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_200XX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -215,6 +215,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index 9b585fe7d3d1..08fbf5d989e2 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007 - 2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -8,13 +8,12 @@ #include "adf_gen4_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_4XXX, "qat_4xxx", "qat_4xxx"); @@ -147,6 +146,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) #ifdef QAT_DISABLE_SAFE_DC_MODE adf_4xxx_disable_safe_dc_sysctl_remove(accel_dev); #endif /* QAT_DISABLE_SAFE_DC_MODE */ + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -280,6 +280,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c index 9b66ae4b2370..42189c28b21a 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include #include @@ -8,6 +8,7 @@ #include "adf_gen4_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include @@ -83,6 +84,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_4XXXVF); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); } @@ -180,6 +182,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + /* Completion for VF2PF request/response message exchange */ init_completion(&accel_dev->u1.vf.msg_received); mutex_init(&accel_dev->u1.vf.rpreset_lock); diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c index 74e9e2292623..9f2c9374e968 100644 --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c3xxx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C3XXX, "qat_c3xxx", "qat_c3xxx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C3XXX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -204,6 +204,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c index 0e206e960a6c..697f5b1ce786 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c4xxx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C4XXX, "qat_c4xx", "qat_c4xx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C4XXX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -203,6 +203,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c index 4035a8385bd5..1d48b85b2e12 100644 --- a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c62x_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C62X, "qat_c62x", "qat_c62x"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C62X); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -205,6 +205,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c index f7a31da23ba9..d8f2ba0a99b7 100644 --- a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_dh895xcc_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include *** 34 LINES SKIPPED *** From nobody Fri Jun 6 13:57:07 2025 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 4bDND36kBHz5xB72; Fri, 06 Jun 2025 13:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND33V3nz3mGB; Fri, 06 Jun 2025 13:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zrv5KkLGUMYVVpdamrr5MC98U2hCVkdzvaMRfGX72eQ=; b=ompjWqIvA2+VyaU9ccNkRPIupKq1acyoGyPfcxJMXMP6U4vz0INnnmXzOy9RRjkov3/DGa IyKUwNOqrJveCJlvE1UT+TIXbS//uYNfjEFm9IcAlo3amAZWj0K+9dRFElgltDfbedCHvD 7t9bW6F/JtHBeiFbk3krPGHf0QtbWQx/kdE90rvR8j8TWKv6WvHmzltdfzbAEuPmT4PiWM 7jbieYZmRogmttnvUljiORirjcqOvhGlJuCxKro/Dbe9kWZ1cbZPzeSdxekqnbtp/raSGh p+nQIkIFQCt1nNWDa6b4GqKmdxlyLw5CVgUzxvIvF9ZYzcpeLTC3WHNNekTddA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zrv5KkLGUMYVVpdamrr5MC98U2hCVkdzvaMRfGX72eQ=; b=qKXZTLsHW1XVXjR1pLN/pGYc6tICB/wD9v8T9Ijs0lcImab94xQ7vTRAfr5ENoGnS4JK3u hywQtncFkSKdfKHJa6WRn4jWmpMWVGb939qH/av+fkrom+RLxM1ek/wXnt5br6h/zcw347 IWb4HQPWu6Zqv+/b92UhtAYmqWnwUjnigBo8TYDP9nvq5N9Q3hXmXHZTQodmNDSwjx+eqj gpVtmSsld+h9vzpEDWwCH2WZUNmuU+kMkQ+RFR/sBLdJQwjNsiHVcZceNfXdGoA+Ul6MJQ PDLb9n8/HRY/MaXAJmM+0bSJXszBd1QkgyENTSaBTFmQWtqYJgloYzPbm57Wgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218227; a=rsa-sha256; cv=none; b=ivo2W962qtRyiQWo/5thHCFrsCJXGFJZ5W00DX9HV2/ozDKJbsGARkfQnvo7C5H094PKvr FxM5uLBzhW779W+tuwEf5Wj6VNpMdlYkIf0m0DlTQusFDN3RgCr6jq2RrLcv/8qsBwqyO6 aOhqHPojQWsV0T/MxP4w9nEfjPs8YmkUh03tFyNxLSRfZzZQlJlhh6by2+WqofMNVfoOfo KIKnyBEqZXmj6zVI9jZ2MHVO6wRvopRw+ns3uYHKOOchZzwBvBvz3+SjVgSXKjFz7zKTbt BoBijDrb/iuyvu0uOXOi4wsWkSKXE2EwqAHGbGqrYleJwnEhTSlcYSYkGp68mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND330MNzxj9; Fri, 06 Jun 2025 13:57: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 556Dv729084026; Fri, 6 Jun 2025 13:57:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv7Ep084023; Fri, 6 Jun 2025 13:57:07 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:07 GMT Message-Id: <202506061357.556Dv7Ep084023@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: 8aa51e6d7de0 - main - qat: restrict sysctl access to privileged users 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: 8aa51e6d7de0a828020de64560d1385e15955a1c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8aa51e6d7de0a828020de64560d1385e15955a1c commit 8aa51e6d7de0a828020de64560d1385e15955a1c Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 22:27:51 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:43:33 +0000 qat: restrict sysctl access to privileged users Access to crucial QAT driver internals, such as firmware counters and transport debug via sysctl, has been limited to privileged users only. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/qat_common/adf_cfg_sysctl.c | 15 ++++- sys/dev/qat/qat_common/adf_clock.c | 34 +++++++++-- sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c | 6 +- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 4 ++ sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c | 66 +++++++++++++++++++--- sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c | 6 +- .../qat/qat_common/adf_freebsd_transport_debug.c | 9 ++- sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c | 10 ++++ sys/dev/qat/qat_common/adf_fw_counters.c | 4 ++ sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c | 7 ++- .../qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c | 6 +- .../qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c | 6 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c | 15 ++++- 13 files changed, 167 insertions(+), 21 deletions(-) diff --git a/sys/dev/qat/qat_common/adf_cfg_sysctl.c b/sys/dev/qat/qat_common/adf_cfg_sysctl.c index 621c3cc5b6c6..1a836765c94a 100644 --- a/sys/dev/qat/qat_common/adf_cfg_sysctl.c +++ b/sys/dev/qat/qat_common/adf_cfg_sysctl.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -10,6 +10,7 @@ #include "adf_common_drv.h" #include #include +#include #define ADF_CFG_SYSCTL_BUF_SZ ADF_CFG_MAX_VAL #define ADF_CFG_UP_STR "up" @@ -105,6 +106,9 @@ static int adf_cfg_sysctl_services_handle(SYSCTL_HANDLER_ARGS) int ret = 0; int i = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -156,6 +160,9 @@ static int adf_cfg_sysctl_mode_handle(SYSCTL_HANDLER_ARGS) int ret = 0; int i = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -204,6 +211,9 @@ static int adf_cfg_sysctl_handle(SYSCTL_HANDLER_ARGS) unsigned int len; int ret = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -245,6 +255,9 @@ static int adf_cfg_sysctl_num_processes_handle(SYSCTL_HANDLER_ARGS) uint32_t num_user_processes = 0; int ret = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; diff --git a/sys/dev/qat/qat_common/adf_clock.c b/sys/dev/qat/qat_common/adf_clock.c index 36204c9939ac..f5d4116505b6 100644 --- a/sys/dev/qat/qat_common/adf_clock.c +++ b/sys/dev/qat/qat_common/adf_clock.c @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_common_drv.h" #include +#include #define MEASURE_CLOCK_RETRIES 10 #define MEASURE_CLOCK_DELTA_THRESHOLD 100 @@ -21,11 +22,30 @@ } \ } while (0) +static int adf_clock_read_frequency(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_hw_device_data *hw_data; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hw_data = accel_dev->hw_device; + + error = sysctl_handle_int(oidp, &hw_data->clock_frequency, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + int adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) { - struct adf_hw_device_data *hw_data = accel_dev->hw_device; - struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; struct sysctl_oid *rc = 0; @@ -35,13 +55,15 @@ adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_UINT(qat_sysctl_ctx, + rc = SYSCTL_ADD_PROC(qat_sysctl_ctx, SYSCTL_CHILDREN(qat_sysctl_tree), OID_AUTO, CLK_DBGFS_FILE, - CTLFLAG_RD, - &hw_data->clock_frequency, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, + adf_clock_read_frequency, + "IU", "clock frequency"); HB_SYSCTL_ERR(rc); return 0; diff --git a/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c index 7585dd9b29d4..6068d7d99496 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_common_drv.h" #include "adf_cfg_device.h" @@ -12,6 +12,7 @@ #include #include #include +#include static int qat_dev_cfg_show(SYSCTL_HANDLER_ARGS) { @@ -21,6 +22,9 @@ static int qat_dev_cfg_show(SYSCTL_HANDLER_ARGS) struct sbuf sb; int error; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); dev_cfg = arg1; sx_slock(&dev_cfg->lock); diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index ead172635e59..539059589bc8 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "adf_cnvnr_freq_counters.h" #include "adf_common_drv.h" #include "adf_cfg.h" @@ -45,6 +46,9 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) char report[MAX_REPORT_SIZE]; char *report_ptr = report; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + /* Defensive check */ if (!accel_dev || accel_dev->accel_id > ADF_MAX_DEVICES) return EINVAL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c index 8690c000760c..e7b4840600e1 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "adf_heartbeat_dbg.h" #include "adf_common_drv.h" #include "adf_cfg.h" @@ -17,6 +18,49 @@ } \ } while (0) + +static int qat_dev_hb_read_sent(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_heartbeat *hb; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hb = accel_dev->heartbeat; + + error = sysctl_handle_int(oidp, &hb->hb_sent_counter, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + +static int qat_dev_hb_read_failed(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_heartbeat *hb; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hb = accel_dev->heartbeat; + + error = sysctl_handle_int(oidp, &hb->hb_failed_counter, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + /* Handler for HB status check */ static int qat_dev_hb_read(SYSCTL_HANDLER_ARGS) { @@ -24,6 +68,10 @@ static int qat_dev_hb_read(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; struct adf_heartbeat *hb; int ret = 0; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev == NULL) { return EINVAL; } @@ -63,24 +111,28 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); hb->heartbeat_sent.oid = - SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, SYSCTL_CHILDREN(qat_hb_sysctl_tree), OID_AUTO, "heartbeat_sent", - CTLFLAG_RD, - &hb->hb_sent_counter, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, - "HB sent count"); + qat_dev_hb_read_sent, + "IU", + "HB failed count"); HB_SYSCTL_ERR(hb->heartbeat_sent.oid); hb->heartbeat_failed.oid = - SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, SYSCTL_CHILDREN(qat_hb_sysctl_tree), OID_AUTO, "heartbeat_failed", - CTLFLAG_RD, - &hb->hb_failed_counter, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, + qat_dev_hb_read_failed, + "IU", "HB failed count"); HB_SYSCTL_ERR(hb->heartbeat_failed.oid); diff --git a/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c index 76830e2920c3..a50e5fa62a18 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_common_drv.h" #include "adf_dev_err.h" #include "adf_freebsd_pfvf_ctrs_dbg.h" +#include #define MAX_REPORT_LINES (14) #define MAX_REPORT_LINE_LEN (64) @@ -92,6 +93,9 @@ static int adf_pfvf_ctrs_show(SYSCTL_HANDLER_ARGS) struct pfvf_stats *pfvf_counters = arg1; char report[MAX_REPORT_SIZE]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!pfvf_counters) return EINVAL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c b/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c index 35375bb20014..78ea6a7a5083 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c +++ b/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -14,6 +14,7 @@ #include #include #include +#include static int adf_ring_show(SYSCTL_HANDLER_ARGS) { @@ -25,6 +26,9 @@ static int adf_ring_show(SYSCTL_HANDLER_ARGS) int error, word; uint32_t *wp, *end; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); { int head, tail, empty; @@ -125,6 +129,9 @@ static int adf_bank_show(SYSCTL_HANDLER_ARGS) struct sbuf sb; int error, ring_id; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); bank = arg1; accel_dev = bank->accel_dev; diff --git a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c index 98cde6a742c1..041481435426 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c @@ -5,12 +5,16 @@ #include "adf_common_drv.h" #include "adf_accel_devices.h" #include "adf_ver_dbg.h" +#include static int adf_sysctl_read_fw_versions(SYSCTL_HANDLER_ARGS) { struct adf_accel_dev *accel_dev = arg1; char fw_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; @@ -34,6 +38,9 @@ static int adf_sysctl_read_hw_versions(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; char hw_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; @@ -55,6 +62,9 @@ static int adf_sysctl_read_mmp_versions(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; char mmp_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; diff --git a/sys/dev/qat/qat_common/adf_fw_counters.c b/sys/dev/qat/qat_common/adf_fw_counters.c index 1acabe4c9364..1356fa89e775 100644 --- a/sys/dev/qat/qat_common/adf_fw_counters.c +++ b/sys/dev/qat/qat_common/adf_fw_counters.c @@ -9,6 +9,7 @@ #include "icp_qat_fw_init_admin.h" #include #include +#include #define ADF_FW_COUNTERS_BUF_SZ 4096 #define ADF_RAS_EVENT_STR "RAS events" @@ -126,6 +127,9 @@ int adf_read_fw_counters(SYSCTL_HANDLER_ARGS) struct sbuf *sbuf = NULL; char *cbuf = NULL; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev == NULL) { return EINVAL; } diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c index e68d0bca80fc..a2bb36727fd4 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include #include @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,10 @@ static int adf_ae_config_show(SYSCTL_HANDLER_ARGS) u8 ae_index; u8 num_aes; int ret = 0; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + u32 num_au = hw_data->get_num_accel_units(hw_data); sbuf_new_for_sysctl(&sb, NULL, 2048, req); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c index 3821e60df746..4fdbec791ce6 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include "adf_c4xxx_misc_error_stats.h" #include "adf_common_drv.h" #include "adf_cfg_common.h" #include #include +#include #define MISC_ERROR_DBG_FILE "misc_error_stats" #define LINE \ @@ -23,6 +24,9 @@ static int qat_misc_error_show(SYSCTL_HANDLER_ARGS) { struct sbuf sb; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "\n"); sbuf_printf(&sb, LINE); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c index 61a879900f9c..06145a3d7906 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include "adf_c4xxx_pke_replay_stats.h" #include "adf_common_drv.h" #include "icp_qat_fw_init_admin.h" #include #include +#include #define PKE_REPLAY_DBG_FILE "pke_replay_stats" #define LINE \ @@ -21,6 +22,9 @@ static int qat_pke_replay_counters_show(SYSCTL_HANDLER_ARGS) u64 suc_counter = 0; u64 unsuc_counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "\n"); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c index d7cf8e350fa4..af4c6d123c84 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c @@ -1,10 +1,11 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_ras.h" #include "adf_accel_devices.h" #include "adf_c4xxx_hw_data.h" #include #include "adf_c4xxx_inline.h" +#include #define ADF_RAS_STR_LEN 64 @@ -13,6 +14,9 @@ static int adf_sysctl_read_ras_correctable(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_CORR]); @@ -24,6 +28,9 @@ static int adf_sysctl_read_ras_uncorrectable(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_UNCORR]); @@ -35,6 +42,9 @@ static int adf_sysctl_read_ras_fatal(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_FATAL]); @@ -47,6 +57,9 @@ static int adf_sysctl_write_ras_reset(SYSCTL_HANDLER_ARGS) int value = 0; int ret = SYSCTL_IN(req, &value, sizeof(value)); + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!ret && value != 0 && accel_dev->ras_counters) { } From nobody Fri Jun 6 13:57:08 2025 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 4bDND473H1z5x9xX; Fri, 06 Jun 2025 13:57: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 4bDND44g0jz3mR9; Fri, 06 Jun 2025 13:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/D3EVOghjF9xmDS89CZgThVmhMx30+dZy0aheRuoe2o=; b=kvXd9MQ2RRw4qm3rcgOnT8zmkpbStl9FW91wUtZtn8V2DjUTfQDpuyxZOvaJGNjblznKOE 0Gl+waZFyqBCUagMPERKP6YMsOSO2bfMm6NEVMrjtdVDLa9td9LahqwPAe24+1xv1FC6Be jfZ5I7/SKqJS1JCeckiIll37MY8aWm9lM9j4/YtItabgFx7pAGjNVYLDGJzZ0oqp7OKK19 +54dxTaEgUbLoRAXJqN75YpjPh9kpV03C7QYNJNeSeFZPMK6E997K6lPqW6nqEkAGoOBDl Z4YDYoWW4Ii0+Z4nH4XabuhZkY80N4Oui6zXorQMgEV7JnOcyMDQaTo4C0KizA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/D3EVOghjF9xmDS89CZgThVmhMx30+dZy0aheRuoe2o=; b=lyWemXlwIaaBN+BGj3b4P0A0Q1ZSlQTpmHE1xgZFwgORlXzqsO69IUAU5iAxe/HxY7NGcq 1pasxjaSmm0RbTeNkblv0zJ7TSgarncxmF98ypw/RB259wzhWhM34TsKkCboqMt8TMmx+p b+5wonN0FybXH1lXfEhEpl7MVG+9BWfFvT/j2AF8GcXPwZh38N7Eg48gw1cAnKeUENYHRJ o3FbWXUTYAYrQlEveecPUIIlNuRMsARoDoiZAiAAaJZkr0XKyjiCvdzEucgHf7BcSxtlEG vYh9f0SnI7efmUQEiVKdL2OcqnYw+G1VHtqHj202He3bwsjwx+g425OF3xkalw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218228; a=rsa-sha256; cv=none; b=qBoF+gscLj9OEuqlJq2w/S/CR8v8E0PrDkPs0G+SfkDGLrcUmkvmFLInw43xJY0yaauYgE ATS9arc6A0iYo1zUXPwomFLumqt8ycilAX30Obf2nZaLeMa7zX3NzAc4SI8797P7CwAQUx sx71d/+NJnFsHOtOwJuaCNvW3GHQaT2GztSPwS7EA03H30mBzZT8/lFrX5otU2Ri1wfsgG UA6AvSv1vPtg8C+3u+qTaMI6mKkgPJ8SkMYPThjUruRrTEuzeIhqPtBliTPKssP2XhiIfX AGNSVhb1yd9VSySz5sRAdV0jGMifHvOMdIC6lS+yb1TdDVtNjcgwRwru8E78Og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND43xt7zxVn; Fri, 06 Jun 2025 13:57: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 556Dv88c084058; Fri, 6 Jun 2025 13:57:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv8pU084055; Fri, 6 Jun 2025 13:57:08 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:08 GMT Message-Id: <202506061357.556Dv8pU084055@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: e745eee59c82 - main - qat: reimplement cpaCyGetXXXInstances as a wrapper 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: e745eee59c821c1d8ae7f5b25dfbdf0049b4787c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e745eee59c821c1d8ae7f5b25dfbdf0049b4787c commit e745eee59c821c1d8ae7f5b25dfbdf0049b4787c Author: Hareshx Sankar Raj AuthorDate: 2025-05-01 05:53:54 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:43:42 +0000 qat: reimplement cpaCyGetXXXInstances as a wrapper Currently code from sal_instances.c and sal_crypto.c for getting cy instances or number of instances is duplicated. This commit replaces cpaCyGetXXXInstances implementation with Lac_GetCyXXXInstancesByType invocation. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 205 ++------------------- .../qat/qat_api/common/ctrl/sal_get_instances.c | 177 ++++++++++++++---- .../qat_api/common/include/lac_sal_types_crypto.h | 23 ++- 3 files changed, 182 insertions(+), 223 deletions(-) diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c index e8a5ab1361e7..7bfc5ec3ba10 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c @@ -73,6 +73,15 @@ #define NUM_CRYPTO_ASYM_RX_RINGS 1 #define NUM_CRYPTO_NRBG_RX_RINGS 1 +CpaStatus Lac_GetCyInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U numInstances, + CpaInstanceHandle *pInstances); + +CpaStatus Lac_GetCyNumInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U *pNumInstances); + static CpaInstanceHandle Lac_CryptoGetFirstHandle(void) { @@ -1068,84 +1077,8 @@ cpaCyInstanceSetNotificationCb( CpaStatus cpaCyGetNumInstances(Cpa16U *pNumInstances) { - CpaStatus status = CPA_STATUS_SUCCESS; - CpaInstanceHandle cyInstanceHandle; - CpaInstanceInfo2 info; - icp_accel_dev_t **pAdfInsts = NULL; - icp_accel_dev_t *dev_addr = NULL; - sal_t *base_addr = NULL; - sal_list_t *list_temp = NULL; - Cpa16U num_accel_dev = 0; - Cpa16U num_inst = 0; - Cpa16U i = 0; - - LAC_CHECK_NULL_PARAM(pNumInstances); - - /* Get the number of accel_dev in the system */ - status = icp_amgr_getNumInstances(&num_accel_dev); - LAC_CHECK_STATUS(status); - - /* Allocate memory to store addr of accel_devs */ - pAdfInsts = - malloc(num_accel_dev * sizeof(icp_accel_dev_t *), M_QAT, M_WAITOK); - num_accel_dev = 0; - /* Get ADF to return all accel_devs that support either - * symmetric or asymmetric crypto */ - status = icp_amgr_getAllAccelDevByCapabilities( - (ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC), - pAdfInsts, - &num_accel_dev); - if (CPA_STATUS_SUCCESS != status) { - LAC_LOG_ERROR("No support for crypto\n"); - *pNumInstances = 0; - free(pAdfInsts, M_QAT); - return status; - } - - for (i = 0; i < num_accel_dev; i++) { - dev_addr = (icp_accel_dev_t *)pAdfInsts[i]; - if (NULL == dev_addr || NULL == dev_addr->pSalHandle) { - continue; - } - - base_addr = dev_addr->pSalHandle; - list_temp = base_addr->crypto_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - list_temp = base_addr->asym_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - } - *pNumInstances = num_inst; - free(pAdfInsts, M_QAT); - - - return status; + return Lac_GetCyNumInstancesByType(CPA_ACC_SVC_TYPE_CRYPTO, + pNumInstances); } /** @@ -1155,119 +1088,9 @@ cpaCyGetNumInstances(Cpa16U *pNumInstances) CpaStatus cpaCyGetInstances(Cpa16U numInstances, CpaInstanceHandle *pCyInstances) { - CpaStatus status = CPA_STATUS_SUCCESS; - CpaInstanceHandle cyInstanceHandle; - CpaInstanceInfo2 info; - icp_accel_dev_t **pAdfInsts = NULL; - icp_accel_dev_t *dev_addr = NULL; - sal_t *base_addr = NULL; - sal_list_t *list_temp = NULL; - Cpa16U num_accel_dev = 0; - Cpa16U num_allocated_instances = 0; - Cpa16U index = 0; - Cpa16U i = 0; - - - LAC_CHECK_NULL_PARAM(pCyInstances); - if (0 == numInstances) { - LAC_INVALID_PARAM_LOG("NumInstances is 0"); - return CPA_STATUS_INVALID_PARAM; - } - - /* Get the number of crypto instances */ - status = cpaCyGetNumInstances(&num_allocated_instances); - if (CPA_STATUS_SUCCESS != status) { - return status; - } - - if (numInstances > num_allocated_instances) { - QAT_UTILS_LOG("Only %d crypto instances available\n", - num_allocated_instances); - return CPA_STATUS_RESOURCE; - } - - /* Get the number of accel devices in the system */ - status = icp_amgr_getNumInstances(&num_accel_dev); - LAC_CHECK_STATUS(status); - - /* Allocate memory to store addr of accel_devs */ - pAdfInsts = - malloc(num_accel_dev * sizeof(icp_accel_dev_t *), M_QAT, M_WAITOK); - - num_accel_dev = 0; - /* Get ADF to return all accel_devs that support either - * symmetric or asymmetric crypto */ - status = icp_amgr_getAllAccelDevByCapabilities( - (ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC), - pAdfInsts, - &num_accel_dev); - if (CPA_STATUS_SUCCESS != status) { - LAC_LOG_ERROR("No support for crypto\n"); - free(pAdfInsts, M_QAT); - return status; - } - - for (i = 0; i < num_accel_dev; i++) { - dev_addr = (icp_accel_dev_t *)pAdfInsts[i]; - /* Note dev_addr cannot be NULL here as numInstances = 0 - * is not valid and if dev_addr = NULL then index = 0 (which - * is less than numInstances and status is set to _RESOURCE - * above - */ - base_addr = dev_addr->pSalHandle; - if (NULL == base_addr) { - continue; - } - list_temp = base_addr->crypto_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - list_temp = base_addr->asym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - } - free(pAdfInsts, M_QAT); - - return status; + return Lac_GetCyInstancesByType(CPA_ACC_SVC_TYPE_CRYPTO, + numInstances, + pCyInstances); } /** diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c b/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c index 27037e99d1ac..f68853dc43a8 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -10,7 +10,9 @@ * @ingroup SalCtrl * * @description - * This file contains the main function to get SAL instances. + * This file contains generic functions to get instances of a specified + * service type. Note these are complementary to the already existing + * service-specific functions. * *****************************************************************************/ @@ -34,19 +36,22 @@ #include "lac_mem.h" #include "lac_list.h" #include "lac_sal_types.h" +#include "lac_sal_types_crypto.h" /** ****************************************************************************** * @ingroup SalCtrl * @description - * Get either sym or asym instance number + * Get the total number of either sym, asym or cy instances *****************************************************************************/ -static CpaStatus -Lac_GetSingleCyNumInstances( +CpaStatus +Lac_GetCyNumInstancesByType( const CpaAccelerationServiceType accelerationServiceType, Cpa16U *pNumInstances) { CpaStatus status = CPA_STATUS_SUCCESS; + CpaInstanceHandle instanceHandle; + CpaInstanceInfo2 info; icp_accel_dev_t **pAdfInsts = NULL; icp_accel_dev_t *dev_addr = NULL; sal_t *base_addr = NULL; @@ -71,6 +76,12 @@ Lac_GetSingleCyNumInstances( service = "sym"; break; + case CPA_ACC_SVC_TYPE_CRYPTO: + accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | + ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + service = "cy"; + break; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; @@ -106,14 +117,48 @@ Lac_GetSingleCyNumInstances( } base_addr = dev_addr->pSalHandle; - if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType) { + if (CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->crypto_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } + } + + if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { list_temp = base_addr->asym_services; - } else { - list_temp = base_addr->sym_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } } - while (NULL != list_temp) { - num_inst++; - list_temp = SalList_next(list_temp); + + if (CPA_ACC_SVC_TYPE_CRYPTO_SYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->sym_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } } } @@ -127,15 +172,17 @@ Lac_GetSingleCyNumInstances( ****************************************************************************** * @ingroup SalCtrl * @description - * Get either sym or asym instance + * Get either sym, asym or cy instance *****************************************************************************/ -static CpaStatus -Lac_GetSingleCyInstances( +CpaStatus +Lac_GetCyInstancesByType( const CpaAccelerationServiceType accelerationServiceType, Cpa16U numInstances, CpaInstanceHandle *pInstances) { CpaStatus status = CPA_STATUS_SUCCESS; + CpaInstanceHandle instanceHandle = NULL; + CpaInstanceInfo2 info; icp_accel_dev_t **pAdfInsts = NULL; icp_accel_dev_t *dev_addr = NULL; sal_t *base_addr = NULL; @@ -163,14 +210,21 @@ Lac_GetSingleCyInstances( accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; service = "sym"; break; + + case CPA_ACC_SVC_TYPE_CRYPTO: + accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | + ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + service = "cy"; + break; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; } /* Get the number of instances */ - status = cpaGetNumInstances(accelerationServiceType, - &num_allocated_instances); + status = Lac_GetCyNumInstancesByType(accelerationServiceType, + &num_allocated_instances); if (CPA_STATUS_SUCCESS != status) { return status; } @@ -216,17 +270,63 @@ Lac_GetSingleCyInstances( continue; } - if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType) + if (CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->crypto_services; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } + } + + if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { list_temp = base_addr->asym_services; - else - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) - break; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } + } - pInstances[index] = SalList_getObject(list_temp); - list_temp = SalList_next(list_temp); - index++; + if (CPA_ACC_SVC_TYPE_CRYPTO_SYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->sym_services; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } } } free(pAdfInsts, M_QAT); @@ -242,16 +342,24 @@ CpaStatus cpaGetNumInstances(const CpaAccelerationServiceType accelerationServiceType, Cpa16U *pNumInstances) { + LAC_CHECK_NULL_PARAM(pNumInstances); + switch (accelerationServiceType) { case CPA_ACC_SVC_TYPE_CRYPTO_ASYM: case CPA_ACC_SVC_TYPE_CRYPTO_SYM: - return Lac_GetSingleCyNumInstances(accelerationServiceType, - pNumInstances); case CPA_ACC_SVC_TYPE_CRYPTO: - return cpaCyGetNumInstances(pNumInstances); + return Lac_GetCyNumInstancesByType(accelerationServiceType, + pNumInstances); + case CPA_ACC_SVC_TYPE_DATA_COMPRESSION: return cpaDcGetNumInstances(pNumInstances); + case CPA_ACC_SVC_TYPE_PATTERN_MATCH: + case CPA_ACC_SVC_TYPE_RAID: + case CPA_ACC_SVC_TYPE_XML: + QAT_UTILS_LOG("Unsupported service type\n"); + return CPA_STATUS_UNSUPPORTED; + default: QAT_UTILS_LOG("Invalid service type\n"); *pNumInstances = 0; @@ -268,18 +376,25 @@ cpaGetInstances(const CpaAccelerationServiceType accelerationServiceType, Cpa16U numInstances, CpaInstanceHandle *pInstances) { + LAC_CHECK_NULL_PARAM(pInstances); + switch (accelerationServiceType) { case CPA_ACC_SVC_TYPE_CRYPTO_ASYM: case CPA_ACC_SVC_TYPE_CRYPTO_SYM: - return Lac_GetSingleCyInstances(accelerationServiceType, + case CPA_ACC_SVC_TYPE_CRYPTO: + return Lac_GetCyInstancesByType(accelerationServiceType, numInstances, pInstances); - case CPA_ACC_SVC_TYPE_CRYPTO: - return cpaCyGetInstances(numInstances, pInstances); case CPA_ACC_SVC_TYPE_DATA_COMPRESSION: return cpaDcGetInstances(numInstances, pInstances); + case CPA_ACC_SVC_TYPE_PATTERN_MATCH: + case CPA_ACC_SVC_TYPE_RAID: + case CPA_ACC_SVC_TYPE_XML: + QAT_UTILS_LOG("Unsupported service type\n"); + return CPA_STATUS_UNSUPPORTED; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; diff --git a/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h b/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h index c26603e4b582..952c174adfec 100644 --- a/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h +++ b/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -187,4 +187,25 @@ typedef struct sal_crypto_service_s { CpaInstanceHandle Lac_GetFirstHandle(sal_service_type_t svc_type); +/** + ****************************************************************************** + * @ingroup SalCtrl + * @description + * Get the total number of either sym, asym or cy instances + *****************************************************************************/ +CpaStatus Lac_GetCyNumInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U *pNumInstances); + +/** + ****************************************************************************** + * @ingroup SalCtrl + * @description + * Get either sym, asym or cy instance + *****************************************************************************/ +CpaStatus Lac_GetCyInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U numInstances, + CpaInstanceHandle *pInstances); + #endif /*LAC_SAL_TYPES_CRYPTO_H_*/ From nobody Fri Jun 6 13:57:09 2025 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 4bDND61fqcz5xB9n; Fri, 06 Jun 2025 13:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND5538Gz3m9d; Fri, 06 Jun 2025 13:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEAjU1Trbcm+LO0FiA30y2jDyDMHDc8dsgF0wb2IXlg=; b=CnPOoRw1lxkBe7uxK8jJWsUV8ZTBTDEOajVuOtoax915tEHIci43zVGiC+jEr5FS4vnnTL mjo9kA0nc+gs9jl2nomOqLWVr/INPKrNAQzxOJ6ne6lLDB4sWfi7pjdR/1HRYErp5D9WsD sD+SnwPdpBvHXBqe6AcwDw038lHe1QHnEKjoc2BcUM/CW6vtvXM4Kje8Dej9AhQrgXJR3w qCdPqvPgNfDTLa0glGZEk20AGP5SXwoWozKA3CcVcj7SUDQkdQk6p+V4YlNW6ooQbrsDbL Y/kCDylIN/Slr8djcdrnu7rdcyJFtKTBQt4ALsfQv75nBgGLD256q7BXfp8dTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEAjU1Trbcm+LO0FiA30y2jDyDMHDc8dsgF0wb2IXlg=; b=e88+wlKByPY1qH6hI4wsbsTpr50cDzXc5wYhtrRWtDKkYkiRup6w1se9ZuPU2JI0y98O5L /cC08EnsBGR67PnPIZQZ70K+NPjDMeJAGnE/F8sYnek1dhLTSonfjtI71hdRzXTLiqHMBf LNj7Awjsrh3z+2RbzaaVCrzCgWShh01DxOWX9L6/m52VvhkopyYJ/QFVPXazVEsw09BB6Y QltlfEYwU1faxjn4VDOG0okzzOcHYr6Wp9ZRxhNnSFHzeBwVaysEdWSVHtdqdYbsXQRIFg m9hl+tR8zgyfP5VrweCEsyXyTYYQhT7BOL5OMKgLXay/UDYFFHYeH8z134Jy4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218229; a=rsa-sha256; cv=none; b=MVNOreeqIBX+TK/ygeW6mI8VOx82Byk3dincV8s29zPBVu3gTGIMfGuoXUjRP1k1AwCfj/ 0D80zQRsewjGa7l++C8Blwqpw4hjuvGlNdxI0RgKYh38ih6kuaZx5KyBoIqThKhxTT3FeQ vUIslR1JjYVVZuml52LmnV/TT10WP79kLxtg/qmnNnLuzH+27mXMt7a1IgbtguNJvRPnbD qlO8NvNzVEhrPMQBKtiFr6L0/glwxjacwQtTTapSlPnvRlstQRGq4Gl6E80gVNbBdoCSas WUskLqcVEKGuu/vd20eyv4zGJ/umJQYjRTymJ7+iBZ+17qslgGifARhEQejHmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND54c6Hzxv1; Fri, 06 Jun 2025 13:57:09 +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 556Dv9Aa084090; Fri, 6 Jun 2025 13:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Dv9Zc084087; Fri, 6 Jun 2025 13:57:09 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:09 GMT Message-Id: <202506061357.556Dv9Zc084087@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: ded037e65e52 - main - qat: driver updates to improve code and fix bugs 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: ded037e65e5239671b1292ec987a2e0894b217b5 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ded037e65e5239671b1292ec987a2e0894b217b5 commit ded037e65e5239671b1292ec987a2e0894b217b5 Author: Hareshx Sankar Raj AuthorDate: 2025-05-07 09:38:21 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:43:54 +0000 qat: driver updates to improve code and fix bugs Bug fixes and improvements are done for the qat code base to improve code quality. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/include/adf_cfg_device.h | 4 +- sys/dev/qat/include/adf_gen4vf_hw_csr_data.h | 4 +- sys/dev/qat/include/adf_pfvf_vf_msg.h | 3 +- sys/dev/qat/include/common/adf_accel_devices.h | 2 + sys/dev/qat/include/common/adf_cfg_common.h | 4 +- sys/dev/qat/include/common/adf_common_drv.h | 3 +- sys/dev/qat/include/common/adf_gen4_hw_data.h | 6 +- sys/dev/qat/include/common/adf_pfvf_msg.h | 8 ++- sys/dev/qat/include/icp_qat_fw_init_admin.h | 2 +- .../qat/qat_api/common/compression/dc_datapath.c | 11 +++- .../qat_api/common/crypto/sym/key/lac_sym_key.c | 8 +++ .../qat/qat_api/common/crypto/sym/lac_sym_hash.c | 11 ++-- .../common/crypto/sym/qat/lac_sym_qat_cipher.c | 35 +++++++++--- sys/dev/qat/qat_api/common/ctrl/sal_compression.c | 8 +-- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 4 +- .../qat_api/common/include/sal_types_compression.h | 4 +- sys/dev/qat/qat_api/include/icp_sal_versions.h | 4 +- sys/dev/qat/qat_common/adf_aer.c | 11 +++- sys/dev/qat/qat_common/adf_cfg_device.c | 14 ++++- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 1 + sys/dev/qat/qat_common/adf_freebsd_dev_processes.c | 20 ++----- sys/dev/qat/qat_common/adf_gen2_hw_data.c | 6 +- sys/dev/qat/qat_common/adf_gen4_pfvf.c | 3 +- sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c | 8 +-- sys/dev/qat/qat_common/adf_init.c | 66 +++++++++++++++++++++- sys/dev/qat/qat_common/adf_pfvf_vf_msg.c | 20 ++++++- sys/dev/qat/qat_common/adf_pfvf_vf_proto.c | 17 ++++-- sys/dev/qat/qat_common/adf_vf_isr.c | 15 ++++- sys/dev/qat/qat_common/qat_hal.c | 17 ++++-- sys/dev/qat/qat_common/qat_uclo.c | 12 ++-- sys/dev/qat/qat_hw/qat_200xx/adf_200xx_hw_data.h | 6 +- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 3 + sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 5 -- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c | 3 + sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h | 6 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_hw_data.c | 6 +- 36 files changed, 262 insertions(+), 98 deletions(-) diff --git a/sys/dev/qat/include/adf_cfg_device.h b/sys/dev/qat/include/adf_cfg_device.h index f2891e4eb805..1419292a262f 100644 --- a/sys/dev/qat/include/adf_cfg_device.h +++ b/sys/dev/qat/include/adf_cfg_device.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_CFG_DEVICE_H_ #define ADF_CFG_DEVICE_H_ @@ -79,4 +79,6 @@ int adf_cfg_device_init(struct adf_cfg_device *device, void adf_cfg_device_clear(struct adf_cfg_device *device, struct adf_accel_dev *accel_dev); +void adf_cfg_device_clear_all(struct adf_accel_dev *accel_dev); + #endif diff --git a/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h b/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h index ed78ab54ec4e..5143b88907ba 100644 --- a/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h +++ b/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_GEN4VF_HW_CSR_DATA_H_ #define ADF_GEN4VF_HW_CSR_DATA_H_ @@ -51,7 +51,7 @@ struct resource *_csr_base_addr = csr_base_addr; \ u32 _bank = bank; \ u32 _ring = ring; \ - dma_addr_t _value = value; \ + bus_addr_t _value = value; \ u32 l_base = 0, u_base = 0; \ l_base = (u32)((_value)&0xFFFFFFFF); \ u_base = (u32)(((_value)&0xFFFFFFFF00000000ULL) >> 32); \ diff --git a/sys/dev/qat/include/adf_pfvf_vf_msg.h b/sys/dev/qat/include/adf_pfvf_vf_msg.h index 3cf6d5ed0815..44066ca1fe85 100644 --- a/sys/dev/qat/include/adf_pfvf_vf_msg.h +++ b/sys/dev/qat/include/adf_pfvf_vf_msg.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_PFVF_VF_MSG_H #define ADF_PFVF_VF_MSG_H @@ -8,5 +8,6 @@ void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev); int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev); int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev); int adf_vf2pf_get_ring_to_svc(struct adf_accel_dev *accel_dev); +void adf_vf2pf_restarting_complete(struct adf_accel_dev *accel_dev); #endif /* ADF_PFVF_VF_MSG_H */ diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index b3f82234bc2b..c09aee8ea4bd 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -448,6 +448,7 @@ struct adf_hw_device_data { uint8_t num_accel; uint8_t num_logical_accel; uint8_t num_engines; + bool get_ring_to_svc_done; int (*get_storage_enabled)(struct adf_accel_dev *accel_dev, uint32_t *storage_enabled); u8 query_storage_cap; @@ -721,5 +722,6 @@ struct adf_accel_dev { bool is_vf; u32 accel_id; void *lac_dev; + struct mutex lock; /* protect accel_dev during start/stop e.t.c */ }; #endif diff --git a/sys/dev/qat/include/common/adf_cfg_common.h b/sys/dev/qat/include/common/adf_cfg_common.h index 4a85e021aeb7..eb3edec41742 100644 --- a/sys/dev/qat/include/common/adf_cfg_common.h +++ b/sys/dev/qat/include/common/adf_cfg_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_CFG_COMMON_H_ #define ADF_CFG_COMMON_H_ @@ -62,7 +62,7 @@ struct adf_pci_address { unsigned char bus; unsigned char dev; unsigned char func; -} __packed; +}; #define ADF_CFG_SERV_RING_PAIR_0_SHIFT 0 #define ADF_CFG_SERV_RING_PAIR_1_SHIFT 3 diff --git a/sys/dev/qat/include/common/adf_common_drv.h b/sys/dev/qat/include/common/adf_common_drv.h index b6bc2511bfba..f9f4463f69c3 100644 --- a/sys/dev/qat/include/common/adf_common_drv.h +++ b/sys/dev/qat/include/common/adf_common_drv.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_DRV_H #define ADF_DRV_H @@ -304,6 +304,7 @@ void adf_flush_vf_wq(struct adf_accel_dev *accel_dev); int adf_pf2vf_handle_pf_restarting(struct adf_accel_dev *accel_dev); int adf_pf2vf_handle_pf_rp_reset(struct adf_accel_dev *accel_dev, struct pfvf_message msg); +int adf_pf2vf_handle_pf_error(struct adf_accel_dev *accel_dev); bool adf_recv_and_handle_pf2vf_msg(struct adf_accel_dev *accel_dev); static inline int adf_sriov_configure(device_t *pdev, int numvfs) diff --git a/sys/dev/qat/include/common/adf_gen4_hw_data.h b/sys/dev/qat/include/common/adf_gen4_hw_data.h index d0423eaa17cf..cde5ae1f4e10 100644 --- a/sys/dev/qat/include/common/adf_gen4_hw_data.h +++ b/sys/dev/qat/include/common/adf_gen4_hw_data.h @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2021 Intel Corporation */ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_GEN4_HW_CSR_DATA_H_ #define ADF_GEN4_HW_CSR_DATA_H_ @@ -62,7 +62,7 @@ struct resource *_csr_base_addr = csr_base_addr; \ u32 _bank = bank; \ u32 _ring = ring; \ - dma_addr_t _value = value; \ + bus_addr_t _value = value; \ u32 l_base = 0, u_base = 0; \ l_base = lower_32_bits(_value); \ u_base = upper_32_bits(_value); \ diff --git a/sys/dev/qat/include/common/adf_pfvf_msg.h b/sys/dev/qat/include/common/adf_pfvf_msg.h index 349db9a13b22..abd9cd46014f 100644 --- a/sys/dev/qat/include/common/adf_pfvf_msg.h +++ b/sys/dev/qat/include/common/adf_pfvf_msg.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_PFVF_MSG_H #define ADF_PFVF_MSG_H @@ -97,6 +97,7 @@ enum pf2vf_msgtype { ADF_PF2VF_MSGTYPE_RESTARTING = 0x01, ADF_PF2VF_MSGTYPE_VERSION_RESP = 0x02, ADF_PF2VF_MSGTYPE_BLKMSG_RESP = 0x03, + ADF_PF2VF_MSGTYPE_FATAL_ERROR = 0x04, /* Values from 0x10 are Gen4 specific, message type is only 4 bits in Gen2 devices. */ ADF_PF2VF_MSGTYPE_RP_RESET_RESP = 0x10, @@ -111,6 +112,7 @@ enum vf2pf_msgtype { ADF_VF2PF_MSGTYPE_LARGE_BLOCK_REQ = 0x07, ADF_VF2PF_MSGTYPE_MEDIUM_BLOCK_REQ = 0x08, ADF_VF2PF_MSGTYPE_SMALL_BLOCK_REQ = 0x09, + ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE = 0x0a, /* Values from 0x10 are Gen4 specific, message type is only 4 bits in Gen2 devices. */ ADF_VF2PF_MSGTYPE_RP_RESET = 0x10, @@ -124,8 +126,10 @@ enum pfvf_compatibility_version { ADF_PFVF_COMPAT_FAST_ACK = 0x03, /* Ring to service mapping support for non-standard mappings */ ADF_PFVF_COMPAT_RING_TO_SVC_MAP = 0x04, + /* Fallback compat */ + ADF_PFVF_COMPAT_FALLBACK = 0x05, /* Reference to the latest version */ - ADF_PFVF_COMPAT_THIS_VERSION = 0x04, + ADF_PFVF_COMPAT_THIS_VERSION = 0x05, }; /* PF->VF Version Response */ diff --git a/sys/dev/qat/include/icp_qat_fw_init_admin.h b/sys/dev/qat/include/icp_qat_fw_init_admin.h index cd4edbdbc93b..f3e0ff9d0064 100644 --- a/sys/dev/qat/include/icp_qat_fw_init_admin.h +++ b/sys/dev/qat/include/icp_qat_fw_init_admin.h @@ -198,8 +198,8 @@ struct icp_qat_fw_init_admin_resp { enum icp_qat_fw_init_admin_init_flag { ICP_QAT_FW_INIT_FLAG_PKE_DISABLED = 0 }; struct icp_qat_fw_init_admin_hb_cnt { - u16 resp_heartbeat_cnt; u16 req_heartbeat_cnt; + u16 resp_heartbeat_cnt; }; #define ICP_QAT_FW_COMN_HEARTBEAT_OK 0 diff --git a/sys/dev/qat/qat_api/common/compression/dc_datapath.c b/sys/dev/qat/qat_api/common/compression/dc_datapath.c index f5a8600eadfa..312b2d6749cc 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_datapath.c +++ b/sys/dev/qat/qat_api/common/compression/dc_datapath.c @@ -118,14 +118,19 @@ dcCompression_ProcessCallback(void *pRespMsg) /* Cast response message to compression response message type */ pCompRespMsg = (icp_qat_fw_comp_resp_t *)pRespMsg; - + if (!(pCompRespMsg)) { + QAT_UTILS_LOG("pCompRespMsg is NULL\n"); + return; + } /* Extract request data pointer from the opaque data */ LAC_MEM_SHARED_READ_TO_PTR(pCompRespMsg->opaque_data, pReqData); + if (!(pReqData)) { + QAT_UTILS_LOG("pReqData is NULL\n"); + return; + } /* Extract fields from the request data structure */ pCookie = (dc_compression_cookie_t *)pReqData; - if (!pCookie) - return; pSessionDesc = DC_SESSION_DESC_FROM_CTX_GET(pCookie->pSessionHandle); pService = (sal_compression_service_t *)(pCookie->dcInstance); diff --git a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c index 965874e7466f..36e0175f988a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c @@ -2160,6 +2160,14 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, } } + /* check 0 secret length as it is not valid for SSL3 Key Gen + * request */ + if (0 == uSecretLen) { + LAC_INVALID_PARAM_LOG1("%u secret.dataLenInBytes", + uSecretLen); + return CPA_STATUS_INVALID_PARAM; + } + /* Only seed length for SSL3 Key Gen request */ if (maxSeedLen != uSeedLen) { LAC_INVALID_PARAM_LOG("seed.dataLenInBytes"); diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c index 5ad64ca09a0b..46f652cfd5c6 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c @@ -751,10 +751,13 @@ LacHash_PerformParamCheck(CpaInstanceHandle instanceHandle, &pHashAlgInfo); /* check if the message is a multiple of the block size. */ - if ((pOpData->messageLenToHashInBytes % - pHashAlgInfo->blockLength) != 0) { - LAC_INVALID_PARAM_LOG( - "messageLenToHashInBytes not block size"); + if (pOpData->messageLenToHashInBytes % + pHashAlgInfo->blockLength != + 0) { + LAC_INVALID_PARAM_LOG2( + "message(%d) not block-size(%d) multiple", + pOpData->messageLenToHashInBytes, + pHashAlgInfo->blockLength); return CPA_STATUS_INVALID_PARAM; } } diff --git a/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c b/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c index c6fbeb1b888a..d8a7ac75aec1 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c @@ -214,6 +214,11 @@ static const uint8_t key_size_f8[] = { ICP_QAT_HW_CIPHER_ALGO_AES256 /* ICP_QAT_HW_AES_256_F8_KEY_SZ */ }; +/* This array must be kept aligned with CpaCySymCipherAlgorithm enum but + * offset by -1 as that enum starts at 1. LacSymQat_CipherGetCfgData() + * below relies on that alignment and uses that enum -1 to index into this + * array. + */ typedef struct _icp_qat_hw_cipher_info { icp_qat_hw_cipher_algo_t algorithm; icp_qat_hw_cipher_mode_t mode; @@ -542,7 +547,7 @@ LacSymQat_CipherGetCfgData(lac_session_desc_t *pSession, sal_crypto_service_t *pService = (sal_crypto_service_t *)pSession->pInstance; - CpaCySymCipherAlgorithm cipherAlgorithm = 0; + int cipherIdx = 0; icp_qat_hw_cipher_dir_t cipherDirection = 0; /* Set defaults */ @@ -551,21 +556,33 @@ LacSymQat_CipherGetCfgData(lac_session_desc_t *pSession, *pMode = ICP_QAT_HW_CIPHER_ECB_MODE; *pDir = ICP_QAT_HW_CIPHER_ENCRYPT; - /* decrease since it's numbered from 1 instead of 0 */ - cipherAlgorithm = pSession->cipherAlgorithm - 1; + /* offset index as CpaCySymCipherAlgorithm enum starts from 1, not from + * 0 */ + cipherIdx = pSession->cipherAlgorithm - 1; cipherDirection = pSession->cipherDirection == CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT ? ICP_QAT_HW_CIPHER_ENCRYPT : ICP_QAT_HW_CIPHER_DECRYPT; - *pAlgorithm = icp_qat_alg_info[cipherAlgorithm].algorithm; - *pMode = icp_qat_alg_info[cipherAlgorithm].mode; - *pDir = icp_qat_alg_info[cipherAlgorithm].dir[cipherDirection]; + /* Boundary check against the last value in the algorithm enum */ + if (!(pSession->cipherAlgorithm <= CPA_CY_SYM_CIPHER_SM4_CTR)) { + QAT_UTILS_LOG("Invalid cipherAlgorithm value\n"); + return; + } + + if (!(cipherDirection <= ICP_QAT_HW_CIPHER_DECRYPT)) { + QAT_UTILS_LOG("Invalid cipherDirection value\n"); + return; + } + + *pAlgorithm = icp_qat_alg_info[cipherIdx].algorithm; + *pMode = icp_qat_alg_info[cipherIdx].mode; + *pDir = icp_qat_alg_info[cipherIdx].dir[cipherDirection]; *pKey_convert = - icp_qat_alg_info[cipherAlgorithm].key_convert[cipherDirection]; + icp_qat_alg_info[cipherIdx].key_convert[cipherDirection]; - if (IS_KEY_DEP_NO != icp_qat_alg_info[cipherAlgorithm].isKeyLenDepend) { - *pAlgorithm = icp_qat_alg_info[cipherAlgorithm] + if (IS_KEY_DEP_NO != icp_qat_alg_info[cipherIdx].isKeyLenDepend) { + *pAlgorithm = icp_qat_alg_info[cipherIdx] .pAlgByKeySize[pSession->cipherKeyLenInBytes]; } diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_compression.c b/sys/dev/qat/qat_api/common/ctrl/sal_compression.c index c0f5a411d87e..e8ae47f0f0d3 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_compression.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_compression.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** * @file sal_compression.c @@ -371,9 +371,6 @@ SalCtrl_CompressionInit(icp_accel_dev_t *device, sal_service_t *service) SAL_SERVICE_GOOD_FOR_INIT(pCompressionService); - pCompressionService->generic_service_info.state = - SAL_SERVICE_STATE_INITIALIZING; - if (CPA_FALSE == pCompressionService->generic_service_info.is_dyn) { section = icpGetProcessName(); } @@ -1438,7 +1435,8 @@ cpaDcInstanceGetInfo2(const CpaInstanceHandle instanceHandle, pInstanceInfo2->isOffloaded = CPA_TRUE; /* Get the instance name and part name from the config file */ dev = icp_adf_getAccelDevByAccelId(pCompressionService->pkgID); - if (NULL == dev) { + if (NULL == dev || + 0 == strnlen(dev->deviceName, ADF_DEVICE_TYPE_LENGTH + 1)) { QAT_UTILS_LOG("Can not find device for the instance.\n"); LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2)); return CPA_STATUS_FAIL; diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c index 7bfc5ec3ba10..3e134f43af6e 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c @@ -1235,7 +1235,8 @@ cpaCyInstanceGetInfo2(const CpaInstanceHandle instanceHandle_in, /* Get the instance name and part name */ dev = icp_adf_getAccelDevByAccelId(pCryptoService->pkgID); - if (NULL == dev) { + if (NULL == dev || + 0 == strnlen(dev->deviceName, ADF_DEVICE_TYPE_LENGTH + 1)) { LAC_LOG_ERROR("Can not find device for the instance\n"); LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2)); return CPA_STATUS_FAIL; @@ -1717,7 +1718,6 @@ Lac_GetFirstHandle(sal_service_type_t svc_type) default: LAC_LOG_ERROR("Invalid service type\n"); return NULL; - break; } /* Only need 1 dev with crypto enabled - so check all devices*/ status = icp_amgr_getAllAccelDevByEachCapability(capabilities, diff --git a/sys/dev/qat/qat_api/common/include/sal_types_compression.h b/sys/dev/qat/qat_api/common/include/sal_types_compression.h index d7bfe33cab08..4b17438b3258 100644 --- a/sys/dev/qat/qat_api/common/include/sal_types_compression.h +++ b/sys/dev/qat/qat_api/common/include/sal_types_compression.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** * @file sal_types_compression.h @@ -24,6 +24,8 @@ #define DC_NUM_RX_RINGS (1) #define DC_NUM_COMPRESSION_LEVELS (CPA_DC_L12) +#define MAX_SGL_NUM 0x10000 + /** ***************************************************************************** * @ingroup SalCtrl diff --git a/sys/dev/qat/qat_api/include/icp_sal_versions.h b/sys/dev/qat/qat_api/include/icp_sal_versions.h index db1ba297adc6..03bcef4fcbbb 100644 --- a/sys/dev/qat/qat_api/include/icp_sal_versions.h +++ b/sys/dev/qat/qat_api/include/icp_sal_versions.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** * @file icp_sal_versions.h @@ -26,7 +26,7 @@ /* Part name and number of the accelerator device */ #define SAL_INFO2_DRIVER_SW_VERSION_MAJ_NUMBER 3 -#define SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER 14 +#define SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER 15 #define SAL_INFO2_DRIVER_SW_VERSION_PATCH_NUMBER 0 /** diff --git a/sys/dev/qat/qat_common/adf_aer.c b/sys/dev/qat/qat_common/adf_aer.c index 6be8ab04bbd7..0f402ba255ed 100644 --- a/sys/dev/qat/qat_common/adf_aer.c +++ b/sys/dev/qat/qat_common/adf_aer.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -276,6 +276,15 @@ adf_notify_fatal_error_work(struct work_struct *work) struct adf_fatal_error_data *wq_data = container_of(work, struct adf_fatal_error_data, work); struct adf_accel_dev *accel_dev = wq_data->accel_dev; + struct adf_hw_device_data *hw_device = accel_dev->hw_device; + + if (adf_dev_in_use(accel_dev)) { + if (hw_device->pre_reset) { + device_printf(GET_DEV(accel_dev), + "Performing pre reset save\n"); + hw_device->pre_reset(accel_dev); + } + } adf_error_notifier((uintptr_t)accel_dev); if (!accel_dev->is_vf) { diff --git a/sys/dev/qat/qat_common/adf_cfg_device.c b/sys/dev/qat/qat_common/adf_cfg_device.c index a26d2fdfd32e..4860a4064b97 100644 --- a/sys/dev/qat/qat_common/adf_cfg_device.c +++ b/sys/dev/qat/qat_common/adf_cfg_device.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_cfg_instance.h" #include "adf_cfg_section.h" #include "adf_cfg_device.h" @@ -677,6 +677,18 @@ adf_cfg_device_clear(struct adf_cfg_device *device, device->instances = NULL; } +void +adf_cfg_device_clear_all(struct adf_accel_dev *accel_dev) +{ + sx_xlock(&accel_dev->cfg->lock); + if (accel_dev->cfg->dev) { + adf_cfg_device_clear(accel_dev->cfg->dev, accel_dev); + free(accel_dev->cfg->dev, M_QAT); + accel_dev->cfg->dev = NULL; + } + sx_xunlock(&accel_dev->cfg->lock); +} + /* * Static configuration for userspace */ diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index 539059589bc8..e4ddbf489192 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -93,6 +93,7 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) /* Extracting number of Acceleration Engines */ num_aes = hw_device->get_num_aes(hw_device); + explicit_bzero(&request, sizeof(struct icp_qat_fw_init_admin_req)); for (ae = 0; ae < num_aes; ae++) { if (accel_dev->au_info && !test_bit(ae, &dc_ae_msk)) continue; diff --git a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c index 661d5bd0f14e..67e1d4ad2cab 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c +++ b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ - +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -85,7 +84,7 @@ static struct cdevsw adf_state_cdevsw = { .d_name = ADF_DEV_STATE_NAME, }; -static const struct filterops adf_state_read_filterops = { +static struct filterops adf_state_read_filterops = { .f_isfd = 1, .f_attach = NULL, .f_detach = adf_state_kqread_detach, @@ -410,17 +409,6 @@ adf_state_set(int dev, enum adf_event event) state->state.dev_state = event; state->state.dev_id = dev; STAILQ_INSERT_TAIL(head, state, entries_state); - if (event == ADF_EVENT_STOP) { - state = NULL; - state = malloc(sizeof(struct entry_state), - M_QAT, - M_NOWAIT | M_ZERO); - if (!state) - continue; - state->state.dev_state = ADF_EVENT_SHUTDOWN; - state->state.dev_id = dev; - STAILQ_INSERT_TAIL(head, state, entries_state); - } } mtx_unlock(&mtx); callout_schedule(&callout, ADF_STATE_CALLOUT_TIME); @@ -451,7 +439,7 @@ adf_state_event_handler(struct adf_accel_dev *accel_dev, enum adf_event event) case ADF_EVENT_START: return ret; case ADF_EVENT_STOP: - break; + return ret; case ADF_EVENT_ERROR: break; #if defined(QAT_UIO) && defined(QAT_DBG) @@ -548,6 +536,7 @@ adf_state_destroy(void) struct entry_proc_events *proc_events = NULL; adf_service_unregister(&adf_state_hndl); + destroy_dev(adf_state_dev); mtx_lock(&callout_mtx); callout_stop(&callout); mtx_unlock(&callout_mtx); @@ -560,7 +549,6 @@ adf_state_destroy(void) } mtx_unlock(&mtx); mtx_destroy(&mtx); - destroy_dev(adf_state_dev); } static int diff --git a/sys/dev/qat/qat_common/adf_gen2_hw_data.c b/sys/dev/qat/qat_common/adf_gen2_hw_data.c index 10e86f8cd218..92fd2b9bc8e5 100644 --- a/sys/dev/qat/qat_common/adf_gen2_hw_data.c +++ b/sys/dev/qat/qat_common/adf_gen2_hw_data.c @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2021 Intel Corporation */ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_gen2_hw_data.h" #include "icp_qat_hw.h" @@ -54,7 +54,7 @@ write_csr_ring_config(struct resource *csr_base_addr, WRITE_CSR_RING_CONFIG(csr_base_addr, bank, ring, value); } -static dma_addr_t +static bus_addr_t read_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring) { return READ_CSR_RING_BASE(csr_base_addr, bank, ring); diff --git a/sys/dev/qat/qat_common/adf_gen4_pfvf.c b/sys/dev/qat/qat_common/adf_gen4_pfvf.c index 03bb90938e85..122abb301d31 100644 --- a/sys/dev/qat/qat_common/adf_gen4_pfvf.c +++ b/sys/dev/qat/qat_common/adf_gen4_pfvf.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include -#include #include #include "adf_accel_devices.h" #include "adf_common_drv.h" diff --git a/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c b/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c index 5c06b413b528..bfa778ea301b 100644 --- a/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c +++ b/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c @@ -1,10 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_gen4vf_hw_csr_data.h" static u64 -build_csr_ring_base_addr(dma_addr_t addr, u32 size) +build_csr_ring_base_addr(bus_addr_t addr, u32 size) { return BUILD_RING_BASE_ADDR_GEN4(addr, size); } @@ -54,7 +54,7 @@ write_csr_ring_config(struct resource *csr_base_addr, WRITE_CSR_RING_CONFIG_GEN4VF(csr_base_addr, bank, ring, value); } -static dma_addr_t +static bus_addr_t read_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring) { return READ_CSR_RING_BASE_GEN4VF(csr_base_addr, bank, ring); @@ -64,7 +64,7 @@ static void write_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring, - dma_addr_t addr) + bus_addr_t addr) { WRITE_CSR_RING_BASE_GEN4VF(csr_base_addr, bank, ring, addr); } diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index 9f239b8f63d3..6bd0d85aae69 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -20,6 +20,10 @@ #include "adf_common_drv.h" #include "icp_qat_fw.h" +#if defined(QAT_UIO) +#include "adf_cfg_device.h" +#endif /* QAT_UIO*/ + /* Mask used to check the CompressAndVerify capability bit */ #define DC_CNV_EXTENDED_CAPABILITY (0x01) @@ -29,6 +33,11 @@ static LIST_HEAD(service_table); static DEFINE_MUTEX(service_lock); +static int adf_dev_init_locked(struct adf_accel_dev *accel_dev); +static int adf_dev_start_locked(struct adf_accel_dev *accel_dev); +static int adf_dev_stop_locked(struct adf_accel_dev *accel_dev); +static void adf_dev_shutdown_locked(struct adf_accel_dev *accel_dev); + static void adf_service_add(struct service_hndl *service) { @@ -261,6 +270,18 @@ adf_set_ssm_wdtimer(struct adf_accel_dev *accel_dev) */ int adf_dev_init(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_init_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_init_locked(struct adf_accel_dev *accel_dev) { struct service_hndl *service; struct list_head *list_itr; @@ -410,6 +431,18 @@ adf_dev_init(struct adf_accel_dev *accel_dev) */ int adf_dev_start(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_start_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_start_locked(struct adf_accel_dev *accel_dev) { struct adf_hw_device_data *hw_data = accel_dev->hw_device; struct service_hndl *service; @@ -507,6 +540,18 @@ adf_dev_start(struct adf_accel_dev *accel_dev) */ int adf_dev_stop(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_stop_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_stop_locked(struct adf_accel_dev *accel_dev) { struct service_hndl *service; struct list_head *list_itr; @@ -517,6 +562,10 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) accel_dev->accel_id); return ENODEV; } + + if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) + return 0; + if (!adf_dev_started(accel_dev) && !test_bit(ADF_STATUS_STARTING, &accel_dev->status)) { return 0; @@ -570,11 +619,22 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) */ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) +{ + mutex_lock(&accel_dev->lock); + adf_dev_shutdown_locked(accel_dev); + mutex_unlock(&accel_dev->lock); +} + +static void +adf_dev_shutdown_locked(struct adf_accel_dev *accel_dev) { struct adf_hw_device_data *hw_data = accel_dev->hw_device; struct service_hndl *service; struct list_head *list_itr; + if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) + return; + if (test_bit(ADF_STATUS_SYSCTL_CTX_INITIALISED, &accel_dev->status)) { sysctl_ctx_free(&accel_dev->sysctl_ctx); clear_bit(ADF_STATUS_SYSCTL_CTX_INITIALISED, @@ -623,8 +683,12 @@ adf_dev_shutdown(struct adf_accel_dev *accel_dev) } /* Delete configuration only if not restarting */ - if (!test_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) + if (!test_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) { adf_cfg_del_all(accel_dev); +#ifdef QAT_UIO + adf_cfg_device_clear_all(accel_dev); +#endif + } if (hw_data->remove_pke_stats) hw_data->remove_pke_stats(accel_dev); diff --git a/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c b/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c index dc0cb0110ec3..8c0221d344ff 100644 --- a/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c +++ b/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include "adf_accel_devices.h" #include "adf_common_drv.h" @@ -98,6 +98,22 @@ adf_vf2pf_request_version(struct adf_accel_dev *accel_dev) return 0; } +void +adf_vf2pf_restarting_complete(struct adf_accel_dev *accel_dev) +{ + struct pfvf_message msg = { .type = + ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE }; + + if (accel_dev->u1.vf.pf_compat_ver < ADF_PFVF_COMPAT_FALLBACK) + return; + + if (adf_send_vf2pf_msg(accel_dev, msg)) { + device_printf( + GET_DEV(accel_dev), + "Failed to send Restarting complete event to PF\n"); + } +} + int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev) { @@ -180,5 +196,7 @@ adf_vf2pf_get_ring_to_svc(struct adf_accel_dev *accel_dev) /* Only v1 at present */ accel_dev->hw_device->ring_to_svc_map = rts_map_msg.map; + accel_dev->hw_device->get_ring_to_svc_done = true; + return 0; } diff --git a/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c b/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c index a09ddb819831..2a338b96a5f3 100644 --- a/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c +++ b/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include "adf_accel_devices.h" #include "adf_common_drv.h" @@ -89,9 +89,15 @@ adf_send_vf2pf_req(struct adf_accel_dev *accel_dev, } /* Wait for response, if it times out retry */ - ret = - wait_for_completion_timeout(&accel_dev->u1.vf.msg_received, - timeout); + if (!cold) { + ret = wait_for_completion_timeout( + &accel_dev->u1.vf.msg_received, timeout); + } else { + /* In cold start timers may not be initialized yet */ + DELAY(ADF_PFVF_MSG_RESP_TIMEOUT * 1000); + ret = try_wait_for_completion( + &accel_dev->u1.vf.msg_received); + } if (ret) { if (likely(resp)) *resp = accel_dev->u1.vf.response; @@ -346,6 +352,9 @@ adf_handle_pf2vf_msg(struct adf_accel_dev *accel_dev, struct pfvf_message msg) case ADF_PF2VF_MSGTYPE_RP_RESET_RESP: adf_pf2vf_handle_pf_rp_reset(accel_dev, msg); return true; + case ADF_PF2VF_MSGTYPE_FATAL_ERROR: + adf_pf2vf_handle_pf_error(accel_dev); + return true; case ADF_PF2VF_MSGTYPE_VERSION_RESP: case ADF_PF2VF_MSGTYPE_BLKMSG_RESP: accel_dev->u1.vf.response = msg; diff --git a/sys/dev/qat/qat_common/adf_vf_isr.c b/sys/dev/qat/qat_common/adf_vf_isr.c index a34e23b8fb4b..9f98ecd09d6e 100644 --- a/sys/dev/qat/qat_common/adf_vf_isr.c +++ b/sys/dev/qat/qat_common/adf_vf_isr.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include #include @@ -17,6 +17,7 @@ #include "adf_transport_access_macros.h" #include "adf_transport_internal.h" #include "adf_pfvf_utils.h" +#include "adf_pfvf_vf_msg.h" static TASKQUEUE_DEFINE_THREAD(qat_vf); static TASKQUEUE_DEFINE_THREAD(qat_bank_handler); @@ -65,6 +66,7 @@ adf_dev_stop_async(struct work_struct *work) /* Re-enable PF2VF interrupts */ hw_data->enable_pf2vf_interrupt(accel_dev); + adf_vf2pf_restarting_complete(accel_dev); kfree(stop_data); } @@ -123,6 +125,17 @@ adf_pf2vf_handle_pf_rp_reset(struct adf_accel_dev *accel_dev, return 0; } +int +adf_pf2vf_handle_pf_error(struct adf_accel_dev *accel_dev) +{ + device_printf(GET_DEV(accel_dev), "Fatal error received from PF\n"); + + if (adf_notify_fatal_error(accel_dev)) + device_printf(GET_DEV(accel_dev), "Couldn't notify fatal error\n"); + + return 0; +} + static void adf_pf2vf_bh_handler(void *data, int pending) { diff --git a/sys/dev/qat/qat_common/qat_hal.c b/sys/dev/qat/qat_common/qat_hal.c index b1e35e77272a..75190246ee1d 100644 --- a/sys/dev/qat/qat_common/qat_hal.c +++ b/sys/dev/qat/qat_common/qat_hal.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -1052,8 +1052,7 @@ qat_hal_init(struct adf_accel_dev *accel_dev) handle->hal_cap_ae_xfer_csr_addr_v = ae_offset; handle->hal_ep_csr_addr_v = ep_offset; handle->hal_cap_ae_local_csr_addr_v = - ((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v + - LOCAL_TO_XFER_REG_OFFSET); + ((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v + LOCAL_TO_XFER_REG_OFFSET); handle->fw_auth = (pci_get_device(GET_DEV(handle->accel_dev)) == ADF_DH895XCC_PCI_DEVICE_ID) ? false : @@ -1283,7 +1282,7 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, unsigned int max_cycle, unsigned int *endpc) { - uint64_t savuwords[MAX_EXEC_INST]; + u64 *savuwords = NULL; unsigned int ind_lm_addr0, ind_lm_addr1; unsigned int ind_lm_addr2, ind_lm_addr3; unsigned int ind_lm_addr_byte0, ind_lm_addr_byte1; @@ -1300,6 +1299,11 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, pr_err("QAT: invalid instruction num %d\n", inst_num); return EINVAL; } + + savuwords = kzalloc(sizeof(u64) * MAX_EXEC_INST, GFP_KERNEL); + if (!savuwords) + return ENOMEM; + /* save current context */ qat_hal_rd_indr_csr(handle, ae, ctx, LM_ADDR_0_INDIRECT, &ind_lm_addr0); qat_hal_rd_indr_csr(handle, ae, ctx, LM_ADDR_1_INDIRECT, &ind_lm_addr1); @@ -1360,8 +1364,10 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, qat_hal_wr_ae_csr(handle, ae, CTX_SIG_EVENTS_ACTIVE, 0); qat_hal_enable_ctx(handle, ae, (1 << ctx)); /* wait for micro codes to finish */ - if (qat_hal_wait_cycles(handle, ae, max_cycle, 1) != 0) + if (qat_hal_wait_cycles(handle, ae, max_cycle, 1) != 0) { + kfree(savuwords); return EFAULT; + } *** 152 LINES SKIPPED *** From nobody Fri Jun 6 13:57:10 2025 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 4bDND66SBVz5xB54; Fri, 06 Jun 2025 13:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND65wmfz3mMF; Fri, 06 Jun 2025 13:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiV1EHdqlKL/Ql+Gre6Q+ulavKbIkp/8GeboPml/53Q=; b=asx2B0YP4hYGZVBCuwPuROPcXPx1f/I/MBAZpowhndV5xcnlUacX5af7zAKV4kDo+vfqT7 27Pp++neohlvJLHlR97n6CEJVE3IBAjhJwy/yGmBNDiJa6g900wwIoUNBMxP8JrUHgXjiD /1B0NspNuxh9kwZGWrjUTT+UfHbg7y6vOygL//cJM2bzWUHB0GJ74l+higQMZrcxVNNJ3W YAZjMiXWmUpxe7gLKcTnBTuKiqxWnMS+NljNxsz5IyWU/xwyD+63B95W6LDmWPDHC2bx1f QI2+4YThdSNEZr9i7VRfLSpmD71iMjADVQJel4MHFXslUL/8/egHPqRaxrv2AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiV1EHdqlKL/Ql+Gre6Q+ulavKbIkp/8GeboPml/53Q=; b=oubT3zL+crBZoeBk3tKA2BoSycrGHNjNdyh3cXS0VaOrH6QrW+BwBk5P6mOXstRSWtm5t5 DY6QfNJvIq2/2TkdiH2FE7pJGePjqkT+JfaPdD+D52Ov8CRyG3ZQgohwXmznqrCPjuGtXv 9VU5jKtK5g+w5LDPgPPtPlPNL2MCOsM1QmXz9QyLT6KilnrgGTHuvorIF3Cej4sJGDN/4s 7wJSzslCw29oS/XdvqPIyeq1xlK28KtT8fzXn3OeSWDP2AJC6aYGkYLQT/Y3mdUWgVOav/ 3SxmRcGdCQJqEnVxxLgA3lGKN+N1rrw28T+/qxtxjqFXsLJKKVPaAKcVHHE0dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218230; a=rsa-sha256; cv=none; b=pQn7wMXsM97rX4VfedKex91Vd8C0oJtMxIbvDnW9YOAkB8wpf4u4d5oEYUWqGCs0BAqdsE Y/fwZ8tZiMiYYFo5pkc/VVij7iPL23HtRaNh7i/lhSFSxCPa0tYdaggwIc0lwejX+h0PLD xY2Xm2Qbm1WAqz/tRpdMUlv+BcFSpo3vonl1HGl0+5rgBBdgP+C/ifxZuQqal82+ekAOrU C1DcYmYWI7dbRiUOKW4y0qVQKVmOpd6OwQr0CYc1YvD+GJvzPUH+p/8HHW0mjwUW7JSg2Z qL3PrjOHCIonYfm7I2eiYU4Pg9tU65Kn4tGvy5X4tBSrDPJPwkWJLihq7x1sdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND65H11zxl5; Fri, 06 Jun 2025 13:57: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 556DvAVO084124; Fri, 6 Jun 2025 13:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556DvAUS084121; Fri, 6 Jun 2025 13:57:10 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:10 GMT Message-Id: <202506061357.556DvAUS084121@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: ae1dc27639c8 - main - qat: refactor error handling and add mutex locks 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: ae1dc27639c88038d150660c4096753e210aec42 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ae1dc27639c88038d150660c4096753e210aec42 commit ae1dc27639c88038d150660c4096753e210aec42 Author: Hareshx Sankar Raj AuthorDate: 2025-05-07 09:32:10 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:49:51 +0000 qat: refactor error handling and add mutex locks Error handling in qat driver code has been refactored. Mutex lock handling has also been added during driver attach and detach. Also pci_disable_busmaster() is called in adf_detach() to ensure proper cleanup during device detachment. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/qat_common/adf_init.c | 13 ------------- sys/dev/qat/qat_hw/qat_200xx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c | 22 ++++++++++++++++++---- sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_c62x/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c | 24 ++++++++++++++++++------ 8 files changed, 121 insertions(+), 53 deletions(-) diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index 6bd0d85aae69..a7ebb70dde3d 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -449,12 +449,6 @@ adf_dev_start_locked(struct adf_accel_dev *accel_dev) struct list_head *list_itr; set_bit(ADF_STATUS_STARTING, &accel_dev->status); - if (adf_devmgr_verify_id(&accel_dev->accel_id)) { - device_printf(GET_DEV(accel_dev), - "QAT: Device %d not found\n", - accel_dev->accel_id); - return ENODEV; - } if (adf_ae_start(accel_dev)) { device_printf(GET_DEV(accel_dev), "AE Start Failed\n"); return EFAULT; @@ -556,13 +550,6 @@ adf_dev_stop_locked(struct adf_accel_dev *accel_dev) struct service_hndl *service; struct list_head *list_itr; - if (adf_devmgr_verify_id(&accel_dev->accel_id)) { - device_printf(GET_DEV(accel_dev), - "QAT: Device %d not found\n", - accel_dev->accel_id); - return ENODEV; - } - if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) return 0; diff --git a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c index 9e2462c05657..816010dc06f8 100644 --- a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i = 0, bar_nr = 0, reg_val = 0; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -96,6 +96,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -108,9 +109,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -213,18 +215,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -243,8 +247,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -260,7 +269,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index 0813ccf5baf0..cb534dd03b86 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -158,7 +158,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 512. Implemented to avoid the issue of @@ -170,6 +170,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -180,9 +181,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -273,18 +275,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -303,8 +307,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -320,7 +329,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c index 42189c28b21a..2bbccb4d6b17 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c @@ -101,6 +101,7 @@ adf_attach(device_t dev) struct adf_cfg_device *cfg_dev = NULL; accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); accel_dev->is_vf = true; pf = adf_devmgr_pci_to_accel_dev(pci_find_pf(dev)); @@ -112,11 +113,13 @@ adf_attach(device_t dev) accel_pci_dev->node = 0; /* Add accel device to accel table */ - if (adf_devmgr_add_dev(accel_dev, pf)) { + ret = adf_devmgr_add_dev(accel_dev, pf); + if (ret) { device_printf(GET_DEV(accel_dev), "Failed to add new accelerator device.\n"); - return -EFAULT; + goto out_err_lock; } + /* Allocate and configure device configuration structure */ hw_data = malloc(sizeof(*hw_data), M_QAT_4XXXVF, M_WAITOK | M_ZERO); accel_dev->hw_device = hw_data; @@ -152,6 +155,8 @@ adf_attach(device_t dev) NULL, NULL, &accel_dev->dma_tag); + if (ret) + goto out_err; hw_data->accel_capabilities_mask = adf_4xxxvf_get_hw_cap(accel_dev); @@ -180,7 +185,9 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); @@ -190,7 +197,7 @@ adf_attach(device_t dev) ret = hw_data->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (!ret) @@ -212,8 +219,13 @@ adf_attach(device_t dev) return ret; +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -231,7 +243,9 @@ adf_detach(device_t dev) clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); adf_dev_stop(accel_dev); adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c index 9f2c9374e968..b91daefb45d4 100644 --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -106,9 +107,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -202,18 +204,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -232,8 +236,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -249,7 +258,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c index 697f5b1ce786..f333101cce50 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -96,6 +96,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -108,9 +109,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -201,18 +203,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_start(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -231,8 +235,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -248,7 +257,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c index 1d48b85b2e12..955f6c48a071 100644 --- a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -106,9 +107,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -203,18 +205,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -233,8 +237,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -250,7 +259,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c index d8f2ba0a99b7..a74de5eb592d 100644 --- a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -104,9 +105,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -191,18 +193,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -221,8 +225,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -238,7 +247,10 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); + return 0; } From nobody Fri Jun 6 13:57:11 2025 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 4bDND81gkpz5xB7L; Fri, 06 Jun 2025 13:57:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDND76Lmdz3mDk; Fri, 06 Jun 2025 13:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NQKr5lM2WbJqsIbrZ2XHkp/hwJXyi/md/AAMl/29Sps=; b=RpSg1d63BrZPoEs9uSjvTKVwvXhymlKTmi/6rXMwh1kfVraItLVRBmvGT21h/ZenKk04C4 yWzd7jhiWicQqTxLjAZS3acrvEbrTYlcK1yVL5+YPLmO2p6iYUA4Qto7jXp3/ddBeP3Kdq hmQuc+emJyATfpGnIBNpPQq9ssZBNKU6WZtxtq/Asy/7TG7NALixEXDmRQWVi4jA4Elq3i ZHfXyvcx9NTAeCbjPrcVn///ALb+doO8GMNhrb3jNKFcPnfzw4KPrK4r0xgVcJ5n8crAsU U1a5HythdJd2HvjHlCdeHD2hH2ahnOHayhqGimXBHUIPlVS7Gp104h4s1XUC3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749218232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NQKr5lM2WbJqsIbrZ2XHkp/hwJXyi/md/AAMl/29Sps=; b=hLSNeF9Z65W2AwmmlkrTymahcvektDWfRegDPruvTCkZBrNS3ynelnOB+aYKK5tfFCf+bA Tg756z3/Nj6JA9Z5GWTSSuSIf+epvlA6ZiIifR18V9K3DOt4cB2pOUZl8oC4J09UxwXuVo yBOvEIZsuAhWn5EiSzAL4p5RAWcPLWa4bftzjL3uy13MH6XcRQqpbKrzVMq32KpZKDfI4e nIWykBNnCghDrHtYBDIZmejh01dvuaff/1jnEhMMisSAvwGpy76Osh+ao28xL7QfOvGZ3M FkN1lFOzDLBmHlHK76XpegqJ4js9t6OfBGOHziEP5e4cI7LshjeEyirQTOYzng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749218232; a=rsa-sha256; cv=none; b=iZ4z/FEDeLJKRSXHCEWiWuN8mGR9OrfdQmXHCTld2eczhu5pQFKYQeTJoBO+RbAiLENqXh 8O8MmEA0BrBE8PDvAVjdJs0RMHDUBHeizt1elrmsOh373+CZQYA8IiIGLXOgopuw6Ajg6s Ma7dfJpS35crvL3oYab9OjqZ1pmLVXXAMq5z3rzWzUvFF0ETIb07VWtu23iy9KwSEGnQRi q6NftK7TXLRkRBL3B45HWzkxJrRcf7yJQLEeCnaQm/dwO5uqhT7Q4ql5ayEtBkmXMxlby+ pmyYkqj09rtlE5m4g40VrqEqU3oaIJfst9LDiPgaRK9YsO46IPZsq3LVzmXH7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDND75lKgzxv2; Fri, 06 Jun 2025 13:57:11 +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 556DvBbA084160; Fri, 6 Jun 2025 13:57:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556DvBKp084157; Fri, 6 Jun 2025 13:57:11 GMT (envelope-from git) Date: Fri, 6 Jun 2025 13:57:11 GMT Message-Id: <202506061357.556DvBKp084157@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: 2542189532b3 - main - qat: update API files to use SPDX identifier 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: 2542189532b3025577fa4e782904494f3587008b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2542189532b3025577fa4e782904494f3587008b commit 2542189532b3025577fa4e782904494f3587008b Author: Hareshx Sankar Raj AuthorDate: 2025-05-29 08:14:59 +0000 Commit: Mark Johnston CommitDate: 2025-06-06 13:50:00 +0000 qat: update API files to use SPDX identifier API files are updated to have SPDX identifier and remove longer form of license to ensure consistency with the license format across all files. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 --- sys/dev/qat/qat_api/include/cpa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/cpa_dev.h | 37 ++----------------------- sys/dev/qat/qat_api/include/cpa_types.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_common.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_im.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_key.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 37 ++----------------------- 22 files changed, 44 insertions(+), 770 deletions(-) diff --git a/sys/dev/qat/qat_api/include/cpa.h b/sys/dev/qat/qat_api/include/cpa.h index f91de67caf5a..a3e32e4ef1d4 100644 --- a/sys/dev/qat/qat_api/include/cpa.h +++ b/sys/dev/qat/qat_api/include/cpa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/cpa_dev.h b/sys/dev/qat/qat_api/include/cpa_dev.h index bb6dd1d76f2a..9c1c7ccff45e 100644 --- a/sys/dev/qat/qat_api/include/cpa_dev.h +++ b/sys/dev/qat/qat_api/include/cpa_dev.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/cpa_types.h b/sys/dev/qat/qat_api/include/cpa_types.h index 93bed46f3730..712f1cf88b93 100644 --- a/sys/dev/qat/qat_api/include/cpa_types.h +++ b/sys/dev/qat/qat_api/include/cpa_types.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc.h b/sys/dev/qat/qat_api/include/dc/cpa_dc.h index 3002c62776c5..d1751fc7ee16 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h index 06b191a6f671..754992f65e67 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h index 8679b64fa5b5..7c0102d8d838 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h index a0aac8037855..95c34e631b9e 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h index a7cdb711e60b..87c73fe7f05d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h index c99aa449ec06..b82bf63642a9 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h index eea346ddadae..149a888f1744 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h index e6466ab7476a..45f724a8d629 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h index d968b5931a26..3a7ce1a820c0 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h index f1bb2b0240dc..af1eea223e89 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h index c7c89e3c6e8a..5d5e2b209aa1 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2023 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h index f70e43fcf047..a9410523367f 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h index a0eaf35ec760..c51d57fd8ca6 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h index dbf510cacb82..e3efc2163848 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h index 6039720d3368..1049bb114948 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h index 11e4773a05d1..313a2aca7649 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h index fb6c83725745..bd85b7ee178d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h index adc1671c7f57..45f456d4a31d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 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. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ *** 49 LINES SKIPPED *** From nobody Fri Jun 6 14:34:11 2025 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 4bDP2r2RY9z5xDMh; Fri, 06 Jun 2025 14:34:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDP2r1XQwz4B7M; Fri, 06 Jun 2025 14:34:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749220452; 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=fx2AgCbvOr8DxMcMFOZEp2HatdjZ1/mw2Pi2d7d+XPE=; b=b6Fgnk3ynGh74ndFYMuwJPb3IXdvpqOHeg+pZZiUIesCdwbgTWVKye7N4Dq98V/lxIABnh rmwiM3xeBT3TCpZRqrbqqapRy3q3mIXnIiH6aFqidPmra3vemwYGt7Wn+JrV+WLyaAgCWS qOEeCAXeWJLJB+vLO6rlkBFZxnHsgMv9bm/+/KRHYdETVss0dkgGtHSdYTm8ToOnRGPLOY DeZOFMNEvyPkmLLQtTXp9uZyrbY+0iMGhaFkTBuEKDuBLWDJuvB16Kx2eHom8QohVLeyPG ItSlqYKENPi+S2OBOROuoUkYH4HUAR7ptifqDxGpktmAKGnmbqidpbqbj+C5qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749220452; 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=fx2AgCbvOr8DxMcMFOZEp2HatdjZ1/mw2Pi2d7d+XPE=; b=TuduQznquliVZgJNUdTk5/SJ0uCpXh9KvQ4+mfjM/AQfrGpfKT6eGk9KXOrdqLG/v3kgvi JCLzrGa0NQmwn2GR9n98Iw5+5fr6YeSzth7FfnqE8pbhED9eaOjY0NLxQaHKU43qpafD5o SqImxf5QCMXkSKWaQqCbR8kLou227rsdlr3h6eEPhPpTK5Q6GvwOhu5Tx5RrQYrDgh4Fhh UlTYeGuaViOF/BEGvyVpLbASEsDVZgb7aA6pk+Xcbqi51s79Wm9W+RvZh4e583xSUODROe 1Lyfjjg0gOimFJlyBllMQgOCj9XSk3VBdKJDlsR/1O/RWG/+9Q53/PKXlUGknQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749220452; a=rsa-sha256; cv=none; b=i+5eQgviKwR86hcD6fuibge/azeQXpqVX4gIYOVPvuICXFK2DgDYgxUnJFO+XNLahimwtB WjXV1fgWIOKsEyBXEMpct+JKVs1n0BNbTV02mgarJnUOvXM7qq5nm9yIhVd+eLjqgsXDaM 5Wjq5kkE+3dKAAyE/qc/mCrCLlK3WoRCmImELSEsehGGeDqi5Plb+s2EFA0TqP9LYSlOGW dNfkyx3MpkRczQi2oYXzZkwTAMC2kLoWht3Lo1TpHiK1jnwiSxR4dSm/r5F7DxzoJbPZCm p085tm6a6ej8LX2FnaE4yABoYPPWQE0dQA168BiKqZ6yJhnW2zEuBDMu55bQOQ== Received: from [IPV6:2601:5c0:4200:b830:f:bebf:564e:f7bd] (unknown [IPv6:2601:5c0:4200:b830:f:bebf:564e:f7bd]) (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) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bDP2q6b6BzP8h; Fri, 06 Jun 2025 14:34:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <346c0310-b9b6-4eb7-ac94-0575a83c3416@FreeBSD.org> Date: Fri, 6 Jun 2025 10:34:11 -0400 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: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c Content-Language: en-US To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506060132.5561Wakc094185@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/5/25 22:21, Warner Losh wrote: > On Thu, Jun 5, 2025 at 7:41 PM John Baldwin wrote: >> >> On 6/5/25 21:32, John Baldwin wrote: >>> The branch main has been updated by jhb: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=7b3ee39e73af36f49f471f7900baeb98ac3504d0 >>> >>> commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 >>> Author: John Baldwin >>> AuthorDate: 2025-06-06 01:28:38 +0000 >>> Commit: John Baldwin >>> CommitDate: 2025-06-06 01:28:38 +0000 >>> >>> libcam: Include nvme opcode and status code routines from nvme_util.c >>> >>> libcam in userspace also includes nvme_all.c which now depends on >>> nvme_util.c, so add nvme_util.c to libcam's sources. This requires >>> exporting the opcode and status code routines in nvme_util.c to >>> userspace as well as the kernel. In turn, this means nvmecontrol now >>> depends on libsbuf (which is already present in /lib). >>> >>> Reported by: viswhin, Jenkins >>> Fixes: 60159a98a837 ("nvme: Move opcode and status code tables from base CAM to nvme_util.c") >>> Sponsored by: Chelsio Communications >> >> This fixes the build for now (and sorry for breaking it). However, this >> raises a few questions for me at least. Why does libcam include nvme_all.c >> at all? We don't document any of the nvme_* functions in cam(3), nor any >> of the functions from scsi_all.c, smp_all.c, etc. This seems really odd, >> and it also means that we can add (and remove!) symbols from libcam without >> realizing it by changing sys/cam//_all.h which is not very >> obvious. >> >> It seems to me that we should be more intentional about which symbols we >> export from libcam. Switching to symbol versioning (which implicitly >> enforces hidden visibility on all symbols not explicitly exported) would >> keep us from leaking symbols into the ABI of libcam that we don't intend >> to export. >> >> I also wonder if we can remove some of the *_all.c files from libcam >> entirely? None of the nvme_* ones are used outside of the kernel in the >> base system for example. > > No. We can't remove all that. They are used by camcontrol, ddcam and > others. We use the functions in *_all.h/c functions to populate the > CCBs to send down into the kernel. I think that we need a different > take on it. It is, after all, basically designed in FreeBSD 3 > timeframe when such considerations were the furthest thing from the > minds of the developers. Times have changed, though, and libcam hasn't > with it. We don't use a single routine from nvme_all.c outside of the kernel. libcam also doesn't include mmc_all.c. > We don't document it very well... Sometimes I've thought we should > make libcam a private library. But I don't know who all uses it in raw > mode. I think about a dozen ports use this for things like smart > reporting... I think a decent start would be to maybe be a bit more choosy in what things have to be exported. Only a few routines in ata_all.c and smp_all.c appear to be used in camcontrol for example. And it certainly seems like we could remove nvme_all.c from libcam entirely. Using a version map with symbol versioning might be the best way to enforce that (though more liberal use of #ifdef _KERNEL in *_all.c would be another route). We definitely will need to bump the SHLIB_MAJOR for libcam before branching 15 though. -- John Baldwin From nobody Fri Jun 6 14:44:42 2025 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 4bDPGz28b8z5xF5d; Fri, 06 Jun 2025 14:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDPGz0jxFz3FbP; Fri, 06 Jun 2025 14:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749221083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXsMDgKF0KrFGEVcxcY//xrtghFz3K7/mGcPFZINJDU=; b=bA2988frUZ4G9M8KggpF/TiP48/lYj+cvBA0xmbz8RaCpgEqXKko68Uoq2Q+G/0OaeDaAt 4WVLWv3fZFyFlMCbqjyKubQBaXmSCUtxVc6sJzrwsdA/+dOL/yyxUk4rNbpP6+oYMr8iRB l3shSu94TDwrVi1smho/f7aDgLEBaK72bseY6V17jUn1rs2Krutm58xjnSGP6xjO/o4392 GBKlzRNFoN+oy3IA2K2mtCSdVdF4CBxKuxPfyg0s/Tsxd///L1FIwre3+MN6Xh1+3JgiYx WfRkhbOHqj9fApkdHZbb5Xn4O2C/PK63yzlhurVzFQ228L+yEzch2wuxTlVRuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749221083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXsMDgKF0KrFGEVcxcY//xrtghFz3K7/mGcPFZINJDU=; b=KTjhXKmYQrl15xR9QQHp//pgt9McRtG9/R1EkpuHcpANbu+wuKwl32qdWOVvCUKIP7gVHP BeqcpwMGziqU2yTA7+/5PAlfJ1V+LQI0RAt3FRVMCNjdUDL5+C3cKyHTEk4DoMpgbSWIcv XqIBwf9oz0FxNWoRIux1lSPCW/cyVnqoUQchbKTvZmGusnWIhxNU55k0vintUPx64a5fQ0 akGGFyQcx913Lezg0vVT8yHK8g2/KgzTspVbjvlXtmqApSSNPaemDp8uUikt57aXywT9JD q9lu74GMBHOcCWGPJUHCt1zuTCH4M/9Q4h8PYFZtHrtbcqG3x0iHQ/F4PDESpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749221083; a=rsa-sha256; cv=none; b=D7p9JNDGzo5XG/H145Boc3N1fx1WBnIB1BTgOswQykTjNR3mkI6jJo7lv2bjZ7YcVt7fHv f0DEUQs+clyRMdQAT3P830FZn6baaaSWZavvgwPMvBxp6cG/6cSesf0WYJg16VN71T099Z yXsKwBGjNMcdi4RHdddmjn/mvMm1Va9evwCPwS8a/YAegzMLZZ6/1DK6Du5YuoPtxBzGMA gSnK4yYbFJxZzjvUyxQ0m95kEKVAO0NmzSiFcQtKHYhHoN94Prl68INepCLVelpU8Q4kZL foyEd/yBW0sy8KF1U0wR6OBe9T/dngtQ07bSG4sbzS/U8EQR6gBjnE87d2mMOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDPGz052Cz10GM; Fri, 06 Jun 2025 14:44:43 +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 556Eigxi078033; Fri, 6 Jun 2025 14:44:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556Eig3m078030; Fri, 6 Jun 2025 14:44:42 GMT (envelope-from git) Date: Fri, 6 Jun 2025 14:44:42 GMT Message-Id: <202506061444.556Eig3m078030@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: bef6d85b6de5 - main - lualoader: allow graphical bits to be disabled with loader_gfx 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: bef6d85b6de55e0e7adcfa1fd2e4abdcecbf9564 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bef6d85b6de55e0e7adcfa1fd2e4abdcecbf9564 commit bef6d85b6de55e0e7adcfa1fd2e4abdcecbf9564 Author: Kyle Evans AuthorDate: 2025-06-06 14:44:14 +0000 Commit: Kyle Evans CommitDate: 2025-06-06 14:44:29 +0000 lualoader: allow graphical bits to be disabled with loader_gfx Some people prefer the old ASCII art look and it's good to have a way to confirm that the fallbacks still work right on systems that have a functional framebuffer available. Add a loader_gfx loader.conf(5) variable to disable the eager use of graphics for these use-cases. While we're here, clean up the style in the area a little bit; the early porting that I did to lualoader did a lot of redundant ~= nil that has carried over into some of the later work. We can drop some of that, and also re-organize some of these variables to improve readability. ziaee notes that the positioning of the orb is a bit off; this is due to a change in positioning that happened in 1b4e1171315398dec ("loader: Fix orb position") to account for the image dimensions. This should be partially reverted to get it right; we shouldn't assume that we can use the same shift in gfx-* definitions for both the ASCII art and the associated image -- the {image, image_rl} pair should be converted to something more like an fbimg or gfx table that has the image, image width and a shift override to avoid messing up the ASCII positioning when disabled (or with no graphics available). Reviewed by: imp, manu, ziaee (manpages) Differential Revision: https://reviews.freebsd.org/D50706 --- stand/defaults/loader.conf | 1 + stand/defaults/loader.conf.5 | 8 +++++++- stand/lua/drawer.lua | 30 +++++++++++++++--------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index b1e87520a2d4..5d66708d30ef 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -105,6 +105,7 @@ efi_max_resolution="1x1" # Set the max resolution for EFI loader to use: # WidthxHeight (e.g. 1920x1080) #kernels="kernel kernel.old" # Kernels to display in the boot menu kernels_autodetect="YES" # Auto-detect kernel directories in /boot +#loader_gfx="YES" # Use graphical images when available #loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none #comconsole_speed="115200" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 807d8ae62e9a..021f68f2309e 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" 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. -.Dd February 9, 2025 +.Dd June 5, 2025 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -414,6 +414,12 @@ the beastie boot menu will be skipped. If set to .Dq NO , the autoboot menu will not be displayed +.It Va loader_gfx +If set to +.Dq NO , +the ASCII art version of the brand and logo will be used even if graphical +versions are available. +Additionally, the menu frame will be drawn with ASCII art as well. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index ee33ae753916..d4c6bf850e86 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -217,6 +217,13 @@ local function defaultframe() return "double" end +local function gfxenabled() + return (loader.getenv("loader_gfx") or "yes"):lower() ~= "no" +end +local function gfxcapable() + return core.isFramebufferConsole() and gfx.term_putimage +end + local function drawframe() local x = menu_position.x - 3 local y = menu_position.y - 1 @@ -242,7 +249,7 @@ local function drawframe() x = x + shift.x y = y + shift.y - if core.isFramebufferConsole() and gfx.term_drawrect ~= nil then + if gfxenabled() and gfxcapable() then gfx.term_drawrect(x, y, x + w, y + h) return true end @@ -332,11 +339,9 @@ local function drawbrand() y = y + branddef.shift.y end - if core.isFramebufferConsole() and - gfx.term_putimage ~= nil and - branddef.image ~= nil then - if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) - then + local gfx_requested = branddef.image and gfxenabled() + if gfx_requested and gfxcapable() then + if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) then return true end end @@ -383,16 +388,11 @@ local function drawlogo() y = y + logodef.shift.y end - if core.isFramebufferConsole() and - gfx.term_putimage ~= nil and - logodef.image ~= nil then - local y1 = 15 + local gfx_requested = logodef.image and gfxenabled() + if gfx_requested and gfxcapable() then + local y1 = logodef.image_rl or 15 - if logodef.image_rl ~= nil then - y1 = logodef.image_rl - end - if gfx.term_putimage(logodef.image, x, y, 0, y + y1, 0) - then + if gfx.term_putimage(logodef.image, x, y, 0, y + y1, 0) then return true end end From nobody Fri Jun 6 14:44:44 2025 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 4bDPH02Tsnz5xF1l; Fri, 06 Jun 2025 14:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDPH01B7Mz3FvC; Fri, 06 Jun 2025 14:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749221084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivmAYiOhnPnI9iR+1lVB7puyWGH+vtyp6ooaaNZpC4w=; b=OnckveGXRkNbTo7n7kvxnRmvwcw1KM1a6AMziUDyw3naXek7qCns3Bkr75JB56BjOsg6Qe fyaa5wfseUtw0hTTL0eMf8asMu78aCoSBxjxkwt3bbZaQoScWRpxjaEztvec5N3IpUe9Oj mjurvGkUlmaU/592faTkTrg4ps9lZrx3F2IB2iLUjJrsdMFB+ivX/lV80I17gYWoDV94w0 /S+mfMDlCPZq2KVRW/DL0Jcaz+kqQvzPyllABwcYpSCeJsDvjD+eO89gWnwo8z29ftbi3E X0J3Lh1eymxouX6FcnDP+sMVGelEOzjjX6ilcqK/V5yFLO+qgOjftBTEM1EhbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749221084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivmAYiOhnPnI9iR+1lVB7puyWGH+vtyp6ooaaNZpC4w=; b=aHzQHQKnxzn3W9LTja24Z8LlCoOwVdeFTdUL4bMpsMolcQ16tO9ntWNE2dLxNnamlkmwrG MKrvQqGZ7GROfE9TIPZHnVrT76T2OjZtyHh7jnLyMj2540Uwn7DcDtbX3QOYqGhtwLA5TI rPbIU/qYlcPSfGDxq/jDBTqyjhtz4zhkWvc8vZ3X98kr1GraEXY0gv/kAmXVk+5p9ujqMP 7fz7lJP4pp5fhnTiae/YI4HhmNUPfaXbQLLTSL/6gquOzTm9vsp45hWDSoHlJZG8lp834Z nkywM4HTIfeCupAlOXZOV9GL8WE8I2YGitJNmfPz9sNPgDVMbepH1TPuT2B20Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749221084; a=rsa-sha256; cv=none; b=jBw8t3fshM/4Lerwkol0QDr8afzKwDz39Ua9hYKEFx3D0TllmIofDxLR3/NyeJuvem/TTX 3BjXRh5zXpl+g9cu9uafrYj1kSy9u4J8Tge0VsfNxnzI6DIm7MbNObZOw1NiBjZbTyJS9S BlSHD9ww0/7iUuzJQtWs6LPr+nH7QD8ujUEkgvaRJSI0xvUSnzsbK7j4bnCW91q1sGJwEt XV1H6/jgoUGwF9WH+AN3FpBwRsu0RNLtF858iUcTXSK9VTzgZce48lHnseh6UzeYaH0QZr o/uiXliG/ARIaiWN+BRm7gkqOWwoyRQm6yJNLstTZ24rKVlgjjlvLOj0hV/p6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDPH00kdnz101J; Fri, 06 Jun 2025 14:44:44 +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 556EiiVg078066; Fri, 6 Jun 2025 14:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556EiiY0078063; Fri, 6 Jun 2025 14:44:44 GMT (envelope-from git) Date: Fri, 6 Jun 2025 14:44:44 GMT Message-Id: <202506061444.556EiiY0078063@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: d0d5415881b7 - main - lualoader: rename loop variable to cleanup luacheck 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: d0d5415881b7ed6908a2a734d893eb870b93b33f Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d0d5415881b7ed6908a2a734d893eb870b93b33f commit d0d5415881b7ed6908a2a734d893eb870b93b33f Author: Kyle Evans AuthorDate: 2025-06-06 14:44:15 +0000 Commit: Kyle Evans CommitDate: 2025-06-06 14:44:37 +0000 lualoader: rename loop variable to cleanup luacheck This shadows an `i` used for indexing earlier in the function, and we don't care that much about the name. --- stand/lua/core.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 5976cc65156d..f42be6fbebb7 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -282,11 +282,11 @@ function core.kernelList() -- actually find any kernels, we just assume that they know what they're -- doing and leave it alone. if default_kernel and not present[default_kernel] and #kernels > 1 then - for i = 1, #kernels do - if i == #kernels then - kernels[i] = nil + for n = 1, #kernels do + if n == #kernels then + kernels[n] = nil else - kernels[i] = kernels[i + 1] + kernels[n] = kernels[n + 1] end end end From nobody Fri Jun 6 16:26:57 2025 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 4bDRXy2w8Vz5xcxR; Fri, 06 Jun 2025 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRXy0gPXz3L67; Fri, 06 Jun 2025 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LNN2CryD8clc7H2u0Pq9/0U2cckTE2YmCBUX8hjEGKc=; b=wBoRm/+AC/AE7ZVpMuXfU+OcCacjiJprs37r6RRJuFIR+8ihJF7obcGPXyfFu5bwMS3gkn U8n2M0oQsbgoYzrouxnFgbjrPMclSrJtJpniPeprv6ROo4BT4xxuNIdz/IsU1vaMYvCFSx 053jXgzCCPWXx2U4y9QT5fb5lNsUoIHV24gOiCUvobKGWZZ8je0mpbT77CAVmErk3dGiNS B7p4nMqKs+xM6wJev4ytBo1nQbsdYS9NyWUCBUPOfhS9N2NofT+k4HmhcJvLfEXayEM2RD a+3dwJZoGWVUbMMvDztof04mCP8jckwP+waB1pK2Q+TEXqoLpLYrG9HUS4505Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LNN2CryD8clc7H2u0Pq9/0U2cckTE2YmCBUX8hjEGKc=; b=N7hBisL14TCCDCSXVLZGYvuXbRMzhZnJtuhoagjs7uqEWCT3nmDEAFeanf+fydpaKqvt+g a2XC7gzo6UZgb3j55i3WcCiILEbnYgwpuY41QwKKqMiiS3q84f8oaK0HAyDuk8V42sJ3ee iJnxym3FhN/GoKPO0kzSYFREgsl28CjtmHfBQUV2Gz5Qr9DrkyJNW2zvDdafloX/SoVnsW ywhvVnKYhhbQbcrOQncc9Ayl6wVKOFqakWpVUzoDVJHBayuYLet/aAKfeQGOu1Q779WOVS iwujU2i7SDnSq+ovfNc4djQuATyu8PnBIKpsFC4l/+bNM33Wn+Z/JPBqNpH7PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227218; a=rsa-sha256; cv=none; b=qRdA8Is2ksPa3bHhfJfJqquY+8wUK7n0V+S1eyQp6azasphD7kA6h2LGwz3gdeDRAmz8w+ y/TQJNbO/qPlZgfpgR3DLoRCko9L6ppZ02HApH0Qn0xuiA6FZqoERFvVR0ErKHwXvK96jb rmKXjiu9fYCkV6eYmD1qf+/a8hYakQHsB8YBwc7Hgg7seVGLvZz446jce5BhHi4kIsCJDV TvD9JZpX6NB+o4n4lbNcEJOj72cJ7GwJIE2vCHbLBYSEnKX1TsXq8dQLYpHzz/1oZkTLJ6 dQJESN/wdDTpaWUTxG7AMtN53LcASEV3uKVjOaRuNda3XOs17t1w+D3nV9M3MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRXy07H8z12Zl; Fri, 06 Jun 2025 16:26: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 556GQv7K066402; Fri, 6 Jun 2025 16:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GQv6P066399; Fri, 6 Jun 2025 16:26:57 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:26:57 GMT Message-Id: <202506061626.556GQv6P066399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e38f521f53d7 - main - nuageinit: helper function to setup adduser 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e38f521f53d70423064a987be08c3bd5debe3a2e Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e38f521f53d70423064a987be08c3bd5debe3a2e commit e38f521f53d70423064a987be08c3bd5debe3a2e Author: Sebastien Baylocq AuthorDate: 2025-06-05 20:52:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:35 +0000 nuageinit: helper function to setup adduser To carry out the userdata unit tests, you need to set up the environment in order to skip adding the default user (nuage.adduser(default_user) Sponsored by: OVHCloud --- libexec/nuageinit/tests/nuageinit.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 1b67468971a6..811eb9c0c73b 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -24,6 +24,22 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list +setup_test_adduser() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + mkdir -p etc/ssh + cat > etc/master.passwd << EOF +root:*:0:0::0:0:Charlie &:/root:/bin/csh +sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +EOF + pwd_mkdb -d etc ${here}/etc/master.passwd + cat > etc/group << EOF +wheel:*:0:root +users:*:1: +EOF +} + args_body() { atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit From nobody Fri Jun 6 16:26:59 2025 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 4bDRXz6dBTz5xcjd; Fri, 06 Jun 2025 16:26: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 4bDRXz2brfz3L2N; Fri, 06 Jun 2025 16:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3bIbeYC/MdA2PIgNtlbXD6/TXWRLV0Hl1OrAzLz1Klw=; b=CEXaOEdmeTsJkU+9ZgqUT9cX5LSPJxXRwVo2oJOosfhTpYWS19KeRUwH4VB0swwg3QVVDq cUcRMqwydzqLMuz4ITck8XlElVVbH2+PnXMpKhpD4n06Nz6hRe3BQRTkTMQxjyjgiYRYTf 5Eis53uwfDlvu5kWP3hpdpHLdzsgA1ewGJU+EoT9oh0DFiyw18XfpLN6Y9VrMOUag4DtYS jnxzB0yBjsfrG5ZZ0ux3V6TNW7NLU/l+FyPohZm2gwgxSTvone/l4FvGqJdwFbyaXlTdZX u2yH/4s9BjCj4NU7jrtwo3JT6aAHtJMSsSvR3Rhxkr+JANsEoxsWKZ9qJxmGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3bIbeYC/MdA2PIgNtlbXD6/TXWRLV0Hl1OrAzLz1Klw=; b=kxGjFm/Btxsi80hFdtvaMamqTP7iqAsQsidq3zNe7LSRQiQj4mwW7QnjDfLAir5zCtKwQS T/41hiZlCy2pd0dr+67/wvG/uSnzismIpJDRJF30LNBPu+ghCACLHL6XJf1lWgujgk8JH7 G5yBHFZ6D44sITlzuqr21zaeh4nngUA5KTIdgx9nu0KXPqo9qlB4eM8gcwaGYSlpybFciz Oiwpg9TPm2pAww6bym+Zir/d9NXqnRQHOCTCOeSU0bM9veUN0z4bZ4FAchW27B9sF1JCu/ 6pILNcpx0Qk8n8GyYfZD9j/wFG0Y7RqCACyE58reKCNQc3DdchlB4bG3VOQehw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227219; a=rsa-sha256; cv=none; b=VMV5YPWqm9qurH2PXlbNR4m59+oP05I+6IcjH2s146L3zLAtzGFvsquJ3ot7RWo9s2KuPG z5Rter/BbLQQAFpYxXUNhq1yE54NC3ChGVpJyjSkKXp2Rrb8hQ2Wj3m9gWD80PcfHIoSLu 2l83JnUSkH5HEWWwbrDj5FnQlEP3dIv0mkDE3Muo6TVE+slGKJxxLPSN0nI5NF3J6QbqvV 8mGHn6I+YkulJVpGO/IeMabVv6QCXnZ+Q6tTE6GqKp4qEsWfUZ+gmQEKz7WeCNfmXsdjXS LKhYLrUBsgFI+7khiwKawzTYLpys6QowZidePDxfXQF01HDQMQtMvCBDiqVWOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRXz0wPRz12Zm; Fri, 06 Jun 2025 16:26: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 556GQxQk066441; Fri, 6 Jun 2025 16:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GQx10066435; Fri, 6 Jun 2025 16:26:59 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:26:59 GMT Message-Id: <202506061626.556GQx10066435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 2f35a5218323 - main - nuageinit: implement runcmd 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f35a5218323b3da7fb71933778c03bbb1c2bb7f Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2f35a5218323b3da7fb71933778c03bbb1c2bb7f commit 2f35a5218323b3da7fb71933778c03bbb1c2bb7f Author: Sebastien Baylocq AuthorDate: 2025-06-05 21:11:33 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:37 +0000 nuageinit: implement runcmd runcmd contains a list of string, each item will be executed in order. Sponsored by: OVHCloud --- libexec/nuageinit/nuageinit | 9 ++++++++- libexec/nuageinit/tests/nuageinit.sh | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 74a75c88098a..ef215af00924 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -362,7 +362,14 @@ if line == "#cloud-config" then if obj.chpasswd ~= nil then nuage.chpasswd(obj.chpasswd) end - + if obj.runcmd then + for _, c in ipairs(obj.runcmd) do + if not os.execute(c) then + nuage.warn("Failed to execute '" .. c .. "'") + -- execute the next command anyway -- + end + end + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 811eb9c0c73b..06f4a12d7503 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -23,6 +23,7 @@ atf_test_case nocloud_userdata_cloudconfig_ssh_pwauth atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list +atf_test_case config2_userdata_runcmd setup_test_adduser() { @@ -700,6 +701,41 @@ EOF atf_check -o match:'root:\$.*:0:0::0:0:Charlie &:/root:/bin/sh$' pw -R $(pwd) usershow root } +config2_userdata_runcmd_head() +{ + atf_set "require.user" root +} +config2_userdata_runcmd_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: + - plop +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -e inline:"sh: plop: not found\nnuageinit: Failed to execute 'plop'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: + - echo "yeah!" > "${PWD}"/media/nuageinit/runcmd_echo + - uname -s > "${PWD}"/media/nuageinit/runcmd_uname +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:0 -o inline:"yeah!\n" cat "${PWD}"/media/nuageinit/runcmd_echo + atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname +} + atf_init_test_cases() { atf_add_test_case args @@ -719,4 +755,5 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list + atf_add_test_case config2_userdata_runcmd } From nobody Fri Jun 6 16:27:00 2025 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 4bDRY03xSbz5xd0l; Fri, 06 Jun 2025 16:27: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 4bDRY01zm1z3LBl; Fri, 06 Jun 2025 16:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YoD4GD25kI5YRIxnvP07Cv12zyYKpjXwB/0kc+fxsJk=; b=mZ2k1R43567BCUJOnW2XOTMXU5v2XJ66lovo8DYX3/lKB9OwTFw8/OFgZo1c6jiG1V8mFw hkn14ABCxZ4UZfQxWMVyEKGTo4WOVuVMNMSD246Lx/hd0ivk+ldD096cbueB/Puy7bqYS3 hChdvnTdvVJ68rS+CAcsC32vJf21ve3n0276Y/N6la06cIhDaqQN64qS91vrBTesWEjl3d I9HN7ru6K1NqIkJUgS4vNoGwUA5S2MQt1wW5AEpuiGPl1pOmBNwKqAw46iKPUhIPxrZtGI lMyOK9HJlgzFvSGr3GPC8M1GjYS8AayNfKjmP+0LLeVeg7qIfuNGj2Ku5WUW6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YoD4GD25kI5YRIxnvP07Cv12zyYKpjXwB/0kc+fxsJk=; b=rh3pW4tdkq+ALATF/z6duXNDmb5+3iMNkURaN1PRrekkDf+t2j3BvcTi7WAOgB1oDqRspF 6zTKaVTtlBf3pJRk2NFM4VUznPwTo47bQZlbd+xIu6bs5zcM2gtAuJ4KK/twB8Vko8LRKd mWAv0QOuWyJK23Ji3VUQmhFQWMfivdwMX1g3rUFZ2AS3W1FkBihPePU9Jp9w5L+wIUThAs YV5ffpkWrKG1r4DXWRJw97Tiwn2Lku/heWUDsozi4TbsYVX3KquS6W9xCztbPa/IMVK2GA GwvaVv9sjtuVRstAhWKZwIlTHdgK2yJXp2CiJBJG9JEW6WW1KYoW6uGExQb70g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227220; a=rsa-sha256; cv=none; b=q5Jb5QhoDvu2QesAnHAr6Vq8U1pnT7dryqZfo7sx9+x69nBD1qPgF8JQpk/VTjOWcmifOs NcbtUo7cPGa1SIuFezviF+nRQXMXtyUsxGVzeYPIPAWuz5FmhZHkTy6L19ae5o6yjIA+GN GuCrWtApij2Pd1sVLJhw7WwIlg2yDxpWuVvO2Vx28/u65sDRvLYWSs3gPrk9FLOK+6+lxV DI78NjpysnegVzmjH37TD6NKEYMIDx+gSPxqw5AEE1jP+9x4PjDqDrzi+rlC0vl+o4eb6Q Ns5QFSaYJP67IvfINmv0eZGY9iTbHX9UxA1EIIgfB0fuwVwCVvMvIVY87XLApw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRY01Pp8z12jn; Fri, 06 Jun 2025 16:27:00 +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 556GR0IR066486; Fri, 6 Jun 2025 16:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GR03Y066483; Fri, 6 Jun 2025 16:27:00 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:27:00 GMT Message-Id: <202506061627.556GR03Y066483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 43b82d69b252 - main - nuageinit: add a function to bootstrap pkg if needed 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43b82d69b252ddd50ac82e54481f2184b8212869 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=43b82d69b252ddd50ac82e54481f2184b8212869 commit 43b82d69b252ddd50ac82e54481f2184b8212869 Author: Sebastien Baylocq AuthorDate: 2025-06-06 10:20:46 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:38 +0000 nuageinit: add a function to bootstrap pkg if needed Sponsored by: OVHCloud --- libexec/nuageinit/nuage.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 15af5afbd9f0..addab5419193 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -361,6 +361,15 @@ local function chpasswd(obj) end end +local function pkg_bootstrap() + if os.execute("pkg -N 2>/dev/null") then + return true + end + print("Bootstrapping pkg") + return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap") +end + + local n = { warn = warnmsg, err = errmsg, @@ -371,7 +380,8 @@ local n = { addgroup = addgroup, addsshkey = addsshkey, update_sshd_config = update_sshd_config, - chpasswd = chpasswd + chpasswd = chpasswd, + pkg_bootstrap = pkg_bootstrap } return n From nobody Fri Jun 6 16:27:01 2025 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 4bDRY20wPlz5xcg4; Fri, 06 Jun 2025 16:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRY12vfwz3KwW; Fri, 06 Jun 2025 16:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BGw9T+b0FZaYSQLPXeDV2hI2H5rKKbq8JrCuHJo9+xw=; b=ujZpjAkwmtXMIyWKj/Ls0X2w7+xHsTE+gtahkFrYFJaJYuO/AKarHEDUwhcjOtkf36IXiZ FZA/s+ky6I+F3WWxvl8HqaHiML37T4Ojtrk0np/Cg3VfnkF9HPnoZqkzvub04NJS9qqTm8 auI3pkrlztlEWgzCkJjjmd6bYItuKmrChkV45lVdedcIplBlJoiQRq11vfmLQ6Q7fQ1gkR ZvrDm/ygTCMPqsrHSHl1z6JMvO/i6TL/2/p3SY9h1cu6ZQTkB46p9rk8ViOhNArD7R+HIq kHpqkmrPJ6tjdh/j6LrhqfpmHZG/CfsICXwhY/E8smnlkxGOGqOB0vC11G6q8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BGw9T+b0FZaYSQLPXeDV2hI2H5rKKbq8JrCuHJo9+xw=; b=ChjUC7Jnx7DtsWjd3N3B18ZFKUOttHF/Ff8XsEq59t4e401kFCSN4KxFlSfWpCgllRzhfG BYTIXC1c1Y0YSoMYQ9+mRVjfBiN2SmQQOVsHWaOkGCfsC+YfiHeH+e70UVbOJqQPgSzRja hw9WyD6cW+UY8+LYJk/oSpQQRSYbWag2OZaRVri6oBt+zgzKC+LZW7RvfN5Kh82INPlIzs R5FeAri9SRJPqMbGfGoU4wnAh5O+8yqtGD9NmfAeE1xArpuud6zuP1Tf5DdihL99mNI3QA 4tvd204OWHYQWwUn12mz3yCz9NFBGBFNxPlMsqxAptsWd1kO+NinqwDClcv8ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227221; a=rsa-sha256; cv=none; b=eKG0nEshq93eKZMQ7WRCnRHyKmyKxmcRVdD3q12Aw0aSr+3nnwZMDC1ZbYQIB5jM+z6kei rFODsw2uDR0QhPYmoQDpYzToAVtuRTsQHgAPLilvWNw5EKqR9ImJQM3JnSoqaegIRRZkUp 79Z80zsHm7h5OZ4y6WIhptI+LEUVobLOc8ZcLk4pens93gKdCkwARt51fpRMmAzDhKGv55 FshqAOOmMMDZ8IRNtP2GdqFxGwXdvpEuEq+u4+X+Fe3y+Jvr9awpnvo4zyME/YaKAELwfv eJl8s+n90imoZq3emu1FM0UHD8VGTEz7iPq1NUOarOBkIa98zJAOY2osFtfKrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRY11rmjz12jp; Fri, 06 Jun 2025 16:27:01 +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 556GR1GN066521; Fri, 6 Jun 2025 16:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GR1IQ066518; Fri, 6 Jun 2025 16:27:01 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:27:01 GMT Message-Id: <202506061627.556GR1IQ066518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 076fec1b88de - main - nuageinit: implement packages 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 076fec1b88de8e14f370127cc4aeaa737eda92a8 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=076fec1b88de8e14f370127cc4aeaa737eda92a8 commit 076fec1b88de8e14f370127cc4aeaa737eda92a8 Author: Sebastien Baylocq AuthorDate: 2025-06-06 09:49:56 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:40 +0000 nuageinit: implement packages Installs a list of packages Sponsored by: OVHCloud --- libexec/nuageinit/nuage.lua | 22 +++++++++++++++++- libexec/nuageinit/nuageinit | 19 ++++++++++++++++ libexec/nuageinit/tests/nuageinit.sh | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index addab5419193..0fe7400c2bbc 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -362,6 +362,9 @@ local function chpasswd(obj) end local function pkg_bootstrap() + if os.getenv("NUAGE_RUN_TESTS") then + return true + end if os.execute("pkg -N 2>/dev/null") then return true end @@ -369,6 +372,22 @@ local function pkg_bootstrap() return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap") end +local function install_package(package) + if package == nil then + return true + end + local install_cmd = "pkg install -y " .. package + local test_cmd = "pkg info -q " .. package + if os.getenv("NUAGE_RUN_TESTS") then + print(install_cmd) + print(test_cmd) + return true + end + if os.execute(test_cmd) then + return true + end + return os.execute(install_cmd) +end local n = { warn = warnmsg, @@ -381,7 +400,8 @@ local n = { addsshkey = addsshkey, update_sshd_config = update_sshd_config, chpasswd = chpasswd, - pkg_bootstrap = pkg_bootstrap + pkg_bootstrap = pkg_bootstrap, + install_package = install_package } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index ef215af00924..ef5726960978 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -69,6 +69,22 @@ local function get_ifaces() return myifaces end +local function install_packages(packages) + if not nuage.pkg_bootstrap() then + nuage.warn("Failed to bootstrap pkg, skip installing packages") + return + end + for n, p in pairs(packages) do + if type(p) == "string" then + if not nuage.install_package(p) then + nuage.warn("Failed to install : " .. p) + end + else + nuage.warn("Invalid type : " .. type(p) .. " for packages entry number " .. n) + end + end +end + local function config2_network(p) local parser = ucl.parser() local f = io.open(p .. "/network_data.json") @@ -370,6 +386,9 @@ if line == "#cloud-config" then end end end + if obj.packages then + install_packages(obj.packages) + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 06f4a12d7503..e8742be3ba51 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -24,6 +24,7 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_test_case config2_userdata_runcmd +atf_test_case config2_userdata_packages setup_test_adduser() { @@ -736,6 +737,48 @@ EOF atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname } +config2_userdata_packages_head() +{ + atf_set "require.user" root +} +config2_userdata_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - yeah/plop +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"pkg install -y yeah/plop\npkg info -q yeah/plop\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - curl +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - curl + - meh: bla +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + atf_init_test_cases() { atf_add_test_case args @@ -756,4 +799,5 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_add_test_case config2_userdata_runcmd + atf_add_test_case config2_userdata_packages } From nobody Fri Jun 6 16:27:02 2025 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 4bDRY31DRfz5xcxV; Fri, 06 Jun 2025 16:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRY23QvFz3L2w; Fri, 06 Jun 2025 16:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PeGme3/vwH9Rxu5g8BFL7KDAzDexrELvmn9sJolA3Ss=; b=wAl3JNn6nF1N1MCtD3DbLCtcOfuJAum1gxZmBOZithxTq3GzsRlQL1AuGumcpQ54Tgbxv0 xfAjEDij+Y+KwY49VPjmchAE8bcb/T/ePpkAduWBOBjdiNG46TFK1jYnXqbiPU7WfY1tGm ZGo4ZzU2UzP1VQzOrdMaYxoA3+iVHNM92KAL0V+itfR+sGZ0eRfpcBeucFR8wxDhTa5gcL 8stM8unqtKaExKgg7zjl2vCkDxBQhi1dQ6vmWhLhedDU4jvVBU8/72J79i69Zgm3MWZtn+ fRVvQC1fHZAPjRF24tBYKWABaUvAjCFxNdBx4l/nbsnRrXtke8X/JVoeIO2uxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PeGme3/vwH9Rxu5g8BFL7KDAzDexrELvmn9sJolA3Ss=; b=emBQyqhg5Oulb6+GW3QpG4fubs3SR5j3ACvmNanfHQ4YayC663CHXrHJCCEtTahdHiGswI +ENRKpqqMVxVjOn43Z70Kl47r6uG7+6+ahwu4ZI6XdSNW1ewu1yWxORmVtVUDqAl8+w2wY uOTs2qoVyVAAZxOTJuA1C7dwF3z/F+sxXNBrle+oKmmORqMfQrTa2xsJ1xcLcOXCeoMOuA Iq2LFKo0JCfo4rs5sHHn2Jbr7UsgdHhpyqX5b0bRspFsGn9Kh7uTTeXh4rEBeYSmTAIvm+ gAh9JUktmRsl0e/jVxmASWsOLTl5b1g3XpaZ23L3J/GLcDwBCQLhGiT4drSriw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227222; a=rsa-sha256; cv=none; b=Or4HsPmjvib51ZrKda38s7ch2PKVEryDKimu97fRBx8g3xEUvv6+7fedcMAKQKsS5VHO/2 NN+3GLgPo88mxcK8AMP/af6qr6YlWV59B0X16RZx5y0TsN747n/qfyz/Zn23jDZAapXVbv 4fZ79NHLOx7lovEvIi69J3K8MiMXGExJTQT7wjsBwTVucHquMQqo9+4hQe+PegezJGJLAM 1zxRbbDSWwJGHAZCxJSCj1LAASfaNIi34BvubWYaPyCC/Hj4C8bV9D0dFhpYjDFURRflfW 655IPIGss+h3FEcNbTmKAspRUscl/N/xC16OY99us/uNiGYki019D5qqI2lY4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRY22lzsz12W9; Fri, 06 Jun 2025 16:27: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 556GR2VO066562; Fri, 6 Jun 2025 16:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GR28l066559; Fri, 6 Jun 2025 16:27:02 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:27:02 GMT Message-Id: <202506061627.556GR28l066559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 682af9601aeb - main - nuageinit: more package related functions 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 682af9601aebb71357d05bb9ffbc137958a437cf Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=682af9601aebb71357d05bb9ffbc137958a437cf commit 682af9601aebb71357d05bb9ffbc137958a437cf Author: Sebastien Baylocq AuthorDate: 2025-06-06 16:24:48 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:41 +0000 nuageinit: more package related functions Implement package_update and package_upgrade, which allows to launch an update of the metadata and an upgrade of the packages. Sponsored by: OVHCloud --- libexec/nuageinit/nuage.lua | 20 +++++++++++++++++++- libexec/nuageinit/nuageinit | 7 +++++++ libexec/nuageinit/tests/nuageinit.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 0fe7400c2bbc..76f2d24ac178 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -389,6 +389,22 @@ local function install_package(package) return os.execute(install_cmd) end +local function run_pkg_cmd(subcmd) + local cmd = "pkg " .. subcmd .. " -y" + if os.getenv("NUAGE_RUN_TESTS") then + print(cmd) + return true + end + return os.execute(cmd) +end +local function update_packages() + return run_pkg_cmd("update") +end + +local function upgrade_packages() + return run_pkg_cmd("upgrade") +end + local n = { warn = warnmsg, err = errmsg, @@ -401,7 +417,9 @@ local n = { update_sshd_config = update_sshd_config, chpasswd = chpasswd, pkg_bootstrap = pkg_bootstrap, - install_package = install_package + install_package = install_package, + update_packages = update_packages, + upgrade_packages = upgrade_packages } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index ef5726960978..dda3ae482859 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -389,6 +389,13 @@ if line == "#cloud-config" then if obj.packages then install_packages(obj.packages) end + + if obj.package_update then + nuage.update_packages() + end + if obj.package_upgrade then + nuage.upgrade_packages() + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index e8742be3ba51..5fc811f1dcb5 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -25,6 +25,8 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_test_case config2_userdata_runcmd atf_test_case config2_userdata_packages +atf_test_case config2_userdata_update_packages +atf_test_case config2_userdata_upgrade_packages setup_test_adduser() { @@ -741,6 +743,7 @@ config2_userdata_packages_head() { atf_set "require.user" root } + config2_userdata_packages_body() { mkdir -p media/nuageinit @@ -779,6 +782,34 @@ EOF atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 } +config2_userdata_update_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +package_update: true +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg update -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + +config2_userdata_upgrade_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +package_upgrade: true +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + atf_init_test_cases() { atf_add_test_case args @@ -800,4 +831,6 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_add_test_case config2_userdata_runcmd atf_add_test_case config2_userdata_packages + atf_add_test_case config2_userdata_update_packages + atf_add_test_case config2_userdata_upgrade_packages } From nobody Fri Jun 6 16:29:34 2025 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 4bDRbz2hKHz5xd8L; Fri, 06 Jun 2025 16:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRby6qKzz3NWH; Fri, 06 Jun 2025 16:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QoXXtOUaXBCwT4B9k83s6wOaYXqtRuxe7AzlV2uC2c0=; b=K6GHc80EFkCe5VKyz29+vXcJjgJbzm6ztk6H/C8z53yh1I2HwK4zxulZ9MEe9TUcCg5JyR /4/J7QFzWEWyOaPnbhELf8zsQ9Hefl92bZQQuNp4Z0+q4N1HYPuCDHvJges+yt8kba7Flg dxsL/We+91swonWd0jBO3slVYGVda1sXHkIcRKaVttwaJHAG89LvCaqxNZwvYYs3FhcgTb B5QeX1fszbkc595svVFI3H1g1w/R4FsMWzwT3xR2MEaK+DUuwYol9XoOoiCVI6IfYxYlPt 7j6+6WuRpGchRozD/nlM1DnAuT4/8M4fKqsnfEuXGQvWg5V1LYvkKq0E9xHhQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QoXXtOUaXBCwT4B9k83s6wOaYXqtRuxe7AzlV2uC2c0=; b=CoGE4maAPOIFln7hbx6QSr3A/VkM6FdPnQRxbF/DkuMI393gQEa4tAUrpSj3zeYHNfkE6G 9mjoM7e3qX7SKCg39lwF9xOlrDTP4ITB85s4+YbX8ugy3DMMwQtdiffk46zpOZRG6mtaC1 Rjr9XfgPONJGjSlPCziItuXlpbQUe0i8wBdarqiZu44Pifim5+usDuHOPPiD6JD/VUC+wt I7wPi3UGIQpgI8w/FzvoA/my9flMa+GDzPc2u+X4F0QOCa8YBQr9VdvY468EZSCFVQqnkJ UJRMkgmhiW3s9IvXwDHq3wpgNZvMTdOhPkXB/3hCQAmxgme9V7KON5xO058l1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227375; a=rsa-sha256; cv=none; b=yDj5odrHhIa7YYvymUN4txPN7Eq6EbiCsfJ4yHbMYziMOsaijMgY6fzQGf73zBPTxcsUV/ qFngvFQxqFwlFnnUHnD3KJ8hqX0q4yplOb49GfSSmx5/gZQo3xT4mTvJAOx2WoEX/AcvuC HIahch9lSCtuhY0Cdh3VOH5Xh+0fRV2isDSLTwQlw00EtIpSdpSxNwwQtdIl+vPRQwFmaM P2OVPD9VWhfl4tLnWYpe8YFNngPmb6zhinHBRoR26kwUlbYTiNvQXdzOgu7gxvWNze6GrC KHk6UBnY5KhMdK8KYZdn/gaJKboy72bUz4bofgvu3vUgg6HnfzP5zJEZiOK4Eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRby6QBzz12jq; Fri, 06 Jun 2025 16:29: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 556GTYoE067418; Fri, 6 Jun 2025 16:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTYba067415; Fri, 6 Jun 2025 16:29:34 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:34 GMT Message-Id: <202506061629.556GTYba067415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 80386ed954aa - main - LinuxKPI: 802.11: adjust logging for key handling 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80386ed954aaa33b849877e8a86918de9365a087 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=80386ed954aaa33b849877e8a86918de9365a087 commit 80386ed954aaa33b849877e8a86918de9365a087 Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 20:53:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:27:59 +0000 LinuxKPI: 802.11: adjust logging for key handling Given there are still problems observed (at least in the Lab) adjust crypto key handling routines and enhance logging with td_tid, jiffies. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 62 ++++++++++++++++------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7520ed7331be..921c986fcd06 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1243,18 +1243,19 @@ lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(lsta->ni->ni_ic, "%s: running set_key cmd %d(%s) for " + ic_printf(lsta->ni->ni_ic, "%d %lu %s: running set_key cmd %d(%s) for " "sta %6D: keyidx %u hw_key_idx %u flags %b\n", - __func__, DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", + curthread->td_tid, jiffies, __func__, + DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif err = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, LSTA_TO_STA(lsta), kc); if (err != 0) { - ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " - "sta %6D failed: %d\n", __func__, DISABLE_KEY, - "DISABLE", lsta->sta.addr, ":", err); + ic_printf(lsta->ni->ni_ic, "%d %lu %s: set_key cmd %d(%s) for " + "sta %6D failed: %d\n", curthread->td_tid, jiffies, __func__, + DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", err); error++; /* @@ -1266,9 +1267,10 @@ lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + ic_printf(lsta->ni->ni_ic, "%d %lu %s: set_key cmd %d(%s) for " "sta %6D succeeded: keyidx %u hw_key_idx %u flags %b\n", - __func__, DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", + curthread->td_tid, jiffies, __func__, + DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif @@ -1321,9 +1323,9 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) if (lsta->kc[k->wk_keyix] == NULL) { #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: sta %6D and no key information, " + ic_printf(ic, "%d %lu %s: sta %6D and no key information, " "keyidx %u wk_macaddr %6D; returning success\n", - __func__, sta->addr, ":", + curthread->td_tid, jiffies, __func__, sta->addr, ":", k->wk_keyix, k->wk_macaddr, ":"); #endif ieee80211_free_node(ni); @@ -1344,8 +1346,9 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: running set_key cmd %d(%s) for sta %6D: " - "keyidx %u hw_key_idx %u flags %b\n", __func__, + ic_printf(ic, "%d %lu %s: running set_key cmd %d(%s) for sta %6D: " + "keyidx %u hw_key_idx %u flags %b\n", + curthread->td_tid, jiffies, __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif @@ -1356,16 +1359,18 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) vif = LVIF_TO_VIF(lvif); error = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, sta, kc); if (error != 0) { - ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", - __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", error); + ic_printf(ic, "%d %lu %s: set_key cmd %d(%s) for sta %6D failed: %d\n", + curthread->td_tid, jiffies, __func__, + DISABLE_KEY, "DISABLE", sta->addr, ":", error); error = 0; goto out; } #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " - "keyidx %u hw_key_idx %u flags %b\n", __func__, + ic_printf(ic, "%d %lu %s: set_key cmd %d(%s) for sta %6D succeeded: " + "keyidx %u hw_key_idx %u flags %b\n", + curthread->td_tid, jiffies, __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif @@ -1480,8 +1485,9 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: running set_key cmd %d(%s) for sta %6D: " - "kc %p keyidx %u hw_key_idx %u keylen %u flags %b\n", __func__, + ic_printf(ic, "%d %lu %s: running set_key cmd %d(%s) for sta %6D: " + "kc %p keyidx %u hw_key_idx %u keylen %u flags %b\n", + curthread->td_tid, jiffies, __func__, SET_KEY, "SET", sta->addr, ":", kc, kc->keyidx, kc->hw_key_idx, kc->keylen, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif @@ -1492,8 +1498,9 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) vif = LVIF_TO_VIF(lvif); error = lkpi_80211_mo_set_key(hw, SET_KEY, vif, sta, kc); if (error != 0) { - ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", - __func__, SET_KEY, "SET", sta->addr, ":", error); + ic_printf(ic, "%d %lu %s: set_key cmd %d(%s) for sta %6D failed: %d\n", + curthread->td_tid, jiffies, __func__, + SET_KEY, "SET", sta->addr, ":", error); lsta->kc[k->wk_keyix] = NULL; free(kc, M_LKPI80211); ieee80211_free_node(ni); @@ -1502,8 +1509,9 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " - "kc %p keyidx %u hw_key_idx %u flags %b\n", __func__, + ic_printf(ic, "%d %lu %s: set_key cmd %d(%s) for sta %6D succeeded: " + "kc %p keyidx %u hw_key_idx %u flags %b\n", + curthread->td_tid, jiffies, __func__, SET_KEY, "SET", sta->addr, ":", kc, kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif @@ -1582,9 +1590,9 @@ lkpi_iv_key_update_begin(struct ieee80211vap *vap) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: tid %d vap %p ic %p %slocked nt %p %slocked " - "lvif ic_unlocked %d nt_unlocked %d\n", __func__, - curthread->td_tid, vap, + ic_printf(ic, "%d %lu %s: vap %p ic %p %slocked nt %p %slocked " + "lvif ic_unlocked %d nt_unlocked %d\n", + curthread->td_tid, jiffies, __func__, vap, ic, icislocked ? "" : "un", nt, ntislocked ? "" : "un", lvif->ic_unlocked, lvif->nt_unlocked); #endif @@ -1645,9 +1653,9 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: tid %d vap %p ic %p %slocked nt %p %slocked " - "lvif ic_unlocked %d nt_unlocked %d\n", __func__, - curthread->td_tid, vap, + ic_printf(ic, "%d %lu %s: vap %p ic %p %slocked nt %p %slocked " + "lvif ic_unlocked %d nt_unlocked %d\n", + curthread->td_tid, jiffies, __func__, vap, ic, icislocked ? "" : "un", nt, ntislocked ? "" : "un", lvif->ic_unlocked, lvif->nt_unlocked); #endif From nobody Fri Jun 6 16:29:35 2025 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 4bDRc02TBZz5xd2M; Fri, 06 Jun 2025 16:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRc00WLbz3NWK; Fri, 06 Jun 2025 16:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n6P5cpRgcqqiSLvIjEjs00iBhipnzUT3WvZeT7KOMt0=; b=XcyA/jrm2o+dpEWEOaQpMDYVEzTLPK5fzpjVBAh6+3FIHlXji7Wvkeyi0mjVmBfi2jG1hQ IKu1cvE99ykjsvh2qEEY9V1DBHJ2VKpEd2L1zFM7J+EZGo3G26yFb0wdzdEX49wGjFH5Kd O0TwgH1/DYwDjj0x90HgtVi7wkY4mcjb5DjFrIZ/LWxdYgc05WF80GMzQlWa7HpgSgoXWA v2TRRHMJV8fJZ+IcEu08VItyTp9MIBr/UEZeUX/tqGoDvy8TPVsTPTyw19a3dHg9Lxm/lz 9xf8STna8mTkfnVTdtj1E8IBMQ/SMkhuXn26UfT/eYnv0umP21ZEtDd++l5RdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n6P5cpRgcqqiSLvIjEjs00iBhipnzUT3WvZeT7KOMt0=; b=OBaOvRJmt05DgxGpz8upLm/H4FbWRYvVRxWIxZXoDo3G0q/vpaE06umzb1KgQNI3Hy5Gch LiqIYvqwK2GmL+wOkDuEbrdoEK2vEDosHzLSrAuwEt9SR+0OWh2ZEsvvfUazS+LnggAHKV PPpo6SkPlxWp8EBPsbPGoIvpIKoo9k9tQnwALoCEHCRdF8s/CEKuGU8o46KUdfXbN8ADEl Pk6gKg+vwzfs84J9fs3Bz4AvFO+nLi4X+VFCFu1TkqKPFgQ+G7Uw+gjQQKPf50efWmtm5i EucneUMyAXvKkeO/s0yNnKRC7Wc5vTpy0E/AwPkpb1hsrfNzXs91Z3l1u6CMhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227376; a=rsa-sha256; cv=none; b=orsUBCOmNLx2A6iWom67S5PzUjtdVLHPUUCZa615meg5Kq3X3ZJKzhobTVMgnFlL4J8NYt M//VYg79cMOG5vODq3i7tXMZw7wYiR1ZFZPMbttYvp1RtZZ2AO2ejVFmxQsdWGy9+EdGOh 7Gt7vox0tt7yPmSz9fUjLdoQCam03p6aQx5Gcvevb6CY1sZ05XYV7Xk/p+ahz8ndnP5PN4 3eatfXryEyn0SrU7OzJ3lfoAUTjD2blky00aCwMvkTuIOUxmatC8twL6HF3ZVCyFqU6AlM o2QS7yWCxL2mf3wU59hKqUUjLqhOASbqOrGDbTzjcYPZIYBvj4FcgBoygIT0cA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRbz755Xz12Xt; Fri, 06 Jun 2025 16:29:35 +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 556GTZWq067460; Fri, 6 Jun 2025 16:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTZx2067457; Fri, 6 Jun 2025 16:29:35 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:35 GMT Message-Id: <202506061629.556GTZx2067457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 284af342971d - main - LinuxKPI: 802.11: place lock asserts for key operation 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 284af342971d102702df950a2f1e5479eaabdf0b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=284af342971d102702df950a2f1e5479eaabdf0b commit 284af342971d102702df950a2f1e5479eaabdf0b Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 21:00:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:27:59 +0000 LinuxKPI: 802.11: place lock asserts for key operation Since b8dfc3ecf7031 we hold the wiphy lock over any key updates. Assert that on function entry. Given this invariant there is no need to recheck a kay under lock now, as the first lookup already is under the lock, so simplify the code. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 35 +++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 921c986fcd06..e81c77d67001 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1298,6 +1298,16 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) int error; ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + + /* + * Make sure we do not make it here without going through + * lkpi_iv_key_update_begin() first. + */ + lockdep_assert_wiphy(hw->wiphy); + if (IEEE80211_KEY_UNDEFINED(k)) { ic_printf(ic, "%s: vap %p key %p is undefined: %p %u\n", __func__, vap, k, k->wk_cipher, k->wk_keyix); @@ -1331,18 +1341,7 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) ieee80211_free_node(ni); return (1); } - kc = lsta->kc[k->wk_keyix]; - /* Re-check under lock. */ - if (kc == NULL) { -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) - ic_printf(ic, "%s: sta %6D and key information vanished, " - "returning success\n", __func__, sta->addr, ":"); -#endif - error = 1; - goto out; - } #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) @@ -1353,9 +1352,6 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif - lhw = ic->ic_softc; - hw = LHW_TO_HW(lhw); - lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); error = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, sta, kc); if (error != 0) { @@ -1400,6 +1396,15 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) int error; ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + + /* + * Make sure we do not make it here without going through + * lkpi_iv_key_update_begin() first. + */ + lockdep_assert_wiphy(hw->wiphy); + if (IEEE80211_KEY_UNDEFINED(k)) { ic_printf(ic, "%s: vap %p key %p is undefined: %p %u\n", __func__, vap, k, k->wk_cipher, k->wk_keyix); @@ -1492,8 +1497,6 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) kc->keylen, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif - lhw = ic->ic_softc; - hw = LHW_TO_HW(lhw); lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); error = lkpi_80211_mo_set_key(hw, SET_KEY, vif, sta, kc); From nobody Fri Jun 6 16:29:37 2025 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 4bDRc13y6zz5xckb; Fri, 06 Jun 2025 16:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRc11jDpz3NH3; Fri, 06 Jun 2025 16:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUuFsL731WZxN6B8NvAkpquJ6XqTLB1q6r6fE2sU290=; b=a4NHwMd3B1vmHbkEUMecK8PeG8u3Zv5yffGi40J2jCgtzzKuRs4ZxUjgAcNc/7nigHtbFO iu5B0PW9EAkM4Tod9k0jO9ZiVLELAaST2jLWPAvRYR1qtxvBzTQ+NCHDniggMy0w1C/uy8 xMA5IgJJ4jlpk6c64K0LVnUSGWT/pVTyoBR3KV010rFRThy6hDzCIN2S7tRhFiIHXUDPCZ OUhNMsSqBLhw3kVHoVcDpQN3PhLZrV54H+aAsY6Sp7+N02Zzk5PHae13qJTdeemHzZBIga E98Tgn6JtWTS/4qbeHla4KLd/wfUwU8CybGMdZSD27xiKoNJF/zSjXaqJ7SeJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUuFsL731WZxN6B8NvAkpquJ6XqTLB1q6r6fE2sU290=; b=sp4oLU7wxxgtAZk3iJnu1W5cHhOzweu5YYoJ2q7J/LPPnII7YTRPAEJkYm/6IAl8tLp3sC ppc9RKdXdQ17GvFqLKcyNUWsOY0sz1n+2EJfARoSdh3CcHT2pRxw0XqUpz4h/YQi31rsoY G84I0HjN0zwCJle/GLGaN/nyP8ar+ZNgEtFj7b26eFWPaNjC+Rln0IuWYFdikv5ReRxd46 I4/6SN1IXoUh3MwUaxJzqodTmN5Xxqotixq+p/40TUw81RHuExkxjg959lCQSHZqWLHaqw MK4iC9Ast5BthqiXJVH/3m3icRh2i3Z7JWg0LYFZPZHeg48e2nkn0lk1GiZmGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227377; a=rsa-sha256; cv=none; b=CyuX+GFAtRlnF0UpUPlRnMp97XBR2dAiRo+3EhOwZcN27He8afaVmQDnTJU/7MlMa1hdzt Es/91dYRArilkFZ1nMfKb7i5oWhI4ym4CErBkIM2sIlswzIz6YdNE3VEubTrwNysac8QH0 PjwzAG/fZg74knGR5RNuYH80WjQXyZWTP0bJxoKzfFtPc5qASkxzcKbfmMUjKc4sBw5P0M EYL3gA88cOeWPuwJTAyUdQRhO6c7WD7jZPMwAVCNmTLiE8ptefAe85C/CXr/UE0UxVr21n /K0MuGCGD6H4XjGC9H27cd4DIfvfWn/i3UafwwtsOKtXlROnQ1iTdzY50wQ8/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 4bDRc11GStz12Xv; Fri, 06 Jun 2025 16:29:37 +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 556GTbcj067513; Fri, 6 Jun 2025 16:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTbjT067510; Fri, 6 Jun 2025 16:29:37 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:37 GMT Message-Id: <202506061629.556GTbjT067510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bc24342d96aa - main - LinuxKPI: 802.11: improve queue locking 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc24342d96aa816b448bec4d32b1f5e4a5793886 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bc24342d96aa816b448bec4d32b1f5e4a5793886 commit bc24342d96aa816b448bec4d32b1f5e4a5793886 Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 22:02:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:27:59 +0000 LinuxKPI: 802.11: improve queue locking Introduce an internal lkpi_ieee80211_wake_queues_locked() function that can be used from context holding the wiphy lock. Make linuxkpi_ieee80211_wake_queues() a wrapper with locking around this. Equally apply the wiphy lock to linuxkpi_ieee80211_wake_queue(). In lkpi_ieee80211_wake_queues() only wakeup the driver if the queue is not empty; otherwise weird sideeffects can happen with some drivers. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e81c77d67001..ef53c91a201e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -7395,6 +7395,7 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct lkpi_vif *lvif; struct sk_buff *skb; + IMPROVE("wiphy_lock? or assert?"); skb = NULL; ltxq = TXQ_TO_LTXQ(txq); ltxq->seen_dequeue = true; @@ -7898,8 +7899,8 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) ltxq->stopped = false; - /* XXX-BZ see when this explodes with all the locking. taskq? */ - lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); + if (!skb_queue_empty(<xq->skbq)) + lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); } } rcu_read_unlock(); @@ -7909,8 +7910,8 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) LKPI_80211_LHW_LVIF_UNLOCK(lhw); } -void -linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *hw) +static void +lkpi_ieee80211_wake_queues_locked(struct ieee80211_hw *hw) { int i; @@ -7919,6 +7920,14 @@ linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *hw) lkpi_ieee80211_wake_queues(hw, i); } +void +linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *hw) +{ + wiphy_lock(hw->wiphy); + lkpi_ieee80211_wake_queues_locked(hw); + wiphy_unlock(hw->wiphy); +} + void linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) { @@ -7926,7 +7935,9 @@ linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) KASSERT(qnum < hw->queues, ("%s: qnum %d >= hw->queues %d, hw %p\n", __func__, qnum, hw->queues, hw)); + wiphy_lock(hw->wiphy); lkpi_ieee80211_wake_queues(hw, qnum); + wiphy_unlock(hw->wiphy); } /* This is just hardware queues. */ From nobody Fri Jun 6 16:29:38 2025 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 4bDRc26B5Qz5xcvs; Fri, 06 Jun 2025 16:29: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 4bDRc22nQQz3NWj; Fri, 06 Jun 2025 16:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nI1LH3iNEky4Zaxhg4V+h+Jcm7jJ7HgT74mxX+7SWA4=; b=Eknr+U47Jr7ByWC+38zMwmC1MU0qeF0tx4PZb97iIGFaliCNTNlkU1nNLIJXYp5TZeBLdE aQ80ZyuvynDSu3V6mnezAVp520ro/FM09UVSPhDTvMAJ9LcvxwuHda+ECfFQAaOUJb+pbU /iiL+sFFfAbN4qdCIQc7aaCx3HsG0NqqDCb5M6/AqH7WIDGxTyqg6UveHUH8rwY5nhwJhX 8mqntthfNddu6icxQf/FPiPOs3BypHv5AatQLRNBAGwF/2pojMu29HCNFoT+qACtz1YzOS ebKmxySUVhxzbGJPu94o+9FE/Sbjs+NAoRMKwh9wx5JWhuC3oCKGcn0TXsxxsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nI1LH3iNEky4Zaxhg4V+h+Jcm7jJ7HgT74mxX+7SWA4=; b=M5t55Qz7KBB7vI7g/DtdqbwcPRlf7KhCnH3iofBA8nIfLwH4PCBJgpCM0zrJGtyRO8NtmB gGSxaUsLfeTE8DkSX/+Lv4A8ihPLzY2q2KWrLb5hgM51iio+pOZe5JQgvOoofVCOv60hXC phVc2tA4eLSE9aykovamYKaX18t0g/Z/jJQLrMZNnJiZWnRuoxmtRgA3cmIkndR8Dw+pOS 9sEQhblRE5J+79NzoSsJVoM2J/iff2s/3aIWiKOndWYOlCZZKAw1fToTWsYxAXy5AfwL4v y3KmrvCjGg/525f6nyphYSjrOsTInvEDs02HMoNwYhdqE938IE2fdTQaC6NEXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227378; a=rsa-sha256; cv=none; b=NC46QPBAgAtvJARyThhTehXrK5esW3Z+XV5VW1PaXl0h72+k2BjG0+Ky1qImqCZwF+dALR gmn8iXgUycdanRK+JxDMlE/8YGyraylPdjvA3MTl3J55jL8KC7jcIT+vQjKZQMNB6Cn0jA kUeMy+682KliM2X6I6i2ce93HsVoUTdc6WsKqZnkJ4vh9eFO5dKaYjfbVzdOFNCPfWWmUg dCO461x26XLUeeTgcysd9EebEA9nIVM53WFcx0vig8lem2p4axcWoJM6zH+3bTvLxn25gg L8SebpJN9uqzaxoQPND1lUMBBtET1izDsQXw21ziAq3o2rHS1LpHTBUChIHPHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRc226S2z12tl; Fri, 06 Jun 2025 16:29: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 556GTcOd067551; Fri, 6 Jun 2025 16:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTcKf067548; Fri, 6 Jun 2025 16:29:38 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:38 GMT Message-Id: <202506061629.556GTcKf067548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: db480c29879c - main - LinuxKPI: 802.11: stop queues during key updates 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db480c29879cac1afba1d887d7b8871aa4eef6db Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=db480c29879cac1afba1d887d7b8871aa4eef6db commit db480c29879cac1afba1d887d7b8871aa4eef6db Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 21:47:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:27:59 +0000 LinuxKPI: 802.11: stop queues during key updates When beginning key updates do stop and afterwards re-enable the tx queues to avoid packets being passed to the driver. This is a theoretical problem at this point but helps some cases. These functions will likely need refinement in the future. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index ef53c91a201e..4c511eeba388 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -174,6 +174,7 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); #ifdef LKPI_80211_WME static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +static void lkpi_ieee80211_wake_queues_locked(struct ieee80211_hw *); static const char * lkpi_rate_info_bw_to_str(enum rate_info_bw bw) @@ -1631,6 +1632,11 @@ lkpi_iv_key_update_begin(struct ieee80211vap *vap) refcount_acquire(&lvif->ic_unlocked); if (ntislocked) refcount_acquire(&lvif->nt_unlocked); + + /* + * Stop the queues while doing key updates. + */ + ieee80211_stop_queues(hw); } static void @@ -1649,6 +1655,11 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap) lvif = VAP_TO_LVIF(vap); nt = &ic->ic_sta; + /* + * Re-enabled the queues after the key update. + */ + lkpi_ieee80211_wake_queues_locked(hw); + icislocked = IEEE80211_IS_LOCKED(ic); MPASS(!icislocked); ntislocked = IEEE80211_NODE_IS_LOCKED(nt); From nobody Fri Jun 6 16:29:39 2025 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 4bDRc41ckKz5xd8T; Fri, 06 Jun 2025 16:29: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 4bDRc33VTvz3NSm; Fri, 06 Jun 2025 16:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kT7QBlfowFh5FLIQdpQHtzKy0QQa3WeLOSswsJQAwk4=; b=RoPSLjumvi9GKW2B7vV5SdcqwuRKE2cBI9so6C8ITPHeTxnA5h16v6qv/JrikLpEwhYmIz AP9liAbMfvrsp04E91ryS1UPao21Me4bpNb5tunUiEC9chOflT+Wc59pOL04Ki0FdOwdoC 5q4mp5ECecBzwBIUJAN2CFROwHoxNV2uCoEPgfnabCEPdktPNggnCQTLaPVTQAbJXcIDna 6riiT//sU90SCRLjFzq4HbnJfs2kfSupvqxYIFUp23IHoFb5zgJ5sh9V2H7AHGlOf86W2J pJREE0xF/hPVs7duQXokeFAYQ52VP0sfE3cukIcMmSpTexjsPmrKQm+w4PBSgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kT7QBlfowFh5FLIQdpQHtzKy0QQa3WeLOSswsJQAwk4=; b=TpVwUCdyVZnaLEszzNIw+xFllaLdzn/DnxxccUKn1TSFZwyyaZrdTFdvR8uQBtz3bTg6A/ V3C1d3qZawYGY0ndeymESZadFS/jLlYepvnI7xVgO+Cmy9Pl2SClcq/3Hs9zz5728Kd3AU r6aG34XTq67Wcg2yzMTGhj7Wf1oBcnc9/RENkxVIefc10692K0rKYdKshuD6gShY7AwUit ZmhWJbseoevQnXshxeZtgZzRB032hxGiGG+KDD2pgAee3D23ma5YbrF9/H13bG2G2ffx+a zxTY9TfTvLz/KvrYVlabaVVCG1szEg2QRWrzQgiC8JIZJ2W9u3eUu8qUd44EpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227379; a=rsa-sha256; cv=none; b=MyrJ7wWpRLp9n+JRJyNR7vMUPhsmTVjxTX0BCd8qw+hsTQPfIVRdmBty50+9mUF0loRgT3 L/oZeHppOAIP7cVLlSSAAkJEZPpQdY4xTSm+6WHEM6gFe542ymuM6vquV/gNvHSA9KUDhy OcewEF7eW7GSVs6qFFaVm/NHOQVgHxW3+COr45hhPVlvS9oW6qBhRUn41XryfMN61D6lmT vmryNJA+dwkAC1h4ER6uPId/poG0X782AVeAX2pIhpPAx4l6zsyaoy1KK2ZvkMZPjjTP0f 4DxW68pNb1RtF01vDc+8CapGHhMXRehoPq9wHtWYkbPWEyV7MdFtbCZoqeZ87g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRc332x6z12Zn; Fri, 06 Jun 2025 16:29: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 556GTd17067588; Fri, 6 Jun 2025 16:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTd9n067585; Fri, 6 Jun 2025 16:29:39 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:39 GMT Message-Id: <202506061629.556GTd9n067585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f1a110f1f0f2 - main - LinuxKPI: 802.11: fix lkpi_scan_ies_add() channel 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1a110f1f0f2ef83758f7d0a984b14f512ea00fd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f1a110f1f0f2ef83758f7d0a984b14f512ea00fd commit f1a110f1f0f2ef83758f7d0a984b14f512ea00fd Author: Bjoern A. Zeeb AuthorDate: 2025-06-05 21:53:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:27:59 +0000 LinuxKPI: 802.11: fix lkpi_scan_ies_add() channel lookup When looking up the channel we may not get a result if no flags are passed in as net80211 channel list setup and lookup coding requires a matching flag (band). So pass in IEEE80211_CHAN_[AG] depending on band to increase the chances of finding a base channel and from that derive rates, etc. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4c511eeba388..2721aa84b9fd 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4118,12 +4118,26 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, channels = supband->channels; chan = NULL; for (i = 0; i < supband->n_channels; i++) { + uint32_t flags; if (channels[i].flags & IEEE80211_CHAN_DISABLED) continue; + flags = 0; + switch (band) { + case NL80211_BAND_2GHZ: + flags |= IEEE80211_CHAN_G; + break; + case NL80211_BAND_5GHZ: + flags |= IEEE80211_CHAN_A; + break; + default: + panic("%s:%d: unupported band %d\n", + __func__, __LINE__, band); + } + chan = ieee80211_find_channel(ic, - channels[i].center_freq, 0); + channels[i].center_freq, flags); if (chan != NULL) break; } From nobody Fri Jun 6 16:29:40 2025 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 4bDRc55vRLz5xchH; Fri, 06 Jun 2025 16:29:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRc44GY5z3NHl; Fri, 06 Jun 2025 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C5fKqZU4dd4ncWAl+oesVOp1/wXR0zl6STJWRUIfdF4=; b=Y3ynFg6AQP7IaqTnUU/cU2BI/9FrhXPasjikBqLBo9mh6CAU5Fez9+YqR97iaiwa2TEZBt bvx4AJ+NGW0SA3Pgp6uhjYa4A+10/UhiALQiqyPEqrzuc0JvGLgD/LWnI5p6PvhQhkJKXe b/tx8NvjtaxZhH9F8fCv6ddh9RWsLL836pWpoVaYcoaQ8nGKh2f45MI4UiAXiKKXAk45qd NR5ltA0cHfNSlguqKUCXBJjIfcxK2wvIs/OvJHmdumuGfRix+Lt8Yj0G6xEn/EaGBLcLP9 dT3g8PzrgwCcCeIDyQQka6m8yr2nFEIBx7LSGCqYDQ+IBXyF68kElTOFip91Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C5fKqZU4dd4ncWAl+oesVOp1/wXR0zl6STJWRUIfdF4=; b=E3N1chLIGwfJGajEA8cBjoWw1oSaWZImSGG4mW4LsHNPBO8sVEpUumdMSUa4OptXyoZTur SmYrBIhfbRb2AxfVMVm9Yzy6xG7uKQOBzpm6cwiXlv/NiUrH4l+IRs+sLp72WhyufGJIKV iytYtJX8XFOiOvUvIipYDqEKhgnhKF+v7flvm/VRK/DHD/1GQC5w/bKF7ypylLXYuRMtwZ 4EcWt56ZBHM0jPNo4HziK3Z39TujYnx5KoQ8srfIZPW/6twIebAi051YZLiaYywzHJX5BC RHbYRiBy5IFB3qXeIBdlrWYrYc426UaMOOMIKXn+Qqj4IGbZqYUm6qwpT5z9Rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227380; a=rsa-sha256; cv=none; b=lBq1q9purMjeZ8nx4H0d37LLSaGKRrrnGByb0fuOfirZeIee0M3k8U8AMm3MdEZA2H37lI qCHBJzmcUtv5kcObKjvQ9CfaSP2G0Qa1o5KBspkTCiI16Lwm9hm9j3gUKmkCpYyAwiXE1G PIsgp7mpdaymICnAHjuQaPp8a45RSv+LRC6JS8dC7RxtGA4pm+3WX7Bm0pihsm/flIqt2d OxOkBPUczYSz3EHI4UC+0G1C3WkjQ2y5+H7UwNPkT9ep78BI5mYNgDR33noNWu8NGYeS1g ToHYcPzGgXfCJzSu1T2CSsSGZp6RCVKJSIqrv3ETEMBnR5UqPHnhT5Io3ulFWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDRc43kNkz12Zp; Fri, 06 Jun 2025 16:29: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 556GTeuR067625; Fri, 6 Jun 2025 16:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GTeC1067622; Fri, 6 Jun 2025 16:29:40 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:29:40 GMT Message-Id: <202506061629.556GTeC1067622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6e7a6a66b239 - main - LinuxKPI: 802.11; update frag_threshold and rts_threshold 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e7a6a66b239180778bb31da9fa8544bbd977cde Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6e7a6a66b239180778bb31da9fa8544bbd977cde commit 6e7a6a66b239180778bb31da9fa8544bbd977cde Author: Bjoern A. Zeeb AuthorDate: 2025-04-16 21:16:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-06 16:28:00 +0000 LinuxKPI: 802.11; update frag_threshold and rts_threshold Update threshold values once we are associated. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 2721aa84b9fd..1d00e8da8f9a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2981,6 +2981,12 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("Is this the right spot, has net80211 done all updates already?"); lkpi_sta_sync_from_ni(hw, vif, sta, ni, true); + /* Update thresholds. */ + hw->wiphy->frag_threshold = vap->iv_fragthreshold; + lkpi_80211_mo_set_frag_threshold(hw, vap->iv_fragthreshold); + hw->wiphy->rts_threshold = vap->iv_rtsthreshold; + lkpi_80211_mo_set_rts_threshold(hw, vap->iv_rtsthreshold); + /* Update sta_state (ASSOC to AUTHORIZED). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " From nobody Fri Jun 6 20:25:14 2025 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 4bDXqt5HrGz5xxXB; Fri, 06 Jun 2025 20:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDXqt4ShLz45qW; Fri, 06 Jun 2025 20:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749241514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Juj0op6Dq4dCNxrhjJkKaByxI/9Ys5UgnTcG6SSGUw8=; b=Zo2tQeShaIMz/hY6Aunt45CS/VqAsLByVoj6hEzn7RQR7OsSXOBNfKo+xQiwT8RYTDJuIv rgVl/EGVtTNTEfBp86FoHnaI8XxS5QKmzsULHsqVbtuOfLOC8aaOKEeUT6M9uEpeVmDsWq xz9xLrJ6RbhEy01HBsj1pbRQsHCdkkFtmvyvw9rwZ6OCB6Jb7TOnyCgbwIsiy36MJTWhQi SP4T2dj9HJu0g/ny3j4rx48pPZoT3y3F6cHWc/KXIxvhVB6LsoBuVpJmBNgRvCZHSYDiGY GAABBgvWx8btAZa/D5Ql4RvxTFZ8lXYiRJ5QbYmDO8BGA3ZBIbfXP3DhkGH0lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749241514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Juj0op6Dq4dCNxrhjJkKaByxI/9Ys5UgnTcG6SSGUw8=; b=HmRlLu8CG0RAnnFUrT29u8YBoJW1Hpv6yf4SsYZ1HQ4pj+26lH6eyW/JbQxfVWBER7pZTh vfBE5cc0iSRnsSwqJd+AttodudMNaSdaMgREM3ZOelxlNG1SdlbmwYlm0PoFDVynLS+Gxg LgnvWQ91paMQC9QcVs2t9l2MaZR5h4sRxSQwCMx6wEknMhxAe89hHE4QRqkUEFUJQOtRPK EjqEmj8ZBIHiiwFHjMC3CD8KDcoxrSTPIrxsTtl2mY7YKBhaq0c1vVZ5NoTmpEi4Cq6aEl +wUORGPPLJk3Pm9L5AqmgBeqftIziSaN/8eWGe+a0Bx0yE8Khwp1DVGeV+tiKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749241514; a=rsa-sha256; cv=none; b=ux6rmEJUx6B9aV8Gg241P6yG5dV2xcZRH/M9VsbE8/nsFSpTlvSOTZf8Qbo4qt+cA5Yza1 0fz80QegBsAxDKV8ato9oTrhuF57+RyBGzEtzvfnuFdqMRnHuFNpRFfVj/G2ZdLvq+z61c 4eFc4bT6wi3BWYfemCWgNf73fhGiVIK773HOUrZt5VAOWJxvboaWcwsGSwCXik92sD2Pz6 9YAMk7gElgaXgu24R/mwyp+WDGICMep4b/HmveQ8RwqvjDgQDLyKk8fZFTd4FLU5FZ28Gi jgcU/FaSlVC1n9CmgFDsz96DjMKij7GRZ8Q4JlqMzhJoKmXyKMasY5vE2yrqhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDXqt3fWrz18PW; Fri, 06 Jun 2025 20:25:14 +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 556KPEcp017941; Fri, 6 Jun 2025 20:25:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556KPENC017937; Fri, 6 Jun 2025 20:25:14 GMT (envelope-from git) Date: Fri, 6 Jun 2025 20:25:14 GMT Message-Id: <202506062025.556KPENC017937@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: 7908b5df1abd - main - pctrie_lookup_node: assume parent_out != NULL 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: 7908b5df1abdb3cf9aac0560401a718bff3e304a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=7908b5df1abdb3cf9aac0560401a718bff3e304a commit 7908b5df1abdb3cf9aac0560401a718bff3e304a Author: Doug Moore AuthorDate: 2025-06-06 20:24:01 +0000 Commit: Doug Moore CommitDate: 2025-06-06 20:24:01 +0000 pctrie_lookup_node: assume parent_out != NULL Since NULL is never passed as the parent_out parameter to _pctrie_lookup_node, stop making the assignment to *parent_out check parent_out for NULL first. Reported by: alc Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D50729 --- sys/kern/subr_pctrie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 676e3595316a..cb813cfbd847 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -514,8 +514,7 @@ _pctrie_lookup_node(struct pctrie *ptree, struct pctrie_node *node, parent = node; node = pctrie_node_load(&node->pn_child[slot], smr, access); } - if (parent_out != NULL) - *parent_out = parent; + *parent_out = parent; return (node); } From nobody Fri Jun 6 21:37:39 2025 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 4bDZRp1y19z5y2Yk for ; Fri, 06 Jun 2025 21:37:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) (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 4bDZRn40VDz3wRQ for ; Fri, 06 Jun 2025 21:37:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-70e5599b795so26817027b3.3 for ; Fri, 06 Jun 2025 14:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749245872; x=1749850672; 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=Zga1Sz3BLcwWlEYiC2uBZiyDifpefMebRMwohKPAgUU=; b=HwVyCq1Msx0mPViZAXICCJ2ThvzEV8NrwwSiN+TyyVC96W1x2LdxHeT/WvLrYDhjuQ QrQrtAWPdEFzyVjddQNzWqh6CwO+NnraWnTQTZK75VfBswdu253iCYxFEqbxJaaPDEH9 w9D/To/3s79NTOlvHDubZYBGtvWSEj5JTsYgECJsSiDgwNZKX8mk8TkFy5Xu5osbQrWb 7345Jb8uztYEQfYeRo3lQv4WRaiRabbg+Fp0SUVREwM8WfOXk1rKD4rRGaSt9Yxjo3t7 LfF2qZbN1L1vAW1poAp3Un7eJlwdigH236MX5FOW0/hVUDnjXWx6dTKk4DeHtuThn5uC N1DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749245872; x=1749850672; 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=Zga1Sz3BLcwWlEYiC2uBZiyDifpefMebRMwohKPAgUU=; b=Q32OpuNCNpG6SOB+xNTVZHoTDLDhAnCUdQlfS6Z69qThfQ9ZlQ9ga4ch03+n9+X4Q2 UY+ZJ6kP9KEnKeCkNrD+8k9kJZb5a1kWmUcOYLmSKb2/4gGtEPs/niplID2taaHT2oEF vdBNMeNL+cM5tK7XCtZGNIVmxjab4FvktyN1MFSzxEAWzdovnQ660Dd6U0ULTw+b8mJm HzdJZ/cMGnOiYOKuJO5TAAy9r0Z4hT4DI6PdT3OTN0QWCpwBnxOpxmOaqYUmKTt+ffKN wKuVXpN8IZaW3Qo+NHz8B/I7btoGyUkZ+qW0xFZg8PCo+CXfz4w1RhsKYTUKFSg+1FJ3 ZZLQ== X-Forwarded-Encrypted: i=1; AJvYcCUKxT5Y1R79C3Z06m834D3qWVIr1NbLwg4JAE5vltTSB+0sbCKhho5ETEfyoayXIOulflVT1QPvWLA88DLnRR53B6LLlw==@freebsd.org X-Gm-Message-State: AOJu0Yx8ONiVof8hV58JZV02UtksNSQbP8LqRLPvK7Hr/YfK/K7Gt3kX QyDl5W43Ne3iDAXOPXKqQ6U46mhINotB3GSZRmybiG8Yd0NihOo63AQfxb9Xmx9IksdPPQruIsr 0DivZ6GjdwpEdv0KjSGV9q1ofvJU5/UTmx+GFcBXbbQ== X-Gm-Gg: ASbGnct6fFAyd6g5RxtJKGllX2cFJ8jUNKikf9AxPtPhbDmRMGCPF/KNJQv/uxZOHEB fwNsB4jd7jTAlyCYV2w4ZVLH5WWwFqVw+MLYPFz+FBzxDdJIsu0q8GmZ1cbDn1QHCGWNHKq94XE 3ZJqWmJAe2Y3M+btgnl1m6qZyW70wlGDZhadmrGHoHp4b9L3J61+nSOQ== X-Google-Smtp-Source: AGHT+IGWaoscmwkw/GfIroo3Mixu6IN7UnGQX23OkR/K+OAz9hUJRBMvzuVs38aq8Knmeyz8RJNPPszVKgCdzAw8qnU= X-Received: by 2002:a05:690c:6d0b:b0:70d:ed5d:b4d2 with SMTP id 00721157ae682-710f76949femr79778647b3.16.1749245871740; Fri, 06 Jun 2025 14:37:51 -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: <202506060132.5561Wakc094185@gitrepo.freebsd.org> <346c0310-b9b6-4eb7-ac94-0575a83c3416@FreeBSD.org> In-Reply-To: <346c0310-b9b6-4eb7-ac94-0575a83c3416@FreeBSD.org> From: Warner Losh Date: Fri, 6 Jun 2025 15:37:39 -0600 X-Gm-Features: AX0GCFu0noPrayLc4cMjmVzLnFdJfMOq9gMTwXOzw9oPpe_J3mmi4qkgPD4sNsE Message-ID: Subject: Re: git: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c To: John Baldwin Cc: 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-Rspamd-Queue-Id: 4bDZRn40VDz3wRQ 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] On Fri, Jun 6, 2025 at 8:34=E2=80=AFAM John Baldwin wrote= : > > On 6/5/25 22:21, Warner Losh wrote: > > On Thu, Jun 5, 2025 at 7:41=E2=80=AFPM John Baldwin w= rote: > >> > >> On 6/5/25 21:32, John Baldwin wrote: > >>> The branch main has been updated by jhb: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D7b3ee39e73af36f49f471f= 7900baeb98ac3504d0 > >>> > >>> commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 > >>> Author: John Baldwin > >>> AuthorDate: 2025-06-06 01:28:38 +0000 > >>> Commit: John Baldwin > >>> CommitDate: 2025-06-06 01:28:38 +0000 > >>> > >>> libcam: Include nvme opcode and status code routines from nvme_= util.c > >>> > >>> libcam in userspace also includes nvme_all.c which now depends = on > >>> nvme_util.c, so add nvme_util.c to libcam's sources. This requ= ires > >>> exporting the opcode and status code routines in nvme_util.c to > >>> userspace as well as the kernel. In turn, this means nvmecontr= ol now > >>> depends on libsbuf (which is already present in /lib). > >>> > >>> Reported by: viswhin, Jenkins > >>> Fixes: 60159a98a837 ("nvme: Move opcode and status cod= e tables from base CAM to nvme_util.c") > >>> Sponsored by: Chelsio Communications > >> > >> This fixes the build for now (and sorry for breaking it). However, th= is > >> raises a few questions for me at least. Why does libcam include nvme_= all.c > >> at all? We don't document any of the nvme_* functions in cam(3), nor = any > >> of the functions from scsi_all.c, smp_all.c, etc. This seems really o= dd, > >> and it also means that we can add (and remove!) symbols from libcam wi= thout > >> realizing it by changing sys/cam//_all.h which is not ve= ry > >> obvious. > >> > >> It seems to me that we should be more intentional about which symbols = we > >> export from libcam. Switching to symbol versioning (which implicitly > >> enforces hidden visibility on all symbols not explicitly exported) wou= ld > >> keep us from leaking symbols into the ABI of libcam that we don't inte= nd > >> to export. > >> > >> I also wonder if we can remove some of the *_all.c files from libcam > >> entirely? None of the nvme_* ones are used outside of the kernel in t= he > >> base system for example. > > > > No. We can't remove all that. They are used by camcontrol, ddcam and > > others. We use the functions in *_all.h/c functions to populate the > > CCBs to send down into the kernel. I think that we need a different > > take on it. It is, after all, basically designed in FreeBSD 3 > > timeframe when such considerations were the furthest thing from the > > minds of the developers. Times have changed, though, and libcam hasn't > > with it. > > We don't use a single routine from nvme_all.c outside of the kernel. > libcam also doesn't include mmc_all.c. Hmmm, I added it into libcam because we did use one. But maybe we don't need it. It's been a while, and I added it in my experimental tree and push that upstream before I pushed the things that used it, so maybe something got dropped. > > We don't document it very well... Sometimes I've thought we should > > make libcam a private library. But I don't know who all uses it in raw > > mode. I think about a dozen ports use this for things like smart > > reporting... > > I think a decent start would be to maybe be a bit more choosy in what > things have to be exported. Only a few routines in ata_all.c and > smp_all.c appear to be used in camcontrol for example. And it > certainly seems like we could remove nvme_all.c from libcam entirely. I'll give that a short. I was sure that something was using it, but that may have only been in early version(s) of code... I'll look into it. > Using a version map with symbol versioning might be the best way to > enforce that (though more liberal use of #ifdef _KERNEL in *_all.c > would be another route). We definitely will need to bump the > SHLIB_MAJOR for libcam before branching 15 though. Yea. I've been hesitant to clean this up too much. I know $WORK doesn't need this library for anything interesting. But I also think we should check with Netapp and Spectralogic. Warner From nobody Fri Jun 6 22:13:11 2025 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 4bDbDT6dpnz5y5PG; Fri, 06 Jun 2025 22:13:13 +0000 (UTC) (envelope-from vishwin@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDbDT56zSz4MBV; Fri, 06 Jun 2025 22:13:13 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749247993; 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:autocrypt:autocrypt; bh=m8eOFdhIHf8rsQmEzjUD8DyGPrx/FowcfF3kLqfxID8=; b=UdJv9V0G0B8K/HyjXWNexYpIUUmo1LZFuRC2TaCvX8P9HXuzMor2ytpAxHtU+VS+ja/VtZ vzk2xlOo7lb2meArhxPBbMTEBQcjwLfIhQ0odVIVBlsthiUudQOLh7C/hmbZO78tqga0D4 +0IyuVXgfTDTmeyYQQRiNsd7+2Ts8+Y+Vl5yal03iPu6FkH+Xl48YzGfpxw4Zd+95L/bD8 UwPEdTQY1NGxuvqYWtpVICGma/hZ/9iOBiF65/Cc84NV+NAergvcE+ZBVR9mWuRMJ0ls/d SquSh/MQ9zTznwuXdW2U4c6x9DakaG76HOIJvr+EfEG8I3kkQXTHQlTeejPIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749247993; 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:autocrypt:autocrypt; bh=m8eOFdhIHf8rsQmEzjUD8DyGPrx/FowcfF3kLqfxID8=; b=nLJ2mkiXPGDECLmdjaMH6NTlm7jxDln8BhQaexWqfKYHvf7fqPqNVgrBz8jjelrfGSg7qV kvqKelEdghEG79bxjeRsxHneu09my2KYsTZXgcLRzeDBSqd2yitS3bmtjkmdmagWZA1nTj d5IKU5zPxyV+Yg83ATEBXTpSebVHobZnmeF5gWSv4ayJWmhOBaWRl2/pna7974G+uCtGQ9 tlcG1h4BWTPYf4+k4h/oFa7JlNoamNuZJBMza4oj2QStVWAV2umjwoDhe+326TCJpPpj2Y iM2+LPL3l3IxtAdU/1CtQTUNu7tcT92760kHvq7on1HBIgyvtY2NR8sNNUHtDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749247993; a=rsa-sha256; cv=none; b=XgSDvolFsrp38HpIQxiZEfrlvCWPwexYJ41spvwvWH/6iLohmif3UUK0g4IkXqdkXbtU9N 8uFRvoch1jCEDHwZj1EJanJtD2oi35MdGEBlo+6uXWm4V/JTYRpACgvSq/4VWirzHIVHri qYhr7SBM1ThxmqXMPW/Zifo41La670wcBe3ZNM0JUCxbAvJFGf2T4fyjjwV3eQgdi5+qN3 Qj7ytcDJkPcGV2W65DyM+QWNV4O/kVEWW1r+OKGnfZyGlmMErAFRljeozbceQ/ObnTXL5r 8LvvrRnFcwfqYPUn+sZdlKxbAW4i8xCbop7RIo73OeB2oijTahH+pzxfvpdA4A== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bDbDT2sfMzpPm; Fri, 06 Jun 2025 22:13:13 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: Date: Fri, 6 Jun 2025 18:13:11 -0400 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: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c To: Warner Losh Cc: John Baldwin , src-committers , "" , "" References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEZFWWqBYJKwYBBAHaRw8BAQdAINFDmM+bgGkT1C4nD5a3BxgcH8Xnx5qTJbPuIBxD57LN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbAwUJA+3ogAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRBnj5NgWEFcyllaAP9CGICFEvTUOv5BYh/H8m49VJ87a/wd 0obeQfVBnS464AD9FopTHbjEs0HDV0ZYmJPxzJIznjumsj9gBxX0bBqqTgzOOARkVZaoEgor BgEEAZdVAQUBAQdA6BUWuG5RuT0vmtoDyCUUqiJGdtd78GM5ic3kw2AntSADAQgHwn4EGBYK ACYWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbDAUJA+3ogAAKCRBnj5NgWEFcyn55 AP9ezKDCUgHqAq6JX976abb9pYdbSjxxNJqnrjgNkfhgIQD/QhR+fgnUHhcGTMBy+pYHZUGH 5DCuITsK1U4+v252uws= Organization: FreeBSD Project In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------FOob0JMBWh7U0jSvTKmCFJAB" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------FOob0JMBWh7U0jSvTKmCFJAB Content-Type: multipart/mixed; boundary="------------I09uQmPb5R5UnWGV2ZrkEXy5"; protected-headers="v1" From: Charlie Li To: Warner Losh Cc: John Baldwin , src-committers , "" , "" Message-ID: Subject: Re: git: 60159a98a837 - main - nvme: Move opcode and status code tables from base CAM to nvme_util.c References: <202506052106.555L6XBV089396@gitrepo.freebsd.org> <53d9ce10-191c-4edf-85d1-41b3162aefa4@freebsd.org> <371a7bf2-61ee-4528-9aec-846601973b78@freebsd.org> In-Reply-To: --------------I09uQmPb5R5UnWGV2ZrkEXy5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 V2FybmVyIExvc2ggd3JvdGU6DQo+IA0KPiANCj4gT24gVGh1LCBKdW4gNSwgMjAyNSwgNjo0 NuKAr1BNIENoYXJsaWUgTGkgPHZpc2h3aW5AZnJlZWJzZC5vcmcgDQo+IDxtYWlsdG86dmlz aHdpbkBmcmVlYnNkLm9yZz4+IHdyb3RlOg0KPiANCj4gICAgIEpvaG4gQmFsZHdpbiB3cm90 ZToNCj4gICAgICA+IE9uIDYvNS8yNSAxOToyOSwgQ2hhcmxpZSBMaSB3cm90ZToNCj4gICAg ICA+PiA8c3lzL2Rldi9udm1lLmg+IGRvZXNuJ3QgYXBwZWFyIHRvIGJlIG1ha2luZyBpdCBp biBudm1lX2FsbC5oIGFzIHRoZQ0KPiAgICAgID4+IGJ1aWxkIGNvbXBsYWlucyBhYm91dCBt aXNzaW5nIG52bWVfb3Bjb2RlX3NidWYoKSBpbiBudm1lX2FsbC5jLg0KPiAgICAgID4NCj4g ICAgICA+IEFyZSB5b3UgZ2V0dGluZyBhIGxpbmsgZXJyb3Igb3IgYSBjb21waWxlIGVycm9y P8KgIEkgYnVpbHQgdGhpcw0KPiAgICAgbG9jYWxseQ0KPiAgICAgID4gc2V2ZXJhbCB0aW1l cw0KPiAgICAgID4gdG9kYXkgdG8gdGVzdCB2YXJpb3VzIGNvbWJpbmF0aW9ucyAoa2VybmVs cyB3aXRoIGFuZCB3aXRob3V0DQo+ICAgICBlaXRoZXIgQ0FNDQo+ICAgICAgPiBvciBudm1l IGFuZA0KPiAgICAgID4gbG9hZGluZyBudm1lLmtvIGluIGtlcm5lbHMgd2l0aG91dCB0byBt YWtlIHN1cmUgaXQgd29ya2VkKS7CoCBJIGFsc28NCj4gICAgICA+IGJ1aWx0IEdFTkVSSUMN Cj4gICAgICA+IHByaW9yIHRvIHB1c2hpbmcgYW5kIGl0IGJ1aWx0IGZpbmUuDQo+ICAgICAg Pg0KPiAgICAgQ29tcGlsZSBlcnJvciBpbiBidWlsZHdvcmxkLg0KPiANCj4gDQo+IEluIGxp YmNhbT8NCj4gDQpZZXMgbGliY2FtLiA3YjNlZTM5ZTczYWYgYWxsb3dlZCB0aGUgcmVzdCBv ZiBidWlsZHdvcmxkIHRvIGNvbnRpbnVlLg0KDQotLSANCkNoYXJsaWUgTGkNCi4uLm5vcGUs IHN0aWxsIGRvbid0IGhhdmUgYW4gZXhpdCBsaW5lLg0K --------------I09uQmPb5R5UnWGV2ZrkEXy5-- --------------FOob0JMBWh7U0jSvTKmCFJAB Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCaENn+AUDAAAAAAAKCRBnj5NgWEFcymBQ AQDG5fUjQ74hkp5eov/ceTo6BHgifbyuMEcznegFkuBZtAEAgvWKAoX7wWv07GtPDXGLTS2PCc2z AS11Ugni11hFtgM= =wY7h -----END PGP SIGNATURE----- --------------FOob0JMBWh7U0jSvTKmCFJAB-- From nobody Fri Jun 6 22:17:40 2025 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 4bDbKc3pdbz5y5bB; Fri, 06 Jun 2025 22:17: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 4bDbKc3Dz9z4PvR; Fri, 06 Jun 2025 22:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749248260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MfaHIpBzs4wr6qrU7ck1pOUY3URQcLMkE6zdTk4ey84=; b=Z6MhyOoppFyxqV3VgqBKRX2tbrFATdFNQ6xb8zWv0nzumpdtFTPGBG5XiCawh2SeLo6d31 P3WuIQ0oDxw2+xeqg2eu9lvazSW7NQGPX/t2UsuetPj5O0n67WdgvTErgBl6JQqgmk4l7T a5AIN/zu8JbZ3/TASORuUcQw6kAh9iUhOh1N3Afl7Uf0pJOt9XexmmKBc8KRlSWJcdNaJH hlSyCxtCJgooEfiGLeykml8FTB0627w3C/VOgejyMs9JHdrgBCROcA3Ctk3+6kvkB55y+Q tpNBjYZKgcUbRwK9gVzz0FSsjsGWNE38kHYgLhuh5AcGyWCb3Ox7nesRa3xmEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749248260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MfaHIpBzs4wr6qrU7ck1pOUY3URQcLMkE6zdTk4ey84=; b=GFVrX235gDN5gRgQQQMkDwJyRm5JB1DvLqMxqCajpfwq41308XWmJxtCUf8cIEuGmUPRYT d1ECKA/bxTFkjLroEqD0d9vQTcWcVDRaU4x4o0w+jN+FxMF9f5O7+lO7jkpHzlQ2ZAjNt5 BdZplKb0IZ8uvH2pfRZz1CsVrqFj4nczSSO82u/cirlOJixnRGy0WRgaX5E/4ykbP88l1Q f+jhUP22/h4w4+1VexZn8WIp5Ie51Eow0ECH9O0BiB8wjfJlhhYROz32BW4/2R+zx+NgnX NaavasUi5mQ/V771zb5KiHtXAkqYKTFaTlQ2y34NpxRO+9vHLn09x7GaYXnlJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749248260; a=rsa-sha256; cv=none; b=ke26245E4PRSCfWcPEvQbY7o/Bury++TM0zupeHvGFqRMxRIyOJcDYOlVW2hkfVNkAAeCc mZ41uSXw1C3WWOoS5EuIVx1y8iAZd4TXhIJQceYz+//3tzMc/3LqInqrjE6cAab5qfxe4v Xx4FXuIV9FbFKVnmWkRUzt/rVpLbANXjTDqXDW88r0LvpxSacMZfM8TJThh4Hz9/dmmXLU 3rqQxFEh+o6LRGFkrHxJvCkDKWx5jH2uhDjYBpkc771CDHBkgBQ1aiKeYj0ms8+5EP42Kj nhjHk+sRZ7w03F+Q3h8jnyDxyOJllTe364VE9a64Q8vNVmqxTliAu4GWadz90g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDbKc2hKdz1BwC; Fri, 06 Jun 2025 22:17: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 556MHenj025493; Fri, 6 Jun 2025 22:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556MHeM9025490; Fri, 6 Jun 2025 22:17:40 GMT (envelope-from git) Date: Fri, 6 Jun 2025 22:17:40 GMT Message-Id: <202506062217.556MHeM9025490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 9623040eee15 - main - closefrom: always use close_range(2) 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9623040eee15b05b50b90b01da18537cce26a353 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9623040eee15b05b50b90b01da18537cce26a353 commit 9623040eee15b05b50b90b01da18537cce26a353 Author: Brooks Davis AuthorDate: 2025-06-06 21:13:29 +0000 Commit: Brooks Davis CommitDate: 2025-06-06 21:58:29 +0000 closefrom: always use close_range(2) close_range(2) was added prior to 13.0. There is no need to support a new userspace on such an old kernel. Reviewed by: kevans, imp Differential Revision: https://reviews.freebsd.org/D50730 --- lib/libc/sys/closefrom.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/libc/sys/closefrom.c b/lib/libc/sys/closefrom.c index 292702fad38c..76ed4e744397 100644 --- a/lib/libc/sys/closefrom.c +++ b/lib/libc/sys/closefrom.c @@ -26,20 +26,12 @@ */ #include -#include #include #include "libc_private.h" -#define CLOSE_RANGE_OSREL 1300091 - void closefrom(int lowfd) { - - if (__getosreldate() >= CLOSE_RANGE_OSREL) - __sys_close_range(MAX(0, lowfd), ~0U, 0); - else - /* Fallback to closefrom(2) on older kernels. */ - syscall(SYS_freebsd12_closefrom, lowfd); + __sys_close_range(MAX(0, lowfd), ~0U, 0); } From nobody Fri Jun 6 22:17:41 2025 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 4bDbKf0FhTz5y5gt; Fri, 06 Jun 2025 22:17: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 4bDbKd4Y89z4Pwr; Fri, 06 Jun 2025 22:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749248261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOsES4Z1F56/Qxp1g+6KzorZkSjLzi79Igiq+iJXKd8=; b=XGt2AswcQSUIfOo1B7wTPWxk4djUZJV3NttC/6bgWSJTr0B/cLFUwz7VPXgDVnaluB0xOw gxcRodiJqgaVTHmjrgut3qDit9+bzvRY6Uhf9mXUkLJVBmLNvk7KX2SDg9SSQc5SjtcTnZ Raqwbn6ESXduD7qkUwNILlxUUwDLncRDSxThnjDGQkS33KqqO4YHoRIsvv3IeRML0yIVo1 K9Lsj3jgrYtMIiTztByN82pEvrwXwIVCBKt7xmZrx75pkNQe/IKCHAZsJ1aSouZox0yGxV yd78+dra0W/1Fq04iw7uQXM+V7j+ZygGOIt/EZhaS20YbTFkjIkSQHvYSttRyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749248261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOsES4Z1F56/Qxp1g+6KzorZkSjLzi79Igiq+iJXKd8=; b=ug+p/ISR2+32s846a7lR0HCjev23v/AMUyTogqMxJe9oBmPg6Etx8R6SNvZVeyUqJtJTtL yx5lVSt3SRFV6uhStdH+U+3SbmgZcb+TqRECybqfLNCpzD4Q0ZsfSKkQnCE5q8/1OZtjrk dZfmoVCTML1s2SyBeVAx0QGoZjM5gb2liPsPbORviKltmvYr581NcnC/gWADRLBH3UFr/g wEUElmpN1UApjYoKthaMk+Vy5GJwnmvMSrIbhQ/UmEWuUCaI3Rw3tTnf/MyAUo5uLFlaRi HsJtQDJ3UQtDiVv1xfGwTOUJ7y+l6Wj2lcmEQU1gVUUqhHUX2G4txmxpWnv43w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749248261; a=rsa-sha256; cv=none; b=cBy6C/ESfVFJRGAF3+PtCKaCCJpLX93opOaHlBtoIODohycPs1vdLoPgGNxzalG1SKz2YL zmflFI2sziYTZgBtWxpfT+pTapa0kXTivSCb1A0QIATVeR4SEPqW8ebk2fLrqU26ipGS6M OD4hdIlQFmLIPjqntggaCUg89EBkWabbbXw8HvdVsONwvZyrPz0n0WG7G9IsL3oroZ8WNE B1GRjZZEUf1tDiynZN4ybAFZXlxKuUnw0uOZz5tGwM9KCaxTkupDBcfxgVMsrl4J23F1yM W4/1gwzDJqkImvqVa03P9ottnXoSDRYG8GJagXXAwpbIcy1crdJN6DK5NJSY1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bDbKd3v2jz1CGj; Fri, 06 Jun 2025 22:17: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 556MHfr5025533; Fri, 6 Jun 2025 22:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556MHf4M025530; Fri, 6 Jun 2025 22:17:41 GMT (envelope-from git) Date: Fri, 6 Jun 2025 22:17:41 GMT Message-Id: <202506062217.556MHf4M025530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2a5841795fb7 - main - src.conf.5: regen with MITKRB5 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a5841795fb78f29fbeed246deba10b2872b8ffa Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2a5841795fb78f29fbeed246deba10b2872b8ffa commit 2a5841795fb78f29fbeed246deba10b2872b8ffa Author: Brooks Davis AuthorDate: 2025-06-06 21:49:58 +0000 Commit: Brooks Davis CommitDate: 2025-06-06 21:58:29 +0000 src.conf.5: regen with MITKRB5 This option doesn't actually do anything yet, but we need to update src.conf.5 to keep CI happy. Fixes: 290e8aaa3840 ("share/mk: Add MIT KRB5 build knob") --- share/man/man5/src.conf.5 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index d52f0a170203..3afc79516366 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd May 26, 2025 +.Dd June 6, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -450,6 +450,8 @@ When set, it enforces these options: .It .Va WITHOUT_LOADER_ZFS .It +.Va WITHOUT_MITKRB5 +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL @@ -1288,6 +1290,8 @@ This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITH_MITKRB5 +Set this to build MIT Kerberos 5 instead of KTH Heimdal. .It Va WITHOUT_MLX5TOOL Do not build .Xr mlx5tool 8 @@ -1422,6 +1426,8 @@ When set, it enforces these options: .It .Va WITHOUT_LOADER_ZFS .It +.Va WITHOUT_MITKRB5 +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL_KTLS From nobody Fri Jun 6 23:10:13 2025 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 4bDcVJ33Cbz5y8Gt; Fri, 06 Jun 2025 23:10:16 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDcVH6XSfz3m5Q; Fri, 06 Jun 2025 23:10:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id NTSvuDbbY5MqyNgCVuUFCi; Fri, 06 Jun 2025 23:10:15 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id NgCTuSKXbWbOaNgCUuA2Tj; Fri, 06 Jun 2025 23:10:15 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=68437557 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=DP1YVvf8Lzd6IFmn3JEA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 59D71139; Fri, 06 Jun 2025 16:10:13 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 27390CA; Fri, 06 Jun 2025 16:10:13 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Brooks Davis cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a5841795fb7 - main - src.conf.5: regen with MITKRB5 In-reply-to: <202506062217.556MHf4M025530@gitrepo.freebsd.org> References: <202506062217.556MHf4M025530@gitrepo.freebsd.org> Comments: In-reply-to Brooks Davis message dated "Fri, 06 Jun 2025 22:17:41 +0000." 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 Date: Fri, 06 Jun 2025 16:10:13 -0700 Message-Id: <20250606231013.27390CA@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCPuJUfei759WK1sOd7imnA69MWdx6mxSsW6mOzzZoXxrxpJi5Q4TA1kmMWEz1gH8Iky0wZUq5Th8d/AlOdfK/MRYoSneVPoMaFDIaMIsiQlMLzmFTiQ VvOOAt8QUjaDJW/1wYjA7XGFBzP7AMmliahv6wkqbrnZFdrnZdGRWk4eatL0J5Ct/kxFeaQCHEHgj5Rd/ppob1qW6VRlCT0rI3+y91slDb2qzyxPJHwuwnt1 3RUhGtOIcT9EZi6cWt7qaxxZIgS5FifY0GymHsCzBSPIW5NZPMC1//8Llx5EHk/ycAsiBxhFMC74wcyuohIj+kUSSVm3NSRf980Gm344V64= X-Rspamd-Queue-Id: 4bDcVH6XSfz3m5Q 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:16509, ipnet:3.96.0.0/15, country:US] In message <202506062217.556MHf4M025530@gitrepo.freebsd.org>, Brooks Davis writ es: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a5841795fb78f29fbeed246deba10b2 > 872b8ffa > > commit 2a5841795fb78f29fbeed246deba10b2872b8ffa > Author: Brooks Davis > AuthorDate: 2025-06-06 21:49:58 +0000 > Commit: Brooks Davis > CommitDate: 2025-06-06 21:58:29 +0000 > > src.conf.5: regen with MITKRB5 > > This option doesn't actually do anything yet, but we need to update > src.conf.5 to keep CI happy. > > Fixes: 290e8aaa3840 ("share/mk: Add MIT KRB5 build knob") > --- > share/man/man5/src.conf.5 | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 > index d52f0a170203..3afc79516366 100644 > --- a/share/man/man5/src.conf.5 > +++ b/share/man/man5/src.conf.5 > @@ -1,5 +1,5 @@ > .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. > -.Dd May 26, 2025 > +.Dd June 6, 2025 > .Dt SRC.CONF 5 > .Os > .Sh NAME > @@ -450,6 +450,8 @@ When set, it enforces these options: > .It > .Va WITHOUT_LOADER_ZFS > .It > +.Va WITHOUT_MITKRB5 > +.It > .Va WITHOUT_OPENSSH > .It > .Va WITHOUT_OPENSSL > @@ -1288,6 +1290,8 @@ This must be set in the environment, make command line, > or > .Pa /etc/src-env.conf , > not > .Pa /etc/src.conf . > +.It Va WITH_MITKRB5 > +Set this to build MIT Kerberos 5 instead of KTH Heimdal. > .It Va WITHOUT_MLX5TOOL > Do not build > .Xr mlx5tool 8 > @@ -1422,6 +1426,8 @@ When set, it enforces these options: > .It > .Va WITHOUT_LOADER_ZFS > .It > +.Va WITHOUT_MITKRB5 > +.It > .Va WITHOUT_OPENSSH > .It > .Va WITHOUT_OPENSSL_KTLS > Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Sun Jun 8 15:22:51 2025 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 4bFf2342jvz5xgX5; Sun, 08 Jun 2025 15:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bFf232Sk7z3LPx; Sun, 08 Jun 2025 15:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749396171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IvxDRHJzxEgXzHbqn6UPxd5ckBW8u7XYce/KxySips=; b=dccSAO/syV6IFCVUxRpokFezFrPRkuST8QtCB8/lsF8uId6Zu4oBZNMQokJ9efhOIwbPBc B+WXhAZtHt2yLwIMXu4BNKVZ6z+kuHpG5FTXPqTQ5tam2otavSjOmJU9WYiVTB7+8i3LHb EWlIXSLGMqYMZjUY1Q8Wd7WUI1P26cv01chpHfqFX7o8mP7XRoK+UJULyAc1sGNlJlO2uc MhOEmKPYCg47OQFA6UjWhWnZmDD1XcWwxrWTEEzXCxCQd2U2/uw7BulWQM5cTPgKiqyOnr Rp2LIv/1BdS7ijGrqWUFSrBXyTeFhH/SNGluGKpUB+UJJubjuVvCGk9ynW5O+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749396171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IvxDRHJzxEgXzHbqn6UPxd5ckBW8u7XYce/KxySips=; b=sJiIh8LQTvp4WgeajuJh+ua95kmoCsg13vBytBVHzjle7oNTmaS+NDxuoj8LtZX4QdN1hG GQIich1i63F+T94Dz+QMPym9JIGNtNcKm5+zRQtvWbI/ULyCjTB3oYhYZHRNnouIv+oVbD WUFM5s3wXnbE56bGc5e4ye/GnMPqR0Hmzfl4JwwqFAZKSUcK9U6wHDj4U9E5rvUPf8W8IB +xxiJvhXrZTZViIyYc9iG5YS1ROSWC5n7Y5xvXKKKI0IMH3eJQjYpSCAPA2elyQ7IOyjME Ys+AGd2J+1q13IOTY6+D1RO0pLvL6T+TvJTWb0CCzX+W3QYbG+mOnOtjVeypIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749396171; a=rsa-sha256; cv=none; b=SLlegEJuAOm0qI0I4Y0f3xUMu/3UTQG1m1mUMAVp2rihSduNe2L1TC2EGBSHp8SrbqECKo UJM4o0UWGjocLhXvCYU5C/uILuXTxOmTV9YgB5IJ6ufZErrRY8awGx1FyP00e7cIrMek5R +aASe+4oYxtWRcuQhH1xVIvV4/V2IAzXuP54C9chZ3F4dxf8nnDQJsxmQoeG2Q5zHv8kS3 FC03inkqQq6390+iyGym/ywAoI5PWFpmuWwkPrtKHFnBF/0wpI7hIiSXSxE9n9YJDgbVVv n0ZE+VgdjycrwmmR4truvovNswgziLUyeyU1XAKF+5AI/HRlGRtrv9PDgMEc5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bFf23249Gz197; Sun, 08 Jun 2025 15:22:51 +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 558FMpuf051265; Sun, 8 Jun 2025 15:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 558FMpsA051262; Sun, 8 Jun 2025 15:22:51 GMT (envelope-from git) Date: Sun, 8 Jun 2025 15:22:51 GMT Message-Id: <202506081522.558FMpsA051262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Juraj Lutter Subject: git: 99ec65e7fe61 - main - traceroute6(8): Stop probing on networks rejected. 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: otis X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99ec65e7fe61e3148dde543ed7d6566fe589a565 Auto-Submitted: auto-generated The branch main has been updated by otis: URL: https://cgit.FreeBSD.org/src/commit/?id=99ec65e7fe61e3148dde543ed7d6566fe589a565 commit 99ec65e7fe61e3148dde543ed7d6566fe589a565 Author: Juraj Lutter AuthorDate: 2024-11-11 22:39:00 +0000 Commit: Juraj Lutter CommitDate: 2025-06-08 15:21:24 +0000 traceroute6(8): Stop probing on networks rejected. Stop probing after receiving ICMP6_DST_UNREACH and print ICMP6 error code. The behavior can be observed by tracing the route to, for example, 2a02:ee80:4028:1126:: Discussed with: Job Snijders, Nick Hilliard Obtained from: OpenBSD Reviewed by: markj, jlduran Differential Revision: https://reviews.freebsd.org/D47520 --- usr.sbin/traceroute6/traceroute6.8 | 6 ++++-- usr.sbin/traceroute6/traceroute6.c | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8 index f185b8087411..406a96a04424 100644 --- a/usr.sbin/traceroute6/traceroute6.8 +++ b/usr.sbin/traceroute6/traceroute6.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 2, 2024 +.Dd November 12, 2024 .Dt TRACEROUTE6 8 .Os .\" @@ -75,7 +75,7 @@ .Sh DESCRIPTION The .Nm -utility uses the IPv6 protocol hop limit field to elicit an ICMPv6 +utility uses the IPv6 protocol hop limit field to elicit an ICMP6 TIME_EXCEEDED response from each gateway along the path to some host. .Pp The only mandatory parameter is the destination host name or IPv6 address. @@ -191,6 +191,8 @@ Destination Unreachable - Not a Neighbour. Destination Unreachable - Address Unreachable. .It !H Parameter Problem - Unrecognized Next Header Type. +.It ! +ICMP6 unreachable code . .It !\& This is printed if the hop limit is <= 1 on a port unreachable message. This means that the packet got to the destination, but that the reply had a hop diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index bfa840b3b1c2..173e97c13bb3 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -1009,6 +1009,10 @@ main(int argc, char *argv[]) printf(" !"); ++got_there; break; + default: + ++unreachable; + printf(" !<%d>", code & 0xff); + break; } } else if (type == ICMP6_PARAM_PROB && code == ICMP6_PARAMPROB_NEXTHEADER) { From nobody Sun Jun 8 18:28:35 2025 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 4bFk8N2nFWz5xw86; Sun, 08 Jun 2025 18:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bFk8N0Bfgz3tQb; Sun, 08 Jun 2025 18:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749407316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFZi+rSLNB1aRVJeN0cPd64xCjcOEJqHyeUI0Xuw0nw=; b=ByqyhGsr//oAF39+loxto3lP2e3vUgE6qjY/7Z/D1bAYTT/ADUKz+O8B2xpNPB1eA27iwF logIYa9aBkVA5A28WMHZCLJWbsppKwN+J476dMDrgPmKErSdBkeOg3QzmhAbSdcC231L/0 eMYQ1z0SqKsjhvPCKT3Ty2PKz40G0mYNvDZji1x0mD4iBQULSyuSbccEYOPcxrOAq/tMF9 HkparI9xAOpe4lIuqOo9lchLhoZpinKgK52V0qNjkVBKc/jXsDe9JVS3lY2x0Uey4MOiqc V9ckmWuSHxR9tV9vI9PGhSkJ0/iW0oxTC+28d3Hp7vRbqn95Oe/ICrFN7ePhuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749407316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFZi+rSLNB1aRVJeN0cPd64xCjcOEJqHyeUI0Xuw0nw=; b=pVRjNw8vBEkEbTwEGJxA7InKympeL6gHGnGD1vUJN+NYJEZTAsSARxZ8V9DP6VQNZaMVou hQNUZhhWd3RjhTUd0tZKTycHY255d3zmUAXYwz6HUtOCR67m+1kJ77gNFBMD6hSGW1y09r cPU70M6tUYbd5x1lsAFdRANESojAIw8YDOYg5GHzx5OQkMmAI5WhtkkGGF3te63WQpYC/n ZYa+7exuBVwpoDRwF9ZDyesceXhQGPJO840ohAtW4bS1magrdSoab+zRRUln9edsxVBnaV vm279M8iRW/g5TcEZYeIIiKUNKgpilue55SkpZFKlXSMuqRggNhUuEs8pjsk/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749407316; a=rsa-sha256; cv=none; b=Cn+MnJX/jMy/jjSOpJotllKoi8Nff20kXgDLKZRbXAanoSIwtnvO6aY60soWsspBuddXLj UnoFcoGllnR5JT/FuUhETEJvRCNw+jtpRpdwUSTtI+QEE/a4Gs/Oc9RuKLLs3kod9pHgrK Du+9YDvYld+cIi+UWEp1pqrgROyKRNPRnYuTlLgldt5f0IqaSx8MWNqmei9isYQOYVR2GU f2d0Jy473oDWmjt39WZ1nXylBoUlKcNctuTiqRio41QzaQH9HvtdXBFiHVAoP1/kGUkbaA On81dk67jEMz3xgqJGF1tE1HISmAGhIiXSlbMAk7sjaa9LPqyymf74O+EYEghQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bFk8M6d1Fz68C; Sun, 08 Jun 2025 18:28:35 +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 558ISZB3090360; Sun, 8 Jun 2025 18:28:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 558ISZSQ090357; Sun, 8 Jun 2025 18:28:35 GMT (envelope-from git) Date: Sun, 8 Jun 2025 18:28:35 GMT Message-Id: <202506081828.558ISZSQ090357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3a427b832084 - main - rtw89: prevent a NULL pointer deref in rtw89_swap_chanctx() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a427b8320840f1e69779efeccc5898eb2972030 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3a427b8320840f1e69779efeccc5898eb2972030 commit 3a427b8320840f1e69779efeccc5898eb2972030 Author: Bjoern A. Zeeb AuthorDate: 2025-06-08 18:05:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-08 18:19:36 +0000 rtw89: prevent a NULL pointer deref in rtw89_swap_chanctx() It is currently unclear if this is a result of the driver itself already or the way LinuxKPI drives channels and the driver simply accepting and acting on things it no longer should. For now put the bandaid into place to make the driver work and pass packets. For better resilience the check does not hurt anyway. The moment we enter rtw89_chanctx_ops_add() the first time, entity_map 0x00000001 has the lowest bit set and find_next_zero_bit() will return 1. As a result the driver will try to swap chanctxs and trip over a NULL pointer in rtw89_swap_chanctx(). See comment there for how to (likely) trigger it. Sponsored by: The FreeBSD Foundation Reported by: Axel Rau (Axel.Rau Chaos1.DE) with 8852CE MFC after: 3 days --- sys/contrib/dev/rtw89/chan.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/contrib/dev/rtw89/chan.c b/sys/contrib/dev/rtw89/chan.c index 4df4e04c3e67..257331c2de2e 100644 --- a/sys/contrib/dev/rtw89/chan.c +++ b/sys/contrib/dev/rtw89/chan.c @@ -2612,6 +2612,27 @@ static void rtw89_swap_chanctx(struct rtw89_dev *rtwdev, if (idx1 == idx2) return; +#if defined(__FreeBSD__) + /* + * __rtw89_config_entity_chandef() might set RTW89_CHANCTX_0 but no + * cfg assigned. + * A mac80211 (*config)() with IEEE80211_CONF_CHANGE_CHANNEL could do + * that if rtw89_config_default_chandef() from rtw89_entity_init() does + * not already. + * A mac80211: (*assign_vif_chanctx)() following will find idx 0 filled + * and rtw89_chanctx_ops_add() will call here. Trying to swap results + * in a NULL pointer deref as hal->chanctx[idx1].cfg is NULL. + * Catch this for now until fully understood or a proper solution is + * found. + */ + if (hal->chanctx[idx1].cfg == NULL || hal->chanctx[idx2].cfg == NULL) { + rtw89_debug(rtwdev, RTW89_DBG_CHAN, + "%s: !swapping idx1 %d cfg %p, idx2 %d cfg %p\n", __func__, + idx1, hal->chanctx[idx1].cfg, idx2, hal->chanctx[idx2].cfg); + return; + } +#endif + hal->chanctx[idx1].cfg->idx = idx2; hal->chanctx[idx2].cfg->idx = idx1; From nobody Sun Jun 8 18:36:48 2025 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 4bFkKs1lrlz5xwrr; Sun, 08 Jun 2025 18:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bFkKs0FQvz42bg; Sun, 08 Jun 2025 18:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749407809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+NHATqZM0v3urQaevNgDmv+N7fNGKsqX7ELUT7C0Ak=; b=CK1hmvgLS9+eRkO+V4foIoM+kciCAo1Aa/YdjcNArduySHFTjRkHv5LawPeHVtDMqXnPxR 81B9VSNqbjrtECC1RCG4q37/ygGNAIAVquXEdf47dhlZYPmG5comWgvXxZVdDggt1WPQXw VWcIxOhqhJCxrb9kUtDMxS4B6xvEtyZbQHAY8kFgm1nhzaspNZjxidaPJscDofEA9cVYC0 HC3eSTm46/yhKmNvCZpLc+Fn3ij21pU8u6C+5SX+to1PXUTUcZurW+a4V86+bOlaFIYf6M pZ7Jreau3y0GWeAtZbi5WR93ynrhk7CFEoIgA7yZzmmdFYDxHQAVMI71Zs+MaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749407809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+NHATqZM0v3urQaevNgDmv+N7fNGKsqX7ELUT7C0Ak=; b=ZX+UhXE28TpVWOL4KBeUwuPNYwt2/N8LuHY4/qwLjH8uKPaBwj2wZNKLUxx6ipe07HRNgy eiYFjSulGlHZONnvWLzGij4+I8fwQOFjGZiUKb1mNQbdXj8BWiOWD9oM3q3Pq66wCzmPGF FYGbfdaxmgmP1xAsJ31/1xfnp/W1kj/WGjBrncEAn07yBBLzMDMVgi4yAniJF0PoFk35pg uvoDloyRaDHWuywn+LEzef3B0wLVBJuOK+1SMPOXnNdpGlbyyviHcgrpcFk1ZXIyyTnlJQ fuaD/AIFEMniyLY2klAPLnLsazkBfgJc8Pzw6t2Qvusji5eMFemNExoRjXiElA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749407809; a=rsa-sha256; cv=none; b=EE0o3EyxLmGP5my3ppIj97nE/w9RdzTctaJsy0vGm+7W+Jjl17386zwL+sytqTTK/J7peY JM1xR9RkeN5D6lFEK/OjAFdXvy0GJJ67x1jnrHPBPl7lWKWoe39TsYjo6+s08V/X39PvUe KKTEfQcdIY7ya/7nZ3GMVViHn1Fa8mcv6+X3UTCXhBHVhG7ecrspqSEev+vgMlXsGSjGnc mqhhplGaXcv90Iohvrg1Nru3xQl1WDf+NwvNoaIBhlJPa6M9nt9UdXPr03Zl7rgKRFtr13 WH9vXFltYkK2o+mXjiQS0GKOwg6u6q8U7XQWEuNU30OYxtSGnitBH0o2/E7s1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bFkKr6Whlz68f; Sun, 08 Jun 2025 18:36:48 +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 558IamHr008412; Sun, 8 Jun 2025 18:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 558IamHL008409; Sun, 8 Jun 2025 18:36:48 GMT (envelope-from git) Date: Sun, 8 Jun 2025 18:36:48 GMT Message-Id: <202506081836.558IamHL008409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 1fee99800a79 - main - vm_page: Retire its listq field 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: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fee99800a79887b9037749a34d09f2acab082c0 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=1fee99800a79887b9037749a34d09f2acab082c0 commit 1fee99800a79887b9037749a34d09f2acab082c0 Author: Alan Cox AuthorDate: 2025-05-27 08:27:16 +0000 Commit: Alan Cox CommitDate: 2025-06-08 18:35:56 +0000 vm_page: Retire its listq field Over the life cycle of a vm_page, its listq field has been used for two distinct purposes. First, linking together all of the pages allocated to a vm_object. Recently, c8d56817b80f ("vm_object: drop memq field") completed the elimination of this use case, using pctrie iterators in place of iteration over the listq. Second, linking together power-of- two-sized chunks of free pages within vm_phys. This change eliminates that use case. In essence, this change reverts vm_phys back to using the plinks.q field, like it did before 5cd29d0f3cda ("Improve VM page queue scalability."), but with a twist to maintain scalability. Just before vm_phys uses the plinks.q field, it ensures that any lazy dequeue from a paging queue, e.g., PQ_ACTIVE, has completed. Typically, the dequeue has completed, so vm_page_dequeue() is infrequently called by vm_freelist_add(). The reason being that vm_phys only needs to use the plinks.q field within the first page of any power-of-two-sized chunk, so the rest of the pages can still have pending dequeues until the chunk is split. This change saves a non-trivial amount of memory, since we have an instance of struct vm_page for every dynamically allocatable physical page. Bump __FreeBSD_version, since third-party modules that use the inline accessors in vm_page.h may need to be recompiled. Reviewed by: dougm, kib, markj Differential Revision: https://reviews.freebsd.org/D50515 --- sys/sys/param.h | 2 +- sys/vm/vm_page.c | 22 +++++++++++++++------- sys/vm/vm_page.h | 1 - sys/vm/vm_phys.c | 20 +++++++++++++++----- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index da2089918323..e167c96cf9f8 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500045 +#define __FreeBSD_version 1500046 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 79eaf8563208..128a1ef7ca54 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -341,7 +341,7 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose) vm_domain_free_unlock(vmd); if (found) { vm_domain_freecnt_inc(vmd, -1); - TAILQ_INSERT_TAIL(&blacklist_head, m, listq); + TAILQ_INSERT_TAIL(&blacklist_head, m, plinks.q); if (verbose) printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); } @@ -411,7 +411,7 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - TAILQ_FOREACH(m, &blacklist_head, listq) { + TAILQ_FOREACH(m, &blacklist_head, plinks.q) { sbuf_printf(&sbuf, "%s%#jx", first ? "" : ",", (uintmax_t)m->phys_addr); first = 0; @@ -2470,6 +2470,13 @@ again: } found: + /* + * If the page comes from the free page cache, then it might still + * have a pending deferred dequeue. Specifically, when the page is + * imported from a different pool by vm_phys_alloc_npages(), the + * second, third, etc. pages in a non-zero order set could have + * pending deferred dequeues. + */ vm_page_dequeue(m); vm_page_alloc_check(m); @@ -2536,17 +2543,18 @@ vm_page_alloc_nofree_domain(int domain, int req) return (NULL); } m->ref_count = count - 1; - TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, listq); + TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, plinks.q); VM_CNT_ADD(v_nofree_count, count); } m = TAILQ_FIRST(&vmd->vmd_nofreeq); - TAILQ_REMOVE(&vmd->vmd_nofreeq, m, listq); + TAILQ_REMOVE(&vmd->vmd_nofreeq, m, plinks.q); if (m->ref_count > 0) { vm_page_t m_next; m_next = &m[1]; + vm_page_dequeue(m_next); m_next->ref_count = m->ref_count - 1; - TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m_next, listq); + TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m_next, plinks.q); m->ref_count = 0; } vm_domain_free_unlock(vmd); @@ -2566,7 +2574,7 @@ vm_page_free_nofree(struct vm_domain *vmd, vm_page_t m) { vm_domain_free_lock(vmd); MPASS(m->ref_count == 0); - TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, listq); + TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, plinks.q); vm_domain_free_unlock(vmd); VM_CNT_ADD(v_nofree_count, 1); } @@ -3971,7 +3979,7 @@ vm_page_dequeue(vm_page_t m) old = vm_page_astate_load(m); do { - if (old.queue == PQ_NONE) { + if (__predict_true(old.queue == PQ_NONE)) { KASSERT((old.flags & PGA_QUEUE_STATE_MASK) == 0, ("%s: page %p has unexpected queue state", __func__, m)); diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 4bcd8d9f8236..4f82a69ebe25 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -229,7 +229,6 @@ struct vm_page { void *zone; } uma; } plinks; - TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */ vm_object_t object; /* which object am I in (O) */ vm_pindex_t pindex; /* offset into object (O,P) */ vm_paddr_t phys_addr; /* physical address of page (C) */ diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 95bf6b61fe19..ba16ae551093 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -393,13 +393,23 @@ static void vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int pool, int tail) { + /* + * The paging queues and the free page lists utilize the same field, + * plinks.q, within the vm_page structure. When a physical page is + * freed, it is lazily removed from the paging queues to reduce the + * cost of removal through batching. Here, we must ensure that any + * deferred dequeue on the physical page has completed before using + * its plinks.q field. + */ + if (__predict_false(vm_page_astate_load(m).queue != PQ_NONE)) + vm_page_dequeue(m); m->order = order; m->pool = pool; if (tail) - TAILQ_INSERT_TAIL(&fl[order].pl, m, listq); + TAILQ_INSERT_TAIL(&fl[order].pl, m, plinks.q); else - TAILQ_INSERT_HEAD(&fl[order].pl, m, listq); + TAILQ_INSERT_HEAD(&fl[order].pl, m, plinks.q); fl[order].lcnt++; } @@ -407,7 +417,7 @@ static void vm_freelist_rem(struct vm_freelist *fl, vm_page_t m, int order) { - TAILQ_REMOVE(&fl[order].pl, m, listq); + TAILQ_REMOVE(&fl[order].pl, m, plinks.q); fl[order].lcnt--; m->order = VM_NFREEORDER; } @@ -1582,7 +1592,7 @@ vm_phys_find_freelist_contig(struct vm_freelist *fl, u_long npages, * check if there are enough free blocks starting at a properly aligned * block. Thus, no block is checked for free-ness more than twice. */ - TAILQ_FOREACH(m, &fl[max_order].pl, listq) { + TAILQ_FOREACH(m, &fl[max_order].pl, plinks.q) { /* * Skip m unless it is first in a sequence of free max page * blocks >= low in its segment. @@ -1655,7 +1665,7 @@ vm_phys_find_queues_contig( for (oind = order; oind < VM_NFREEORDER; oind++) { for (pind = vm_default_freepool; pind < VM_NFREEPOOL; pind++) { fl = (*queues)[pind]; - TAILQ_FOREACH(m_ret, &fl[oind].pl, listq) { + TAILQ_FOREACH(m_ret, &fl[oind].pl, plinks.q) { /* * Determine if the address range starting at pa * is within the given range, satisfies the