netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: jiri@resnulli.us, gerlitz.or@gmail.com,
	sridhar.samudrala@intel.com, oss-drivers@netronome.com,
	john.hurley@netronome.com,
	Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [RFC net-next 0/4] net: sched: support replay of filter offload when binding to block
Date: Thu, 24 May 2018 19:25:35 -0700	[thread overview]
Message-ID: <20180525022539.6799-1-jakub.kicinski@netronome.com> (raw)

Hi!

This series from John adds the ability to replay filter offload requests
when new offload callback is being registered on a TC block.  This is most
likely to take place for shared blocks today, when a block which already
has rules is bound to another interface.  Prior to this patch set if any
of the rules were offloaded the block bind would fail.

A new tcf_proto_op is added to generate a filter-specific offload request.
The new 'offload' op is supporting extack from day 0, hence we need to
propagate extack to .ndo_setup_tc TC_BLOCK_BIND/TC_BLOCK_UNBIND and
through tcf_block_cb_register() to tcf_block_playback_offloads().

The immediate use of this patch set is to simplify life of drivers which
require duplicating rules when sharing blocks.  Switch drivers (mlxsw)
can bind ports to rule lists dynamically, NIC drivers generally don't
have that ability and need the rules to be duplicated for each ingress
they match on.  In code terms this means that switch drivers don't
register multiple callbacks for each port.  NIC drivers do, and get a
separate request and hance rule per-port, as if the block was not shared.
The registration would fail, however, if some rules were already present.

As John notes in description of patch 2, drivers which register multiple
callbacks to shared blocks will likely need to flush the rules on block
unbind.  This set makes the core not only replay the the offload add
requests but also offload remove requests when callback is unregistered.


John Hurley (4):
  net: sched: pass extack pointer to block binds and cb registration
  net: sched: add tcf_proto_op to offload a rule
  net: sched: cls_flower: implement offload tcf_proto_op
  net: sched: cls_matchall: implement offload tcf_proto_op

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c |  2 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  2 +-
 .../net/ethernet/intel/i40evf/i40evf_main.c   |  2 +-
 drivers/net/ethernet/intel/igb/igb_main.c     |  2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en_main.c |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en_rep.c  |  2 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 14 ++--
 drivers/net/ethernet/netronome/nfp/bpf/main.c |  2 +-
 .../ethernet/netronome/nfp/flower/offload.c   |  2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  2 +-
 drivers/net/netdevsim/netdev.c                |  2 +-
 include/net/act_api.h                         |  3 -
 include/net/pkt_cls.h                         | 12 ++-
 include/net/sch_generic.h                     |  6 ++
 net/dsa/slave.c                               |  2 +-
 net/sched/cls_api.c                           | 74 ++++++++++++++-----
 net/sched/cls_flower.c                        | 51 +++++++++++++
 net/sched/cls_matchall.c                      | 40 ++++++++++
 21 files changed, 184 insertions(+), 44 deletions(-)

-- 
2.17.0

             reply	other threads:[~2018-05-25  2:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25  2:25 Jakub Kicinski [this message]
2018-05-25  2:25 ` [RFC net-next 1/4] net: sched: pass extack pointer to block binds and cb registration Jakub Kicinski
2018-05-25  2:25 ` [RFC net-next 2/4] net: sched: add tcf_proto_op to offload a rule Jakub Kicinski
2018-05-25  2:25 ` [RFC net-next 3/4] net: sched: cls_flower: implement offload tcf_proto_op Jakub Kicinski
2018-05-25  2:25 ` [RFC net-next 4/4] net: sched: cls_matchall: " Jakub Kicinski
2018-05-28 10:48 ` [RFC net-next 0/4] net: sched: support replay of filter offload when binding to block Or Gerlitz
2018-05-28 20:02   ` Jakub Kicinski
2018-05-30 15:59     ` Or Gerlitz

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=20180525022539.6799-1-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=gerlitz.or@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=john.hurley@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=sridhar.samudrala@intel.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).