aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2017-02-12 04:21:31 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-26 05:10:50 -0500
commit859900c24bff90768e1789bd93e1b51fa726a659 (patch)
tree1ecf922a8a9447d6d33289b784d2cadf06978c37 /drivers/net
parent90aa7993d5c7fdc476009189a9b2a65d97fe9350 (diff)
net/mlx5e: Disable preemption when doing TC statistics upcall
[ Upstream commit fed06ee89b78d3af32e235e0e89ad0d946fcb95d ] When called by HW offloading drivers, the TC action (e.g net/sched/act_mirred.c) code uses this_cpu logic, e.g _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets) per the kernel documention, preemption should be disabled, add that. Before the fix, when running with CONFIG_PREEMPT set, we get a BUG: using smp_processor_id() in preemptible [00000000] code: tc/3793 asserion from the TC action (mirred) stats_update callback. Fixes: aad7e08d39bd ('net/mlx5e: Hardware offloaded flower filter statistics support') Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 6bb21b31cfeb..a543ea676de3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -567,10 +567,14 @@ int mlx5e_stats_flower(struct mlx5e_priv *priv,
567 567
568 mlx5_fc_query_cached(counter, &bytes, &packets, &lastuse); 568 mlx5_fc_query_cached(counter, &bytes, &packets, &lastuse);
569 569
570 preempt_disable();
571
570 tcf_exts_to_list(f->exts, &actions); 572 tcf_exts_to_list(f->exts, &actions);
571 list_for_each_entry(a, &actions, list) 573 list_for_each_entry(a, &actions, list)
572 tcf_action_stats_update(a, bytes, packets, lastuse); 574 tcf_action_stats_update(a, bytes, packets, lastuse);
573 575
576 preempt_enable();
577
574 return 0; 578 return 0;
575} 579}
576 580