summaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorJiri Pirko2017-08-04 14:29:15 +0200
committerDavid S. Miller2017-08-04 20:21:24 +0200
commit9b0d4446b56904b59ae3809913b0ac760fa941a6 (patch)
tree1b6d353ef75496604e247b0ceec74e63cb228708 /net/sched/cls_api.c
parentnet: sched: cls_u32: no need to call tcf_exts_change for newly allocated struct (diff)
downloadkernel-qcow2-linux-9b0d4446b56904b59ae3809913b0ac760fa941a6.tar.gz
kernel-qcow2-linux-9b0d4446b56904b59ae3809913b0ac760fa941a6.tar.xz
kernel-qcow2-linux-9b0d4446b56904b59ae3809913b0ac760fa941a6.zip
net: sched: avoid atomic swap in tcf_exts_change
tcf_exts_change is always called on newly created exts, which are not used on fastpath. Therefore, simple struct copy is enough. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 735d556a5283..e655221c654e 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -883,18 +883,12 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
}
EXPORT_SYMBOL(tcf_exts_validate);
-void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
- struct tcf_exts *src)
+void tcf_exts_change(struct tcf_exts *dst, struct tcf_exts *src)
{
#ifdef CONFIG_NET_CLS_ACT
struct tcf_exts old = *dst;
- tcf_tree_lock(tp);
- dst->nr_actions = src->nr_actions;
- dst->actions = src->actions;
- dst->type = src->type;
- tcf_tree_unlock(tp);
-
+ *dst = *src;
tcf_exts_destroy(&old);
#endif
}