From nobody Wed Jun 05 04:29:19 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 4VvDxq5xT0z5LTJh; Wed, 05 Jun 2024 04:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VvDxq3r5Gz4sQ7; Wed, 5 Jun 2024 04:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717561759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZlKRNz4vRKYTlp7DuHi0+z3/mt4A6A0JZhYXstBFQ5M=; b=Em9Fba75EMRLEnpQ6Yx0RylGOfs+FgKoZAvplBFXqSqFBCj5eJSs+zdDrHEgzxdFwLpcff 4YXm2kHxmGRKQB66sMXTih3pgXeZmbgHkKnzr4xRo2s3+dVGagVhmTogsrulzGJaofgYFm r9GS8mgHO+JFp/MJud0mKqHMijDPrNVmijeMn76emXdmYuYunU7xxFmnjF2H3tBDePLu8m nxaSbC+wuZ5fE2S9YETKuC/HWpFf452yodhG6jvAzW/aM6ThBu9acA0c7YakWkS7IIujJp QRIZkSBbeaLuG7EBBIKdK3Fmn7ZKONByLkZ49AbBdLN2EAdVFTTCuyLXOvrGhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717561759; a=rsa-sha256; cv=none; b=SFbzuZFPRY2cmqw0mbIeKvAIVwrHA2SK6tEs6cuRDpZNAM1tGQAVuC3lJewRmpN4a6JFfl tXjX9pscRFufjFJC6NB6owEGGoBQOr5IckVmiR7MZFXrPwZb0CzFWT4yh3b1u1MNyI8SNo G/65QSkbIfS5GaGcDv/UpOp6VLwxCS6OrtzKiiVwghiL/RMQr2vLrIILk9hx8t90rKatJL PDzjsQWTAiyrtV5fxzrEXklp2LlrWdV2vgECQLU2U4gIVuIbIyo3GnZO9oBM5k2Jw5/F7d Cd1ZZppQD10oPDIFRBWgKohcETnVilZ4jyw4X1CcgbLFd/5xdxtu+RvIJK6fDg== 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=1717561759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZlKRNz4vRKYTlp7DuHi0+z3/mt4A6A0JZhYXstBFQ5M=; b=n4hAmEQhKk/u8UyAWfCLgfyWst5/cXEU8DaT8DbHfHfUeWnXiFSEsHehhYXMkKBvEIKWzQ OekKDUPLlKA3Uw0aUG2xZzja/85zLj1jFq7mJJtQLeKLmuSXfVLN7KDFFPfSmFIPLps842 naTRtZ9M36X7bJ2gE/jTbgTbhIWR9LN48k13IuF1jgdBBRSmDqLkaBB8SqIHmjO56orbNq gi1H/o9TU0icQL+nw0+QYSBjTvE8UC1/0E5cvGG6iUshteMtNITVFQaKxAPdMhoZDMjiXm WycqPTNHU8Fmh/Mza3kbysqDVEoYH6XKvmPZvvzXd02okd8EHVnsMc7L5tisNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VvDxq3S7pzmvV; Wed, 5 Jun 2024 04:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4554TJpH020174; Wed, 5 Jun 2024 04:29:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4554TJkq020171; Wed, 5 Jun 2024 04:29:19 GMT (envelope-from git) Date: Wed, 5 Jun 2024 04:29:19 GMT Message-Id: <202406050429.4554TJkq020171@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: d98ced6588b5 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: d98ced6588b522e8833888bc99b7b9468312b221 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d98ced6588b522e8833888bc99b7b9468312b221 commit d98ced6588b522e8833888bc99b7b9468312b221 Author: Zhenlei Huang AuthorDate: 2024-05-28 04:46:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-05 04:27:11 +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) --- 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 9a73c7571fd7..d45ccacd7499 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 && if_getbpf(ifp) != 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 1f2820abc30e..3f70e8a818ea 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 && if_getbpf(ifp) != NULL) + if (ifp != NULL) ETHER_BPF_MTAP(ifp, mb); if (mb->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)) {