From nobody Wed Jun 05 04:45:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VvFJj2VT1z5LWp2; Wed, 05 Jun 2024 04:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VvFJj1x0Hz4wvT; Wed, 5 Jun 2024 04:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717562741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qYLIIX+iC/aOUp153u5XigLd+qim5DGPbhAETbcwEGU=; b=fm9jR6pEiAs6kZFVWfToncL8OjM6+dY/btEMNXx+oNzKG0FTMX0b4GF4MrH6Xtzc16YMQo TpaddRS9oCJgpc9gbo9LBt1kT/B1Z+vJHtODPjxXNOfy4mZ+0YhzZ7Ytxp6OUll+FOhbyB JHDytjI6PxxO6qOxGXKq3W0LVr3F+meXI6fvoh4ehuVfNON95AXykWuI9kEgPsyQCwv6QL ikOs2kXJSqR73vxbFm5O6QdbiWta0WTWscSzsXDB9mB07v+TLDcXRVombyr6/Yj88qw9gZ vuI9iVCj5F/4NG0v1MevT7wQvZjbV3ARELm1qBPUNt6kndhrYq+F2/3Vl0UF+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717562741; a=rsa-sha256; cv=none; b=mAWOQtbuoz/EUju6pzJYifqarAhDudHbFwQFf+dVzUzSMo2VDPYevctuRPa/991rBBfI8d M+7mq+fwvaoGY3ZgxSiZPPULiQXkQEG+J1qB3wJzbDVCps6QyQK51SxXNbGHwfzgWB/6jK +kUOeosjEdEQJQDSdsoH8FDHYAqZExR4kY5113XOgyFYVYU4e0nerw8DdZ1yRt2jyXDkNf GX8stR9Xgng+gp92AyGTMosHMxCRxxWlfLHYmQQA9w9WO0AZy2ILBI0rMlX9xN1jVCEbM/ MPpqlH9W35GT9WJxU2PrOfd8VBiDd6WsBxMLCEFtWuM/z7Lf4B1MW5XDc4OTZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717562741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qYLIIX+iC/aOUp153u5XigLd+qim5DGPbhAETbcwEGU=; b=tNtnXs7pPywfyno3VACWekKtwM/EgUKs4UllivKWF5CT5Z57bMbM1NtiMQXGi9V+s68aab k/BHI88XhC3uKthkSyeoFhaq7EZRAORrkZuwds38InGPs2xFwaUMfqAkWrt8czc2N9zW0n /v9Keb7ydqj2pqr9RiYgJgKuY+680QIb7nBchRfpwOBB+xBOsPvKiV8jAxBuGw9mqAjkVk Sj+8Ls01/e/O9v/rJmyYGLlT52N4/I1tqNVIb+XPELcfWvVROxIo6B2AqPPpG0mMAv6u0N UNIkmcFf6pIuEE2UB1xuOSaBEIa2hOHb2/TpmaJI+JWzdQ9/XyAXbZ22+06E+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 4VvFJj1RbPzp4v; Wed, 5 Jun 2024 04:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4554jfel053656; Wed, 5 Jun 2024 04:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4554jf3x053653; Wed, 5 Jun 2024 04:45:41 GMT (envelope-from git) Date: Wed, 5 Jun 2024 04:45:41 GMT Message-Id: <202406050445.4554jf3x053653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ff4b8d51ac72 - stable/13 - mlx4, mlx5: Eliminate redundent NULL check for packet filter List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ff4b8d51ac72b426618c7c7ea438c5e2c7586fb6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4b8d51ac72b426618c7c7ea438c5e2c7586fb6 commit ff4b8d51ac72b426618c7c7ea438c5e2c7586fb6 Author: Zhenlei Huang AuthorDate: 2024-05-28 04:46:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-05 04:44:22 +0000 mlx4, mlx5: Eliminate redundent NULL check for packet filter mlx4 and mlx5 are Ethernet devices and ether_ifattach() does an unconditional bpfattach(). From commit 16d878cc99ef [1] and on, we should not check ifp->if_bpf to tell us whether or not we have any bpf peers that might be interested in receiving packets. And since commit 2b9600b4497b [2], ifp->if_bpf can not be NULL even after the network interface has been detached. No functional change intended. 1. 16d878cc99ef Fix the following bpf(4) race condition which can result in a panic 2. 2b9600b4497b Add dead_bpf_if structure, that should be used as fake bpf_if during ifnet detach Reviewed by: kp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45196 (cherry picked from commit 2439ae948352766f6b993c5103a4c516376bec28) (cherry picked from commit d98ced6588b522e8833888bc99b7b9468312b221) --- sys/dev/mlx4/mlx4_en/mlx4_en_tx.c | 2 +- sys/dev/mlx5/mlx5_en/mlx5_en_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c index 7cff1a224e9a..0bbc54790a40 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -688,7 +688,7 @@ int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp) dseg = &tx_desc->data; /* send a copy of the frame to the BPF listener, if any */ - if (ifp != NULL && ifp->if_bpf != NULL) + if (ifp != NULL) ETHER_BPF_MTAP(ifp, mb); /* get default flags */ diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c index 7a023c2499e2..44f38db911cb 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c @@ -745,7 +745,7 @@ top: mb = *mbp; /* Send a copy of the frame to the BPF listener, if any */ - if (ifp != NULL && ifp->if_bpf != NULL) + if (ifp != NULL) ETHER_BPF_MTAP(ifp, mb); if (mb->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)) {