Commit 3a97e2ae authored by Jussi Maki's avatar Jussi Maki Committed by Zhengchao Shao
Browse files

net: bonding: Use per-cpu rr_tx_counter

mainline inclusion
from mainline-v5.14-rc1
commit 848ca918
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NDRB
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=848ca9182a7d25bb54955c3aab9a3a2742bf9678



----------------------------------------

The round-robin rr_tx_counter was shared across CPUs leading to
significant cache thrashing at high packet rates. This patch switches
the round-robin packet counter to use a per-cpu variable to decide
the destination slave.

On a test with 2x100Gbit ICE nic with pktgen_sample_04_many_flows.sh
(-s 64 -t 32) the tx rate was 19.6Mpps before and 22.3Mpps after
this patch.

"perf top -e cache_misses" before:
    12.31%  [bonding]       [k] bond_xmit_roundrobin_slave_get
    10.59%  [sch_fq_codel]  [k] fq_codel_dequeue
     9.34%  [kernel]        [k] skb_release_data
after:
    15.42%  [sch_fq_codel]  [k] fq_codel_dequeue
    10.06%  [kernel]        [k] __memset
     9.12%  [kernel]        [k] skb_release_data

Signed-off-by: default avatarJussi Maki <joamaki@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Conflicts:
	drivers/net/bonding/bond_main.c

Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 323ca2c2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment