diff options
| author | Paolo Abeni <pabeni@redhat.com> | 2023-02-16 12:39:30 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2023-02-16 12:39:30 +0300 |
| commit | e9ab2559e2c501593c58a02a956a6005a2a749fb (patch) | |
| tree | 45bc5299e267357a6b3732102e4158227138b209 /include | |
| parent | 10d13421a6ae414ab91d4f2103fc90d1f4216736 (diff) | |
| parent | 2d2e75d2d4a2245175d77899764b56e19c5769b4 (diff) | |
| download | linux-e9ab2559e2c501593c58a02a956a6005a2a749fb.tar.xz | |
Merge branch 'net-sched-transition-actions-to-pcpu-stats-and-rcu'
Pedro Tammela says:
====================
net/sched: transition actions to pcpu stats and rcu
Following the work done for act_pedit[0], transition the remaining tc
actions to percpu stats and rcu, whenever possible.
Percpu stats make updating the action stats very cheap, while combining
it with rcu action parameters makes it possible to get rid of the per
action lock in the datapath.
For act_connmark and act_nat we run the following tests:
- tc filter add dev ens2f0 ingress matchall action connmark
- tc filter add dev ens2f0 ingress matchall action nat ingress any 10.10.10.10
Our setup consists of a 26 cores Intel CPU and a 25G NIC.
We use TRex to shoot 10mpps TCP packets and take perf measurements.
Both actions improved performance as expected since the datapath lock disappeared.
For act_pedit we move the drop counter to percpu, when available.
For act_gate we move the counters to percpu, when available.
[0] https://lore.kernel.org/all/20230131145149.3776656-1-pctammela@mojatatu.com/
====================
Link: https://lore.kernel.org/r/20230214211534.735718-1-pctammela@mojatatu.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/tc_act/tc_connmark.h | 9 | ||||
| -rw-r--r-- | include/net/tc_act/tc_nat.h | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/include/net/tc_act/tc_connmark.h b/include/net/tc_act/tc_connmark.h index 1f4cb477bb5d..e8dd77a96748 100644 --- a/include/net/tc_act/tc_connmark.h +++ b/include/net/tc_act/tc_connmark.h @@ -4,10 +4,15 @@ #include <net/act_api.h> -struct tcf_connmark_info { - struct tc_action common; +struct tcf_connmark_parms { struct net *net; u16 zone; + struct rcu_head rcu; +}; + +struct tcf_connmark_info { + struct tc_action common; + struct tcf_connmark_parms __rcu *parms; }; #define to_connmark(a) ((struct tcf_connmark_info *)a) diff --git a/include/net/tc_act/tc_nat.h b/include/net/tc_act/tc_nat.h index c14407160812..c869274ac529 100644 --- a/include/net/tc_act/tc_nat.h +++ b/include/net/tc_act/tc_nat.h @@ -5,13 +5,17 @@ #include <linux/types.h> #include <net/act_api.h> -struct tcf_nat { - struct tc_action common; - +struct tcf_nat_parms { __be32 old_addr; __be32 new_addr; __be32 mask; u32 flags; + struct rcu_head rcu; +}; + +struct tcf_nat { + struct tc_action common; + struct tcf_nat_parms __rcu *parms; }; #define to_tcf_nat(a) ((struct tcf_nat *)a) |
