net: sched: cls_basic: no need to call tcf_exts_change for newly allocated struct
As the f struct was allocated right before basic_set_parms call, no need to use tcf_exts_change to do atomic change, and we can just fill-up the unused exts struct directly by tcf_exts_validate. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a74cb36980
commit
ff1f8ca080
|
@ -129,31 +129,22 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
|
||||||
struct nlattr *est, bool ovr)
|
struct nlattr *est, bool ovr)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct tcf_exts e;
|
|
||||||
|
|
||||||
err = tcf_exts_init(&e, TCA_BASIC_ACT, TCA_BASIC_POLICE);
|
err = tcf_exts_validate(net, tp, tb, est, &f->exts, ovr);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
err = tcf_exts_validate(net, tp, tb, est, &e, ovr);
|
|
||||||
if (err < 0)
|
|
||||||
goto errout;
|
|
||||||
|
|
||||||
err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES], &f->ematches);
|
err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES], &f->ematches);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto errout;
|
return err;
|
||||||
|
|
||||||
if (tb[TCA_BASIC_CLASSID]) {
|
if (tb[TCA_BASIC_CLASSID]) {
|
||||||
f->res.classid = nla_get_u32(tb[TCA_BASIC_CLASSID]);
|
f->res.classid = nla_get_u32(tb[TCA_BASIC_CLASSID]);
|
||||||
tcf_bind_filter(tp, &f->res, base);
|
tcf_bind_filter(tp, &f->res, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
tcf_exts_change(tp, &f->exts, &e);
|
|
||||||
f->tp = tp;
|
f->tp = tp;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
errout:
|
|
||||||
tcf_exts_destroy(&e);
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int basic_change(struct net *net, struct sk_buff *in_skb,
|
static int basic_change(struct net *net, struct sk_buff *in_skb,
|
||||||
|
|
Loading…
Reference in New Issue