netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: David Miller <davem@davemloft.net>,
	David Ahern <dsahern@gmail.com>,
	aring@mojatatu.com, Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Linux Netdev List <netdev@vger.kernel.org>,
	oss-drivers@netronome.com,
	Quentin Monnet <quentin.monnet@netronome.com>
Subject: Re: [PATCH net-next v4 6/8] net: sched: create tc_can_offload_extack() wrapper
Date: Sat, 20 Jan 2018 11:22:36 +0100	[thread overview]
Message-ID: <20180120102236.GF2147@nanopsycho.orion> (raw)
In-Reply-To: <CAJpBn1yWf8B745JmbQ5PC=dRk=xdP0A-xg7rOr10AA4Tp83fSg@mail.gmail.com>

Sat, Jan 20, 2018 at 11:12:25AM CET, jakub.kicinski@netronome.com wrote:
>On Sat, Jan 20, 2018 at 12:59 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Sat, Jan 20, 2018 at 02:44:48AM CET, jakub.kicinski@netronome.com wrote:
>>>From: Quentin Monnet <quentin.monnet@netronome.com>
>>>
>>>Create a wrapper around tc_can_offload() that takes an additional
>>>extack pointer argument in order to output an error message if TC
>>>offload is disabled on the device.
>>>
>>>In this way, the error message is handled by the core and can be the
>>>same for all drivers.
>>>
>>>Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
>>>Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>>>---
>>> include/net/pkt_cls.h | 11 +++++++++++
>>> 1 file changed, 11 insertions(+)
>>>
>>>diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
>>>index f497f622580b..2f8f16a4d88e 100644
>>>--- a/include/net/pkt_cls.h
>>>+++ b/include/net/pkt_cls.h
>>>@@ -656,6 +656,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)
>>
>> I don't like to add tc_can_offload variant for this. It makes sense
>> the original tc_can_offload to be extended and set the extack message
>> always.
>>
>> It would require some more work in drivers (5), sure, but we endup with
>> nicer and consistent code.
>
>$ git grep tc_can_offload
>drivers/net/ethernet/broadcom/bnxt/bnxt.c:      if
>(!bnxt_tc_flower_enabled(bp) || !tc_can_offload(bp->dev))
>drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:  if
>(!bnxt_tc_flower_enabled(vf_rep->bp) || !tc_can_offload(bp->dev))
>drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:        if
>(!tc_can_offload(dev))
>drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:  if
>(!tc_can_offload(adapter->netdev))
>drivers/net/ethernet/mellanox/mlx5/core/en_main.c:      if
>(!tc_can_offload(priv->netdev))
>drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:       if
>(!tc_can_offload(priv->netdev))
>drivers/net/ethernet/mellanox/mlxsw/spectrum.c:         if
>(!tc_can_offload(mlxsw_sp_port->dev))
>drivers/net/ethernet/netronome/nfp/bpf/main.c:
>!tc_can_offload(nn->dp.netdev) ||
>drivers/net/ethernet/netronome/nfp/flower/offload.c:    if
>(!tc_can_offload(repr->netdev))
>drivers/net/ethernet/netronome/nfp/flower/offload.c:    if
>(!tc_can_offload(repr->netdev))
>drivers/net/netdevsim/bpf.c:        !tc_can_offload(ns->netdev) ||
>include/net/pkt_cls.h:static inline bool tc_can_offload(const struct
>net_device *dev)
>net/dsa/slave.c:        if (!tc_can_offload(dev))
>net/sched/cls_api.c:    if (!tc_can_offload(dev) &&
>tcf_block_offload_in_use(block))
>net/sched/sch_mq.c:     if (!tc_can_offload(dev) ||
>!dev->netdev_ops->ndo_setup_tc)
>net/sched/sch_prio.c:   if (!tc_can_offload(dev) ||
>!dev->netdev_ops->ndo_setup_tc)
>net/sched/sch_prio.c:   if (!tc_can_offload(dev) ||
>!dev->netdev_ops->ndo_setup_tc)
>net/sched/sch_red.c:    if (!tc_can_offload(dev) ||
>!dev->netdev_ops->ndo_setup_tc)
>net/sched/sch_red.c:    if (!tc_can_offload(dev) ||
>!dev->netdev_ops->ndo_setup_tc)
>
>Do you mean the qdisc offloads too?  The whole lot?

Yes.

  reply	other threads:[~2018-01-20 10:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20  1:44 [PATCH net-next v4 0/8] net: sched: add extack support for cls offloads Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 1/8] net: sched: cls_flower: propagate extack support for filter offload Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 2/8] net: sched: cls_matchall: " Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 3/8] net: sched: cls_u32: " Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 4/8] net: sched: cls_bpf: plumb extack support in filter for hardware offload Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 5/8] net: sched: add extack support for offload via tc_cls_common_offload Jakub Kicinski
2018-01-20  8:54   ` Jiri Pirko
2018-01-20 10:28     ` Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 6/8] net: sched: create tc_can_offload_extack() wrapper Jakub Kicinski
2018-01-20  8:59   ` Jiri Pirko
2018-01-20 10:12     ` Jakub Kicinski
2018-01-20 10:22       ` Jiri Pirko [this message]
2018-01-20 10:33         ` Jakub Kicinski
2018-01-20 10:54           ` Jiri Pirko
2018-01-20 11:12             ` Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 7/8] nfp: bpf: plumb extack into functions related to XDP offload Jakub Kicinski
2018-01-20  1:44 ` [PATCH net-next v4 8/8] nfp: bpf: use extack support to improve debugging Jakub Kicinski
2018-01-22 21:32 ` [PATCH net-next v4 0/8] net: sched: add extack support for cls offloads David Miller

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=20180120102236.GF2147@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=alexei.starovoitov@gmail.com \
    --cc=aring@mojatatu.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=quentin.monnet@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).