Skip to content

Commit 0371310

Browse files
cjubranrleon
authored andcommitted
net/mlx5: Add support for new scheduling elements
Introduce new scheduling elements in the E-Switch QoS hierarchy to enhance traffic management capabilities. This patch adds support for: - Rate Limit scheduling elements: Enables bandwidth limitation across multiple nodes without a shared ancestor, providing a mechanism for more granular control of bandwidth allocation. - Traffic Class Transmit Scheduling Arbiter (TSAR): Introduces the infrastructure for creating Traffic Class TSARs, allowing hierarchical arbitration based on traffic classes. - Traffic Class Arbiter TSAR: Adds support for a TSAR capable of managing arbitration between multiple traffic classes, enabling improved bandwidth prioritization and traffic management. No functional changes are introduced in this patch. Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent e799ac9 commit 0371310

File tree

2 files changed

+15
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

2 files changed

+15
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/rl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ bool mlx5_qos_tsar_type_supported(struct mlx5_core_dev *dev, int type, u8 hierar
5656
return cap & TSAR_TYPE_CAP_MASK_ROUND_ROBIN;
5757
case TSAR_ELEMENT_TSAR_TYPE_ETS:
5858
return cap & TSAR_TYPE_CAP_MASK_ETS;
59+
case TSAR_ELEMENT_TSAR_TYPE_TC_ARB:
60+
return cap & TSAR_TYPE_CAP_MASK_TC_ARB;
5961
}
6062

6163
return false;
@@ -87,6 +89,8 @@ bool mlx5_qos_element_type_supported(struct mlx5_core_dev *dev, int type, u8 hie
8789
return cap & ELEMENT_TYPE_CAP_MASK_PARA_VPORT_TC;
8890
case SCHEDULING_CONTEXT_ELEMENT_TYPE_QUEUE_GROUP:
8991
return cap & ELEMENT_TYPE_CAP_MASK_QUEUE_GROUP;
92+
case SCHEDULING_CONTEXT_ELEMENT_TYPE_RATE_LIMIT:
93+
return cap & ELEMENT_TYPE_CAP_MASK_RATE_LIMIT;
9094
}
9195

9296
return false;

include/linux/mlx5/mlx5_ifc.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,8 @@ struct mlx5_ifc_qos_cap_bits {
11031103

11041104
u8 packet_pacing_min_rate[0x20];
11051105

1106-
u8 reserved_at_80[0x10];
1106+
u8 reserved_at_80[0xb];
1107+
u8 log_esw_max_rate_limit[0x5];
11071108
u8 packet_pacing_rate_table_size[0x10];
11081109

11091110
u8 esw_element_type[0x10];
@@ -4104,6 +4105,7 @@ enum {
41044105
SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT_TC = 0x2,
41054106
SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3,
41064107
SCHEDULING_CONTEXT_ELEMENT_TYPE_QUEUE_GROUP = 0x4,
4108+
SCHEDULING_CONTEXT_ELEMENT_TYPE_RATE_LIMIT = 0x5,
41074109
};
41084110

41094111
enum {
@@ -4112,22 +4114,26 @@ enum {
41124114
ELEMENT_TYPE_CAP_MASK_VPORT_TC = 1 << 2,
41134115
ELEMENT_TYPE_CAP_MASK_PARA_VPORT_TC = 1 << 3,
41144116
ELEMENT_TYPE_CAP_MASK_QUEUE_GROUP = 1 << 4,
4117+
ELEMENT_TYPE_CAP_MASK_RATE_LIMIT = 1 << 5,
41154118
};
41164119

41174120
enum {
41184121
TSAR_ELEMENT_TSAR_TYPE_DWRR = 0x0,
41194122
TSAR_ELEMENT_TSAR_TYPE_ROUND_ROBIN = 0x1,
41204123
TSAR_ELEMENT_TSAR_TYPE_ETS = 0x2,
4124+
TSAR_ELEMENT_TSAR_TYPE_TC_ARB = 0x3,
41214125
};
41224126

41234127
enum {
41244128
TSAR_TYPE_CAP_MASK_DWRR = 1 << 0,
41254129
TSAR_TYPE_CAP_MASK_ROUND_ROBIN = 1 << 1,
41264130
TSAR_TYPE_CAP_MASK_ETS = 1 << 2,
4131+
TSAR_TYPE_CAP_MASK_TC_ARB = 1 << 3,
41274132
};
41284133

41294134
struct mlx5_ifc_tsar_element_bits {
4130-
u8 reserved_at_0[0x8];
4135+
u8 traffic_class[0x4];
4136+
u8 reserved_at_4[0x4];
41314137
u8 tsar_type[0x8];
41324138
u8 reserved_at_10[0x10];
41334139
};
@@ -4164,7 +4170,9 @@ struct mlx5_ifc_scheduling_context_bits {
41644170

41654171
u8 max_average_bw[0x20];
41664172

4167-
u8 reserved_at_e0[0x120];
4173+
u8 max_bw_obj_id[0x20];
4174+
4175+
u8 reserved_at_100[0x100];
41684176
};
41694177

41704178
struct mlx5_ifc_rqtc_bits {

0 commit comments

Comments
 (0)