Re: [PATCH net-next v3 1/2] bridge: mcast: Fix a false positive lockdep splat

Ido Schimmel <[email protected]> Thu, 9 Jul 2026 17:08:46 +0300
Newsgroups gmane.linux.network.bridge
Message-ID <20260709140846.GA1679019__33413.8653635577$1783607150$gmane$org@shredder>
On Wed, Jul 08, 2026 at 03:28:19PM +0300, Ido Schimmel wrote:
> @@ -1783,6 +1841,7 @@ static void __br_multicast_send_query(struct net_bridge_mcast *brmctx,
>  				      u8 sflag,
>  				      bool *need_rexmit)
>  {
> +	struct sk_buff_head *queue;
>  	bool over_lmqt = !!sflag;
>  	struct sk_buff *skb;
>  	u8 igmp_type;
> @@ -1791,7 +1850,12 @@ static void __br_multicast_send_query(struct net_bridge_mcast *brmctx,
>  	    !br_multicast_ctx_matches_vlan_snooping(brmctx))
>  		return;
>  
> +	queue = pmctx ? &pmctx->query_queue : &brmctx->query_queue;
> +
>  again_under_lmqt:
> +	if (skb_queue_len_lockless(queue) >= BR_MULTICAST_QUERY_QUEUE_LEN_MAX)
> +		return;
> +
>  	skb = br_multicast_alloc_query(brmctx, pmctx, pg, ip_dst, group,
>  				       with_srcs, over_lmqt, sflag, &igmp_type,
>  				       need_rexmit);
> @@ -1800,11 +1864,8 @@ static void __br_multicast_send_query(struct net_bridge_mcast *brmctx,
>  
>  	if (pmctx) {
>  		skb->dev = pmctx->port->dev;
> -		br_multicast_count(brmctx->br, pmctx->port, skb, igmp_type,
> -				   BR_MCAST_DIR_TX);
> -		NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT,
> -			dev_net(pmctx->port->dev), NULL, skb, NULL, skb->dev,
> -			br_dev_queue_push_xmit);
> +		skb_queue_tail(queue, skb);
> +		queue_work(system_highpri_wq, &pmctx->query_queue_work);

The issue reported by sashiko-gemini [1] is addressed in patch #2.

[1]
"This isn't a bug, but it looks like the local variable igmp_type is no
longer used in __br_multicast_send_query.

Since br_multicast_count() was moved out of this function and into the
workqueue processing, the value returned via the &igmp_type parameter
from br_multicast_alloc_query() is no longer read. Could we clean this
up and remove the local variable entirely?"