netdev.vger.kernel.org archive mirror
 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, Tariq Toukan <tariqt@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [pull request][net-next 00/15] mlx5 updates 2022-02-14
Date: Mon, 14 Feb 2022 22:32:14 -0800	[thread overview]
Message-ID: <20220215063229.737960-1-saeed@kernel.org> (raw)

From: Saeed Mahameed <saeedm@nvidia.com>

Hi Dave, Hi Jakub,

This series TX updates for mlx5e netdev driver.
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 d0b78ab1ca357628ffb92cf8a0af00b4ffdc4e3b:

  net: dsa: mv88e6xxx: Fix validation of built-in PHYs on 6095/6097 (2022-02-14 21:13:54 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2022-02-14

for you to fetch changes up to 71753b8ec103fd71d6ee90e522d797ccf978e4ed:

  net/mlx5e: Optimize the common case condition in mlx5e_select_queue (2022-02-14 22:30:52 -0800)

----------------------------------------------------------------
mlx5-updates-2022-02-14

mlx5 TX routines improvements

1) From Aya and Tariq, first 3 patches, Use the Max size of the TX descriptor
as advertised by the device and not the fixed value of 16 that the driver
always assumed, this is not a bug fix as all existing devices have Max value
larger than 16, but the series is necessary for future proofing the driver.

2) TX Synchronization improvements from Maxim, last 12 patches

Maxim Mikityanskiy Says:
=======================
mlx5e: Synchronize ndo_select_queue with configuration changes

The kernel can call ndo_select_queue at any time, and there is no direct
way to block it. The implementation of ndo_select_queue in mlx5e expects
the parameters to be consistent and may crash (invalid pointer, division
by zero) if they aren't.

There were attempts to partially fix some of the most frequent crashes,
see commit 846d6da1fcdb ("net/mlx5e: Fix division by 0 in
mlx5e_select_queue") and commit 84c8a87402cf ("net/mlx5e: Fix division
by 0 in mlx5e_select_queue for representors"). However, they don't
address the issue completely.

This series introduces the proper synchronization mechanism between
mlx5e configuration and TX data path:

1. txq2sq updates are synchronized properly with ndo_start_xmit
   (mlx5e_xmit). The TX queue is stopped when it configuration is being
   updated, and memory barriers ensure the changes are visible before
   restarting.

2. The set of parameters needed for mlx5e_select_queue is reduced, and
   synchronization using RCU is implemented. This way, changes are
   atomic, and the state in mlx5e_select_queue is always consistent.

3. A few optimizations are applied to the new implementation of
   mlx5e_select_queue.

=======================

----------------------------------------------------------------
Aya Levin (2):
      net/mlx5e: Read max WQEBBs on the SQ from firmware
      net/mlx5e: Use FW limitation for max MPW WQEBBs

Maxim Mikityanskiy (12):
      net/mlx5e: Cleanup of start/stop all queues
      net/mlx5e: Disable TX queues before registering the netdev
      net/mlx5e: Use a barrier after updating txq2sq
      net/mlx5e: Sync txq2sq updates with mlx5e_xmit for HTB queues
      net/mlx5e: Introduce select queue parameters
      net/mlx5e: Move mlx5e_select_queue to en/selq.c
      net/mlx5e: Use select queue parameters to sync with control flow
      net/mlx5e: Move repeating code that gets TC prio into a function
      net/mlx5e: Use READ_ONCE/WRITE_ONCE for DCBX trust state
      net/mlx5e: Optimize mlx5e_select_queue
      net/mlx5e: Optimize modulo in mlx5e_select_queue
      net/mlx5e: Optimize the common case condition in mlx5e_select_queue

Tariq Toukan (1):
      net/mlx5e: Remove unused tstamp SQ field

 drivers/net/ethernet/mellanox/mlx5/core/Makefile   |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  43 +++-
 .../net/ethernet/mellanox/mlx5/core/en/params.c    |  10 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c   |   3 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/qos.c   |  42 +++-
 drivers/net/ethernet/mellanox/mlx5/core/en/selq.c  | 231 +++++++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/en/selq.h  |  51 +++++
 drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h  |  47 ++---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c   |   8 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h   |   7 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c |   6 +-
 .../mellanox/mlx5/core/en_accel/tls_rxtx.c         |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c |  12 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  | 113 +++++-----
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |   5 -
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    | 128 ++----------
 17 files changed, 480 insertions(+), 232 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/selq.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/selq.h

             reply	other threads:[~2022-02-15  6:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  6:32 Saeed Mahameed [this message]
2022-02-15  6:32 ` [net-next 01/15] net/mlx5e: Remove unused tstamp SQ field Saeed Mahameed
2022-02-15 10:50   ` patchwork-bot+netdevbpf
2022-02-15  6:32 ` [net-next 02/15] net/mlx5e: Read max WQEBBs on the SQ from firmware Saeed Mahameed
2022-02-15  6:32 ` [net-next 03/15] net/mlx5e: Use FW limitation for max MPW WQEBBs Saeed Mahameed
2022-02-15  6:32 ` [net-next 04/15] net/mlx5e: Cleanup of start/stop all queues Saeed Mahameed
2022-02-15  6:32 ` [net-next 05/15] net/mlx5e: Disable TX queues before registering the netdev Saeed Mahameed
2022-02-15  6:32 ` [net-next 06/15] net/mlx5e: Use a barrier after updating txq2sq Saeed Mahameed
2022-02-15  6:32 ` [net-next 07/15] net/mlx5e: Sync txq2sq updates with mlx5e_xmit for HTB queues Saeed Mahameed
2022-02-15  6:32 ` [net-next 08/15] net/mlx5e: Introduce select queue parameters Saeed Mahameed
2022-02-15  6:32 ` [net-next 09/15] net/mlx5e: Move mlx5e_select_queue to en/selq.c Saeed Mahameed
2022-02-15  6:32 ` [net-next 10/15] net/mlx5e: Use select queue parameters to sync with control flow Saeed Mahameed
2022-02-15  6:32 ` [net-next 11/15] net/mlx5e: Move repeating code that gets TC prio into a function Saeed Mahameed
2022-02-15  6:32 ` [net-next 12/15] net/mlx5e: Use READ_ONCE/WRITE_ONCE for DCBX trust state Saeed Mahameed
2022-02-15  6:32 ` [net-next 13/15] net/mlx5e: Optimize mlx5e_select_queue Saeed Mahameed
2022-02-15  6:32 ` [net-next 14/15] net/mlx5e: Optimize modulo in mlx5e_select_queue Saeed Mahameed
2022-02-15  6:32 ` [net-next 15/15] net/mlx5e: Optimize the common case condition " 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=20220215063229.737960-1-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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 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).