lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 24 Jan 2018 09:28:44 +0100 From: Jiri Pirko <jiri@...nulli.us> To: Jakub Kicinski <jakub.kicinski@...ronome.com> Cc: netdev@...r.kernel.org, oss-drivers@...ronome.com, dsahern@...il.com Subject: Re: [RFC net-next 1/8] pkt_cls: make tc_can_offload_extack() check chain index Tue, Jan 23, 2018 at 10:33:33PM CET, jakub.kicinski@...ronome.com wrote: >No upstream drivers seem to allow offload of chains other than 0. mlxsw does. And I know that Intel was talking about adding the support to i40e iirc. >Save driver developers typing and make tc_can_offload_extack() >check for that condition as well. Rename the function to >tc_can_offload_cls() to better represent its application. > >Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com> >--- [...] >--- a/include/net/pkt_cls.h >+++ b/include/net/pkt_cls.h >@@ -645,15 +645,21 @@ 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) >+static inline bool tc_can_offload_cls(const struct net_device *dev, >+ struct tc_cls_common_offload *common) > { >- bool can = tc_can_offload(dev); >- >- if (!can) >- NL_SET_ERR_MSG(extack, "TC offload is disabled on net device"); >+ if (common->chain_index) { This check here is wrong. It is up to the driver if it supports multichain offload or not, should not be checked in a generic code along with tc_can_offload. >+ NL_SET_ERR_MSG(common->extack, >+ "Driver supports only offload of chain 0"); >+ return false; >+ } >+ if (!tc_can_offload(dev)) { >+ NL_SET_ERR_MSG(common->extack, >+ "TC offload is disabled on net device"); >+ return false; >+ } > >- return can; >+ return true; > } > > static inline bool tc_skip_hw(u32 flags) >-- >2.15.1 >
Powered by blists - more mailing lists