summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2017-02-16 10:31:14 +0200
committerDavid S. Miller <davem@davemloft.net>2017-02-17 12:08:06 -0500
commitc7d2b2f5eebe6e76efc11cfd7a600c0748234f3a (patch)
tree8f6da703338925a2d91a906c98cc2163995d02aa /net/sched
parent55593960d0d88c6d80b7b3a615dbe09de85f2541 (diff)
net/sched: cls_matchall: Reflect HW offloading status
Matchall support for the "in hw" offloading flags. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Amir Vadai <amir@vadai.me> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_matchall.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 35ef1c1be1f3..224eb2c14346 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)