From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, dsahern@gmail.com
Subject: Re: [RFC net-next 1/8] pkt_cls: make tc_can_offload_extack() check chain index
Date: Wed, 24 Jan 2018 09:28:44 +0100 [thread overview]
Message-ID: <20180124082844.GA2234@nanopsycho> (raw)
In-Reply-To: <20180123213340.19235-2-jakub.kicinski@netronome.com>
Tue, Jan 23, 2018 at 10:33:33PM CET, jakub.kicinski@netronome.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@netronome.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
>
next prev parent reply other threads:[~2018-01-24 8:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 21:33 [RFC net-next 0/8] use tc_can_offload_extack() throughout the drivers Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 1/8] pkt_cls: make tc_can_offload_extack() check chain index Jakub Kicinski
2018-01-24 8:28 ` Jiri Pirko [this message]
2018-01-24 8:53 ` Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 2/8] bnxt: use tc_can_offload_cls() Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 3/8] nfp: flower: " Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 4/8] cxgb4: " Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 5/8] ixgbe: " Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 6/8] mlx5: " Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 7/8] mlxsw: " Jakub Kicinski
2018-01-23 21:33 ` [RFC net-next 8/8] cls_bpf: drivers: don't try to use extack before callback type is validated Jakub Kicinski
2018-01-24 10:25 ` [RFC net-next 0/8] use tc_can_offload_extack() throughout the drivers Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180124082844.GA2234@nanopsycho \
--to=jiri@resnulli.us \
--cc=dsahern@gmail.com \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).