[PATCH 5/9] bpf: remove redundant memory barrier on unload

Stephen Hemminger stephen at networkplumber.org
Sun Oct 11 21:50:16 CEST 2026


On Sun, 11 Oct 2026 18:21:53 +0000
Marat Khalili <qm2k21 at gmail.com> wrote:

> In bpf_eth_cbi_unload(), rte_smp_mb() was called immediately before
> bpf_eth_cbi_wait(), which itself starts with rte_smp_mb().
> 
> Remove the redundant rte_smp_mb() call from bpf_eth_cbi_unload() and
> update the unload sequence diagram accordingly.
> 
> Signed-off-by: Marat Khalili <qm2k21 at gmail.com>
> ---
>  lib/bpf/bpf_pkt.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c
> index 7ee16cfa69..68671848e9 100644
> --- a/lib/bpf/bpf_pkt.c
> +++ b/lib/bpf/bpf_pkt.c
> @@ -62,8 +62,6 @@
>   *     |                      |               |              |              |                |
>   *   rte_smp_mb()             |               |              |              |                |
>   *     |                      |               |              |              |                |
> - *   rte_smp_mb()             |               |              |              |                |
> - *     |                      |               |              |              |                |
>   *     +-if use is odd        |               |              |              | if cb not NULL-+
>   *     | |                    |               |              |              |              | |
>   *     | +------------ fetch odd ------------>|              |              |<-- execute --+ |
> @@ -502,7 +500,6 @@ bpf_eth_cbi_unload(struct bpf_eth_cbi *bc)
>  {
>  	/* mark this cbi as empty */
>  	bc->cb = NULL;
> -	rte_smp_mb();
>  
>  	/* make sure datapath doesn't use bpf anymore, then destroy bpf */
>  	bpf_eth_cbi_wait(bc);

I think this already covered by:

https://patchwork.dpdk.org/project/dpdk/patch/20261008233649.1260843-2-stephen@networkplumber.org/


More information about the dev mailing list