netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
	"Amit Cohen" <amcohen@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 00/10] mlxsw: Preparations for out-of-order-operations patches
Date: Mon, 12 Jun 2023 17:30:59 +0200	[thread overview]
Message-ID: <cover.1686581444.git.petrm@nvidia.com> (raw)

The mlxsw driver currently makes the assumption that the user applies
configuration in a bottom-up manner. Thus netdevices need to be added to
the bridge before IP addresses are configured on that bridge or SVI added
on top of it. Enslaving a netdevice to another netdevice that already has
uppers is in fact forbidden by mlxsw for this reason. Despite this safety,
it is rather easy to get into situations where the offloaded configuration
is just plain wrong.

As an example, take a front panel port, configure an IP address: it gets a
RIF. Now enslave the port to a bridge, and the RIF is gone. Remove the
port from the bridge again, but the RIF never comes back. There is a number
of similar situations, where changing the configuration there and back
utterly breaks the offload.

Over the course of the following several patchsets, mlxsw code is going to
be adjusted to diminish the space of wrongly offloaded configurations.
Ideally the offload state will reflect the actual state, regardless of the
sequence of operation used to construct that state.

No functional changes are intended in this patchset yet. Rather the patches
prepare the codebase for easier introduction of functional changes in later
patchsets.

- In patch #1, extract a helper to join a RIF of a given port, if there is
  one. In patch #2, use it in a newly-added helper to join a LAG interface.

- In patches #3, #4 and #5, add helpers that abstract away the rif->dev
  access. This will make it simpler in the future to change the way the
  deduction is done. In patch #6, do this for deduction from nexthop group
  info to RIF.

- In patch #7, add a helper to destroy a RIF. So far RIF was destroyed
  simply by kfree'ing it.

- In patch #8, add a helper to check if any IP addresses are configured on
  a netdevice. This helper will be useful later.

- In patch #9, add a helper to migrate a RIF. This will be a convenient
  place to put extensions later on.

- Patch #10 move IPIP initialization up to make ipip_ops_arr available
  earlier.

Petr Machata (10):
  mlxsw: spectrum_router: Extract a helper from
    mlxsw_sp_port_vlan_router_join()
  mlxsw: spectrum_router: Add a helper specifically for joining a LAG
  mlxsw: spectrum_router: Access rif->dev through a helper
  mlxsw: spectrum_router: Access rif->dev from params in
    mlxsw_sp_rif_create()
  mlxsw: spectrum_router: Access nh->rif->dev through a helper
  mlxsw: spectrum_router: Access nhgi->rif through a helper
  mlxsw: spectrum_router: Extract a helper to free a RIF
  mlxsw: spectrum_router: Add a helper to check if netdev has addresses
  mlxsw: spectrum_router: Extract a helper for RIF migration
  mlxsw: spectrum_router: Move IPIP init up

 .../net/ethernet/mellanox/mlxsw/spectrum.c    |   4 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |   4 -
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 311 ++++++++++++------
 .../ethernet/mellanox/mlxsw/spectrum_router.h |   3 +
 4 files changed, 212 insertions(+), 110 deletions(-)

-- 
2.40.1


             reply	other threads:[~2023-06-12 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 15:30 Petr Machata [this message]
2023-06-12 15:31 ` [PATCH net-next 01/10] mlxsw: spectrum_router: Extract a helper from mlxsw_sp_port_vlan_router_join() Petr Machata
2023-06-12 15:31 ` [PATCH net-next 02/10] mlxsw: spectrum_router: Add a helper specifically for joining a LAG Petr Machata
2023-06-12 15:31 ` [PATCH net-next 03/10] mlxsw: spectrum_router: Access rif->dev through a helper Petr Machata
2023-06-12 15:31 ` [PATCH net-next 04/10] mlxsw: spectrum_router: Access rif->dev from params in mlxsw_sp_rif_create() Petr Machata
2023-06-14 11:22   ` Paolo Abeni
2023-06-14 13:13     ` Petr Machata
2023-06-12 15:31 ` [PATCH net-next 05/10] mlxsw: spectrum_router: Access nh->rif->dev through a helper Petr Machata
2023-06-12 15:31 ` [PATCH net-next 06/10] mlxsw: spectrum_router: Access nhgi->rif " Petr Machata
2023-06-12 15:31 ` [PATCH net-next 07/10] mlxsw: spectrum_router: Extract a helper to free a RIF Petr Machata
2023-06-12 15:31 ` [PATCH net-next 08/10] mlxsw: spectrum_router: Add a helper to check if netdev has addresses Petr Machata
2023-06-12 15:31 ` [PATCH net-next 09/10] mlxsw: spectrum_router: Extract a helper for RIF migration Petr Machata
2023-06-12 15:31 ` [PATCH net-next 10/10] mlxsw: spectrum_router: Move IPIP init up Petr Machata
2023-06-14 11:30 ` [PATCH net-next 00/10] mlxsw: Preparations for out-of-order-operations patches patchwork-bot+netdevbpf

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=cover.1686581444.git.petrm@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=amcohen@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).