summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@kernel.org>2026-11-04 10:28:51 +0100
committerJakub Kicinski <kuba@kernel.org>2026-11-10 10:38:47 -0800
commita978095699641d4f83a32b499a981c419c94abca (patch)
treeed553e21880bcc342fd4a516549e3fd69d2a6664 /tools/perf/scripts/python
parentb66fca408bf85bb40f48a689daac75421f5283f8 (diff)
bonding: fix slave_cnt leak on XDP enslave failure
bond_enslave() increments bond->slave_cnt before setting up XDP on the new slave. If that setup fails (slave has no XDP support, already has an XDP program, or dev_xdp_propagate() fails), the error path jumps to err_sysfs_del, which never decrements slave_cnt. Each failed enslave therefore leaves slave_cnt one too high: - SIOCBONDINFOQUERY reports a wrong num_slaves, - balance-rr picks slave ids beyond the end of the slave list, so bond_get_slave_by_id() falls back to the first usable slave and transmit is skewed toward it. Reproducer: ip link add bond0 type bond mode balance-rr ip link set bond0 xdpdrv obj xdp_dummy.bpf.o sec xdp for i in 0 1 2; do ip link add d$i type dummy ip link set d$i master bond0 # fails: Slave does not support XDP done num_slaves read via SIOCBONDINFOQUERY is 3 before this patch, 0 after. Add an err_dec_slave_cnt label ahead of err_sysfs_del and use it from the three XDP failure paths, which are the only failures after the increment. Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver") Signed-off-by: Eric Dumazet <edumazet@kernel.org> Link: https://patch.msgid.link/20261104092851.688361-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions