net/sched: cls_flower: Reflect HW offload status
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 16 Feb 2017 08:31:13 +0000 (10:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 17:08:05 +0000 (12:08 -0500)
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>
net/sched/cls_flower.c

index 850d98294bf60c104a0c2d2a219ae31e7d566a0e..9d0c99d2e9fbcc35aee5a51274cf9fe7f542a14f 100644 (file)
@@ -273,6 +273,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;
@@ -912,6 +914,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,