summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-05-31 18:06:43 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-01 00:58:13 +0300
commitd897a638e98c476c56118d0dcc1bc55450504866 (patch)
treee902b10f4f6f2f9335d3e1ec039f97b42f4ecde0 /drivers/net/ethernet/netronome/nfp
parentc380e377a50e944a2b9a892133b5a37b3ec90fe3 (diff)
downloadlinux-d897a638e98c476c56118d0dcc1bc55450504866.tar.xz
sched: add helper for updating statistics on all actions
Forgetting to disable preemption around tcf_action_stats_update() seems to be a common mistake. Add a helper function for updating stats on all actions of a filter. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_offload.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c b/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
index cc823df12c8a..2fa7b67d0c6f 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
@@ -84,8 +84,6 @@ static void nfp_net_bpf_stats_reset(struct nfp_net *nn)
static int
nfp_net_bpf_stats_update(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf)
{
- struct tc_action *a;
- LIST_HEAD(actions);
u64 bytes, pkts;
pkts = nn->rx_filter.pkts - nn->rx_filter_prev.pkts;
@@ -94,13 +92,8 @@ nfp_net_bpf_stats_update(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf)
nn->rx_filter_prev = nn->rx_filter;
- preempt_disable();
-
- tcf_exts_to_list(cls_bpf->exts, &actions);
- list_for_each_entry(a, &actions, list)
- tcf_action_stats_update(a, bytes, pkts, nn->rx_filter_change);
-
- preempt_enable();
+ tcf_exts_stats_update(cls_bpf->exts,
+ bytes, pkts, nn->rx_filter_change);
return 0;
}