[15/18] net/sched: cls_flower: Reflect HW offload status

Submitted by Talat Batheesh on Feb. 26, 2017, 9:10 a.m.

Details

Message ID 1488100203-31976-15-git-send-email-talatb@mellanox.com
State New
Headers show

Commit Message

Talat Batheesh Feb. 26, 2017, 9:10 a.m.
From: Or Gerlitz <ogerlitz@mellanox.com>

BugLink: https://bugs.launchpad.net/ubuntu/1668019

Flower 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>
(cherry picked from commit 55593960d0d88c6d80b7b3a615dbe09de85f2541)
Signed-off-by: Talat Batheesh <talatb@mellanox.com>
---
 net/sched/cls_flower.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index df4293e..c5de304 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -270,6 +270,8 @@  static int fl_hw_replace_filter(struct tcf_proto *tp,
 
 	err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol,
 					    tc);
+	if (!err)
+		f->flags |= TCA_CLS_FLAGS_IN_HW;
 
 	if (tc_skip_sw(f->flags))
 		return err;
@@ -871,6 +873,9 @@  static int fl_change(struct net *net, struct sk_buff *in_skb,
 			goto errout;
 	}
 
+	if (!tc_in_hw(fnew->flags))
+		fnew->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
+
 	if (fold) {
 		if (!tc_skip_sw(fold->flags))
 			rhashtable_remove_fast(&head->ht, &fold->ht_node,