All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, petrm@mellanox.com, idosch@mellanox.com,
	mlxsw@mellanox.com, xeb@mail.ru, dsa@cumulusnetworks.com
Subject: [patch net-next 00/15] mlxsw: Offloading encapsulated SPAN
Date: Tue, 27 Feb 2018 14:53:34 +0100	[thread overview]
Message-ID: <20180227135349.11637-1-jiri@resnulli.us> (raw)

From: Jiri Pirko <jiri@mellanox.com>

Petr says:

This patch series introduces support for mirroring with GRE
encapsulation. It offloads tc action mirred mirror from a mlxsw port to
either a gretap or an ip6gretap netdevice.

Spectrum hardware needs to know all the details of the requested
encapsulation: source and destination MAC and IP addresses, details of
VLAN tagging, etc. The only variables are the encapsulated packet
itself, and TOS field, which may be inherited. To that end, mlxsw driver
resolves the route that encapsulated packets would take, queries the
corresponding neighbor, and with that configuration in hand, configures
the mirroring in the hardware.

The driver also hooks into event handlers for netdevice changes, FIB and
neighbor events, and reconsiders the configuration on each such change.
When the new configuration differs from the currently-offloaded one, the
existing offload is removed and replaced with a new one.

It is possible to mirror to {ip6,}gretap from a matchall rule as well as
from a flower match.

** Note that with this patch set, mlxsw build depends on NET_IPGRE and
   IPV6_GRE.

Current limitations:

- There has to be a route that directs packets to an mlxsw port. We
  intend to extend the logic to support other netdevice types in the
  future, but the eventual egress netdevice will have to be an mlxsw
  port in any case.

- Offload reconfiguration due to changes in netdevice configuration
  creates a window of time where packets are not mirrored. Under some
  circumstances this can be prevented by configuring an unused port
  analyzer and migrating mirrors over to that. However that's currently
  not implemented.

- Remote address of a tunnel device needs to be set, there may not be a
  GRE key, checksumming or sequence numbers, and TTL needs to be fixed
  (non-inherit). These are hard requirements imposed by the underlying
  hardware.

- TOS of a tunnel device needs to be "inherit". The hardware supports a
  fixed TOS, but that's currently not implemented.

The series start with two patches, #1 and #2, that publish one function
and add support for querying IPv6 tunnel parameters.

In patches #3 and #4, we introduce helpers to GRE and tunneling code
that we will use later in the patchset from the SPAN code.

Patches #5 and #6 introduce support for encapsulated SPAN in reg.h.

The following seven patches, #7-#13, then prepare the SPAN codebase for
introduction of mirroring to netdevices that don't correspond to front
panel ports.

Then #14 and #15 pull all this together to implement mirroring to
{ip6,}gretap netdevices.

Petr Machata (15):
  mlxsw: spectrum_ipip: Extract mlxsw_sp_l3addr_is_zero
  mlxsw: spectrum_ipip: Support decoding IPv6 tunnel addresses
  net: GRE: Add is_gretap_dev, is_ip6gretap_dev
  ip_tunnel: Rename & publish init_tunnel_flow
  mlxsw: reg: Add SPAN encapsulation to MPAT register
  mlxsw: reg: Extend mlxsw_reg_mpat_pack()
  mlxsw: span: Remove span_entry by span_id
  mlxsw: spectrum_span: Initialize span_entry.id eagerly
  mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de,}configure()
  mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entry
  mlxsw: spectrum_span: Generalize SPAN support
  mlxsw: Handle config changes pertinent to SPAN
  mlxsw: Move a mirroring check to mlxsw_sp_span_entry_create
  mlxsw: spectrum_span: Support mirror to gretap
  mlxsw: spectrum_span: Support mirror to ip6gretap

 drivers/net/ethernet/mellanox/mlxsw/Kconfig        |   4 +
 .../mellanox/mlxsw/core_acl_flex_actions.c         |  19 +-
 .../mellanox/mlxsw/core_acl_flex_actions.h         |   9 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h          | 145 +++++-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  50 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h     |   2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c |   9 +-
 .../mellanox/mlxsw/spectrum_acl_flex_actions.c     |  33 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c    |  45 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.h    |   8 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |   7 +
 .../net/ethernet/mellanox/mlxsw/spectrum_span.c    | 522 +++++++++++++++++++--
 .../net/ethernet/mellanox/mlxsw/spectrum_span.h    |  41 +-
 include/net/gre.h                                  |   3 +
 include/net/ip_tunnels.h                           |  16 +
 net/ipv4/ip_gre.c                                  |   6 +
 net/ipv4/ip_tunnel.c                               |  40 +-
 net/ipv6/ip6_gre.c                                 |   6 +
 18 files changed, 808 insertions(+), 157 deletions(-)

-- 
2.14.3

             reply	other threads:[~2018-02-27 13:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 13:53 Jiri Pirko [this message]
2018-02-27 13:53 ` [patch net-next 01/15] mlxsw: spectrum_ipip: Extract mlxsw_sp_l3addr_is_zero Jiri Pirko
2018-02-27 13:53 ` [patch net-next 02/15] mlxsw: spectrum_ipip: Support decoding IPv6 tunnel addresses Jiri Pirko
2018-02-27 13:53 ` [patch net-next 03/15] net: GRE: Add is_gretap_dev, is_ip6gretap_dev Jiri Pirko
2018-02-27 13:53 ` [patch net-next 04/15] ip_tunnel: Rename & publish init_tunnel_flow Jiri Pirko
2018-02-27 13:53 ` [patch net-next 05/15] mlxsw: reg: Add SPAN encapsulation to MPAT register Jiri Pirko
2018-02-27 13:53 ` [patch net-next 06/15] mlxsw: reg: Extend mlxsw_reg_mpat_pack() Jiri Pirko
2018-02-27 13:53 ` [patch net-next 07/15] mlxsw: span: Remove span_entry by span_id Jiri Pirko
2018-02-27 13:53 ` [patch net-next 08/15] mlxsw: spectrum_span: Initialize span_entry.id eagerly Jiri Pirko
2018-02-27 13:53 ` [patch net-next 09/15] mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de,}configure() Jiri Pirko
2018-02-27 13:53 ` [patch net-next 10/15] mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entry Jiri Pirko
2018-02-27 13:53 ` [patch net-next 11/15] mlxsw: spectrum_span: Generalize SPAN support Jiri Pirko
2018-02-27 13:53 ` [patch net-next 12/15] mlxsw: Handle config changes pertinent to SPAN Jiri Pirko
2018-02-27 13:53 ` [patch net-next 13/15] mlxsw: Move a mirroring check to mlxsw_sp_span_entry_create Jiri Pirko
2018-02-27 13:53 ` [patch net-next 14/15] mlxsw: spectrum_span: Support mirror to gretap Jiri Pirko
2018-02-27 13:53 ` [patch net-next 15/15] mlxsw: spectrum_span: Support mirror to ip6gretap Jiri Pirko
2018-02-27 20:17   ` David Ahern
2018-02-27 21:08     ` Petr Machata
2018-02-28 14:35     ` Petr Machata
2018-02-27 19:52 ` [patch net-next 00/15] mlxsw: Offloading encapsulated SPAN 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=20180227135349.11637-1-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=xeb@mail.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.