Message ID | 1487148757-24809-6-git-send-email-ogerlitz@mellanox.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Or Gerlitz <ogerlitz@mellanox.com> Date: Wed, 15 Feb 2017 10:52:35 +0200 > @@ -194,6 +199,9 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, > } > } > > + if (!(tc_in_hw(new->flags))) > + new->flags |= TCA_CLS_FLAGS_NOT_IN_HW; Too many parenthesis, please make this: if (!tc_in_hw(new->flags)) new->flags |= TCA_CLS_FLAGS_NOT_IN_HW; Thanks.
On Wed, Feb 15, 2017 at 8:15 PM, David Miller <davem@davemloft.net> wrote: > From: Or Gerlitz <ogerlitz@mellanox.com> > Date: Wed, 15 Feb 2017 10:52:35 +0200 > >> @@ -194,6 +199,9 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, >> } >> } >> >> + if (!(tc_in_hw(new->flags))) >> + new->flags |= TCA_CLS_FLAGS_NOT_IN_HW; > > Too many parenthesis, please make this: > > if (!tc_in_hw(new->flags)) > new->flags |= TCA_CLS_FLAGS_NOT_IN_HW; OKay, Dave, I will fix that along with the other places
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 35ef1c1..14de5b7 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -56,6 +56,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp, struct net_device *dev = tp->q->dev_queue->dev; struct tc_to_netdev offload; struct tc_cls_matchall_offload mall_offload = {0}; + int err; offload.type = TC_SETUP_MATCHALL; offload.cls_mall = &mall_offload; @@ -63,8 +64,12 @@ static int mall_replace_hw_filter(struct tcf_proto *tp, offload.cls_mall->exts = &head->exts; offload.cls_mall->cookie = cookie; - return dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, - &offload); + err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, + &offload); + if (!err) + head->flags |= TCA_CLS_FLAGS_IN_HW; + + return err; } static void mall_destroy_hw_filter(struct tcf_proto *tp, @@ -194,6 +199,9 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, } } + if (!(tc_in_hw(new->flags))) + new->flags |= TCA_CLS_FLAGS_NOT_IN_HW; + *arg = (unsigned long) head; rcu_assign_pointer(tp->root, new); if (head)