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 846d6da1fc ("net/mlx5e: Fix division by 0 in
 mlx5e_select_queue") and commit 84c8a87402 ("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.
 
 =======================
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGhZs6bAKwk/OTgTpSD+KveBX+j4FAmILSJwACgkQSD+KveBX
 +j6BjwgAj4tGNrIuR8wByLq7gFG+h8t/A80TkqxgNHFhYuF3u6bS6UnmymCAsM3F
 G8jFott6Pu/4d7SQvksrtVQJvTTj+TinZFeLGNxYXLwm/Syk6Avbs2c02eDL1CbQ
 fUE4HavgwpS+hp8xvdWOUH+i5b+e7I+iF6JC/K0LULHUhXaJ7BXiQi3qCm7DKwLm
 gVdWzDHNBj73Xmxak71CH0b79qdIBMs0JlZjdizE++8vg/AZ8CY2G51UUTmjJk5h
 YASXBigbmGAP5o30IWxjYaj51UQTmWmR5A1XhNIC4iVdWjFOPcz6k8M5EfB0ADq+
 eXkQKGDiyMDddKAaor611K0n9H4Ogw==
 =SDns
 -----END PGP SIGNATURE-----

Merge tag 'mlx5-updates-2022-02-14' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
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 846d6da1fc ("net/mlx5e: Fix division by 0 in
mlx5e_select_queue") and commit 84c8a87402 ("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.

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

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

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2022-02-15 10:35:09 +00:00
commit 9b3e446cd0
17 changed files with 480 additions and 232 deletions