Skip to content

Commit 24d3dc6

Browse files
ogerlitzdavem330
authored andcommitted
net/sched: cls_u32: Reflect HW offload status
U32 support for the "in hw" offloading flags. Signed-off-by: Or Gerlitz <[email protected]> Reviewed-by: Amir Vadai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7d2b2f commit 24d3dc6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

net/sched/cls_u32.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
523523

524524
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
525525
tp->protocol, &offload);
526+
527+
if (!err)
528+
n->flags |= TCA_CLS_FLAGS_IN_HW;
529+
526530
if (tc_skip_sw(flags))
527531
return err;
528532

@@ -895,6 +899,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
895899
return err;
896900
}
897901

902+
if (!tc_in_hw(new->flags))
903+
new->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
904+
898905
u32_replace_knode(tp, tp_c, new);
899906
tcf_unbind_filter(tp, &n->res);
900907
call_rcu(&n->rcu, u32_delete_key_rcu);
@@ -1014,6 +1021,9 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
10141021
if (err)
10151022
goto errhw;
10161023

1024+
if (!tc_in_hw(n->flags))
1025+
n->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
1026+
10171027
ins = &ht->ht[TC_U32_HASH(handle)];
10181028
for (pins = rtnl_dereference(*ins); pins;
10191029
ins = &pins->next, pins = rtnl_dereference(*ins))

0 commit comments

Comments
 (0)