From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davide Caratti Subject: [PATCH net-next 0/2] net/sched: act_police: lockless data path Date: Thu, 13 Sep 2018 19:29:11 +0200 Message-ID: Cc: netdev@vger.kernel.org To: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56552 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbeIMWjs (ORCPT ); Thu, 13 Sep 2018 18:39:48 -0400 Sender: netdev-owner@vger.kernel.org List-ID: the data path of 'police' action can be faster if we avoid using spinlocks: - patch 1 converts act_police to use per-cpu counters - patch 2 lets act_police use RCU to access its configuration data. test procedure (using pktgen from https://github.com/netoptimizer): # ip link add name eth1 type dummy # ip link set dev eth1 up # tc qdisc add dev eth1 clsact # tc filter add dev eth1 egress matchall action police \ > rate 2gbit burst 100k conform-exceed pass/pass index 100 # for c in 1 2 4; do > ./pktgen_bench_xmit_mode_queue_xmit.sh -v -s 64 -t $c -n 5000000 -i eth1 > done test results (avg. pps/thread): $c | before patch | after patch | improvement ----+--------------+--------------+------------- 1 | 3518448 | 3591240 | irrelevant 2 | 3070065 | 3383393 | 10% 4 | 1540969 | 3238385 | 110% Davide Caratti (2): net/sched: act_police: use per-cpu counters net/sched: act_police: don't use spinlock in the data path net/sched/act_police.c | 186 +++++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 80 deletions(-) -- 2.17.1