summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h
diff options
context:
space:
mode:
authorMaher Sanalla <msanalla@nvidia.com>2022-11-28 19:03:07 +0200
committerSaeed Mahameed <saeedm@nvidia.com>2023-01-10 21:24:40 -0800
commita440030d8946bfe3fd44b6da685e33ffe0ecd1ff (patch)
tree89487e0d838101f86d750b66af9e2e170a872bef /drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h
parent11f0996d5c6023f4889882c8d088ec76a050d704 (diff)
downloadlinux-stable-a440030d8946bfe3fd44b6da685e33ffe0ecd1ff.tar.gz
linux-stable-a440030d8946bfe3fd44b6da685e33ffe0ecd1ff.tar.bz2
linux-stable-a440030d8946bfe3fd44b6da685e33ffe0ecd1ff.zip
net/mlx5e: Update shared buffer along with device buffer changes
Currently, the user can modify device's receive buffer size, modify the mapping between QoS priority groups to buffers and change the buffer state to become lossy/lossless via pfc command. However, the shared receive buffer pool alignments, as a result of such commands, is performed only when the shared buffer is in FW ownership. When a user changes the mapping of priority groups or buffer size, the shared buffer is moved to SW ownership. Therefore, for devices that support shared buffer, handle the shared buffer alignments in accordance to user's desired configurations. Meaning, the following will be performed: 1. For every change of buffer's headroom, recalculate the size of shared buffer to be equal to "total_buffer_size" - "new_headroom_size". The new shared buffer size will be split in ratio of 3:1 between lossy and lossless pools, respectively. 2. For each port buffer change, count the number of lossless buffers. If there is only one lossless buffer, then set its lossless pool usage threshold to be infinite. Otherwise, if there is more than one lossless buffer, set a usage threshold for each lossless buffer. While at it, add more verbosity to debug prints when handling user commands, to assist in future debug. Signed-off-by: Maher Sanalla <msanalla@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h b/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h
index 80af7a5ac604..a6ef118de758 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h
@@ -60,6 +60,7 @@ struct mlx5e_bufferx_reg {
struct mlx5e_port_buffer {
u32 port_buffer_size;
u32 spare_buffer_size;
+ u32 headroom_size;
struct mlx5e_bufferx_reg buffer[MLX5E_MAX_BUFFER];
};