mbox series

[net-next,0/3] net/sched: transition actions to pcpu stats and rcu

Message ID 20230210202725.446422-1-pctammela@mojatatu.com (mailing list archive)
Headers show
Series net/sched: transition actions to pcpu stats and rcu | expand

Message

Pedro Tammela Feb. 10, 2023, 8:27 p.m. UTC
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.

Actions act_gate and act_ctinfo are changed to use the percpu stats.
act_ctinfo already relied on rcu on the datapath but it was updating the stats wrongly,
act_gate datapath has interactions with hrtimers which might require to take the per
action lock (not sure yet, so we only convert to percpu stats).

[0] https://lore.kernel.org/all/20230131145149.3776656-1-pctammela@mojatatu.com/

Pedro Tammela (3):
  net/sched: act_nat: transition to percpu stats and rcu
  net/sched: act_connmark: transition to percpu stats and rcu
  net/sched: act_gate: use percpu stats

 include/net/tc_act/tc_connmark.h |   9 ++-
 include/net/tc_act/tc_nat.h      |  10 ++-
 net/sched/act_connmark.c         | 109 ++++++++++++++++++++-----------
 net/sched/act_gate.c             |  10 +--
 net/sched/act_nat.c              |  68 +++++++++++++------
 5 files changed, 137 insertions(+), 69 deletions(-)