Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'macvlan-broadcast-delivery-changes'

Eric Dumazet says:

====================
macvlan: broadcast delivery changes

First patch adds data-race annotations.

Second patch changes macvlan_broadcast_enqueue() to return
early if the queue is full.
====================

Link: https://patch.msgid.link/20260401103809.3038139-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+8 -3
+8 -3
drivers/net/macvlan.c
··· 356 356 const struct macvlan_dev *src, 357 357 struct sk_buff *skb) 358 358 { 359 + u32 bc_queue_len_used = READ_ONCE(port->bc_queue_len_used); 359 360 struct sk_buff *nskb; 360 361 int err = -ENOMEM; 362 + 363 + if (skb_queue_len_lockless(&port->bc_queue) >= bc_queue_len_used) 364 + goto err; 361 365 362 366 nskb = skb_clone(skb, GFP_ATOMIC); 363 367 if (!nskb) ··· 370 366 MACVLAN_SKB_CB(nskb)->src = src; 371 367 372 368 spin_lock(&port->bc_queue.lock); 373 - if (skb_queue_len(&port->bc_queue) < port->bc_queue_len_used) { 369 + if (skb_queue_len(&port->bc_queue) < bc_queue_len_used) { 374 370 if (src) 375 371 dev_hold(src->dev); 376 372 __skb_queue_tail(&port->bc_queue, nskb); ··· 1735 1731 } 1736 1732 if (nla_put_u32(skb, IFLA_MACVLAN_BC_QUEUE_LEN, vlan->bc_queue_len_req)) 1737 1733 goto nla_put_failure; 1738 - if (nla_put_u32(skb, IFLA_MACVLAN_BC_QUEUE_LEN_USED, port->bc_queue_len_used)) 1734 + if (nla_put_u32(skb, IFLA_MACVLAN_BC_QUEUE_LEN_USED, 1735 + READ_ONCE(port->bc_queue_len_used))) 1739 1736 goto nla_put_failure; 1740 1737 if (port->bc_cutoff != 1 && 1741 1738 nla_put_s32(skb, IFLA_MACVLAN_BC_CUTOFF, port->bc_cutoff)) ··· 1796 1791 if (vlan->bc_queue_len_req > max_bc_queue_len_req) 1797 1792 max_bc_queue_len_req = vlan->bc_queue_len_req; 1798 1793 } 1799 - port->bc_queue_len_used = max_bc_queue_len_req; 1794 + WRITE_ONCE(port->bc_queue_len_used, max_bc_queue_len_req); 1800 1795 } 1801 1796 1802 1797 static int macvlan_device_event(struct notifier_block *unused,