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>
This commit is contained in:

committed by
David S. Miller

parent
d2e42a1756
commit
6843e7a2ab
@@ -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
|
||||
|
Reference in New Issue
Block a user