mbox series

[net-next,v4,0/2] net/sched: transition act_pedit to rcu and percpu stats

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

Message

Pedro Tammela Jan. 30, 2023, 4:02 p.m. UTC
The software pedit action didn't get the same love as some of the
other actions and it's still using spinlocks and shared stats.
Therefore, transition the action to rcu and percpu stats which
improves the action's performance.

We test this change with a very simple packet forwarding setup:

tc filter add dev ens2f0 ingress protocol ip matchall \
   action pedit ex munge eth src set b8:ce:f6:4b:68:35 pipe \
   action pedit ex munge eth dst set ac:1f:6b:e4:ff:93 pipe \
   action mirred egress redirect dev ens2f1
tc filter add dev ens2f1 ingress protocol ip matchall \
   action pedit ex munge eth src set b8:ce:f6:4b:68:34 pipe \
   action pedit ex munge eth dst set ac:1f:6b:e4:ff:92 pipe \
   action mirred egress redirect dev ens2f0

Using TRex with a http-like profile, in our setup with a 25G NIC
and a 26 cores Intel CPU, we observe the following in perf:
   before:
    11.59%  2.30%  [kernel]  [k] tcf_pedit_act
       2.55% tcf_pedit_act
             8.38% _raw_spin_lock
                       6.43% native_queued_spin_lock_slowpath
   after:
    1.46%  1.46%  [kernel]  [k] tcf_pedit_act

v3->v4:
- Address Simon's comments

v2->v3:
- Add missing change in act idr create

v1->v2:
- Fix lock unbalance found by sparse

Pedro Tammela (2):
  net/sched: transition act_pedit to rcu and percpu stats
  net/sched: simplify tcf_pedit_act

 include/net/tc_act/tc_pedit.h |  81 ++++++++--
 net/sched/act_pedit.c         | 273 +++++++++++++++++++---------------
 2 files changed, 217 insertions(+), 137 deletions(-)