From nobody Tue May 28 04:47:28 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 4VpKkT2FPfz5LZjS; Tue, 28 May 2024 04:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VpKkT1MTyz4d57; Tue, 28 May 2024 04:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716871649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4gKSxgblMfhtfqlm42L1RDlEDB1iQF0bwu0oA/XSEho=; b=YaXH6JZajxbhDTBvMpd4IBGIYsqo7nZrqJY7TRBlo2ViChl2U1Yk8N4jc2pexF8bcBW0Gf RyCWQz32QbOw45IHk6KgN0aBb6kcAAKL96Jit7p+nlSz/94auZWUv8vANdDTqOU5Amf6i1 QxEtFdIY2NBVg7x2sBIjy2YXOFIQxxVtbCQ+PqWscLPj8iTu2u1rp5WnuBrBUTBw9M6f1k qIMelzzW2D1S3XfsaNhqniduOtOnp6WgLCoaG0zWJ/ByXY0WYe9NYX+PCEkozHEdxPaEFD Edrkd7mgZ6WjThUFA5sZH88Rz/4CbOcUHpDS/uMmIBaSvUhk+1xduEc+90fgpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716871649; a=rsa-sha256; cv=none; b=OkpIxVcVAas2t/WsndKl9XQA1VpxWoN2gBF6YHUzlUG3xIPx/t66r4BZ9IT0kAoD6baY0a a8RoHwf+dzp7PbTM4GRkdEdGIcAlMJEFCMuhQ219Zuw/x8YA9RkXgJKd80NndBrAwO1DBs elvzw66zNK6U3I6ZKkqeGUMpbcp0jMGsqklPciOmrMqRcBlvwfuLDQWCHsDidNDG6Psgbn kyKsi7FfZtc0bRxMCCfnZZK10mB1PWYWS9cvO1mnIcXv6yqNROb5EVionRTJGe68wrL7pW D24ky1hFRDOyY+/zbd46uOMAL89PVkt7t9lU3sboO2cFHtbQxtJWkePtYGKCHA== 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=1716871649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4gKSxgblMfhtfqlm42L1RDlEDB1iQF0bwu0oA/XSEho=; b=fkn/xTNO5CpM6r1eac6WMNn47ecXPoJiRZDNqKP53GBHHgnlVhaqfwOhGMHJjcZlcgzkBq oUfKt1Te1jmUB5IkSqsVK32Pp7vxYS9VdAnOrnC2DTIubgZy2S3oQ/uhm6AXMnqQeNrg7Z QCnGu4FdWVZcV220l7bEm7V1s48n1tVb8W0n1guHuofXr+dBnXd8PzGtv1YwJ9GLIfvS67 nMtEHtaJrCvLmRWmdmSwGZG9zniX2MoCN3YDjQYamnOO6Ywdqe810wSf/1Xz8m+SUljS3R 0hmTf5b9i3RT6hbbyIH3S18zeXjg+LYJVZzRdKiJMiDgRTZLnXmFQtBNXTIT2A== 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 4VpKkT0p9Cz1DB7; Tue, 28 May 2024 04:47:29 +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 44S4lS6a050818; Tue, 28 May 2024 04:47:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44S4lSdt050815; Tue, 28 May 2024 04:47:28 GMT (envelope-from git) Date: Tue, 28 May 2024 04:47:28 GMT Message-Id: <202405280447.44S4lSdt050815@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: 2439ae948352 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 2439ae948352766f6b993c5103a4c516376bec28 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2439ae948352766f6b993c5103a4c516376bec28 commit 2439ae948352766f6b993c5103a4c516376bec28 Author: Zhenlei Huang AuthorDate: 2024-05-28 04:46:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-28 04:46:04 +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 --- 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)) {