summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/qos.c
diff options
context:
space:
mode:
authorCarolina Jubran <cjubran@nvidia.com>2024-10-08 21:32:22 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-10-10 13:12:00 +0200
commite1013c792960324d9780f11acd88c5b2ed7747c5 (patch)
treed65dbe2b1f59ec12a03a36fd6b98a019d5017428 /drivers/net/ethernet/mellanox/mlx5/core/qos.c
parentf91c69f43c545f46f256d907d55d24d06a4ac8f5 (diff)
downloadlinux-e1013c792960324d9780f11acd88c5b2ed7747c5.tar.gz
linux-e1013c792960324d9780f11acd88c5b2ed7747c5.tar.bz2
linux-e1013c792960324d9780f11acd88c5b2ed7747c5.zip
net/mlx5: Add support check for TSAR types in QoS scheduling
Introduce a new function, mlx5_qos_tsar_type_supported(), to handle the validation of TSAR types within QoS scheduling contexts. Refactor the existing code to use this new function, replacing direct checks for TSAR type support in the NIC scheduling hierarchy. Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/qos.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/qos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/qos.c
index 4d353da3eb7b..6be9981bb6b1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/qos.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/qos.c
@@ -52,7 +52,9 @@ int mlx5_qos_create_inner_node(struct mlx5_core_dev *mdev, u32 parent_id,
if (!mlx5_qos_element_type_supported(mdev,
SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR,
SCHEDULING_HIERARCHY_NIC) ||
- !(MLX5_CAP_QOS(mdev, nic_tsar_type) & TSAR_TYPE_CAP_MASK_DWRR))
+ !mlx5_qos_tsar_type_supported(mdev,
+ TSAR_ELEMENT_TSAR_TYPE_DWRR,
+ SCHEDULING_HIERARCHY_NIC))
return -EOPNOTSUPP;
MLX5_SET(scheduling_context, sched_ctx, parent_element_id, parent_id);