All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Jiri Pirko <jiri@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>
Subject: [pull request][net-next 00/15] mlx5 updates 2021-03-16
Date: Tue, 16 Mar 2021 16:50:57 -0700	[thread overview]
Message-ID: <20210316235112.72626-1-saeed@kernel.org> (raw)

From: Saeed Mahameed <saeedm@nvidia.com>

Hi Dave, Jakub,

This patchset refactors mlx5 Switchdev uplink representor to use the
same netdev as the NIC native mode.

Please note there is one trivial non-mlx5 patch in this series:
net: Change dev parameter to const in netif_device_present()
all the others are pure mlx5 changes.

For more information please see tag log below.

Please pull and let me know if there is any problem.

Thanks,
Saeed.

---
The following changes since commit 5a30833b9a16f8d1aa15de06636f9317ca51f9df:

  net: dsa: mt7530: support MDB and bridge flag operations (2021-03-16 11:54:41 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2021-03-16

for you to fetch changes up to 7dc84de98babc709910947b24e8cd1c2e01c7857:

  net/mlx5: E-Switch, Protect changing mode while adding rules (2021-03-16 16:48:43 -0700)

----------------------------------------------------------------
mlx5-updates-2021-03-16

mlx5 uplink representor netdev persistence.

Before this patchset we used to have separate netdevs for Native NIC mode
and Switchdev mode (uplink representor netdev), meaning that if user
switches modes between Native to Switchdev and vice versa, the driver
would cleanup the current netdev representor and create a new one for the
new mode, such behavior created an administrative nightmare for users,
where users need to be aware of such loss of both data path and control
path configurations, e.g. netdev attributes and arp/route tables,
where the later is more painful.

A simple solution for this is not to replace the netdev in first place
and use a single netdev to serve the uplink/physical port whether it is
in switchdev mode or native mode.

We already have different HW profiles for each netdev mode, in this series
we just replace the HW profile on the fly and we keep the same netdev
attached.

Refactoring: Some refactoring has been made to overcome some technical
difficulties
1) The netdev is created with the maximum amount of tx/rx queues to serve
the two profiles.

2) Some ndos are not supported in some modes, so we added a mode check for
   such cases, e.g legacy sriov ndos must be blocked in switchdev mode.

3) Some mlx5 netdev private attributes need to be moved out of profiles
   and kept in a persistent place, where the netdev is created
   e.g devlink port and other global HW resources

4) The netdev devlink port is now always registered with the switch id

Implementation: the last three patches implement the mechanism now as the
netdev can be shared.

5) Don't recreate the netdev on switchdev mode changes
6) Prevent changing switchdev mode when some netdev operations
are active, mostly when TC rules are being processed.
This is required since the netdev is kept registered while switchdev mode
can be changed.

----------------------------------------------------------------
Roi Dayan (14):
      net: Change dev parameter to const in netif_device_present()
      net/mlx5e: Allow legacy vf ndos only if in legacy mode
      net/mlx5e: Distinguish nic and esw offload in tc setup block cb
      net/mlx5e: Add offload stats ndos to nic netdev ops
      net/mlx5e: Use nic mode netdev ndos and ethtool ops for uplink representor
      net/mlx5e: Verify dev is present in some ndos
      net/mlx5e: Move devlink port register and unregister calls
      net/mlx5e: Register nic devlink port with switch id
      net/mlx5: Move mlx5e hw resources into a sub object
      net/mlx5: Move devlink port from mlx5e priv to mlx5e resources
      net/mlx5e: Unregister eth-reps devices first
      net/mlx5e: Do not reload ethernet ports when changing eswitch mode
      net/mlx5: E-Switch, Change mode lock from mutex to rw semaphore
      net/mlx5: E-Switch, Protect changing mode while adding rules

Saeed Mahameed (1):
      net/mlx5e: Same max num channels for both nic and uplink profiles

 drivers/net/ethernet/mellanox/mlx5/core/dev.c      |   3 -
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |   2 +-
 .../net/ethernet/mellanox/mlx5/core/en/devlink.c   |  38 ++-
 .../net/ethernet/mellanox/mlx5/core/en/devlink.h   |   6 +
 drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c   |   4 +-
 .../net/ethernet/mellanox/mlx5/core/en/rep/tc.c    |   6 +
 .../ethernet/mellanox/mlx5/core/en/reporter_rx.c   |   5 +-
 .../ethernet/mellanox/mlx5/core/en/reporter_tx.c   |   5 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/trap.c  |   6 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c |   2 +-
 .../net/ethernet/mellanox/mlx5/core/en_common.c    |  27 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c    |   7 +
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  | 114 ++++++--
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   | 286 ++++++++-------------
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.h   |   9 +
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   5 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  19 +-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  | 138 +++++++++-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h  |  18 +-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |  51 ++--
 .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c  |   2 +-
 .../net/ethernet/mellanox/mlx5/core/lib/crypto.c   |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h |   9 +
 include/linux/mlx5/driver.h                        |  12 +-
 include/linux/netdevice.h                          |   2 +-
 25 files changed, 502 insertions(+), 276 deletions(-)

             reply	other threads:[~2021-03-16 23:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 23:50 Saeed Mahameed [this message]
2021-03-16 23:50 ` [net-next 01/15] net: Change dev parameter to const in netif_device_present() Saeed Mahameed
2021-03-16 23:50 ` [net-next 02/15] net/mlx5e: Same max num channels for both nic and uplink profiles Saeed Mahameed
2021-03-16 23:51 ` [net-next 03/15] net/mlx5e: Allow legacy vf ndos only if in legacy mode Saeed Mahameed
2021-03-16 23:51 ` [net-next 04/15] net/mlx5e: Distinguish nic and esw offload in tc setup block cb Saeed Mahameed
2021-03-16 23:51 ` [net-next 05/15] net/mlx5e: Add offload stats ndos to nic netdev ops Saeed Mahameed
2021-03-16 23:51 ` [net-next 06/15] net/mlx5e: Use nic mode netdev ndos and ethtool ops for uplink representor Saeed Mahameed
2021-03-16 23:51 ` [net-next 07/15] net/mlx5e: Verify dev is present in some ndos Saeed Mahameed
2021-03-16 23:51 ` [net-next 08/15] net/mlx5e: Move devlink port register and unregister calls Saeed Mahameed
2021-03-16 23:51 ` [net-next 09/15] net/mlx5e: Register nic devlink port with switch id Saeed Mahameed
2021-03-16 23:51 ` [net-next 10/15] net/mlx5: Move mlx5e hw resources into a sub object Saeed Mahameed
2021-03-16 23:51 ` [net-next 11/15] net/mlx5: Move devlink port from mlx5e priv to mlx5e resources Saeed Mahameed
2021-03-16 23:51 ` [net-next 12/15] net/mlx5e: Unregister eth-reps devices first Saeed Mahameed
2021-03-16 23:51 ` [net-next 13/15] net/mlx5e: Do not reload ethernet ports when changing eswitch mode Saeed Mahameed
2021-03-16 23:51 ` [net-next 14/15] net/mlx5: E-Switch, Change mode lock from mutex to rw semaphore Saeed Mahameed
2021-03-16 23:51 ` [net-next 15/15] net/mlx5: E-Switch, Protect changing mode while adding rules Saeed Mahameed

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=20210316235112.72626-1-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.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 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.