From nobody Wed Dec 3 23:20:02 2025 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 4dMDBV6VxQz6J1rG for ; Wed, 03 Dec 2025 23:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dMDBV4d0Pz3Zh0 for ; Wed, 03 Dec 2025 23:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764804002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OB838eFQbeHHdGUnwnEbrADQojy4nkcq/tD14DnkrWM=; b=vIwKEfcxw2cF9CdSgnYaKsKc0HvCpovY3TUomomXRQ1An+6MyuCNiKOCDYU4+7vB0BPmrN 9V6ny+kPUZp9MxE/Hm6yw6TyLQRyXn8kgsPWj6iWeEDhVlvK5oNw0OqeEy9gIKWF3zdOGU zwUl/8aNt4B4c5Z8de95hnwy4gBWeq7bAUF6G7j9LtKqjBh+xoyD5YLu5W8RS4YCabmXbJ /ZfeBboOmKhI9r1d1Ld8XOD6XwinHQ6Dzkh3ypc8Su0evd69Fv6Bp39whuSkd1aHHi1YHm 1tm75CTXexMNIoMOif5ijlXKJOj0st0x3x/WFwkfzJEvsdd7TGjHRcHFucUtvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764804002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OB838eFQbeHHdGUnwnEbrADQojy4nkcq/tD14DnkrWM=; b=KyCEpFIgmbvB+C5Nwu/lzCMKKkFGVQ/CT254vWm80brsDD5cJqYPM8YSAqD/+zBulYBoJl VSdQnKZcLJBvqB5B6HKprn8fAPHIVM4j0WT/1Cvv0jaI9/hYONhZf4hRclNWdPRq5UI5Ue 065PpKRbcs3xe6/dhazI+8hNoLGC10I97VdnRbw2bJRLBuMYBg4zTnPtTNH8EZDeODkkV5 +z9VKmTxjhlIt8+Om4iVGxrgF3SMxdvYzF2XdebaASCiDXOWv4qj0L9h8xKYp7t2xPN3ba 8jwA3kd1UKmKvW0ythGSJU/niGBp2WKWSpdQbYwzlGRptybIbHfsXPGM0KakYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764804002; a=rsa-sha256; cv=none; b=ghSMGsZ4h9/Nkf/WgVHRXwhaSSxvJvgG/IPiPMkjhO2Fw0+bqzdDqsXpVlpoOIcQVH6jrg XltxdrEQRQbm/j5KyHRD05ZZSJtROg223UVO0R9P5U1+9p+hetN+y1a08Idl0Xq0yvjxrK snTJ5fC0pXHuksi3Wz7RN299nUISY8SH/PEtr3FikyPh/Ljh6RNKASDieSx48f0whe0fzG fgwtu3vas5HlSsAJcZNgWcUSzcHa41x8IbuCYTuiKcyAt7m9yXTegDDVYcjPpceWGB1A7/ +HJju5JZobc/Ris9EuDCcWllUxQY3uTzpOs5fALRHDg8GsvBJRP35FH3XgGL7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dMDBV3qpVzyZ8 for ; Wed, 03 Dec 2025 23:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e633 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 23:20:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 72ca89482afc - main - bpf: global bpf list doesn't need CK 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ca89482afcdec7db1d7555bdb3505498c729c2 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 23:20:02 +0000 Message-Id: <6930c5a2.3e633.361b4798@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=72ca89482afcdec7db1d7555bdb3505498c729c2 commit 72ca89482afcdec7db1d7555bdb3505498c729c2 Author: Gleb Smirnoff AuthorDate: 2025-12-03 23:16:50 +0000 Commit: Gleb Smirnoff CommitDate: 2025-12-03 23:19:45 +0000 bpf: global bpf list doesn't need CK All accesses to this list are done with the global lock held. The CK connotation is just confusing the reader. Fixes: 699281b545a8a3fc5109b5f2db62d261b65b588b Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53869 --- sys/net/bpf.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index aff0d3c761ad..b043773bc876 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -97,7 +97,7 @@ static const struct bpfd_list dead_bpf_if = CK_LIST_HEAD_INITIALIZER(); struct bpf_if { struct bpfd_list bif_dlist; /* list of all interfaces */ - CK_LIST_ENTRY(bpf_if) bif_next; /* descriptor list */ + LIST_ENTRY(bpf_if) bif_next; /* descriptor list */ u_int bif_dlt; /* link layer type */ u_int bif_hdrlen; /* length of link header */ struct bpfd_list bif_wlist; /* writer-only list */ @@ -175,8 +175,8 @@ struct bpf_dltlist32 { * structures registered by different layers in the stack (i.e., 802.11 * frames, ethernet frames, etc). */ -CK_LIST_HEAD(bpf_iflist, bpf_if); -static struct bpf_iflist bpf_iflist = CK_LIST_HEAD_INITIALIZER(); +LIST_HEAD(bpf_iflist, bpf_if); +static struct bpf_iflist bpf_iflist = LIST_HEAD_INITIALIZER(); static struct sx bpf_sx; /* bpf global lock */ static void bpfif_ref(struct bpf_if *); @@ -2078,7 +2078,7 @@ bpf_setif(struct bpf_d *d, struct ifreq *ifr) /* * Look through attached interfaces for the named one. */ - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp == theywant && bp->bif_bpf == &theywant->if_bpf) break; @@ -2799,7 +2799,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, */ if_ref(ifp); BPF_LOCK(); - CK_LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); + LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); BPF_UNLOCK(); if (bootverbose && IS_DEFAULT_VNET(curvnet)) @@ -2817,7 +2817,7 @@ bpf_ifdetach(struct ifnet *ifp) struct bpf_d *d; BPF_LOCK(); - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; @@ -2848,11 +2848,11 @@ bpfdetach(struct ifnet *ifp) BPF_LOCK(); /* Find all bpf_if struct's which reference ifp and detach them. */ - CK_LIST_FOREACH_SAFE(bp, &bpf_iflist, bif_next, bp_temp) { + LIST_FOREACH_SAFE(bp, &bpf_iflist, bif_next, bp_temp) { if (ifp != bp->bif_ifp) continue; - CK_LIST_REMOVE(bp, bif_next); + LIST_REMOVE(bp, bif_next); *bp->bif_bpf = __DECONST(struct bpf_if *, &dead_bpf_if); CTR4(KTR_NET, @@ -2894,7 +2894,7 @@ bpf_getdltlist(struct bpf_d *d, struct bpf_dltlist *bfl) ifp = d->bd_bif->bif_ifp; n1 = 0; - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp == ifp) n1++; } @@ -2907,7 +2907,7 @@ bpf_getdltlist(struct bpf_d *d, struct bpf_dltlist *bfl) lst = malloc(n1 * sizeof(u_int), M_TEMP, M_WAITOK); n = 0; - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; lst[n++] = bp->bif_dlt; @@ -2939,7 +2939,7 @@ bpf_setdlt(struct bpf_d *d, u_int dlt) return (0); ifp = d->bd_bif->bif_ifp; - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp == ifp && bp->bif_dlt == dlt) break; } @@ -2986,7 +2986,7 @@ bpf_zero_counters(void) * We are protected by global lock here, interfaces and * descriptors can not be deleted while we hold it. */ - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { CK_LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { counter_u64_zero(bd->bd_rcount); counter_u64_zero(bd->bd_dcount); @@ -3074,7 +3074,7 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) } bpfd_cnt = 0; BPF_LOCK(); - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { CK_LIST_FOREACH(bd, &bp->bif_wlist, bd_next) bpfd_cnt++; CK_LIST_FOREACH(bd, &bp->bif_dlist, bd_next) @@ -3090,7 +3090,7 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) } xbdbuf = malloc(bpfd_cnt * sizeof(*xbd), M_BPF, M_WAITOK); index = 0; - CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { + LIST_FOREACH(bp, &bpf_iflist, bif_next) { /* Send writers-only first */ CK_LIST_FOREACH(bd, &bp->bif_wlist, bd_next) { MPASS(index <= bpfd_cnt);