OSDN Git Service

net/mlx5e: Do not update SBCM when prio2buffer command is invalid
authorMaher Sanalla <msanalla@nvidia.com>
Tue, 9 May 2023 14:56:01 +0000 (17:56 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 25 May 2023 03:44:17 +0000 (20:44 -0700)
commit623efc4cbd6115db36716e31037cb6d1f3ce6754
treefaa6c62150b7c1516b37d3ede3ca26dba9495c2d
parent81fe2be062915e2a2fdc494c3cd90e946e946c25
net/mlx5e: Do not update SBCM when prio2buffer command is invalid

The shared buffer pools configuration which are stored in the SBCM
register are updated when the user changes the prio2buffer mapping.

However, in case the user desired prio2buffer change is invalid,
which can occur due to mapping a lossless priority to a not large enough
buffer, the SBCM update should not be performed, as the user command is
failed.

Thus, Perform the SBCM update only after xoff threshold calculation is
performed and the user prio2buffer mapping is validated.

Fixes: a440030d8946 ("net/mlx5e: Update shared buffer along with device buffer changes")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c