Commit 24d3dc6d authored by Or Gerlitz's avatar Or Gerlitz Committed by David S. Miller

net/sched: cls_u32: Reflect HW offload status

U32 support for the "in hw" offloading flags.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarAmir Vadai <amir@vadai.me>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7d2b2f5
...@@ -523,6 +523,10 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n, ...@@ -523,6 +523,10 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
tp->protocol, &offload); tp->protocol, &offload);
if (!err)
n->flags |= TCA_CLS_FLAGS_IN_HW;
if (tc_skip_sw(flags)) if (tc_skip_sw(flags))
return err; return err;
...@@ -895,6 +899,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -895,6 +899,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
return err; return err;
} }
if (!tc_in_hw(new->flags))
new->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
u32_replace_knode(tp, tp_c, new); u32_replace_knode(tp, tp_c, new);
tcf_unbind_filter(tp, &n->res); tcf_unbind_filter(tp, &n->res);
call_rcu(&n->rcu, u32_delete_key_rcu); call_rcu(&n->rcu, u32_delete_key_rcu);
...@@ -1014,6 +1021,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -1014,6 +1021,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
if (err) if (err)
goto errhw; goto errhw;
if (!tc_in_hw(n->flags))
n->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
ins = &ht->ht[TC_U32_HASH(handle)]; ins = &ht->ht[TC_U32_HASH(handle)];
for (pins = rtnl_dereference(*ins); pins; for (pins = rtnl_dereference(*ins); pins;
ins = &pins->next, pins = rtnl_dereference(*ins)) ins = &pins->next, pins = rtnl_dereference(*ins))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment