• Pedro Tammela's avatar
    net/sched: act_nat: transition to percpu stats and rcu · 7d12057b
    Pedro Tammela authored
    The tc action act_nat was using shared stats and taking the per action
    lock in the datapath. Improve it by using percpu stats and rcu.
    
    perf before:
    - 10.48% tcf_nat_act
       - 81.83% _raw_spin_lock
            81.08% native_queued_spin_lock_slowpath
    
    perf after:
    - 0.48% tcf_nat_act
    
    tdc results:
    1..27
    ok 1 7565 - Add nat action on ingress with default control action
    ok 2 fd79 - Add nat action on ingress with pipe control action
    ok 3 eab9 - Add nat action on ingress with continue control action
    ok 4 c53a - Add nat action on ingress with reclassify control action
    ok 5 76c9 - Add nat action on ingress with jump control action
    ok 6 24c6 - Add nat action on ingress with drop control action
    ok 7 2120 - Add nat action on ingress with maximum index value
    ok 8 3e9d - Add nat action on ingress with invalid index value
    ok 9 f6c9 - Add nat action on ingress with invalid IP address
    ok 10 be25 - Add nat action on ingress with invalid argument
    ok 11 a7bd - Add nat action on ingress with DEFAULT IP address
    ok 12 ee1e - Add nat action on ingress with ANY IP address
    ok 13 1de8 - Add nat action on ingress with ALL IP address
    ok 14 8dba - Add nat action on egress with default control action
    ok 15 19a7 - Add nat action on egress with pipe control action
    ok 16 f1d9 - Add nat action on egress with continue control action
    ok 17 6d4a - Add nat action on egress with reclassify control action
    ok 18 b313 - Add nat action on egress with jump control action
    ok 19 d9fc - Add nat action on egress with drop control action
    ok 20 a895 - Add nat action on egress with DEFAULT IP address
    ok 21 2572 - Add nat action on egress with ANY IP address
    ok 22 37f3 - Add nat action on egress with ALL IP address
    ok 23 6054 - Add nat action on egress with cookie
    ok 24 79d6 - Add nat action on ingress with cookie
    ok 25 4b12 - Replace nat action with invalid goto chain control
    ok 26 b811 - Delete nat action with valid index
    ok 27 a521 - Delete nat action with invalid index
    Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
    Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    7d12057b
act_nat.c 7.89 KB