Re: [PATCH v2 net] net: bridge: Do not offload IGMP/MLD messages
From: Ido Schimmel
Date: Wed Jul 16 2025 - 10:55:49 EST
On Wed, Jul 16, 2025 at 10:29:55AM -0400, Joseph Huang wrote:
> Talking about these packets being low rate, should I add unlikely() like so:
I don't think it's needed and probably not measurable in most (all?)
deployments. The entire thing is hidden behind static_branch_unlikely().
It just seemed weird to perform the checks about the Tx offload and only
later check if it's even a packet for which you want this offload.
>
> diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
> index 95d7355a0407..9a910cf0256e 100644
> --- a/net/bridge/br_switchdev.c
> +++ b/net/bridge/br_switchdev.c
> @@ -17,6 +17,9 @@ static bool nbp_switchdev_can_offload_tx_fwd(const struct
> net_bridge_port *p,
> if (!static_branch_unlikely(&br_switchdev_tx_fwd_offload))
> return false;
>
> + if (unlikely(br_multicast_igmp_type(skb)))
> + return false;
> +
> return (p->flags & BR_TX_FWD_OFFLOAD) &&
> (p->hwdom != BR_INPUT_SKB_CB(skb)->src_hwdom);
> }
>
> Thanks,
> Joseph