summaryrefslogtreecommitdiffstats
path: root/include/net/pkt_cls.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2016-02-26 07:53:49 -0800
committerDavid S. Miller <davem@davemloft.net>2016-03-01 16:05:39 -0500
commit6843e7a2abe7cac10c19702ffec90018df6f040d (patch)
tree6ce0e74043e12f755c5bba0174d2f2c5e7cb5544 /include/net/pkt_cls.h
parentd2e42a1756501ce3466e538da742f9a67c233d47 (diff)
downloadlinux-6843e7a2abe7cac10c19702ffec90018df6f040d.tar.bz2
net: sched: consolidate offload decision in cls_u32
The offload decision was originally very basic and tied to if the dev implemented the appropriate ndo op hook. The next step is to allow the user to more flexibly define if any paticular rule should be offloaded or not. In order to have this logic in one function lift the current check into a helper routine tc_should_offload(). Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/pkt_cls.h')
-rw-r--r--include/net/pkt_cls.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2121df574262..e64d20b81047 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -392,4 +392,9 @@ struct tc_cls_u32_offload {
};
};
+static inline bool tc_should_offload(struct net_device *dev)
+{
+ return dev->netdev_ops->ndo_setup_tc;
+}
+
#endif