Message ID | 20180116003027.9405-8-jakub.kicinski@netronome.com |
---|---|
State | Changes Requested, archived |
Delegated to: | BPF Maintainers |
Headers | show |
Series | net: sched: add extack support for cls offload | expand |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index c88c61234cb3..a3ad6a5a2d12 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -644,6 +644,17 @@ static inline bool tc_can_offload(const struct net_device *dev) return dev->features & NETIF_F_HW_TC; } +static inline bool tc_can_offload_extack(const struct net_device *dev, + struct netlink_ext_ack *extack) +{ + bool can = tc_can_offload(dev); + + if (!can) + NL_SET_ERR_MSG(extack, "TC offload is disabled on net device"); + + return can; +} + static inline bool tc_skip_hw(u32 flags) { return (flags & TCA_CLS_FLAGS_SKIP_HW) ? true : false;